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

[AutoPR azure-mgmt-keyvault] Generate go sdk for keyvault - package-preview-2020-04 #2414

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sdk/keyvault/azure-mgmt-keyvault/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ For a more complete view of Azure libraries, see the [azure sdk python release](

# Usage

For code examples, see [Key Vault Management](https://docs.microsoft.com/python/api/overview/azure/?view=azure-python-preview)
For code examples, see [Key Vault Management](https://docs.microsoft.com/python/api/overview/azure/key-vault)
on docs.microsoft.com.


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def models(cls, api_version=DEFAULT_API_VERSION):
* 2016-10-01: :mod:`v2016_10_01.models<azure.mgmt.keyvault.v2016_10_01.models>`
* 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>`
"""
if api_version == '2016-10-01':
from .v2016_10_01 import models
Expand All @@ -85,15 +86,32 @@ def models(cls, api_version=DEFAULT_API_VERSION):
elif api_version == '2019-09-01':
from .v2019_09_01 import models
return models
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))

@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>`
"""
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
else:
raise NotImplementedError("APIVersion {} is not available".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.operations.Operations>`
* 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>`
"""
api_version = self._get_api_version('operations')
if api_version == '2016-10-01':
Expand All @@ -102,6 +120,8 @@ def operations(self):
from .v2018_02_14.operations import Operations as OperationClass
elif api_version == '2019-09-01':
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
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand All @@ -112,12 +132,15 @@ 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>`
"""
api_version = self._get_api_version('private_endpoint_connections')
if api_version == '2018-02-14':
from .v2018_02_14.operations import PrivateEndpointConnectionsOperations as OperationClass
elif api_version == '2019-09-01':
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
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand All @@ -128,12 +151,15 @@ 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>`
"""
api_version = self._get_api_version('private_link_resources')
if api_version == '2018-02-14':
from .v2018_02_14.operations import PrivateLinkResourcesOperations as OperationClass
elif api_version == '2019-09-01':
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
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand All @@ -145,6 +171,7 @@ def vaults(self):
* 2016-10-01: :class:`VaultsOperations<azure.mgmt.keyvault.v2016_10_01.operations.VaultsOperations>`
* 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>`
"""
api_version = self._get_api_version('vaults')
if api_version == '2016-10-01':
Expand All @@ -153,6 +180,8 @@ def vaults(self):
from .v2018_02_14.operations import VaultsOperations as OperationClass
elif api_version == '2019-09-01':
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
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Original file line number Diff line number Diff line change
Expand Up @@ -911,9 +911,9 @@ class VaultPatchProperties(Model):
:type tenant_id: str
:param sku: SKU details
:type sku: ~azure.mgmt.keyvault.v2018_02_14.models.Sku
:param access_policies: An array of 0 to 16 identities that have access to
the key vault. All identities in the array must use the same tenant ID as
the key vault's tenant ID.
:param access_policies: An array of 0 to 1024 identities that have access
to the key vault. All identities in the array must use the same tenant ID
as the key vault's tenant ID.
:type access_policies:
list[~azure.mgmt.keyvault.v2018_02_14.models.AccessPolicyEntry]
:param enabled_for_deployment: Property to specify whether Azure Virtual
Expand Down Expand Up @@ -988,10 +988,10 @@ class VaultProperties(Model):
:type tenant_id: str
:param sku: Required. SKU details
:type sku: ~azure.mgmt.keyvault.v2018_02_14.models.Sku
:param access_policies: An array of 0 to 16 identities that have access to
the key vault. All identities in the array must use the same tenant ID as
the key vault's tenant ID. When `createMode` is set to `recover`, access
policies are not required. Otherwise, access policies are required.
:param access_policies: An array of 0 to 1024 identities that have access
to the key vault. All identities in the array must use the same tenant ID
as the key vault's tenant ID. When `createMode` is set to `recover`,
access policies are not required. Otherwise, access policies are required.
:type access_policies:
list[~azure.mgmt.keyvault.v2018_02_14.models.AccessPolicyEntry]
:param vault_uri: The URI of the vault for performing operations on keys
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -911,9 +911,9 @@ class VaultPatchProperties(Model):
:type tenant_id: str
:param sku: SKU details
:type sku: ~azure.mgmt.keyvault.v2018_02_14.models.Sku
:param access_policies: An array of 0 to 16 identities that have access to
the key vault. All identities in the array must use the same tenant ID as
the key vault's tenant ID.
:param access_policies: An array of 0 to 1024 identities that have access
to the key vault. All identities in the array must use the same tenant ID
as the key vault's tenant ID.
:type access_policies:
list[~azure.mgmt.keyvault.v2018_02_14.models.AccessPolicyEntry]
:param enabled_for_deployment: Property to specify whether Azure Virtual
Expand Down Expand Up @@ -988,10 +988,10 @@ class VaultProperties(Model):
:type tenant_id: str
:param sku: Required. SKU details
:type sku: ~azure.mgmt.keyvault.v2018_02_14.models.Sku
:param access_policies: An array of 0 to 16 identities that have access to
the key vault. All identities in the array must use the same tenant ID as
the key vault's tenant ID. When `createMode` is set to `recover`, access
policies are not required. Otherwise, access policies are required.
:param access_policies: An array of 0 to 1024 identities that have access
to the key vault. All identities in the array must use the same tenant ID
as the key vault's tenant ID. When `createMode` is set to `recover`,
access policies are not required. Otherwise, access policies are required.
:type access_policies:
list[~azure.mgmt.keyvault.v2018_02_14.models.AccessPolicyEntry]
:param vault_uri: The URI of the vault for performing operations on keys
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class SkuName(str, Enum):

class KeyPermissions(str, Enum):

all = "all"
encrypt = "encrypt"
decrypt = "decrypt"
wrap_key = "wrapKey"
Expand All @@ -40,6 +41,7 @@ class KeyPermissions(str, Enum):

class SecretPermissions(str, Enum):

all = "all"
get = "get"
list = "list"
set = "set"
Expand All @@ -52,6 +54,7 @@ class SecretPermissions(str, Enum):

class CertificatePermissions(str, Enum):

all = "all"
get = "get"
list = "list"
delete = "delete"
Expand All @@ -72,6 +75,7 @@ class CertificatePermissions(str, Enum):

class StoragePermissions(str, Enum):

all = "all"
get = "get"
list = "list"
delete = "delete"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1004,10 +1004,10 @@ class VaultProperties(Model):
:type tenant_id: str
:param sku: Required. SKU details
:type sku: ~azure.mgmt.keyvault.v2019_09_01.models.Sku
:param access_policies: An array of 0 to 16 identities that have access to
the key vault. All identities in the array must use the same tenant ID as
the key vault's tenant ID. When `createMode` is set to `recover`, access
policies are not required. Otherwise, access policies are required.
:param access_policies: An array of 0 to 1024 identities that have access
to the key vault. All identities in the array must use the same tenant ID
as the key vault's tenant ID. When `createMode` is set to `recover`,
access policies are not required. Otherwise, access policies are required.
:type access_policies:
list[~azure.mgmt.keyvault.v2019_09_01.models.AccessPolicyEntry]
:param vault_uri: The URI of the vault for performing operations on keys
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1004,10 +1004,10 @@ class VaultProperties(Model):
:type tenant_id: str
:param sku: Required. SKU details
:type sku: ~azure.mgmt.keyvault.v2019_09_01.models.Sku
:param access_policies: An array of 0 to 16 identities that have access to
the key vault. All identities in the array must use the same tenant ID as
the key vault's tenant ID. When `createMode` is set to `recover`, access
policies are not required. Otherwise, access policies are required.
:param access_policies: An array of 0 to 1024 identities that have access
to the key vault. All identities in the array must use the same tenant ID
as the key vault's tenant ID. When `createMode` is set to `recover`,
access policies are not required. Otherwise, access policies are required.
:type access_policies:
list[~azure.mgmt.keyvault.v2019_09_01.models.AccessPolicyEntry]
:param vault_uri: The URI of the vault for performing operations on keys
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from ._configuration import KeyVaultManagementClientConfiguration
from ._key_vault_management_client import KeyVaultManagementClient
__all__ = ['KeyVaultManagementClient', 'KeyVaultManagementClientConfiguration']

from .version import VERSION

__version__ = VERSION

Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrestazure import AzureConfiguration

from .version import VERSION


class KeyVaultManagementClientConfiguration(AzureConfiguration):
"""Configuration for KeyVaultManagementClient
Note that all parameters used to create this instance are saved as instance
attributes.

:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
: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 base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, base_url=None):

if credentials is None:
raise ValueError("Parameter 'credentials' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
if not base_url:
base_url = 'https://management.azure.com'

super(KeyVaultManagementClientConfiguration, self).__init__(base_url)

# Starting Autorest.Python 4.0.64, make connection pool activated by default
self.keep_alive = True

self.add_user_agent('azure-mgmt-keyvault/{}'.format(VERSION))
self.add_user_agent('Azure-SDK-For-Python')

self.credentials = credentials
self.subscription_id = subscription_id
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.service_client import SDKClient
from msrest import Serializer, Deserializer

from ._configuration import KeyVaultManagementClientConfiguration
from .operations import VaultsOperations
from .operations import PrivateEndpointConnectionsOperations
from .operations import PrivateLinkResourcesOperations
from .operations import Operations
from .operations import ManagedHsmsOperations
from . import models


class KeyVaultManagementClient(SDKClient):
"""The Azure management API provides a RESTful set of web services that interact with Azure Key Vault.

:ivar config: Configuration for client.
:vartype config: KeyVaultManagementClientConfiguration

:ivar vaults: Vaults operations
:vartype vaults: azure.mgmt.keyvault.v2020_04_01_preview.operations.VaultsOperations
:ivar private_endpoint_connections: PrivateEndpointConnections operations
:vartype private_endpoint_connections: azure.mgmt.keyvault.v2020_04_01_preview.operations.PrivateEndpointConnectionsOperations
:ivar private_link_resources: PrivateLinkResources operations
:vartype private_link_resources: azure.mgmt.keyvault.v2020_04_01_preview.operations.PrivateLinkResourcesOperations
:ivar operations: Operations operations
:vartype operations: azure.mgmt.keyvault.v2020_04_01_preview.operations.Operations
:ivar managed_hsms: ManagedHsms operations
:vartype managed_hsms: azure.mgmt.keyvault.v2020_04_01_preview.operations.ManagedHsmsOperations

:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
: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 base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, base_url=None):

self.config = KeyVaultManagementClientConfiguration(credentials, subscription_id, base_url)
super(KeyVaultManagementClient, self).__init__(self.config.credentials, self.config)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

self.vaults = VaultsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.private_endpoint_connections = PrivateEndpointConnectionsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.private_link_resources = PrivateLinkResourcesOperations(
self._client, self.config, self._serialize, self._deserialize)
self.operations = Operations(
self._client, self.config, self._serialize, self._deserialize)
self.managed_hsms = ManagedHsmsOperations(
self._client, self.config, self._serialize, self._deserialize)
Loading