Skip to content

Commit affc649

Browse files
[T2-GA] Keyvault (#13785)
* generate keyvault track2 ga version * fix changelog * Update CHANGELOG.md Co-authored-by: changlong-liu <[email protected]>
1 parent b7c2189 commit affc649

File tree

88 files changed

+1704
-1272
lines changed

Some content is hidden

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

88 files changed

+1704
-1272
lines changed

sdk/keyvault/azure-mgmt-keyvault/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Release History
22

3+
## 7.0.0 (2020-09-15)
4+
5+
- Release as a stable version
6+
37
## 7.0.0b3 (2020-09-09)
48

59
**Features**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
__all__ = ['KeyVaultManagementClient']
1111

1212
try:
13-
from ._patch import patch_sdk
13+
from ._patch import patch_sdk # type: ignore
1414
patch_sdk()
1515
except ImportError:
1616
pass

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
from azure.core.configuration import Configuration
1414
from azure.core.pipeline import policies
15+
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
1516

1617
from ._version import VERSION
1718

@@ -43,8 +44,7 @@ def __init__(
4344

4445
self.credential = credential
4546
self.subscription_id = subscription_id
46-
self.credential_scopes = ['https://management.azure.com/.default']
47-
self.credential_scopes.extend(kwargs.pop('credential_scopes', []))
47+
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
4848
kwargs.setdefault('sdk_moniker', 'azure-mgmt-keyvault/{}'.format(VERSION))
4949
self._configure(**kwargs)
5050

@@ -57,6 +57,7 @@ def _configure(
5757
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
5858
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
5959
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
60+
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
6061
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
6162
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
6263
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)

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

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ def __init__(
6969
self._config = KeyVaultManagementClientConfiguration(credential, subscription_id, **kwargs)
7070
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
7171
super(KeyVaultManagementClient, self).__init__(
72-
credential,
73-
self._config,
7472
api_version=api_version,
7573
profile=profile
7674
)
@@ -100,7 +98,7 @@ def models(cls, api_version=DEFAULT_API_VERSION):
10098
elif api_version == '2020-04-01-preview':
10199
from .v2020_04_01_preview import models
102100
return models
103-
raise NotImplementedError("APIVersion {} is not available".format(api_version))
101+
raise ValueError("API version {} is not available".format(api_version))
104102

105103
@property
106104
def managed_hsms(self):
@@ -112,7 +110,7 @@ def managed_hsms(self):
112110
if api_version == '2020-04-01-preview':
113111
from .v2020_04_01_preview.operations import ManagedHsmsOperations as OperationClass
114112
else:
115-
raise NotImplementedError("APIVersion {} is not available".format(api_version))
113+
raise ValueError("API version {} does not have operation group 'managed_hsms'".format(api_version))
116114
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
117115

118116
@property
@@ -134,7 +132,7 @@ def operations(self):
134132
elif api_version == '2020-04-01-preview':
135133
from .v2020_04_01_preview.operations import Operations as OperationClass
136134
else:
137-
raise NotImplementedError("APIVersion {} is not available".format(api_version))
135+
raise ValueError("API version {} does not have operation group 'operations'".format(api_version))
138136
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
139137

140138
@property
@@ -153,7 +151,7 @@ def private_endpoint_connections(self):
153151
elif api_version == '2020-04-01-preview':
154152
from .v2020_04_01_preview.operations import PrivateEndpointConnectionsOperations as OperationClass
155153
else:
156-
raise NotImplementedError("APIVersion {} is not available".format(api_version))
154+
raise ValueError("API version {} does not have operation group 'private_endpoint_connections'".format(api_version))
157155
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
158156

159157
@property
@@ -172,7 +170,7 @@ def private_link_resources(self):
172170
elif api_version == '2020-04-01-preview':
173171
from .v2020_04_01_preview.operations import PrivateLinkResourcesOperations as OperationClass
174172
else:
175-
raise NotImplementedError("APIVersion {} is not available".format(api_version))
173+
raise ValueError("API version {} does not have operation group 'private_link_resources'".format(api_version))
176174
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
177175

178176
@property
@@ -194,7 +192,7 @@ def vaults(self):
194192
elif api_version == '2020-04-01-preview':
195193
from .v2020_04_01_preview.operations import VaultsOperations as OperationClass
196194
else:
197-
raise NotImplementedError("APIVersion {} is not available".format(api_version))
195+
raise ValueError("API version {} does not have operation group 'vaults'".format(api_version))
198196
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
199197

200198
def close(self):

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
# license information.
66
# --------------------------------------------------------------------------
77

8-
VERSION = "7.0.0b3"
8+
VERSION = "7.0.0"

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

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

9-
from ._key_vault_management_client_async import KeyVaultManagementClient
9+
from ._key_vault_management_client import KeyVaultManagementClient
1010
__all__ = ['KeyVaultManagementClient']

sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/aio/_configuration_async.py renamed to sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/aio/_configuration.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
from azure.core.configuration import Configuration
1414
from azure.core.pipeline import policies
15+
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
1516

1617
from .._version import VERSION
1718

@@ -34,7 +35,6 @@ def __init__(
3435
subscription_id, # type: str
3536
**kwargs # type: Any
3637
) -> None:
37-
# type: (...) -> None
3838
if credential is None:
3939
raise ValueError("Parameter 'credential' must not be None.")
4040
if subscription_id is None:
@@ -43,8 +43,7 @@ def __init__(
4343

4444
self.credential = credential
4545
self.subscription_id = subscription_id
46-
self.credential_scopes = ['https://management.azure.com/.default']
47-
self.credential_scopes.extend(kwargs.pop('credential_scopes', []))
46+
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
4847
kwargs.setdefault('sdk_moniker', 'azure-mgmt-keyvault/{}'.format(VERSION))
4948
self._configure(**kwargs)
5049

@@ -56,6 +55,7 @@ def _configure(
5655
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
5756
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
5857
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
58+
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
5959
self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs)
6060
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
6161
self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs)
Lines changed: 37 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
from azure.profiles import KnownProfiles, ProfileDefinition
1616
from azure.profiles.multiapiclient import MultiApiClientMixin
17-
from ._configuration_async import KeyVaultManagementClientConfiguration
17+
from ._configuration import KeyVaultManagementClientConfiguration
1818

1919
class _SDKClient(object):
2020
def __init__(self, *args, **kwargs):
@@ -69,8 +69,6 @@ def __init__(
6969
self._config = KeyVaultManagementClientConfiguration(credential, subscription_id, **kwargs)
7070
self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
7171
super(KeyVaultManagementClient, self).__init__(
72-
credential,
73-
self._config,
7472
api_version=api_version,
7573
profile=profile
7674
)
@@ -100,101 +98,101 @@ def models(cls, api_version=DEFAULT_API_VERSION):
10098
elif api_version == '2020-04-01-preview':
10199
from ..v2020_04_01_preview import models
102100
return models
103-
raise NotImplementedError("APIVersion {} is not available".format(api_version))
101+
raise ValueError("API version {} is not available".format(api_version))
104102

105103
@property
106104
def managed_hsms(self):
107105
"""Instance depends on the API version:
108106
109-
* 2020-04-01-preview: :class:`ManagedHsmsOperations<azure.mgmt.keyvault.v2020_04_01_preview.aio.operations_async.ManagedHsmsOperations>`
107+
* 2020-04-01-preview: :class:`ManagedHsmsOperations<azure.mgmt.keyvault.v2020_04_01_preview.aio.operations.ManagedHsmsOperations>`
110108
"""
111109
api_version = self._get_api_version('managed_hsms')
112110
if api_version == '2020-04-01-preview':
113-
from ..v2020_04_01_preview.aio.operations_async import ManagedHsmsOperations as OperationClass
111+
from ..v2020_04_01_preview.aio.operations import ManagedHsmsOperations as OperationClass
114112
else:
115-
raise NotImplementedError("APIVersion {} is not available".format(api_version))
113+
raise ValueError("API version {} does not have operation group 'managed_hsms'".format(api_version))
116114
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
117115

118116
@property
119117
def operations(self):
120118
"""Instance depends on the API version:
121119
122-
* 2016-10-01: :class:`Operations<azure.mgmt.keyvault.v2016_10_01.aio.operations_async.Operations>`
123-
* 2018-02-14: :class:`Operations<azure.mgmt.keyvault.v2018_02_14.aio.operations_async.Operations>`
124-
* 2019-09-01: :class:`Operations<azure.mgmt.keyvault.v2019_09_01.aio.operations_async.Operations>`
125-
* 2020-04-01-preview: :class:`Operations<azure.mgmt.keyvault.v2020_04_01_preview.aio.operations_async.Operations>`
120+
* 2016-10-01: :class:`Operations<azure.mgmt.keyvault.v2016_10_01.aio.operations.Operations>`
121+
* 2018-02-14: :class:`Operations<azure.mgmt.keyvault.v2018_02_14.aio.operations.Operations>`
122+
* 2019-09-01: :class:`Operations<azure.mgmt.keyvault.v2019_09_01.aio.operations.Operations>`
123+
* 2020-04-01-preview: :class:`Operations<azure.mgmt.keyvault.v2020_04_01_preview.aio.operations.Operations>`
126124
"""
127125
api_version = self._get_api_version('operations')
128126
if api_version == '2016-10-01':
129-
from ..v2016_10_01.aio.operations_async import Operations as OperationClass
127+
from ..v2016_10_01.aio.operations import Operations as OperationClass
130128
elif api_version == '2018-02-14':
131-
from ..v2018_02_14.aio.operations_async import Operations as OperationClass
129+
from ..v2018_02_14.aio.operations import Operations as OperationClass
132130
elif api_version == '2019-09-01':
133-
from ..v2019_09_01.aio.operations_async import Operations as OperationClass
131+
from ..v2019_09_01.aio.operations import Operations as OperationClass
134132
elif api_version == '2020-04-01-preview':
135-
from ..v2020_04_01_preview.aio.operations_async import Operations as OperationClass
133+
from ..v2020_04_01_preview.aio.operations import Operations as OperationClass
136134
else:
137-
raise NotImplementedError("APIVersion {} is not available".format(api_version))
135+
raise ValueError("API version {} does not have operation group 'operations'".format(api_version))
138136
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
139137

140138
@property
141139
def private_endpoint_connections(self):
142140
"""Instance depends on the API version:
143141
144-
* 2018-02-14: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.keyvault.v2018_02_14.aio.operations_async.PrivateEndpointConnectionsOperations>`
145-
* 2019-09-01: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.keyvault.v2019_09_01.aio.operations_async.PrivateEndpointConnectionsOperations>`
146-
* 2020-04-01-preview: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.keyvault.v2020_04_01_preview.aio.operations_async.PrivateEndpointConnectionsOperations>`
142+
* 2018-02-14: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.keyvault.v2018_02_14.aio.operations.PrivateEndpointConnectionsOperations>`
143+
* 2019-09-01: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.keyvault.v2019_09_01.aio.operations.PrivateEndpointConnectionsOperations>`
144+
* 2020-04-01-preview: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.keyvault.v2020_04_01_preview.aio.operations.PrivateEndpointConnectionsOperations>`
147145
"""
148146
api_version = self._get_api_version('private_endpoint_connections')
149147
if api_version == '2018-02-14':
150-
from ..v2018_02_14.aio.operations_async import PrivateEndpointConnectionsOperations as OperationClass
148+
from ..v2018_02_14.aio.operations import PrivateEndpointConnectionsOperations as OperationClass
151149
elif api_version == '2019-09-01':
152-
from ..v2019_09_01.aio.operations_async import PrivateEndpointConnectionsOperations as OperationClass
150+
from ..v2019_09_01.aio.operations import PrivateEndpointConnectionsOperations as OperationClass
153151
elif api_version == '2020-04-01-preview':
154-
from ..v2020_04_01_preview.aio.operations_async import PrivateEndpointConnectionsOperations as OperationClass
152+
from ..v2020_04_01_preview.aio.operations import PrivateEndpointConnectionsOperations as OperationClass
155153
else:
156-
raise NotImplementedError("APIVersion {} is not available".format(api_version))
154+
raise ValueError("API version {} does not have operation group 'private_endpoint_connections'".format(api_version))
157155
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
158156

159157
@property
160158
def private_link_resources(self):
161159
"""Instance depends on the API version:
162160
163-
* 2018-02-14: :class:`PrivateLinkResourcesOperations<azure.mgmt.keyvault.v2018_02_14.aio.operations_async.PrivateLinkResourcesOperations>`
164-
* 2019-09-01: :class:`PrivateLinkResourcesOperations<azure.mgmt.keyvault.v2019_09_01.aio.operations_async.PrivateLinkResourcesOperations>`
165-
* 2020-04-01-preview: :class:`PrivateLinkResourcesOperations<azure.mgmt.keyvault.v2020_04_01_preview.aio.operations_async.PrivateLinkResourcesOperations>`
161+
* 2018-02-14: :class:`PrivateLinkResourcesOperations<azure.mgmt.keyvault.v2018_02_14.aio.operations.PrivateLinkResourcesOperations>`
162+
* 2019-09-01: :class:`PrivateLinkResourcesOperations<azure.mgmt.keyvault.v2019_09_01.aio.operations.PrivateLinkResourcesOperations>`
163+
* 2020-04-01-preview: :class:`PrivateLinkResourcesOperations<azure.mgmt.keyvault.v2020_04_01_preview.aio.operations.PrivateLinkResourcesOperations>`
166164
"""
167165
api_version = self._get_api_version('private_link_resources')
168166
if api_version == '2018-02-14':
169-
from ..v2018_02_14.aio.operations_async import PrivateLinkResourcesOperations as OperationClass
167+
from ..v2018_02_14.aio.operations import PrivateLinkResourcesOperations as OperationClass
170168
elif api_version == '2019-09-01':
171-
from ..v2019_09_01.aio.operations_async import PrivateLinkResourcesOperations as OperationClass
169+
from ..v2019_09_01.aio.operations import PrivateLinkResourcesOperations as OperationClass
172170
elif api_version == '2020-04-01-preview':
173-
from ..v2020_04_01_preview.aio.operations_async import PrivateLinkResourcesOperations as OperationClass
171+
from ..v2020_04_01_preview.aio.operations import PrivateLinkResourcesOperations as OperationClass
174172
else:
175-
raise NotImplementedError("APIVersion {} is not available".format(api_version))
173+
raise ValueError("API version {} does not have operation group 'private_link_resources'".format(api_version))
176174
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
177175

178176
@property
179177
def vaults(self):
180178
"""Instance depends on the API version:
181179
182-
* 2016-10-01: :class:`VaultsOperations<azure.mgmt.keyvault.v2016_10_01.aio.operations_async.VaultsOperations>`
183-
* 2018-02-14: :class:`VaultsOperations<azure.mgmt.keyvault.v2018_02_14.aio.operations_async.VaultsOperations>`
184-
* 2019-09-01: :class:`VaultsOperations<azure.mgmt.keyvault.v2019_09_01.aio.operations_async.VaultsOperations>`
185-
* 2020-04-01-preview: :class:`VaultsOperations<azure.mgmt.keyvault.v2020_04_01_preview.aio.operations_async.VaultsOperations>`
180+
* 2016-10-01: :class:`VaultsOperations<azure.mgmt.keyvault.v2016_10_01.aio.operations.VaultsOperations>`
181+
* 2018-02-14: :class:`VaultsOperations<azure.mgmt.keyvault.v2018_02_14.aio.operations.VaultsOperations>`
182+
* 2019-09-01: :class:`VaultsOperations<azure.mgmt.keyvault.v2019_09_01.aio.operations.VaultsOperations>`
183+
* 2020-04-01-preview: :class:`VaultsOperations<azure.mgmt.keyvault.v2020_04_01_preview.aio.operations.VaultsOperations>`
186184
"""
187185
api_version = self._get_api_version('vaults')
188186
if api_version == '2016-10-01':
189-
from ..v2016_10_01.aio.operations_async import VaultsOperations as OperationClass
187+
from ..v2016_10_01.aio.operations import VaultsOperations as OperationClass
190188
elif api_version == '2018-02-14':
191-
from ..v2018_02_14.aio.operations_async import VaultsOperations as OperationClass
189+
from ..v2018_02_14.aio.operations import VaultsOperations as OperationClass
192190
elif api_version == '2019-09-01':
193-
from ..v2019_09_01.aio.operations_async import VaultsOperations as OperationClass
191+
from ..v2019_09_01.aio.operations import VaultsOperations as OperationClass
194192
elif api_version == '2020-04-01-preview':
195-
from ..v2020_04_01_preview.aio.operations_async import VaultsOperations as OperationClass
193+
from ..v2020_04_01_preview.aio.operations import VaultsOperations as OperationClass
196194
else:
197-
raise NotImplementedError("APIVersion {} is not available".format(api_version))
195+
raise ValueError("API version {} does not have operation group 'vaults'".format(api_version))
198196
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
199197

200198
async def close(self):

sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2016_10_01/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
__all__ = ['KeyVaultManagementClient']
1111

1212
try:
13-
from ._patch import patch_sdk
13+
from ._patch import patch_sdk # type: ignore
1414
patch_sdk()
1515
except ImportError:
1616
pass

0 commit comments

Comments
 (0)