From 9e121fa3e3ca4eb17069b14b31e6a705e75ca56c Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 20 Nov 2020 02:13:56 +0000 Subject: [PATCH] CodeGen from PR 11724 in Azure/azure-rest-api-specs [T2] devtestlabs for python track2 (#11724) * python track2 * python --- .../mgmt/devtestlabs/_dev_test_labs_client.py | 1 - .../azure/mgmt/devtestlabs/_metadata.json | 85 +++++++++ .../azure/mgmt/devtestlabs/_version.py | 2 +- .../devtestlabs/aio/_dev_test_labs_client.py | 1 - .../operations/_arm_templates_operations.py | 12 +- .../_artifact_sources_operations.py | 24 +-- .../aio/operations/_artifacts_operations.py | 18 +- .../aio/operations/_costs_operations.py | 14 +- .../operations/_custom_images_operations.py | 48 +++-- .../aio/operations/_disks_operations.py | 74 +++++--- .../operations/_environments_operations.py | 50 ++++-- .../aio/operations/_formulas_operations.py | 39 ++-- .../operations/_gallery_images_operations.py | 8 +- .../_global_schedules_operations.py | 46 +++-- .../aio/operations/_labs_operations.py | 100 +++++++---- .../_notification_channels_operations.py | 28 +-- .../devtestlabs/aio/operations/_operations.py | 8 +- .../aio/operations/_policies_operations.py | 24 +-- .../aio/operations/_policy_sets_operations.py | 12 +- .../_provider_operations_operations.py | 8 +- .../aio/operations/_schedules_operations.py | 37 ++-- .../aio/operations/_secrets_operations.py | 40 +++-- .../_service_fabric_schedules_operations.py | 35 ++-- .../operations/_service_fabrics_operations.py | 74 +++++--- .../operations/_service_runners_operations.py | 14 +- .../aio/operations/_users_operations.py | 48 +++-- .../_virtual_machine_schedules_operations.py | 34 ++-- .../_virtual_machines_operations.py | 169 ++++++++++++++---- .../_virtual_networks_operations.py | 48 +++-- .../models/_dev_test_labs_client_enums.py | 2 +- .../operations/_arm_templates_operations.py | 12 +- .../_artifact_sources_operations.py | 24 +-- .../operations/_artifacts_operations.py | 18 +- .../operations/_costs_operations.py | 14 +- .../operations/_custom_images_operations.py | 48 +++-- .../operations/_disks_operations.py | 74 +++++--- .../operations/_environments_operations.py | 50 ++++-- .../operations/_formulas_operations.py | 39 ++-- .../operations/_gallery_images_operations.py | 8 +- .../_global_schedules_operations.py | 46 +++-- .../operations/_labs_operations.py | 100 +++++++---- .../_notification_channels_operations.py | 28 +-- .../devtestlabs/operations/_operations.py | 8 +- .../operations/_policies_operations.py | 24 +-- .../operations/_policy_sets_operations.py | 12 +- .../_provider_operations_operations.py | 8 +- .../operations/_schedules_operations.py | 37 ++-- .../operations/_secrets_operations.py | 40 +++-- .../_service_fabric_schedules_operations.py | 35 ++-- .../operations/_service_fabrics_operations.py | 74 +++++--- .../operations/_service_runners_operations.py | 14 +- .../operations/_users_operations.py | 48 +++-- .../_virtual_machine_schedules_operations.py | 34 ++-- .../_virtual_machines_operations.py | 169 ++++++++++++++---- .../_virtual_networks_operations.py | 48 +++-- 55 files changed, 1399 insertions(+), 716 deletions(-) create mode 100644 sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/_metadata.json diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/_dev_test_labs_client.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/_dev_test_labs_client.py index 292b59cccf08..268f3340e2cf 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/_dev_test_labs_client.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/_dev_test_labs_client.py @@ -122,7 +122,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.provider_operations = ProviderOperationsOperations( diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/_metadata.json b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/_metadata.json new file mode 100644 index 000000000000..abe1464a4869 --- /dev/null +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/_metadata.json @@ -0,0 +1,85 @@ +{ + "chosen_version": "2018-09-15", + "total_api_version_list": ["2018-09-15"], + "client": { + "name": "DevTestLabsClient", + "filename": "_dev_test_labs_client", + "description": "The DevTest Labs Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true, + "client_side_validation": true + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "The subscription ID.", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "signature": "credential, # type: \"AsyncTokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "The subscription ID.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id" + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null + }, + "operation_groups": { + "provider_operations": "ProviderOperationsOperations", + "labs": "LabsOperations", + "operations": "Operations", + "global_schedules": "GlobalSchedulesOperations", + "artifact_sources": "ArtifactSourcesOperations", + "arm_templates": "ArmTemplatesOperations", + "artifacts": "ArtifactsOperations", + "costs": "CostsOperations", + "custom_images": "CustomImagesOperations", + "formulas": "FormulasOperations", + "gallery_images": "GalleryImagesOperations", + "notification_channels": "NotificationChannelsOperations", + "policy_sets": "PolicySetsOperations", + "policies": "PoliciesOperations", + "schedules": "SchedulesOperations", + "service_runners": "ServiceRunnersOperations", + "users": "UsersOperations", + "disks": "DisksOperations", + "environments": "EnvironmentsOperations", + "secrets": "SecretsOperations", + "service_fabrics": "ServiceFabricsOperations", + "service_fabric_schedules": "ServiceFabricSchedulesOperations", + "virtual_machines": "VirtualMachinesOperations", + "virtual_machine_schedules": "VirtualMachineSchedulesOperations", + "virtual_networks": "VirtualNetworksOperations" + }, + "operation_mixins": { + }, + "sync_imports": "None", + "async_imports": "None" +} \ No newline at end of file diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/_version.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/_version.py index 6dddc002d43d..c47f66669f1b 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/_version.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "9.0.0b1" +VERSION = "1.0.0" diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/_dev_test_labs_client.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/_dev_test_labs_client.py index e54b913aa64a..aacf53a777e0 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/_dev_test_labs_client.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/_dev_test_labs_client.py @@ -119,7 +119,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.provider_operations = ProviderOperationsOperations( diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_arm_templates_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_arm_templates_operations.py index bbd46145249e..55850951470a 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_arm_templates_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_arm_templates_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ArmTemplatesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -51,7 +51,7 @@ def list( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.ArmTemplateList"]: + ) -> AsyncIterable["_models.ArmTemplateList"]: """List azure resource manager templates in a given artifact source. :param resource_group_name: The name of the resource group. @@ -74,7 +74,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.devtestlabs.models.ArmTemplateList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ArmTemplateList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArmTemplateList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -148,7 +148,7 @@ async def get( name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ArmTemplate": + ) -> "_models.ArmTemplate": """Get azure resource manager template. :param resource_group_name: The name of the resource group. @@ -166,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.devtestlabs.models.ArmTemplate :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ArmTemplate"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArmTemplate"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_artifact_sources_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_artifact_sources_operations.py index 5126af1c28fc..aad52c573238 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_artifact_sources_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_artifact_sources_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ArtifactSourcesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -50,7 +50,7 @@ def list( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.ArtifactSourceList"]: + ) -> AsyncIterable["_models.ArtifactSourceList"]: """List artifact sources in a given lab. :param resource_group_name: The name of the resource group. @@ -71,7 +71,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.devtestlabs.models.ArtifactSourceList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ArtifactSourceList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactSourceList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -143,7 +143,7 @@ async def get( name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ArtifactSource": + ) -> "_models.ArtifactSource": """Get artifact source. :param resource_group_name: The name of the resource group. @@ -159,7 +159,7 @@ async def get( :rtype: ~azure.mgmt.devtestlabs.models.ArtifactSource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ArtifactSource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactSource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -208,9 +208,9 @@ async def create_or_update( resource_group_name: str, lab_name: str, name: str, - artifact_source: "models.ArtifactSource", + artifact_source: "_models.ArtifactSource", **kwargs - ) -> "models.ArtifactSource": + ) -> "_models.ArtifactSource": """Create or replace an existing artifact source. :param resource_group_name: The name of the resource group. @@ -226,7 +226,7 @@ async def create_or_update( :rtype: ~azure.mgmt.devtestlabs.models.ArtifactSource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ArtifactSource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactSource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -341,9 +341,9 @@ async def update( resource_group_name: str, lab_name: str, name: str, - artifact_source: "models.ArtifactSourceFragment", + artifact_source: "_models.ArtifactSourceFragment", **kwargs - ) -> "models.ArtifactSource": + ) -> "_models.ArtifactSource": """Allows modifying tags of artifact sources. All other properties will be ignored. :param resource_group_name: The name of the resource group. @@ -359,7 +359,7 @@ async def update( :rtype: ~azure.mgmt.devtestlabs.models.ArtifactSource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ArtifactSource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactSource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_artifacts_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_artifacts_operations.py index e42f9f846e49..68bed6059bde 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_artifacts_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_artifacts_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ArtifactsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -51,7 +51,7 @@ def list( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.ArtifactList"]: + ) -> AsyncIterable["_models.ArtifactList"]: """List artifacts in a given artifact source. :param resource_group_name: The name of the resource group. @@ -74,7 +74,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.devtestlabs.models.ArtifactList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ArtifactList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -148,7 +148,7 @@ async def get( name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Artifact": + ) -> "_models.Artifact": """Get artifact. :param resource_group_name: The name of the resource group. @@ -166,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.devtestlabs.models.Artifact :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Artifact"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Artifact"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,9 +217,9 @@ async def generate_arm_template( lab_name: str, artifact_source_name: str, name: str, - generate_arm_template_request: "models.GenerateArmTemplateRequest", + generate_arm_template_request: "_models.GenerateArmTemplateRequest", **kwargs - ) -> "models.ArmTemplateInfo": + ) -> "_models.ArmTemplateInfo": """Generates an ARM template for the given artifact, uploads the required files to a storage account, and validates the generated artifact. @@ -239,7 +239,7 @@ async def generate_arm_template( :rtype: ~azure.mgmt.devtestlabs.models.ArmTemplateInfo :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ArmTemplateInfo"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArmTemplateInfo"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_costs_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_costs_operations.py index 0567c9b01f89..86a66ff8307c 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_costs_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_costs_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class CostsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( name: str, expand: Optional[str] = None, **kwargs - ) -> "models.LabCost": + ) -> "_models.LabCost": """Get cost. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.devtestlabs.models.LabCost :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LabCost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LabCost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,9 +112,9 @@ async def create_or_update( resource_group_name: str, lab_name: str, name: str, - lab_cost: "models.LabCost", + lab_cost: "_models.LabCost", **kwargs - ) -> "models.LabCost": + ) -> "_models.LabCost": """Create or replace an existing cost. :param resource_group_name: The name of the resource group. @@ -130,7 +130,7 @@ async def create_or_update( :rtype: ~azure.mgmt.devtestlabs.models.LabCost :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LabCost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LabCost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_custom_images_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_custom_images_operations.py index 79391a07726b..67cad5bcf5b0 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_custom_images_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_custom_images_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class CustomImagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -52,7 +52,7 @@ def list( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.CustomImageList"]: + ) -> AsyncIterable["_models.CustomImageList"]: """List custom images in a given lab. :param resource_group_name: The name of the resource group. @@ -73,7 +73,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.devtestlabs.models.CustomImageList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CustomImageList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomImageList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def get( name: str, expand: Optional[str] = None, **kwargs - ) -> "models.CustomImage": + ) -> "_models.CustomImage": """Get custom image. :param resource_group_name: The name of the resource group. @@ -161,7 +161,7 @@ async def get( :rtype: ~azure.mgmt.devtestlabs.models.CustomImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CustomImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +210,10 @@ async def _create_or_update_initial( resource_group_name: str, lab_name: str, name: str, - custom_image: "models.CustomImage", + custom_image: "_models.CustomImage", **kwargs - ) -> "models.CustomImage": - cls = kwargs.pop('cls', None) # type: ClsType["models.CustomImage"] + ) -> "_models.CustomImage": + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +269,9 @@ async def begin_create_or_update( resource_group_name: str, lab_name: str, name: str, - custom_image: "models.CustomImage", + custom_image: "_models.CustomImage", **kwargs - ) -> AsyncLROPoller["models.CustomImage"]: + ) -> AsyncLROPoller["_models.CustomImage"]: """Create or replace an existing custom image. This operation can take a while to complete. :param resource_group_name: The name of the resource group. @@ -293,7 +293,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.CustomImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomImage"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +319,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -427,7 +434,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -446,9 +460,9 @@ async def update( resource_group_name: str, lab_name: str, name: str, - custom_image: "models.CustomImageFragment", + custom_image: "_models.CustomImageFragment", **kwargs - ) -> "models.CustomImage": + ) -> "_models.CustomImage": """Allows modifying tags of custom images. All other properties will be ignored. :param resource_group_name: The name of the resource group. @@ -464,7 +478,7 @@ async def update( :rtype: ~azure.mgmt.devtestlabs.models.CustomImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CustomImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_disks_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_disks_operations.py index ae1c4caaf1fd..02cb285e430a 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_disks_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_disks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class DisksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -53,7 +53,7 @@ def list( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.DiskList"]: + ) -> AsyncIterable["_models.DiskList"]: """List disks in a given user profile. :param resource_group_name: The name of the resource group. @@ -76,7 +76,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.devtestlabs.models.DiskList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -150,7 +150,7 @@ async def get( name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Disk": + ) -> "_models.Disk": """Get disk. :param resource_group_name: The name of the resource group. @@ -168,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.devtestlabs.models.Disk :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,10 +219,10 @@ async def _create_or_update_initial( lab_name: str, user_name: str, name: str, - disk: "models.Disk", + disk: "_models.Disk", **kwargs - ) -> "models.Disk": - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + ) -> "_models.Disk": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -280,9 +280,9 @@ async def begin_create_or_update( lab_name: str, user_name: str, name: str, - disk: "models.Disk", + disk: "_models.Disk", **kwargs - ) -> AsyncLROPoller["models.Disk"]: + ) -> AsyncLROPoller["_models.Disk"]: """Create or replace an existing disk. This operation can take a while to complete. :param resource_group_name: The name of the resource group. @@ -306,7 +306,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -333,7 +333,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'userName': self._serialize.url("user_name", user_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -447,7 +455,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'userName': self._serialize.url("user_name", user_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -467,9 +483,9 @@ async def update( lab_name: str, user_name: str, name: str, - disk: "models.DiskFragment", + disk: "_models.DiskFragment", **kwargs - ) -> "models.Disk": + ) -> "_models.Disk": """Allows modifying tags of disks. All other properties will be ignored. :param resource_group_name: The name of the resource group. @@ -487,7 +503,7 @@ async def update( :rtype: ~azure.mgmt.devtestlabs.models.Disk :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -550,7 +566,7 @@ async def _attach_initial( } error_map.update(kwargs.pop('error_map', {})) - _attach_disk_properties = models.AttachDiskProperties(leased_by_lab_vm_id=leased_by_lab_vm_id) + _attach_disk_properties = _models.AttachDiskProperties(leased_by_lab_vm_id=leased_by_lab_vm_id) api_version = "2018-09-15" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -649,7 +665,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'userName': self._serialize.url("user_name", user_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -678,7 +702,7 @@ async def _detach_initial( } error_map.update(kwargs.pop('error_map', {})) - _detach_disk_properties = models.DetachDiskProperties(leased_by_lab_vm_id=leased_by_lab_vm_id) + _detach_disk_properties = _models.DetachDiskProperties(leased_by_lab_vm_id=leased_by_lab_vm_id) api_version = "2018-09-15" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -776,7 +800,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'userName': self._serialize.url("user_name", user_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_environments_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_environments_operations.py index 31055f2c1d3c..06d7746ab9ef 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_environments_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_environments_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class EnvironmentsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -53,7 +53,7 @@ def list( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.DtlEnvironmentList"]: + ) -> AsyncIterable["_models.DtlEnvironmentList"]: """List environments in a given user profile. :param resource_group_name: The name of the resource group. @@ -76,7 +76,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.devtestlabs.models.DtlEnvironmentList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DtlEnvironmentList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DtlEnvironmentList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -150,7 +150,7 @@ async def get( name: str, expand: Optional[str] = None, **kwargs - ) -> "models.DtlEnvironment": + ) -> "_models.DtlEnvironment": """Get environment. :param resource_group_name: The name of the resource group. @@ -168,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.devtestlabs.models.DtlEnvironment :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DtlEnvironment"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DtlEnvironment"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,10 +219,10 @@ async def _create_or_update_initial( lab_name: str, user_name: str, name: str, - dtl_environment: "models.DtlEnvironment", + dtl_environment: "_models.DtlEnvironment", **kwargs - ) -> "models.DtlEnvironment": - cls = kwargs.pop('cls', None) # type: ClsType["models.DtlEnvironment"] + ) -> "_models.DtlEnvironment": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DtlEnvironment"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -280,9 +280,9 @@ async def begin_create_or_update( lab_name: str, user_name: str, name: str, - dtl_environment: "models.DtlEnvironment", + dtl_environment: "_models.DtlEnvironment", **kwargs - ) -> AsyncLROPoller["models.DtlEnvironment"]: + ) -> AsyncLROPoller["_models.DtlEnvironment"]: """Create or replace an existing environment. This operation can take a while to complete. :param resource_group_name: The name of the resource group. @@ -306,7 +306,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DtlEnvironment"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DtlEnvironment"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -333,7 +333,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'userName': self._serialize.url("user_name", user_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -447,7 +455,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'userName': self._serialize.url("user_name", user_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -467,9 +483,9 @@ async def update( lab_name: str, user_name: str, name: str, - dtl_environment: "models.DtlEnvironmentFragment", + dtl_environment: "_models.DtlEnvironmentFragment", **kwargs - ) -> "models.DtlEnvironment": + ) -> "_models.DtlEnvironment": """Allows modifying tags of environments. All other properties will be ignored. :param resource_group_name: The name of the resource group. @@ -487,7 +503,7 @@ async def update( :rtype: ~azure.mgmt.devtestlabs.models.DtlEnvironment :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DtlEnvironment"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DtlEnvironment"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_formulas_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_formulas_operations.py index 048079b19692..2753d74534f9 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_formulas_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_formulas_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class FormulasOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -52,7 +52,7 @@ def list( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.FormulaList"]: + ) -> AsyncIterable["_models.FormulaList"]: """List formulas in a given lab. :param resource_group_name: The name of the resource group. @@ -73,7 +73,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.devtestlabs.models.FormulaList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FormulaList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FormulaList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def get( name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Formula": + ) -> "_models.Formula": """Get formula. :param resource_group_name: The name of the resource group. @@ -161,7 +161,7 @@ async def get( :rtype: ~azure.mgmt.devtestlabs.models.Formula :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Formula"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Formula"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +210,10 @@ async def _create_or_update_initial( resource_group_name: str, lab_name: str, name: str, - formula: "models.Formula", + formula: "_models.Formula", **kwargs - ) -> "models.Formula": - cls = kwargs.pop('cls', None) # type: ClsType["models.Formula"] + ) -> "_models.Formula": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Formula"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +269,9 @@ async def begin_create_or_update( resource_group_name: str, lab_name: str, name: str, - formula: "models.Formula", + formula: "_models.Formula", **kwargs - ) -> AsyncLROPoller["models.Formula"]: + ) -> AsyncLROPoller["_models.Formula"]: """Create or replace an existing formula. This operation can take a while to complete. :param resource_group_name: The name of the resource group. @@ -293,7 +293,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Formula"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Formula"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +319,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -397,9 +404,9 @@ async def update( resource_group_name: str, lab_name: str, name: str, - formula: "models.FormulaFragment", + formula: "_models.FormulaFragment", **kwargs - ) -> "models.Formula": + ) -> "_models.Formula": """Allows modifying tags of formulas. All other properties will be ignored. :param resource_group_name: The name of the resource group. @@ -415,7 +422,7 @@ async def update( :rtype: ~azure.mgmt.devtestlabs.models.Formula :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Formula"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Formula"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_gallery_images_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_gallery_images_operations.py index 539efa80c500..3b30158b713e 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_gallery_images_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_gallery_images_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class GalleryImagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -50,7 +50,7 @@ def list( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.GalleryImageList"]: + ) -> AsyncIterable["_models.GalleryImageList"]: """List gallery images in a given lab. :param resource_group_name: The name of the resource group. @@ -71,7 +71,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.devtestlabs.models.GalleryImageList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_global_schedules_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_global_schedules_operations.py index 4019f53b532b..a0bb8f037e5d 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_global_schedules_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_global_schedules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class GlobalSchedulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -50,7 +50,7 @@ def list_by_subscription( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.ScheduleList"]: + ) -> AsyncIterable["_models.ScheduleList"]: """List schedules in a subscription. :param expand: Specify the $expand query. Example: 'properties($select=status)'. @@ -67,7 +67,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.devtestlabs.models.ScheduleList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ScheduleList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduleList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -138,7 +138,7 @@ def list_by_resource_group( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.ScheduleList"]: + ) -> AsyncIterable["_models.ScheduleList"]: """List schedules in a resource group. :param resource_group_name: The name of the resource group. @@ -157,7 +157,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.devtestlabs.models.ScheduleList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ScheduleList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduleList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -227,7 +227,7 @@ async def get( name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Schedule": + ) -> "_models.Schedule": """Get schedule. :param resource_group_name: The name of the resource group. @@ -241,7 +241,7 @@ async def get( :rtype: ~azure.mgmt.devtestlabs.models.Schedule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Schedule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,9 +288,9 @@ async def create_or_update( self, resource_group_name: str, name: str, - schedule: "models.Schedule", + schedule: "_models.Schedule", **kwargs - ) -> "models.Schedule": + ) -> "_models.Schedule": """Create or replace an existing schedule. :param resource_group_name: The name of the resource group. @@ -304,7 +304,7 @@ async def create_or_update( :rtype: ~azure.mgmt.devtestlabs.models.Schedule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Schedule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -413,9 +413,9 @@ async def update( self, resource_group_name: str, name: str, - schedule: "models.ScheduleFragment", + schedule: "_models.ScheduleFragment", **kwargs - ) -> "models.Schedule": + ) -> "_models.Schedule": """Allows modifying tags of schedules. All other properties will be ignored. :param resource_group_name: The name of the resource group. @@ -429,7 +429,7 @@ async def update( :rtype: ~azure.mgmt.devtestlabs.models.Schedule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Schedule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -563,7 +563,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -591,7 +597,7 @@ async def _retarget_initial( } error_map.update(kwargs.pop('error_map', {})) - _retarget_schedule_properties = models.RetargetScheduleProperties(current_resource_id=current_resource_id, target_resource_id=target_resource_id) + _retarget_schedule_properties = _models.RetargetScheduleProperties(current_resource_id=current_resource_id, target_resource_id=target_resource_id) api_version = "2018-09-15" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -684,7 +690,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_labs_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_labs_operations.py index 99ebefaa0499..a705d8403efc 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_labs_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_labs_operations.py @@ -17,7 +17,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -36,7 +36,7 @@ class LabsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -51,7 +51,7 @@ def list_by_subscription( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.LabList"]: + ) -> AsyncIterable["_models.LabList"]: """List labs in a subscription. :param expand: Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. @@ -68,7 +68,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.devtestlabs.models.LabList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LabList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LabList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -139,7 +139,7 @@ def list_by_resource_group( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.LabList"]: + ) -> AsyncIterable["_models.LabList"]: """List labs in a resource group. :param resource_group_name: The name of the resource group. @@ -158,7 +158,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.devtestlabs.models.LabList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LabList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LabList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,7 +228,7 @@ async def get( name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Lab": + ) -> "_models.Lab": """Get lab. :param resource_group_name: The name of the resource group. @@ -242,7 +242,7 @@ async def get( :rtype: ~azure.mgmt.devtestlabs.models.Lab :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Lab"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Lab"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -289,10 +289,10 @@ async def _create_or_update_initial( self, resource_group_name: str, name: str, - lab: "models.Lab", + lab: "_models.Lab", **kwargs - ) -> "models.Lab": - cls = kwargs.pop('cls', None) # type: ClsType["models.Lab"] + ) -> "_models.Lab": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Lab"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -346,9 +346,9 @@ async def begin_create_or_update( self, resource_group_name: str, name: str, - lab: "models.Lab", + lab: "_models.Lab", **kwargs - ) -> AsyncLROPoller["models.Lab"]: + ) -> AsyncLROPoller["_models.Lab"]: """Create or replace an existing lab. This operation can take a while to complete. :param resource_group_name: The name of the resource group. @@ -368,7 +368,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Lab"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Lab"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -393,7 +393,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -495,7 +501,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -513,9 +525,9 @@ async def update( self, resource_group_name: str, name: str, - lab: "models.LabFragment", + lab: "_models.LabFragment", **kwargs - ) -> "models.Lab": + ) -> "_models.Lab": """Allows modifying tags of labs. All other properties will be ignored. :param resource_group_name: The name of the resource group. @@ -529,7 +541,7 @@ async def update( :rtype: ~azure.mgmt.devtestlabs.models.Lab :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Lab"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Lab"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -664,7 +676,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -682,7 +700,7 @@ async def _create_environment_initial( self, resource_group_name: str, name: str, - lab_virtual_machine_creation_parameter: "models.LabVirtualMachineCreationParameter", + lab_virtual_machine_creation_parameter: "_models.LabVirtualMachineCreationParameter", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -732,7 +750,7 @@ async def begin_create_environment( self, resource_group_name: str, name: str, - lab_virtual_machine_creation_parameter: "models.LabVirtualMachineCreationParameter", + lab_virtual_machine_creation_parameter: "_models.LabVirtualMachineCreationParameter", **kwargs ) -> AsyncLROPoller[None]: """Create virtual machines in a lab. This operation can take a while to complete. @@ -776,7 +794,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -804,7 +828,7 @@ async def _export_resource_usage_initial( } error_map.update(kwargs.pop('error_map', {})) - _export_resource_usage_parameters = models.ExportResourceUsageParameters(blob_storage_absolute_sas_uri=blob_storage_absolute_sas_uri, usage_start_date=usage_start_date) + _export_resource_usage_parameters = _models.ExportResourceUsageParameters(blob_storage_absolute_sas_uri=blob_storage_absolute_sas_uri, usage_start_date=usage_start_date) api_version = "2018-09-15" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -898,7 +922,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -918,7 +948,7 @@ async def generate_upload_uri( name: str, blob_name: Optional[str] = None, **kwargs - ) -> "models.GenerateUploadUriResponse": + ) -> "_models.GenerateUploadUriResponse": """Generate a URI for uploading custom disk images to a Lab. :param resource_group_name: The name of the resource group. @@ -932,13 +962,13 @@ async def generate_upload_uri( :rtype: ~azure.mgmt.devtestlabs.models.GenerateUploadUriResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GenerateUploadUriResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GenerateUploadUriResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - _generate_upload_uri_parameter = models.GenerateUploadUriParameter(blob_name=blob_name) + _generate_upload_uri_parameter = _models.GenerateUploadUriParameter(blob_name=blob_name) api_version = "2018-09-15" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -994,7 +1024,7 @@ async def _import_virtual_machine_initial( } error_map.update(kwargs.pop('error_map', {})) - _import_lab_virtual_machine_request = models.ImportLabVirtualMachineRequest(source_virtual_machine_resource_id=source_virtual_machine_resource_id, destination_virtual_machine_name=destination_virtual_machine_name) + _import_lab_virtual_machine_request = _models.ImportLabVirtualMachineRequest(source_virtual_machine_resource_id=source_virtual_machine_resource_id, destination_virtual_machine_name=destination_virtual_machine_name) api_version = "2018-09-15" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1087,7 +1117,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1106,7 +1142,7 @@ def list_vhds( resource_group_name: str, name: str, **kwargs - ) -> AsyncIterable["models.LabVhdList"]: + ) -> AsyncIterable["_models.LabVhdList"]: """List disk images available for custom image creation. :param resource_group_name: The name of the resource group. @@ -1118,7 +1154,7 @@ def list_vhds( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.devtestlabs.models.LabVhdList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LabVhdList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LabVhdList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_notification_channels_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_notification_channels_operations.py index 7b60051f0015..be21cb67a36a 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_notification_channels_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_notification_channels_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NotificationChannelsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -50,7 +50,7 @@ def list( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.NotificationChannelList"]: + ) -> AsyncIterable["_models.NotificationChannelList"]: """List notification channels in a given lab. :param resource_group_name: The name of the resource group. @@ -71,7 +71,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.devtestlabs.models.NotificationChannelList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NotificationChannelList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NotificationChannelList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -143,7 +143,7 @@ async def get( name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NotificationChannel": + ) -> "_models.NotificationChannel": """Get notification channel. :param resource_group_name: The name of the resource group. @@ -159,7 +159,7 @@ async def get( :rtype: ~azure.mgmt.devtestlabs.models.NotificationChannel :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NotificationChannel"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NotificationChannel"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -208,9 +208,9 @@ async def create_or_update( resource_group_name: str, lab_name: str, name: str, - notification_channel: "models.NotificationChannel", + notification_channel: "_models.NotificationChannel", **kwargs - ) -> "models.NotificationChannel": + ) -> "_models.NotificationChannel": """Create or replace an existing notification channel. :param resource_group_name: The name of the resource group. @@ -226,7 +226,7 @@ async def create_or_update( :rtype: ~azure.mgmt.devtestlabs.models.NotificationChannel :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NotificationChannel"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NotificationChannel"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -341,9 +341,9 @@ async def update( resource_group_name: str, lab_name: str, name: str, - notification_channel: "models.NotificationChannelFragment", + notification_channel: "_models.NotificationChannelFragment", **kwargs - ) -> "models.NotificationChannel": + ) -> "_models.NotificationChannel": """Allows modifying tags of notification channels. All other properties will be ignored. :param resource_group_name: The name of the resource group. @@ -359,7 +359,7 @@ async def update( :rtype: ~azure.mgmt.devtestlabs.models.NotificationChannel :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NotificationChannel"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NotificationChannel"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -411,7 +411,7 @@ async def notify( resource_group_name: str, lab_name: str, name: str, - event_name: Optional[Union[str, "models.NotificationChannelEventType"]] = None, + event_name: Optional[Union[str, "_models.NotificationChannelEventType"]] = None, json_payload: Optional[str] = None, **kwargs ) -> None: @@ -438,7 +438,7 @@ async def notify( } error_map.update(kwargs.pop('error_map', {})) - _notify_parameters = models.NotifyParameters(event_name=event_name, json_payload=json_payload) + _notify_parameters = _models.NotifyParameters(event_name=event_name, json_payload=json_payload) api_version = "2018-09-15" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_operations.py index 6ff3deb4a7e3..cbefde857aa9 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ async def get( location_name: str, name: str, **kwargs - ) -> "models.OperationResult": + ) -> "_models.OperationResult": """Get operation. :param location_name: The name of the location. @@ -57,7 +57,7 @@ async def get( :rtype: ~azure.mgmt.devtestlabs.models.OperationResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_policies_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_policies_operations.py index c726733e32c2..86b3eeb89d69 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_policies_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_policies_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class PoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -51,7 +51,7 @@ def list( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.PolicyList"]: + ) -> AsyncIterable["_models.PolicyList"]: """List policies in a given policy set. :param resource_group_name: The name of the resource group. @@ -74,7 +74,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.devtestlabs.models.PolicyList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PolicyList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PolicyList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -148,7 +148,7 @@ async def get( name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Policy": + ) -> "_models.Policy": """Get policy. :param resource_group_name: The name of the resource group. @@ -166,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.devtestlabs.models.Policy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Policy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Policy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,9 +217,9 @@ async def create_or_update( lab_name: str, policy_set_name: str, name: str, - policy: "models.Policy", + policy: "_models.Policy", **kwargs - ) -> "models.Policy": + ) -> "_models.Policy": """Create or replace an existing policy. :param resource_group_name: The name of the resource group. @@ -237,7 +237,7 @@ async def create_or_update( :rtype: ~azure.mgmt.devtestlabs.models.Policy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Policy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Policy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -358,9 +358,9 @@ async def update( lab_name: str, policy_set_name: str, name: str, - policy: "models.PolicyFragment", + policy: "_models.PolicyFragment", **kwargs - ) -> "models.Policy": + ) -> "_models.Policy": """Allows modifying tags of policies. All other properties will be ignored. :param resource_group_name: The name of the resource group. @@ -378,7 +378,7 @@ async def update( :rtype: ~azure.mgmt.devtestlabs.models.Policy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Policy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Policy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_policy_sets_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_policy_sets_operations.py index 91cc5dbb77ef..1fc63e77dfc8 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_policy_sets_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_policy_sets_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class PolicySetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ async def evaluate_policies( resource_group_name: str, lab_name: str, name: str, - policies: Optional[List["models.EvaluatePoliciesProperties"]] = None, + policies: Optional[List["_models.EvaluatePoliciesProperties"]] = None, **kwargs - ) -> "models.EvaluatePoliciesResponse": + ) -> "_models.EvaluatePoliciesResponse": """Evaluates lab policy. :param resource_group_name: The name of the resource group. @@ -63,13 +63,13 @@ async def evaluate_policies( :rtype: ~azure.mgmt.devtestlabs.models.EvaluatePoliciesResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EvaluatePoliciesResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EvaluatePoliciesResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - _evaluate_policies_request = models.EvaluatePoliciesRequest(policies=policies) + _evaluate_policies_request = _models.EvaluatePoliciesRequest(policies=policies) api_version = "2018-09-15" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_provider_operations_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_provider_operations_operations.py index f5035d65d74f..abea508b6cca 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_provider_operations_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_provider_operations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ProviderOperationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ProviderOperationResult"]: + ) -> AsyncIterable["_models.ProviderOperationResult"]: """Result of the request to list REST API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.devtestlabs.models.ProviderOperationResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProviderOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProviderOperationResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_schedules_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_schedules_operations.py index fd89fbddb16f..5f2c79aea70d 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_schedules_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_schedules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SchedulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -52,7 +52,7 @@ def list( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.ScheduleList"]: + ) -> AsyncIterable["_models.ScheduleList"]: """List schedules in a given lab. :param resource_group_name: The name of the resource group. @@ -73,7 +73,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.devtestlabs.models.ScheduleList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ScheduleList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduleList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def get( name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Schedule": + ) -> "_models.Schedule": """Get schedule. :param resource_group_name: The name of the resource group. @@ -161,7 +161,7 @@ async def get( :rtype: ~azure.mgmt.devtestlabs.models.Schedule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Schedule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,9 +210,9 @@ async def create_or_update( resource_group_name: str, lab_name: str, name: str, - schedule: "models.Schedule", + schedule: "_models.Schedule", **kwargs - ) -> "models.Schedule": + ) -> "_models.Schedule": """Create or replace an existing schedule. :param resource_group_name: The name of the resource group. @@ -228,7 +228,7 @@ async def create_or_update( :rtype: ~azure.mgmt.devtestlabs.models.Schedule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Schedule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -343,9 +343,9 @@ async def update( resource_group_name: str, lab_name: str, name: str, - schedule: "models.ScheduleFragment", + schedule: "_models.ScheduleFragment", **kwargs - ) -> "models.Schedule": + ) -> "_models.Schedule": """Allows modifying tags of schedules. All other properties will be ignored. :param resource_group_name: The name of the resource group. @@ -361,7 +361,7 @@ async def update( :rtype: ~azure.mgmt.devtestlabs.models.Schedule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Schedule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -502,7 +502,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -522,7 +529,7 @@ def list_applicable( lab_name: str, name: str, **kwargs - ) -> AsyncIterable["models.ScheduleList"]: + ) -> AsyncIterable["_models.ScheduleList"]: """Lists all applicable schedules. :param resource_group_name: The name of the resource group. @@ -536,7 +543,7 @@ def list_applicable( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.devtestlabs.models.ScheduleList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ScheduleList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduleList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_secrets_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_secrets_operations.py index d3dd7ea288b2..880c4f793811 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_secrets_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_secrets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SecretsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -53,7 +53,7 @@ def list( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.SecretList"]: + ) -> AsyncIterable["_models.SecretList"]: """List secrets in a given user profile. :param resource_group_name: The name of the resource group. @@ -76,7 +76,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.devtestlabs.models.SecretList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecretList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecretList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -150,7 +150,7 @@ async def get( name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Secret": + ) -> "_models.Secret": """Get secret. :param resource_group_name: The name of the resource group. @@ -168,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.devtestlabs.models.Secret :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Secret"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Secret"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,10 +219,10 @@ async def _create_or_update_initial( lab_name: str, user_name: str, name: str, - secret: "models.Secret", + secret: "_models.Secret", **kwargs - ) -> "models.Secret": - cls = kwargs.pop('cls', None) # type: ClsType["models.Secret"] + ) -> "_models.Secret": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Secret"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -280,9 +280,9 @@ async def begin_create_or_update( lab_name: str, user_name: str, name: str, - secret: "models.Secret", + secret: "_models.Secret", **kwargs - ) -> AsyncLROPoller["models.Secret"]: + ) -> AsyncLROPoller["_models.Secret"]: """Create or replace an existing secret. This operation can take a while to complete. :param resource_group_name: The name of the resource group. @@ -306,7 +306,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Secret"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Secret"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -333,7 +333,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'userName': self._serialize.url("user_name", user_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -419,7 +427,7 @@ async def update( tags: Optional[Dict[str, str]] = None, value: Optional[str] = None, **kwargs - ) -> "models.Secret": + ) -> "_models.Secret": """Allows modifying tags of secrets. All other properties will be ignored. :param resource_group_name: The name of the resource group. @@ -439,13 +447,13 @@ async def update( :rtype: ~azure.mgmt.devtestlabs.models.Secret :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Secret"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Secret"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - _secret = models.SecretFragment(tags=tags, value=value) + _secret = _models.SecretFragment(tags=tags, value=value) api_version = "2018-09-15" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_service_fabric_schedules_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_service_fabric_schedules_operations.py index 72341482c578..1ed377f38b03 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_service_fabric_schedules_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_service_fabric_schedules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ServiceFabricSchedulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -54,7 +54,7 @@ def list( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.ScheduleList"]: + ) -> AsyncIterable["_models.ScheduleList"]: """List schedules in a given service fabric. :param resource_group_name: The name of the resource group. @@ -79,7 +79,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.devtestlabs.models.ScheduleList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ScheduleList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduleList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -155,7 +155,7 @@ async def get( name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Schedule": + ) -> "_models.Schedule": """Get schedule. :param resource_group_name: The name of the resource group. @@ -175,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.devtestlabs.models.Schedule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Schedule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,9 +228,9 @@ async def create_or_update( user_name: str, service_fabric_name: str, name: str, - schedule: "models.Schedule", + schedule: "_models.Schedule", **kwargs - ) -> "models.Schedule": + ) -> "_models.Schedule": """Create or replace an existing schedule. :param resource_group_name: The name of the resource group. @@ -250,7 +250,7 @@ async def create_or_update( :rtype: ~azure.mgmt.devtestlabs.models.Schedule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Schedule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -377,9 +377,9 @@ async def update( user_name: str, service_fabric_name: str, name: str, - schedule: "models.ScheduleFragment", + schedule: "_models.ScheduleFragment", **kwargs - ) -> "models.Schedule": + ) -> "_models.Schedule": """Allows modifying tags of schedules. All other properties will be ignored. :param resource_group_name: The name of the resource group. @@ -399,7 +399,7 @@ async def update( :rtype: ~azure.mgmt.devtestlabs.models.Schedule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Schedule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -554,7 +554,16 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'userName': self._serialize.url("user_name", user_name, 'str'), + 'serviceFabricName': self._serialize.url("service_fabric_name", service_fabric_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_service_fabrics_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_service_fabrics_operations.py index bf7173702644..4fa19e38d269 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_service_fabrics_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_service_fabrics_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ServiceFabricsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -53,7 +53,7 @@ def list( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.ServiceFabricList"]: + ) -> AsyncIterable["_models.ServiceFabricList"]: """List service fabrics in a given user profile. :param resource_group_name: The name of the resource group. @@ -76,7 +76,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.devtestlabs.models.ServiceFabricList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceFabricList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceFabricList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -150,7 +150,7 @@ async def get( name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ServiceFabric": + ) -> "_models.ServiceFabric": """Get service fabric. :param resource_group_name: The name of the resource group. @@ -168,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.devtestlabs.models.ServiceFabric :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceFabric"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceFabric"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,10 +219,10 @@ async def _create_or_update_initial( lab_name: str, user_name: str, name: str, - service_fabric: "models.ServiceFabric", + service_fabric: "_models.ServiceFabric", **kwargs - ) -> "models.ServiceFabric": - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceFabric"] + ) -> "_models.ServiceFabric": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceFabric"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -280,9 +280,9 @@ async def begin_create_or_update( lab_name: str, user_name: str, name: str, - service_fabric: "models.ServiceFabric", + service_fabric: "_models.ServiceFabric", **kwargs - ) -> AsyncLROPoller["models.ServiceFabric"]: + ) -> AsyncLROPoller["_models.ServiceFabric"]: """Create or replace an existing service fabric. This operation can take a while to complete. :param resource_group_name: The name of the resource group. @@ -306,7 +306,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceFabric"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceFabric"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -333,7 +333,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'userName': self._serialize.url("user_name", user_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -447,7 +455,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'userName': self._serialize.url("user_name", user_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -467,9 +483,9 @@ async def update( lab_name: str, user_name: str, name: str, - service_fabric: "models.ServiceFabricFragment", + service_fabric: "_models.ServiceFabricFragment", **kwargs - ) -> "models.ServiceFabric": + ) -> "_models.ServiceFabric": """Allows modifying tags of service fabrics. All other properties will be ignored. :param resource_group_name: The name of the resource group. @@ -487,7 +503,7 @@ async def update( :rtype: ~azure.mgmt.devtestlabs.models.ServiceFabric :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceFabric"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceFabric"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -542,7 +558,7 @@ async def list_applicable_schedules( user_name: str, name: str, **kwargs - ) -> "models.ApplicableSchedule": + ) -> "_models.ApplicableSchedule": """Lists the applicable start/stop schedules, if any. :param resource_group_name: The name of the resource group. @@ -558,7 +574,7 @@ async def list_applicable_schedules( :rtype: ~azure.mgmt.devtestlabs.models.ApplicableSchedule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicableSchedule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicableSchedule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -701,7 +717,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'userName': self._serialize.url("user_name", user_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -815,7 +839,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'userName': self._serialize.url("user_name", user_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_service_runners_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_service_runners_operations.py index b7aff3227fea..e43f7fa34dac 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_service_runners_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_service_runners_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ServiceRunnersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def get( lab_name: str, name: str, **kwargs - ) -> "models.ServiceRunner": + ) -> "_models.ServiceRunner": """Get service runner. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.devtestlabs.models.ServiceRunner :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceRunner"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceRunner"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,9 +107,9 @@ async def create_or_update( resource_group_name: str, lab_name: str, name: str, - service_runner: "models.ServiceRunner", + service_runner: "_models.ServiceRunner", **kwargs - ) -> "models.ServiceRunner": + ) -> "_models.ServiceRunner": """Create or replace an existing service runner. :param resource_group_name: The name of the resource group. @@ -125,7 +125,7 @@ async def create_or_update( :rtype: ~azure.mgmt.devtestlabs.models.ServiceRunner :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceRunner"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceRunner"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_users_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_users_operations.py index ef122d6cc603..1705b9b08454 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_users_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_users_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class UsersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -52,7 +52,7 @@ def list( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.UserList"]: + ) -> AsyncIterable["_models.UserList"]: """List user profiles in a given lab. :param resource_group_name: The name of the resource group. @@ -73,7 +73,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.devtestlabs.models.UserList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UserList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UserList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def get( name: str, expand: Optional[str] = None, **kwargs - ) -> "models.User": + ) -> "_models.User": """Get user profile. :param resource_group_name: The name of the resource group. @@ -161,7 +161,7 @@ async def get( :rtype: ~azure.mgmt.devtestlabs.models.User :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.User"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +210,10 @@ async def _create_or_update_initial( resource_group_name: str, lab_name: str, name: str, - user: "models.User", + user: "_models.User", **kwargs - ) -> "models.User": - cls = kwargs.pop('cls', None) # type: ClsType["models.User"] + ) -> "_models.User": + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +269,9 @@ async def begin_create_or_update( resource_group_name: str, lab_name: str, name: str, - user: "models.User", + user: "_models.User", **kwargs - ) -> AsyncLROPoller["models.User"]: + ) -> AsyncLROPoller["_models.User"]: """Create or replace an existing user profile. This operation can take a while to complete. :param resource_group_name: The name of the resource group. @@ -293,7 +293,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.User"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +319,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -427,7 +434,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -446,9 +460,9 @@ async def update( resource_group_name: str, lab_name: str, name: str, - user: "models.UserFragment", + user: "_models.UserFragment", **kwargs - ) -> "models.User": + ) -> "_models.User": """Allows modifying tags of user profiles. All other properties will be ignored. :param resource_group_name: The name of the resource group. @@ -464,7 +478,7 @@ async def update( :rtype: ~azure.mgmt.devtestlabs.models.User :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.User"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_virtual_machine_schedules_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_virtual_machine_schedules_operations.py index c72628131fdf..dab93e3eb69b 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_virtual_machine_schedules_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_virtual_machine_schedules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachineSchedulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -53,7 +53,7 @@ def list( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.ScheduleList"]: + ) -> AsyncIterable["_models.ScheduleList"]: """List schedules in a given virtual machine. :param resource_group_name: The name of the resource group. @@ -76,7 +76,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.devtestlabs.models.ScheduleList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ScheduleList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduleList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -150,7 +150,7 @@ async def get( name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Schedule": + ) -> "_models.Schedule": """Get schedule. :param resource_group_name: The name of the resource group. @@ -168,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.devtestlabs.models.Schedule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Schedule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,9 +219,9 @@ async def create_or_update( lab_name: str, virtual_machine_name: str, name: str, - schedule: "models.Schedule", + schedule: "_models.Schedule", **kwargs - ) -> "models.Schedule": + ) -> "_models.Schedule": """Create or replace an existing schedule. :param resource_group_name: The name of the resource group. @@ -239,7 +239,7 @@ async def create_or_update( :rtype: ~azure.mgmt.devtestlabs.models.Schedule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Schedule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -360,9 +360,9 @@ async def update( lab_name: str, virtual_machine_name: str, name: str, - schedule: "models.ScheduleFragment", + schedule: "_models.ScheduleFragment", **kwargs - ) -> "models.Schedule": + ) -> "_models.Schedule": """Allows modifying tags of schedules. All other properties will be ignored. :param resource_group_name: The name of the resource group. @@ -380,7 +380,7 @@ async def update( :rtype: ~azure.mgmt.devtestlabs.models.Schedule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Schedule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -528,7 +528,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_virtual_machines_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_virtual_machines_operations.py index 3fbd6b631c53..b83ef07fa68b 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_virtual_machines_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_virtual_machines_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachinesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -52,7 +52,7 @@ def list( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.LabVirtualMachineList"]: + ) -> AsyncIterable["_models.LabVirtualMachineList"]: """List virtual machines in a given lab. :param resource_group_name: The name of the resource group. @@ -74,7 +74,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.devtestlabs.models.LabVirtualMachineList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LabVirtualMachineList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LabVirtualMachineList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -146,7 +146,7 @@ async def get( name: str, expand: Optional[str] = None, **kwargs - ) -> "models.LabVirtualMachine": + ) -> "_models.LabVirtualMachine": """Get virtual machine. :param resource_group_name: The name of the resource group. @@ -163,7 +163,7 @@ async def get( :rtype: ~azure.mgmt.devtestlabs.models.LabVirtualMachine :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LabVirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LabVirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +212,10 @@ async def _create_or_update_initial( resource_group_name: str, lab_name: str, name: str, - lab_virtual_machine: "models.LabVirtualMachine", + lab_virtual_machine: "_models.LabVirtualMachine", **kwargs - ) -> "models.LabVirtualMachine": - cls = kwargs.pop('cls', None) # type: ClsType["models.LabVirtualMachine"] + ) -> "_models.LabVirtualMachine": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LabVirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -271,9 +271,9 @@ async def begin_create_or_update( resource_group_name: str, lab_name: str, name: str, - lab_virtual_machine: "models.LabVirtualMachine", + lab_virtual_machine: "_models.LabVirtualMachine", **kwargs - ) -> AsyncLROPoller["models.LabVirtualMachine"]: + ) -> AsyncLROPoller["_models.LabVirtualMachine"]: """Create or replace an existing virtual machine. This operation can take a while to complete. :param resource_group_name: The name of the resource group. @@ -295,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LabVirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LabVirtualMachine"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -321,7 +321,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -429,7 +436,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -448,9 +462,9 @@ async def update( resource_group_name: str, lab_name: str, name: str, - lab_virtual_machine: "models.LabVirtualMachineFragment", + lab_virtual_machine: "_models.LabVirtualMachineFragment", **kwargs - ) -> "models.LabVirtualMachine": + ) -> "_models.LabVirtualMachine": """Allows modifying tags of virtual machines. All other properties will be ignored. :param resource_group_name: The name of the resource group. @@ -466,7 +480,7 @@ async def update( :rtype: ~azure.mgmt.devtestlabs.models.LabVirtualMachine :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LabVirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LabVirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -518,7 +532,7 @@ async def _add_data_disk_initial( resource_group_name: str, lab_name: str, name: str, - data_disk_properties: "models.DataDiskProperties", + data_disk_properties: "_models.DataDiskProperties", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -570,7 +584,7 @@ async def begin_add_data_disk( resource_group_name: str, lab_name: str, name: str, - data_disk_properties: "models.DataDiskProperties", + data_disk_properties: "_models.DataDiskProperties", **kwargs ) -> AsyncLROPoller[None]: """Attach a new or existing data disk to virtual machine. This operation can take a while to @@ -619,7 +633,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -638,7 +659,7 @@ async def _apply_artifacts_initial( resource_group_name: str, lab_name: str, name: str, - artifacts: Optional[List["models.ArtifactInstallProperties"]] = None, + artifacts: Optional[List["_models.ArtifactInstallProperties"]] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -647,7 +668,7 @@ async def _apply_artifacts_initial( } error_map.update(kwargs.pop('error_map', {})) - _apply_artifacts_request = models.ApplyArtifactsRequest(artifacts=artifacts) + _apply_artifacts_request = _models.ApplyArtifactsRequest(artifacts=artifacts) api_version = "2018-09-15" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -692,7 +713,7 @@ async def begin_apply_artifacts( resource_group_name: str, lab_name: str, name: str, - artifacts: Optional[List["models.ArtifactInstallProperties"]] = None, + artifacts: Optional[List["_models.ArtifactInstallProperties"]] = None, **kwargs ) -> AsyncLROPoller[None]: """Apply artifacts to virtual machine. This operation can take a while to complete. @@ -739,7 +760,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -847,7 +875,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -875,7 +910,7 @@ async def _detach_data_disk_initial( } error_map.update(kwargs.pop('error_map', {})) - _detach_data_disk_properties = models.DetachDataDiskProperties(existing_lab_disk_id=existing_lab_disk_id) + _detach_data_disk_properties = _models.DetachDataDiskProperties(existing_lab_disk_id=existing_lab_disk_id) api_version = "2018-09-15" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -968,7 +1003,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -988,7 +1030,7 @@ async def get_rdp_file_contents( lab_name: str, name: str, **kwargs - ) -> "models.RdpConnection": + ) -> "_models.RdpConnection": """Gets a string that represents the contents of the RDP file for the virtual machine. :param resource_group_name: The name of the resource group. @@ -1002,7 +1044,7 @@ async def get_rdp_file_contents( :rtype: ~azure.mgmt.devtestlabs.models.RdpConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RdpConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RdpConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1050,7 +1092,7 @@ async def list_applicable_schedules( lab_name: str, name: str, **kwargs - ) -> "models.ApplicableSchedule": + ) -> "_models.ApplicableSchedule": """Lists the applicable start/stop schedules, if any. :param resource_group_name: The name of the resource group. @@ -1064,7 +1106,7 @@ async def list_applicable_schedules( :rtype: ~azure.mgmt.devtestlabs.models.ApplicableSchedule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicableSchedule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicableSchedule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1200,7 +1242,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1228,7 +1277,7 @@ async def _resize_initial( } error_map.update(kwargs.pop('error_map', {})) - _resize_lab_virtual_machine_properties = models.ResizeLabVirtualMachineProperties(size=size) + _resize_lab_virtual_machine_properties = _models.ResizeLabVirtualMachineProperties(size=size) api_version = "2018-09-15" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1320,7 +1369,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1428,7 +1484,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1536,7 +1599,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1644,7 +1714,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1753,7 +1830,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1861,7 +1945,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_virtual_networks_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_virtual_networks_operations.py index a79c53168a85..624b20adfe4c 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_virtual_networks_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/aio/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -52,7 +52,7 @@ def list( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.VirtualNetworkList"]: + ) -> AsyncIterable["_models.VirtualNetworkList"]: """List virtual networks in a given lab. :param resource_group_name: The name of the resource group. @@ -73,7 +73,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.devtestlabs.models.VirtualNetworkList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def get( name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualNetwork": + ) -> "_models.VirtualNetwork": """Get virtual network. :param resource_group_name: The name of the resource group. @@ -161,7 +161,7 @@ async def get( :rtype: ~azure.mgmt.devtestlabs.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +210,10 @@ async def _create_or_update_initial( resource_group_name: str, lab_name: str, name: str, - virtual_network: "models.VirtualNetwork", + virtual_network: "_models.VirtualNetwork", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +269,9 @@ async def begin_create_or_update( resource_group_name: str, lab_name: str, name: str, - virtual_network: "models.VirtualNetwork", + virtual_network: "_models.VirtualNetwork", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Create or replace an existing virtual network. This operation can take a while to complete. :param resource_group_name: The name of the resource group. @@ -293,7 +293,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +319,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -427,7 +434,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -446,9 +460,9 @@ async def update( resource_group_name: str, lab_name: str, name: str, - virtual_network: "models.VirtualNetworkFragment", + virtual_network: "_models.VirtualNetworkFragment", **kwargs - ) -> "models.VirtualNetwork": + ) -> "_models.VirtualNetwork": """Allows modifying tags of virtual networks. All other properties will be ignored. :param resource_group_name: The name of the resource group. @@ -464,7 +478,7 @@ async def update( :rtype: ~azure.mgmt.devtestlabs.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/models/_dev_test_labs_client_enums.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/models/_dev_test_labs_client_enums.py index 177f446ee1c5..e0d3c9005b69 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/models/_dev_test_labs_client_enums.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/models/_dev_test_labs_client_enums.py @@ -50,7 +50,7 @@ class CustomImageOsType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): NONE = "None" class EnableStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """If notifications are enabled for this schedule (i.e. Enabled, Disabled). + """Indicates if the artifact source is enabled (values: Enabled, Disabled). """ ENABLED = "Enabled" diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_arm_templates_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_arm_templates_operations.py index 8409e8ef9a91..a2fca1cf573c 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_arm_templates_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_arm_templates_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ArmTemplatesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -56,7 +56,7 @@ def list( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.ArmTemplateList"] + # type: (...) -> Iterable["_models.ArmTemplateList"] """List azure resource manager templates in a given artifact source. :param resource_group_name: The name of the resource group. @@ -79,7 +79,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.devtestlabs.models.ArmTemplateList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ArmTemplateList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArmTemplateList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -154,7 +154,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ArmTemplate" + # type: (...) -> "_models.ArmTemplate" """Get azure resource manager template. :param resource_group_name: The name of the resource group. @@ -172,7 +172,7 @@ def get( :rtype: ~azure.mgmt.devtestlabs.models.ArmTemplate :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ArmTemplate"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArmTemplate"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_artifact_sources_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_artifact_sources_operations.py index 9335e3ca3fb8..3a2397e3e372 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_artifact_sources_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_artifact_sources_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ArtifactSourcesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -55,7 +55,7 @@ def list( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.ArtifactSourceList"] + # type: (...) -> Iterable["_models.ArtifactSourceList"] """List artifact sources in a given lab. :param resource_group_name: The name of the resource group. @@ -76,7 +76,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.devtestlabs.models.ArtifactSourceList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ArtifactSourceList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactSourceList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -149,7 +149,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ArtifactSource" + # type: (...) -> "_models.ArtifactSource" """Get artifact source. :param resource_group_name: The name of the resource group. @@ -165,7 +165,7 @@ def get( :rtype: ~azure.mgmt.devtestlabs.models.ArtifactSource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ArtifactSource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactSource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,10 +214,10 @@ def create_or_update( resource_group_name, # type: str lab_name, # type: str name, # type: str - artifact_source, # type: "models.ArtifactSource" + artifact_source, # type: "_models.ArtifactSource" **kwargs # type: Any ): - # type: (...) -> "models.ArtifactSource" + # type: (...) -> "_models.ArtifactSource" """Create or replace an existing artifact source. :param resource_group_name: The name of the resource group. @@ -233,7 +233,7 @@ def create_or_update( :rtype: ~azure.mgmt.devtestlabs.models.ArtifactSource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ArtifactSource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactSource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -349,10 +349,10 @@ def update( resource_group_name, # type: str lab_name, # type: str name, # type: str - artifact_source, # type: "models.ArtifactSourceFragment" + artifact_source, # type: "_models.ArtifactSourceFragment" **kwargs # type: Any ): - # type: (...) -> "models.ArtifactSource" + # type: (...) -> "_models.ArtifactSource" """Allows modifying tags of artifact sources. All other properties will be ignored. :param resource_group_name: The name of the resource group. @@ -368,7 +368,7 @@ def update( :rtype: ~azure.mgmt.devtestlabs.models.ArtifactSource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ArtifactSource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactSource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_artifacts_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_artifacts_operations.py index 841f112719c7..c7b21cf36eb6 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_artifacts_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_artifacts_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ArtifactsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -56,7 +56,7 @@ def list( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.ArtifactList"] + # type: (...) -> Iterable["_models.ArtifactList"] """List artifacts in a given artifact source. :param resource_group_name: The name of the resource group. @@ -79,7 +79,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.devtestlabs.models.ArtifactList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ArtifactList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -154,7 +154,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Artifact" + # type: (...) -> "_models.Artifact" """Get artifact. :param resource_group_name: The name of the resource group. @@ -172,7 +172,7 @@ def get( :rtype: ~azure.mgmt.devtestlabs.models.Artifact :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Artifact"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Artifact"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,10 +223,10 @@ def generate_arm_template( lab_name, # type: str artifact_source_name, # type: str name, # type: str - generate_arm_template_request, # type: "models.GenerateArmTemplateRequest" + generate_arm_template_request, # type: "_models.GenerateArmTemplateRequest" **kwargs # type: Any ): - # type: (...) -> "models.ArmTemplateInfo" + # type: (...) -> "_models.ArmTemplateInfo" """Generates an ARM template for the given artifact, uploads the required files to a storage account, and validates the generated artifact. @@ -246,7 +246,7 @@ def generate_arm_template( :rtype: ~azure.mgmt.devtestlabs.models.ArmTemplateInfo :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ArmTemplateInfo"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArmTemplateInfo"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_costs_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_costs_operations.py index 9d9fc0aaaf8b..96861c3efbcf 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_costs_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_costs_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class CostsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.LabCost" + # type: (...) -> "_models.LabCost" """Get cost. :param resource_group_name: The name of the resource group. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.devtestlabs.models.LabCost :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LabCost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LabCost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -117,10 +117,10 @@ def create_or_update( resource_group_name, # type: str lab_name, # type: str name, # type: str - lab_cost, # type: "models.LabCost" + lab_cost, # type: "_models.LabCost" **kwargs # type: Any ): - # type: (...) -> "models.LabCost" + # type: (...) -> "_models.LabCost" """Create or replace an existing cost. :param resource_group_name: The name of the resource group. @@ -136,7 +136,7 @@ def create_or_update( :rtype: ~azure.mgmt.devtestlabs.models.LabCost :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LabCost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LabCost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_custom_images_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_custom_images_operations.py index 839073696c63..af13121d1c49 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_custom_images_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_custom_images_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class CustomImagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -57,7 +57,7 @@ def list( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.CustomImageList"] + # type: (...) -> Iterable["_models.CustomImageList"] """List custom images in a given lab. :param resource_group_name: The name of the resource group. @@ -78,7 +78,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.devtestlabs.models.CustomImageList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CustomImageList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomImageList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.CustomImage" + # type: (...) -> "_models.CustomImage" """Get custom image. :param resource_group_name: The name of the resource group. @@ -167,7 +167,7 @@ def get( :rtype: ~azure.mgmt.devtestlabs.models.CustomImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CustomImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,11 +216,11 @@ def _create_or_update_initial( resource_group_name, # type: str lab_name, # type: str name, # type: str - custom_image, # type: "models.CustomImage" + custom_image, # type: "_models.CustomImage" **kwargs # type: Any ): - # type: (...) -> "models.CustomImage" - cls = kwargs.pop('cls', None) # type: ClsType["models.CustomImage"] + # type: (...) -> "_models.CustomImage" + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -276,10 +276,10 @@ def begin_create_or_update( resource_group_name, # type: str lab_name, # type: str name, # type: str - custom_image, # type: "models.CustomImage" + custom_image, # type: "_models.CustomImage" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.CustomImage"] + # type: (...) -> LROPoller["_models.CustomImage"] """Create or replace an existing custom image. This operation can take a while to complete. :param resource_group_name: The name of the resource group. @@ -301,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.CustomImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomImage"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -327,7 +327,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -437,7 +444,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -456,10 +470,10 @@ def update( resource_group_name, # type: str lab_name, # type: str name, # type: str - custom_image, # type: "models.CustomImageFragment" + custom_image, # type: "_models.CustomImageFragment" **kwargs # type: Any ): - # type: (...) -> "models.CustomImage" + # type: (...) -> "_models.CustomImage" """Allows modifying tags of custom images. All other properties will be ignored. :param resource_group_name: The name of the resource group. @@ -475,7 +489,7 @@ def update( :rtype: ~azure.mgmt.devtestlabs.models.CustomImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CustomImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_disks_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_disks_operations.py index 81f1c54d6c0b..044e1fa10005 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_disks_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_disks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class DisksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -58,7 +58,7 @@ def list( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.DiskList"] + # type: (...) -> Iterable["_models.DiskList"] """List disks in a given user profile. :param resource_group_name: The name of the resource group. @@ -81,7 +81,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.devtestlabs.models.DiskList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -156,7 +156,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Disk" + # type: (...) -> "_models.Disk" """Get disk. :param resource_group_name: The name of the resource group. @@ -174,7 +174,7 @@ def get( :rtype: ~azure.mgmt.devtestlabs.models.Disk :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +225,11 @@ def _create_or_update_initial( lab_name, # type: str user_name, # type: str name, # type: str - disk, # type: "models.Disk" + disk, # type: "_models.Disk" **kwargs # type: Any ): - # type: (...) -> "models.Disk" - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + # type: (...) -> "_models.Disk" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -287,10 +287,10 @@ def begin_create_or_update( lab_name, # type: str user_name, # type: str name, # type: str - disk, # type: "models.Disk" + disk, # type: "_models.Disk" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Disk"] + # type: (...) -> LROPoller["_models.Disk"] """Create or replace an existing disk. This operation can take a while to complete. :param resource_group_name: The name of the resource group. @@ -314,7 +314,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -341,7 +341,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'userName': self._serialize.url("user_name", user_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +465,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'userName': self._serialize.url("user_name", user_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -477,10 +493,10 @@ def update( lab_name, # type: str user_name, # type: str name, # type: str - disk, # type: "models.DiskFragment" + disk, # type: "_models.DiskFragment" **kwargs # type: Any ): - # type: (...) -> "models.Disk" + # type: (...) -> "_models.Disk" """Allows modifying tags of disks. All other properties will be ignored. :param resource_group_name: The name of the resource group. @@ -498,7 +514,7 @@ def update( :rtype: ~azure.mgmt.devtestlabs.models.Disk :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -562,7 +578,7 @@ def _attach_initial( } error_map.update(kwargs.pop('error_map', {})) - _attach_disk_properties = models.AttachDiskProperties(leased_by_lab_vm_id=leased_by_lab_vm_id) + _attach_disk_properties = _models.AttachDiskProperties(leased_by_lab_vm_id=leased_by_lab_vm_id) api_version = "2018-09-15" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -662,7 +678,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'userName': self._serialize.url("user_name", user_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -692,7 +716,7 @@ def _detach_initial( } error_map.update(kwargs.pop('error_map', {})) - _detach_disk_properties = models.DetachDiskProperties(leased_by_lab_vm_id=leased_by_lab_vm_id) + _detach_disk_properties = _models.DetachDiskProperties(leased_by_lab_vm_id=leased_by_lab_vm_id) api_version = "2018-09-15" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -791,7 +815,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'userName': self._serialize.url("user_name", user_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_environments_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_environments_operations.py index 30344658bc1d..e3da2d9c3b4e 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_environments_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_environments_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class EnvironmentsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -58,7 +58,7 @@ def list( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.DtlEnvironmentList"] + # type: (...) -> Iterable["_models.DtlEnvironmentList"] """List environments in a given user profile. :param resource_group_name: The name of the resource group. @@ -81,7 +81,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.devtestlabs.models.DtlEnvironmentList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DtlEnvironmentList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DtlEnvironmentList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -156,7 +156,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.DtlEnvironment" + # type: (...) -> "_models.DtlEnvironment" """Get environment. :param resource_group_name: The name of the resource group. @@ -174,7 +174,7 @@ def get( :rtype: ~azure.mgmt.devtestlabs.models.DtlEnvironment :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DtlEnvironment"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DtlEnvironment"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +225,11 @@ def _create_or_update_initial( lab_name, # type: str user_name, # type: str name, # type: str - dtl_environment, # type: "models.DtlEnvironment" + dtl_environment, # type: "_models.DtlEnvironment" **kwargs # type: Any ): - # type: (...) -> "models.DtlEnvironment" - cls = kwargs.pop('cls', None) # type: ClsType["models.DtlEnvironment"] + # type: (...) -> "_models.DtlEnvironment" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DtlEnvironment"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -287,10 +287,10 @@ def begin_create_or_update( lab_name, # type: str user_name, # type: str name, # type: str - dtl_environment, # type: "models.DtlEnvironment" + dtl_environment, # type: "_models.DtlEnvironment" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DtlEnvironment"] + # type: (...) -> LROPoller["_models.DtlEnvironment"] """Create or replace an existing environment. This operation can take a while to complete. :param resource_group_name: The name of the resource group. @@ -314,7 +314,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DtlEnvironment"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DtlEnvironment"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -341,7 +341,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'userName': self._serialize.url("user_name", user_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +465,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'userName': self._serialize.url("user_name", user_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -477,10 +493,10 @@ def update( lab_name, # type: str user_name, # type: str name, # type: str - dtl_environment, # type: "models.DtlEnvironmentFragment" + dtl_environment, # type: "_models.DtlEnvironmentFragment" **kwargs # type: Any ): - # type: (...) -> "models.DtlEnvironment" + # type: (...) -> "_models.DtlEnvironment" """Allows modifying tags of environments. All other properties will be ignored. :param resource_group_name: The name of the resource group. @@ -498,7 +514,7 @@ def update( :rtype: ~azure.mgmt.devtestlabs.models.DtlEnvironment :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DtlEnvironment"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DtlEnvironment"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_formulas_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_formulas_operations.py index 5f4434456b9b..eefb750c3900 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_formulas_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_formulas_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class FormulasOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -57,7 +57,7 @@ def list( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.FormulaList"] + # type: (...) -> Iterable["_models.FormulaList"] """List formulas in a given lab. :param resource_group_name: The name of the resource group. @@ -78,7 +78,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.devtestlabs.models.FormulaList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FormulaList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FormulaList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Formula" + # type: (...) -> "_models.Formula" """Get formula. :param resource_group_name: The name of the resource group. @@ -167,7 +167,7 @@ def get( :rtype: ~azure.mgmt.devtestlabs.models.Formula :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Formula"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Formula"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,11 +216,11 @@ def _create_or_update_initial( resource_group_name, # type: str lab_name, # type: str name, # type: str - formula, # type: "models.Formula" + formula, # type: "_models.Formula" **kwargs # type: Any ): - # type: (...) -> "models.Formula" - cls = kwargs.pop('cls', None) # type: ClsType["models.Formula"] + # type: (...) -> "_models.Formula" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Formula"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -276,10 +276,10 @@ def begin_create_or_update( resource_group_name, # type: str lab_name, # type: str name, # type: str - formula, # type: "models.Formula" + formula, # type: "_models.Formula" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Formula"] + # type: (...) -> LROPoller["_models.Formula"] """Create or replace an existing formula. This operation can take a while to complete. :param resource_group_name: The name of the resource group. @@ -301,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Formula"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Formula"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -327,7 +327,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -406,10 +413,10 @@ def update( resource_group_name, # type: str lab_name, # type: str name, # type: str - formula, # type: "models.FormulaFragment" + formula, # type: "_models.FormulaFragment" **kwargs # type: Any ): - # type: (...) -> "models.Formula" + # type: (...) -> "_models.Formula" """Allows modifying tags of formulas. All other properties will be ignored. :param resource_group_name: The name of the resource group. @@ -425,7 +432,7 @@ def update( :rtype: ~azure.mgmt.devtestlabs.models.Formula :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Formula"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Formula"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_gallery_images_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_gallery_images_operations.py index a1d03976f6fe..abf735429b1b 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_gallery_images_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_gallery_images_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class GalleryImagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -55,7 +55,7 @@ def list( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.GalleryImageList"] + # type: (...) -> Iterable["_models.GalleryImageList"] """List gallery images in a given lab. :param resource_group_name: The name of the resource group. @@ -76,7 +76,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.devtestlabs.models.GalleryImageList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_global_schedules_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_global_schedules_operations.py index e3a7c2379b2a..8f8cb436844a 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_global_schedules_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_global_schedules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class GlobalSchedulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -55,7 +55,7 @@ def list_by_subscription( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.ScheduleList"] + # type: (...) -> Iterable["_models.ScheduleList"] """List schedules in a subscription. :param expand: Specify the $expand query. Example: 'properties($select=status)'. @@ -72,7 +72,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.devtestlabs.models.ScheduleList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ScheduleList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduleList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -144,7 +144,7 @@ def list_by_resource_group( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.ScheduleList"] + # type: (...) -> Iterable["_models.ScheduleList"] """List schedules in a resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +163,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.devtestlabs.models.ScheduleList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ScheduleList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduleList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -234,7 +234,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Schedule" + # type: (...) -> "_models.Schedule" """Get schedule. :param resource_group_name: The name of the resource group. @@ -248,7 +248,7 @@ def get( :rtype: ~azure.mgmt.devtestlabs.models.Schedule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Schedule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,10 +295,10 @@ def create_or_update( self, resource_group_name, # type: str name, # type: str - schedule, # type: "models.Schedule" + schedule, # type: "_models.Schedule" **kwargs # type: Any ): - # type: (...) -> "models.Schedule" + # type: (...) -> "_models.Schedule" """Create or replace an existing schedule. :param resource_group_name: The name of the resource group. @@ -312,7 +312,7 @@ def create_or_update( :rtype: ~azure.mgmt.devtestlabs.models.Schedule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Schedule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -422,10 +422,10 @@ def update( self, resource_group_name, # type: str name, # type: str - schedule, # type: "models.ScheduleFragment" + schedule, # type: "_models.ScheduleFragment" **kwargs # type: Any ): - # type: (...) -> "models.Schedule" + # type: (...) -> "_models.Schedule" """Allows modifying tags of schedules. All other properties will be ignored. :param resource_group_name: The name of the resource group. @@ -439,7 +439,7 @@ def update( :rtype: ~azure.mgmt.devtestlabs.models.Schedule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Schedule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -575,7 +575,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -604,7 +610,7 @@ def _retarget_initial( } error_map.update(kwargs.pop('error_map', {})) - _retarget_schedule_properties = models.RetargetScheduleProperties(current_resource_id=current_resource_id, target_resource_id=target_resource_id) + _retarget_schedule_properties = _models.RetargetScheduleProperties(current_resource_id=current_resource_id, target_resource_id=target_resource_id) api_version = "2018-09-15" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -698,7 +704,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_labs_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_labs_operations.py index 0a87e8c22f72..e164f414ce5f 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_labs_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_labs_operations.py @@ -17,7 +17,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -40,7 +40,7 @@ class LabsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -56,7 +56,7 @@ def list_by_subscription( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.LabList"] + # type: (...) -> Iterable["_models.LabList"] """List labs in a subscription. :param expand: Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. @@ -73,7 +73,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.devtestlabs.models.LabList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LabList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LabList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ def list_by_resource_group( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.LabList"] + # type: (...) -> Iterable["_models.LabList"] """List labs in a resource group. :param resource_group_name: The name of the resource group. @@ -164,7 +164,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.devtestlabs.models.LabList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LabList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LabList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -235,7 +235,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Lab" + # type: (...) -> "_models.Lab" """Get lab. :param resource_group_name: The name of the resource group. @@ -249,7 +249,7 @@ def get( :rtype: ~azure.mgmt.devtestlabs.models.Lab :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Lab"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Lab"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -296,11 +296,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str name, # type: str - lab, # type: "models.Lab" + lab, # type: "_models.Lab" **kwargs # type: Any ): - # type: (...) -> "models.Lab" - cls = kwargs.pop('cls', None) # type: ClsType["models.Lab"] + # type: (...) -> "_models.Lab" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Lab"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -354,10 +354,10 @@ def begin_create_or_update( self, resource_group_name, # type: str name, # type: str - lab, # type: "models.Lab" + lab, # type: "_models.Lab" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Lab"] + # type: (...) -> LROPoller["_models.Lab"] """Create or replace an existing lab. This operation can take a while to complete. :param resource_group_name: The name of the resource group. @@ -377,7 +377,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Lab"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Lab"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -402,7 +402,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -506,7 +512,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -524,10 +536,10 @@ def update( self, resource_group_name, # type: str name, # type: str - lab, # type: "models.LabFragment" + lab, # type: "_models.LabFragment" **kwargs # type: Any ): - # type: (...) -> "models.Lab" + # type: (...) -> "_models.Lab" """Allows modifying tags of labs. All other properties will be ignored. :param resource_group_name: The name of the resource group. @@ -541,7 +553,7 @@ def update( :rtype: ~azure.mgmt.devtestlabs.models.Lab :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Lab"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Lab"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -678,7 +690,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -696,7 +714,7 @@ def _create_environment_initial( self, resource_group_name, # type: str name, # type: str - lab_virtual_machine_creation_parameter, # type: "models.LabVirtualMachineCreationParameter" + lab_virtual_machine_creation_parameter, # type: "_models.LabVirtualMachineCreationParameter" **kwargs # type: Any ): # type: (...) -> None @@ -747,7 +765,7 @@ def begin_create_environment( self, resource_group_name, # type: str name, # type: str - lab_virtual_machine_creation_parameter, # type: "models.LabVirtualMachineCreationParameter" + lab_virtual_machine_creation_parameter, # type: "_models.LabVirtualMachineCreationParameter" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -792,7 +810,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -821,7 +845,7 @@ def _export_resource_usage_initial( } error_map.update(kwargs.pop('error_map', {})) - _export_resource_usage_parameters = models.ExportResourceUsageParameters(blob_storage_absolute_sas_uri=blob_storage_absolute_sas_uri, usage_start_date=usage_start_date) + _export_resource_usage_parameters = _models.ExportResourceUsageParameters(blob_storage_absolute_sas_uri=blob_storage_absolute_sas_uri, usage_start_date=usage_start_date) api_version = "2018-09-15" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -916,7 +940,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -937,7 +967,7 @@ def generate_upload_uri( blob_name=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.GenerateUploadUriResponse" + # type: (...) -> "_models.GenerateUploadUriResponse" """Generate a URI for uploading custom disk images to a Lab. :param resource_group_name: The name of the resource group. @@ -951,13 +981,13 @@ def generate_upload_uri( :rtype: ~azure.mgmt.devtestlabs.models.GenerateUploadUriResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GenerateUploadUriResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GenerateUploadUriResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - _generate_upload_uri_parameter = models.GenerateUploadUriParameter(blob_name=blob_name) + _generate_upload_uri_parameter = _models.GenerateUploadUriParameter(blob_name=blob_name) api_version = "2018-09-15" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1014,7 +1044,7 @@ def _import_virtual_machine_initial( } error_map.update(kwargs.pop('error_map', {})) - _import_lab_virtual_machine_request = models.ImportLabVirtualMachineRequest(source_virtual_machine_resource_id=source_virtual_machine_resource_id, destination_virtual_machine_name=destination_virtual_machine_name) + _import_lab_virtual_machine_request = _models.ImportLabVirtualMachineRequest(source_virtual_machine_resource_id=source_virtual_machine_resource_id, destination_virtual_machine_name=destination_virtual_machine_name) api_version = "2018-09-15" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1108,7 +1138,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1128,7 +1164,7 @@ def list_vhds( name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LabVhdList"] + # type: (...) -> Iterable["_models.LabVhdList"] """List disk images available for custom image creation. :param resource_group_name: The name of the resource group. @@ -1140,7 +1176,7 @@ def list_vhds( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.devtestlabs.models.LabVhdList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LabVhdList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LabVhdList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_notification_channels_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_notification_channels_operations.py index 2a90bcee6aed..16808e656def 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_notification_channels_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_notification_channels_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NotificationChannelsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -55,7 +55,7 @@ def list( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.NotificationChannelList"] + # type: (...) -> Iterable["_models.NotificationChannelList"] """List notification channels in a given lab. :param resource_group_name: The name of the resource group. @@ -76,7 +76,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.devtestlabs.models.NotificationChannelList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NotificationChannelList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NotificationChannelList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -149,7 +149,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NotificationChannel" + # type: (...) -> "_models.NotificationChannel" """Get notification channel. :param resource_group_name: The name of the resource group. @@ -165,7 +165,7 @@ def get( :rtype: ~azure.mgmt.devtestlabs.models.NotificationChannel :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NotificationChannel"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NotificationChannel"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,10 +214,10 @@ def create_or_update( resource_group_name, # type: str lab_name, # type: str name, # type: str - notification_channel, # type: "models.NotificationChannel" + notification_channel, # type: "_models.NotificationChannel" **kwargs # type: Any ): - # type: (...) -> "models.NotificationChannel" + # type: (...) -> "_models.NotificationChannel" """Create or replace an existing notification channel. :param resource_group_name: The name of the resource group. @@ -233,7 +233,7 @@ def create_or_update( :rtype: ~azure.mgmt.devtestlabs.models.NotificationChannel :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NotificationChannel"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NotificationChannel"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -349,10 +349,10 @@ def update( resource_group_name, # type: str lab_name, # type: str name, # type: str - notification_channel, # type: "models.NotificationChannelFragment" + notification_channel, # type: "_models.NotificationChannelFragment" **kwargs # type: Any ): - # type: (...) -> "models.NotificationChannel" + # type: (...) -> "_models.NotificationChannel" """Allows modifying tags of notification channels. All other properties will be ignored. :param resource_group_name: The name of the resource group. @@ -368,7 +368,7 @@ def update( :rtype: ~azure.mgmt.devtestlabs.models.NotificationChannel :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NotificationChannel"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NotificationChannel"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -420,7 +420,7 @@ def notify( resource_group_name, # type: str lab_name, # type: str name, # type: str - event_name=None, # type: Optional[Union[str, "models.NotificationChannelEventType"]] + event_name=None, # type: Optional[Union[str, "_models.NotificationChannelEventType"]] json_payload=None, # type: Optional[str] **kwargs # type: Any ): @@ -448,7 +448,7 @@ def notify( } error_map.update(kwargs.pop('error_map', {})) - _notify_parameters = models.NotifyParameters(event_name=event_name, json_payload=json_payload) + _notify_parameters = _models.NotifyParameters(event_name=event_name, json_payload=json_payload) api_version = "2018-09-15" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_operations.py index 9e49b2c7bb04..92225c143fa2 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def get( name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationResult" + # type: (...) -> "_models.OperationResult" """Get operation. :param location_name: The name of the location. @@ -62,7 +62,7 @@ def get( :rtype: ~azure.mgmt.devtestlabs.models.OperationResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_policies_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_policies_operations.py index b1f0a71cf959..98a56b3a700b 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_policies_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_policies_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class PoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -56,7 +56,7 @@ def list( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.PolicyList"] + # type: (...) -> Iterable["_models.PolicyList"] """List policies in a given policy set. :param resource_group_name: The name of the resource group. @@ -79,7 +79,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.devtestlabs.models.PolicyList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PolicyList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PolicyList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -154,7 +154,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Policy" + # type: (...) -> "_models.Policy" """Get policy. :param resource_group_name: The name of the resource group. @@ -172,7 +172,7 @@ def get( :rtype: ~azure.mgmt.devtestlabs.models.Policy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Policy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Policy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,10 +223,10 @@ def create_or_update( lab_name, # type: str policy_set_name, # type: str name, # type: str - policy, # type: "models.Policy" + policy, # type: "_models.Policy" **kwargs # type: Any ): - # type: (...) -> "models.Policy" + # type: (...) -> "_models.Policy" """Create or replace an existing policy. :param resource_group_name: The name of the resource group. @@ -244,7 +244,7 @@ def create_or_update( :rtype: ~azure.mgmt.devtestlabs.models.Policy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Policy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Policy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -366,10 +366,10 @@ def update( lab_name, # type: str policy_set_name, # type: str name, # type: str - policy, # type: "models.PolicyFragment" + policy, # type: "_models.PolicyFragment" **kwargs # type: Any ): - # type: (...) -> "models.Policy" + # type: (...) -> "_models.Policy" """Allows modifying tags of policies. All other properties will be ignored. :param resource_group_name: The name of the resource group. @@ -387,7 +387,7 @@ def update( :rtype: ~azure.mgmt.devtestlabs.models.Policy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Policy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Policy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_policy_sets_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_policy_sets_operations.py index 3241a6ad29e8..f0356e649e37 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_policy_sets_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_policy_sets_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class PolicySetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def evaluate_policies( resource_group_name, # type: str lab_name, # type: str name, # type: str - policies=None, # type: Optional[List["models.EvaluatePoliciesProperties"]] + policies=None, # type: Optional[List["_models.EvaluatePoliciesProperties"]] **kwargs # type: Any ): - # type: (...) -> "models.EvaluatePoliciesResponse" + # type: (...) -> "_models.EvaluatePoliciesResponse" """Evaluates lab policy. :param resource_group_name: The name of the resource group. @@ -68,13 +68,13 @@ def evaluate_policies( :rtype: ~azure.mgmt.devtestlabs.models.EvaluatePoliciesResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EvaluatePoliciesResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EvaluatePoliciesResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - _evaluate_policies_request = models.EvaluatePoliciesRequest(policies=policies) + _evaluate_policies_request = _models.EvaluatePoliciesRequest(policies=policies) api_version = "2018-09-15" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_provider_operations_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_provider_operations_operations.py index 36f297530519..db59d4590c0d 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_provider_operations_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_provider_operations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ProviderOperationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ProviderOperationResult"] + # type: (...) -> Iterable["_models.ProviderOperationResult"] """Result of the request to list REST API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.devtestlabs.models.ProviderOperationResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProviderOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProviderOperationResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_schedules_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_schedules_operations.py index ce45a3009f9c..04e61b479eb6 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_schedules_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_schedules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SchedulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -57,7 +57,7 @@ def list( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.ScheduleList"] + # type: (...) -> Iterable["_models.ScheduleList"] """List schedules in a given lab. :param resource_group_name: The name of the resource group. @@ -78,7 +78,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.devtestlabs.models.ScheduleList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ScheduleList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduleList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Schedule" + # type: (...) -> "_models.Schedule" """Get schedule. :param resource_group_name: The name of the resource group. @@ -167,7 +167,7 @@ def get( :rtype: ~azure.mgmt.devtestlabs.models.Schedule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Schedule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +216,10 @@ def create_or_update( resource_group_name, # type: str lab_name, # type: str name, # type: str - schedule, # type: "models.Schedule" + schedule, # type: "_models.Schedule" **kwargs # type: Any ): - # type: (...) -> "models.Schedule" + # type: (...) -> "_models.Schedule" """Create or replace an existing schedule. :param resource_group_name: The name of the resource group. @@ -235,7 +235,7 @@ def create_or_update( :rtype: ~azure.mgmt.devtestlabs.models.Schedule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Schedule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -351,10 +351,10 @@ def update( resource_group_name, # type: str lab_name, # type: str name, # type: str - schedule, # type: "models.ScheduleFragment" + schedule, # type: "_models.ScheduleFragment" **kwargs # type: Any ): - # type: (...) -> "models.Schedule" + # type: (...) -> "_models.Schedule" """Allows modifying tags of schedules. All other properties will be ignored. :param resource_group_name: The name of the resource group. @@ -370,7 +370,7 @@ def update( :rtype: ~azure.mgmt.devtestlabs.models.Schedule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Schedule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -513,7 +513,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -534,7 +541,7 @@ def list_applicable( name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ScheduleList"] + # type: (...) -> Iterable["_models.ScheduleList"] """Lists all applicable schedules. :param resource_group_name: The name of the resource group. @@ -548,7 +555,7 @@ def list_applicable( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.devtestlabs.models.ScheduleList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ScheduleList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduleList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_secrets_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_secrets_operations.py index e975086baa89..c5dac71c3edd 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_secrets_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_secrets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SecretsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -58,7 +58,7 @@ def list( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecretList"] + # type: (...) -> Iterable["_models.SecretList"] """List secrets in a given user profile. :param resource_group_name: The name of the resource group. @@ -81,7 +81,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.devtestlabs.models.SecretList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecretList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecretList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -156,7 +156,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Secret" + # type: (...) -> "_models.Secret" """Get secret. :param resource_group_name: The name of the resource group. @@ -174,7 +174,7 @@ def get( :rtype: ~azure.mgmt.devtestlabs.models.Secret :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Secret"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Secret"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +225,11 @@ def _create_or_update_initial( lab_name, # type: str user_name, # type: str name, # type: str - secret, # type: "models.Secret" + secret, # type: "_models.Secret" **kwargs # type: Any ): - # type: (...) -> "models.Secret" - cls = kwargs.pop('cls', None) # type: ClsType["models.Secret"] + # type: (...) -> "_models.Secret" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Secret"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -287,10 +287,10 @@ def begin_create_or_update( lab_name, # type: str user_name, # type: str name, # type: str - secret, # type: "models.Secret" + secret, # type: "_models.Secret" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Secret"] + # type: (...) -> LROPoller["_models.Secret"] """Create or replace an existing secret. This operation can take a while to complete. :param resource_group_name: The name of the resource group. @@ -314,7 +314,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Secret"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Secret"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -341,7 +341,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'userName': self._serialize.url("user_name", user_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -429,7 +437,7 @@ def update( value=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Secret" + # type: (...) -> "_models.Secret" """Allows modifying tags of secrets. All other properties will be ignored. :param resource_group_name: The name of the resource group. @@ -449,13 +457,13 @@ def update( :rtype: ~azure.mgmt.devtestlabs.models.Secret :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Secret"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Secret"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - _secret = models.SecretFragment(tags=tags, value=value) + _secret = _models.SecretFragment(tags=tags, value=value) api_version = "2018-09-15" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_service_fabric_schedules_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_service_fabric_schedules_operations.py index ff91a6b4f291..fcedae3b5264 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_service_fabric_schedules_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_service_fabric_schedules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ServiceFabricSchedulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -59,7 +59,7 @@ def list( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.ScheduleList"] + # type: (...) -> Iterable["_models.ScheduleList"] """List schedules in a given service fabric. :param resource_group_name: The name of the resource group. @@ -84,7 +84,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.devtestlabs.models.ScheduleList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ScheduleList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduleList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -161,7 +161,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Schedule" + # type: (...) -> "_models.Schedule" """Get schedule. :param resource_group_name: The name of the resource group. @@ -181,7 +181,7 @@ def get( :rtype: ~azure.mgmt.devtestlabs.models.Schedule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Schedule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -234,10 +234,10 @@ def create_or_update( user_name, # type: str service_fabric_name, # type: str name, # type: str - schedule, # type: "models.Schedule" + schedule, # type: "_models.Schedule" **kwargs # type: Any ): - # type: (...) -> "models.Schedule" + # type: (...) -> "_models.Schedule" """Create or replace an existing schedule. :param resource_group_name: The name of the resource group. @@ -257,7 +257,7 @@ def create_or_update( :rtype: ~azure.mgmt.devtestlabs.models.Schedule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Schedule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,10 +385,10 @@ def update( user_name, # type: str service_fabric_name, # type: str name, # type: str - schedule, # type: "models.ScheduleFragment" + schedule, # type: "_models.ScheduleFragment" **kwargs # type: Any ): - # type: (...) -> "models.Schedule" + # type: (...) -> "_models.Schedule" """Allows modifying tags of schedules. All other properties will be ignored. :param resource_group_name: The name of the resource group. @@ -408,7 +408,7 @@ def update( :rtype: ~azure.mgmt.devtestlabs.models.Schedule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Schedule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -565,7 +565,16 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'userName': self._serialize.url("user_name", user_name, 'str'), + 'serviceFabricName': self._serialize.url("service_fabric_name", service_fabric_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_service_fabrics_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_service_fabrics_operations.py index 20d2c3b03573..b9f877ec224e 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_service_fabrics_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_service_fabrics_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ServiceFabricsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -58,7 +58,7 @@ def list( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceFabricList"] + # type: (...) -> Iterable["_models.ServiceFabricList"] """List service fabrics in a given user profile. :param resource_group_name: The name of the resource group. @@ -81,7 +81,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.devtestlabs.models.ServiceFabricList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceFabricList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceFabricList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -156,7 +156,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ServiceFabric" + # type: (...) -> "_models.ServiceFabric" """Get service fabric. :param resource_group_name: The name of the resource group. @@ -174,7 +174,7 @@ def get( :rtype: ~azure.mgmt.devtestlabs.models.ServiceFabric :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceFabric"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceFabric"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +225,11 @@ def _create_or_update_initial( lab_name, # type: str user_name, # type: str name, # type: str - service_fabric, # type: "models.ServiceFabric" + service_fabric, # type: "_models.ServiceFabric" **kwargs # type: Any ): - # type: (...) -> "models.ServiceFabric" - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceFabric"] + # type: (...) -> "_models.ServiceFabric" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceFabric"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -287,10 +287,10 @@ def begin_create_or_update( lab_name, # type: str user_name, # type: str name, # type: str - service_fabric, # type: "models.ServiceFabric" + service_fabric, # type: "_models.ServiceFabric" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ServiceFabric"] + # type: (...) -> LROPoller["_models.ServiceFabric"] """Create or replace an existing service fabric. This operation can take a while to complete. :param resource_group_name: The name of the resource group. @@ -314,7 +314,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceFabric"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceFabric"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -341,7 +341,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'userName': self._serialize.url("user_name", user_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +465,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'userName': self._serialize.url("user_name", user_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -477,10 +493,10 @@ def update( lab_name, # type: str user_name, # type: str name, # type: str - service_fabric, # type: "models.ServiceFabricFragment" + service_fabric, # type: "_models.ServiceFabricFragment" **kwargs # type: Any ): - # type: (...) -> "models.ServiceFabric" + # type: (...) -> "_models.ServiceFabric" """Allows modifying tags of service fabrics. All other properties will be ignored. :param resource_group_name: The name of the resource group. @@ -498,7 +514,7 @@ def update( :rtype: ~azure.mgmt.devtestlabs.models.ServiceFabric :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceFabric"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceFabric"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -554,7 +570,7 @@ def list_applicable_schedules( name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicableSchedule" + # type: (...) -> "_models.ApplicableSchedule" """Lists the applicable start/stop schedules, if any. :param resource_group_name: The name of the resource group. @@ -570,7 +586,7 @@ def list_applicable_schedules( :rtype: ~azure.mgmt.devtestlabs.models.ApplicableSchedule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicableSchedule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicableSchedule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -715,7 +731,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'userName': self._serialize.url("user_name", user_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -831,7 +855,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'userName': self._serialize.url("user_name", user_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_service_runners_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_service_runners_operations.py index 677351910f9a..ae6b6537e611 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_service_runners_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_service_runners_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ServiceRunnersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def get( name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ServiceRunner" + # type: (...) -> "_models.ServiceRunner" """Get service runner. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.devtestlabs.models.ServiceRunner :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceRunner"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceRunner"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,10 +112,10 @@ def create_or_update( resource_group_name, # type: str lab_name, # type: str name, # type: str - service_runner, # type: "models.ServiceRunner" + service_runner, # type: "_models.ServiceRunner" **kwargs # type: Any ): - # type: (...) -> "models.ServiceRunner" + # type: (...) -> "_models.ServiceRunner" """Create or replace an existing service runner. :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ def create_or_update( :rtype: ~azure.mgmt.devtestlabs.models.ServiceRunner :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceRunner"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceRunner"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_users_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_users_operations.py index e7846b9dc8f9..25168f7c139c 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_users_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_users_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class UsersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -57,7 +57,7 @@ def list( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.UserList"] + # type: (...) -> Iterable["_models.UserList"] """List user profiles in a given lab. :param resource_group_name: The name of the resource group. @@ -78,7 +78,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.devtestlabs.models.UserList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UserList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UserList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.User" + # type: (...) -> "_models.User" """Get user profile. :param resource_group_name: The name of the resource group. @@ -167,7 +167,7 @@ def get( :rtype: ~azure.mgmt.devtestlabs.models.User :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.User"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,11 +216,11 @@ def _create_or_update_initial( resource_group_name, # type: str lab_name, # type: str name, # type: str - user, # type: "models.User" + user, # type: "_models.User" **kwargs # type: Any ): - # type: (...) -> "models.User" - cls = kwargs.pop('cls', None) # type: ClsType["models.User"] + # type: (...) -> "_models.User" + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -276,10 +276,10 @@ def begin_create_or_update( resource_group_name, # type: str lab_name, # type: str name, # type: str - user, # type: "models.User" + user, # type: "_models.User" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.User"] + # type: (...) -> LROPoller["_models.User"] """Create or replace an existing user profile. This operation can take a while to complete. :param resource_group_name: The name of the resource group. @@ -301,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.User"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -327,7 +327,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -437,7 +444,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -456,10 +470,10 @@ def update( resource_group_name, # type: str lab_name, # type: str name, # type: str - user, # type: "models.UserFragment" + user, # type: "_models.UserFragment" **kwargs # type: Any ): - # type: (...) -> "models.User" + # type: (...) -> "_models.User" """Allows modifying tags of user profiles. All other properties will be ignored. :param resource_group_name: The name of the resource group. @@ -475,7 +489,7 @@ def update( :rtype: ~azure.mgmt.devtestlabs.models.User :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.User"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_virtual_machine_schedules_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_virtual_machine_schedules_operations.py index 11f55372e715..aebc3a28c782 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_virtual_machine_schedules_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_virtual_machine_schedules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachineSchedulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -58,7 +58,7 @@ def list( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.ScheduleList"] + # type: (...) -> Iterable["_models.ScheduleList"] """List schedules in a given virtual machine. :param resource_group_name: The name of the resource group. @@ -81,7 +81,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.devtestlabs.models.ScheduleList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ScheduleList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduleList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -156,7 +156,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Schedule" + # type: (...) -> "_models.Schedule" """Get schedule. :param resource_group_name: The name of the resource group. @@ -174,7 +174,7 @@ def get( :rtype: ~azure.mgmt.devtestlabs.models.Schedule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Schedule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,10 +225,10 @@ def create_or_update( lab_name, # type: str virtual_machine_name, # type: str name, # type: str - schedule, # type: "models.Schedule" + schedule, # type: "_models.Schedule" **kwargs # type: Any ): - # type: (...) -> "models.Schedule" + # type: (...) -> "_models.Schedule" """Create or replace an existing schedule. :param resource_group_name: The name of the resource group. @@ -246,7 +246,7 @@ def create_or_update( :rtype: ~azure.mgmt.devtestlabs.models.Schedule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Schedule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -368,10 +368,10 @@ def update( lab_name, # type: str virtual_machine_name, # type: str name, # type: str - schedule, # type: "models.ScheduleFragment" + schedule, # type: "_models.ScheduleFragment" **kwargs # type: Any ): - # type: (...) -> "models.Schedule" + # type: (...) -> "_models.Schedule" """Allows modifying tags of schedules. All other properties will be ignored. :param resource_group_name: The name of the resource group. @@ -389,7 +389,7 @@ def update( :rtype: ~azure.mgmt.devtestlabs.models.Schedule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Schedule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -539,7 +539,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_virtual_machines_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_virtual_machines_operations.py index 19c88e7312f1..626ea2158dfe 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_virtual_machines_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_virtual_machines_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachinesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -57,7 +57,7 @@ def list( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.LabVirtualMachineList"] + # type: (...) -> Iterable["_models.LabVirtualMachineList"] """List virtual machines in a given lab. :param resource_group_name: The name of the resource group. @@ -79,7 +79,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.devtestlabs.models.LabVirtualMachineList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LabVirtualMachineList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LabVirtualMachineList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -152,7 +152,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.LabVirtualMachine" + # type: (...) -> "_models.LabVirtualMachine" """Get virtual machine. :param resource_group_name: The name of the resource group. @@ -169,7 +169,7 @@ def get( :rtype: ~azure.mgmt.devtestlabs.models.LabVirtualMachine :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LabVirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LabVirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,11 +218,11 @@ def _create_or_update_initial( resource_group_name, # type: str lab_name, # type: str name, # type: str - lab_virtual_machine, # type: "models.LabVirtualMachine" + lab_virtual_machine, # type: "_models.LabVirtualMachine" **kwargs # type: Any ): - # type: (...) -> "models.LabVirtualMachine" - cls = kwargs.pop('cls', None) # type: ClsType["models.LabVirtualMachine"] + # type: (...) -> "_models.LabVirtualMachine" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LabVirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -278,10 +278,10 @@ def begin_create_or_update( resource_group_name, # type: str lab_name, # type: str name, # type: str - lab_virtual_machine, # type: "models.LabVirtualMachine" + lab_virtual_machine, # type: "_models.LabVirtualMachine" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LabVirtualMachine"] + # type: (...) -> LROPoller["_models.LabVirtualMachine"] """Create or replace an existing virtual machine. This operation can take a while to complete. :param resource_group_name: The name of the resource group. @@ -303,7 +303,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LabVirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LabVirtualMachine"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -329,7 +329,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -439,7 +446,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -458,10 +472,10 @@ def update( resource_group_name, # type: str lab_name, # type: str name, # type: str - lab_virtual_machine, # type: "models.LabVirtualMachineFragment" + lab_virtual_machine, # type: "_models.LabVirtualMachineFragment" **kwargs # type: Any ): - # type: (...) -> "models.LabVirtualMachine" + # type: (...) -> "_models.LabVirtualMachine" """Allows modifying tags of virtual machines. All other properties will be ignored. :param resource_group_name: The name of the resource group. @@ -477,7 +491,7 @@ def update( :rtype: ~azure.mgmt.devtestlabs.models.LabVirtualMachine :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LabVirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LabVirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +543,7 @@ def _add_data_disk_initial( resource_group_name, # type: str lab_name, # type: str name, # type: str - data_disk_properties, # type: "models.DataDiskProperties" + data_disk_properties, # type: "_models.DataDiskProperties" **kwargs # type: Any ): # type: (...) -> None @@ -582,7 +596,7 @@ def begin_add_data_disk( resource_group_name, # type: str lab_name, # type: str name, # type: str - data_disk_properties, # type: "models.DataDiskProperties" + data_disk_properties, # type: "_models.DataDiskProperties" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -632,7 +646,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -651,7 +672,7 @@ def _apply_artifacts_initial( resource_group_name, # type: str lab_name, # type: str name, # type: str - artifacts=None, # type: Optional[List["models.ArtifactInstallProperties"]] + artifacts=None, # type: Optional[List["_models.ArtifactInstallProperties"]] **kwargs # type: Any ): # type: (...) -> None @@ -661,7 +682,7 @@ def _apply_artifacts_initial( } error_map.update(kwargs.pop('error_map', {})) - _apply_artifacts_request = models.ApplyArtifactsRequest(artifacts=artifacts) + _apply_artifacts_request = _models.ApplyArtifactsRequest(artifacts=artifacts) api_version = "2018-09-15" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -706,7 +727,7 @@ def begin_apply_artifacts( resource_group_name, # type: str lab_name, # type: str name, # type: str - artifacts=None, # type: Optional[List["models.ArtifactInstallProperties"]] + artifacts=None, # type: Optional[List["_models.ArtifactInstallProperties"]] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -754,7 +775,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -864,7 +892,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -893,7 +928,7 @@ def _detach_data_disk_initial( } error_map.update(kwargs.pop('error_map', {})) - _detach_data_disk_properties = models.DetachDataDiskProperties(existing_lab_disk_id=existing_lab_disk_id) + _detach_data_disk_properties = _models.DetachDataDiskProperties(existing_lab_disk_id=existing_lab_disk_id) api_version = "2018-09-15" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -987,7 +1022,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1008,7 +1050,7 @@ def get_rdp_file_contents( name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RdpConnection" + # type: (...) -> "_models.RdpConnection" """Gets a string that represents the contents of the RDP file for the virtual machine. :param resource_group_name: The name of the resource group. @@ -1022,7 +1064,7 @@ def get_rdp_file_contents( :rtype: ~azure.mgmt.devtestlabs.models.RdpConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RdpConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RdpConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1071,7 +1113,7 @@ def list_applicable_schedules( name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicableSchedule" + # type: (...) -> "_models.ApplicableSchedule" """Lists the applicable start/stop schedules, if any. :param resource_group_name: The name of the resource group. @@ -1085,7 +1127,7 @@ def list_applicable_schedules( :rtype: ~azure.mgmt.devtestlabs.models.ApplicableSchedule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicableSchedule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicableSchedule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1223,7 +1265,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1252,7 +1301,7 @@ def _resize_initial( } error_map.update(kwargs.pop('error_map', {})) - _resize_lab_virtual_machine_properties = models.ResizeLabVirtualMachineProperties(size=size) + _resize_lab_virtual_machine_properties = _models.ResizeLabVirtualMachineProperties(size=size) api_version = "2018-09-15" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1345,7 +1394,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1455,7 +1511,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1565,7 +1628,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1675,7 +1745,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1786,7 +1863,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1896,7 +1980,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_virtual_networks_operations.py b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_virtual_networks_operations.py index 88a3c5f4e1cb..578ae36c52fe 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_virtual_networks_operations.py +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -57,7 +57,7 @@ def list( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkList"] + # type: (...) -> Iterable["_models.VirtualNetworkList"] """List virtual networks in a given lab. :param resource_group_name: The name of the resource group. @@ -78,7 +78,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.devtestlabs.models.VirtualNetworkList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" + # type: (...) -> "_models.VirtualNetwork" """Get virtual network. :param resource_group_name: The name of the resource group. @@ -167,7 +167,7 @@ def get( :rtype: ~azure.mgmt.devtestlabs.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,11 +216,11 @@ def _create_or_update_initial( resource_group_name, # type: str lab_name, # type: str name, # type: str - virtual_network, # type: "models.VirtualNetwork" + virtual_network, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -276,10 +276,10 @@ def begin_create_or_update( resource_group_name, # type: str lab_name, # type: str name, # type: str - virtual_network, # type: "models.VirtualNetwork" + virtual_network, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Create or replace an existing virtual network. This operation can take a while to complete. :param resource_group_name: The name of the resource group. @@ -301,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -327,7 +327,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -437,7 +444,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'labName': self._serialize.url("lab_name", lab_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -456,10 +470,10 @@ def update( resource_group_name, # type: str lab_name, # type: str name, # type: str - virtual_network, # type: "models.VirtualNetworkFragment" + virtual_network, # type: "_models.VirtualNetworkFragment" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" + # type: (...) -> "_models.VirtualNetwork" """Allows modifying tags of virtual networks. All other properties will be ignored. :param resource_group_name: The name of the resource group. @@ -475,7 +489,7 @@ def update( :rtype: ~azure.mgmt.devtestlabs.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError }