Skip to content

Commit

Permalink
CodeGen from PR 13585 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Dev keyvault microsoft.key vault 2021 04 01 preview (Azure#13585)

* Adds base for updating Microsoft.KeyVault from version preview/2020-04-01-preview to version 2021-04-01-preview

* Updates readme

* Updates API version in new specs and examples

* Open API change for Managed Hsm private endpoints feature (Azure#12938)

* Open API change for Managed Hsm private endpoints feature

* Fixing spell check errors

* Fixing spell check errors

* Prettier fixes

* Fixing swagger validation errors

* Fixing systemData property reference

* Adding publicNetworkAccess property based on private endpoint requirement.

* GET responses following a successful DELETE should be returning 404. … (Azure#13054)

* GET responses following a successful DELETE should be returning 404. Only the DELETE response is to return 204 if the resource didn't exist (it allows idempotent deletes).

(cherry picked from commit b752a19c6cc1f8a8eed9f106e2c77b8d5b5db19f)

* Removing 404 as it is taken care by default response.

* Added new routes for Deleted ManagedHsm for Soft Delete Feature (Azure#13282)

* Added new routes for Deleted ManagedHsm and examples, updated ManagedHsm definition to include PurgeDateTimeUTC

* Fixing validation issues.

* Fixing errors in properties in example jsons

* Delete keyvault.json

Deleted an errant json file

* Fixed misspelling of property in examples

* Fixed x-ms-examples naming, fixed camelcasing

* Addressing comments in PR to make 204s 404s and also changing PurgeDateTimeUTC to scheduledPurgeDate

* Added schema definitions for 404

* Removed 200 for purge

Co-authored-by: Soohwan Kim <sookim@microsoft.com>

* Addressing Comments for PR 13585 (Azure#13586)

* Removed 404s to allow requests to fall through to default

* Removing 404s from examples

Co-authored-by: Soohwan Kim <sookim@microsoft.com>

* Added deletedmanagedhsm object to examples and managedhsm.json (Azure#13591)

* Added deletedmanagedhsm object to examples and managedhsm.json

* Fixing error in references to correct values

* Changed vaultId to mhsmId in exmaples

Co-authored-by: Soohwan Kim <sookim@microsoft.com>

* Try to use the common type for SystemData (Azure#13723)

* Add SystemData property for KeyVault

* 04012021 fix schema (Azure#13749)

* Resolving conflict with custom-words.txt

* Add 2021 preview to azureresourcechema, add suppression to readme

* Add 2021 preview to azureresourcechema

* Merging custom-words.txt

Co-authored-by: Soohwan Kim <sookim@microsoft.com>

* Add missing default error response (Azure#13762)

* Fix Lint error (Azure#13765)

* Add missing default error response

* Update the integer format to fix Lint error

* Add securityDefinitions

* Added python tag for 2021 preview (Azure#13805)

Co-authored-by: Soohwan Kim <sookim@microsoft.com>

* Fixing linting errors for MHSM R4036 - ImplementPrivateEndpointAPIs (Azure#13822)

* Fixing linting errors for MHSM R4036 - ImplementPrivateEndpointAPIs

(cherry picked from commit c1c5aebfb98cacd0a4ee5596fb7b0d9f782a9a3e)

* prettier fix

* Add suppression for SystemData (Azure#13835)

* Add suppression for SystemData

* Fix linting error R4036 - ImplementPrivateEndpointAPIs

* specify the suppression for SystemData

* Revert "specify the suppression for SystemData"

This reverts commit cbebab81ab08ec1a29b41c891c58cf08ff2eb3c4.

Co-authored-by: jiacheng-L <71623842+jiacheng-L@users.noreply.github.com>
Co-authored-by: kim-soohwan <40476315+kim-soohwan@users.noreply.github.com>
Co-authored-by: Soohwan Kim <sookim@microsoft.com>
Co-authored-by: Arthur Ning <57385816+akning-ms@users.noreply.github.com>
  • Loading branch information
5 people committed Apr 8, 2021
1 parent d34872c commit 63c263f
Show file tree
Hide file tree
Showing 94 changed files with 15,759 additions and 714 deletions.
1 change: 1 addition & 0 deletions sdk/keyvault/azure-mgmt-keyvault/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include _meta.json
recursive-include tests *.py *.yaml
include *.md
include azure/__init__.py
Expand Down
8 changes: 8 additions & 0 deletions sdk/keyvault/azure-mgmt-keyvault/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"autorest": "3.0.6369",
"use": "@autorest/python@5.6.2",
"commit": "738823deb56c98b6e7448620ffba21fc11a16715",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/keyvault/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.2 --version=3.0.6369",
"readme": "specification/keyvault/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,19 @@
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from typing import Any
from typing import TYPE_CHECKING

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

from ._version import VERSION

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from typing import Any

from azure.core.credentials import TokenCredential

class KeyVaultManagementClientConfiguration(Configuration):
"""Configuration for KeyVaultManagementClient.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,21 @@
# regenerated.
# --------------------------------------------------------------------------

from azure.mgmt.core import ARMPipelineClient
from msrest import Serializer, Deserializer
from typing import TYPE_CHECKING

from azure.mgmt.core import ARMPipelineClient
from azure.profiles import KnownProfiles, ProfileDefinition
from azure.profiles.multiapiclient import MultiApiClientMixin
from msrest import Deserializer, Serializer

from ._configuration import KeyVaultManagementClientConfiguration

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from typing import Any, Optional

from azure.core.credentials import TokenCredential

class _SDKClient(object):
def __init__(self, *args, **kwargs):
"""This is a fake class to support current implemetation of MultiApiClientMixin."
Expand All @@ -38,9 +46,10 @@ class KeyVaultManagementClient(MultiApiClientMixin, _SDKClient):
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
:type subscription_id: str
:param str api_version: API version to use if no profile is provided, or if
missing in profile.
:param str base_url: Service URL
:param api_version: API version to use if no profile is provided, or if missing in profile.
:type api_version: str
:param base_url: Service URL
:type base_url: str
:param profile: A profile definition, from KnownProfiles to dict.
:type profile: azure.profiles.KnownProfiles
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
Expand All @@ -59,9 +68,9 @@ def __init__(
self,
credential, # type: "TokenCredential"
subscription_id, # type: str
api_version=None,
base_url=None,
profile=KnownProfiles.default,
api_version=None, # type: Optional[str]
base_url=None, # type: Optional[str]
profile=KnownProfiles.default, # type: KnownProfiles
**kwargs # type: Any
):
if not base_url:
Expand All @@ -85,6 +94,7 @@ def models(cls, api_version=DEFAULT_API_VERSION):
* 2018-02-14: :mod:`v2018_02_14.models<azure.mgmt.keyvault.v2018_02_14.models>`
* 2019-09-01: :mod:`v2019_09_01.models<azure.mgmt.keyvault.v2019_09_01.models>`
* 2020-04-01-preview: :mod:`v2020_04_01_preview.models<azure.mgmt.keyvault.v2020_04_01_preview.models>`
* 2021-04-01-preview: :mod:`v2021_04_01_preview.models<azure.mgmt.keyvault.v2021_04_01_preview.models>`
"""
if api_version == '2016-10-01':
from .v2016_10_01 import models
Expand All @@ -98,21 +108,66 @@ def models(cls, api_version=DEFAULT_API_VERSION):
elif api_version == '2020-04-01-preview':
from .v2020_04_01_preview import models
return models
elif api_version == '2021-04-01-preview':
from .v2021_04_01_preview import models
return models
raise ValueError("API version {} is not available".format(api_version))

@property
def keys(self):
"""Instance depends on the API version:
* 2019-09-01: :class:`KeysOperations<azure.mgmt.keyvault.v2019_09_01.operations.KeysOperations>`
"""
api_version = self._get_api_version('keys')
if api_version == '2019-09-01':
from .v2019_09_01.operations import KeysOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'keys'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(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.operations.ManagedHsmsOperations>`
* 2021-04-01-preview: :class:`ManagedHsmsOperations<azure.mgmt.keyvault.v2021_04_01_preview.operations.ManagedHsmsOperations>`
"""
api_version = self._get_api_version('managed_hsms')
if api_version == '2020-04-01-preview':
from .v2020_04_01_preview.operations import ManagedHsmsOperations as OperationClass
elif api_version == '2021-04-01-preview':
from .v2021_04_01_preview.operations import ManagedHsmsOperations as OperationClass
else:
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 mhsm_private_endpoint_connections(self):
"""Instance depends on the API version:
* 2021-04-01-preview: :class:`MHSMPrivateEndpointConnectionsOperations<azure.mgmt.keyvault.v2021_04_01_preview.operations.MHSMPrivateEndpointConnectionsOperations>`
"""
api_version = self._get_api_version('mhsm_private_endpoint_connections')
if api_version == '2021-04-01-preview':
from .v2021_04_01_preview.operations import MHSMPrivateEndpointConnectionsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'mhsm_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 mhsm_private_link_resources(self):
"""Instance depends on the API version:
* 2021-04-01-preview: :class:`MHSMPrivateLinkResourcesOperations<azure.mgmt.keyvault.v2021_04_01_preview.operations.MHSMPrivateLinkResourcesOperations>`
"""
api_version = self._get_api_version('mhsm_private_link_resources')
if api_version == '2021-04-01-preview':
from .v2021_04_01_preview.operations import MHSMPrivateLinkResourcesOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'mhsm_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 operations(self):
"""Instance depends on the API version:
Expand All @@ -121,6 +176,7 @@ def operations(self):
* 2018-02-14: :class:`Operations<azure.mgmt.keyvault.v2018_02_14.operations.Operations>`
* 2019-09-01: :class:`Operations<azure.mgmt.keyvault.v2019_09_01.operations.Operations>`
* 2020-04-01-preview: :class:`Operations<azure.mgmt.keyvault.v2020_04_01_preview.operations.Operations>`
* 2021-04-01-preview: :class:`Operations<azure.mgmt.keyvault.v2021_04_01_preview.operations.Operations>`
"""
api_version = self._get_api_version('operations')
if api_version == '2016-10-01':
Expand All @@ -131,6 +187,8 @@ def operations(self):
from .v2019_09_01.operations import Operations as OperationClass
elif api_version == '2020-04-01-preview':
from .v2020_04_01_preview.operations import Operations as OperationClass
elif api_version == '2021-04-01-preview':
from .v2021_04_01_preview.operations import Operations as OperationClass
else:
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)))
Expand All @@ -142,6 +200,7 @@ def private_endpoint_connections(self):
* 2018-02-14: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.keyvault.v2018_02_14.operations.PrivateEndpointConnectionsOperations>`
* 2019-09-01: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.keyvault.v2019_09_01.operations.PrivateEndpointConnectionsOperations>`
* 2020-04-01-preview: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.keyvault.v2020_04_01_preview.operations.PrivateEndpointConnectionsOperations>`
* 2021-04-01-preview: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.keyvault.v2021_04_01_preview.operations.PrivateEndpointConnectionsOperations>`
"""
api_version = self._get_api_version('private_endpoint_connections')
if api_version == '2018-02-14':
Expand All @@ -150,6 +209,8 @@ def private_endpoint_connections(self):
from .v2019_09_01.operations import PrivateEndpointConnectionsOperations as OperationClass
elif api_version == '2020-04-01-preview':
from .v2020_04_01_preview.operations import PrivateEndpointConnectionsOperations as OperationClass
elif api_version == '2021-04-01-preview':
from .v2021_04_01_preview.operations import PrivateEndpointConnectionsOperations as OperationClass
else:
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)))
Expand All @@ -161,6 +222,7 @@ def private_link_resources(self):
* 2018-02-14: :class:`PrivateLinkResourcesOperations<azure.mgmt.keyvault.v2018_02_14.operations.PrivateLinkResourcesOperations>`
* 2019-09-01: :class:`PrivateLinkResourcesOperations<azure.mgmt.keyvault.v2019_09_01.operations.PrivateLinkResourcesOperations>`
* 2020-04-01-preview: :class:`PrivateLinkResourcesOperations<azure.mgmt.keyvault.v2020_04_01_preview.operations.PrivateLinkResourcesOperations>`
* 2021-04-01-preview: :class:`PrivateLinkResourcesOperations<azure.mgmt.keyvault.v2021_04_01_preview.operations.PrivateLinkResourcesOperations>`
"""
api_version = self._get_api_version('private_link_resources')
if api_version == '2018-02-14':
Expand All @@ -169,10 +231,25 @@ def private_link_resources(self):
from .v2019_09_01.operations import PrivateLinkResourcesOperations as OperationClass
elif api_version == '2020-04-01-preview':
from .v2020_04_01_preview.operations import PrivateLinkResourcesOperations as OperationClass
elif api_version == '2021-04-01-preview':
from .v2021_04_01_preview.operations import PrivateLinkResourcesOperations as OperationClass
else:
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 secrets(self):
"""Instance depends on the API version:
* 2021-04-01-preview: :class:`SecretsOperations<azure.mgmt.keyvault.v2021_04_01_preview.operations.SecretsOperations>`
"""
api_version = self._get_api_version('secrets')
if api_version == '2021-04-01-preview':
from .v2021_04_01_preview.operations import SecretsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'secrets'".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:
Expand All @@ -181,6 +258,7 @@ def vaults(self):
* 2018-02-14: :class:`VaultsOperations<azure.mgmt.keyvault.v2018_02_14.operations.VaultsOperations>`
* 2019-09-01: :class:`VaultsOperations<azure.mgmt.keyvault.v2019_09_01.operations.VaultsOperations>`
* 2020-04-01-preview: :class:`VaultsOperations<azure.mgmt.keyvault.v2020_04_01_preview.operations.VaultsOperations>`
* 2021-04-01-preview: :class:`VaultsOperations<azure.mgmt.keyvault.v2021_04_01_preview.operations.VaultsOperations>`
"""
api_version = self._get_api_version('vaults')
if api_version == '2016-10-01':
Expand All @@ -191,6 +269,8 @@ def vaults(self):
from .v2019_09_01.operations import VaultsOperations as OperationClass
elif api_version == '2020-04-01-preview':
from .v2020_04_01_preview.operations import VaultsOperations as OperationClass
elif api_version == '2021-04-01-preview':
from .v2021_04_01_preview.operations import VaultsOperations as OperationClass
else:
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)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from typing import Any
from typing import Any, TYPE_CHECKING

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

from .._version import VERSION

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential

class KeyVaultManagementClientConfiguration(Configuration):
"""Configuration for KeyVaultManagementClient.
Expand All @@ -31,8 +34,8 @@ class KeyVaultManagementClientConfiguration(Configuration):

def __init__(
self,
credential, # type: "AsyncTokenCredential"
subscription_id, # type: str
credential: "AsyncTokenCredential",
subscription_id: str,
**kwargs # type: Any
) -> None:
if credential is None:
Expand Down

0 comments on commit 63c263f

Please sign in to comment.