Skip to content

Commit 40fcf4f

Browse files
author
SDKAuto
committed
CodeGen from PR 11695 in Azure/azure-rest-api-specs
fix java readme (Azure#11695)
1 parent fd0f1f6 commit 40fcf4f

File tree

53 files changed

+2223
-563
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+2223
-563
lines changed

sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/_key_vault_management_client.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,19 @@ def models(cls, api_version=DEFAULT_API_VERSION):
100100
return models
101101
raise ValueError("API version {} is not available".format(api_version))
102102

103+
@property
104+
def keys(self):
105+
"""Instance depends on the API version:
106+
107+
* 2019-09-01: :class:`KeysOperations<azure.mgmt.keyvault.v2019_09_01.operations.KeysOperations>`
108+
"""
109+
api_version = self._get_api_version('keys')
110+
if api_version == '2019-09-01':
111+
from .v2019_09_01.operations import KeysOperations as OperationClass
112+
else:
113+
raise ValueError("API version {} does not have operation group 'keys'".format(api_version))
114+
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
115+
103116
@property
104117
def managed_hsms(self):
105118
"""Instance depends on the API version:

sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/aio/_key_vault_management_client.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,19 @@ def models(cls, api_version=DEFAULT_API_VERSION):
100100
return models
101101
raise ValueError("API version {} is not available".format(api_version))
102102

103+
@property
104+
def keys(self):
105+
"""Instance depends on the API version:
106+
107+
* 2019-09-01: :class:`KeysOperations<azure.mgmt.keyvault.v2019_09_01.aio.operations.KeysOperations>`
108+
"""
109+
api_version = self._get_api_version('keys')
110+
if api_version == '2019-09-01':
111+
from ..v2019_09_01.aio.operations import KeysOperations as OperationClass
112+
else:
113+
raise ValueError("API version {} does not have operation group 'keys'".format(api_version))
114+
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
115+
103116
@property
104117
def managed_hsms(self):
105118
"""Instance depends on the API version:

sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2016_10_01/_metadata.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,33 @@
88
"base_url": "\u0027https://management.azure.com\u0027",
99
"custom_base_url": null,
1010
"azure_arm": true,
11-
"has_lro_operations": true
11+
"has_lro_operations": true,
12+
"client_side_validation": true
1213
},
1314
"global_parameters": {
14-
"sync_method": {
15+
"sync": {
1516
"credential": {
16-
"method_signature": "credential, # type: \"TokenCredential\"",
17+
"signature": "credential, # type: \"TokenCredential\"",
1718
"description": "Credential needed for the client to connect to Azure.",
1819
"docstring_type": "~azure.core.credentials.TokenCredential",
1920
"required": true
2021
},
2122
"subscription_id": {
22-
"method_signature": "subscription_id, # type: str",
23+
"signature": "subscription_id, # type: str",
2324
"description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.",
2425
"docstring_type": "str",
2526
"required": true
2627
}
2728
},
28-
"async_method": {
29+
"async": {
2930
"credential": {
30-
"method_signature": "credential, # type: \"AsyncTokenCredential\"",
31+
"signature": "credential, # type: \"AsyncTokenCredential\"",
3132
"description": "Credential needed for the client to connect to Azure.",
3233
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
3334
"required": true
3435
},
3536
"subscription_id": {
36-
"method_signature": "subscription_id, # type: str",
37+
"signature": "subscription_id, # type: str",
3738
"description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.",
3839
"docstring_type": "str",
3940
"required": true

sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2016_10_01/aio/operations/_operations.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
1515
from azure.mgmt.core.exceptions import ARMErrorFormat
1616

17-
from ... import models
17+
from ... import models as _models
1818

1919
T = TypeVar('T')
2020
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -33,7 +33,7 @@ class Operations:
3333
:param deserializer: An object model deserializer.
3434
"""
3535

36-
models = models
36+
models = _models
3737

3838
def __init__(self, client, config, serializer, deserializer) -> None:
3939
self._client = client
@@ -44,15 +44,15 @@ def __init__(self, client, config, serializer, deserializer) -> None:
4444
def list(
4545
self,
4646
**kwargs
47-
) -> AsyncIterable["models.OperationListResult"]:
47+
) -> AsyncIterable["_models.OperationListResult"]:
4848
"""Lists all of the available Key Vault Rest API operations.
4949
5050
:keyword callable cls: A custom type or function that will be passed the direct response
5151
:return: An iterator like instance of either OperationListResult or the result of cls(response)
5252
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.keyvault.v2016_10_01.models.OperationListResult]
5353
:raises: ~azure.core.exceptions.HttpResponseError
5454
"""
55-
cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"]
55+
cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"]
5656
error_map = {
5757
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
5858
}

sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2016_10_01/aio/operations/_vaults_operations.py

Lines changed: 34 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from azure.mgmt.core.exceptions import ARMErrorFormat
1717
from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling
1818

19-
from ... import models
19+
from ... import models as _models
2020

2121
T = TypeVar('T')
2222
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -35,7 +35,7 @@ class VaultsOperations:
3535
:param deserializer: An object model deserializer.
3636
"""
3737

38-
models = models
38+
models = _models
3939

4040
def __init__(self, client, config, serializer, deserializer) -> None:
4141
self._client = client
@@ -47,9 +47,9 @@ async def create_or_update(
4747
self,
4848
resource_group_name: str,
4949
vault_name: str,
50-
parameters: "models.VaultCreateOrUpdateParameters",
50+
parameters: "_models.VaultCreateOrUpdateParameters",
5151
**kwargs
52-
) -> "models.Vault":
52+
) -> "_models.Vault":
5353
"""Create or update a key vault in the specified subscription.
5454
5555
:param resource_group_name: The name of the Resource Group to which the server belongs.
@@ -63,7 +63,7 @@ async def create_or_update(
6363
:rtype: ~azure.mgmt.keyvault.v2016_10_01.models.Vault
6464
:raises: ~azure.core.exceptions.HttpResponseError
6565
"""
66-
cls = kwargs.pop('cls', None) # type: ClsType["models.Vault"]
66+
cls = kwargs.pop('cls', None) # type: ClsType["_models.Vault"]
6767
error_map = {
6868
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
6969
}
@@ -117,9 +117,9 @@ async def update(
117117
self,
118118
resource_group_name: str,
119119
vault_name: str,
120-
parameters: "models.VaultPatchParameters",
120+
parameters: "_models.VaultPatchParameters",
121121
**kwargs
122-
) -> "models.Vault":
122+
) -> "_models.Vault":
123123
"""Update a key vault in the specified subscription.
124124
125125
:param resource_group_name: The name of the Resource Group to which the server belongs.
@@ -133,7 +133,7 @@ async def update(
133133
:rtype: ~azure.mgmt.keyvault.v2016_10_01.models.Vault
134134
:raises: ~azure.core.exceptions.HttpResponseError
135135
"""
136-
cls = kwargs.pop('cls', None) # type: ClsType["models.Vault"]
136+
cls = kwargs.pop('cls', None) # type: ClsType["_models.Vault"]
137137
error_map = {
138138
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
139139
}
@@ -241,7 +241,7 @@ async def get(
241241
resource_group_name: str,
242242
vault_name: str,
243243
**kwargs
244-
) -> "models.Vault":
244+
) -> "_models.Vault":
245245
"""Gets the specified Azure key vault.
246246
247247
:param resource_group_name: The name of the Resource Group to which the vault belongs.
@@ -253,7 +253,7 @@ async def get(
253253
:rtype: ~azure.mgmt.keyvault.v2016_10_01.models.Vault
254254
:raises: ~azure.core.exceptions.HttpResponseError
255255
"""
256-
cls = kwargs.pop('cls', None) # type: ClsType["models.Vault"]
256+
cls = kwargs.pop('cls', None) # type: ClsType["_models.Vault"]
257257
error_map = {
258258
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
259259
}
@@ -298,10 +298,10 @@ async def update_access_policy(
298298
self,
299299
resource_group_name: str,
300300
vault_name: str,
301-
operation_kind: Union[str, "models.AccessPolicyUpdateKind"],
302-
parameters: "models.VaultAccessPolicyParameters",
301+
operation_kind: Union[str, "_models.AccessPolicyUpdateKind"],
302+
parameters: "_models.VaultAccessPolicyParameters",
303303
**kwargs
304-
) -> "models.VaultAccessPolicyParameters":
304+
) -> "_models.VaultAccessPolicyParameters":
305305
"""Update access policies in a key vault in the specified subscription.
306306
307307
:param resource_group_name: The name of the Resource Group to which the vault belongs.
@@ -317,7 +317,7 @@ async def update_access_policy(
317317
:rtype: ~azure.mgmt.keyvault.v2016_10_01.models.VaultAccessPolicyParameters
318318
:raises: ~azure.core.exceptions.HttpResponseError
319319
"""
320-
cls = kwargs.pop('cls', None) # type: ClsType["models.VaultAccessPolicyParameters"]
320+
cls = kwargs.pop('cls', None) # type: ClsType["_models.VaultAccessPolicyParameters"]
321321
error_map = {
322322
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
323323
}
@@ -373,7 +373,7 @@ def list_by_resource_group(
373373
resource_group_name: str,
374374
top: Optional[int] = None,
375375
**kwargs
376-
) -> AsyncIterable["models.VaultListResult"]:
376+
) -> AsyncIterable["_models.VaultListResult"]:
377377
"""The List operation gets information about the vaults associated with the subscription and
378378
within the specified resource group.
379379
@@ -386,7 +386,7 @@ def list_by_resource_group(
386386
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.keyvault.v2016_10_01.models.VaultListResult]
387387
:raises: ~azure.core.exceptions.HttpResponseError
388388
"""
389-
cls = kwargs.pop('cls', None) # type: ClsType["models.VaultListResult"]
389+
cls = kwargs.pop('cls', None) # type: ClsType["_models.VaultListResult"]
390390
error_map = {
391391
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
392392
}
@@ -448,7 +448,7 @@ def list_by_subscription(
448448
self,
449449
top: Optional[int] = None,
450450
**kwargs
451-
) -> AsyncIterable["models.VaultListResult"]:
451+
) -> AsyncIterable["_models.VaultListResult"]:
452452
"""The List operation gets information about the vaults associated with the subscription.
453453
454454
:param top: Maximum number of results to return.
@@ -458,7 +458,7 @@ def list_by_subscription(
458458
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.keyvault.v2016_10_01.models.VaultListResult]
459459
:raises: ~azure.core.exceptions.HttpResponseError
460460
"""
461-
cls = kwargs.pop('cls', None) # type: ClsType["models.VaultListResult"]
461+
cls = kwargs.pop('cls', None) # type: ClsType["_models.VaultListResult"]
462462
error_map = {
463463
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
464464
}
@@ -518,15 +518,15 @@ async def get_next(next_link=None):
518518
def list_deleted(
519519
self,
520520
**kwargs
521-
) -> AsyncIterable["models.DeletedVaultListResult"]:
521+
) -> AsyncIterable["_models.DeletedVaultListResult"]:
522522
"""Gets information about the deleted vaults in a subscription.
523523
524524
:keyword callable cls: A custom type or function that will be passed the direct response
525525
:return: An iterator like instance of either DeletedVaultListResult or the result of cls(response)
526526
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.keyvault.v2016_10_01.models.DeletedVaultListResult]
527527
:raises: ~azure.core.exceptions.HttpResponseError
528528
"""
529-
cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedVaultListResult"]
529+
cls = kwargs.pop('cls', None) # type: ClsType["_models.DeletedVaultListResult"]
530530
error_map = {
531531
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
532532
}
@@ -586,7 +586,7 @@ async def get_deleted(
586586
vault_name: str,
587587
location: str,
588588
**kwargs
589-
) -> "models.DeletedVault":
589+
) -> "_models.DeletedVault":
590590
"""Gets the deleted Azure key vault.
591591
592592
:param vault_name: The name of the vault.
@@ -598,7 +598,7 @@ async def get_deleted(
598598
:rtype: ~azure.mgmt.keyvault.v2016_10_01.models.DeletedVault
599599
:raises: ~azure.core.exceptions.HttpResponseError
600600
"""
601-
cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedVault"]
601+
cls = kwargs.pop('cls', None) # type: ClsType["_models.DeletedVault"]
602602
error_map = {
603603
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
604604
}
@@ -725,7 +725,13 @@ def get_long_running_output(pipeline_response):
725725
if cls:
726726
return cls(pipeline_response, None, {})
727727

