diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/_storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/_storage_management_client.py index c468c8a66b63a..8dc5a6fb6dee4 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/_storage_management_client.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/_storage_management_client.py @@ -170,6 +170,19 @@ def blob_services(self): raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property + def encryption_scopes(self): + """Instance depends on the API version: + + * 2019-06-01: :class:`EncryptionScopesOperations` + """ + api_version = self._get_api_version('encryption_scopes') + if api_version == '2019-06-01': + from .v2019_06_01.operations import EncryptionScopesOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def file_services(self): """Instance depends on the API version: diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/_storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/_storage_management_client.py index 692c9e08d5fe1..215670463ba79 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/_storage_management_client.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/_storage_management_client.py @@ -20,6 +20,7 @@ from .operations import ManagementPoliciesOperations from .operations import PrivateEndpointConnectionsOperations from .operations import PrivateLinkResourcesOperations +from .operations import EncryptionScopesOperations from .operations import BlobServicesOperations from .operations import BlobContainersOperations from .operations import FileServicesOperations @@ -47,6 +48,8 @@ class StorageManagementClient(SDKClient): :vartype private_endpoint_connections: azure.mgmt.storage.v2019_06_01.operations.PrivateEndpointConnectionsOperations :ivar private_link_resources: PrivateLinkResources operations :vartype private_link_resources: azure.mgmt.storage.v2019_06_01.operations.PrivateLinkResourcesOperations + :ivar encryption_scopes: EncryptionScopes operations + :vartype encryption_scopes: azure.mgmt.storage.v2019_06_01.operations.EncryptionScopesOperations :ivar blob_services: BlobServices operations :vartype blob_services: azure.mgmt.storage.v2019_06_01.operations.BlobServicesOperations :ivar blob_containers: BlobContainers operations @@ -89,6 +92,8 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.private_link_resources = PrivateLinkResourcesOperations( self._client, self.config, self._serialize, self._deserialize) + self.encryption_scopes = EncryptionScopesOperations( + self._client, self.config, self._serialize, self._deserialize) self.blob_services = BlobServicesOperations( self._client, self.config, self._serialize, self._deserialize) self.blob_containers = BlobContainersOperations( diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/models/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/models/__init__.py index ca7dfe8163921..dca930d902ba5 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/models/__init__.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/models/__init__.py @@ -29,6 +29,8 @@ from ._models_py3 import DeleteRetentionPolicy from ._models_py3 import Dimension from ._models_py3 import Encryption + from ._models_py3 import EncryptionScope + from ._models_py3 import EncryptionScopeKeyVaultProperties from ._models_py3 import EncryptionService from ._models_py3 import EncryptionServices from ._models_py3 import Endpoints @@ -112,6 +114,8 @@ from ._models import DeleteRetentionPolicy from ._models import Dimension from ._models import Encryption + from ._models import EncryptionScope + from ._models import EncryptionScopeKeyVaultProperties from ._models import EncryptionService from ._models import EncryptionServices from ._models import Endpoints @@ -176,6 +180,7 @@ from ._models import UsageName from ._models import VirtualNetworkRule from ._paged_models import BlobServicePropertiesPaged +from ._paged_models import EncryptionScopePaged from ._paged_models import FileShareItemPaged from ._paged_models import ListContainerItemPaged from ._paged_models import OperationPaged @@ -211,6 +216,8 @@ Permissions, HttpProtocol, SignedResource, + EncryptionScopeSource, + EncryptionScopeState, PublicAccess, LeaseStatus, LeaseState, @@ -241,6 +248,8 @@ 'DeleteRetentionPolicy', 'Dimension', 'Encryption', + 'EncryptionScope', + 'EncryptionScopeKeyVaultProperties', 'EncryptionService', 'EncryptionServices', 'Endpoints', @@ -308,6 +317,7 @@ 'SkuInformationPaged', 'StorageAccountPaged', 'UsagePaged', + 'EncryptionScopePaged', 'BlobServicePropertiesPaged', 'ListContainerItemPaged', 'FileShareItemPaged', @@ -339,6 +349,8 @@ 'Permissions', 'HttpProtocol', 'SignedResource', + 'EncryptionScopeSource', + 'EncryptionScopeState', 'PublicAccess', 'LeaseStatus', 'LeaseState', diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/models/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/models/_models.py index 51deb18a4816c..c65ee9cce59a6 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/models/_models.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/models/_models.py @@ -467,8 +467,10 @@ class BlobServiceProperties(Resource): delete. :type delete_retention_policy: ~azure.mgmt.storage.v2019_06_01.models.DeleteRetentionPolicy - :param automatic_snapshot_policy_enabled: Automatic Snapshot is enabled if - set to true. + :param is_versioning_enabled: Versioning is enabled if set to true. + :type is_versioning_enabled: bool + :param automatic_snapshot_policy_enabled: Deprecated in favor of + isVersioningEnabled property. :type automatic_snapshot_policy_enabled: bool :param change_feed: The blob service properties for change feed events. :type change_feed: ~azure.mgmt.storage.v2019_06_01.models.ChangeFeed @@ -476,6 +478,10 @@ class BlobServiceProperties(Resource): policy. :type restore_policy: ~azure.mgmt.storage.v2019_06_01.models.RestorePolicyProperties + :param container_delete_retention_policy: The blob service properties for + container soft delete. + :type container_delete_retention_policy: + ~azure.mgmt.storage.v2019_06_01.models.DeleteRetentionPolicy :ivar sku: Sku name and tier. :vartype sku: ~azure.mgmt.storage.v2019_06_01.models.Sku """ @@ -494,9 +500,11 @@ class BlobServiceProperties(Resource): 'cors': {'key': 'properties.cors', 'type': 'CorsRules'}, 'default_service_version': {'key': 'properties.defaultServiceVersion', 'type': 'str'}, 'delete_retention_policy': {'key': 'properties.deleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'}, + 'is_versioning_enabled': {'key': 'properties.isVersioningEnabled', 'type': 'bool'}, 'automatic_snapshot_policy_enabled': {'key': 'properties.automaticSnapshotPolicyEnabled', 'type': 'bool'}, 'change_feed': {'key': 'properties.changeFeed', 'type': 'ChangeFeed'}, 'restore_policy': {'key': 'properties.restorePolicy', 'type': 'RestorePolicyProperties'}, + 'container_delete_retention_policy': {'key': 'properties.containerDeleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'}, 'sku': {'key': 'sku', 'type': 'Sku'}, } @@ -505,9 +513,11 @@ def __init__(self, **kwargs): self.cors = kwargs.get('cors', None) self.default_service_version = kwargs.get('default_service_version', None) self.delete_retention_policy = kwargs.get('delete_retention_policy', None) + self.is_versioning_enabled = kwargs.get('is_versioning_enabled', None) self.automatic_snapshot_policy_enabled = kwargs.get('automatic_snapshot_policy_enabled', None) self.change_feed = kwargs.get('change_feed', None) self.restore_policy = kwargs.get('restore_policy', None) + self.container_delete_retention_policy = kwargs.get('container_delete_retention_policy', None) self.sku = None @@ -847,6 +857,91 @@ def __init__(self, **kwargs): self.key_vault_properties = kwargs.get('key_vault_properties', None) +class EncryptionScope(Resource): + """The Encryption Scope resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param source: The provider for the encryption scope. Possible values + (case-insensitive): Microsoft.Storage, Microsoft.KeyVault. Possible + values include: 'Microsoft.Storage', 'Microsoft.KeyVault' + :type source: str or + ~azure.mgmt.storage.v2019_06_01.models.EncryptionScopeSource + :param state: The state of the encryption scope. Possible values + (case-insensitive): Enabled, Disabled. Possible values include: + 'Enabled', 'Disabled' + :type state: str or + ~azure.mgmt.storage.v2019_06_01.models.EncryptionScopeState + :ivar creation_time: Gets the creation date and time of the encryption + scope in UTC. + :vartype creation_time: datetime + :ivar last_modified_time: Gets the last modification date and time of the + encryption scope in UTC. + :vartype last_modified_time: datetime + :param key_vault_properties: The key vault properties for the encryption + scope. This is a required field if encryption scope 'source' attribute is + set to 'Microsoft.KeyVault'. + :type key_vault_properties: + ~azure.mgmt.storage.v2019_06_01.models.EncryptionScopeKeyVaultProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'source': {'key': 'properties.source', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'key_vault_properties': {'key': 'properties.keyVaultProperties', 'type': 'EncryptionScopeKeyVaultProperties'}, + } + + def __init__(self, **kwargs): + super(EncryptionScope, self).__init__(**kwargs) + self.source = kwargs.get('source', None) + self.state = kwargs.get('state', None) + self.creation_time = None + self.last_modified_time = None + self.key_vault_properties = kwargs.get('key_vault_properties', None) + + +class EncryptionScopeKeyVaultProperties(Model): + """The key vault properties for the encryption scope. This is a required field + if encryption scope 'source' attribute is set to 'Microsoft.KeyVault'. + + :param key_uri: The object identifier for a key vault key object. When + applied, the encryption scope will use the key referenced by the + identifier to enable customer-managed key support on this encryption + scope. + :type key_uri: str + """ + + _attribute_map = { + 'key_uri': {'key': 'keyUri', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EncryptionScopeKeyVaultProperties, self).__init__(**kwargs) + self.key_uri = kwargs.get('key_uri', None) + + class EncryptionService(Model): """A service that allows server-side encryption to be used. @@ -1279,8 +1374,6 @@ class ImmutabilityPolicy(AzureEntityResource): 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: Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str @@ -1291,15 +1384,21 @@ class ImmutabilityPolicy(AzureEntityResource): :vartype type: str :ivar etag: Resource Etag. :vartype etag: str - :param immutability_period_since_creation_in_days: Required. The - immutability period for the blobs in the container since the policy - creation, in days. + :param immutability_period_since_creation_in_days: The immutability period + for the blobs in the container since the policy creation, in days. :type immutability_period_since_creation_in_days: int :ivar state: The ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked. Possible values include: 'Locked', 'Unlocked' :vartype state: str or ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicyState + :param allow_protected_append_writes: This property can only be changed + for unlocked time-based retention policies. When enabled, new blocks can + be written to an append blob while maintaining immutability protection and + compliance. Only new blocks can be added and any existing blocks cannot be + modified or deleted. This property cannot be changed with + ExtendImmutabilityPolicy API + :type allow_protected_append_writes: bool """ _validation = { @@ -1307,7 +1406,6 @@ class ImmutabilityPolicy(AzureEntityResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'etag': {'readonly': True}, - 'immutability_period_since_creation_in_days': {'required': True}, 'state': {'readonly': True}, } @@ -1318,12 +1416,14 @@ class ImmutabilityPolicy(AzureEntityResource): 'etag': {'key': 'etag', 'type': 'str'}, 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, 'state': {'key': 'properties.state', 'type': 'str'}, + 'allow_protected_append_writes': {'key': 'properties.allowProtectedAppendWrites', 'type': 'bool'}, } def __init__(self, **kwargs): super(ImmutabilityPolicy, self).__init__(**kwargs) self.immutability_period_since_creation_in_days = kwargs.get('immutability_period_since_creation_in_days', None) self.state = None + self.allow_protected_append_writes = kwargs.get('allow_protected_append_writes', None) class ImmutabilityPolicyProperties(Model): @@ -1332,17 +1432,21 @@ class ImmutabilityPolicyProperties(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. - - :param immutability_period_since_creation_in_days: Required. The - immutability period for the blobs in the container since the policy - creation, in days. + :param immutability_period_since_creation_in_days: The immutability period + for the blobs in the container since the policy creation, in days. :type immutability_period_since_creation_in_days: int :ivar state: The ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked. Possible values include: 'Locked', 'Unlocked' :vartype state: str or ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicyState + :param allow_protected_append_writes: This property can only be changed + for unlocked time-based retention policies. When enabled, new blocks can + be written to an append blob while maintaining immutability protection and + compliance. Only new blocks can be added and any existing blocks cannot be + modified or deleted. This property cannot be changed with + ExtendImmutabilityPolicy API + :type allow_protected_append_writes: bool :ivar etag: ImmutabilityPolicy Etag. :vartype etag: str :ivar update_history: The ImmutabilityPolicy update history of the blob @@ -1352,7 +1456,6 @@ class ImmutabilityPolicyProperties(Model): """ _validation = { - 'immutability_period_since_creation_in_days': {'required': True}, 'state': {'readonly': True}, 'etag': {'readonly': True}, 'update_history': {'readonly': True}, @@ -1361,6 +1464,7 @@ class ImmutabilityPolicyProperties(Model): _attribute_map = { 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, 'state': {'key': 'properties.state', 'type': 'str'}, + 'allow_protected_append_writes': {'key': 'properties.allowProtectedAppendWrites', 'type': 'bool'}, 'etag': {'key': 'etag', 'type': 'str'}, 'update_history': {'key': 'updateHistory', 'type': '[UpdateHistoryProperty]'}, } @@ -1369,6 +1473,7 @@ def __init__(self, **kwargs): super(ImmutabilityPolicyProperties, self).__init__(**kwargs) self.immutability_period_since_creation_in_days = kwargs.get('immutability_period_since_creation_in_days', None) self.state = None + self.allow_protected_append_writes = kwargs.get('allow_protected_append_writes', None) self.etag = None self.update_history = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/models/_models_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/models/_models_py3.py index 68b276b146e5e..dca3cd47b7e6f 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/models/_models_py3.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/models/_models_py3.py @@ -467,8 +467,10 @@ class BlobServiceProperties(Resource): delete. :type delete_retention_policy: ~azure.mgmt.storage.v2019_06_01.models.DeleteRetentionPolicy - :param automatic_snapshot_policy_enabled: Automatic Snapshot is enabled if - set to true. + :param is_versioning_enabled: Versioning is enabled if set to true. + :type is_versioning_enabled: bool + :param automatic_snapshot_policy_enabled: Deprecated in favor of + isVersioningEnabled property. :type automatic_snapshot_policy_enabled: bool :param change_feed: The blob service properties for change feed events. :type change_feed: ~azure.mgmt.storage.v2019_06_01.models.ChangeFeed @@ -476,6 +478,10 @@ class BlobServiceProperties(Resource): policy. :type restore_policy: ~azure.mgmt.storage.v2019_06_01.models.RestorePolicyProperties + :param container_delete_retention_policy: The blob service properties for + container soft delete. + :type container_delete_retention_policy: + ~azure.mgmt.storage.v2019_06_01.models.DeleteRetentionPolicy :ivar sku: Sku name and tier. :vartype sku: ~azure.mgmt.storage.v2019_06_01.models.Sku """ @@ -494,20 +500,24 @@ class BlobServiceProperties(Resource): 'cors': {'key': 'properties.cors', 'type': 'CorsRules'}, 'default_service_version': {'key': 'properties.defaultServiceVersion', 'type': 'str'}, 'delete_retention_policy': {'key': 'properties.deleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'}, + 'is_versioning_enabled': {'key': 'properties.isVersioningEnabled', 'type': 'bool'}, 'automatic_snapshot_policy_enabled': {'key': 'properties.automaticSnapshotPolicyEnabled', 'type': 'bool'}, 'change_feed': {'key': 'properties.changeFeed', 'type': 'ChangeFeed'}, 'restore_policy': {'key': 'properties.restorePolicy', 'type': 'RestorePolicyProperties'}, + 'container_delete_retention_policy': {'key': 'properties.containerDeleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'}, 'sku': {'key': 'sku', 'type': 'Sku'}, } - def __init__(self, *, cors=None, default_service_version: str=None, delete_retention_policy=None, automatic_snapshot_policy_enabled: bool=None, change_feed=None, restore_policy=None, **kwargs) -> None: + def __init__(self, *, cors=None, default_service_version: str=None, delete_retention_policy=None, is_versioning_enabled: bool=None, automatic_snapshot_policy_enabled: bool=None, change_feed=None, restore_policy=None, container_delete_retention_policy=None, **kwargs) -> None: super(BlobServiceProperties, self).__init__(**kwargs) self.cors = cors self.default_service_version = default_service_version self.delete_retention_policy = delete_retention_policy + self.is_versioning_enabled = is_versioning_enabled self.automatic_snapshot_policy_enabled = automatic_snapshot_policy_enabled self.change_feed = change_feed self.restore_policy = restore_policy + self.container_delete_retention_policy = container_delete_retention_policy self.sku = None @@ -847,6 +857,91 @@ def __init__(self, *, services=None, key_source="Microsoft.Storage", key_vault_p self.key_vault_properties = key_vault_properties +class EncryptionScope(Resource): + """The Encryption Scope resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param source: The provider for the encryption scope. Possible values + (case-insensitive): Microsoft.Storage, Microsoft.KeyVault. Possible + values include: 'Microsoft.Storage', 'Microsoft.KeyVault' + :type source: str or + ~azure.mgmt.storage.v2019_06_01.models.EncryptionScopeSource + :param state: The state of the encryption scope. Possible values + (case-insensitive): Enabled, Disabled. Possible values include: + 'Enabled', 'Disabled' + :type state: str or + ~azure.mgmt.storage.v2019_06_01.models.EncryptionScopeState + :ivar creation_time: Gets the creation date and time of the encryption + scope in UTC. + :vartype creation_time: datetime + :ivar last_modified_time: Gets the last modification date and time of the + encryption scope in UTC. + :vartype last_modified_time: datetime + :param key_vault_properties: The key vault properties for the encryption + scope. This is a required field if encryption scope 'source' attribute is + set to 'Microsoft.KeyVault'. + :type key_vault_properties: + ~azure.mgmt.storage.v2019_06_01.models.EncryptionScopeKeyVaultProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'source': {'key': 'properties.source', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'key_vault_properties': {'key': 'properties.keyVaultProperties', 'type': 'EncryptionScopeKeyVaultProperties'}, + } + + def __init__(self, *, source=None, state=None, key_vault_properties=None, **kwargs) -> None: + super(EncryptionScope, self).__init__(**kwargs) + self.source = source + self.state = state + self.creation_time = None + self.last_modified_time = None + self.key_vault_properties = key_vault_properties + + +class EncryptionScopeKeyVaultProperties(Model): + """The key vault properties for the encryption scope. This is a required field + if encryption scope 'source' attribute is set to 'Microsoft.KeyVault'. + + :param key_uri: The object identifier for a key vault key object. When + applied, the encryption scope will use the key referenced by the + identifier to enable customer-managed key support on this encryption + scope. + :type key_uri: str + """ + + _attribute_map = { + 'key_uri': {'key': 'keyUri', 'type': 'str'}, + } + + def __init__(self, *, key_uri: str=None, **kwargs) -> None: + super(EncryptionScopeKeyVaultProperties, self).__init__(**kwargs) + self.key_uri = key_uri + + class EncryptionService(Model): """A service that allows server-side encryption to be used. @@ -1279,8 +1374,6 @@ class ImmutabilityPolicy(AzureEntityResource): 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: Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str @@ -1291,15 +1384,21 @@ class ImmutabilityPolicy(AzureEntityResource): :vartype type: str :ivar etag: Resource Etag. :vartype etag: str - :param immutability_period_since_creation_in_days: Required. The - immutability period for the blobs in the container since the policy - creation, in days. + :param immutability_period_since_creation_in_days: The immutability period + for the blobs in the container since the policy creation, in days. :type immutability_period_since_creation_in_days: int :ivar state: The ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked. Possible values include: 'Locked', 'Unlocked' :vartype state: str or ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicyState + :param allow_protected_append_writes: This property can only be changed + for unlocked time-based retention policies. When enabled, new blocks can + be written to an append blob while maintaining immutability protection and + compliance. Only new blocks can be added and any existing blocks cannot be + modified or deleted. This property cannot be changed with + ExtendImmutabilityPolicy API + :type allow_protected_append_writes: bool """ _validation = { @@ -1307,7 +1406,6 @@ class ImmutabilityPolicy(AzureEntityResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'etag': {'readonly': True}, - 'immutability_period_since_creation_in_days': {'required': True}, 'state': {'readonly': True}, } @@ -1318,12 +1416,14 @@ class ImmutabilityPolicy(AzureEntityResource): 'etag': {'key': 'etag', 'type': 'str'}, 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, 'state': {'key': 'properties.state', 'type': 'str'}, + 'allow_protected_append_writes': {'key': 'properties.allowProtectedAppendWrites', 'type': 'bool'}, } - def __init__(self, *, immutability_period_since_creation_in_days: int, **kwargs) -> None: + def __init__(self, *, immutability_period_since_creation_in_days: int=None, allow_protected_append_writes: bool=None, **kwargs) -> None: super(ImmutabilityPolicy, self).__init__(**kwargs) self.immutability_period_since_creation_in_days = immutability_period_since_creation_in_days self.state = None + self.allow_protected_append_writes = allow_protected_append_writes class ImmutabilityPolicyProperties(Model): @@ -1332,17 +1432,21 @@ class ImmutabilityPolicyProperties(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. - - :param immutability_period_since_creation_in_days: Required. The - immutability period for the blobs in the container since the policy - creation, in days. + :param immutability_period_since_creation_in_days: The immutability period + for the blobs in the container since the policy creation, in days. :type immutability_period_since_creation_in_days: int :ivar state: The ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked. Possible values include: 'Locked', 'Unlocked' :vartype state: str or ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicyState + :param allow_protected_append_writes: This property can only be changed + for unlocked time-based retention policies. When enabled, new blocks can + be written to an append blob while maintaining immutability protection and + compliance. Only new blocks can be added and any existing blocks cannot be + modified or deleted. This property cannot be changed with + ExtendImmutabilityPolicy API + :type allow_protected_append_writes: bool :ivar etag: ImmutabilityPolicy Etag. :vartype etag: str :ivar update_history: The ImmutabilityPolicy update history of the blob @@ -1352,7 +1456,6 @@ class ImmutabilityPolicyProperties(Model): """ _validation = { - 'immutability_period_since_creation_in_days': {'required': True}, 'state': {'readonly': True}, 'etag': {'readonly': True}, 'update_history': {'readonly': True}, @@ -1361,14 +1464,16 @@ class ImmutabilityPolicyProperties(Model): _attribute_map = { 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, 'state': {'key': 'properties.state', 'type': 'str'}, + 'allow_protected_append_writes': {'key': 'properties.allowProtectedAppendWrites', 'type': 'bool'}, 'etag': {'key': 'etag', 'type': 'str'}, 'update_history': {'key': 'updateHistory', 'type': '[UpdateHistoryProperty]'}, } - def __init__(self, *, immutability_period_since_creation_in_days: int, **kwargs) -> None: + def __init__(self, *, immutability_period_since_creation_in_days: int=None, allow_protected_append_writes: bool=None, **kwargs) -> None: super(ImmutabilityPolicyProperties, self).__init__(**kwargs) self.immutability_period_since_creation_in_days = immutability_period_since_creation_in_days self.state = None + self.allow_protected_append_writes = allow_protected_append_writes self.etag = None self.update_history = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/models/_paged_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/models/_paged_models.py index c4ace1805ecc3..2d27addefa8b7 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/models/_paged_models.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/models/_paged_models.py @@ -64,6 +64,19 @@ class UsagePaged(Paged): def __init__(self, *args, **kwargs): super(UsagePaged, self).__init__(*args, **kwargs) +class EncryptionScopePaged(Paged): + """ + A paging container for iterating over a list of :class:`EncryptionScope ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[EncryptionScope]'} + } + + def __init__(self, *args, **kwargs): + + super(EncryptionScopePaged, self).__init__(*args, **kwargs) class BlobServicePropertiesPaged(Paged): """ A paging container for iterating over a list of :class:`BlobServiceProperties ` object diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/models/_storage_management_client_enums.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/models/_storage_management_client_enums.py index de53d1469cacf..19601af72a5ae 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/models/_storage_management_client_enums.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/models/_storage_management_client_enums.py @@ -215,6 +215,18 @@ class SignedResource(str, Enum): s = "s" +class EncryptionScopeSource(str, Enum): + + microsoft_storage = "Microsoft.Storage" + microsoft_key_vault = "Microsoft.KeyVault" + + +class EncryptionScopeState(str, Enum): + + enabled = "Enabled" + disabled = "Disabled" + + class PublicAccess(str, Enum): container = "Container" diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/__init__.py index 5a2ff1e65d658..b7aa936eb73ab 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/__init__.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/__init__.py @@ -16,6 +16,7 @@ from ._management_policies_operations import ManagementPoliciesOperations from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._encryption_scopes_operations import EncryptionScopesOperations from ._blob_services_operations import BlobServicesOperations from ._blob_containers_operations import BlobContainersOperations from ._file_services_operations import FileServicesOperations @@ -29,6 +30,7 @@ 'ManagementPoliciesOperations', 'PrivateEndpointConnectionsOperations', 'PrivateLinkResourcesOperations', + 'EncryptionScopesOperations', 'BlobServicesOperations', 'BlobContainersOperations', 'FileServicesOperations', diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_blob_containers_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_blob_containers_operations.py index 2e21e131e554c..f074275eef8e2 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_blob_containers_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_blob_containers_operations.py @@ -603,7 +603,7 @@ def clear_legal_hold( clear_legal_hold.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/clearLegalHold'} def create_or_update_immutability_policy( - self, resource_group_name, account_name, container_name, immutability_period_since_creation_in_days, if_match=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, account_name, container_name, if_match=None, immutability_period_since_creation_in_days=None, allow_protected_append_writes=None, custom_headers=None, raw=False, **operation_config): """Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation. @@ -620,15 +620,22 @@ def create_or_update_immutability_policy( (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. :type container_name: str - :param immutability_period_since_creation_in_days: The immutability - period for the blobs in the container since the policy creation, in - days. - :type immutability_period_since_creation_in_days: int :param if_match: The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. :type if_match: str + :param immutability_period_since_creation_in_days: The immutability + period for the blobs in the container since the policy creation, in + days. + :type immutability_period_since_creation_in_days: int + :param allow_protected_append_writes: This property can only be + changed for unlocked time-based retention policies. When enabled, new + blocks can be written to an append blob while maintaining immutability + protection and compliance. Only new blocks can be added and any + existing blocks cannot be modified or deleted. This property cannot be + changed with ExtendImmutabilityPolicy API + :type allow_protected_append_writes: bool :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -640,8 +647,8 @@ def create_or_update_immutability_policy( :raises: :class:`CloudError` """ parameters = None - if immutability_period_since_creation_in_days is not None: - parameters = models.ImmutabilityPolicy(immutability_period_since_creation_in_days=immutability_period_since_creation_in_days) + if immutability_period_since_creation_in_days is not None or allow_protected_append_writes is not None: + parameters = models.ImmutabilityPolicy(immutability_period_since_creation_in_days=immutability_period_since_creation_in_days, allow_protected_append_writes=allow_protected_append_writes) # Construct URL url = self.create_or_update_immutability_policy.metadata['url'] @@ -959,7 +966,7 @@ def lock_immutability_policy( lock_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/lock'} def extend_immutability_policy( - self, resource_group_name, account_name, container_name, if_match, immutability_period_since_creation_in_days, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, account_name, container_name, if_match, immutability_period_since_creation_in_days=None, allow_protected_append_writes=None, custom_headers=None, raw=False, **operation_config): """Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked policy will be this action. ETag in If-Match is required for this operation. @@ -986,6 +993,13 @@ def extend_immutability_policy( period for the blobs in the container since the policy creation, in days. :type immutability_period_since_creation_in_days: int + :param allow_protected_append_writes: This property can only be + changed for unlocked time-based retention policies. When enabled, new + blocks can be written to an append blob while maintaining immutability + protection and compliance. Only new blocks can be added and any + existing blocks cannot be modified or deleted. This property cannot be + changed with ExtendImmutabilityPolicy API + :type allow_protected_append_writes: bool :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -997,8 +1011,8 @@ def extend_immutability_policy( :raises: :class:`CloudError` """ parameters = None - if immutability_period_since_creation_in_days is not None: - parameters = models.ImmutabilityPolicy(immutability_period_since_creation_in_days=immutability_period_since_creation_in_days) + if immutability_period_since_creation_in_days is not None or allow_protected_append_writes is not None: + parameters = models.ImmutabilityPolicy(immutability_period_since_creation_in_days=immutability_period_since_creation_in_days, allow_protected_append_writes=allow_protected_append_writes) # Construct URL url = self.extend_immutability_policy.metadata['url'] diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_encryption_scopes_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_encryption_scopes_operations.py new file mode 100644 index 0000000000000..e469ccf7968c1 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_encryption_scopes_operations.py @@ -0,0 +1,348 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class EncryptionScopesOperations(object): + """EncryptionScopesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2019-06-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01" + + self.config = config + + def put( + self, resource_group_name, account_name, encryption_scope_name, encryption_scope, custom_headers=None, raw=False, **operation_config): + """Synchronously creates or updates an encryption scope under the + specified storage account. If an encryption scope is already created + and a subsequent request is issued with different properties, the + encryption scope properties will be updated per the specified request. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param encryption_scope_name: The name of the encryption scope within + the specified storage account. Encryption scope names must be between + 3 and 63 characters in length and use numbers, lower-case letters and + dash (-) only. Every dash (-) character must be immediately preceded + and followed by a letter or number. + :type encryption_scope_name: str + :param encryption_scope: Encryption scope properties to be used for + the create or update. + :type encryption_scope: + ~azure.mgmt.storage.v2019_06_01.models.EncryptionScope + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: EncryptionScope or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_06_01.models.EncryptionScope or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.put.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'encryptionScopeName': self._serialize.url("encryption_scope_name", encryption_scope_name, 'str', max_length=63, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(encryption_scope, 'EncryptionScope') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('EncryptionScope', response) + if response.status_code == 201: + deserialized = self._deserialize('EncryptionScope', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + put.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}'} + + def patch( + self, resource_group_name, account_name, encryption_scope_name, encryption_scope, custom_headers=None, raw=False, **operation_config): + """Update encryption scope properties as specified in the request body. + Update fails if the specified encryption scope does not already exist. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param encryption_scope_name: The name of the encryption scope within + the specified storage account. Encryption scope names must be between + 3 and 63 characters in length and use numbers, lower-case letters and + dash (-) only. Every dash (-) character must be immediately preceded + and followed by a letter or number. + :type encryption_scope_name: str + :param encryption_scope: Encryption scope properties to be used for + the update. + :type encryption_scope: + ~azure.mgmt.storage.v2019_06_01.models.EncryptionScope + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: EncryptionScope or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_06_01.models.EncryptionScope or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.patch.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'encryptionScopeName': self._serialize.url("encryption_scope_name", encryption_scope_name, 'str', max_length=63, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(encryption_scope, 'EncryptionScope') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('EncryptionScope', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + patch.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}'} + + def get( + self, resource_group_name, account_name, encryption_scope_name, custom_headers=None, raw=False, **operation_config): + """Returns the properties for the specified encryption scope. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param encryption_scope_name: The name of the encryption scope within + the specified storage account. Encryption scope names must be between + 3 and 63 characters in length and use numbers, lower-case letters and + dash (-) only. Every dash (-) character must be immediately preceded + and followed by a letter or number. + :type encryption_scope_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: EncryptionScope or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_06_01.models.EncryptionScope or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'encryptionScopeName': self._serialize.url("encryption_scope_name", encryption_scope_name, 'str', max_length=63, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('EncryptionScope', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}'} + + def list( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Lists all the encryption scopes available under the specified storage + account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of EncryptionScope + :rtype: + ~azure.mgmt.storage.v2019_06_01.models.EncryptionScopePaged[~azure.mgmt.storage.v2019_06_01.models.EncryptionScope] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.EncryptionScopePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes'}