Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified azure-mgmt-keyvault/azure/mgmt/keyvault/__init__.py
100755 → 100644
Empty file.
21 changes: 12 additions & 9 deletions azure-mgmt-keyvault/azure/mgmt/keyvault/key_vault_management_client.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from msrestazure import AzureConfiguration
from .version import VERSION
from .operations.vaults_operations import VaultsOperations
from .operations.operations import Operations
from . import models


Expand All @@ -25,9 +26,9 @@ class KeyVaultManagementClientConfiguration(AzureConfiguration):
: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: Gets subscription credentials which uniquely
identify Microsoft Azure subscription. The subscription ID forms part of
the URI for every service call.
: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
"""
Expand All @@ -39,14 +40,12 @@ def __init__(
raise ValueError("Parameter 'credentials' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
if not isinstance(subscription_id, str):
raise TypeError("Parameter 'subscription_id' must be str.")
if not base_url:
base_url = 'https://management.azure.com'

super(KeyVaultManagementClientConfiguration, self).__init__(base_url)

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

self.credentials = credentials
Expand All @@ -61,13 +60,15 @@ class KeyVaultManagementClient(object):

:ivar vaults: Vaults operations
:vartype vaults: azure.mgmt.keyvault.operations.VaultsOperations
:ivar operations: Operations operations
:vartype operations: azure.mgmt.keyvault.operations.Operations

: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: Gets subscription credentials which uniquely
identify Microsoft Azure subscription. The subscription ID forms part of
the URI for every service call.
: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
"""
Expand All @@ -85,3 +86,5 @@ def __init__(

self.vaults = VaultsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.operations = Operations(
self._client, self.config, self._serialize, self._deserialize)
65 changes: 56 additions & 9 deletions azure-mgmt-keyvault/azure/mgmt/keyvault/models/__init__.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -9,44 +9,91 @@
# regenerated.
# --------------------------------------------------------------------------

from .sku import Sku
from .permissions import Permissions
from .access_policy_entry import AccessPolicyEntry
from .vault_properties import VaultProperties
from .deleted_vault_properties import DeletedVaultProperties
from .vault_create_or_update_parameters import VaultCreateOrUpdateParameters
from .vault import Vault
from .deleted_vault import DeletedVault
from .resource import Resource
try:
from .sku_py3 import Sku
from .permissions_py3 import Permissions
from .access_policy_entry_py3 import AccessPolicyEntry
from .vault_properties_py3 import VaultProperties
from .vault_patch_properties_py3 import VaultPatchProperties
from .vault_access_policy_properties_py3 import VaultAccessPolicyProperties
from .deleted_vault_properties_py3 import DeletedVaultProperties
from .vault_create_or_update_parameters_py3 import VaultCreateOrUpdateParameters
from .vault_patch_parameters_py3 import VaultPatchParameters
from .vault_access_policy_parameters_py3 import VaultAccessPolicyParameters
from .vault_py3 import Vault
from .deleted_vault_py3 import DeletedVault
from .resource_py3 import Resource
from .vault_check_name_availability_parameters_py3 import VaultCheckNameAvailabilityParameters
from .check_name_availability_result_py3 import CheckNameAvailabilityResult
from .operation_display_py3 import OperationDisplay
from .log_specification_py3 import LogSpecification
from .service_specification_py3 import ServiceSpecification
from .operation_py3 import Operation
except (SyntaxError, ImportError):
from .sku import Sku
from .permissions import Permissions
from .access_policy_entry import AccessPolicyEntry
from .vault_properties import VaultProperties
from .vault_patch_properties import VaultPatchProperties
from .vault_access_policy_properties import VaultAccessPolicyProperties
from .deleted_vault_properties import DeletedVaultProperties
from .vault_create_or_update_parameters import VaultCreateOrUpdateParameters
from .vault_patch_parameters import VaultPatchParameters
from .vault_access_policy_parameters import VaultAccessPolicyParameters
from .vault import Vault
from .deleted_vault import DeletedVault
from .resource import Resource
from .vault_check_name_availability_parameters import VaultCheckNameAvailabilityParameters
from .check_name_availability_result import CheckNameAvailabilityResult
from .operation_display import OperationDisplay
from .log_specification import LogSpecification
from .service_specification import ServiceSpecification
from .operation import Operation
from .vault_paged import VaultPaged
from .deleted_vault_paged import DeletedVaultPaged
from .resource_paged import ResourcePaged
from .operation_paged import OperationPaged
from .key_vault_management_client_enums import (
SkuName,
KeyPermissions,
SecretPermissions,
CertificatePermissions,
StoragePermissions,
CreateMode,
Reason,
AccessPolicyUpdateKind,
)

__all__ = [
'Sku',
'Permissions',
'AccessPolicyEntry',
'VaultProperties',
'VaultPatchProperties',
'VaultAccessPolicyProperties',
'DeletedVaultProperties',
'VaultCreateOrUpdateParameters',
'VaultPatchParameters',
'VaultAccessPolicyParameters',
'Vault',
'DeletedVault',
'Resource',
'VaultCheckNameAvailabilityParameters',
'CheckNameAvailabilityResult',
'OperationDisplay',
'LogSpecification',
'ServiceSpecification',
'Operation',
'VaultPaged',
'DeletedVaultPaged',
'ResourcePaged',
'OperationPaged',
'SkuName',
'KeyPermissions',
'SecretPermissions',
'CertificatePermissions',
'StoragePermissions',
'CreateMode',
'Reason',
'AccessPolicyUpdateKind',
]
30 changes: 16 additions & 14 deletions azure-mgmt-keyvault/azure/mgmt/keyvault/models/access_policy_entry.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,21 @@ class AccessPolicyEntry(Model):
"""An identity 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 tenant_id: The Azure Active Directory tenant ID that should be used
for authenticating requests to the key vault.
All required parameters must be populated in order to send to Azure.

:param tenant_id: Required. The Azure Active Directory tenant ID that
should be used for authenticating requests to the key vault.
:type tenant_id: str
:param object_id: The object ID of a user, service principal or security
group in the Azure Active Directory tenant for the vault. The object ID
must be unique for the list of access policies.
:param object_id: Required. The object ID of a user, service principal or
security group in the Azure Active Directory tenant for the vault. The
object ID must be unique for the list of access policies.
:type object_id: str
:param application_id: Application ID of the client making request on
behalf of a principal
:type application_id: str
:param permissions: Permissions the identity has for keys, secrets and
certificates.
:type permissions: :class:`Permissions
<azure.mgmt.keyvault.models.Permissions>`
:param permissions: Required. Permissions the identity has for keys,
secrets and certificates.
:type permissions: ~azure.mgmt.keyvault.models.Permissions
"""

_validation = {
Expand All @@ -45,8 +46,9 @@ class AccessPolicyEntry(Model):
'permissions': {'key': 'permissions', 'type': 'Permissions'},
}

def __init__(self, tenant_id, object_id, permissions, application_id=None):
self.tenant_id = tenant_id
self.object_id = object_id
self.application_id = application_id
self.permissions = permissions
def __init__(self, **kwargs):
super(AccessPolicyEntry, self).__init__(**kwargs)
self.tenant_id = kwargs.get('tenant_id', None)
self.object_id = kwargs.get('object_id', None)
self.application_id = kwargs.get('application_id', None)
self.permissions = kwargs.get('permissions', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# 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.serialization import Model


class AccessPolicyEntry(Model):
"""An identity 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.

All required parameters must be populated in order to send to Azure.

:param tenant_id: Required. The Azure Active Directory tenant ID that
should be used for authenticating requests to the key vault.
:type tenant_id: str
:param object_id: Required. The object ID of a user, service principal or
security group in the Azure Active Directory tenant for the vault. The
object ID must be unique for the list of access policies.
:type object_id: str
:param application_id: Application ID of the client making request on
behalf of a principal
:type application_id: str
:param permissions: Required. Permissions the identity has for keys,
secrets and certificates.
:type permissions: ~azure.mgmt.keyvault.models.Permissions
"""

_validation = {
'tenant_id': {'required': True},
'object_id': {'required': True},
'permissions': {'required': True},
}

_attribute_map = {
'tenant_id': {'key': 'tenantId', 'type': 'str'},
'object_id': {'key': 'objectId', 'type': 'str'},
'application_id': {'key': 'applicationId', 'type': 'str'},
'permissions': {'key': 'permissions', 'type': 'Permissions'},
}

def __init__(self, *, tenant_id: str, object_id: str, permissions, application_id: str=None, **kwargs) -> None:
super(AccessPolicyEntry, self).__init__(**kwargs)
self.tenant_id = tenant_id
self.object_id = object_id
self.application_id = application_id
self.permissions = permissions
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 msrest.serialization import Model


class CheckNameAvailabilityResult(Model):
"""The CheckNameAvailability operation response.

Variables are only populated by the server, and will be ignored when
sending a request.

:ivar name_available: A boolean value that indicates whether the name is
available for you to use. If true, the name is available. If false, the
name has already been taken or is invalid and cannot be used.
:vartype name_available: bool
:ivar reason: The reason that a vault name could not be used. The Reason
element is only returned if NameAvailable is false. Possible values
include: 'AccountNameInvalid', 'AlreadyExists'
:vartype reason: str or ~azure.mgmt.keyvault.models.Reason
:ivar message: An error message explaining the Reason value in more
detail.
:vartype message: str
"""

_validation = {
'name_available': {'readonly': True},
'reason': {'readonly': True},
'message': {'readonly': True},
}

_attribute_map = {
'name_available': {'key': 'nameAvailable', 'type': 'bool'},
'reason': {'key': 'reason', 'type': 'Reason'},
'message': {'key': 'message', 'type': 'str'},
}

def __init__(self, **kwargs):
super(CheckNameAvailabilityResult, self).__init__(**kwargs)
self.name_available = None
self.reason = None
self.message = None
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 msrest.serialization import Model


class CheckNameAvailabilityResult(Model):
"""The CheckNameAvailability operation response.

Variables are only populated by the server, and will be ignored when
sending a request.

:ivar name_available: A boolean value that indicates whether the name is
available for you to use. If true, the name is available. If false, the
name has already been taken or is invalid and cannot be used.
:vartype name_available: bool
:ivar reason: The reason that a vault name could not be used. The Reason
element is only returned if NameAvailable is false. Possible values
include: 'AccountNameInvalid', 'AlreadyExists'
:vartype reason: str or ~azure.mgmt.keyvault.models.Reason
:ivar message: An error message explaining the Reason value in more
detail.
:vartype message: str
"""

_validation = {
'name_available': {'readonly': True},
'reason': {'readonly': True},
'message': {'readonly': True},
}

_attribute_map = {
'name_available': {'key': 'nameAvailable', 'type': 'bool'},
'reason': {'key': 'reason', 'type': 'Reason'},
'message': {'key': 'message', 'type': 'str'},
}

def __init__(self, **kwargs) -> None:
super(CheckNameAvailabilityResult, self).__init__(**kwargs)
self.name_available = None
self.reason = None
self.message = None
8 changes: 4 additions & 4 deletions azure-mgmt-keyvault/azure/mgmt/keyvault/models/deleted_vault.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ class DeletedVault(Model):
:ivar type: The resource type of the key vault.
:vartype type: str
:param properties: Properties of the vault
:type properties: :class:`DeletedVaultProperties
<azure.mgmt.keyvault.models.DeletedVaultProperties>`
:type properties: ~azure.mgmt.keyvault.models.DeletedVaultProperties
"""

_validation = {
Expand All @@ -42,8 +41,9 @@ class DeletedVault(Model):
'properties': {'key': 'properties', 'type': 'DeletedVaultProperties'},
}

def __init__(self, properties=None):
def __init__(self, **kwargs):
super(DeletedVault, self).__init__(**kwargs)
self.id = None
self.name = None
self.type = None
self.properties = properties
self.properties = kwargs.get('properties', None)
2 changes: 1 addition & 1 deletion azure-mgmt-keyvault/azure/mgmt/keyvault/models/deleted_vault_paged.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

class DeletedVaultPaged(Paged):
"""
A paging container for iterating over a list of DeletedVault object
A paging container for iterating over a list of :class:`DeletedVault <azure.mgmt.keyvault.models.DeletedVault>` object
"""

_attribute_map = {
Expand Down
Loading