diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/__init__.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/__init__.py index 58dac299a951..e561ff7983d0 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/__init__.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/__init__.py @@ -9,28 +9,52 @@ # regenerated. # -------------------------------------------------------------------------- -from .sku import Sku -from .permissions import Permissions -from .access_policy_entry import AccessPolicyEntry -from .ip_rule import IPRule -from .virtual_network_rule import VirtualNetworkRule -from .network_rule_set import NetworkRuleSet -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 +try: + from .sku_py3 import Sku + from .permissions_py3 import Permissions + from .access_policy_entry_py3 import AccessPolicyEntry + from .ip_rule_py3 import IPRule + from .virtual_network_rule_py3 import VirtualNetworkRule + from .network_rule_set_py3 import NetworkRuleSet + 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 .ip_rule import IPRule + from .virtual_network_rule import VirtualNetworkRule + from .network_rule_set import NetworkRuleSet + 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 diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/access_policy_entry.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/access_policy_entry.py index 2b4ccd6fb4cb..532fd4ad3cc4 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/access_policy_entry.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/access_policy_entry.py @@ -16,18 +16,20 @@ 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. + :param permissions: Required. Permissions the identity has for keys, + secrets and certificates. :type permissions: ~azure.mgmt.keyvault.models.Permissions """ @@ -44,9 +46,9 @@ class AccessPolicyEntry(Model): 'permissions': {'key': 'permissions', 'type': 'Permissions'}, } - def __init__(self, tenant_id, object_id, permissions, application_id=None): - super(AccessPolicyEntry, self).__init__() - 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) diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/access_policy_entry_py3.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/access_policy_entry_py3.py new file mode 100644 index 000000000000..1862c8f5e881 --- /dev/null +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/access_policy_entry_py3.py @@ -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 diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/check_name_availability_result.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/check_name_availability_result.py index 6e8d8b5a2a9b..eb924fe2ecd6 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/check_name_availability_result.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/check_name_availability_result.py @@ -43,8 +43,8 @@ class CheckNameAvailabilityResult(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self): - super(CheckNameAvailabilityResult, self).__init__() + def __init__(self, **kwargs): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) self.name_available = None self.reason = None self.message = None diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/check_name_availability_result_py3.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/check_name_availability_result_py3.py new file mode 100644 index 000000000000..cd818840e171 --- /dev/null +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/check_name_availability_result_py3.py @@ -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 diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/deleted_vault.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/deleted_vault.py index 7b49d29ed836..fde8fff07353 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/deleted_vault.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/deleted_vault.py @@ -41,9 +41,9 @@ class DeletedVault(Model): 'properties': {'key': 'properties', 'type': 'DeletedVaultProperties'}, } - def __init__(self, properties=None): - super(DeletedVault, self).__init__() + 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) diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/deleted_vault_properties.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/deleted_vault_properties.py index 3247a439d946..76fa9d43de1f 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/deleted_vault_properties.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/deleted_vault_properties.py @@ -46,8 +46,8 @@ class DeletedVaultProperties(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self): - super(DeletedVaultProperties, self).__init__() + def __init__(self, **kwargs): + super(DeletedVaultProperties, self).__init__(**kwargs) self.vault_id = None self.location = None self.deletion_date = None diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/deleted_vault_properties_py3.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/deleted_vault_properties_py3.py new file mode 100644 index 000000000000..c78663f989b5 --- /dev/null +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/deleted_vault_properties_py3.py @@ -0,0 +1,55 @@ +# 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 DeletedVaultProperties(Model): + """Properties of the deleted vault. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar vault_id: The resource id of the original vault. + :vartype vault_id: str + :ivar location: The location of the original vault. + :vartype location: str + :ivar deletion_date: The deleted date. + :vartype deletion_date: datetime + :ivar scheduled_purge_date: The scheduled purged date. + :vartype scheduled_purge_date: datetime + :ivar tags: Tags of the original vault. + :vartype tags: dict[str, str] + """ + + _validation = { + 'vault_id': {'readonly': True}, + 'location': {'readonly': True}, + 'deletion_date': {'readonly': True}, + 'scheduled_purge_date': {'readonly': True}, + 'tags': {'readonly': True}, + } + + _attribute_map = { + 'vault_id': {'key': 'vaultId', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'deletion_date': {'key': 'deletionDate', 'type': 'iso-8601'}, + 'scheduled_purge_date': {'key': 'scheduledPurgeDate', 'type': 'iso-8601'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs) -> None: + super(DeletedVaultProperties, self).__init__(**kwargs) + self.vault_id = None + self.location = None + self.deletion_date = None + self.scheduled_purge_date = None + self.tags = None diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/deleted_vault_py3.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/deleted_vault_py3.py new file mode 100644 index 000000000000..5ef53e97840f --- /dev/null +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/deleted_vault_py3.py @@ -0,0 +1,49 @@ +# 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 DeletedVault(Model): + """Deleted vault information with extended details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The resource ID for the deleted key vault. + :vartype id: str + :ivar name: The name of the key vault. + :vartype name: str + :ivar type: The resource type of the key vault. + :vartype type: str + :param properties: Properties of the vault + :type properties: ~azure.mgmt.keyvault.models.DeletedVaultProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DeletedVaultProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(DeletedVault, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.properties = properties diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/ip_rule.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/ip_rule.py index 4e8dd1fdfc34..8dc2808dd197 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/ip_rule.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/ip_rule.py @@ -16,7 +16,9 @@ class IPRule(Model): """A rule governing the accesibility of a vault from a specific ip address or ip range. - :param value: An IPv4 address range in CIDR notation, such as + All required parameters must be populated in order to send to Azure. + + :param value: Required. An IPv4 address range in CIDR notation, such as '124.56.78.91' (simple IP address) or '124.56.78.0/24' (all addresses that start with 124.56.78). :type value: str @@ -30,6 +32,6 @@ class IPRule(Model): 'value': {'key': 'value', 'type': 'str'}, } - def __init__(self, value): - super(IPRule, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(IPRule, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/ip_rule_py3.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/ip_rule_py3.py new file mode 100644 index 000000000000..e0656699eb1e --- /dev/null +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/ip_rule_py3.py @@ -0,0 +1,37 @@ +# 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 IPRule(Model): + """A rule governing the accesibility of a vault from a specific ip address or + ip range. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. An IPv4 address range in CIDR notation, such as + '124.56.78.91' (simple IP address) or '124.56.78.0/24' (all addresses that + start with 124.56.78). + :type value: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, value: str, **kwargs) -> None: + super(IPRule, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/key_vault_management_client_enums.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/key_vault_management_client_enums.py index 871b034f2215..e31e5b8e5c8f 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/key_vault_management_client_enums.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/key_vault_management_client_enums.py @@ -12,13 +12,13 @@ from enum import Enum -class SkuName(Enum): +class SkuName(str, Enum): standard = "standard" premium = "premium" -class KeyPermissions(Enum): +class KeyPermissions(str, Enum): encrypt = "encrypt" decrypt = "decrypt" @@ -38,7 +38,7 @@ class KeyPermissions(Enum): purge = "purge" -class SecretPermissions(Enum): +class SecretPermissions(str, Enum): get = "get" list = "list" @@ -50,7 +50,7 @@ class SecretPermissions(Enum): purge = "purge" -class CertificatePermissions(Enum): +class CertificatePermissions(str, Enum): get = "get" list = "list" @@ -66,9 +66,11 @@ class CertificatePermissions(Enum): manageissuers = "manageissuers" recover = "recover" purge = "purge" + backup = "backup" + restore = "restore" -class StoragePermissions(Enum): +class StoragePermissions(str, Enum): get = "get" list = "list" @@ -86,31 +88,31 @@ class StoragePermissions(Enum): deletesas = "deletesas" -class CreateMode(Enum): +class CreateMode(str, Enum): recover = "recover" default = "default" -class NetworkRuleBypassOptions(Enum): +class NetworkRuleBypassOptions(str, Enum): azure_services = "AzureServices" none = "None" -class NetworkRuleAction(Enum): +class NetworkRuleAction(str, Enum): allow = "Allow" deny = "Deny" -class Reason(Enum): +class Reason(str, Enum): account_name_invalid = "AccountNameInvalid" already_exists = "AlreadyExists" -class AccessPolicyUpdateKind(Enum): +class AccessPolicyUpdateKind(str, Enum): add = "add" replace = "replace" diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/log_specification.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/log_specification.py index 1c4e46d69fbd..092f8d7039b9 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/log_specification.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/log_specification.py @@ -29,8 +29,8 @@ class LogSpecification(Model): 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, } - def __init__(self, name=None, display_name=None, blob_duration=None): - super(LogSpecification, self).__init__() - self.name = name - self.display_name = display_name - self.blob_duration = blob_duration + def __init__(self, **kwargs): + super(LogSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.blob_duration = kwargs.get('blob_duration', None) diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/log_specification_py3.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/log_specification_py3.py new file mode 100644 index 000000000000..091c8250d3f2 --- /dev/null +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/log_specification_py3.py @@ -0,0 +1,36 @@ +# 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 LogSpecification(Model): + """Log specification of operation. + + :param name: Name of log specification. + :type name: str + :param display_name: Display name of log specification. + :type display_name: str + :param blob_duration: Blob duration of specification. + :type blob_duration: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, blob_duration: str=None, **kwargs) -> None: + super(LogSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.blob_duration = blob_duration diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/network_rule_set.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/network_rule_set.py index ff6a68c37bc0..59ccba80617a 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/network_rule_set.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/network_rule_set.py @@ -37,9 +37,9 @@ class NetworkRuleSet(Model): 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, } - def __init__(self, bypass=None, default_action=None, ip_rules=None, virtual_network_rules=None): - super(NetworkRuleSet, self).__init__() - self.bypass = bypass - self.default_action = default_action - self.ip_rules = ip_rules - self.virtual_network_rules = virtual_network_rules + def __init__(self, **kwargs): + super(NetworkRuleSet, self).__init__(**kwargs) + self.bypass = kwargs.get('bypass', None) + self.default_action = kwargs.get('default_action', None) + self.ip_rules = kwargs.get('ip_rules', None) + self.virtual_network_rules = kwargs.get('virtual_network_rules', None) diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/network_rule_set_py3.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/network_rule_set_py3.py new file mode 100644 index 000000000000..ae74ff44fa86 --- /dev/null +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/network_rule_set_py3.py @@ -0,0 +1,45 @@ +# 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 NetworkRuleSet(Model): + """A set of rules governing the network accessibility of a vault. + + :param bypass: Tells what traffic can bypass network rules. This can be + 'AzureServices' or 'None'. If not specified the default is + 'AzureServices'. Possible values include: 'AzureServices', 'None' + :type bypass: str or ~azure.mgmt.keyvault.models.NetworkRuleBypassOptions + :param default_action: The default action when no rule from ipRules and + from virtualNetworkRules match. This is only used after the bypass + property has been evaluated. Possible values include: 'Allow', 'Deny' + :type default_action: str or ~azure.mgmt.keyvault.models.NetworkRuleAction + :param ip_rules: The list of IP address rules. + :type ip_rules: list[~azure.mgmt.keyvault.models.IPRule] + :param virtual_network_rules: The list of virtual network rules. + :type virtual_network_rules: + list[~azure.mgmt.keyvault.models.VirtualNetworkRule] + """ + + _attribute_map = { + 'bypass': {'key': 'bypass', 'type': 'str'}, + 'default_action': {'key': 'defaultAction', 'type': 'str'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + } + + def __init__(self, *, bypass=None, default_action=None, ip_rules=None, virtual_network_rules=None, **kwargs) -> None: + super(NetworkRuleSet, self).__init__(**kwargs) + self.bypass = bypass + self.default_action = default_action + self.ip_rules = ip_rules + self.virtual_network_rules = virtual_network_rules diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/operation.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/operation.py index 27e52fdb7f54..201a18369a5d 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/operation.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/operation.py @@ -34,9 +34,9 @@ class Operation(Model): 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, } - def __init__(self, name=None, display=None, origin=None, service_specification=None): - super(Operation, self).__init__() - self.name = name - self.display = display - self.origin = origin - self.service_specification = service_specification + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.service_specification = kwargs.get('service_specification', None) diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/operation_display.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/operation_display.py index ccb8d7adee3a..6aaa72c83818 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/operation_display.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/operation_display.py @@ -32,9 +32,9 @@ class OperationDisplay(Model): 'description': {'key': 'description', 'type': 'str'}, } - def __init__(self, provider=None, resource=None, operation=None, description=None): - super(OperationDisplay, self).__init__() - self.provider = provider - self.resource = resource - self.operation = operation - self.description = description + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/operation_display_py3.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/operation_display_py3.py new file mode 100644 index 000000000000..75671557dbee --- /dev/null +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/operation_display_py3.py @@ -0,0 +1,40 @@ +# 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 OperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Service provider: Microsoft Key Vault. + :type provider: str + :param resource: Resource on which the operation is performed etc. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + :param description: Decription of operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/operation_py3.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/operation_py3.py new file mode 100644 index 000000000000..caad53eed64b --- /dev/null +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/operation_py3.py @@ -0,0 +1,42 @@ +# 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 Operation(Model): + """Key Vault REST API operation definition. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: ~azure.mgmt.keyvault.models.OperationDisplay + :param origin: The origin of operations. + :type origin: str + :param service_specification: One property of operation, include metric + specifications. + :type service_specification: + ~azure.mgmt.keyvault.models.ServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__(self, *, name: str=None, display=None, origin: str=None, service_specification=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + self.service_specification = service_specification diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/permissions.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/permissions.py index 25d73401a680..cd774ee7763f 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/permissions.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/permissions.py @@ -33,9 +33,9 @@ class Permissions(Model): 'storage': {'key': 'storage', 'type': '[str]'}, } - def __init__(self, keys=None, secrets=None, certificates=None, storage=None): - super(Permissions, self).__init__() - self.keys = keys - self.secrets = secrets - self.certificates = certificates - self.storage = storage + def __init__(self, **kwargs): + super(Permissions, self).__init__(**kwargs) + self.keys = kwargs.get('keys', None) + self.secrets = kwargs.get('secrets', None) + self.certificates = kwargs.get('certificates', None) + self.storage = kwargs.get('storage', None) diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/permissions_py3.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/permissions_py3.py new file mode 100644 index 000000000000..a46b41e32517 --- /dev/null +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/permissions_py3.py @@ -0,0 +1,41 @@ +# 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 Permissions(Model): + """Permissions the identity has for keys, secrets, certificates and storage. + + :param keys: Permissions to keys + :type keys: list[str or ~azure.mgmt.keyvault.models.KeyPermissions] + :param secrets: Permissions to secrets + :type secrets: list[str or ~azure.mgmt.keyvault.models.SecretPermissions] + :param certificates: Permissions to certificates + :type certificates: list[str or + ~azure.mgmt.keyvault.models.CertificatePermissions] + :param storage: Permissions to storage accounts + :type storage: list[str or ~azure.mgmt.keyvault.models.StoragePermissions] + """ + + _attribute_map = { + 'keys': {'key': 'keys', 'type': '[str]'}, + 'secrets': {'key': 'secrets', 'type': '[str]'}, + 'certificates': {'key': 'certificates', 'type': '[str]'}, + 'storage': {'key': 'storage', 'type': '[str]'}, + } + + def __init__(self, *, keys=None, secrets=None, certificates=None, storage=None, **kwargs) -> None: + super(Permissions, self).__init__(**kwargs) + self.keys = keys + self.secrets = secrets + self.certificates = certificates + self.storage = storage diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/resource.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/resource.py index 9d91463bfeee..0c30e1ffcb16 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/resource.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/resource.py @@ -18,14 +18,16 @@ class Resource(Model): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: The Azure Resource Manager resource ID for the key vault. :vartype id: str :ivar name: The name of the key vault. :vartype name: str :ivar type: The resource type of the key vault. :vartype type: str - :param location: The supported Azure location where the key vault should - be created. + :param location: Required. The supported Azure location where the key + vault should be created. :type location: str :param tags: The tags that will be assigned to the key vault. :type tags: dict[str, str] @@ -46,10 +48,10 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, location, tags=None): - super(Resource, self).__init__() + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = location - self.tags = tags + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/resource_py3.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/resource_py3.py new file mode 100644 index 000000000000..57daac0d2a91 --- /dev/null +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/resource_py3.py @@ -0,0 +1,57 @@ +# 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 Resource(Model): + """Key Vault resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The Azure Resource Manager resource ID for the key vault. + :vartype id: str + :ivar name: The name of the key vault. + :vartype name: str + :ivar type: The resource type of the key vault. + :vartype type: str + :param location: Required. The supported Azure location where the key + vault should be created. + :type location: str + :param tags: The tags that will be assigned to the key vault. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/service_specification.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/service_specification.py index a4fa109f9243..e049692e09c0 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/service_specification.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/service_specification.py @@ -24,6 +24,6 @@ class ServiceSpecification(Model): 'log_specifications': {'key': 'logSpecifications', 'type': '[LogSpecification]'}, } - def __init__(self, log_specifications=None): - super(ServiceSpecification, self).__init__() - self.log_specifications = log_specifications + def __init__(self, **kwargs): + super(ServiceSpecification, self).__init__(**kwargs) + self.log_specifications = kwargs.get('log_specifications', None) diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/service_specification_py3.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/service_specification_py3.py new file mode 100644 index 000000000000..b34f83c19eee --- /dev/null +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/service_specification_py3.py @@ -0,0 +1,29 @@ +# 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 ServiceSpecification(Model): + """One property of operation, include log specifications. + + :param log_specifications: Log specifications of operation. + :type log_specifications: + list[~azure.mgmt.keyvault.models.LogSpecification] + """ + + _attribute_map = { + 'log_specifications': {'key': 'logSpecifications', 'type': '[LogSpecification]'}, + } + + def __init__(self, *, log_specifications=None, **kwargs) -> None: + super(ServiceSpecification, self).__init__(**kwargs) + self.log_specifications = log_specifications diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/sku.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/sku.py index 69a4758e155f..821f817256a4 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/sku.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/sku.py @@ -18,10 +18,13 @@ class Sku(Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar family: SKU family name. Default value: "A" . + All required parameters must be populated in order to send to Azure. + + :ivar family: Required. SKU family name. Default value: "A" . :vartype family: str - :param name: SKU name to specify whether the key vault is a standard vault - or a premium vault. Possible values include: 'standard', 'premium' + :param name: Required. SKU name to specify whether the key vault is a + standard vault or a premium vault. Possible values include: 'standard', + 'premium' :type name: str or ~azure.mgmt.keyvault.models.SkuName """ @@ -37,6 +40,6 @@ class Sku(Model): family = "A" - def __init__(self, name): - super(Sku, self).__init__() - self.name = name + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/sku_py3.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/sku_py3.py new file mode 100644 index 000000000000..f14fc4dafab0 --- /dev/null +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/sku_py3.py @@ -0,0 +1,45 @@ +# 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 Sku(Model): + """SKU details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar family: Required. SKU family name. Default value: "A" . + :vartype family: str + :param name: Required. SKU name to specify whether the key vault is a + standard vault or a premium vault. Possible values include: 'standard', + 'premium' + :type name: str or ~azure.mgmt.keyvault.models.SkuName + """ + + _validation = { + 'family': {'required': True, 'constant': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'family': {'key': 'family', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'SkuName'}, + } + + family = "A" + + def __init__(self, *, name, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault.py index c47e0d8b68e0..6ec3c66c53e1 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault.py @@ -18,18 +18,20 @@ class Vault(Resource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: The Azure Resource Manager resource ID for the key vault. :vartype id: str :ivar name: The name of the key vault. :vartype name: str :ivar type: The resource type of the key vault. :vartype type: str - :param location: The supported Azure location where the key vault should - be created. + :param location: Required. The supported Azure location where the key + vault should be created. :type location: str :param tags: The tags that will be assigned to the key vault. :type tags: dict[str, str] - :param properties: Properties of the vault + :param properties: Required. Properties of the vault :type properties: ~azure.mgmt.keyvault.models.VaultProperties """ @@ -50,6 +52,6 @@ class Vault(Resource): 'properties': {'key': 'properties', 'type': 'VaultProperties'}, } - def __init__(self, location, properties, tags=None): - super(Vault, self).__init__(location=location, tags=tags) - self.properties = properties + def __init__(self, **kwargs): + super(Vault, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_access_policy_parameters.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_access_policy_parameters.py index 65667c484b09..a2a6e5db234e 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_access_policy_parameters.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_access_policy_parameters.py @@ -18,6 +18,8 @@ class VaultAccessPolicyParameters(Model): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: The resource id of the access policy. :vartype id: str :ivar name: The resource name of the access policy. @@ -26,7 +28,7 @@ class VaultAccessPolicyParameters(Model): :vartype type: str :ivar location: The resource type of the the access policy. :vartype location: str - :param properties: Properties of the access policy + :param properties: Required. Properties of the access policy :type properties: ~azure.mgmt.keyvault.models.VaultAccessPolicyProperties """ @@ -46,10 +48,10 @@ class VaultAccessPolicyParameters(Model): 'properties': {'key': 'properties', 'type': 'VaultAccessPolicyProperties'}, } - def __init__(self, properties): - super(VaultAccessPolicyParameters, self).__init__() + def __init__(self, **kwargs): + super(VaultAccessPolicyParameters, self).__init__(**kwargs) self.id = None self.name = None self.type = None self.location = None - self.properties = properties + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_access_policy_parameters_py3.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_access_policy_parameters_py3.py new file mode 100644 index 000000000000..0b3bc1b438c7 --- /dev/null +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_access_policy_parameters_py3.py @@ -0,0 +1,57 @@ +# 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 VaultAccessPolicyParameters(Model): + """Parameters for updating the access policy in a vault. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the access policy. + :vartype id: str + :ivar name: The resource name of the access policy. + :vartype name: str + :ivar type: The resource name of the access policy. + :vartype type: str + :ivar location: The resource type of the the access policy. + :vartype location: str + :param properties: Required. Properties of the access policy + :type properties: ~azure.mgmt.keyvault.models.VaultAccessPolicyProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'readonly': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'VaultAccessPolicyProperties'}, + } + + def __init__(self, *, properties, **kwargs) -> None: + super(VaultAccessPolicyParameters, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = None + self.properties = properties diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_access_policy_properties.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_access_policy_properties.py index 2c93c6b466aa..cf906d226126 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_access_policy_properties.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_access_policy_properties.py @@ -15,9 +15,11 @@ class VaultAccessPolicyProperties(Model): """Properties of the vault access policy. - :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. + All required parameters must be populated in order to send to Azure. + + :param access_policies: Required. 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. :type access_policies: list[~azure.mgmt.keyvault.models.AccessPolicyEntry] """ @@ -29,6 +31,6 @@ class VaultAccessPolicyProperties(Model): 'access_policies': {'key': 'accessPolicies', 'type': '[AccessPolicyEntry]'}, } - def __init__(self, access_policies): - super(VaultAccessPolicyProperties, self).__init__() - self.access_policies = access_policies + def __init__(self, **kwargs): + super(VaultAccessPolicyProperties, self).__init__(**kwargs) + self.access_policies = kwargs.get('access_policies', None) diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_access_policy_properties_py3.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_access_policy_properties_py3.py new file mode 100644 index 000000000000..bacfa890f9f2 --- /dev/null +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_access_policy_properties_py3.py @@ -0,0 +1,36 @@ +# 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 VaultAccessPolicyProperties(Model): + """Properties of the vault access policy. + + All required parameters must be populated in order to send to Azure. + + :param access_policies: Required. 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. + :type access_policies: list[~azure.mgmt.keyvault.models.AccessPolicyEntry] + """ + + _validation = { + 'access_policies': {'required': True}, + } + + _attribute_map = { + 'access_policies': {'key': 'accessPolicies', 'type': '[AccessPolicyEntry]'}, + } + + def __init__(self, *, access_policies, **kwargs) -> None: + super(VaultAccessPolicyProperties, self).__init__(**kwargs) + self.access_policies = access_policies diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_check_name_availability_parameters.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_check_name_availability_parameters.py index ff2b7e738674..b49bc5dbb513 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_check_name_availability_parameters.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_check_name_availability_parameters.py @@ -18,10 +18,12 @@ class VaultCheckNameAvailabilityParameters(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param name: The vault name. + All required parameters must be populated in order to send to Azure. + + :param name: Required. The vault name. :type name: str - :ivar type: The type of resource, Microsoft.KeyVault/vaults. Default - value: "Microsoft.KeyVault/vaults" . + :ivar type: Required. The type of resource, Microsoft.KeyVault/vaults. + Default value: "Microsoft.KeyVault/vaults" . :vartype type: str """ @@ -37,6 +39,6 @@ class VaultCheckNameAvailabilityParameters(Model): type = "Microsoft.KeyVault/vaults" - def __init__(self, name): - super(VaultCheckNameAvailabilityParameters, self).__init__() - self.name = name + def __init__(self, **kwargs): + super(VaultCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_check_name_availability_parameters_py3.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_check_name_availability_parameters_py3.py new file mode 100644 index 000000000000..74afce9a8c85 --- /dev/null +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_check_name_availability_parameters_py3.py @@ -0,0 +1,44 @@ +# 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 VaultCheckNameAvailabilityParameters(Model): + """The parameters used to check the availabity of the vault name. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The vault name. + :type name: str + :ivar type: Required. The type of resource, Microsoft.KeyVault/vaults. + Default value: "Microsoft.KeyVault/vaults" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.KeyVault/vaults" + + def __init__(self, *, name: str, **kwargs) -> None: + super(VaultCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_create_or_update_parameters.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_create_or_update_parameters.py index 8e5a87895bf7..17d358af45c4 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_create_or_update_parameters.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_create_or_update_parameters.py @@ -15,12 +15,14 @@ class VaultCreateOrUpdateParameters(Model): """Parameters for creating or updating a vault. - :param location: The supported Azure location where the key vault should - be created. + All required parameters must be populated in order to send to Azure. + + :param location: Required. The supported Azure location where the key + vault should be created. :type location: str :param tags: The tags that will be assigned to the key vault. :type tags: dict[str, str] - :param properties: Properties of the vault + :param properties: Required. Properties of the vault :type properties: ~azure.mgmt.keyvault.models.VaultProperties """ @@ -35,8 +37,8 @@ class VaultCreateOrUpdateParameters(Model): 'properties': {'key': 'properties', 'type': 'VaultProperties'}, } - def __init__(self, location, properties, tags=None): - super(VaultCreateOrUpdateParameters, self).__init__() - self.location = location - self.tags = tags - self.properties = properties + def __init__(self, **kwargs): + super(VaultCreateOrUpdateParameters, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_create_or_update_parameters_py3.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_create_or_update_parameters_py3.py new file mode 100644 index 000000000000..861fc58686cb --- /dev/null +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_create_or_update_parameters_py3.py @@ -0,0 +1,44 @@ +# 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 VaultCreateOrUpdateParameters(Model): + """Parameters for creating or updating a vault. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The supported Azure location where the key + vault should be created. + :type location: str + :param tags: The tags that will be assigned to the key vault. + :type tags: dict[str, str] + :param properties: Required. Properties of the vault + :type properties: ~azure.mgmt.keyvault.models.VaultProperties + """ + + _validation = { + 'location': {'required': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'properties': {'key': 'properties', 'type': 'VaultProperties'}, + } + + def __init__(self, *, location: str, properties, tags=None, **kwargs) -> None: + super(VaultCreateOrUpdateParameters, self).__init__(**kwargs) + self.location = location + self.tags = tags + self.properties = properties diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_patch_parameters.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_patch_parameters.py index ada3e9a9c58d..b38fcc1b32df 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_patch_parameters.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_patch_parameters.py @@ -26,7 +26,7 @@ class VaultPatchParameters(Model): 'properties': {'key': 'properties', 'type': 'VaultPatchProperties'}, } - def __init__(self, tags=None, properties=None): - super(VaultPatchParameters, self).__init__() - self.tags = tags - self.properties = properties + def __init__(self, **kwargs): + super(VaultPatchParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_patch_parameters_py3.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_patch_parameters_py3.py new file mode 100644 index 000000000000..16bf148f7b8c --- /dev/null +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_patch_parameters_py3.py @@ -0,0 +1,32 @@ +# 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 VaultPatchParameters(Model): + """Parameters for creating or updating a vault. + + :param tags: The tags that will be assigned to the key vault. + :type tags: dict[str, str] + :param properties: Properties of the vault + :type properties: ~azure.mgmt.keyvault.models.VaultPatchProperties + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'properties': {'key': 'properties', 'type': 'VaultPatchProperties'}, + } + + def __init__(self, *, tags=None, properties=None, **kwargs) -> None: + super(VaultPatchParameters, self).__init__(**kwargs) + self.tags = tags + self.properties = properties diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_patch_properties.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_patch_properties.py index 22d3a0b8c88b..e1e4b1b5b89d 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_patch_properties.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_patch_properties.py @@ -68,15 +68,15 @@ class VaultPatchProperties(Model): 'network_acls': {'key': 'networkAcls', 'type': 'NetworkRuleSet'}, } - def __init__(self, tenant_id=None, sku=None, access_policies=None, enabled_for_deployment=None, enabled_for_disk_encryption=None, enabled_for_template_deployment=None, enable_soft_delete=None, create_mode=None, enable_purge_protection=None, network_acls=None): - super(VaultPatchProperties, self).__init__() - self.tenant_id = tenant_id - self.sku = sku - self.access_policies = access_policies - self.enabled_for_deployment = enabled_for_deployment - self.enabled_for_disk_encryption = enabled_for_disk_encryption - self.enabled_for_template_deployment = enabled_for_template_deployment - self.enable_soft_delete = enable_soft_delete - self.create_mode = create_mode - self.enable_purge_protection = enable_purge_protection - self.network_acls = network_acls + def __init__(self, **kwargs): + super(VaultPatchProperties, self).__init__(**kwargs) + self.tenant_id = kwargs.get('tenant_id', None) + self.sku = kwargs.get('sku', None) + self.access_policies = kwargs.get('access_policies', None) + self.enabled_for_deployment = kwargs.get('enabled_for_deployment', None) + self.enabled_for_disk_encryption = kwargs.get('enabled_for_disk_encryption', None) + self.enabled_for_template_deployment = kwargs.get('enabled_for_template_deployment', None) + self.enable_soft_delete = kwargs.get('enable_soft_delete', None) + self.create_mode = kwargs.get('create_mode', None) + self.enable_purge_protection = kwargs.get('enable_purge_protection', None) + self.network_acls = kwargs.get('network_acls', None) diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_patch_properties_py3.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_patch_properties_py3.py new file mode 100644 index 000000000000..c31e17f365cc --- /dev/null +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_patch_properties_py3.py @@ -0,0 +1,82 @@ +# 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 VaultPatchProperties(Model): + """Properties of the vault. + + :param tenant_id: The Azure Active Directory tenant ID that should be used + for authenticating requests to the key vault. + :type tenant_id: str + :param sku: SKU details + :type sku: ~azure.mgmt.keyvault.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. + :type access_policies: list[~azure.mgmt.keyvault.models.AccessPolicyEntry] + :param enabled_for_deployment: Property to specify whether Azure Virtual + Machines are permitted to retrieve certificates stored as secrets from the + key vault. + :type enabled_for_deployment: bool + :param enabled_for_disk_encryption: Property to specify whether Azure Disk + Encryption is permitted to retrieve secrets from the vault and unwrap + keys. + :type enabled_for_disk_encryption: bool + :param enabled_for_template_deployment: Property to specify whether Azure + Resource Manager is permitted to retrieve secrets from the key vault. + :type enabled_for_template_deployment: bool + :param enable_soft_delete: Property to specify whether the 'soft delete' + functionality is enabled for this key vault. It does not accept false + value. + :type enable_soft_delete: bool + :param create_mode: The vault's create mode to indicate whether the vault + need to be recovered or not. Possible values include: 'recover', 'default' + :type create_mode: str or ~azure.mgmt.keyvault.models.CreateMode + :param enable_purge_protection: Property specifying whether protection + against purge is enabled for this vault. Setting this property to true + activates protection against purge for this vault and its content - only + the Key Vault service may initiate a hard, irrecoverable deletion. The + setting is effective only if soft delete is also enabled. Enabling this + functionality is irreversible - that is, the property does not accept + false as its value. + :type enable_purge_protection: bool + :param network_acls: A collection of rules governing the accessibility of + the vault from specific network locations. + :type network_acls: ~azure.mgmt.keyvault.models.NetworkRuleSet + """ + + _attribute_map = { + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'access_policies': {'key': 'accessPolicies', 'type': '[AccessPolicyEntry]'}, + 'enabled_for_deployment': {'key': 'enabledForDeployment', 'type': 'bool'}, + 'enabled_for_disk_encryption': {'key': 'enabledForDiskEncryption', 'type': 'bool'}, + 'enabled_for_template_deployment': {'key': 'enabledForTemplateDeployment', 'type': 'bool'}, + 'enable_soft_delete': {'key': 'enableSoftDelete', 'type': 'bool'}, + 'create_mode': {'key': 'createMode', 'type': 'CreateMode'}, + 'enable_purge_protection': {'key': 'enablePurgeProtection', 'type': 'bool'}, + 'network_acls': {'key': 'networkAcls', 'type': 'NetworkRuleSet'}, + } + + def __init__(self, *, tenant_id: str=None, sku=None, access_policies=None, enabled_for_deployment: bool=None, enabled_for_disk_encryption: bool=None, enabled_for_template_deployment: bool=None, enable_soft_delete: bool=None, create_mode=None, enable_purge_protection: bool=None, network_acls=None, **kwargs) -> None: + super(VaultPatchProperties, self).__init__(**kwargs) + self.tenant_id = tenant_id + self.sku = sku + self.access_policies = access_policies + self.enabled_for_deployment = enabled_for_deployment + self.enabled_for_disk_encryption = enabled_for_disk_encryption + self.enabled_for_template_deployment = enabled_for_template_deployment + self.enable_soft_delete = enable_soft_delete + self.create_mode = create_mode + self.enable_purge_protection = enable_purge_protection + self.network_acls = network_acls diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_properties.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_properties.py index d903a7d93145..a09d68c304b0 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_properties.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_properties.py @@ -15,10 +15,12 @@ class VaultProperties(Model): """Properties of the vault. - :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 sku: SKU details + :param sku: Required. SKU details :type sku: ~azure.mgmt.keyvault.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 @@ -77,16 +79,16 @@ class VaultProperties(Model): 'network_acls': {'key': 'networkAcls', 'type': 'NetworkRuleSet'}, } - def __init__(self, tenant_id, sku, access_policies=None, vault_uri=None, enabled_for_deployment=None, enabled_for_disk_encryption=None, enabled_for_template_deployment=None, enable_soft_delete=None, create_mode=None, enable_purge_protection=None, network_acls=None): - super(VaultProperties, self).__init__() - self.tenant_id = tenant_id - self.sku = sku - self.access_policies = access_policies - self.vault_uri = vault_uri - self.enabled_for_deployment = enabled_for_deployment - self.enabled_for_disk_encryption = enabled_for_disk_encryption - self.enabled_for_template_deployment = enabled_for_template_deployment - self.enable_soft_delete = enable_soft_delete - self.create_mode = create_mode - self.enable_purge_protection = enable_purge_protection - self.network_acls = network_acls + def __init__(self, **kwargs): + super(VaultProperties, self).__init__(**kwargs) + self.tenant_id = kwargs.get('tenant_id', None) + self.sku = kwargs.get('sku', None) + self.access_policies = kwargs.get('access_policies', None) + self.vault_uri = kwargs.get('vault_uri', None) + self.enabled_for_deployment = kwargs.get('enabled_for_deployment', None) + self.enabled_for_disk_encryption = kwargs.get('enabled_for_disk_encryption', None) + self.enabled_for_template_deployment = kwargs.get('enabled_for_template_deployment', None) + self.enable_soft_delete = kwargs.get('enable_soft_delete', None) + self.create_mode = kwargs.get('create_mode', None) + self.enable_purge_protection = kwargs.get('enable_purge_protection', None) + self.network_acls = kwargs.get('network_acls', None) diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_properties_py3.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_properties_py3.py new file mode 100644 index 000000000000..e25654b6d375 --- /dev/null +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_properties_py3.py @@ -0,0 +1,94 @@ +# 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 VaultProperties(Model): + """Properties of the 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 sku: Required. SKU details + :type sku: ~azure.mgmt.keyvault.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. + :type access_policies: list[~azure.mgmt.keyvault.models.AccessPolicyEntry] + :param vault_uri: The URI of the vault for performing operations on keys + and secrets. + :type vault_uri: str + :param enabled_for_deployment: Property to specify whether Azure Virtual + Machines are permitted to retrieve certificates stored as secrets from the + key vault. + :type enabled_for_deployment: bool + :param enabled_for_disk_encryption: Property to specify whether Azure Disk + Encryption is permitted to retrieve secrets from the vault and unwrap + keys. + :type enabled_for_disk_encryption: bool + :param enabled_for_template_deployment: Property to specify whether Azure + Resource Manager is permitted to retrieve secrets from the key vault. + :type enabled_for_template_deployment: bool + :param enable_soft_delete: Property to specify whether the 'soft delete' + functionality is enabled for this key vault. It does not accept false + value. + :type enable_soft_delete: bool + :param create_mode: The vault's create mode to indicate whether the vault + need to be recovered or not. Possible values include: 'recover', 'default' + :type create_mode: str or ~azure.mgmt.keyvault.models.CreateMode + :param enable_purge_protection: Property specifying whether protection + against purge is enabled for this vault. Setting this property to true + activates protection against purge for this vault and its content - only + the Key Vault service may initiate a hard, irrecoverable deletion. The + setting is effective only if soft delete is also enabled. Enabling this + functionality is irreversible - that is, the property does not accept + false as its value. + :type enable_purge_protection: bool + :param network_acls: A collection of rules governing the accessibility of + the vault from specific network locations. + :type network_acls: ~azure.mgmt.keyvault.models.NetworkRuleSet + """ + + _validation = { + 'tenant_id': {'required': True}, + 'sku': {'required': True}, + } + + _attribute_map = { + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'access_policies': {'key': 'accessPolicies', 'type': '[AccessPolicyEntry]'}, + 'vault_uri': {'key': 'vaultUri', 'type': 'str'}, + 'enabled_for_deployment': {'key': 'enabledForDeployment', 'type': 'bool'}, + 'enabled_for_disk_encryption': {'key': 'enabledForDiskEncryption', 'type': 'bool'}, + 'enabled_for_template_deployment': {'key': 'enabledForTemplateDeployment', 'type': 'bool'}, + 'enable_soft_delete': {'key': 'enableSoftDelete', 'type': 'bool'}, + 'create_mode': {'key': 'createMode', 'type': 'CreateMode'}, + 'enable_purge_protection': {'key': 'enablePurgeProtection', 'type': 'bool'}, + 'network_acls': {'key': 'networkAcls', 'type': 'NetworkRuleSet'}, + } + + def __init__(self, *, tenant_id: str, sku, access_policies=None, vault_uri: str=None, enabled_for_deployment: bool=None, enabled_for_disk_encryption: bool=None, enabled_for_template_deployment: bool=None, enable_soft_delete: bool=None, create_mode=None, enable_purge_protection: bool=None, network_acls=None, **kwargs) -> None: + super(VaultProperties, self).__init__(**kwargs) + self.tenant_id = tenant_id + self.sku = sku + self.access_policies = access_policies + self.vault_uri = vault_uri + self.enabled_for_deployment = enabled_for_deployment + self.enabled_for_disk_encryption = enabled_for_disk_encryption + self.enabled_for_template_deployment = enabled_for_template_deployment + self.enable_soft_delete = enable_soft_delete + self.create_mode = create_mode + self.enable_purge_protection = enable_purge_protection + self.network_acls = network_acls diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_py3.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_py3.py new file mode 100644 index 000000000000..bcbb18be36d5 --- /dev/null +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/vault_py3.py @@ -0,0 +1,57 @@ +# 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 .resource import Resource + + +class Vault(Resource): + """Resource information with extended details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The Azure Resource Manager resource ID for the key vault. + :vartype id: str + :ivar name: The name of the key vault. + :vartype name: str + :ivar type: The resource type of the key vault. + :vartype type: str + :param location: Required. The supported Azure location where the key + vault should be created. + :type location: str + :param tags: The tags that will be assigned to the key vault. + :type tags: dict[str, str] + :param properties: Required. Properties of the vault + :type properties: ~azure.mgmt.keyvault.models.VaultProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'properties': {'key': 'properties', 'type': 'VaultProperties'}, + } + + def __init__(self, *, location: str, properties, tags=None, **kwargs) -> None: + super(Vault, self).__init__(location=location, tags=tags, **kwargs) + self.properties = properties diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/virtual_network_rule.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/virtual_network_rule.py index f99d02ada8fd..638060696e8e 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/virtual_network_rule.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/virtual_network_rule.py @@ -16,7 +16,9 @@ class VirtualNetworkRule(Model): """A rule governing the accesibility of a vault from a specific virtual network. - :param id: Full resource id of a vnet subnet, such as + All required parameters must be populated in order to send to Azure. + + :param id: Required. Full resource id of a vnet subnet, such as '/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1'. :type id: str """ @@ -29,6 +31,6 @@ class VirtualNetworkRule(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, id): - super(VirtualNetworkRule, self).__init__() - self.id = id + def __init__(self, **kwargs): + super(VirtualNetworkRule, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/models/virtual_network_rule_py3.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/virtual_network_rule_py3.py new file mode 100644 index 000000000000..19f2eec7d290 --- /dev/null +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/models/virtual_network_rule_py3.py @@ -0,0 +1,36 @@ +# 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 VirtualNetworkRule(Model): + """A rule governing the accesibility of a vault from a specific virtual + network. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Full resource id of a vnet subnet, such as + '/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1'. + :type id: str + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str, **kwargs) -> None: + super(VirtualNetworkRule, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-keyvault/azure/mgmt/keyvault/operations/vaults_operations.py b/azure-mgmt-keyvault/azure/mgmt/keyvault/operations/vaults_operations.py index e13133a7f284..22e2537ac076 100644 --- a/azure-mgmt-keyvault/azure/mgmt/keyvault/operations/vaults_operations.py +++ b/azure-mgmt-keyvault/azure/mgmt/keyvault/operations/vaults_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -94,7 +94,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, vault_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, vault_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Create or update a key vault in the specified subscription. :param resource_group_name: The name of the Resource Group to which @@ -106,13 +106,16 @@ def create_or_update( :type parameters: ~azure.mgmt.keyvault.models.VaultCreateOrUpdateParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Vault or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Vault or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.keyvault.models.Vault] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.keyvault.models.Vault]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -123,30 +126,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('Vault', response) if raw: @@ -155,12 +136,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}'} def update( @@ -764,7 +746,7 @@ def _purge_deleted_initial( return client_raw_response def purge_deleted( - self, vault_name, location, custom_headers=None, raw=False, **operation_config): + self, vault_name, location, custom_headers=None, raw=False, polling=True, **operation_config): """Permanently deletes the specified vault. aka Purges the deleted Azure key vault. @@ -773,12 +755,14 @@ def purge_deleted( :param location: The location of the soft-deleted vault. :type location: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._purge_deleted_initial( @@ -788,40 +772,19 @@ def purge_deleted( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) purge_deleted.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/locations/{location}/deletedVaults/{vaultName}/purge'} def list(