From 582085ed15686df3778252031aff1ad80ed418e4 Mon Sep 17 00:00:00 2001 From: tasherif-msft <69483382+tasherif-msft@users.noreply.github.com> Date: Wed, 21 Apr 2021 18:12:33 -0700 Subject: [PATCH] Privated hierarchy traversal and fixed encryption algorithm (#18212) * Privated hierarchy traversal * fixed encryption algo * updated changelog --- sdk/storage/azure-storage-blob/CHANGELOG.md | 4 +- .../azure/storage/blob/_blob_client.py | 2 +- .../azure/storage/blob/_container_client.py | 2 +- .../aio/operations/_append_blob_operations.py | 33 ++++------- .../aio/operations/_blob_operations.py | 55 +++++++------------ .../aio/operations/_block_blob_operations.py | 55 +++++++------------ .../aio/operations/_page_blob_operations.py | 55 +++++++------------ .../blob/_generated/models/__init__.py | 2 + .../models/_azure_blob_storage_enums.py | 5 ++ .../storage/blob/_generated/models/_models.py | 6 ++ .../blob/_generated/models/_models_py3.py | 7 +++ .../operations/_append_blob_operations.py | 33 ++++------- .../_generated/operations/_blob_operations.py | 55 +++++++------------ .../operations/_block_blob_operations.py | 55 +++++++------------ .../operations/_page_blob_operations.py | 55 +++++++------------ .../storage/blob/aio/_blob_client_async.py | 2 +- .../blob/aio/_container_client_async.py | 2 +- .../samples/blob_samples_containers.py | 2 +- .../samples/blob_samples_containers_async.py | 2 +- .../samples/blob_samples_service.py | 2 +- .../samples/blob_samples_service_async.py | 2 +- .../azure-storage-blob/swagger/README.md | 13 +++++ .../tests/test_blob_access_conditions.py | 4 +- .../test_blob_access_conditions_async.py | 4 +- 24 files changed, 190 insertions(+), 267 deletions(-) diff --git a/sdk/storage/azure-storage-blob/CHANGELOG.md b/sdk/storage/azure-storage-blob/CHANGELOG.md index 85c32115f890..37bcb49eb308 100644 --- a/sdk/storage/azure-storage-blob/CHANGELOG.md +++ b/sdk/storage/azure-storage-blob/CHANGELOG.md @@ -1,9 +1,6 @@ # Release History ## 12.8.1 (2021-04-20) -**New Features** -- Added support for `BlobClient -> ContainerClient -> BlobServiceClient` Traversal - **Fixes** - Fixed retry on large block upload - Make `AccountName`, `AccountKey` etc. in conn_str case insensitive @@ -14,6 +11,7 @@ - Fixed retries for blob download streams (#18164, #17974, #10572 (comment)) - Added chunk streaming docstrings and samples (#17149, #11009) - Added retry for blob download (#17974, #10572) +- Fixed encryption algorithm hardcoded setting (#17835) ## 12.8.0 (2021-03-01) diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_blob_client.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_blob_client.py index 02ef9774bfce..e82c04f7bd8f 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_blob_client.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_blob_client.py @@ -3754,7 +3754,7 @@ def seal_append_blob(self, **kwargs): process_storage_error(error) @distributed_trace - def get_container_client(self): # pylint: disable=client-method-missing-kwargs + def _get_container_client(self): # pylint: disable=client-method-missing-kwargs # type: (...) -> ContainerClient """Get a client to interact with the blob's parent container. diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_container_client.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_container_client.py index cc23568b0b1b..d2caf7a5a8e5 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_container_client.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_container_client.py @@ -584,7 +584,7 @@ def set_container_metadata( # type: ignore process_storage_error(error) @distributed_trace - def get_blob_service_client(self): # pylint: disable=client-method-missing-kwargs + def _get_blob_service_client(self): # pylint: disable=client-method-missing-kwargs # type: (...) -> BlobServiceClient """Get a client to interact with the container's parent service account. diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations/_append_blob_operations.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations/_append_blob_operations.py index 333cb9f0e5aa..934b7207a81f 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations/_append_blob_operations.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations/_append_blob_operations.py @@ -45,7 +45,6 @@ async def create( content_length: int, timeout: Optional[int] = None, metadata: Optional[str] = None, - encryption_algorithm: Optional[str] = "AES256", request_id_parameter: Optional[str] = None, blob_tags_string: Optional[str] = None, blob_http_headers: Optional["_models.BlobHTTPHeaders"] = None, @@ -71,10 +70,6 @@ async def create( rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information. :type metadata: str - :param encryption_algorithm: The algorithm used to produce the encryption key hash. Currently, - the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is - provided. - :type encryption_algorithm: str :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id_parameter: str @@ -110,6 +105,7 @@ async def create( _blob_content_disposition = None _encryption_key = None _encryption_key_sha256 = None + _encryption_algorithm = None _encryption_scope = None _if_modified_since = None _if_unmodified_since = None @@ -126,6 +122,7 @@ async def create( if cpk_info is not None: _encryption_key = cpk_info.encryption_key _encryption_key_sha256 = cpk_info.encryption_key_sha256 + _encryption_algorithm = cpk_info.encryption_algorithm if cpk_scope_info is not None: _encryption_scope = cpk_scope_info.encryption_scope if lease_access_conditions is not None: @@ -175,8 +172,8 @@ async def create( header_parameters['x-ms-encryption-key'] = self._serialize.header("encryption_key", _encryption_key, 'str') if _encryption_key_sha256 is not None: header_parameters['x-ms-encryption-key-sha256'] = self._serialize.header("encryption_key_sha256", _encryption_key_sha256, 'str') - if encryption_algorithm is not None: - header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", encryption_algorithm, 'str') + if _encryption_algorithm is not None: + header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", _encryption_algorithm, 'str') if _encryption_scope is not None: header_parameters['x-ms-encryption-scope'] = self._serialize.header("encryption_scope", _encryption_scope, 'str') if _if_modified_since is not None: @@ -230,7 +227,6 @@ async def append_block( timeout: Optional[int] = None, transactional_content_md5: Optional[bytearray] = None, transactional_content_crc64: Optional[bytearray] = None, - encryption_algorithm: Optional[str] = "AES256", request_id_parameter: Optional[str] = None, lease_access_conditions: Optional["_models.LeaseAccessConditions"] = None, append_position_access_conditions: Optional["_models.AppendPositionAccessConditions"] = None, @@ -257,10 +253,6 @@ async def append_block( :param transactional_content_crc64: Specify the transactional crc64 for the body, to be validated by the service. :type transactional_content_crc64: bytearray - :param encryption_algorithm: The algorithm used to produce the encryption key hash. Currently, - the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is - provided. - :type encryption_algorithm: str :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id_parameter: str @@ -290,6 +282,7 @@ async def append_block( _append_position = None _encryption_key = None _encryption_key_sha256 = None + _encryption_algorithm = None _encryption_scope = None _if_modified_since = None _if_unmodified_since = None @@ -302,6 +295,7 @@ async def append_block( if cpk_info is not None: _encryption_key = cpk_info.encryption_key _encryption_key_sha256 = cpk_info.encryption_key_sha256 + _encryption_algorithm = cpk_info.encryption_algorithm if cpk_scope_info is not None: _encryption_scope = cpk_scope_info.encryption_scope if lease_access_conditions is not None: @@ -346,8 +340,8 @@ async def append_block( header_parameters['x-ms-encryption-key'] = self._serialize.header("encryption_key", _encryption_key, 'str') if _encryption_key_sha256 is not None: header_parameters['x-ms-encryption-key-sha256'] = self._serialize.header("encryption_key_sha256", _encryption_key_sha256, 'str') - if encryption_algorithm is not None: - header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", encryption_algorithm, 'str') + if _encryption_algorithm is not None: + header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", _encryption_algorithm, 'str') if _encryption_scope is not None: header_parameters['x-ms-encryption-scope'] = self._serialize.header("encryption_scope", _encryption_scope, 'str') if _if_modified_since is not None: @@ -406,7 +400,6 @@ async def append_block_from_url( source_contentcrc64: Optional[bytearray] = None, timeout: Optional[int] = None, transactional_content_md5: Optional[bytearray] = None, - encryption_algorithm: Optional[str] = "AES256", request_id_parameter: Optional[str] = None, cpk_info: Optional["_models.CpkInfo"] = None, cpk_scope_info: Optional["_models.CpkScopeInfo"] = None, @@ -440,10 +433,6 @@ async def append_block_from_url( :param transactional_content_md5: Specify the transactional md5 for the body, to be validated by the service. :type transactional_content_md5: bytearray - :param encryption_algorithm: The algorithm used to produce the encryption key hash. Currently, - the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is - provided. - :type encryption_algorithm: str :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id_parameter: str @@ -472,6 +461,7 @@ async def append_block_from_url( _encryption_key = None _encryption_key_sha256 = None + _encryption_algorithm = None _encryption_scope = None _lease_id = None _max_size = None @@ -491,6 +481,7 @@ async def append_block_from_url( if cpk_info is not None: _encryption_key = cpk_info.encryption_key _encryption_key_sha256 = cpk_info.encryption_key_sha256 + _encryption_algorithm = cpk_info.encryption_algorithm if cpk_scope_info is not None: _encryption_scope = cpk_scope_info.encryption_scope if lease_access_conditions is not None: @@ -538,8 +529,8 @@ async def append_block_from_url( header_parameters['x-ms-encryption-key'] = self._serialize.header("encryption_key", _encryption_key, 'str') if _encryption_key_sha256 is not None: header_parameters['x-ms-encryption-key-sha256'] = self._serialize.header("encryption_key_sha256", _encryption_key_sha256, 'str') - if encryption_algorithm is not None: - header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", encryption_algorithm, 'str') + if _encryption_algorithm is not None: + header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", _encryption_algorithm, 'str') if _encryption_scope is not None: header_parameters['x-ms-encryption-scope'] = self._serialize.header("encryption_scope", _encryption_scope, 'str') if _lease_id is not None: diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations/_blob_operations.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations/_blob_operations.py index af2d12e92779..0f296df8c98c 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations/_blob_operations.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations/_blob_operations.py @@ -48,7 +48,6 @@ async def download( range: Optional[str] = None, range_get_content_md5: Optional[bool] = None, range_get_content_crc64: Optional[bool] = None, - encryption_algorithm: Optional[str] = "AES256", request_id_parameter: Optional[str] = None, lease_access_conditions: Optional["_models.LeaseAccessConditions"] = None, cpk_info: Optional["_models.CpkInfo"] = None, @@ -81,10 +80,6 @@ async def download( service returns the CRC64 hash for the range, as long as the range is less than or equal to 4 MB in size. :type range_get_content_crc64: bool - :param encryption_algorithm: The algorithm used to produce the encryption key hash. Currently, - the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is - provided. - :type encryption_algorithm: str :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id_parameter: str @@ -108,6 +103,7 @@ async def download( _lease_id = None _encryption_key = None _encryption_key_sha256 = None + _encryption_algorithm = None _if_modified_since = None _if_unmodified_since = None _if_match = None @@ -116,6 +112,7 @@ async def download( if cpk_info is not None: _encryption_key = cpk_info.encryption_key _encryption_key_sha256 = cpk_info.encryption_key_sha256 + _encryption_algorithm = cpk_info.encryption_algorithm if lease_access_conditions is not None: _lease_id = lease_access_conditions.lease_id if modified_access_conditions is not None: @@ -156,8 +153,8 @@ async def download( header_parameters['x-ms-encryption-key'] = self._serialize.header("encryption_key", _encryption_key, 'str') if _encryption_key_sha256 is not None: header_parameters['x-ms-encryption-key-sha256'] = self._serialize.header("encryption_key_sha256", _encryption_key_sha256, 'str') - if encryption_algorithm is not None: - header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", encryption_algorithm, 'str') + if _encryption_algorithm is not None: + header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", _encryption_algorithm, 'str') if _if_modified_since is not None: header_parameters['If-Modified-Since'] = self._serialize.header("if_modified_since", _if_modified_since, 'rfc-1123') if _if_unmodified_since is not None: @@ -279,7 +276,6 @@ async def get_properties( snapshot: Optional[str] = None, version_id: Optional[str] = None, timeout: Optional[int] = None, - encryption_algorithm: Optional[str] = "AES256", request_id_parameter: Optional[str] = None, lease_access_conditions: Optional["_models.LeaseAccessConditions"] = None, cpk_info: Optional["_models.CpkInfo"] = None, @@ -302,10 +298,6 @@ async def get_properties( :code:`Setting Timeouts for Blob Service Operations.`. :type timeout: int - :param encryption_algorithm: The algorithm used to produce the encryption key hash. Currently, - the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is - provided. - :type encryption_algorithm: str :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id_parameter: str @@ -329,6 +321,7 @@ async def get_properties( _lease_id = None _encryption_key = None _encryption_key_sha256 = None + _encryption_algorithm = None _if_modified_since = None _if_unmodified_since = None _if_match = None @@ -337,6 +330,7 @@ async def get_properties( if cpk_info is not None: _encryption_key = cpk_info.encryption_key _encryption_key_sha256 = cpk_info.encryption_key_sha256 + _encryption_algorithm = cpk_info.encryption_algorithm if lease_access_conditions is not None: _lease_id = lease_access_conditions.lease_id if modified_access_conditions is not None: @@ -371,8 +365,8 @@ async def get_properties( header_parameters['x-ms-encryption-key'] = self._serialize.header("encryption_key", _encryption_key, 'str') if _encryption_key_sha256 is not None: header_parameters['x-ms-encryption-key-sha256'] = self._serialize.header("encryption_key_sha256", _encryption_key_sha256, 'str') - if encryption_algorithm is not None: - header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", encryption_algorithm, 'str') + if _encryption_algorithm is not None: + header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", _encryption_algorithm, 'str') if _if_modified_since is not None: header_parameters['If-Modified-Since'] = self._serialize.header("if_modified_since", _if_modified_since, 'rfc-1123') if _if_unmodified_since is not None: @@ -1295,7 +1289,6 @@ async def set_metadata( self, timeout: Optional[int] = None, metadata: Optional[str] = None, - encryption_algorithm: Optional[str] = "AES256", request_id_parameter: Optional[str] = None, lease_access_conditions: Optional["_models.LeaseAccessConditions"] = None, cpk_info: Optional["_models.CpkInfo"] = None, @@ -1318,10 +1311,6 @@ async def set_metadata( rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information. :type metadata: str - :param encryption_algorithm: The algorithm used to produce the encryption key hash. Currently, - the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is - provided. - :type encryption_algorithm: str :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id_parameter: str @@ -1347,6 +1336,7 @@ async def set_metadata( _lease_id = None _encryption_key = None _encryption_key_sha256 = None + _encryption_algorithm = None _encryption_scope = None _if_modified_since = None _if_unmodified_since = None @@ -1356,6 +1346,7 @@ async def set_metadata( if cpk_info is not None: _encryption_key = cpk_info.encryption_key _encryption_key_sha256 = cpk_info.encryption_key_sha256 + _encryption_algorithm = cpk_info.encryption_algorithm if cpk_scope_info is not None: _encryption_scope = cpk_scope_info.encryption_scope if lease_access_conditions is not None: @@ -1392,8 +1383,8 @@ async def set_metadata( header_parameters['x-ms-encryption-key'] = self._serialize.header("encryption_key", _encryption_key, 'str') if _encryption_key_sha256 is not None: header_parameters['x-ms-encryption-key-sha256'] = self._serialize.header("encryption_key_sha256", _encryption_key_sha256, 'str') - if encryption_algorithm is not None: - header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", encryption_algorithm, 'str') + if _encryption_algorithm is not None: + header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", _encryption_algorithm, 'str') if _encryption_scope is not None: header_parameters['x-ms-encryption-scope'] = self._serialize.header("encryption_scope", _encryption_scope, 'str') if _if_modified_since is not None: @@ -1978,7 +1969,6 @@ async def create_snapshot( self, timeout: Optional[int] = None, metadata: Optional[str] = None, - encryption_algorithm: Optional[str] = "AES256", request_id_parameter: Optional[str] = None, cpk_info: Optional["_models.CpkInfo"] = None, cpk_scope_info: Optional["_models.CpkScopeInfo"] = None, @@ -2000,10 +1990,6 @@ async def create_snapshot( rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information. :type metadata: str - :param encryption_algorithm: The algorithm used to produce the encryption key hash. Currently, - the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is - provided. - :type encryption_algorithm: str :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id_parameter: str @@ -2028,6 +2014,7 @@ async def create_snapshot( _encryption_key = None _encryption_key_sha256 = None + _encryption_algorithm = None _encryption_scope = None _if_modified_since = None _if_unmodified_since = None @@ -2038,6 +2025,7 @@ async def create_snapshot( if cpk_info is not None: _encryption_key = cpk_info.encryption_key _encryption_key_sha256 = cpk_info.encryption_key_sha256 + _encryption_algorithm = cpk_info.encryption_algorithm if cpk_scope_info is not None: _encryption_scope = cpk_scope_info.encryption_scope if lease_access_conditions is not None: @@ -2072,8 +2060,8 @@ async def create_snapshot( header_parameters['x-ms-encryption-key'] = self._serialize.header("encryption_key", _encryption_key, 'str') if _encryption_key_sha256 is not None: header_parameters['x-ms-encryption-key-sha256'] = self._serialize.header("encryption_key_sha256", _encryption_key_sha256, 'str') - if encryption_algorithm is not None: - header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", encryption_algorithm, 'str') + if _encryption_algorithm is not None: + header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", _encryption_algorithm, 'str') if _encryption_scope is not None: header_parameters['x-ms-encryption-scope'] = self._serialize.header("encryption_scope", _encryption_scope, 'str') if _if_modified_since is not None: @@ -2716,7 +2704,6 @@ async def query( self, snapshot: Optional[str] = None, timeout: Optional[int] = None, - encryption_algorithm: Optional[str] = "AES256", request_id_parameter: Optional[str] = None, query_request: Optional["_models.QueryRequest"] = None, lease_access_conditions: Optional["_models.LeaseAccessConditions"] = None, @@ -2737,10 +2724,6 @@ async def query( :code:`Setting Timeouts for Blob Service Operations.`. :type timeout: int - :param encryption_algorithm: The algorithm used to produce the encryption key hash. Currently, - the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is - provided. - :type encryption_algorithm: str :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id_parameter: str @@ -2766,6 +2749,7 @@ async def query( _lease_id = None _encryption_key = None _encryption_key_sha256 = None + _encryption_algorithm = None _if_modified_since = None _if_unmodified_since = None _if_match = None @@ -2774,6 +2758,7 @@ async def query( if cpk_info is not None: _encryption_key = cpk_info.encryption_key _encryption_key_sha256 = cpk_info.encryption_key_sha256 + _encryption_algorithm = cpk_info.encryption_algorithm if lease_access_conditions is not None: _lease_id = lease_access_conditions.lease_id if modified_access_conditions is not None: @@ -2809,8 +2794,8 @@ async def query( header_parameters['x-ms-encryption-key'] = self._serialize.header("encryption_key", _encryption_key, 'str') if _encryption_key_sha256 is not None: header_parameters['x-ms-encryption-key-sha256'] = self._serialize.header("encryption_key_sha256", _encryption_key_sha256, 'str') - if encryption_algorithm is not None: - header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", encryption_algorithm, 'str') + if _encryption_algorithm is not None: + header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", _encryption_algorithm, 'str') if _if_modified_since is not None: header_parameters['If-Modified-Since'] = self._serialize.header("if_modified_since", _if_modified_since, 'rfc-1123') if _if_unmodified_since is not None: diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations/_block_blob_operations.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations/_block_blob_operations.py index 67c90b0bf9d4..e90eacd48c9e 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations/_block_blob_operations.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations/_block_blob_operations.py @@ -47,7 +47,6 @@ async def upload( timeout: Optional[int] = None, transactional_content_md5: Optional[bytearray] = None, metadata: Optional[str] = None, - encryption_algorithm: Optional[str] = "AES256", tier: Optional[Union[str, "_models.AccessTierOptional"]] = None, request_id_parameter: Optional[str] = None, blob_tags_string: Optional[str] = None, @@ -83,10 +82,6 @@ async def upload( rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information. :type metadata: str - :param encryption_algorithm: The algorithm used to produce the encryption key hash. Currently, - the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is - provided. - :type encryption_algorithm: str :param tier: Optional. Indicates the tier to be set on the blob. :type tier: str or ~azure.storage.blob.models.AccessTierOptional :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character @@ -124,6 +119,7 @@ async def upload( _blob_content_disposition = None _encryption_key = None _encryption_key_sha256 = None + _encryption_algorithm = None _encryption_scope = None _if_modified_since = None _if_unmodified_since = None @@ -140,6 +136,7 @@ async def upload( if cpk_info is not None: _encryption_key = cpk_info.encryption_key _encryption_key_sha256 = cpk_info.encryption_key_sha256 + _encryption_algorithm = cpk_info.encryption_algorithm if cpk_scope_info is not None: _encryption_scope = cpk_scope_info.encryption_scope if lease_access_conditions is not None: @@ -192,8 +189,8 @@ async def upload( header_parameters['x-ms-encryption-key'] = self._serialize.header("encryption_key", _encryption_key, 'str') if _encryption_key_sha256 is not None: header_parameters['x-ms-encryption-key-sha256'] = self._serialize.header("encryption_key_sha256", _encryption_key_sha256, 'str') - if encryption_algorithm is not None: - header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", encryption_algorithm, 'str') + if _encryption_algorithm is not None: + header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", _encryption_algorithm, 'str') if _encryption_scope is not None: header_parameters['x-ms-encryption-scope'] = self._serialize.header("encryption_scope", _encryption_scope, 'str') if tier is not None: @@ -252,7 +249,6 @@ async def put_blob_from_url( timeout: Optional[int] = None, transactional_content_md5: Optional[bytearray] = None, metadata: Optional[str] = None, - encryption_algorithm: Optional[str] = "AES256", tier: Optional[Union[str, "_models.AccessTierOptional"]] = None, request_id_parameter: Optional[str] = None, source_content_md5: Optional[bytearray] = None, @@ -294,10 +290,6 @@ async def put_blob_from_url( rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information. :type metadata: str - :param encryption_algorithm: The algorithm used to produce the encryption key hash. Currently, - the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is - provided. - :type encryption_algorithm: str :param tier: Optional. Indicates the tier to be set on the blob. :type tier: str or ~azure.storage.blob.models.AccessTierOptional :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character @@ -343,6 +335,7 @@ async def put_blob_from_url( _blob_content_disposition = None _encryption_key = None _encryption_key_sha256 = None + _encryption_algorithm = None _encryption_scope = None _if_modified_since = None _if_unmodified_since = None @@ -364,6 +357,7 @@ async def put_blob_from_url( if cpk_info is not None: _encryption_key = cpk_info.encryption_key _encryption_key_sha256 = cpk_info.encryption_key_sha256 + _encryption_algorithm = cpk_info.encryption_algorithm if cpk_scope_info is not None: _encryption_scope = cpk_scope_info.encryption_scope if lease_access_conditions is not None: @@ -421,8 +415,8 @@ async def put_blob_from_url( header_parameters['x-ms-encryption-key'] = self._serialize.header("encryption_key", _encryption_key, 'str') if _encryption_key_sha256 is not None: header_parameters['x-ms-encryption-key-sha256'] = self._serialize.header("encryption_key_sha256", _encryption_key_sha256, 'str') - if encryption_algorithm is not None: - header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", encryption_algorithm, 'str') + if _encryption_algorithm is not None: + header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", _encryption_algorithm, 'str') if _encryption_scope is not None: header_parameters['x-ms-encryption-scope'] = self._serialize.header("encryption_scope", _encryption_scope, 'str') if tier is not None: @@ -494,7 +488,6 @@ async def stage_block( transactional_content_md5: Optional[bytearray] = None, transactional_content_crc64: Optional[bytearray] = None, timeout: Optional[int] = None, - encryption_algorithm: Optional[str] = "AES256", request_id_parameter: Optional[str] = None, lease_access_conditions: Optional["_models.LeaseAccessConditions"] = None, cpk_info: Optional["_models.CpkInfo"] = None, @@ -521,10 +514,6 @@ async def stage_block( :code:`Setting Timeouts for Blob Service Operations.`. :type timeout: int - :param encryption_algorithm: The algorithm used to produce the encryption key hash. Currently, - the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is - provided. - :type encryption_algorithm: str :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id_parameter: str @@ -548,10 +537,12 @@ async def stage_block( _lease_id = None _encryption_key = None _encryption_key_sha256 = None + _encryption_algorithm = None _encryption_scope = None if cpk_info is not None: _encryption_key = cpk_info.encryption_key _encryption_key_sha256 = cpk_info.encryption_key_sha256 + _encryption_algorithm = cpk_info.encryption_algorithm if cpk_scope_info is not None: _encryption_scope = cpk_scope_info.encryption_scope if lease_access_conditions is not None: @@ -587,8 +578,8 @@ async def stage_block( header_parameters['x-ms-encryption-key'] = self._serialize.header("encryption_key", _encryption_key, 'str') if _encryption_key_sha256 is not None: header_parameters['x-ms-encryption-key-sha256'] = self._serialize.header("encryption_key_sha256", _encryption_key_sha256, 'str') - if encryption_algorithm is not None: - header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", encryption_algorithm, 'str') + if _encryption_algorithm is not None: + header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", _encryption_algorithm, 'str') if _encryption_scope is not None: header_parameters['x-ms-encryption-scope'] = self._serialize.header("encryption_scope", _encryption_scope, 'str') header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') @@ -633,7 +624,6 @@ async def stage_block_from_url( source_content_md5: Optional[bytearray] = None, source_contentcrc64: Optional[bytearray] = None, timeout: Optional[int] = None, - encryption_algorithm: Optional[str] = "AES256", request_id_parameter: Optional[str] = None, cpk_info: Optional["_models.CpkInfo"] = None, cpk_scope_info: Optional["_models.CpkScopeInfo"] = None, @@ -664,10 +654,6 @@ async def stage_block_from_url( :code:`Setting Timeouts for Blob Service Operations.`. :type timeout: int - :param encryption_algorithm: The algorithm used to produce the encryption key hash. Currently, - the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is - provided. - :type encryption_algorithm: str :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id_parameter: str @@ -692,6 +678,7 @@ async def stage_block_from_url( _encryption_key = None _encryption_key_sha256 = None + _encryption_algorithm = None _encryption_scope = None _lease_id = None _source_if_modified_since = None @@ -701,6 +688,7 @@ async def stage_block_from_url( if cpk_info is not None: _encryption_key = cpk_info.encryption_key _encryption_key_sha256 = cpk_info.encryption_key_sha256 + _encryption_algorithm = cpk_info.encryption_algorithm if cpk_scope_info is not None: _encryption_scope = cpk_scope_info.encryption_scope if lease_access_conditions is not None: @@ -741,8 +729,8 @@ async def stage_block_from_url( header_parameters['x-ms-encryption-key'] = self._serialize.header("encryption_key", _encryption_key, 'str') if _encryption_key_sha256 is not None: header_parameters['x-ms-encryption-key-sha256'] = self._serialize.header("encryption_key_sha256", _encryption_key_sha256, 'str') - if encryption_algorithm is not None: - header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", encryption_algorithm, 'str') + if _encryption_algorithm is not None: + header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", _encryption_algorithm, 'str') if _encryption_scope is not None: header_parameters['x-ms-encryption-scope'] = self._serialize.header("encryption_scope", _encryption_scope, 'str') if _lease_id is not None: @@ -792,7 +780,6 @@ async def commit_block_list( transactional_content_md5: Optional[bytearray] = None, transactional_content_crc64: Optional[bytearray] = None, metadata: Optional[str] = None, - encryption_algorithm: Optional[str] = "AES256", tier: Optional[Union[str, "_models.AccessTierOptional"]] = None, request_id_parameter: Optional[str] = None, blob_tags_string: Optional[str] = None, @@ -831,10 +818,6 @@ async def commit_block_list( rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information. :type metadata: str - :param encryption_algorithm: The algorithm used to produce the encryption key hash. Currently, - the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is - provided. - :type encryption_algorithm: str :param tier: Optional. Indicates the tier to be set on the blob. :type tier: str or ~azure.storage.blob.models.AccessTierOptional :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character @@ -872,6 +855,7 @@ async def commit_block_list( _blob_content_disposition = None _encryption_key = None _encryption_key_sha256 = None + _encryption_algorithm = None _encryption_scope = None _if_modified_since = None _if_unmodified_since = None @@ -888,6 +872,7 @@ async def commit_block_list( if cpk_info is not None: _encryption_key = cpk_info.encryption_key _encryption_key_sha256 = cpk_info.encryption_key_sha256 + _encryption_algorithm = cpk_info.encryption_algorithm if cpk_scope_info is not None: _encryption_scope = cpk_scope_info.encryption_scope if lease_access_conditions is not None: @@ -941,8 +926,8 @@ async def commit_block_list( header_parameters['x-ms-encryption-key'] = self._serialize.header("encryption_key", _encryption_key, 'str') if _encryption_key_sha256 is not None: header_parameters['x-ms-encryption-key-sha256'] = self._serialize.header("encryption_key_sha256", _encryption_key_sha256, 'str') - if encryption_algorithm is not None: - header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", encryption_algorithm, 'str') + if _encryption_algorithm is not None: + header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", _encryption_algorithm, 'str') if _encryption_scope is not None: header_parameters['x-ms-encryption-scope'] = self._serialize.header("encryption_scope", _encryption_scope, 'str') if tier is not None: diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations/_page_blob_operations.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations/_page_blob_operations.py index 100f730254ed..da920b5fdc67 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations/_page_blob_operations.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations/_page_blob_operations.py @@ -47,7 +47,6 @@ async def create( timeout: Optional[int] = None, tier: Optional[Union[str, "_models.PremiumPageBlobAccessTier"]] = None, metadata: Optional[str] = None, - encryption_algorithm: Optional[str] = "AES256", blob_sequence_number: Optional[int] = 0, request_id_parameter: Optional[str] = None, blob_tags_string: Optional[str] = None, @@ -79,10 +78,6 @@ async def create( rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information. :type metadata: str - :param encryption_algorithm: The algorithm used to produce the encryption key hash. Currently, - the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is - provided. - :type encryption_algorithm: str :param blob_sequence_number: Set for page blobs only. The sequence number is a user-controlled value that you can use to track requests. The value of the sequence number must be between 0 and 2^63 - 1. @@ -122,6 +117,7 @@ async def create( _blob_content_disposition = None _encryption_key = None _encryption_key_sha256 = None + _encryption_algorithm = None _encryption_scope = None _if_modified_since = None _if_unmodified_since = None @@ -138,6 +134,7 @@ async def create( if cpk_info is not None: _encryption_key = cpk_info.encryption_key _encryption_key_sha256 = cpk_info.encryption_key_sha256 + _encryption_algorithm = cpk_info.encryption_algorithm if cpk_scope_info is not None: _encryption_scope = cpk_scope_info.encryption_scope if lease_access_conditions is not None: @@ -189,8 +186,8 @@ async def create( header_parameters['x-ms-encryption-key'] = self._serialize.header("encryption_key", _encryption_key, 'str') if _encryption_key_sha256 is not None: header_parameters['x-ms-encryption-key-sha256'] = self._serialize.header("encryption_key_sha256", _encryption_key_sha256, 'str') - if encryption_algorithm is not None: - header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", encryption_algorithm, 'str') + if _encryption_algorithm is not None: + header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", _encryption_algorithm, 'str') if _encryption_scope is not None: header_parameters['x-ms-encryption-scope'] = self._serialize.header("encryption_scope", _encryption_scope, 'str') if _if_modified_since is not None: @@ -248,7 +245,6 @@ async def upload_pages( transactional_content_crc64: Optional[bytearray] = None, timeout: Optional[int] = None, range: Optional[str] = None, - encryption_algorithm: Optional[str] = "AES256", request_id_parameter: Optional[str] = None, lease_access_conditions: Optional["_models.LeaseAccessConditions"] = None, cpk_info: Optional["_models.CpkInfo"] = None, @@ -275,10 +271,6 @@ async def upload_pages( :type timeout: int :param range: Return only the bytes of the blob in the specified range. :type range: str - :param encryption_algorithm: The algorithm used to produce the encryption key hash. Currently, - the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is - provided. - :type encryption_algorithm: str :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id_parameter: str @@ -306,6 +298,7 @@ async def upload_pages( _lease_id = None _encryption_key = None _encryption_key_sha256 = None + _encryption_algorithm = None _encryption_scope = None _if_sequence_number_less_than_or_equal_to = None _if_sequence_number_less_than = None @@ -318,6 +311,7 @@ async def upload_pages( if cpk_info is not None: _encryption_key = cpk_info.encryption_key _encryption_key_sha256 = cpk_info.encryption_key_sha256 + _encryption_algorithm = cpk_info.encryption_algorithm if cpk_scope_info is not None: _encryption_scope = cpk_scope_info.encryption_scope if lease_access_conditions is not None: @@ -366,8 +360,8 @@ async def upload_pages( header_parameters['x-ms-encryption-key'] = self._serialize.header("encryption_key", _encryption_key, 'str') if _encryption_key_sha256 is not None: header_parameters['x-ms-encryption-key-sha256'] = self._serialize.header("encryption_key_sha256", _encryption_key_sha256, 'str') - if encryption_algorithm is not None: - header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", encryption_algorithm, 'str') + if _encryption_algorithm is not None: + header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", _encryption_algorithm, 'str') if _encryption_scope is not None: header_parameters['x-ms-encryption-scope'] = self._serialize.header("encryption_scope", _encryption_scope, 'str') if _if_sequence_number_less_than_or_equal_to is not None: @@ -427,7 +421,6 @@ async def clear_pages( content_length: int, timeout: Optional[int] = None, range: Optional[str] = None, - encryption_algorithm: Optional[str] = "AES256", request_id_parameter: Optional[str] = None, lease_access_conditions: Optional["_models.LeaseAccessConditions"] = None, cpk_info: Optional["_models.CpkInfo"] = None, @@ -446,10 +439,6 @@ async def clear_pages( :type timeout: int :param range: Return only the bytes of the blob in the specified range. :type range: str - :param encryption_algorithm: The algorithm used to produce the encryption key hash. Currently, - the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is - provided. - :type encryption_algorithm: str :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id_parameter: str @@ -477,6 +466,7 @@ async def clear_pages( _lease_id = None _encryption_key = None _encryption_key_sha256 = None + _encryption_algorithm = None _encryption_scope = None _if_sequence_number_less_than_or_equal_to = None _if_sequence_number_less_than = None @@ -489,6 +479,7 @@ async def clear_pages( if cpk_info is not None: _encryption_key = cpk_info.encryption_key _encryption_key_sha256 = cpk_info.encryption_key_sha256 + _encryption_algorithm = cpk_info.encryption_algorithm if cpk_scope_info is not None: _encryption_scope = cpk_scope_info.encryption_scope if lease_access_conditions is not None: @@ -532,8 +523,8 @@ async def clear_pages( header_parameters['x-ms-encryption-key'] = self._serialize.header("encryption_key", _encryption_key, 'str') if _encryption_key_sha256 is not None: header_parameters['x-ms-encryption-key-sha256'] = self._serialize.header("encryption_key_sha256", _encryption_key_sha256, 'str') - if encryption_algorithm is not None: - header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", encryption_algorithm, 'str') + if _encryption_algorithm is not None: + header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", _encryption_algorithm, 'str') if _encryption_scope is not None: header_parameters['x-ms-encryption-scope'] = self._serialize.header("encryption_scope", _encryption_scope, 'str') if _if_sequence_number_less_than_or_equal_to is not None: @@ -591,7 +582,6 @@ async def upload_pages_from_url( source_content_md5: Optional[bytearray] = None, source_contentcrc64: Optional[bytearray] = None, timeout: Optional[int] = None, - encryption_algorithm: Optional[str] = "AES256", request_id_parameter: Optional[str] = None, cpk_info: Optional["_models.CpkInfo"] = None, cpk_scope_info: Optional["_models.CpkScopeInfo"] = None, @@ -624,10 +614,6 @@ async def upload_pages_from_url( :code:`Setting Timeouts for Blob Service Operations.`. :type timeout: int - :param encryption_algorithm: The algorithm used to produce the encryption key hash. Currently, - the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is - provided. - :type encryption_algorithm: str :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id_parameter: str @@ -656,6 +642,7 @@ async def upload_pages_from_url( _encryption_key = None _encryption_key_sha256 = None + _encryption_algorithm = None _encryption_scope = None _lease_id = None _if_sequence_number_less_than_or_equal_to = None @@ -673,6 +660,7 @@ async def upload_pages_from_url( if cpk_info is not None: _encryption_key = cpk_info.encryption_key _encryption_key_sha256 = cpk_info.encryption_key_sha256 + _encryption_algorithm = cpk_info.encryption_algorithm if cpk_scope_info is not None: _encryption_scope = cpk_scope_info.encryption_scope if lease_access_conditions is not None: @@ -724,8 +712,8 @@ async def upload_pages_from_url( header_parameters['x-ms-encryption-key'] = self._serialize.header("encryption_key", _encryption_key, 'str') if _encryption_key_sha256 is not None: header_parameters['x-ms-encryption-key-sha256'] = self._serialize.header("encryption_key_sha256", _encryption_key_sha256, 'str') - if encryption_algorithm is not None: - header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", encryption_algorithm, 'str') + if _encryption_algorithm is not None: + header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", _encryption_algorithm, 'str') if _encryption_scope is not None: header_parameters['x-ms-encryption-scope'] = self._serialize.header("encryption_scope", _encryption_scope, 'str') if _lease_id is not None: @@ -1050,7 +1038,6 @@ async def resize( self, blob_content_length: int, timeout: Optional[int] = None, - encryption_algorithm: Optional[str] = "AES256", request_id_parameter: Optional[str] = None, lease_access_conditions: Optional["_models.LeaseAccessConditions"] = None, cpk_info: Optional["_models.CpkInfo"] = None, @@ -1067,10 +1054,6 @@ async def resize( :code:`Setting Timeouts for Blob Service Operations.`. :type timeout: int - :param encryption_algorithm: The algorithm used to produce the encryption key hash. Currently, - the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is - provided. - :type encryption_algorithm: str :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id_parameter: str @@ -1096,6 +1079,7 @@ async def resize( _lease_id = None _encryption_key = None _encryption_key_sha256 = None + _encryption_algorithm = None _encryption_scope = None _if_modified_since = None _if_unmodified_since = None @@ -1105,6 +1089,7 @@ async def resize( if cpk_info is not None: _encryption_key = cpk_info.encryption_key _encryption_key_sha256 = cpk_info.encryption_key_sha256 + _encryption_algorithm = cpk_info.encryption_algorithm if cpk_scope_info is not None: _encryption_scope = cpk_scope_info.encryption_scope if lease_access_conditions is not None: @@ -1139,8 +1124,8 @@ async def resize( header_parameters['x-ms-encryption-key'] = self._serialize.header("encryption_key", _encryption_key, 'str') if _encryption_key_sha256 is not None: header_parameters['x-ms-encryption-key-sha256'] = self._serialize.header("encryption_key_sha256", _encryption_key_sha256, 'str') - if encryption_algorithm is not None: - header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", encryption_algorithm, 'str') + if _encryption_algorithm is not None: + header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", _encryption_algorithm, 'str') if _encryption_scope is not None: header_parameters['x-ms-encryption-scope'] = self._serialize.header("encryption_scope", _encryption_scope, 'str') if _if_modified_since is not None: diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/__init__.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/__init__.py index 831bfa90ca91..3d33d25bb90f 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/__init__.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/__init__.py @@ -126,6 +126,7 @@ BlockListType, CopyStatusType, DeleteSnapshotsOptionType, + EncryptionAlgorithmType, GeoReplicationStatusType, LeaseDurationType, LeaseStateType, @@ -206,6 +207,7 @@ 'BlockListType', 'CopyStatusType', 'DeleteSnapshotsOptionType', + 'EncryptionAlgorithmType', 'GeoReplicationStatusType', 'LeaseDurationType', 'LeaseStateType', diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/_azure_blob_storage_enums.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/_azure_blob_storage_enums.py index 2df7b1ad6219..5d03a102b866 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/_azure_blob_storage_enums.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/_azure_blob_storage_enums.py @@ -121,6 +121,11 @@ class DeleteSnapshotsOptionType(with_metaclass(_CaseInsensitiveEnumMeta, str, En INCLUDE = "include" ONLY = "only" +class EncryptionAlgorithmType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + NONE = "None" + AES256 = "AES256" + class GeoReplicationStatusType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The status of the secondary location """ diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/_models.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/_models.py index dd31ba1fbc92..fadcdd561759 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/_models.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/_models.py @@ -913,11 +913,16 @@ class CpkInfo(msrest.serialization.Model): :param encryption_key_sha256: The SHA-256 hash of the provided encryption key. Must be provided if the x-ms-encryption-key header is provided. :type encryption_key_sha256: str + :param encryption_algorithm: The algorithm used to produce the encryption key hash. Currently, + the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is + provided. Possible values include: "None", "AES256". + :type encryption_algorithm: str or ~azure.storage.blob.models.EncryptionAlgorithmType """ _attribute_map = { 'encryption_key': {'key': 'encryptionKey', 'type': 'str'}, 'encryption_key_sha256': {'key': 'encryptionKeySha256', 'type': 'str'}, + 'encryption_algorithm': {'key': 'encryptionAlgorithm', 'type': 'str'}, } def __init__( @@ -927,6 +932,7 @@ def __init__( super(CpkInfo, self).__init__(**kwargs) self.encryption_key = kwargs.get('encryption_key', None) self.encryption_key_sha256 = kwargs.get('encryption_key_sha256', None) + self.encryption_algorithm = kwargs.get('encryption_algorithm', None) class CpkScopeInfo(msrest.serialization.Model): diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/_models_py3.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/_models_py3.py index 9bac63fee7d6..2ed0d23fd172 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/_models_py3.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/_models_py3.py @@ -1043,11 +1043,16 @@ class CpkInfo(msrest.serialization.Model): :param encryption_key_sha256: The SHA-256 hash of the provided encryption key. Must be provided if the x-ms-encryption-key header is provided. :type encryption_key_sha256: str + :param encryption_algorithm: The algorithm used to produce the encryption key hash. Currently, + the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is + provided. Possible values include: "None", "AES256". + :type encryption_algorithm: str or ~azure.storage.blob.models.EncryptionAlgorithmType """ _attribute_map = { 'encryption_key': {'key': 'encryptionKey', 'type': 'str'}, 'encryption_key_sha256': {'key': 'encryptionKeySha256', 'type': 'str'}, + 'encryption_algorithm': {'key': 'encryptionAlgorithm', 'type': 'str'}, } def __init__( @@ -1055,11 +1060,13 @@ def __init__( *, encryption_key: Optional[str] = None, encryption_key_sha256: Optional[str] = None, + encryption_algorithm: Optional[Union[str, "EncryptionAlgorithmType"]] = None, **kwargs ): super(CpkInfo, self).__init__(**kwargs) self.encryption_key = encryption_key self.encryption_key_sha256 = encryption_key_sha256 + self.encryption_algorithm = encryption_algorithm class CpkScopeInfo(msrest.serialization.Model): diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_append_blob_operations.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_append_blob_operations.py index abbe40eac438..0825fcf791bb 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_append_blob_operations.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_append_blob_operations.py @@ -49,7 +49,6 @@ def create( content_length, # type: int timeout=None, # type: Optional[int] metadata=None, # type: Optional[str] - encryption_algorithm="AES256", # type: Optional[str] request_id_parameter=None, # type: Optional[str] blob_tags_string=None, # type: Optional[str] blob_http_headers=None, # type: Optional["_models.BlobHTTPHeaders"] @@ -76,10 +75,6 @@ def create( rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information. :type metadata: str - :param encryption_algorithm: The algorithm used to produce the encryption key hash. Currently, - the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is - provided. - :type encryption_algorithm: str :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id_parameter: str @@ -115,6 +110,7 @@ def create( _blob_content_disposition = None _encryption_key = None _encryption_key_sha256 = None + _encryption_algorithm = None _encryption_scope = None _if_modified_since = None _if_unmodified_since = None @@ -131,6 +127,7 @@ def create( if cpk_info is not None: _encryption_key = cpk_info.encryption_key _encryption_key_sha256 = cpk_info.encryption_key_sha256 + _encryption_algorithm = cpk_info.encryption_algorithm if cpk_scope_info is not None: _encryption_scope = cpk_scope_info.encryption_scope if lease_access_conditions is not None: @@ -180,8 +177,8 @@ def create( header_parameters['x-ms-encryption-key'] = self._serialize.header("encryption_key", _encryption_key, 'str') if _encryption_key_sha256 is not None: header_parameters['x-ms-encryption-key-sha256'] = self._serialize.header("encryption_key_sha256", _encryption_key_sha256, 'str') - if encryption_algorithm is not None: - header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", encryption_algorithm, 'str') + if _encryption_algorithm is not None: + header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", _encryption_algorithm, 'str') if _encryption_scope is not None: header_parameters['x-ms-encryption-scope'] = self._serialize.header("encryption_scope", _encryption_scope, 'str') if _if_modified_since is not None: @@ -235,7 +232,6 @@ def append_block( timeout=None, # type: Optional[int] transactional_content_md5=None, # type: Optional[bytearray] transactional_content_crc64=None, # type: Optional[bytearray] - encryption_algorithm="AES256", # type: Optional[str] request_id_parameter=None, # type: Optional[str] lease_access_conditions=None, # type: Optional["_models.LeaseAccessConditions"] append_position_access_conditions=None, # type: Optional["_models.AppendPositionAccessConditions"] @@ -263,10 +259,6 @@ def append_block( :param transactional_content_crc64: Specify the transactional crc64 for the body, to be validated by the service. :type transactional_content_crc64: bytearray - :param encryption_algorithm: The algorithm used to produce the encryption key hash. Currently, - the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is - provided. - :type encryption_algorithm: str :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id_parameter: str @@ -296,6 +288,7 @@ def append_block( _append_position = None _encryption_key = None _encryption_key_sha256 = None + _encryption_algorithm = None _encryption_scope = None _if_modified_since = None _if_unmodified_since = None @@ -308,6 +301,7 @@ def append_block( if cpk_info is not None: _encryption_key = cpk_info.encryption_key _encryption_key_sha256 = cpk_info.encryption_key_sha256 + _encryption_algorithm = cpk_info.encryption_algorithm if cpk_scope_info is not None: _encryption_scope = cpk_scope_info.encryption_scope if lease_access_conditions is not None: @@ -352,8 +346,8 @@ def append_block( header_parameters['x-ms-encryption-key'] = self._serialize.header("encryption_key", _encryption_key, 'str') if _encryption_key_sha256 is not None: header_parameters['x-ms-encryption-key-sha256'] = self._serialize.header("encryption_key_sha256", _encryption_key_sha256, 'str') - if encryption_algorithm is not None: - header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", encryption_algorithm, 'str') + if _encryption_algorithm is not None: + header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", _encryption_algorithm, 'str') if _encryption_scope is not None: header_parameters['x-ms-encryption-scope'] = self._serialize.header("encryption_scope", _encryption_scope, 'str') if _if_modified_since is not None: @@ -412,7 +406,6 @@ def append_block_from_url( source_contentcrc64=None, # type: Optional[bytearray] timeout=None, # type: Optional[int] transactional_content_md5=None, # type: Optional[bytearray] - encryption_algorithm="AES256", # type: Optional[str] request_id_parameter=None, # type: Optional[str] cpk_info=None, # type: Optional["_models.CpkInfo"] cpk_scope_info=None, # type: Optional["_models.CpkScopeInfo"] @@ -447,10 +440,6 @@ def append_block_from_url( :param transactional_content_md5: Specify the transactional md5 for the body, to be validated by the service. :type transactional_content_md5: bytearray - :param encryption_algorithm: The algorithm used to produce the encryption key hash. Currently, - the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is - provided. - :type encryption_algorithm: str :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id_parameter: str @@ -479,6 +468,7 @@ def append_block_from_url( _encryption_key = None _encryption_key_sha256 = None + _encryption_algorithm = None _encryption_scope = None _lease_id = None _max_size = None @@ -498,6 +488,7 @@ def append_block_from_url( if cpk_info is not None: _encryption_key = cpk_info.encryption_key _encryption_key_sha256 = cpk_info.encryption_key_sha256 + _encryption_algorithm = cpk_info.encryption_algorithm if cpk_scope_info is not None: _encryption_scope = cpk_scope_info.encryption_scope if lease_access_conditions is not None: @@ -545,8 +536,8 @@ def append_block_from_url( header_parameters['x-ms-encryption-key'] = self._serialize.header("encryption_key", _encryption_key, 'str') if _encryption_key_sha256 is not None: header_parameters['x-ms-encryption-key-sha256'] = self._serialize.header("encryption_key_sha256", _encryption_key_sha256, 'str') - if encryption_algorithm is not None: - header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", encryption_algorithm, 'str') + if _encryption_algorithm is not None: + header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", _encryption_algorithm, 'str') if _encryption_scope is not None: header_parameters['x-ms-encryption-scope'] = self._serialize.header("encryption_scope", _encryption_scope, 'str') if _lease_id is not None: diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_blob_operations.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_blob_operations.py index bfa782f98d6b..a72d4dcd94c8 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_blob_operations.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_blob_operations.py @@ -52,7 +52,6 @@ def download( range=None, # type: Optional[str] range_get_content_md5=None, # type: Optional[bool] range_get_content_crc64=None, # type: Optional[bool] - encryption_algorithm="AES256", # type: Optional[str] request_id_parameter=None, # type: Optional[str] lease_access_conditions=None, # type: Optional["_models.LeaseAccessConditions"] cpk_info=None, # type: Optional["_models.CpkInfo"] @@ -86,10 +85,6 @@ def download( service returns the CRC64 hash for the range, as long as the range is less than or equal to 4 MB in size. :type range_get_content_crc64: bool - :param encryption_algorithm: The algorithm used to produce the encryption key hash. Currently, - the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is - provided. - :type encryption_algorithm: str :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id_parameter: str @@ -113,6 +108,7 @@ def download( _lease_id = None _encryption_key = None _encryption_key_sha256 = None + _encryption_algorithm = None _if_modified_since = None _if_unmodified_since = None _if_match = None @@ -121,6 +117,7 @@ def download( if cpk_info is not None: _encryption_key = cpk_info.encryption_key _encryption_key_sha256 = cpk_info.encryption_key_sha256 + _encryption_algorithm = cpk_info.encryption_algorithm if lease_access_conditions is not None: _lease_id = lease_access_conditions.lease_id if modified_access_conditions is not None: @@ -161,8 +158,8 @@ def download( header_parameters['x-ms-encryption-key'] = self._serialize.header("encryption_key", _encryption_key, 'str') if _encryption_key_sha256 is not None: header_parameters['x-ms-encryption-key-sha256'] = self._serialize.header("encryption_key_sha256", _encryption_key_sha256, 'str') - if encryption_algorithm is not None: - header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", encryption_algorithm, 'str') + if _encryption_algorithm is not None: + header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", _encryption_algorithm, 'str') if _if_modified_since is not None: header_parameters['If-Modified-Since'] = self._serialize.header("if_modified_since", _if_modified_since, 'rfc-1123') if _if_unmodified_since is not None: @@ -284,7 +281,6 @@ def get_properties( snapshot=None, # type: Optional[str] version_id=None, # type: Optional[str] timeout=None, # type: Optional[int] - encryption_algorithm="AES256", # type: Optional[str] request_id_parameter=None, # type: Optional[str] lease_access_conditions=None, # type: Optional["_models.LeaseAccessConditions"] cpk_info=None, # type: Optional["_models.CpkInfo"] @@ -308,10 +304,6 @@ def get_properties( :code:`Setting Timeouts for Blob Service Operations.`. :type timeout: int - :param encryption_algorithm: The algorithm used to produce the encryption key hash. Currently, - the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is - provided. - :type encryption_algorithm: str :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id_parameter: str @@ -335,6 +327,7 @@ def get_properties( _lease_id = None _encryption_key = None _encryption_key_sha256 = None + _encryption_algorithm = None _if_modified_since = None _if_unmodified_since = None _if_match = None @@ -343,6 +336,7 @@ def get_properties( if cpk_info is not None: _encryption_key = cpk_info.encryption_key _encryption_key_sha256 = cpk_info.encryption_key_sha256 + _encryption_algorithm = cpk_info.encryption_algorithm if lease_access_conditions is not None: _lease_id = lease_access_conditions.lease_id if modified_access_conditions is not None: @@ -377,8 +371,8 @@ def get_properties( header_parameters['x-ms-encryption-key'] = self._serialize.header("encryption_key", _encryption_key, 'str') if _encryption_key_sha256 is not None: header_parameters['x-ms-encryption-key-sha256'] = self._serialize.header("encryption_key_sha256", _encryption_key_sha256, 'str') - if encryption_algorithm is not None: - header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", encryption_algorithm, 'str') + if _encryption_algorithm is not None: + header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", _encryption_algorithm, 'str') if _if_modified_since is not None: header_parameters['If-Modified-Since'] = self._serialize.header("if_modified_since", _if_modified_since, 'rfc-1123') if _if_unmodified_since is not None: @@ -1308,7 +1302,6 @@ def set_metadata( self, timeout=None, # type: Optional[int] metadata=None, # type: Optional[str] - encryption_algorithm="AES256", # type: Optional[str] request_id_parameter=None, # type: Optional[str] lease_access_conditions=None, # type: Optional["_models.LeaseAccessConditions"] cpk_info=None, # type: Optional["_models.CpkInfo"] @@ -1332,10 +1325,6 @@ def set_metadata( rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information. :type metadata: str - :param encryption_algorithm: The algorithm used to produce the encryption key hash. Currently, - the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is - provided. - :type encryption_algorithm: str :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id_parameter: str @@ -1361,6 +1350,7 @@ def set_metadata( _lease_id = None _encryption_key = None _encryption_key_sha256 = None + _encryption_algorithm = None _encryption_scope = None _if_modified_since = None _if_unmodified_since = None @@ -1370,6 +1360,7 @@ def set_metadata( if cpk_info is not None: _encryption_key = cpk_info.encryption_key _encryption_key_sha256 = cpk_info.encryption_key_sha256 + _encryption_algorithm = cpk_info.encryption_algorithm if cpk_scope_info is not None: _encryption_scope = cpk_scope_info.encryption_scope if lease_access_conditions is not None: @@ -1406,8 +1397,8 @@ def set_metadata( header_parameters['x-ms-encryption-key'] = self._serialize.header("encryption_key", _encryption_key, 'str') if _encryption_key_sha256 is not None: header_parameters['x-ms-encryption-key-sha256'] = self._serialize.header("encryption_key_sha256", _encryption_key_sha256, 'str') - if encryption_algorithm is not None: - header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", encryption_algorithm, 'str') + if _encryption_algorithm is not None: + header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", _encryption_algorithm, 'str') if _encryption_scope is not None: header_parameters['x-ms-encryption-scope'] = self._serialize.header("encryption_scope", _encryption_scope, 'str') if _if_modified_since is not None: @@ -1997,7 +1988,6 @@ def create_snapshot( self, timeout=None, # type: Optional[int] metadata=None, # type: Optional[str] - encryption_algorithm="AES256", # type: Optional[str] request_id_parameter=None, # type: Optional[str] cpk_info=None, # type: Optional["_models.CpkInfo"] cpk_scope_info=None, # type: Optional["_models.CpkScopeInfo"] @@ -2020,10 +2010,6 @@ def create_snapshot( rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information. :type metadata: str - :param encryption_algorithm: The algorithm used to produce the encryption key hash. Currently, - the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is - provided. - :type encryption_algorithm: str :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id_parameter: str @@ -2048,6 +2034,7 @@ def create_snapshot( _encryption_key = None _encryption_key_sha256 = None + _encryption_algorithm = None _encryption_scope = None _if_modified_since = None _if_unmodified_since = None @@ -2058,6 +2045,7 @@ def create_snapshot( if cpk_info is not None: _encryption_key = cpk_info.encryption_key _encryption_key_sha256 = cpk_info.encryption_key_sha256 + _encryption_algorithm = cpk_info.encryption_algorithm if cpk_scope_info is not None: _encryption_scope = cpk_scope_info.encryption_scope if lease_access_conditions is not None: @@ -2092,8 +2080,8 @@ def create_snapshot( header_parameters['x-ms-encryption-key'] = self._serialize.header("encryption_key", _encryption_key, 'str') if _encryption_key_sha256 is not None: header_parameters['x-ms-encryption-key-sha256'] = self._serialize.header("encryption_key_sha256", _encryption_key_sha256, 'str') - if encryption_algorithm is not None: - header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", encryption_algorithm, 'str') + if _encryption_algorithm is not None: + header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", _encryption_algorithm, 'str') if _encryption_scope is not None: header_parameters['x-ms-encryption-scope'] = self._serialize.header("encryption_scope", _encryption_scope, 'str') if _if_modified_since is not None: @@ -2741,7 +2729,6 @@ def query( self, snapshot=None, # type: Optional[str] timeout=None, # type: Optional[int] - encryption_algorithm="AES256", # type: Optional[str] request_id_parameter=None, # type: Optional[str] query_request=None, # type: Optional["_models.QueryRequest"] lease_access_conditions=None, # type: Optional["_models.LeaseAccessConditions"] @@ -2763,10 +2750,6 @@ def query( :code:`Setting Timeouts for Blob Service Operations.`. :type timeout: int - :param encryption_algorithm: The algorithm used to produce the encryption key hash. Currently, - the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is - provided. - :type encryption_algorithm: str :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id_parameter: str @@ -2792,6 +2775,7 @@ def query( _lease_id = None _encryption_key = None _encryption_key_sha256 = None + _encryption_algorithm = None _if_modified_since = None _if_unmodified_since = None _if_match = None @@ -2800,6 +2784,7 @@ def query( if cpk_info is not None: _encryption_key = cpk_info.encryption_key _encryption_key_sha256 = cpk_info.encryption_key_sha256 + _encryption_algorithm = cpk_info.encryption_algorithm if lease_access_conditions is not None: _lease_id = lease_access_conditions.lease_id if modified_access_conditions is not None: @@ -2835,8 +2820,8 @@ def query( header_parameters['x-ms-encryption-key'] = self._serialize.header("encryption_key", _encryption_key, 'str') if _encryption_key_sha256 is not None: header_parameters['x-ms-encryption-key-sha256'] = self._serialize.header("encryption_key_sha256", _encryption_key_sha256, 'str') - if encryption_algorithm is not None: - header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", encryption_algorithm, 'str') + if _encryption_algorithm is not None: + header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", _encryption_algorithm, 'str') if _if_modified_since is not None: header_parameters['If-Modified-Since'] = self._serialize.header("if_modified_since", _if_modified_since, 'rfc-1123') if _if_unmodified_since is not None: diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_block_blob_operations.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_block_blob_operations.py index 7bb13abc2b7f..f9804ce9b7d1 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_block_blob_operations.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_block_blob_operations.py @@ -51,7 +51,6 @@ def upload( timeout=None, # type: Optional[int] transactional_content_md5=None, # type: Optional[bytearray] metadata=None, # type: Optional[str] - encryption_algorithm="AES256", # type: Optional[str] tier=None, # type: Optional[Union[str, "_models.AccessTierOptional"]] request_id_parameter=None, # type: Optional[str] blob_tags_string=None, # type: Optional[str] @@ -88,10 +87,6 @@ def upload( rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information. :type metadata: str - :param encryption_algorithm: The algorithm used to produce the encryption key hash. Currently, - the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is - provided. - :type encryption_algorithm: str :param tier: Optional. Indicates the tier to be set on the blob. :type tier: str or ~azure.storage.blob.models.AccessTierOptional :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character @@ -129,6 +124,7 @@ def upload( _blob_content_disposition = None _encryption_key = None _encryption_key_sha256 = None + _encryption_algorithm = None _encryption_scope = None _if_modified_since = None _if_unmodified_since = None @@ -145,6 +141,7 @@ def upload( if cpk_info is not None: _encryption_key = cpk_info.encryption_key _encryption_key_sha256 = cpk_info.encryption_key_sha256 + _encryption_algorithm = cpk_info.encryption_algorithm if cpk_scope_info is not None: _encryption_scope = cpk_scope_info.encryption_scope if lease_access_conditions is not None: @@ -197,8 +194,8 @@ def upload( header_parameters['x-ms-encryption-key'] = self._serialize.header("encryption_key", _encryption_key, 'str') if _encryption_key_sha256 is not None: header_parameters['x-ms-encryption-key-sha256'] = self._serialize.header("encryption_key_sha256", _encryption_key_sha256, 'str') - if encryption_algorithm is not None: - header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", encryption_algorithm, 'str') + if _encryption_algorithm is not None: + header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", _encryption_algorithm, 'str') if _encryption_scope is not None: header_parameters['x-ms-encryption-scope'] = self._serialize.header("encryption_scope", _encryption_scope, 'str') if tier is not None: @@ -257,7 +254,6 @@ def put_blob_from_url( timeout=None, # type: Optional[int] transactional_content_md5=None, # type: Optional[bytearray] metadata=None, # type: Optional[str] - encryption_algorithm="AES256", # type: Optional[str] tier=None, # type: Optional[Union[str, "_models.AccessTierOptional"]] request_id_parameter=None, # type: Optional[str] source_content_md5=None, # type: Optional[bytearray] @@ -300,10 +296,6 @@ def put_blob_from_url( rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information. :type metadata: str - :param encryption_algorithm: The algorithm used to produce the encryption key hash. Currently, - the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is - provided. - :type encryption_algorithm: str :param tier: Optional. Indicates the tier to be set on the blob. :type tier: str or ~azure.storage.blob.models.AccessTierOptional :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character @@ -349,6 +341,7 @@ def put_blob_from_url( _blob_content_disposition = None _encryption_key = None _encryption_key_sha256 = None + _encryption_algorithm = None _encryption_scope = None _if_modified_since = None _if_unmodified_since = None @@ -370,6 +363,7 @@ def put_blob_from_url( if cpk_info is not None: _encryption_key = cpk_info.encryption_key _encryption_key_sha256 = cpk_info.encryption_key_sha256 + _encryption_algorithm = cpk_info.encryption_algorithm if cpk_scope_info is not None: _encryption_scope = cpk_scope_info.encryption_scope if lease_access_conditions is not None: @@ -427,8 +421,8 @@ def put_blob_from_url( header_parameters['x-ms-encryption-key'] = self._serialize.header("encryption_key", _encryption_key, 'str') if _encryption_key_sha256 is not None: header_parameters['x-ms-encryption-key-sha256'] = self._serialize.header("encryption_key_sha256", _encryption_key_sha256, 'str') - if encryption_algorithm is not None: - header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", encryption_algorithm, 'str') + if _encryption_algorithm is not None: + header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", _encryption_algorithm, 'str') if _encryption_scope is not None: header_parameters['x-ms-encryption-scope'] = self._serialize.header("encryption_scope", _encryption_scope, 'str') if tier is not None: @@ -500,7 +494,6 @@ def stage_block( transactional_content_md5=None, # type: Optional[bytearray] transactional_content_crc64=None, # type: Optional[bytearray] timeout=None, # type: Optional[int] - encryption_algorithm="AES256", # type: Optional[str] request_id_parameter=None, # type: Optional[str] lease_access_conditions=None, # type: Optional["_models.LeaseAccessConditions"] cpk_info=None, # type: Optional["_models.CpkInfo"] @@ -528,10 +521,6 @@ def stage_block( :code:`Setting Timeouts for Blob Service Operations.`. :type timeout: int - :param encryption_algorithm: The algorithm used to produce the encryption key hash. Currently, - the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is - provided. - :type encryption_algorithm: str :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id_parameter: str @@ -555,10 +544,12 @@ def stage_block( _lease_id = None _encryption_key = None _encryption_key_sha256 = None + _encryption_algorithm = None _encryption_scope = None if cpk_info is not None: _encryption_key = cpk_info.encryption_key _encryption_key_sha256 = cpk_info.encryption_key_sha256 + _encryption_algorithm = cpk_info.encryption_algorithm if cpk_scope_info is not None: _encryption_scope = cpk_scope_info.encryption_scope if lease_access_conditions is not None: @@ -594,8 +585,8 @@ def stage_block( header_parameters['x-ms-encryption-key'] = self._serialize.header("encryption_key", _encryption_key, 'str') if _encryption_key_sha256 is not None: header_parameters['x-ms-encryption-key-sha256'] = self._serialize.header("encryption_key_sha256", _encryption_key_sha256, 'str') - if encryption_algorithm is not None: - header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", encryption_algorithm, 'str') + if _encryption_algorithm is not None: + header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", _encryption_algorithm, 'str') if _encryption_scope is not None: header_parameters['x-ms-encryption-scope'] = self._serialize.header("encryption_scope", _encryption_scope, 'str') header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') @@ -640,7 +631,6 @@ def stage_block_from_url( source_content_md5=None, # type: Optional[bytearray] source_contentcrc64=None, # type: Optional[bytearray] timeout=None, # type: Optional[int] - encryption_algorithm="AES256", # type: Optional[str] request_id_parameter=None, # type: Optional[str] cpk_info=None, # type: Optional["_models.CpkInfo"] cpk_scope_info=None, # type: Optional["_models.CpkScopeInfo"] @@ -672,10 +662,6 @@ def stage_block_from_url( :code:`Setting Timeouts for Blob Service Operations.`. :type timeout: int - :param encryption_algorithm: The algorithm used to produce the encryption key hash. Currently, - the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is - provided. - :type encryption_algorithm: str :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id_parameter: str @@ -700,6 +686,7 @@ def stage_block_from_url( _encryption_key = None _encryption_key_sha256 = None + _encryption_algorithm = None _encryption_scope = None _lease_id = None _source_if_modified_since = None @@ -709,6 +696,7 @@ def stage_block_from_url( if cpk_info is not None: _encryption_key = cpk_info.encryption_key _encryption_key_sha256 = cpk_info.encryption_key_sha256 + _encryption_algorithm = cpk_info.encryption_algorithm if cpk_scope_info is not None: _encryption_scope = cpk_scope_info.encryption_scope if lease_access_conditions is not None: @@ -749,8 +737,8 @@ def stage_block_from_url( header_parameters['x-ms-encryption-key'] = self._serialize.header("encryption_key", _encryption_key, 'str') if _encryption_key_sha256 is not None: header_parameters['x-ms-encryption-key-sha256'] = self._serialize.header("encryption_key_sha256", _encryption_key_sha256, 'str') - if encryption_algorithm is not None: - header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", encryption_algorithm, 'str') + if _encryption_algorithm is not None: + header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", _encryption_algorithm, 'str') if _encryption_scope is not None: header_parameters['x-ms-encryption-scope'] = self._serialize.header("encryption_scope", _encryption_scope, 'str') if _lease_id is not None: @@ -800,7 +788,6 @@ def commit_block_list( transactional_content_md5=None, # type: Optional[bytearray] transactional_content_crc64=None, # type: Optional[bytearray] metadata=None, # type: Optional[str] - encryption_algorithm="AES256", # type: Optional[str] tier=None, # type: Optional[Union[str, "_models.AccessTierOptional"]] request_id_parameter=None, # type: Optional[str] blob_tags_string=None, # type: Optional[str] @@ -840,10 +827,6 @@ def commit_block_list( rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information. :type metadata: str - :param encryption_algorithm: The algorithm used to produce the encryption key hash. Currently, - the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is - provided. - :type encryption_algorithm: str :param tier: Optional. Indicates the tier to be set on the blob. :type tier: str or ~azure.storage.blob.models.AccessTierOptional :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character @@ -881,6 +864,7 @@ def commit_block_list( _blob_content_disposition = None _encryption_key = None _encryption_key_sha256 = None + _encryption_algorithm = None _encryption_scope = None _if_modified_since = None _if_unmodified_since = None @@ -897,6 +881,7 @@ def commit_block_list( if cpk_info is not None: _encryption_key = cpk_info.encryption_key _encryption_key_sha256 = cpk_info.encryption_key_sha256 + _encryption_algorithm = cpk_info.encryption_algorithm if cpk_scope_info is not None: _encryption_scope = cpk_scope_info.encryption_scope if lease_access_conditions is not None: @@ -950,8 +935,8 @@ def commit_block_list( header_parameters['x-ms-encryption-key'] = self._serialize.header("encryption_key", _encryption_key, 'str') if _encryption_key_sha256 is not None: header_parameters['x-ms-encryption-key-sha256'] = self._serialize.header("encryption_key_sha256", _encryption_key_sha256, 'str') - if encryption_algorithm is not None: - header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", encryption_algorithm, 'str') + if _encryption_algorithm is not None: + header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", _encryption_algorithm, 'str') if _encryption_scope is not None: header_parameters['x-ms-encryption-scope'] = self._serialize.header("encryption_scope", _encryption_scope, 'str') if tier is not None: diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_page_blob_operations.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_page_blob_operations.py index e7f8a0223351..ea4b17c056b7 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_page_blob_operations.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_page_blob_operations.py @@ -51,7 +51,6 @@ def create( timeout=None, # type: Optional[int] tier=None, # type: Optional[Union[str, "_models.PremiumPageBlobAccessTier"]] metadata=None, # type: Optional[str] - encryption_algorithm="AES256", # type: Optional[str] blob_sequence_number=0, # type: Optional[int] request_id_parameter=None, # type: Optional[str] blob_tags_string=None, # type: Optional[str] @@ -84,10 +83,6 @@ def create( rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information. :type metadata: str - :param encryption_algorithm: The algorithm used to produce the encryption key hash. Currently, - the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is - provided. - :type encryption_algorithm: str :param blob_sequence_number: Set for page blobs only. The sequence number is a user-controlled value that you can use to track requests. The value of the sequence number must be between 0 and 2^63 - 1. @@ -127,6 +122,7 @@ def create( _blob_content_disposition = None _encryption_key = None _encryption_key_sha256 = None + _encryption_algorithm = None _encryption_scope = None _if_modified_since = None _if_unmodified_since = None @@ -143,6 +139,7 @@ def create( if cpk_info is not None: _encryption_key = cpk_info.encryption_key _encryption_key_sha256 = cpk_info.encryption_key_sha256 + _encryption_algorithm = cpk_info.encryption_algorithm if cpk_scope_info is not None: _encryption_scope = cpk_scope_info.encryption_scope if lease_access_conditions is not None: @@ -194,8 +191,8 @@ def create( header_parameters['x-ms-encryption-key'] = self._serialize.header("encryption_key", _encryption_key, 'str') if _encryption_key_sha256 is not None: header_parameters['x-ms-encryption-key-sha256'] = self._serialize.header("encryption_key_sha256", _encryption_key_sha256, 'str') - if encryption_algorithm is not None: - header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", encryption_algorithm, 'str') + if _encryption_algorithm is not None: + header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", _encryption_algorithm, 'str') if _encryption_scope is not None: header_parameters['x-ms-encryption-scope'] = self._serialize.header("encryption_scope", _encryption_scope, 'str') if _if_modified_since is not None: @@ -253,7 +250,6 @@ def upload_pages( transactional_content_crc64=None, # type: Optional[bytearray] timeout=None, # type: Optional[int] range=None, # type: Optional[str] - encryption_algorithm="AES256", # type: Optional[str] request_id_parameter=None, # type: Optional[str] lease_access_conditions=None, # type: Optional["_models.LeaseAccessConditions"] cpk_info=None, # type: Optional["_models.CpkInfo"] @@ -281,10 +277,6 @@ def upload_pages( :type timeout: int :param range: Return only the bytes of the blob in the specified range. :type range: str - :param encryption_algorithm: The algorithm used to produce the encryption key hash. Currently, - the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is - provided. - :type encryption_algorithm: str :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id_parameter: str @@ -312,6 +304,7 @@ def upload_pages( _lease_id = None _encryption_key = None _encryption_key_sha256 = None + _encryption_algorithm = None _encryption_scope = None _if_sequence_number_less_than_or_equal_to = None _if_sequence_number_less_than = None @@ -324,6 +317,7 @@ def upload_pages( if cpk_info is not None: _encryption_key = cpk_info.encryption_key _encryption_key_sha256 = cpk_info.encryption_key_sha256 + _encryption_algorithm = cpk_info.encryption_algorithm if cpk_scope_info is not None: _encryption_scope = cpk_scope_info.encryption_scope if lease_access_conditions is not None: @@ -372,8 +366,8 @@ def upload_pages( header_parameters['x-ms-encryption-key'] = self._serialize.header("encryption_key", _encryption_key, 'str') if _encryption_key_sha256 is not None: header_parameters['x-ms-encryption-key-sha256'] = self._serialize.header("encryption_key_sha256", _encryption_key_sha256, 'str') - if encryption_algorithm is not None: - header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", encryption_algorithm, 'str') + if _encryption_algorithm is not None: + header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", _encryption_algorithm, 'str') if _encryption_scope is not None: header_parameters['x-ms-encryption-scope'] = self._serialize.header("encryption_scope", _encryption_scope, 'str') if _if_sequence_number_less_than_or_equal_to is not None: @@ -433,7 +427,6 @@ def clear_pages( content_length, # type: int timeout=None, # type: Optional[int] range=None, # type: Optional[str] - encryption_algorithm="AES256", # type: Optional[str] request_id_parameter=None, # type: Optional[str] lease_access_conditions=None, # type: Optional["_models.LeaseAccessConditions"] cpk_info=None, # type: Optional["_models.CpkInfo"] @@ -453,10 +446,6 @@ def clear_pages( :type timeout: int :param range: Return only the bytes of the blob in the specified range. :type range: str - :param encryption_algorithm: The algorithm used to produce the encryption key hash. Currently, - the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is - provided. - :type encryption_algorithm: str :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id_parameter: str @@ -484,6 +473,7 @@ def clear_pages( _lease_id = None _encryption_key = None _encryption_key_sha256 = None + _encryption_algorithm = None _encryption_scope = None _if_sequence_number_less_than_or_equal_to = None _if_sequence_number_less_than = None @@ -496,6 +486,7 @@ def clear_pages( if cpk_info is not None: _encryption_key = cpk_info.encryption_key _encryption_key_sha256 = cpk_info.encryption_key_sha256 + _encryption_algorithm = cpk_info.encryption_algorithm if cpk_scope_info is not None: _encryption_scope = cpk_scope_info.encryption_scope if lease_access_conditions is not None: @@ -539,8 +530,8 @@ def clear_pages( header_parameters['x-ms-encryption-key'] = self._serialize.header("encryption_key", _encryption_key, 'str') if _encryption_key_sha256 is not None: header_parameters['x-ms-encryption-key-sha256'] = self._serialize.header("encryption_key_sha256", _encryption_key_sha256, 'str') - if encryption_algorithm is not None: - header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", encryption_algorithm, 'str') + if _encryption_algorithm is not None: + header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", _encryption_algorithm, 'str') if _encryption_scope is not None: header_parameters['x-ms-encryption-scope'] = self._serialize.header("encryption_scope", _encryption_scope, 'str') if _if_sequence_number_less_than_or_equal_to is not None: @@ -598,7 +589,6 @@ def upload_pages_from_url( source_content_md5=None, # type: Optional[bytearray] source_contentcrc64=None, # type: Optional[bytearray] timeout=None, # type: Optional[int] - encryption_algorithm="AES256", # type: Optional[str] request_id_parameter=None, # type: Optional[str] cpk_info=None, # type: Optional["_models.CpkInfo"] cpk_scope_info=None, # type: Optional["_models.CpkScopeInfo"] @@ -632,10 +622,6 @@ def upload_pages_from_url( :code:`Setting Timeouts for Blob Service Operations.`. :type timeout: int - :param encryption_algorithm: The algorithm used to produce the encryption key hash. Currently, - the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is - provided. - :type encryption_algorithm: str :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id_parameter: str @@ -664,6 +650,7 @@ def upload_pages_from_url( _encryption_key = None _encryption_key_sha256 = None + _encryption_algorithm = None _encryption_scope = None _lease_id = None _if_sequence_number_less_than_or_equal_to = None @@ -681,6 +668,7 @@ def upload_pages_from_url( if cpk_info is not None: _encryption_key = cpk_info.encryption_key _encryption_key_sha256 = cpk_info.encryption_key_sha256 + _encryption_algorithm = cpk_info.encryption_algorithm if cpk_scope_info is not None: _encryption_scope = cpk_scope_info.encryption_scope if lease_access_conditions is not None: @@ -732,8 +720,8 @@ def upload_pages_from_url( header_parameters['x-ms-encryption-key'] = self._serialize.header("encryption_key", _encryption_key, 'str') if _encryption_key_sha256 is not None: header_parameters['x-ms-encryption-key-sha256'] = self._serialize.header("encryption_key_sha256", _encryption_key_sha256, 'str') - if encryption_algorithm is not None: - header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", encryption_algorithm, 'str') + if _encryption_algorithm is not None: + header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", _encryption_algorithm, 'str') if _encryption_scope is not None: header_parameters['x-ms-encryption-scope'] = self._serialize.header("encryption_scope", _encryption_scope, 'str') if _lease_id is not None: @@ -1060,7 +1048,6 @@ def resize( self, blob_content_length, # type: int timeout=None, # type: Optional[int] - encryption_algorithm="AES256", # type: Optional[str] request_id_parameter=None, # type: Optional[str] lease_access_conditions=None, # type: Optional["_models.LeaseAccessConditions"] cpk_info=None, # type: Optional["_models.CpkInfo"] @@ -1078,10 +1065,6 @@ def resize( :code:`Setting Timeouts for Blob Service Operations.`. :type timeout: int - :param encryption_algorithm: The algorithm used to produce the encryption key hash. Currently, - the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is - provided. - :type encryption_algorithm: str :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id_parameter: str @@ -1107,6 +1090,7 @@ def resize( _lease_id = None _encryption_key = None _encryption_key_sha256 = None + _encryption_algorithm = None _encryption_scope = None _if_modified_since = None _if_unmodified_since = None @@ -1116,6 +1100,7 @@ def resize( if cpk_info is not None: _encryption_key = cpk_info.encryption_key _encryption_key_sha256 = cpk_info.encryption_key_sha256 + _encryption_algorithm = cpk_info.encryption_algorithm if cpk_scope_info is not None: _encryption_scope = cpk_scope_info.encryption_scope if lease_access_conditions is not None: @@ -1150,8 +1135,8 @@ def resize( header_parameters['x-ms-encryption-key'] = self._serialize.header("encryption_key", _encryption_key, 'str') if _encryption_key_sha256 is not None: header_parameters['x-ms-encryption-key-sha256'] = self._serialize.header("encryption_key_sha256", _encryption_key_sha256, 'str') - if encryption_algorithm is not None: - header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", encryption_algorithm, 'str') + if _encryption_algorithm is not None: + header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", _encryption_algorithm, 'str') if _encryption_scope is not None: header_parameters['x-ms-encryption-scope'] = self._serialize.header("encryption_scope", _encryption_scope, 'str') if _if_modified_since is not None: diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_blob_client_async.py b/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_blob_client_async.py index 243ab1b7275e..a87a409796e1 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_blob_client_async.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_blob_client_async.py @@ -2449,7 +2449,7 @@ async def seal_append_blob(self, **kwargs): except HttpResponseError as error: process_storage_error(error) - def get_container_client(self): # pylint: disable=client-method-missing-kwargs + def _get_container_client(self): # pylint: disable=client-method-missing-kwargs # type: (...) -> ContainerClient """Get a client to interact with the blob's parent container. diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_container_client_async.py b/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_container_client_async.py index f793dc10c659..93cc87748e34 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_container_client_async.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_container_client_async.py @@ -444,7 +444,7 @@ async def set_container_metadata( # type: ignore process_storage_error(error) @distributed_trace - def get_blob_service_client(self): # pylint: disable=client-method-missing-kwargs + def _get_blob_service_client(self): # pylint: disable=client-method-missing-kwargs # type: (...) -> BlobServiceClient """Get a client to interact with the container's parent service account. diff --git a/sdk/storage/azure-storage-blob/samples/blob_samples_containers.py b/sdk/storage/azure-storage-blob/samples/blob_samples_containers.py index 12474274b8ee..800754f96e00 100644 --- a/sdk/storage/azure-storage-blob/samples/blob_samples_containers.py +++ b/sdk/storage/azure-storage-blob/samples/blob_samples_containers.py @@ -231,7 +231,7 @@ def get_container_client_from_blob_client(self): blob_client1 = container_client1.get_blob_client("blob") blob_client1.upload_blob("hello") - container_client2 = blob_client1.get_container_client() + container_client2 = blob_client1._get_container_client() print(container_client2.get_container_properties()) container_client2.delete_container() # [END get_container_client_from_blob_client] diff --git a/sdk/storage/azure-storage-blob/samples/blob_samples_containers_async.py b/sdk/storage/azure-storage-blob/samples/blob_samples_containers_async.py index a39845371394..62b0a84cb1fe 100644 --- a/sdk/storage/azure-storage-blob/samples/blob_samples_containers_async.py +++ b/sdk/storage/azure-storage-blob/samples/blob_samples_containers_async.py @@ -229,7 +229,7 @@ async def get_container_client_from_blob_client(self): blob_client1 = container_client1.get_blob_client("blob1") await blob_client1.upload_blob("hello") - container_client2 = blob_client1.get_container_client() + container_client2 = blob_client1._get_container_client() print(await container_client2.get_container_properties()) await container_client2.delete_container() # [END get_container_client_from_blob_client] diff --git a/sdk/storage/azure-storage-blob/samples/blob_samples_service.py b/sdk/storage/azure-storage-blob/samples/blob_samples_service.py index 73fb9af986f9..a59e1e859364 100644 --- a/sdk/storage/azure-storage-blob/samples/blob_samples_service.py +++ b/sdk/storage/azure-storage-blob/samples/blob_samples_service.py @@ -146,7 +146,7 @@ def get_blob_service_client_from_container_client(self): container_client1.create_container() # [START get_blob_service_client_from_container_client] - blob_service_client = container_client1.get_blob_service_client() + blob_service_client = container_client1._get_blob_service_client() print(blob_service_client.get_service_properties()) container_client2 = blob_service_client.get_container_client("container") diff --git a/sdk/storage/azure-storage-blob/samples/blob_samples_service_async.py b/sdk/storage/azure-storage-blob/samples/blob_samples_service_async.py index a56cf1afbc28..41cb4646c0f0 100644 --- a/sdk/storage/azure-storage-blob/samples/blob_samples_service_async.py +++ b/sdk/storage/azure-storage-blob/samples/blob_samples_service_async.py @@ -165,7 +165,7 @@ async def get_blob_service_client_from_container_client_async(self): await container_client1.create_container() # [START get_blob_service_client_from_container_client] - blob_service_client = container_client1.get_blob_service_client() + blob_service_client = container_client1._get_blob_service_client() print(await blob_service_client.get_service_properties()) container_client2 = blob_service_client.get_container_client("container") diff --git a/sdk/storage/azure-storage-blob/swagger/README.md b/sdk/storage/azure-storage-blob/swagger/README.md index e14276425d34..1c90942a9bcb 100644 --- a/sdk/storage/azure-storage-blob/swagger/README.md +++ b/sdk/storage/azure-storage-blob/swagger/README.md @@ -97,3 +97,16 @@ directive: transform: > $["x-ms-enum"].name = "AccessTierOptional"; ``` + +### EncryptionAlgorithm workaround until Modeler is fixed +``` yaml +directive: +- from: swagger-document + where: $.parameters + transform: > + delete $.EncryptionAlgorithm.enum; + $.EncryptionAlgorithm.enum = [ + "None", + "AES256" + ]; +``` \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/tests/test_blob_access_conditions.py b/sdk/storage/azure-storage-blob/tests/test_blob_access_conditions.py index 9c00f59f2b5c..378b293f0996 100644 --- a/sdk/storage/azure-storage-blob/tests/test_blob_access_conditions.py +++ b/sdk/storage/azure-storage-blob/tests/test_blob_access_conditions.py @@ -90,7 +90,7 @@ def test_get_blob_service_client_from_container( # Get blob service client from container client bsc_props1 = bsc1.get_service_properties() - bsc2 = container_client1.get_blob_service_client() + bsc2 = container_client1._get_blob_service_client() bsc_props2 = bsc2.get_service_properties() self.assertDictEqual(bsc_props1, bsc_props2) @@ -123,7 +123,7 @@ def test_get_container_client_from_blob(self, resource_group, location, storage_ # Upload data to blob and get container_client again blob_client1.upload_blob(b"this is test data") blob_client1_data = blob_client1.download_blob().readall() - container_client2 = blob_client1.get_container_client() + container_client2 = blob_client1._get_container_client() md2 = container_client2.get_container_properties().metadata self.assertEqual(md1, md2) diff --git a/sdk/storage/azure-storage-blob/tests/test_blob_access_conditions_async.py b/sdk/storage/azure-storage-blob/tests/test_blob_access_conditions_async.py index 80eb2abc3682..da93231c4747 100644 --- a/sdk/storage/azure-storage-blob/tests/test_blob_access_conditions_async.py +++ b/sdk/storage/azure-storage-blob/tests/test_blob_access_conditions_async.py @@ -108,7 +108,7 @@ async def test_get_blob_service_client_from_container( # Get blob service client from container client bsc_props1 = await bsc1.get_service_properties() - bsc2 = container_client1.get_blob_service_client() + bsc2 = container_client1._get_blob_service_client() bsc_props2 = await bsc2.get_service_properties() self.assertDictEqual(bsc_props1, bsc_props2) @@ -145,7 +145,7 @@ async def test_get_container_client_from_blob(self, resource_group, location, st await blob_client1.upload_blob(b"this is test data") downloaded_blob1 = await blob_client1.download_blob() blob_client1_data = await downloaded_blob1.readall() - container_client2 = blob_client1.get_container_client() + container_client2 = blob_client1._get_container_client() props2 = await container_client2.get_container_properties() md2 = props2.metadata