Skip to content

Commit

Permalink
CodeGen from PR 14316 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge b12616f3fcf0e8f2916b557763c77064d5de1539 into a4924d4
  • Loading branch information
SDKAuto committed May 8, 2021
1 parent 5d8bf17 commit 2f867b1
Show file tree
Hide file tree
Showing 23 changed files with 836 additions and 1,473 deletions.
2 changes: 1 addition & 1 deletion sdk/maps/azure-mgmt-maps/_meta.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"autorest": "3.3.0",
"use": "@autorest/[email protected]",
"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/[email protected] --version=3.3.0",
"readme": "specification/maps/resource-manager/readme.md"
Expand Down
4 changes: 2 additions & 2 deletions sdk/maps/azure-mgmt-maps/azure/mgmt/maps/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)}
Expand All @@ -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)

Expand All @@ -94,7 +89,7 @@ def close(self):
self._client.close()

def __enter__(self):
# type: () -> AzureMapsResourceProvider
# type: () -> AzureMapsManagementClient
self._client.__enter__()
return self

Expand Down
8 changes: 4 additions & 4 deletions sdk/maps/azure-mgmt-maps/azure/mgmt/maps/_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)
Expand Down
15 changes: 7 additions & 8 deletions sdk/maps/azure-mgmt-maps/azure/mgmt/maps/_metadata.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down Expand Up @@ -100,7 +100,6 @@
"operation_groups": {
"accounts": "AccountsOperations",
"maps": "MapsOperations",
"private_atlases": "PrivateAtlasesOperations",
"creators": "CreatorsOperations"
}
}
2 changes: 1 addition & 1 deletion sdk/maps/azure-mgmt-maps/azure/mgmt/maps/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 2 additions & 2 deletions sdk/maps/azure-mgmt-maps/azure/mgmt/maps/aio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)}
Expand All @@ -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)

Expand All @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
]
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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"

Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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"

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"

Expand Down
Loading

0 comments on commit 2f867b1

Please sign in to comment.