Skip to content

Commit 7c675e0

Browse files
author
SDKAuto
committed
CodeGen from PR 16153 in Azure/azure-rest-api-specs
Merge 1fbd69858b9ad9ad00d63c2630bb018d89f89214 into b49af80
1 parent 1a9b633 commit 7c675e0

15 files changed

+1038
-83
lines changed

sdk/maps/azure-mgmt-maps/_meta.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
{
2-
"autorest": "3.3.0",
3-
"use": "@autorest/[email protected]",
4-
"commit": "5e6a5758c2bd7128984f131be88200cd4d2d1a17",
2+
"autorest": "3.4.5",
3+
"use": [
4+
"@autorest/[email protected]",
5+
"@autorest/[email protected]"
6+
],
7+
"commit": "b7287ca0d54aab28a05cd7edad3b7abddc5ab0b4",
58
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
6-
"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",
9+
"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.8.4 --use=@autorest/[email protected] --version=3.4.5",
710
"readme": "specification/maps/resource-manager/readme.md"
811
}

sdk/maps/azure-mgmt-maps/azure/mgmt/maps/_configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def __init__(
4848

4949
self.credential = credential
5050
self.subscription_id = subscription_id
51-
self.api_version = "2021-02-01"
51+
self.api_version = "2021-12-01-preview"
5252
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
5353
kwargs.setdefault('sdk_moniker', 'mgmt-maps/{}'.format(VERSION))
5454
self._configure(**kwargs)

sdk/maps/azure-mgmt-maps/azure/mgmt/maps/_metadata.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"chosen_version": "2021-02-01",
3-
"total_api_version_list": ["2021-02-01"],
2+
"chosen_version": "2021-12-01-preview",
3+
"total_api_version_list": ["2021-12-01-preview"],
44
"client": {
55
"name": "AzureMapsManagementClient",
66
"filename": "_azure_maps_management_client",

sdk/maps/azure-mgmt-maps/azure/mgmt/maps/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
VERSION = "2.0.0"
9+
VERSION = "1.0.0b1"

sdk/maps/azure-mgmt-maps/azure/mgmt/maps/aio/_configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def __init__(
4545

4646
self.credential = credential
4747
self.subscription_id = subscription_id
48-
self.api_version = "2021-02-01"
48+
self.api_version = "2021-12-01-preview"
4949
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
5050
kwargs.setdefault('sdk_moniker', 'mgmt-maps/{}'.format(VERSION))
5151
self._configure(**kwargs)

sdk/maps/azure-mgmt-maps/azure/mgmt/maps/aio/operations/_accounts_operations.py

Lines changed: 99 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ async def create_or_update(
4646
resource_group_name: str,
4747
account_name: str,
4848
maps_account: "_models.MapsAccount",
49-
**kwargs
49+
**kwargs: Any
5050
) -> "_models.MapsAccount":
5151
"""Create or update a Maps Account. A Maps Account holds the keys which allow access to the Maps
5252
REST APIs.
@@ -67,15 +67,15 @@ async def create_or_update(
6767
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
6868
}
6969
error_map.update(kwargs.pop('error_map', {}))
70-
api_version = "2021-02-01"
70+
api_version = "2021-12-01-preview"
7171
content_type = kwargs.pop("content_type", "application/json")
7272
accept = "application/json"
7373

7474
# Construct URL
7575
url = self.create_or_update.metadata['url'] # type: ignore
7676
path_format_arguments = {
7777
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1),
78-
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
78+
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
7979
'accountName': self._serialize.url("account_name", account_name, 'str'),
8080
}
8181
url = self._client.format_url(url, **path_format_arguments)
@@ -118,7 +118,7 @@ async def update(
118118
resource_group_name: str,
119119
account_name: str,
120120
maps_account_update_parameters: "_models.MapsAccountUpdateParameters",
121-
**kwargs
121+
**kwargs: Any
122122
) -> "_models.MapsAccount":
123123
"""Updates a Maps Account. Only a subset of the parameters may be updated after creation, such as
124124
Sku, Tags, Properties.
@@ -139,15 +139,15 @@ async def update(
139139
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
140140
}
141141
error_map.update(kwargs.pop('error_map', {}))
142-
api_version = "2021-02-01"
142+
api_version = "2021-12-01-preview"
143143
content_type = kwargs.pop("content_type", "application/json")
144144
accept = "application/json"
145145

146146
# Construct URL
147147
url = self.update.metadata['url'] # type: ignore
148148
path_format_arguments = {
149149
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1),
150-
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
150+
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
151151
'accountName': self._serialize.url("account_name", account_name, 'str'),
152152
}
153153
url = self._client.format_url(url, **path_format_arguments)
@@ -185,7 +185,7 @@ async def delete(
185185
self,
186186
resource_group_name: str,
187187
account_name: str,
188-
**kwargs
188+
**kwargs: Any
189189
) -> None:
190190
"""Delete a Maps Account.
191191
@@ -203,14 +203,14 @@ async def delete(
203203
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
204204
}
205205
error_map.update(kwargs.pop('error_map', {}))
206-
api_version = "2021-02-01"
206+
api_version = "2021-12-01-preview"
207207
accept = "application/json"
208208

209209
# Construct URL
210210
url = self.delete.metadata['url'] # type: ignore
211211
path_format_arguments = {
212212
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1),
213-
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
213+
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
214214
'accountName': self._serialize.url("account_name", account_name, 'str'),
215215
}
216216
url = self._client.format_url(url, **path_format_arguments)
@@ -241,7 +241,7 @@ async def get(
241241
self,
242242
resource_group_name: str,
243243
account_name: str,
244-
**kwargs
244+
**kwargs: Any
245245
) -> "_models.MapsAccount":
246246
"""Get a Maps Account.
247247
@@ -259,14 +259,14 @@ async def get(
259259
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
260260
}
261261
error_map.update(kwargs.pop('error_map', {}))
262-
api_version = "2021-02-01"
262+
api_version = "2021-12-01-preview"
263263
accept = "application/json"
264264

265265
# Construct URL
266266
url = self.get.metadata['url'] # type: ignore
267267
path_format_arguments = {
268268
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1),
269-
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
269+
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
270270
'accountName': self._serialize.url("account_name", account_name, 'str'),
271271
}
272272
url = self._client.format_url(url, **path_format_arguments)
@@ -299,7 +299,7 @@ async def get(
299299
def list_by_resource_group(
300300
self,
301301
resource_group_name: str,
302-
**kwargs
302+
**kwargs: Any
303303
) -> AsyncIterable["_models.MapsAccounts"]:
304304
"""Get all Maps Accounts in a Resource Group.
305305
@@ -315,7 +315,7 @@ def list_by_resource_group(
315315
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
316316
}
317317
error_map.update(kwargs.pop('error_map', {}))
318-
api_version = "2021-02-01"
318+
api_version = "2021-12-01-preview"
319319
accept = "application/json"
320320

321321
def prepare_request(next_link=None):
@@ -328,7 +328,7 @@ def prepare_request(next_link=None):
328328
url = self.list_by_resource_group.metadata['url'] # type: ignore
329329
path_format_arguments = {
330330
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1),
331-
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
331+
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
332332
}
333333
url = self._client.format_url(url, **path_format_arguments)
334334
# Construct parameters
@@ -369,7 +369,7 @@ async def get_next(next_link=None):
369369

370370
def list_by_subscription(
371371
self,
372-
**kwargs
372+
**kwargs: Any
373373
) -> AsyncIterable["_models.MapsAccounts"]:
374374
"""Get all Maps Accounts in a Subscription.
375375
@@ -383,7 +383,7 @@ def list_by_subscription(
383383
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
384384
}
385385
error_map.update(kwargs.pop('error_map', {}))
386-
api_version = "2021-02-01"
386+
api_version = "2021-12-01-preview"
387387
accept = "application/json"
388388

389389
def prepare_request(next_link=None):
@@ -434,11 +434,87 @@ async def get_next(next_link=None):
434434
)
435435
list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Maps/accounts'} # type: ignore
436436

437+
async def list_sas(
438+
self,
439+
resource_group_name: str,
440+
account_name: str,
441+
maps_account_sas_parameters: "_models.AccountSasParameters",
442+
**kwargs: Any
443+
) -> "_models.MapsAccountSasToken":
444+
"""Create and list an account shared access signature token. Use this SAS token for authentication
445+
to Azure Maps REST APIs through various Azure Maps SDKs. As prerequisite to create a SAS Token.
446+
447+
Prerequisites:
448+
449+
450+
#. Create or have an existing User Assigned Managed Identity in the same Azure region as the
451+
account.
452+
#. Create or update an Azure Map account with the same Azure region as the User Assigned
453+
Managed Identity is placed.
454+
455+
:param resource_group_name: The name of the resource group. The name is case insensitive.
456+
:type resource_group_name: str
457+
:param account_name: The name of the Maps Account.
458+
:type account_name: str
459+
:param maps_account_sas_parameters: The updated parameters for the Maps Account.
460+
:type maps_account_sas_parameters: ~azure.mgmt.maps.models.AccountSasParameters
461+
:keyword callable cls: A custom type or function that will be passed the direct response
462+
:return: MapsAccountSasToken, or the result of cls(response)
463+
:rtype: ~azure.mgmt.maps.models.MapsAccountSasToken
464+
:raises: ~azure.core.exceptions.HttpResponseError
465+
"""
466+
cls = kwargs.pop('cls', None) # type: ClsType["_models.MapsAccountSasToken"]
467+
error_map = {
468+
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
469+
}
470+
error_map.update(kwargs.pop('error_map', {}))
471+
api_version = "2021-12-01-preview"
472+
content_type = kwargs.pop("content_type", "application/json")
473+
accept = "application/json"
474+
475+
# Construct URL
476+
url = self.list_sas.metadata['url'] # type: ignore
477+
path_format_arguments = {
478+
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1),
479+
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
480+
'accountName': self._serialize.url("account_name", account_name, 'str'),
481+
}
482+
url = self._client.format_url(url, **path_format_arguments)
483+
484+
# Construct parameters
485+
query_parameters = {} # type: Dict[str, Any]
486+
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
487+
488+
# Construct headers
489+
header_parameters = {} # type: Dict[str, Any]
490+
header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
491+
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
492+
493+
body_content_kwargs = {} # type: Dict[str, Any]
494+
body_content = self._serialize.body(maps_account_sas_parameters, 'AccountSasParameters')
495+
body_content_kwargs['content'] = body_content
496+
request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
497+
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
498+
response = pipeline_response.http_response
499+
500+
if response.status_code not in [200]:
501+
map_error(status_code=response.status_code, response=response, error_map=error_map)
502+
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response)
503+
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
504+
505+
deserialized = self._deserialize('MapsAccountSasToken', pipeline_response)
506+
507+
if cls:
508+
return cls(pipeline_response, deserialized, {})
509+
510+
return deserialized
511+
list_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}/listSas'} # type: ignore
512+
437513
async def list_keys(
438514
self,
439515
resource_group_name: str,
440516
account_name: str,
441-
**kwargs
517+
**kwargs: Any
442518
) -> "_models.MapsAccountKeys":
443519
"""Get the keys to use with the Maps APIs. A key is used to authenticate and authorize access to
444520
the Maps REST APIs. Only one key is needed at a time; two are given to provide seamless key
@@ -458,14 +534,14 @@ async def list_keys(
458534
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
459535
}
460536
error_map.update(kwargs.pop('error_map', {}))
461-
api_version = "2021-02-01"
537+
api_version = "2021-12-01-preview"
462538
accept = "application/json"
463539

464540
# Construct URL
465541
url = self.list_keys.metadata['url'] # type: ignore
466542
path_format_arguments = {
467543
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1),
468-
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
544+
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
469545
'accountName': self._serialize.url("account_name", account_name, 'str'),
470546
}
471547
url = self._client.format_url(url, **path_format_arguments)
@@ -500,7 +576,7 @@ async def regenerate_keys(
500576
resource_group_name: str,
501577
account_name: str,
502578
key_specification: "_models.MapsKeySpecification",
503-
**kwargs
579+
**kwargs: Any
504580
) -> "_models.MapsAccountKeys":
505581
"""Regenerate either the primary or secondary key for use with the Maps APIs. The old key will
506582
stop working immediately.
@@ -521,15 +597,15 @@ async def regenerate_keys(
521597
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
522598
}
523599
error_map.update(kwargs.pop('error_map', {}))
524-
api_version = "2021-02-01"
600+
api_version = "2021-12-01-preview"
525601
content_type = kwargs.pop("content_type", "application/json")
526602
accept = "application/json"
527603

528604
# Construct URL
529605
url = self.regenerate_keys.metadata['url'] # type: ignore
530606
path_format_arguments = {
531607
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1),
532-
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
608+
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
533609
'accountName': self._serialize.url("account_name", account_name, 'str'),
534610
}
535611
url = self._client.format_url(url, **path_format_arguments)

0 commit comments

Comments
 (0)