From 2f867b1eceb2d81f0492043b5e1b3b7e96a603ae Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Sat, 8 May 2021 00:17:04 +0000 Subject: [PATCH] CodeGen from PR 14316 in Azure/azure-rest-api-specs Merge b12616f3fcf0e8f2916b557763c77064d5de1539 into a4924d479f80242b6bd5d02328c4579f58dc87da --- sdk/maps/azure-mgmt-maps/_meta.json | 2 +- .../azure/mgmt/maps/__init__.py | 4 +- ...er.py => _azure_maps_management_client.py} | 15 +- .../azure/mgmt/maps/_configuration.py | 8 +- .../azure/mgmt/maps/_metadata.json | 15 +- .../azure/mgmt/maps/_version.py | 2 +- .../azure/mgmt/maps/aio/__init__.py | 4 +- ...er.py => _azure_maps_management_client.py} | 15 +- .../azure/mgmt/maps/aio/_configuration.py | 8 +- .../mgmt/maps/aio/operations/__init__.py | 2 - .../aio/operations/_accounts_operations.py | 30 +- .../aio/operations/_creators_operations.py | 20 +- .../maps/aio/operations/_maps_operations.py | 4 +- .../operations/_private_atlases_operations.py | 390 ----------- .../azure/mgmt/maps/models/__init__.py | 56 +- ...=> _azure_maps_management_client_enums.py} | 24 + .../azure/mgmt/maps/models/_models.py | 597 +++++++++------- .../azure/mgmt/maps/models/_models_py3.py | 658 ++++++++++-------- .../azure/mgmt/maps/operations/__init__.py | 2 - .../maps/operations/_accounts_operations.py | 30 +- .../maps/operations/_creators_operations.py | 20 +- .../mgmt/maps/operations/_maps_operations.py | 4 +- .../operations/_private_atlases_operations.py | 399 ----------- 23 files changed, 836 insertions(+), 1473 deletions(-) rename sdk/maps/azure-mgmt-maps/azure/mgmt/maps/{_azure_maps_resource_provider.py => _azure_maps_management_client.py} (87%) rename sdk/maps/azure-mgmt-maps/azure/mgmt/maps/aio/{_azure_maps_resource_provider.py => _azure_maps_management_client.py} (86%) delete mode 100644 sdk/maps/azure-mgmt-maps/azure/mgmt/maps/aio/operations/_private_atlases_operations.py rename sdk/maps/azure-mgmt-maps/azure/mgmt/maps/models/{_azure_maps_resource_provider_enums.py => _azure_maps_management_client_enums.py} (72%) delete mode 100644 sdk/maps/azure-mgmt-maps/azure/mgmt/maps/operations/_private_atlases_operations.py diff --git a/sdk/maps/azure-mgmt-maps/_meta.json b/sdk/maps/azure-mgmt-maps/_meta.json index 115285e6ba2d6..0f171ea1030ac 100644 --- a/sdk/maps/azure-mgmt-maps/_meta.json +++ b/sdk/maps/azure-mgmt-maps/_meta.json @@ -1,7 +1,7 @@ { "autorest": "3.3.0", "use": "@autorest/python@5.6.6", - "commit": "c555c1c8bc915132c6f3df485ea49c42765ef32a", + "commit": "f9b1917ce2066427ac3d6807d5bf43f7211ac75e", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest_command": "autorest specification/maps/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.6.6 --version=3.3.0", "readme": "specification/maps/resource-manager/readme.md" diff --git a/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/__init__.py b/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/__init__.py index dd2d70362bf30..c07473b586ca2 100644 --- a/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/__init__.py +++ b/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/__init__.py @@ -6,11 +6,11 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._azure_maps_resource_provider import AzureMapsResourceProvider +from ._azure_maps_management_client import AzureMapsManagementClient from ._version import VERSION __version__ = VERSION -__all__ = ['AzureMapsResourceProvider'] +__all__ = ['AzureMapsManagementClient'] try: from ._patch import patch_sdk # type: ignore diff --git a/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/_azure_maps_resource_provider.py b/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/_azure_maps_management_client.py similarity index 87% rename from sdk/maps/azure-mgmt-maps/azure/mgmt/maps/_azure_maps_resource_provider.py rename to sdk/maps/azure-mgmt-maps/azure/mgmt/maps/_azure_maps_management_client.py index 1ff841729b209..a774b587a3b72 100644 --- a/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/_azure_maps_resource_provider.py +++ b/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/_azure_maps_management_client.py @@ -18,23 +18,20 @@ from azure.core.credentials import TokenCredential from azure.core.pipeline.transport import HttpRequest, HttpResponse -from ._configuration import AzureMapsResourceProviderConfiguration +from ._configuration import AzureMapsManagementClientConfiguration from .operations import AccountsOperations from .operations import MapsOperations -from .operations import PrivateAtlasesOperations from .operations import CreatorsOperations from . import models -class AzureMapsResourceProvider(object): - """Resource Provider. +class AzureMapsManagementClient(object): + """Azure Maps. :ivar accounts: AccountsOperations operations :vartype accounts: azure.mgmt.maps.operations.AccountsOperations :ivar maps: MapsOperations operations :vartype maps: azure.mgmt.maps.operations.MapsOperations - :ivar private_atlases: PrivateAtlasesOperations operations - :vartype private_atlases: azure.mgmt.maps.operations.PrivateAtlasesOperations :ivar creators: CreatorsOperations operations :vartype creators: azure.mgmt.maps.operations.CreatorsOperations :param credential: Credential needed for the client to connect to Azure. @@ -54,7 +51,7 @@ def __init__( # type: (...) -> None if not base_url: base_url = 'https://management.azure.com' - self._config = AzureMapsResourceProviderConfiguration(credential, subscription_id, **kwargs) + self._config = AzureMapsManagementClientConfiguration(credential, subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} @@ -66,8 +63,6 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.maps = MapsOperations( self._client, self._config, self._serialize, self._deserialize) - self.private_atlases = PrivateAtlasesOperations( - self._client, self._config, self._serialize, self._deserialize) self.creators = CreatorsOperations( self._client, self._config, self._serialize, self._deserialize) @@ -94,7 +89,7 @@ def close(self): self._client.close() def __enter__(self): - # type: () -> AzureMapsResourceProvider + # type: () -> AzureMapsManagementClient self._client.__enter__() return self diff --git a/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/_configuration.py b/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/_configuration.py index 54a3adb75b3eb..ffb7bf145df1d 100644 --- a/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/_configuration.py +++ b/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/_configuration.py @@ -21,8 +21,8 @@ from azure.core.credentials import TokenCredential -class AzureMapsResourceProviderConfiguration(Configuration): - """Configuration for AzureMapsResourceProvider. +class AzureMapsManagementClientConfiguration(Configuration): + """Configuration for AzureMapsManagementClient. Note that all parameters used to create this instance are saved as instance attributes. @@ -44,11 +44,11 @@ def __init__( raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(AzureMapsResourceProviderConfiguration, self).__init__(**kwargs) + super(AzureMapsManagementClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id - self.api_version = "2020-02-01-preview" + self.api_version = "2021-07-01-preview" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-maps/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/_metadata.json b/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/_metadata.json index 1f71041804503..213e93585e148 100644 --- a/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/_metadata.json +++ b/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/_metadata.json @@ -1,17 +1,17 @@ { - "chosen_version": "2020-02-01-preview", - "total_api_version_list": ["2020-02-01-preview"], + "chosen_version": "2021-07-01-preview", + "total_api_version_list": ["2021-07-01-preview"], "client": { - "name": "AzureMapsResourceProvider", - "filename": "_azure_maps_resource_provider", - "description": "Resource Provider.", + "name": "AzureMapsManagementClient", + "filename": "_azure_maps_management_client", + "description": "Azure Maps.", "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, "has_lro_operations": false, "client_side_validation": false, - "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"AzureMapsResourceProviderConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", - "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"AzureMapsResourceProviderConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"AzureMapsManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"AzureMapsManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" }, "global_parameters": { "sync": { @@ -100,7 +100,6 @@ "operation_groups": { "accounts": "AccountsOperations", "maps": "MapsOperations", - "private_atlases": "PrivateAtlasesOperations", "creators": "CreatorsOperations" } } \ No newline at end of file diff --git a/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/_version.py b/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/_version.py index c47f66669f1bf..eae7c95b6fbdb 100644 --- a/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/_version.py +++ b/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0" +VERSION = "0.1.0" diff --git a/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/aio/__init__.py b/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/aio/__init__.py index 2ba4494b284b7..10be33448706e 100644 --- a/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/aio/__init__.py +++ b/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/aio/__init__.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._azure_maps_resource_provider import AzureMapsResourceProvider -__all__ = ['AzureMapsResourceProvider'] +from ._azure_maps_management_client import AzureMapsManagementClient +__all__ = ['AzureMapsManagementClient'] diff --git a/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/aio/_azure_maps_resource_provider.py b/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/aio/_azure_maps_management_client.py similarity index 86% rename from sdk/maps/azure-mgmt-maps/azure/mgmt/maps/aio/_azure_maps_resource_provider.py rename to sdk/maps/azure-mgmt-maps/azure/mgmt/maps/aio/_azure_maps_management_client.py index b19f42571fdbd..61b83bfe182e3 100644 --- a/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/aio/_azure_maps_resource_provider.py +++ b/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/aio/_azure_maps_management_client.py @@ -16,23 +16,20 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import AzureMapsResourceProviderConfiguration +from ._configuration import AzureMapsManagementClientConfiguration from .operations import AccountsOperations from .operations import MapsOperations -from .operations import PrivateAtlasesOperations from .operations import CreatorsOperations from .. import models -class AzureMapsResourceProvider(object): - """Resource Provider. +class AzureMapsManagementClient(object): + """Azure Maps. :ivar accounts: AccountsOperations operations :vartype accounts: azure.mgmt.maps.aio.operations.AccountsOperations :ivar maps: MapsOperations operations :vartype maps: azure.mgmt.maps.aio.operations.MapsOperations - :ivar private_atlases: PrivateAtlasesOperations operations - :vartype private_atlases: azure.mgmt.maps.aio.operations.PrivateAtlasesOperations :ivar creators: CreatorsOperations operations :vartype creators: azure.mgmt.maps.aio.operations.CreatorsOperations :param credential: Credential needed for the client to connect to Azure. @@ -51,7 +48,7 @@ def __init__( ) -> None: if not base_url: base_url = 'https://management.azure.com' - self._config = AzureMapsResourceProviderConfiguration(credential, subscription_id, **kwargs) + self._config = AzureMapsManagementClientConfiguration(credential, subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} @@ -63,8 +60,6 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.maps = MapsOperations( self._client, self._config, self._serialize, self._deserialize) - self.private_atlases = PrivateAtlasesOperations( - self._client, self._config, self._serialize, self._deserialize) self.creators = CreatorsOperations( self._client, self._config, self._serialize, self._deserialize) @@ -88,7 +83,7 @@ async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> Async async def close(self) -> None: await self._client.close() - async def __aenter__(self) -> "AzureMapsResourceProvider": + async def __aenter__(self) -> "AzureMapsManagementClient": await self._client.__aenter__() return self diff --git a/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/aio/_configuration.py b/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/aio/_configuration.py index dd70589b40cff..a9d4c60aa58ff 100644 --- a/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/aio/_configuration.py +++ b/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/aio/_configuration.py @@ -19,8 +19,8 @@ from azure.core.credentials_async import AsyncTokenCredential -class AzureMapsResourceProviderConfiguration(Configuration): - """Configuration for AzureMapsResourceProvider. +class AzureMapsManagementClientConfiguration(Configuration): + """Configuration for AzureMapsManagementClient. Note that all parameters used to create this instance are saved as instance attributes. @@ -41,11 +41,11 @@ def __init__( raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(AzureMapsResourceProviderConfiguration, self).__init__(**kwargs) + super(AzureMapsManagementClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id - self.api_version = "2020-02-01-preview" + self.api_version = "2021-07-01-preview" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-maps/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/aio/operations/__init__.py b/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/aio/operations/__init__.py index 5619cfe7f9847..91962f6e09b91 100644 --- a/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/aio/operations/__init__.py +++ b/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/aio/operations/__init__.py @@ -8,12 +8,10 @@ from ._accounts_operations import AccountsOperations from ._maps_operations import MapsOperations -from ._private_atlases_operations import PrivateAtlasesOperations from ._creators_operations import CreatorsOperations __all__ = [ 'AccountsOperations', 'MapsOperations', - 'PrivateAtlasesOperations', 'CreatorsOperations', ] diff --git a/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/aio/operations/_accounts_operations.py b/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/aio/operations/_accounts_operations.py index 9326a6fab9876..f490f27ba4c71 100644 --- a/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/aio/operations/_accounts_operations.py +++ b/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/aio/operations/_accounts_operations.py @@ -45,7 +45,7 @@ async def create_or_update( self, resource_group_name: str, account_name: str, - maps_account_create_parameters: "_models.MapsAccountCreateParameters", + maps_account: "_models.MapsAccount", **kwargs ) -> "_models.MapsAccount": """Create or update a Maps Account. A Maps Account holds the keys which allow access to the Maps @@ -55,8 +55,8 @@ async def create_or_update( :type resource_group_name: str :param account_name: The name of the Maps Account. :type account_name: str - :param maps_account_create_parameters: The new or updated parameters for the Maps Account. - :type maps_account_create_parameters: ~azure.mgmt.maps.models.MapsAccountCreateParameters + :param maps_account: The new or updated parameters for the Maps Account. + :type maps_account: ~azure.mgmt.maps.models.MapsAccount :keyword callable cls: A custom type or function that will be passed the direct response :return: MapsAccount, or the result of cls(response) :rtype: ~azure.mgmt.maps.models.MapsAccount @@ -67,7 +67,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01-preview" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -90,7 +90,7 @@ async def create_or_update( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(maps_account_create_parameters, 'MapsAccountCreateParameters') + body_content = self._serialize.body(maps_account, 'MapsAccount') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) @@ -121,7 +121,7 @@ async def update( **kwargs ) -> "_models.MapsAccount": """Updates a Maps Account. Only a subset of the parameters may be updated after creation, such as - Sku and Tags. + Sku, Tags, Properties. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str @@ -139,7 +139,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01-preview" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -203,7 +203,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -259,7 +259,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -315,7 +315,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -347,7 +347,7 @@ async def extract_data(pipeline_response): list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) - return None, AsyncList(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) @@ -383,7 +383,7 @@ def list_by_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -414,7 +414,7 @@ async def extract_data(pipeline_response): list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) - return None, AsyncList(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) @@ -458,7 +458,7 @@ async def list_keys( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -521,7 +521,7 @@ async def regenerate_keys( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01-preview" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/aio/operations/_creators_operations.py b/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/aio/operations/_creators_operations.py index 48ccb5866b4e8..62ff66435877c 100644 --- a/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/aio/operations/_creators_operations.py +++ b/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/aio/operations/_creators_operations.py @@ -63,7 +63,7 @@ def list_by_account( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -96,7 +96,7 @@ async def extract_data(pipeline_response): list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) - return None, AsyncList(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) @@ -121,7 +121,7 @@ async def create_or_update( resource_group_name: str, account_name: str, creator_name: str, - creator_create_parameters: "_models.CreatorCreateParameters", + creator_resource: "_models.Creator", **kwargs ) -> "_models.Creator": """Create or update a Maps Creator resource. Creator resource will manage Azure resources required @@ -134,8 +134,8 @@ async def create_or_update( :type account_name: str :param creator_name: The name of the Maps Creator instance. :type creator_name: str - :param creator_create_parameters: The new or updated parameters for the Creator resource. - :type creator_create_parameters: ~azure.mgmt.maps.models.CreatorCreateParameters + :param creator_resource: The new or updated parameters for the Creator resource. + :type creator_resource: ~azure.mgmt.maps.models.Creator :keyword callable cls: A custom type or function that will be passed the direct response :return: Creator, or the result of cls(response) :rtype: ~azure.mgmt.maps.models.Creator @@ -146,7 +146,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01-preview" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -170,7 +170,7 @@ async def create_or_update( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(creator_create_parameters, 'CreatorCreateParameters') + body_content = self._serialize.body(creator_resource, 'Creator') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) @@ -222,7 +222,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01-preview" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -290,7 +290,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -350,7 +350,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL diff --git a/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/aio/operations/_maps_operations.py b/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/aio/operations/_maps_operations.py index edebe5234a2e4..30330b5ac0cdb 100644 --- a/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/aio/operations/_maps_operations.py +++ b/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/aio/operations/_maps_operations.py @@ -57,7 +57,7 @@ def list_operations( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -84,7 +84,7 @@ async def extract_data(pipeline_response): list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) - return None, AsyncList(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) diff --git a/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/aio/operations/_private_atlases_operations.py b/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/aio/operations/_private_atlases_operations.py deleted file mode 100644 index 1636b0e0f0eb1..0000000000000 --- a/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/aio/operations/_private_atlases_operations.py +++ /dev/null @@ -1,390 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class PrivateAtlasesOperations: - """PrivateAtlasesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.maps.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def create_or_update( - self, - resource_group_name: str, - account_name: str, - private_atlas_name: str, - private_atlas_create_parameters: "_models.PrivateAtlasCreateParameters", - **kwargs - ) -> "_models.PrivateAtlas": - """[Deprecated] Create or update a Private Atlas resource. Private Atlas resource will enable the - usage of Azure resources to build a custom set of mapping data. It requires an account to exist - before it can be created. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the Maps Account. - :type account_name: str - :param private_atlas_name: The name of the Private Atlas instance. - :type private_atlas_name: str - :param private_atlas_create_parameters: The new or updated parameters for the Private Atlas - resource. - :type private_atlas_create_parameters: ~azure.mgmt.maps.models.PrivateAtlasCreateParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateAtlas, or the result of cls(response) - :rtype: ~azure.mgmt.maps.models.PrivateAtlas - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateAtlas"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), - 'privateAtlasName': self._serialize.url("private_atlas_name", private_atlas_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(private_atlas_create_parameters, 'PrivateAtlasCreateParameters') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('PrivateAtlas', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('PrivateAtlas', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}/privateAtlases/{privateAtlasName}'} # type: ignore - - async def update( - self, - resource_group_name: str, - account_name: str, - private_atlas_name: str, - private_atlas_update_parameters: "_models.PrivateAtlasUpdateParameters", - **kwargs - ) -> "_models.PrivateAtlas": - """[Deprecated] Updates the Private Atlas resource. Only a subset of the parameters may be updated - after creation, such as Tags. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the Maps Account. - :type account_name: str - :param private_atlas_name: The name of the Private Atlas instance. - :type private_atlas_name: str - :param private_atlas_update_parameters: The updated parameters for the Private Atlas. - :type private_atlas_update_parameters: ~azure.mgmt.maps.models.PrivateAtlasUpdateParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateAtlas, or the result of cls(response) - :rtype: ~azure.mgmt.maps.models.PrivateAtlas - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateAtlas"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), - 'privateAtlasName': self._serialize.url("private_atlas_name", private_atlas_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(private_atlas_update_parameters, 'PrivateAtlasUpdateParameters') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateAtlas', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}/privateAtlases/{privateAtlasName}'} # type: ignore - - async def delete( - self, - resource_group_name: str, - account_name: str, - private_atlas_name: str, - **kwargs - ) -> None: - """[Deprecated] Delete a Private Atlas resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the Maps Account. - :type account_name: str - :param private_atlas_name: The name of the Private Atlas instance. - :type private_atlas_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01-preview" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), - 'privateAtlasName': self._serialize.url("private_atlas_name", private_atlas_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}/privateAtlases/{privateAtlasName}'} # type: ignore - - async def get( - self, - resource_group_name: str, - account_name: str, - private_atlas_name: str, - **kwargs - ) -> "_models.PrivateAtlas": - """[Deprecated] Get a Private Atlas resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the Maps Account. - :type account_name: str - :param private_atlas_name: The name of the Private Atlas instance. - :type private_atlas_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateAtlas, or the result of cls(response) - :rtype: ~azure.mgmt.maps.models.PrivateAtlas - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateAtlas"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), - 'privateAtlasName': self._serialize.url("private_atlas_name", private_atlas_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateAtlas', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}/privateAtlases/{privateAtlasName}'} # type: ignore - - def list_by_account( - self, - resource_group_name: str, - account_name: str, - **kwargs - ) -> AsyncIterable["_models.PrivateAtlasList"]: - """[Deprecated] Get all Private Atlas instances for an Azure Map Account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the Maps Account. - :type account_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PrivateAtlasList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.maps.models.PrivateAtlasList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateAtlasList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_account.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('PrivateAtlasList', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}/privateAtlases'} # type: ignore diff --git a/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/models/__init__.py b/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/models/__init__.py index 16f531bba851b..dd4189539eaa1 100644 --- a/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/models/__init__.py +++ b/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/models/__init__.py @@ -7,95 +7,95 @@ # -------------------------------------------------------------------------- try: + from ._models_py3 import Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties from ._models_py3 import Creator - from ._models_py3 import CreatorCreateParameters from ._models_py3 import CreatorList from ._models_py3 import CreatorProperties from ._models_py3 import CreatorUpdateParameters + from ._models_py3 import Dimension from ._models_py3 import ErrorAdditionalInfo from ._models_py3 import ErrorDetail from ._models_py3 import ErrorResponse + from ._models_py3 import ManagedServiceIdentity from ._models_py3 import MapsAccount - from ._models_py3 import MapsAccountCreateParameters from ._models_py3 import MapsAccountKeys from ._models_py3 import MapsAccountProperties from ._models_py3 import MapsAccountUpdateParameters from ._models_py3 import MapsAccounts from ._models_py3 import MapsKeySpecification from ._models_py3 import MapsOperations - from ._models_py3 import MapsOperationsValueItem - from ._models_py3 import MapsOperationsValueItemDisplay - from ._models_py3 import PrivateAtlas - from ._models_py3 import PrivateAtlasCreateParameters - from ._models_py3 import PrivateAtlasList - from ._models_py3 import PrivateAtlasProperties - from ._models_py3 import PrivateAtlasUpdateParameters + from ._models_py3 import MetricSpecification + from ._models_py3 import OperationDetail + from ._models_py3 import OperationDisplay from ._models_py3 import Resource + from ._models_py3 import ServiceSpecification from ._models_py3 import Sku from ._models_py3 import SystemData from ._models_py3 import TrackedResource except (SyntaxError, ImportError): + from ._models import Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties # type: ignore from ._models import Creator # type: ignore - from ._models import CreatorCreateParameters # type: ignore from ._models import CreatorList # type: ignore from ._models import CreatorProperties # type: ignore from ._models import CreatorUpdateParameters # type: ignore + from ._models import Dimension # type: ignore from ._models import ErrorAdditionalInfo # type: ignore from ._models import ErrorDetail # type: ignore from ._models import ErrorResponse # type: ignore + from ._models import ManagedServiceIdentity # type: ignore from ._models import MapsAccount # type: ignore - from ._models import MapsAccountCreateParameters # type: ignore from ._models import MapsAccountKeys # type: ignore from ._models import MapsAccountProperties # type: ignore from ._models import MapsAccountUpdateParameters # type: ignore from ._models import MapsAccounts # type: ignore from ._models import MapsKeySpecification # type: ignore from ._models import MapsOperations # type: ignore - from ._models import MapsOperationsValueItem # type: ignore - from ._models import MapsOperationsValueItemDisplay # type: ignore - from ._models import PrivateAtlas # type: ignore - from ._models import PrivateAtlasCreateParameters # type: ignore - from ._models import PrivateAtlasList # type: ignore - from ._models import PrivateAtlasProperties # type: ignore - from ._models import PrivateAtlasUpdateParameters # type: ignore + from ._models import MetricSpecification # type: ignore + from ._models import OperationDetail # type: ignore + from ._models import OperationDisplay # type: ignore from ._models import Resource # type: ignore + from ._models import ServiceSpecification # type: ignore from ._models import Sku # type: ignore from ._models import SystemData # type: ignore from ._models import TrackedResource # type: ignore -from ._azure_maps_resource_provider_enums import ( +from ._azure_maps_management_client_enums import ( CreatedByType, KeyType, + Kind, + Name, + ResourceIdentityType, ) __all__ = [ + 'Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties', 'Creator', - 'CreatorCreateParameters', 'CreatorList', 'CreatorProperties', 'CreatorUpdateParameters', + 'Dimension', 'ErrorAdditionalInfo', 'ErrorDetail', 'ErrorResponse', + 'ManagedServiceIdentity', 'MapsAccount', - 'MapsAccountCreateParameters', 'MapsAccountKeys', 'MapsAccountProperties', 'MapsAccountUpdateParameters', 'MapsAccounts', 'MapsKeySpecification', 'MapsOperations', - 'MapsOperationsValueItem', - 'MapsOperationsValueItemDisplay', - 'PrivateAtlas', - 'PrivateAtlasCreateParameters', - 'PrivateAtlasList', - 'PrivateAtlasProperties', - 'PrivateAtlasUpdateParameters', + 'MetricSpecification', + 'OperationDetail', + 'OperationDisplay', 'Resource', + 'ServiceSpecification', 'Sku', 'SystemData', 'TrackedResource', 'CreatedByType', 'KeyType', + 'Kind', + 'Name', + 'ResourceIdentityType', ] diff --git a/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/models/_azure_maps_resource_provider_enums.py b/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/models/_azure_maps_management_client_enums.py similarity index 72% rename from sdk/maps/azure-mgmt-maps/azure/mgmt/maps/models/_azure_maps_resource_provider_enums.py rename to sdk/maps/azure-mgmt-maps/azure/mgmt/maps/models/_azure_maps_management_client_enums.py index 08cc42bb937e6..19d2de5c64beb 100644 --- a/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/models/_azure_maps_resource_provider_enums.py +++ b/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/models/_azure_maps_management_client_enums.py @@ -41,3 +41,27 @@ class KeyType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): PRIMARY = "primary" SECONDARY = "secondary" + +class Kind(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The Kind of the Maps Account. + """ + + GEN1 = "Gen1" + GEN2 = "Gen2" + +class Name(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The name of the SKU, in standard format (such as S0). + """ + + S0 = "S0" + S1 = "S1" + G2 = "G2" + +class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The identity type. + """ + + SYSTEM_ASSIGNED = "SystemAssigned" + USER_ASSIGNED = "UserAssigned" + SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned, UserAssigned" + NONE = "None" diff --git a/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/models/_models.py b/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/models/_models.py index 1300820182c05..519db63b8f39f 100644 --- a/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/models/_models.py +++ b/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/models/_models.py @@ -10,6 +10,36 @@ import msrest.serialization +class Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): + """Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + class Resource(msrest.serialization.Model): """Common fields that are returned in the response for all Azure Resource Manager resources. @@ -111,7 +141,7 @@ class Creator(TrackedResource): :type tags: dict[str, str] :param location: Required. The geo-location where the resource lives. :type location: str - :param properties: The Creator resource properties. + :param properties: Required. The Creator resource properties. :type properties: ~azure.mgmt.maps.models.CreatorProperties """ @@ -120,6 +150,7 @@ class Creator(TrackedResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, + 'properties': {'required': True}, } _attribute_map = { @@ -136,39 +167,7 @@ def __init__( **kwargs ): super(Creator, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class CreatorCreateParameters(msrest.serialization.Model): - """Parameters used to create a new Maps Creator resource. - - All required parameters must be populated in order to send to Azure. - - :param location: Required. The location of the resource. - :type location: str - :param tags: A set of tags. Gets or sets a list of key value pairs that describe the resource. - These tags can be used in viewing and grouping this resource (across resource groups). A - maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 - characters and value no greater than 256 characters. - :type tags: dict[str, str] - """ - - _validation = { - 'location': {'required': True}, - } - - _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(CreatorCreateParameters, self).__init__(**kwargs) - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) + self.properties = kwargs['properties'] class CreatorList(msrest.serialization.Model): @@ -178,6 +177,9 @@ class CreatorList(msrest.serialization.Model): :ivar value: a Creator account. :vartype value: list[~azure.mgmt.maps.models.Creator] + :param next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :type next_link: str """ _validation = { @@ -186,6 +188,7 @@ class CreatorList(msrest.serialization.Model): _attribute_map = { 'value': {'key': 'value', 'type': '[Creator]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( @@ -194,18 +197,32 @@ def __init__( ): super(CreatorList, self).__init__(**kwargs) self.value = None + self.next_link = kwargs.get('next_link', None) class CreatorProperties(msrest.serialization.Model): """Creator resource properties. - :param provisioning_state: The state of the resource provisioning, terminal states: Succeeded, + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar provisioning_state: The state of the resource provisioning, terminal states: Succeeded, Failed, Canceled. - :type provisioning_state: str + :vartype provisioning_state: str + :param storage_units: Required. The storage units to be allocated. Integer values from 1 to + 100, inclusive. + :type storage_units: int """ + _validation = { + 'provisioning_state': {'readonly': True}, + 'storage_units': {'required': True, 'maximum': 100, 'minimum': 1}, + } + _attribute_map = { 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'storage_units': {'key': 'storageUnits', 'type': 'int'}, } def __init__( @@ -213,21 +230,37 @@ def __init__( **kwargs ): super(CreatorProperties, self).__init__(**kwargs) - self.provisioning_state = kwargs.get('provisioning_state', None) + self.provisioning_state = None + self.storage_units = kwargs['storage_units'] class CreatorUpdateParameters(msrest.serialization.Model): """Parameters used to update an existing Creator resource. + Variables are only populated by the server, and will be ignored when sending a request. + :param tags: A set of tags. Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. :type tags: dict[str, str] + :ivar provisioning_state: The state of the resource provisioning, terminal states: Succeeded, + Failed, Canceled. + :vartype provisioning_state: str + :param storage_units: The storage units to be allocated. Integer values from 1 to 100, + inclusive. + :type storage_units: int """ + _validation = { + 'provisioning_state': {'readonly': True}, + 'storage_units': {'maximum': 100, 'minimum': 1}, + } + _attribute_map = { 'tags': {'key': 'tags', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'storage_units': {'key': 'properties.storageUnits', 'type': 'int'}, } def __init__( @@ -236,6 +269,31 @@ def __init__( ): super(CreatorUpdateParameters, self).__init__(**kwargs) self.tags = kwargs.get('tags', None) + self.provisioning_state = None + self.storage_units = kwargs.get('storage_units', None) + + +class Dimension(msrest.serialization.Model): + """Dimension of map account, for example API Category, Api Name, Result Type, and Response Code. + + :param name: Display name of dimension. + :type name: str + :param display_name: Display name of dimension. + :type display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Dimension, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) class ErrorAdditionalInfo(msrest.serialization.Model): @@ -246,7 +304,7 @@ class ErrorAdditionalInfo(msrest.serialization.Model): :ivar type: The additional info type. :vartype type: str :ivar info: The additional info. - :vartype info: object + :vartype info: str """ _validation = { @@ -256,7 +314,7 @@ class ErrorAdditionalInfo(msrest.serialization.Model): _attribute_map = { 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, + 'info': {'key': 'info', 'type': 'str'}, } def __init__( @@ -332,6 +390,48 @@ def __init__( self.error = kwargs.get('error', None) +class ManagedServiceIdentity(msrest.serialization.Model): + """Identity for the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type: The identity type. Possible values include: "SystemAssigned", "UserAssigned", + "SystemAssigned, UserAssigned", "None". + :type type: str or ~azure.mgmt.maps.models.ResourceIdentityType + :param user_assigned_identities: The list of user identities associated with the resource. The + user identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.maps.models.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties] + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedServiceIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = kwargs.get('type', None) + self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + + class MapsAccount(TrackedResource): """An Azure resource which represents access to a suite of Maps REST APIs. @@ -351,12 +451,17 @@ class MapsAccount(TrackedResource): :type tags: dict[str, str] :param location: Required. The geo-location where the resource lives. :type location: str - :ivar sku: The SKU of this account. - :vartype sku: ~azure.mgmt.maps.models.Sku + :param sku: Required. The SKU of this account. + :type sku: ~azure.mgmt.maps.models.Sku + :param kind: Get or Set Kind property. Possible values include: "Gen1", "Gen2". Default value: + "Gen1". + :type kind: str or ~azure.mgmt.maps.models.Kind :ivar system_data: The system meta data relating to this resource. :vartype system_data: ~azure.mgmt.maps.models.SystemData - :ivar properties: The map account properties. - :vartype properties: ~azure.mgmt.maps.models.MapsAccountProperties + :param identity: Sets the identity property for maps account. + :type identity: ~azure.mgmt.maps.models.ManagedServiceIdentity + :param properties: The map account properties. + :type properties: ~azure.mgmt.maps.models.MapsAccountProperties """ _validation = { @@ -364,9 +469,8 @@ class MapsAccount(TrackedResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, - 'sku': {'readonly': True}, + 'sku': {'required': True}, 'system_data': {'readonly': True}, - 'properties': {'readonly': True}, } _attribute_map = { @@ -376,7 +480,9 @@ class MapsAccount(TrackedResource): 'tags': {'key': 'tags', 'type': '{str}'}, 'location': {'key': 'location', 'type': 'str'}, 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, 'properties': {'key': 'properties', 'type': 'MapsAccountProperties'}, } @@ -385,45 +491,11 @@ def __init__( **kwargs ): super(MapsAccount, self).__init__(**kwargs) - self.sku = None - self.system_data = None - self.properties = None - - -class MapsAccountCreateParameters(msrest.serialization.Model): - """Parameters used to create a new Maps Account. - - All required parameters must be populated in order to send to Azure. - - :param location: Required. The location of the resource. - :type location: str - :param tags: A set of tags. Gets or sets a list of key value pairs that describe the resource. - These tags can be used in viewing and grouping this resource (across resource groups). Each tag - must have a key no greater than 128 characters and value no greater than 256 characters. - :type tags: dict[str, str] - :param sku: Required. The SKU of this account. - :type sku: ~azure.mgmt.maps.models.Sku - """ - - _validation = { - 'location': {'required': True}, - 'sku': {'required': True}, - } - - _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - super(MapsAccountCreateParameters, self).__init__(**kwargs) - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) self.sku = kwargs['sku'] + self.kind = kwargs.get('kind', "Gen1") + self.system_data = None + self.identity = kwargs.get('identity', None) + self.properties = kwargs.get('properties', None) class MapsAccountKeys(msrest.serialization.Model): @@ -431,24 +503,28 @@ class MapsAccountKeys(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: The full Azure resource identifier of the Maps Account. - :vartype id: str + :ivar primary_key_last_updated: The last updated date and time of the primary key. + :vartype primary_key_last_updated: str :ivar primary_key: The primary key for accessing the Maps REST APIs. :vartype primary_key: str :ivar secondary_key: The secondary key for accessing the Maps REST APIs. :vartype secondary_key: str + :ivar secondary_key_last_updated: The last updated date and time of the secondary key. + :vartype secondary_key_last_updated: str """ _validation = { - 'id': {'readonly': True}, + 'primary_key_last_updated': {'readonly': True}, 'primary_key': {'readonly': True}, 'secondary_key': {'readonly': True}, + 'secondary_key_last_updated': {'readonly': True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + 'primary_key_last_updated': {'key': 'primaryKeyLastUpdated', 'type': 'str'}, 'primary_key': {'key': 'primaryKey', 'type': 'str'}, 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, + 'secondary_key_last_updated': {'key': 'secondaryKeyLastUpdated', 'type': 'str'}, } def __init__( @@ -456,20 +532,39 @@ def __init__( **kwargs ): super(MapsAccountKeys, self).__init__(**kwargs) - self.id = None + self.primary_key_last_updated = None self.primary_key = None self.secondary_key = None + self.secondary_key_last_updated = None class MapsAccountProperties(msrest.serialization.Model): """Additional Map account properties. - :param x_ms_client_id: A unique identifier for the maps account. - :type x_ms_client_id: str + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar unique_id: A unique identifier for the maps account. + :vartype unique_id: str + :param disable_local_auth: Allows toggle functionality on Azure Policy to disable Azure Maps + local authentication support. This will disable Shared Keys authentication from any usage. + :type disable_local_auth: bool + :ivar provisioning_state: The provisioning state of the Map account resource. + :vartype provisioning_state: str + :param linked_resources: Sets the resources to be used for Managed Identities based operations + for the Map account resource. + :type linked_resources: dict[str, str] """ + _validation = { + 'unique_id': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + _attribute_map = { - 'x_ms_client_id': {'key': 'x-ms-client-id', 'type': 'str'}, + 'unique_id': {'key': 'uniqueId', 'type': 'str'}, + 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'linked_resources': {'key': 'linkedResources', 'type': '{str}'}, } def __init__( @@ -477,7 +572,10 @@ def __init__( **kwargs ): super(MapsAccountProperties, self).__init__(**kwargs) - self.x_ms_client_id = kwargs.get('x_ms_client_id', None) + self.unique_id = None + self.disable_local_auth = kwargs.get('disable_local_auth', False) + self.provisioning_state = None + self.linked_resources = kwargs.get('linked_resources', None) class MapsAccounts(msrest.serialization.Model): @@ -487,6 +585,9 @@ class MapsAccounts(msrest.serialization.Model): :ivar value: a Maps Account. :vartype value: list[~azure.mgmt.maps.models.MapsAccount] + :param next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :type next_link: str """ _validation = { @@ -495,6 +596,7 @@ class MapsAccounts(msrest.serialization.Model): _attribute_map = { 'value': {'key': 'value', 'type': '[MapsAccount]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( @@ -503,23 +605,52 @@ def __init__( ): super(MapsAccounts, self).__init__(**kwargs) self.value = None + self.next_link = kwargs.get('next_link', None) class MapsAccountUpdateParameters(msrest.serialization.Model): """Parameters used to update an existing Maps Account. + Variables are only populated by the server, and will be ignored when sending a request. + :param tags: A set of tags. Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. :type tags: dict[str, str] + :param kind: Get or Set Kind property. Possible values include: "Gen1", "Gen2". Default value: + "Gen1". + :type kind: str or ~azure.mgmt.maps.models.Kind :param sku: The SKU of this account. :type sku: ~azure.mgmt.maps.models.Sku + :param identity: Sets the identity property for maps account. + :type identity: ~azure.mgmt.maps.models.ManagedServiceIdentity + :ivar unique_id: A unique identifier for the maps account. + :vartype unique_id: str + :param disable_local_auth: Allows toggle functionality on Azure Policy to disable Azure Maps + local authentication support. This will disable Shared Keys authentication from any usage. + :type disable_local_auth: bool + :ivar provisioning_state: The provisioning state of the Map account resource. + :vartype provisioning_state: str + :param linked_resources: Sets the resources to be used for Managed Identities based operations + for the Map account resource. + :type linked_resources: dict[str, str] """ + _validation = { + 'unique_id': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + _attribute_map = { 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, + 'unique_id': {'key': 'properties.uniqueId', 'type': 'str'}, + 'disable_local_auth': {'key': 'properties.disableLocalAuth', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'linked_resources': {'key': 'properties.linkedResources', 'type': '{str}'}, } def __init__( @@ -528,7 +659,13 @@ def __init__( ): super(MapsAccountUpdateParameters, self).__init__(**kwargs) self.tags = kwargs.get('tags', None) + self.kind = kwargs.get('kind', "Gen1") self.sku = kwargs.get('sku', None) + self.identity = kwargs.get('identity', None) + self.unique_id = None + self.disable_local_auth = kwargs.get('disable_local_auth', False) + self.provisioning_state = None + self.linked_resources = kwargs.get('linked_resources', None) class MapsKeySpecification(msrest.serialization.Model): @@ -563,7 +700,10 @@ class MapsOperations(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: An operation available for Maps. - :vartype value: list[~azure.mgmt.maps.models.MapsOperationsValueItem] + :vartype value: list[~azure.mgmt.maps.models.OperationDetail] + :param next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :type next_link: str """ _validation = { @@ -571,7 +711,8 @@ class MapsOperations(msrest.serialization.Model): } _attribute_map = { - 'value': {'key': 'value', 'type': '[MapsOperationsValueItem]'}, + 'value': {'key': 'value', 'type': '[OperationDetail]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( @@ -580,226 +721,143 @@ def __init__( ): super(MapsOperations, self).__init__(**kwargs) self.value = None + self.next_link = kwargs.get('next_link', None) -class MapsOperationsValueItem(msrest.serialization.Model): - """MapsOperationsValueItem. - - Variables are only populated by the server, and will be ignored when sending a request. +class MetricSpecification(msrest.serialization.Model): + """Metric specification of operation. - :ivar name: Operation name: {provider}/{resource}/{operation}. - :vartype name: str - :param display: The human-readable description of the operation. - :type display: ~azure.mgmt.maps.models.MapsOperationsValueItemDisplay - :ivar origin: The origin of the operation. - :vartype origin: str + :param name: Name of metric specification. + :type name: str + :param display_name: Display name of metric specification. + :type display_name: str + :param display_description: Display description of metric specification. + :type display_description: str + :param unit: Unit could be Count. + :type unit: str + :param dimensions: Dimensions of map account. + :type dimensions: list[~azure.mgmt.maps.models.Dimension] + :param aggregation_type: Aggregation type could be Average. + :type aggregation_type: str + :param fill_gap_with_zero: The property to decide fill gap with zero or not. + :type fill_gap_with_zero: bool + :param category: The category this metric specification belong to, could be Capacity. + :type category: str + :param resource_id_dimension_name_override: Account Resource Id. + :type resource_id_dimension_name_override: str """ - _validation = { - 'name': {'readonly': True}, - 'origin': {'readonly': True}, - } - _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'MapsOperationsValueItemDisplay'}, - 'origin': {'key': 'origin', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'category': {'key': 'category', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, } def __init__( self, **kwargs ): - super(MapsOperationsValueItem, self).__init__(**kwargs) - self.name = None - self.display = kwargs.get('display', None) - self.origin = None - - -class MapsOperationsValueItemDisplay(msrest.serialization.Model): - """The human-readable description of the operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar provider: Service provider: Microsoft Maps. - :vartype provider: str - :ivar resource: Resource on which the operation is performed. - :vartype resource: str - :ivar operation: The action that users can perform, based on their permission level. - :vartype operation: str - :ivar description: The description of the operation. - :vartype description: str - """ - - _validation = { - 'provider': {'readonly': True}, - 'resource': {'readonly': True}, - 'operation': {'readonly': True}, - 'description': {'readonly': True}, - } - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MapsOperationsValueItemDisplay, self).__init__(**kwargs) - self.provider = None - self.resource = None - self.operation = None - self.description = None - - -class PrivateAtlas(TrackedResource): - """An Azure resource which represents which will provision the ability to create private location data. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives. - :type location: str - :param properties: The Private Atlas resource properties. - :type properties: ~azure.mgmt.maps.models.PrivateAtlasProperties + super(MetricSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.dimensions = kwargs.get('dimensions', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) + self.category = kwargs.get('category', None) + self.resource_id_dimension_name_override = kwargs.get('resource_id_dimension_name_override', None) + + +class OperationDetail(msrest.serialization.Model): + """Operation detail payload. + + :param name: Name of the operation. + :type name: str + :param is_data_action: Indicates whether the operation is a data action. + :type is_data_action: bool + :param display: Display of the operation. + :type display: ~azure.mgmt.maps.models.OperationDisplay + :param origin: Origin of the operation. + :type origin: str + :param service_specification: One property of operation, include metric specifications. + :type service_specification: ~azure.mgmt.maps.models.ServiceSpecification """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'PrivateAtlasProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateAtlas, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class PrivateAtlasCreateParameters(msrest.serialization.Model): - """Parameters used to create a new Private Atlas resource. - - All required parameters must be populated in order to send to Azure. - - :param location: Required. The location of the resource. - :type location: str - :param tags: A set of tags. Gets or sets a list of key value pairs that describe the resource. - These tags can be used in viewing and grouping this resource (across resource groups). A - maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 - characters and value no greater than 256 characters. - :type tags: dict[str, str] - """ - - _validation = { - 'location': {'required': True}, - } - - _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateAtlasCreateParameters, self).__init__(**kwargs) - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - - -class PrivateAtlasList(msrest.serialization.Model): - """A list of Private Atlas resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: a Private Atlas. - :vartype value: list[~azure.mgmt.maps.models.PrivateAtlas] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateAtlas]'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, } def __init__( self, **kwargs ): - super(PrivateAtlasList, self).__init__(**kwargs) - self.value = None + super(OperationDetail, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.is_data_action = kwargs.get('is_data_action', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.service_specification = kwargs.get('service_specification', None) -class PrivateAtlasProperties(msrest.serialization.Model): - """Private Atlas resource properties. +class OperationDisplay(msrest.serialization.Model): + """Operation display payload. - :param provisioning_state: The state of the resource provisioning, terminal states: Succeeded, - Failed, Canceled. - :type provisioning_state: str + :param provider: Resource provider of the operation. + :type provider: str + :param resource: Resource of the operation. + :type resource: str + :param operation: Localized friendly name for the operation. + :type operation: str + :param description: Localized friendly description for the operation. + :type description: str """ _attribute_map = { - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, } def __init__( self, **kwargs ): - super(PrivateAtlasProperties, self).__init__(**kwargs) - self.provisioning_state = kwargs.get('provisioning_state', None) + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) -class PrivateAtlasUpdateParameters(msrest.serialization.Model): - """Parameters used to update an existing Private Atlas resource. +class ServiceSpecification(msrest.serialization.Model): + """One property of operation, include metric specifications. - :param tags: A set of tags. Gets or sets a list of key value pairs that describe the resource. - These tags can be used in viewing and grouping this resource (across resource groups). A - maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 - characters and value no greater than 256 characters. - :type tags: dict[str, str] + :param metric_specifications: Metric specifications of operation. + :type metric_specifications: list[~azure.mgmt.maps.models.MetricSpecification] """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, } def __init__( self, **kwargs ): - super(PrivateAtlasUpdateParameters, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = kwargs.get('metric_specifications', None) class Sku(msrest.serialization.Model): @@ -809,8 +867,9 @@ class Sku(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the SKU, in standard format (such as S0). - :type name: str + :param name: Required. The name of the SKU, in standard format (such as S0). Possible values + include: "S0", "S1", "G2". + :type name: str or ~azure.mgmt.maps.models.Name :ivar tier: Gets the sku tier. This is based on the SKU name. :vartype tier: str """ diff --git a/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/models/_models_py3.py b/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/models/_models_py3.py index 6d4ec7d0f6965..56f6a9cdfbb6e 100644 --- a/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/models/_models_py3.py +++ b/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/models/_models_py3.py @@ -7,12 +7,42 @@ # -------------------------------------------------------------------------- import datetime -from typing import Dict, Optional, Union +from typing import Dict, List, Optional, Union from azure.core.exceptions import HttpResponseError import msrest.serialization -from ._azure_maps_resource_provider_enums import * +from ._azure_maps_management_client_enums import * + + +class Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): + """Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None class Resource(msrest.serialization.Model): @@ -119,7 +149,7 @@ class Creator(TrackedResource): :type tags: dict[str, str] :param location: Required. The geo-location where the resource lives. :type location: str - :param properties: The Creator resource properties. + :param properties: Required. The Creator resource properties. :type properties: ~azure.mgmt.maps.models.CreatorProperties """ @@ -128,6 +158,7 @@ class Creator(TrackedResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, + 'properties': {'required': True}, } _attribute_map = { @@ -143,49 +174,14 @@ def __init__( self, *, location: str, + properties: "CreatorProperties", tags: Optional[Dict[str, str]] = None, - properties: Optional["CreatorProperties"] = None, **kwargs ): super(Creator, self).__init__(tags=tags, location=location, **kwargs) self.properties = properties -class CreatorCreateParameters(msrest.serialization.Model): - """Parameters used to create a new Maps Creator resource. - - All required parameters must be populated in order to send to Azure. - - :param location: Required. The location of the resource. - :type location: str - :param tags: A set of tags. Gets or sets a list of key value pairs that describe the resource. - These tags can be used in viewing and grouping this resource (across resource groups). A - maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 - characters and value no greater than 256 characters. - :type tags: dict[str, str] - """ - - _validation = { - 'location': {'required': True}, - } - - _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - super(CreatorCreateParameters, self).__init__(**kwargs) - self.location = location - self.tags = tags - - class CreatorList(msrest.serialization.Model): """A list of Creator resources. @@ -193,6 +189,9 @@ class CreatorList(msrest.serialization.Model): :ivar value: a Creator account. :vartype value: list[~azure.mgmt.maps.models.Creator] + :param next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :type next_link: str """ _validation = { @@ -201,60 +200,122 @@ class CreatorList(msrest.serialization.Model): _attribute_map = { 'value': {'key': 'value', 'type': '[Creator]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, + *, + next_link: Optional[str] = None, **kwargs ): super(CreatorList, self).__init__(**kwargs) self.value = None + self.next_link = next_link class CreatorProperties(msrest.serialization.Model): """Creator resource properties. - :param provisioning_state: The state of the resource provisioning, terminal states: Succeeded, + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar provisioning_state: The state of the resource provisioning, terminal states: Succeeded, Failed, Canceled. - :type provisioning_state: str + :vartype provisioning_state: str + :param storage_units: Required. The storage units to be allocated. Integer values from 1 to + 100, inclusive. + :type storage_units: int """ + _validation = { + 'provisioning_state': {'readonly': True}, + 'storage_units': {'required': True, 'maximum': 100, 'minimum': 1}, + } + _attribute_map = { 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'storage_units': {'key': 'storageUnits', 'type': 'int'}, } def __init__( self, *, - provisioning_state: Optional[str] = None, + storage_units: int, **kwargs ): super(CreatorProperties, self).__init__(**kwargs) - self.provisioning_state = provisioning_state + self.provisioning_state = None + self.storage_units = storage_units class CreatorUpdateParameters(msrest.serialization.Model): """Parameters used to update an existing Creator resource. + Variables are only populated by the server, and will be ignored when sending a request. + :param tags: A set of tags. Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. :type tags: dict[str, str] + :ivar provisioning_state: The state of the resource provisioning, terminal states: Succeeded, + Failed, Canceled. + :vartype provisioning_state: str + :param storage_units: The storage units to be allocated. Integer values from 1 to 100, + inclusive. + :type storage_units: int """ + _validation = { + 'provisioning_state': {'readonly': True}, + 'storage_units': {'maximum': 100, 'minimum': 1}, + } + _attribute_map = { 'tags': {'key': 'tags', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'storage_units': {'key': 'properties.storageUnits', 'type': 'int'}, } def __init__( self, *, tags: Optional[Dict[str, str]] = None, + storage_units: Optional[int] = None, **kwargs ): super(CreatorUpdateParameters, self).__init__(**kwargs) self.tags = tags + self.provisioning_state = None + self.storage_units = storage_units + + +class Dimension(msrest.serialization.Model): + """Dimension of map account, for example API Category, Api Name, Result Type, and Response Code. + + :param name: Display name of dimension. + :type name: str + :param display_name: Display name of dimension. + :type display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display_name: Optional[str] = None, + **kwargs + ): + super(Dimension, self).__init__(**kwargs) + self.name = name + self.display_name = display_name class ErrorAdditionalInfo(msrest.serialization.Model): @@ -265,7 +326,7 @@ class ErrorAdditionalInfo(msrest.serialization.Model): :ivar type: The additional info type. :vartype type: str :ivar info: The additional info. - :vartype info: object + :vartype info: str """ _validation = { @@ -275,7 +336,7 @@ class ErrorAdditionalInfo(msrest.serialization.Model): _attribute_map = { 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, + 'info': {'key': 'info', 'type': 'str'}, } def __init__( @@ -353,6 +414,51 @@ def __init__( self.error = error +class ManagedServiceIdentity(msrest.serialization.Model): + """Identity for the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type: The identity type. Possible values include: "SystemAssigned", "UserAssigned", + "SystemAssigned, UserAssigned", "None". + :type type: str or ~azure.mgmt.maps.models.ResourceIdentityType + :param user_assigned_identities: The list of user identities associated with the resource. The + user identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.maps.models.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties] + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "ResourceIdentityType"]] = None, + user_assigned_identities: Optional[Dict[str, "Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, + **kwargs + ): + super(ManagedServiceIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + self.user_assigned_identities = user_assigned_identities + + class MapsAccount(TrackedResource): """An Azure resource which represents access to a suite of Maps REST APIs. @@ -372,12 +478,17 @@ class MapsAccount(TrackedResource): :type tags: dict[str, str] :param location: Required. The geo-location where the resource lives. :type location: str - :ivar sku: The SKU of this account. - :vartype sku: ~azure.mgmt.maps.models.Sku + :param sku: Required. The SKU of this account. + :type sku: ~azure.mgmt.maps.models.Sku + :param kind: Get or Set Kind property. Possible values include: "Gen1", "Gen2". Default value: + "Gen1". + :type kind: str or ~azure.mgmt.maps.models.Kind :ivar system_data: The system meta data relating to this resource. :vartype system_data: ~azure.mgmt.maps.models.SystemData - :ivar properties: The map account properties. - :vartype properties: ~azure.mgmt.maps.models.MapsAccountProperties + :param identity: Sets the identity property for maps account. + :type identity: ~azure.mgmt.maps.models.ManagedServiceIdentity + :param properties: The map account properties. + :type properties: ~azure.mgmt.maps.models.MapsAccountProperties """ _validation = { @@ -385,9 +496,8 @@ class MapsAccount(TrackedResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, - 'sku': {'readonly': True}, + 'sku': {'required': True}, 'system_data': {'readonly': True}, - 'properties': {'readonly': True}, } _attribute_map = { @@ -397,61 +507,29 @@ class MapsAccount(TrackedResource): 'tags': {'key': 'tags', 'type': '{str}'}, 'location': {'key': 'location', 'type': 'str'}, 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, 'properties': {'key': 'properties', 'type': 'MapsAccountProperties'}, } - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - super(MapsAccount, self).__init__(tags=tags, location=location, **kwargs) - self.sku = None - self.system_data = None - self.properties = None - - -class MapsAccountCreateParameters(msrest.serialization.Model): - """Parameters used to create a new Maps Account. - - All required parameters must be populated in order to send to Azure. - - :param location: Required. The location of the resource. - :type location: str - :param tags: A set of tags. Gets or sets a list of key value pairs that describe the resource. - These tags can be used in viewing and grouping this resource (across resource groups). Each tag - must have a key no greater than 128 characters and value no greater than 256 characters. - :type tags: dict[str, str] - :param sku: Required. The SKU of this account. - :type sku: ~azure.mgmt.maps.models.Sku - """ - - _validation = { - 'location': {'required': True}, - 'sku': {'required': True}, - } - - _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - def __init__( self, *, location: str, sku: "Sku", tags: Optional[Dict[str, str]] = None, + kind: Optional[Union[str, "Kind"]] = "Gen1", + identity: Optional["ManagedServiceIdentity"] = None, + properties: Optional["MapsAccountProperties"] = None, **kwargs ): - super(MapsAccountCreateParameters, self).__init__(**kwargs) - self.location = location - self.tags = tags + super(MapsAccount, self).__init__(tags=tags, location=location, **kwargs) self.sku = sku + self.kind = kind + self.system_data = None + self.identity = identity + self.properties = properties class MapsAccountKeys(msrest.serialization.Model): @@ -459,24 +537,28 @@ class MapsAccountKeys(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: The full Azure resource identifier of the Maps Account. - :vartype id: str + :ivar primary_key_last_updated: The last updated date and time of the primary key. + :vartype primary_key_last_updated: str :ivar primary_key: The primary key for accessing the Maps REST APIs. :vartype primary_key: str :ivar secondary_key: The secondary key for accessing the Maps REST APIs. :vartype secondary_key: str + :ivar secondary_key_last_updated: The last updated date and time of the secondary key. + :vartype secondary_key_last_updated: str """ _validation = { - 'id': {'readonly': True}, + 'primary_key_last_updated': {'readonly': True}, 'primary_key': {'readonly': True}, 'secondary_key': {'readonly': True}, + 'secondary_key_last_updated': {'readonly': True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + 'primary_key_last_updated': {'key': 'primaryKeyLastUpdated', 'type': 'str'}, 'primary_key': {'key': 'primaryKey', 'type': 'str'}, 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, + 'secondary_key_last_updated': {'key': 'secondaryKeyLastUpdated', 'type': 'str'}, } def __init__( @@ -484,30 +566,53 @@ def __init__( **kwargs ): super(MapsAccountKeys, self).__init__(**kwargs) - self.id = None + self.primary_key_last_updated = None self.primary_key = None self.secondary_key = None + self.secondary_key_last_updated = None class MapsAccountProperties(msrest.serialization.Model): """Additional Map account properties. - :param x_ms_client_id: A unique identifier for the maps account. - :type x_ms_client_id: str + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar unique_id: A unique identifier for the maps account. + :vartype unique_id: str + :param disable_local_auth: Allows toggle functionality on Azure Policy to disable Azure Maps + local authentication support. This will disable Shared Keys authentication from any usage. + :type disable_local_auth: bool + :ivar provisioning_state: The provisioning state of the Map account resource. + :vartype provisioning_state: str + :param linked_resources: Sets the resources to be used for Managed Identities based operations + for the Map account resource. + :type linked_resources: dict[str, str] """ + _validation = { + 'unique_id': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + _attribute_map = { - 'x_ms_client_id': {'key': 'x-ms-client-id', 'type': 'str'}, + 'unique_id': {'key': 'uniqueId', 'type': 'str'}, + 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'linked_resources': {'key': 'linkedResources', 'type': '{str}'}, } def __init__( self, *, - x_ms_client_id: Optional[str] = None, + disable_local_auth: Optional[bool] = False, + linked_resources: Optional[Dict[str, str]] = None, **kwargs ): super(MapsAccountProperties, self).__init__(**kwargs) - self.x_ms_client_id = x_ms_client_id + self.unique_id = None + self.disable_local_auth = disable_local_auth + self.provisioning_state = None + self.linked_resources = linked_resources class MapsAccounts(msrest.serialization.Model): @@ -517,6 +622,9 @@ class MapsAccounts(msrest.serialization.Model): :ivar value: a Maps Account. :vartype value: list[~azure.mgmt.maps.models.MapsAccount] + :param next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :type next_link: str """ _validation = { @@ -525,43 +633,85 @@ class MapsAccounts(msrest.serialization.Model): _attribute_map = { 'value': {'key': 'value', 'type': '[MapsAccount]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, + *, + next_link: Optional[str] = None, **kwargs ): super(MapsAccounts, self).__init__(**kwargs) self.value = None + self.next_link = next_link class MapsAccountUpdateParameters(msrest.serialization.Model): """Parameters used to update an existing Maps Account. + Variables are only populated by the server, and will be ignored when sending a request. + :param tags: A set of tags. Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. :type tags: dict[str, str] + :param kind: Get or Set Kind property. Possible values include: "Gen1", "Gen2". Default value: + "Gen1". + :type kind: str or ~azure.mgmt.maps.models.Kind :param sku: The SKU of this account. :type sku: ~azure.mgmt.maps.models.Sku + :param identity: Sets the identity property for maps account. + :type identity: ~azure.mgmt.maps.models.ManagedServiceIdentity + :ivar unique_id: A unique identifier for the maps account. + :vartype unique_id: str + :param disable_local_auth: Allows toggle functionality on Azure Policy to disable Azure Maps + local authentication support. This will disable Shared Keys authentication from any usage. + :type disable_local_auth: bool + :ivar provisioning_state: The provisioning state of the Map account resource. + :vartype provisioning_state: str + :param linked_resources: Sets the resources to be used for Managed Identities based operations + for the Map account resource. + :type linked_resources: dict[str, str] """ + _validation = { + 'unique_id': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + _attribute_map = { 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, + 'unique_id': {'key': 'properties.uniqueId', 'type': 'str'}, + 'disable_local_auth': {'key': 'properties.disableLocalAuth', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'linked_resources': {'key': 'properties.linkedResources', 'type': '{str}'}, } def __init__( self, *, tags: Optional[Dict[str, str]] = None, + kind: Optional[Union[str, "Kind"]] = "Gen1", sku: Optional["Sku"] = None, + identity: Optional["ManagedServiceIdentity"] = None, + disable_local_auth: Optional[bool] = False, + linked_resources: Optional[Dict[str, str]] = None, **kwargs ): super(MapsAccountUpdateParameters, self).__init__(**kwargs) self.tags = tags + self.kind = kind self.sku = sku + self.identity = identity + self.unique_id = None + self.disable_local_auth = disable_local_auth + self.provisioning_state = None + self.linked_resources = linked_resources class MapsKeySpecification(msrest.serialization.Model): @@ -598,7 +748,10 @@ class MapsOperations(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: An operation available for Maps. - :vartype value: list[~azure.mgmt.maps.models.MapsOperationsValueItem] + :vartype value: list[~azure.mgmt.maps.models.OperationDetail] + :param next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :type next_link: str """ _validation = { @@ -606,248 +759,178 @@ class MapsOperations(msrest.serialization.Model): } _attribute_map = { - 'value': {'key': 'value', 'type': '[MapsOperationsValueItem]'}, + 'value': {'key': 'value', 'type': '[OperationDetail]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, + *, + next_link: Optional[str] = None, **kwargs ): super(MapsOperations, self).__init__(**kwargs) self.value = None + self.next_link = next_link -class MapsOperationsValueItem(msrest.serialization.Model): - """MapsOperationsValueItem. +class MetricSpecification(msrest.serialization.Model): + """Metric specification of operation. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Operation name: {provider}/{resource}/{operation}. - :vartype name: str - :param display: The human-readable description of the operation. - :type display: ~azure.mgmt.maps.models.MapsOperationsValueItemDisplay - :ivar origin: The origin of the operation. - :vartype origin: str + :param name: Name of metric specification. + :type name: str + :param display_name: Display name of metric specification. + :type display_name: str + :param display_description: Display description of metric specification. + :type display_description: str + :param unit: Unit could be Count. + :type unit: str + :param dimensions: Dimensions of map account. + :type dimensions: list[~azure.mgmt.maps.models.Dimension] + :param aggregation_type: Aggregation type could be Average. + :type aggregation_type: str + :param fill_gap_with_zero: The property to decide fill gap with zero or not. + :type fill_gap_with_zero: bool + :param category: The category this metric specification belong to, could be Capacity. + :type category: str + :param resource_id_dimension_name_override: Account Resource Id. + :type resource_id_dimension_name_override: str """ - _validation = { - 'name': {'readonly': True}, - 'origin': {'readonly': True}, - } - _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'MapsOperationsValueItemDisplay'}, - 'origin': {'key': 'origin', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'category': {'key': 'category', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, } def __init__( self, *, - display: Optional["MapsOperationsValueItemDisplay"] = None, - **kwargs - ): - super(MapsOperationsValueItem, self).__init__(**kwargs) - self.name = None - self.display = display - self.origin = None - - -class MapsOperationsValueItemDisplay(msrest.serialization.Model): - """The human-readable description of the operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar provider: Service provider: Microsoft Maps. - :vartype provider: str - :ivar resource: Resource on which the operation is performed. - :vartype resource: str - :ivar operation: The action that users can perform, based on their permission level. - :vartype operation: str - :ivar description: The description of the operation. - :vartype description: str - """ - - _validation = { - 'provider': {'readonly': True}, - 'resource': {'readonly': True}, - 'operation': {'readonly': True}, - 'description': {'readonly': True}, - } - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, + name: Optional[str] = None, + display_name: Optional[str] = None, + display_description: Optional[str] = None, + unit: Optional[str] = None, + dimensions: Optional[List["Dimension"]] = None, + aggregation_type: Optional[str] = None, + fill_gap_with_zero: Optional[bool] = None, + category: Optional[str] = None, + resource_id_dimension_name_override: Optional[str] = None, **kwargs ): - super(MapsOperationsValueItemDisplay, self).__init__(**kwargs) - self.provider = None - self.resource = None - self.operation = None - self.description = None - - -class PrivateAtlas(TrackedResource): - """An Azure resource which represents which will provision the ability to create private location data. + super(MetricSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.dimensions = dimensions + self.aggregation_type = aggregation_type + self.fill_gap_with_zero = fill_gap_with_zero + self.category = category + self.resource_id_dimension_name_override = resource_id_dimension_name_override - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. +class OperationDetail(msrest.serialization.Model): + """Operation detail payload. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives. - :type location: str - :param properties: The Private Atlas resource properties. - :type properties: ~azure.mgmt.maps.models.PrivateAtlasProperties + :param name: Name of the operation. + :type name: str + :param is_data_action: Indicates whether the operation is a data action. + :type is_data_action: bool + :param display: Display of the operation. + :type display: ~azure.mgmt.maps.models.OperationDisplay + :param origin: Origin of the operation. + :type origin: str + :param service_specification: One property of operation, include metric specifications. + :type service_specification: ~azure.mgmt.maps.models.ServiceSpecification """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'PrivateAtlasProperties'}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - properties: Optional["PrivateAtlasProperties"] = None, - **kwargs - ): - super(PrivateAtlas, self).__init__(tags=tags, location=location, **kwargs) - self.properties = properties - - -class PrivateAtlasCreateParameters(msrest.serialization.Model): - """Parameters used to create a new Private Atlas resource. - - All required parameters must be populated in order to send to Azure. - - :param location: Required. The location of the resource. - :type location: str - :param tags: A set of tags. Gets or sets a list of key value pairs that describe the resource. - These tags can be used in viewing and grouping this resource (across resource groups). A - maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 - characters and value no greater than 256 characters. - :type tags: dict[str, str] - """ - - _validation = { - 'location': {'required': True}, - } - - _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, } def __init__( self, *, - location: str, - tags: Optional[Dict[str, str]] = None, + name: Optional[str] = None, + is_data_action: Optional[bool] = None, + display: Optional["OperationDisplay"] = None, + origin: Optional[str] = None, + service_specification: Optional["ServiceSpecification"] = None, **kwargs ): - super(PrivateAtlasCreateParameters, self).__init__(**kwargs) - self.location = location - self.tags = tags - - -class PrivateAtlasList(msrest.serialization.Model): - """A list of Private Atlas resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: a Private Atlas. - :vartype value: list[~azure.mgmt.maps.models.PrivateAtlas] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateAtlas]'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateAtlasList, self).__init__(**kwargs) - self.value = None + super(OperationDetail, self).__init__(**kwargs) + self.name = name + self.is_data_action = is_data_action + self.display = display + self.origin = origin + self.service_specification = service_specification -class PrivateAtlasProperties(msrest.serialization.Model): - """Private Atlas resource properties. +class OperationDisplay(msrest.serialization.Model): + """Operation display payload. - :param provisioning_state: The state of the resource provisioning, terminal states: Succeeded, - Failed, Canceled. - :type provisioning_state: str + :param provider: Resource provider of the operation. + :type provider: str + :param resource: Resource of the operation. + :type resource: str + :param operation: Localized friendly name for the operation. + :type operation: str + :param description: Localized friendly description for the operation. + :type description: str """ _attribute_map = { - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, } def __init__( self, *, - provisioning_state: Optional[str] = None, + provider: Optional[str] = None, + resource: Optional[str] = None, + operation: Optional[str] = None, + description: Optional[str] = None, **kwargs ): - super(PrivateAtlasProperties, self).__init__(**kwargs) - self.provisioning_state = provisioning_state + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description -class PrivateAtlasUpdateParameters(msrest.serialization.Model): - """Parameters used to update an existing Private Atlas resource. +class ServiceSpecification(msrest.serialization.Model): + """One property of operation, include metric specifications. - :param tags: A set of tags. Gets or sets a list of key value pairs that describe the resource. - These tags can be used in viewing and grouping this resource (across resource groups). A - maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 - characters and value no greater than 256 characters. - :type tags: dict[str, str] + :param metric_specifications: Metric specifications of operation. + :type metric_specifications: list[~azure.mgmt.maps.models.MetricSpecification] """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, } def __init__( self, *, - tags: Optional[Dict[str, str]] = None, + metric_specifications: Optional[List["MetricSpecification"]] = None, **kwargs ): - super(PrivateAtlasUpdateParameters, self).__init__(**kwargs) - self.tags = tags + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = metric_specifications class Sku(msrest.serialization.Model): @@ -857,8 +940,9 @@ class Sku(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the SKU, in standard format (such as S0). - :type name: str + :param name: Required. The name of the SKU, in standard format (such as S0). Possible values + include: "S0", "S1", "G2". + :type name: str or ~azure.mgmt.maps.models.Name :ivar tier: Gets the sku tier. This is based on the SKU name. :vartype tier: str """ @@ -876,7 +960,7 @@ class Sku(msrest.serialization.Model): def __init__( self, *, - name: str, + name: Union[str, "Name"], **kwargs ): super(Sku, self).__init__(**kwargs) diff --git a/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/operations/__init__.py b/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/operations/__init__.py index 5619cfe7f9847..91962f6e09b91 100644 --- a/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/operations/__init__.py +++ b/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/operations/__init__.py @@ -8,12 +8,10 @@ from ._accounts_operations import AccountsOperations from ._maps_operations import MapsOperations -from ._private_atlases_operations import PrivateAtlasesOperations from ._creators_operations import CreatorsOperations __all__ = [ 'AccountsOperations', 'MapsOperations', - 'PrivateAtlasesOperations', 'CreatorsOperations', ] diff --git a/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/operations/_accounts_operations.py b/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/operations/_accounts_operations.py index f412a9fd35530..cd255a07e7ec9 100644 --- a/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/operations/_accounts_operations.py +++ b/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/operations/_accounts_operations.py @@ -49,7 +49,7 @@ def create_or_update( self, resource_group_name, # type: str account_name, # type: str - maps_account_create_parameters, # type: "_models.MapsAccountCreateParameters" + maps_account, # type: "_models.MapsAccount" **kwargs # type: Any ): # type: (...) -> "_models.MapsAccount" @@ -60,8 +60,8 @@ def create_or_update( :type resource_group_name: str :param account_name: The name of the Maps Account. :type account_name: str - :param maps_account_create_parameters: The new or updated parameters for the Maps Account. - :type maps_account_create_parameters: ~azure.mgmt.maps.models.MapsAccountCreateParameters + :param maps_account: The new or updated parameters for the Maps Account. + :type maps_account: ~azure.mgmt.maps.models.MapsAccount :keyword callable cls: A custom type or function that will be passed the direct response :return: MapsAccount, or the result of cls(response) :rtype: ~azure.mgmt.maps.models.MapsAccount @@ -72,7 +72,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01-preview" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -95,7 +95,7 @@ def create_or_update( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(maps_account_create_parameters, 'MapsAccountCreateParameters') + body_content = self._serialize.body(maps_account, 'MapsAccount') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) @@ -127,7 +127,7 @@ def update( ): # type: (...) -> "_models.MapsAccount" """Updates a Maps Account. Only a subset of the parameters may be updated after creation, such as - Sku and Tags. + Sku, Tags, Properties. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str @@ -145,7 +145,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01-preview" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -210,7 +210,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -267,7 +267,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -324,7 +324,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -356,7 +356,7 @@ def extract_data(pipeline_response): list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) - return None, iter(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) @@ -393,7 +393,7 @@ def list_by_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -424,7 +424,7 @@ def extract_data(pipeline_response): list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) - return None, iter(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) @@ -469,7 +469,7 @@ def list_keys( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -533,7 +533,7 @@ def regenerate_keys( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01-preview" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/operations/_creators_operations.py b/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/operations/_creators_operations.py index d16c49a65d5a0..41aef321c86e0 100644 --- a/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/operations/_creators_operations.py +++ b/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/operations/_creators_operations.py @@ -68,7 +68,7 @@ def list_by_account( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -101,7 +101,7 @@ def extract_data(pipeline_response): list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) - return None, iter(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) @@ -126,7 +126,7 @@ def create_or_update( resource_group_name, # type: str account_name, # type: str creator_name, # type: str - creator_create_parameters, # type: "_models.CreatorCreateParameters" + creator_resource, # type: "_models.Creator" **kwargs # type: Any ): # type: (...) -> "_models.Creator" @@ -140,8 +140,8 @@ def create_or_update( :type account_name: str :param creator_name: The name of the Maps Creator instance. :type creator_name: str - :param creator_create_parameters: The new or updated parameters for the Creator resource. - :type creator_create_parameters: ~azure.mgmt.maps.models.CreatorCreateParameters + :param creator_resource: The new or updated parameters for the Creator resource. + :type creator_resource: ~azure.mgmt.maps.models.Creator :keyword callable cls: A custom type or function that will be passed the direct response :return: Creator, or the result of cls(response) :rtype: ~azure.mgmt.maps.models.Creator @@ -152,7 +152,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01-preview" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -176,7 +176,7 @@ def create_or_update( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(creator_create_parameters, 'CreatorCreateParameters') + body_content = self._serialize.body(creator_resource, 'Creator') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) @@ -229,7 +229,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01-preview" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -298,7 +298,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -359,7 +359,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL diff --git a/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/operations/_maps_operations.py b/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/operations/_maps_operations.py index 2b00d08756e95..af11f70218456 100644 --- a/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/operations/_maps_operations.py +++ b/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/operations/_maps_operations.py @@ -62,7 +62,7 @@ def list_operations( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -89,7 +89,7 @@ def extract_data(pipeline_response): list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) - return None, iter(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) diff --git a/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/operations/_private_atlases_operations.py b/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/operations/_private_atlases_operations.py deleted file mode 100644 index 76eccc770840e..0000000000000 --- a/sdk/maps/azure-mgmt-maps/azure/mgmt/maps/operations/_private_atlases_operations.py +++ /dev/null @@ -1,399 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class PrivateAtlasesOperations(object): - """PrivateAtlasesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.maps.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def create_or_update( - self, - resource_group_name, # type: str - account_name, # type: str - private_atlas_name, # type: str - private_atlas_create_parameters, # type: "_models.PrivateAtlasCreateParameters" - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateAtlas" - """[Deprecated] Create or update a Private Atlas resource. Private Atlas resource will enable the - usage of Azure resources to build a custom set of mapping data. It requires an account to exist - before it can be created. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the Maps Account. - :type account_name: str - :param private_atlas_name: The name of the Private Atlas instance. - :type private_atlas_name: str - :param private_atlas_create_parameters: The new or updated parameters for the Private Atlas - resource. - :type private_atlas_create_parameters: ~azure.mgmt.maps.models.PrivateAtlasCreateParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateAtlas, or the result of cls(response) - :rtype: ~azure.mgmt.maps.models.PrivateAtlas - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateAtlas"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), - 'privateAtlasName': self._serialize.url("private_atlas_name", private_atlas_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(private_atlas_create_parameters, 'PrivateAtlasCreateParameters') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('PrivateAtlas', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('PrivateAtlas', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}/privateAtlases/{privateAtlasName}'} # type: ignore - - def update( - self, - resource_group_name, # type: str - account_name, # type: str - private_atlas_name, # type: str - private_atlas_update_parameters, # type: "_models.PrivateAtlasUpdateParameters" - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateAtlas" - """[Deprecated] Updates the Private Atlas resource. Only a subset of the parameters may be updated - after creation, such as Tags. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the Maps Account. - :type account_name: str - :param private_atlas_name: The name of the Private Atlas instance. - :type private_atlas_name: str - :param private_atlas_update_parameters: The updated parameters for the Private Atlas. - :type private_atlas_update_parameters: ~azure.mgmt.maps.models.PrivateAtlasUpdateParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateAtlas, or the result of cls(response) - :rtype: ~azure.mgmt.maps.models.PrivateAtlas - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateAtlas"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), - 'privateAtlasName': self._serialize.url("private_atlas_name", private_atlas_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(private_atlas_update_parameters, 'PrivateAtlasUpdateParameters') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateAtlas', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}/privateAtlases/{privateAtlasName}'} # type: ignore - - def delete( - self, - resource_group_name, # type: str - account_name, # type: str - private_atlas_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """[Deprecated] Delete a Private Atlas resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the Maps Account. - :type account_name: str - :param private_atlas_name: The name of the Private Atlas instance. - :type private_atlas_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01-preview" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), - 'privateAtlasName': self._serialize.url("private_atlas_name", private_atlas_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}/privateAtlases/{privateAtlasName}'} # type: ignore - - def get( - self, - resource_group_name, # type: str - account_name, # type: str - private_atlas_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateAtlas" - """[Deprecated] Get a Private Atlas resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the Maps Account. - :type account_name: str - :param private_atlas_name: The name of the Private Atlas instance. - :type private_atlas_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateAtlas, or the result of cls(response) - :rtype: ~azure.mgmt.maps.models.PrivateAtlas - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateAtlas"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), - 'privateAtlasName': self._serialize.url("private_atlas_name", private_atlas_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateAtlas', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}/privateAtlases/{privateAtlasName}'} # type: ignore - - def list_by_account( - self, - resource_group_name, # type: str - account_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.PrivateAtlasList"] - """[Deprecated] Get all Private Atlas instances for an Azure Map Account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the Maps Account. - :type account_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PrivateAtlasList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.maps.models.PrivateAtlasList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateAtlasList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_account.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('PrivateAtlasList', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_by_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}/privateAtlases'} # type: ignore