Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[T2-GA] Keyvault #13785

Merged
merged 3 commits into from
Sep 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions sdk/keyvault/azure-mgmt-keyvault/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release History

## 7.0.0 (2020-09-15)

- Release as a stable version

## 7.0.0b3 (2020-09-09)

**Features**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
__all__ = ['KeyVaultManagementClient']

try:
from ._patch import patch_sdk
from ._patch import patch_sdk # type: ignore
patch_sdk()
except ImportError:
pass
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMHttpLoggingPolicy

from ._version import VERSION

Expand Down Expand Up @@ -43,8 +44,7 @@ def __init__(

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

Expand All @@ -57,6 +57,7 @@ def _configure(
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ def __init__(
self._config = KeyVaultManagementClientConfiguration(credential, subscription_id, **kwargs)
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
super(KeyVaultManagementClient, self).__init__(
credential,
self._config,
api_version=api_version,
profile=profile
)
Expand Down Expand Up @@ -100,7 +98,7 @@ def models(cls, api_version=DEFAULT_API_VERSION):
elif api_version == '2020-04-01-preview':
from .v2020_04_01_preview import models
return models
raise NotImplementedError("APIVersion {} is not available".format(api_version))
raise ValueError("API version {} is not available".format(api_version))

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

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

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

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

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

def close(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
# license information.
# --------------------------------------------------------------------------

VERSION = "7.0.0b3"
VERSION = "7.0.0"
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 ._key_vault_management_client_async import KeyVaultManagementClient
from ._key_vault_management_client import KeyVaultManagementClient
__all__ = ['KeyVaultManagementClient']
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMHttpLoggingPolicy

from .._version import VERSION

Expand All @@ -34,7 +35,6 @@ def __init__(
subscription_id, # type: str
**kwargs # type: Any
) -> None:
# type: (...) -> None
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
Expand All @@ -43,8 +43,7 @@ def __init__(

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

Expand All @@ -56,6 +55,7 @@ def _configure(
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from azure.profiles import KnownProfiles, ProfileDefinition
from azure.profiles.multiapiclient import MultiApiClientMixin
from ._configuration_async import KeyVaultManagementClientConfiguration
from ._configuration import KeyVaultManagementClientConfiguration

class _SDKClient(object):
def __init__(self, *args, **kwargs):
Expand Down Expand Up @@ -69,8 +69,6 @@ def __init__(
self._config = KeyVaultManagementClientConfiguration(credential, subscription_id, **kwargs)
self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
super(KeyVaultManagementClient, self).__init__(
credential,
self._config,
api_version=api_version,
profile=profile
)
Expand Down Expand Up @@ -100,101 +98,101 @@ def models(cls, api_version=DEFAULT_API_VERSION):
elif api_version == '2020-04-01-preview':
from ..v2020_04_01_preview import models
return models
raise NotImplementedError("APIVersion {} is not available".format(api_version))
raise ValueError("API version {} is not available".format(api_version))

@property
def managed_hsms(self):
"""Instance depends on the API version:

* 2020-04-01-preview: :class:`ManagedHsmsOperations<azure.mgmt.keyvault.v2020_04_01_preview.aio.operations_async.ManagedHsmsOperations>`
* 2020-04-01-preview: :class:`ManagedHsmsOperations<azure.mgmt.keyvault.v2020_04_01_preview.aio.operations.ManagedHsmsOperations>`
"""
api_version = self._get_api_version('managed_hsms')
if api_version == '2020-04-01-preview':
from ..v2020_04_01_preview.aio.operations_async import ManagedHsmsOperations as OperationClass
from ..v2020_04_01_preview.aio.operations import ManagedHsmsOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
raise ValueError("API version {} does not have operation group 'managed_hsms'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

@property
def operations(self):
"""Instance depends on the API version:

* 2016-10-01: :class:`Operations<azure.mgmt.keyvault.v2016_10_01.aio.operations_async.Operations>`
* 2018-02-14: :class:`Operations<azure.mgmt.keyvault.v2018_02_14.aio.operations_async.Operations>`
* 2019-09-01: :class:`Operations<azure.mgmt.keyvault.v2019_09_01.aio.operations_async.Operations>`
* 2020-04-01-preview: :class:`Operations<azure.mgmt.keyvault.v2020_04_01_preview.aio.operations_async.Operations>`
* 2016-10-01: :class:`Operations<azure.mgmt.keyvault.v2016_10_01.aio.operations.Operations>`
* 2018-02-14: :class:`Operations<azure.mgmt.keyvault.v2018_02_14.aio.operations.Operations>`
* 2019-09-01: :class:`Operations<azure.mgmt.keyvault.v2019_09_01.aio.operations.Operations>`
* 2020-04-01-preview: :class:`Operations<azure.mgmt.keyvault.v2020_04_01_preview.aio.operations.Operations>`
"""
api_version = self._get_api_version('operations')
if api_version == '2016-10-01':
from ..v2016_10_01.aio.operations_async import Operations as OperationClass
from ..v2016_10_01.aio.operations import Operations as OperationClass
elif api_version == '2018-02-14':
from ..v2018_02_14.aio.operations_async import Operations as OperationClass
from ..v2018_02_14.aio.operations import Operations as OperationClass
elif api_version == '2019-09-01':
from ..v2019_09_01.aio.operations_async import Operations as OperationClass
from ..v2019_09_01.aio.operations import Operations as OperationClass
elif api_version == '2020-04-01-preview':
from ..v2020_04_01_preview.aio.operations_async import Operations as OperationClass
from ..v2020_04_01_preview.aio.operations import Operations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
raise ValueError("API version {} does not have operation group 'operations'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

@property
def private_endpoint_connections(self):
"""Instance depends on the API version:

* 2018-02-14: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.keyvault.v2018_02_14.aio.operations_async.PrivateEndpointConnectionsOperations>`
* 2019-09-01: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.keyvault.v2019_09_01.aio.operations_async.PrivateEndpointConnectionsOperations>`
* 2020-04-01-preview: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.keyvault.v2020_04_01_preview.aio.operations_async.PrivateEndpointConnectionsOperations>`
* 2018-02-14: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.keyvault.v2018_02_14.aio.operations.PrivateEndpointConnectionsOperations>`
* 2019-09-01: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.keyvault.v2019_09_01.aio.operations.PrivateEndpointConnectionsOperations>`
* 2020-04-01-preview: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.keyvault.v2020_04_01_preview.aio.operations.PrivateEndpointConnectionsOperations>`
"""
api_version = self._get_api_version('private_endpoint_connections')
if api_version == '2018-02-14':
from ..v2018_02_14.aio.operations_async import PrivateEndpointConnectionsOperations as OperationClass
from ..v2018_02_14.aio.operations import PrivateEndpointConnectionsOperations as OperationClass
elif api_version == '2019-09-01':
from ..v2019_09_01.aio.operations_async import PrivateEndpointConnectionsOperations as OperationClass
from ..v2019_09_01.aio.operations import PrivateEndpointConnectionsOperations as OperationClass
elif api_version == '2020-04-01-preview':
from ..v2020_04_01_preview.aio.operations_async import PrivateEndpointConnectionsOperations as OperationClass
from ..v2020_04_01_preview.aio.operations import PrivateEndpointConnectionsOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
raise ValueError("API version {} does not have operation group 'private_endpoint_connections'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

@property
def private_link_resources(self):
"""Instance depends on the API version:

* 2018-02-14: :class:`PrivateLinkResourcesOperations<azure.mgmt.keyvault.v2018_02_14.aio.operations_async.PrivateLinkResourcesOperations>`
* 2019-09-01: :class:`PrivateLinkResourcesOperations<azure.mgmt.keyvault.v2019_09_01.aio.operations_async.PrivateLinkResourcesOperations>`
* 2020-04-01-preview: :class:`PrivateLinkResourcesOperations<azure.mgmt.keyvault.v2020_04_01_preview.aio.operations_async.PrivateLinkResourcesOperations>`
* 2018-02-14: :class:`PrivateLinkResourcesOperations<azure.mgmt.keyvault.v2018_02_14.aio.operations.PrivateLinkResourcesOperations>`
* 2019-09-01: :class:`PrivateLinkResourcesOperations<azure.mgmt.keyvault.v2019_09_01.aio.operations.PrivateLinkResourcesOperations>`
* 2020-04-01-preview: :class:`PrivateLinkResourcesOperations<azure.mgmt.keyvault.v2020_04_01_preview.aio.operations.PrivateLinkResourcesOperations>`
"""
api_version = self._get_api_version('private_link_resources')
if api_version == '2018-02-14':
from ..v2018_02_14.aio.operations_async import PrivateLinkResourcesOperations as OperationClass
from ..v2018_02_14.aio.operations import PrivateLinkResourcesOperations as OperationClass
elif api_version == '2019-09-01':
from ..v2019_09_01.aio.operations_async import PrivateLinkResourcesOperations as OperationClass
from ..v2019_09_01.aio.operations import PrivateLinkResourcesOperations as OperationClass
elif api_version == '2020-04-01-preview':
from ..v2020_04_01_preview.aio.operations_async import PrivateLinkResourcesOperations as OperationClass
from ..v2020_04_01_preview.aio.operations import PrivateLinkResourcesOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
raise ValueError("API version {} does not have operation group 'private_link_resources'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

@property
def vaults(self):
"""Instance depends on the API version:

* 2016-10-01: :class:`VaultsOperations<azure.mgmt.keyvault.v2016_10_01.aio.operations_async.VaultsOperations>`
* 2018-02-14: :class:`VaultsOperations<azure.mgmt.keyvault.v2018_02_14.aio.operations_async.VaultsOperations>`
* 2019-09-01: :class:`VaultsOperations<azure.mgmt.keyvault.v2019_09_01.aio.operations_async.VaultsOperations>`
* 2020-04-01-preview: :class:`VaultsOperations<azure.mgmt.keyvault.v2020_04_01_preview.aio.operations_async.VaultsOperations>`
* 2016-10-01: :class:`VaultsOperations<azure.mgmt.keyvault.v2016_10_01.aio.operations.VaultsOperations>`
* 2018-02-14: :class:`VaultsOperations<azure.mgmt.keyvault.v2018_02_14.aio.operations.VaultsOperations>`
* 2019-09-01: :class:`VaultsOperations<azure.mgmt.keyvault.v2019_09_01.aio.operations.VaultsOperations>`
* 2020-04-01-preview: :class:`VaultsOperations<azure.mgmt.keyvault.v2020_04_01_preview.aio.operations.VaultsOperations>`
"""
api_version = self._get_api_version('vaults')
if api_version == '2016-10-01':
from ..v2016_10_01.aio.operations_async import VaultsOperations as OperationClass
from ..v2016_10_01.aio.operations import VaultsOperations as OperationClass
elif api_version == '2018-02-14':
from ..v2018_02_14.aio.operations_async import VaultsOperations as OperationClass
from ..v2018_02_14.aio.operations import VaultsOperations as OperationClass
elif api_version == '2019-09-01':
from ..v2019_09_01.aio.operations_async import VaultsOperations as OperationClass
from ..v2019_09_01.aio.operations import VaultsOperations as OperationClass
elif api_version == '2020-04-01-preview':
from ..v2020_04_01_preview.aio.operations_async import VaultsOperations as OperationClass
from ..v2020_04_01_preview.aio.operations import VaultsOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
raise ValueError("API version {} does not have operation group 'vaults'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

async def close(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
__all__ = ['KeyVaultManagementClient']

try:
from ._patch import patch_sdk
from ._patch import patch_sdk # type: ignore
patch_sdk()
except ImportError:
pass