@@ -46,7 +46,7 @@ async def create_or_update(
46
46
resource_group_name : str ,
47
47
account_name : str ,
48
48
maps_account : "_models.MapsAccount" ,
49
- ** kwargs
49
+ ** kwargs : Any
50
50
) -> "_models.MapsAccount" :
51
51
"""Create or update a Maps Account. A Maps Account holds the keys which allow access to the Maps
52
52
REST APIs.
@@ -67,15 +67,15 @@ async def create_or_update(
67
67
401 : ClientAuthenticationError , 404 : ResourceNotFoundError , 409 : ResourceExistsError
68
68
}
69
69
error_map .update (kwargs .pop ('error_map' , {}))
70
- api_version = "2021-02 -01"
70
+ api_version = "2021-12 -01-preview "
71
71
content_type = kwargs .pop ("content_type" , "application/json" )
72
72
accept = "application/json"
73
73
74
74
# Construct URL
75
75
url = self .create_or_update .metadata ['url' ] # type: ignore
76
76
path_format_arguments = {
77
77
'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 ),
79
79
'accountName' : self ._serialize .url ("account_name" , account_name , 'str' ),
80
80
}
81
81
url = self ._client .format_url (url , ** path_format_arguments )
@@ -118,7 +118,7 @@ async def update(
118
118
resource_group_name : str ,
119
119
account_name : str ,
120
120
maps_account_update_parameters : "_models.MapsAccountUpdateParameters" ,
121
- ** kwargs
121
+ ** kwargs : Any
122
122
) -> "_models.MapsAccount" :
123
123
"""Updates a Maps Account. Only a subset of the parameters may be updated after creation, such as
124
124
Sku, Tags, Properties.
@@ -139,15 +139,15 @@ async def update(
139
139
401 : ClientAuthenticationError , 404 : ResourceNotFoundError , 409 : ResourceExistsError
140
140
}
141
141
error_map .update (kwargs .pop ('error_map' , {}))
142
- api_version = "2021-02 -01"
142
+ api_version = "2021-12 -01-preview "
143
143
content_type = kwargs .pop ("content_type" , "application/json" )
144
144
accept = "application/json"
145
145
146
146
# Construct URL
147
147
url = self .update .metadata ['url' ] # type: ignore
148
148
path_format_arguments = {
149
149
'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 ),
151
151
'accountName' : self ._serialize .url ("account_name" , account_name , 'str' ),
152
152
}
153
153
url = self ._client .format_url (url , ** path_format_arguments )
@@ -185,7 +185,7 @@ async def delete(
185
185
self ,
186
186
resource_group_name : str ,
187
187
account_name : str ,
188
- ** kwargs
188
+ ** kwargs : Any
189
189
) -> None :
190
190
"""Delete a Maps Account.
191
191
@@ -203,14 +203,14 @@ async def delete(
203
203
401 : ClientAuthenticationError , 404 : ResourceNotFoundError , 409 : ResourceExistsError
204
204
}
205
205
error_map .update (kwargs .pop ('error_map' , {}))
206
- api_version = "2021-02 -01"
206
+ api_version = "2021-12 -01-preview "
207
207
accept = "application/json"
208
208
209
209
# Construct URL
210
210
url = self .delete .metadata ['url' ] # type: ignore
211
211
path_format_arguments = {
212
212
'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 ),
214
214
'accountName' : self ._serialize .url ("account_name" , account_name , 'str' ),
215
215
}
216
216
url = self ._client .format_url (url , ** path_format_arguments )
@@ -241,7 +241,7 @@ async def get(
241
241
self ,
242
242
resource_group_name : str ,
243
243
account_name : str ,
244
- ** kwargs
244
+ ** kwargs : Any
245
245
) -> "_models.MapsAccount" :
246
246
"""Get a Maps Account.
247
247
@@ -259,14 +259,14 @@ async def get(
259
259
401 : ClientAuthenticationError , 404 : ResourceNotFoundError , 409 : ResourceExistsError
260
260
}
261
261
error_map .update (kwargs .pop ('error_map' , {}))
262
- api_version = "2021-02 -01"
262
+ api_version = "2021-12 -01-preview "
263
263
accept = "application/json"
264
264
265
265
# Construct URL
266
266
url = self .get .metadata ['url' ] # type: ignore
267
267
path_format_arguments = {
268
268
'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 ),
270
270
'accountName' : self ._serialize .url ("account_name" , account_name , 'str' ),
271
271
}
272
272
url = self ._client .format_url (url , ** path_format_arguments )
@@ -299,7 +299,7 @@ async def get(
299
299
def list_by_resource_group (
300
300
self ,
301
301
resource_group_name : str ,
302
- ** kwargs
302
+ ** kwargs : Any
303
303
) -> AsyncIterable ["_models.MapsAccounts" ]:
304
304
"""Get all Maps Accounts in a Resource Group.
305
305
@@ -315,7 +315,7 @@ def list_by_resource_group(
315
315
401 : ClientAuthenticationError , 404 : ResourceNotFoundError , 409 : ResourceExistsError
316
316
}
317
317
error_map .update (kwargs .pop ('error_map' , {}))
318
- api_version = "2021-02 -01"
318
+ api_version = "2021-12 -01-preview "
319
319
accept = "application/json"
320
320
321
321
def prepare_request (next_link = None ):
@@ -328,7 +328,7 @@ def prepare_request(next_link=None):
328
328
url = self .list_by_resource_group .metadata ['url' ] # type: ignore
329
329
path_format_arguments = {
330
330
'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 ),
332
332
}
333
333
url = self ._client .format_url (url , ** path_format_arguments )
334
334
# Construct parameters
@@ -369,7 +369,7 @@ async def get_next(next_link=None):
369
369
370
370
def list_by_subscription (
371
371
self ,
372
- ** kwargs
372
+ ** kwargs : Any
373
373
) -> AsyncIterable ["_models.MapsAccounts" ]:
374
374
"""Get all Maps Accounts in a Subscription.
375
375
@@ -383,7 +383,7 @@ def list_by_subscription(
383
383
401 : ClientAuthenticationError , 404 : ResourceNotFoundError , 409 : ResourceExistsError
384
384
}
385
385
error_map .update (kwargs .pop ('error_map' , {}))
386
- api_version = "2021-02 -01"
386
+ api_version = "2021-12 -01-preview "
387
387
accept = "application/json"
388
388
389
389
def prepare_request (next_link = None ):
@@ -434,11 +434,87 @@ async def get_next(next_link=None):
434
434
)
435
435
list_by_subscription .metadata = {'url' : '/subscriptions/{subscriptionId}/providers/Microsoft.Maps/accounts' } # type: ignore
436
436
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
+
437
513
async def list_keys (
438
514
self ,
439
515
resource_group_name : str ,
440
516
account_name : str ,
441
- ** kwargs
517
+ ** kwargs : Any
442
518
) -> "_models.MapsAccountKeys" :
443
519
"""Get the keys to use with the Maps APIs. A key is used to authenticate and authorize access to
444
520
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(
458
534
401 : ClientAuthenticationError , 404 : ResourceNotFoundError , 409 : ResourceExistsError
459
535
}
460
536
error_map .update (kwargs .pop ('error_map' , {}))
461
- api_version = "2021-02 -01"
537
+ api_version = "2021-12 -01-preview "
462
538
accept = "application/json"
463
539
464
540
# Construct URL
465
541
url = self .list_keys .metadata ['url' ] # type: ignore
466
542
path_format_arguments = {
467
543
'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 ),
469
545
'accountName' : self ._serialize .url ("account_name" , account_name , 'str' ),
470
546
}
471
547
url = self ._client .format_url (url , ** path_format_arguments )
@@ -500,7 +576,7 @@ async def regenerate_keys(
500
576
resource_group_name : str ,
501
577
account_name : str ,
502
578
key_specification : "_models.MapsKeySpecification" ,
503
- ** kwargs
579
+ ** kwargs : Any
504
580
) -> "_models.MapsAccountKeys" :
505
581
"""Regenerate either the primary or secondary key for use with the Maps APIs. The old key will
506
582
stop working immediately.
@@ -521,15 +597,15 @@ async def regenerate_keys(
521
597
401 : ClientAuthenticationError , 404 : ResourceNotFoundError , 409 : ResourceExistsError
522
598
}
523
599
error_map .update (kwargs .pop ('error_map' , {}))
524
- api_version = "2021-02 -01"
600
+ api_version = "2021-12 -01-preview "
525
601
content_type = kwargs .pop ("content_type" , "application/json" )
526
602
accept = "application/json"
527
603
528
604
# Construct URL
529
605
url = self .regenerate_keys .metadata ['url' ] # type: ignore
530
606
path_format_arguments = {
531
607
'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 ),
533
609
'accountName' : self ._serialize .url ("account_name" , account_name , 'str' ),
534
610
}
535
611
url = self ._client .format_url (url , ** path_format_arguments )
0 commit comments