728-
if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs)
728+
path_format_arguments = {
729+
'vaultName': self._serialize.url("vault_name", vault_name, 'str'),
730+
'location': self._serialize.url("location", location, 'str'),
731+
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
732+
}
733+
734+
if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs)
729735
elif polling is False: polling_method = AsyncNoPolling()
730736
else: polling_method = polling
731737
if cont_token:
@@ -743,7 +749,7 @@ def list(
743749
self,
744750
top: Optional[int] = None,
745751
**kwargs
746-
) -> AsyncIterable["models.ResourceListResult"]:
752+
) -> AsyncIterable["_models.ResourceListResult"]:
747753
"""The List operation gets information about the vaults associated with the subscription.
748754
749755
:param top: Maximum number of results to return.
@@ -753,7 +759,7 @@ def list(
753759
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.keyvault.v2016_10_01.models.ResourceListResult]
754760
:raises: ~azure.core.exceptions.HttpResponseError
755761
"""
756-
cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceListResult"]
762+
cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceListResult"]
757763
error_map = {
758764
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
759765
}
@@ -814,9 +820,9 @@ async def get_next(next_link=None):
814820

815821
async def check_name_availability(
816822
self,
817-
vault_name: "models.VaultCheckNameAvailabilityParameters",
823+
vault_name: "_models.VaultCheckNameAvailabilityParameters",
818824
**kwargs
819-
) -> "models.CheckNameAvailabilityResult":
825+
) -> "_models.CheckNameAvailabilityResult":
820826
"""Checks that the vault name is valid and is not already in use.
821827
822828
:param vault_name: The name of the vault.
@@ -826,7 +832,7 @@ async def check_name_availability(
826832
:rtype: ~azure.mgmt.keyvault.v2016_10_01.models.CheckNameAvailabilityResult
827833
:raises: ~azure.core.exceptions.HttpResponseError
828834
"""
829-
cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"]
835+
cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResult"]
830836
error_map = {
831837
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
832838
}

sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2016_10_01/models/_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ def __init__(
455455
**kwargs
456456
):
457457
super(Sku, self).__init__(**kwargs)
458-
self.family = kwargs['family']
458+
self.family = kwargs.get('family', "A")
459459
self.name = kwargs['name']
460460

461461

sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2016_10_01/models/_models_py3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ class Sku(msrest.serialization.Model):
497497
def __init__(
498498
self,
499499
*,
500-
family: Union[str, "SkuFamily"],
500+
family: Union[str, "SkuFamily"] = "A",
501501
name: Union[str, "SkuName"],
502502
**kwargs
503503
):

sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2016_10_01/operations/_operations.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from azure.core.pipeline.transport import HttpRequest, HttpResponse
1515
from azure.mgmt.core.exceptions import ARMErrorFormat
1616

17-
from .. import models
17+
from .. import models as _models
1818

1919
if TYPE_CHECKING:
2020
# pylint: disable=unused-import,ungrouped-imports
@@ -37,7 +37,7 @@ class Operations(object):
3737
:param deserializer: An object model deserializer.
3838
"""
3939

40-
models = models
40+
models = _models
4141

4242
def __init__(self, client, config, serializer, deserializer):
4343
self._client = client
@@ -49,15 +49,15 @@ def list(
4949
self,
5050
**kwargs # type: Any
5151
):
52-
# type: (...) -> Iterable["models.OperationListResult"]
52+
# type: (...) -> Iterable["_models.OperationListResult"]
5353
"""Lists all of the available Key Vault Rest API operations.
5454
5555
:keyword callable cls: A custom type or function that will be passed the direct response
5656
:return: An iterator like instance of either OperationListResult or the result of cls(response)
5757
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.keyvault.v2016_10_01.models.OperationListResult]
5858
:raises: ~azure.core.exceptions.HttpResponseError
5959
"""
60-
cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"]
60+
cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"]
6161
error_map = {
6262
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
6363
}

0 commit comments

Comments
 (0)