diff --git a/sdk/storage/azure-storage-blob/assets.json b/sdk/storage/azure-storage-blob/assets.json index ee6a76c7d8df..5a63d8af02a2 100644 --- a/sdk/storage/azure-storage-blob/assets.json +++ b/sdk/storage/azure-storage-blob/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "python", "TagPrefix": "python/storage/azure-storage-blob", - "Tag": "python/storage/azure-storage-blob_2ebf88fe05" + "Tag": "python/storage/azure-storage-blob_72aa299e55" } diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/_azure_blob_storage.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/_azure_blob_storage.py index 45ff7faa36e4..ab930440b987 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/_azure_blob_storage.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/_azure_blob_storage.py @@ -47,7 +47,7 @@ class AzureBlobStorage: # pylint: disable=client-accepts-api-version-keyword :param base_url: Service URL. Required. Default value is "". :type base_url: str :keyword version: Specifies the version of the operation to use for this request. Default value - is "2021-12-02". Note that overriding this default value may result in unsupported behavior. + is "2024-08-04". Note that overriding this default value may result in unsupported behavior. :paramtype version: str """ diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/_configuration.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/_configuration.py index 7a4dcb114716..4de4871f14b6 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/_configuration.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/_configuration.py @@ -23,12 +23,12 @@ class AzureBlobStorageConfiguration: # pylint: disable=too-many-instance-attrib desired operation. Required. :type url: str :keyword version: Specifies the version of the operation to use for this request. Default value - is "2021-12-02". Note that overriding this default value may result in unsupported behavior. + is "2024-08-04". Note that overriding this default value may result in unsupported behavior. :paramtype version: str """ def __init__(self, url: str, **kwargs: Any) -> None: - version: Literal["2021-12-02"] = kwargs.pop("version", "2021-12-02") + version: Literal["2024-08-04"] = kwargs.pop("version", "2024-08-04") if url is None: raise ValueError("Parameter 'url' must not be None.") diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/_azure_blob_storage.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/_azure_blob_storage.py index 179833c01f13..ef97d289d0c9 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/_azure_blob_storage.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/_azure_blob_storage.py @@ -47,7 +47,7 @@ class AzureBlobStorage: # pylint: disable=client-accepts-api-version-keyword :param base_url: Service URL. Required. Default value is "". :type base_url: str :keyword version: Specifies the version of the operation to use for this request. Default value - is "2021-12-02". Note that overriding this default value may result in unsupported behavior. + is "2024-08-04". Note that overriding this default value may result in unsupported behavior. :paramtype version: str """ diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/_configuration.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/_configuration.py index 3a1e9b4ae201..5960c22f03f2 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/_configuration.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/_configuration.py @@ -23,12 +23,12 @@ class AzureBlobStorageConfiguration: # pylint: disable=too-many-instance-attrib desired operation. Required. :type url: str :keyword version: Specifies the version of the operation to use for this request. Default value - is "2021-12-02". Note that overriding this default value may result in unsupported behavior. + is "2024-08-04". Note that overriding this default value may result in unsupported behavior. :paramtype version: str """ def __init__(self, url: str, **kwargs: Any) -> None: - version: Literal["2021-12-02"] = kwargs.pop("version", "2021-12-02") + version: Literal["2024-08-04"] = kwargs.pop("version", "2024-08-04") if url is None: raise ValueError("Parameter 'url' must not be 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 483d4f1b6369..910ebcb2358e 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 @@ -2602,9 +2602,20 @@ async def set_tier( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace_async - async def get_account_info(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + async def get_account_info( # pylint: disable=inconsistent-return-statements + self, timeout: Optional[int] = None, request_id_parameter: Optional[str] = None, **kwargs: Any + ) -> None: """Returns the sku name and account kind. + :param timeout: The timeout parameter is expressed in seconds. For more information, see + :code:`Setting + Timeouts for Blob Service Operations.`. Default value is None. + :type timeout: int + :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. Default + value is None. + :type request_id_parameter: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -2626,6 +2637,8 @@ async def get_account_info(self, **kwargs: Any) -> None: # pylint: disable=inco _request = build_get_account_info_request( url=self._config.url, + timeout=timeout, + request_id_parameter=request_id_parameter, restype=restype, comp=comp, version=self._config.version, @@ -2656,6 +2669,7 @@ async def get_account_info(self, **kwargs: Any) -> None: # pylint: disable=inco response_headers["Date"] = self._deserialize("rfc-1123", response.headers.get("Date")) response_headers["x-ms-sku-name"] = self._deserialize("str", response.headers.get("x-ms-sku-name")) response_headers["x-ms-account-kind"] = self._deserialize("str", response.headers.get("x-ms-account-kind")) + response_headers["x-ms-is-hns-enabled"] = self._deserialize("bool", response.headers.get("x-ms-is-hns-enabled")) if cls: return cls(pipeline_response, None, response_headers) # type: ignore diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations/_container_operations.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations/_container_operations.py index 7f603c21b594..8772e786345a 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations/_container_operations.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations/_container_operations.py @@ -1732,9 +1732,20 @@ async def list_blob_hierarchy_segment( return deserialized # type: ignore @distributed_trace_async - async def get_account_info(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + async def get_account_info( # pylint: disable=inconsistent-return-statements + self, timeout: Optional[int] = None, request_id_parameter: Optional[str] = None, **kwargs: Any + ) -> None: """Returns the sku name and account kind. + :param timeout: The timeout parameter is expressed in seconds. For more information, see + :code:`Setting + Timeouts for Blob Service Operations.`. Default value is None. + :type timeout: int + :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. Default + value is None. + :type request_id_parameter: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -1756,6 +1767,8 @@ async def get_account_info(self, **kwargs: Any) -> None: # pylint: disable=inco _request = build_get_account_info_request( url=self._config.url, + timeout=timeout, + request_id_parameter=request_id_parameter, restype=restype, comp=comp, version=self._config.version, @@ -1786,6 +1799,7 @@ async def get_account_info(self, **kwargs: Any) -> None: # pylint: disable=inco response_headers["Date"] = self._deserialize("rfc-1123", response.headers.get("Date")) response_headers["x-ms-sku-name"] = self._deserialize("str", response.headers.get("x-ms-sku-name")) response_headers["x-ms-account-kind"] = self._deserialize("str", response.headers.get("x-ms-account-kind")) + response_headers["x-ms-is-hns-enabled"] = self._deserialize("bool", response.headers.get("x-ms-is-hns-enabled")) if cls: return cls(pipeline_response, None, response_headers) # type: ignore diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations/_service_operations.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations/_service_operations.py index b60dcf0a0337..eeb45644cdf2 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations/_service_operations.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations/_service_operations.py @@ -479,9 +479,20 @@ async def get_user_delegation_key( return deserialized # type: ignore @distributed_trace_async - async def get_account_info(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + async def get_account_info( # pylint: disable=inconsistent-return-statements + self, timeout: Optional[int] = None, request_id_parameter: Optional[str] = None, **kwargs: Any + ) -> None: """Returns the sku name and account kind. + :param timeout: The timeout parameter is expressed in seconds. For more information, see + :code:`Setting + Timeouts for Blob Service Operations.`. Default value is None. + :type timeout: int + :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. Default + value is None. + :type request_id_parameter: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -503,6 +514,8 @@ async def get_account_info(self, **kwargs: Any) -> None: # pylint: disable=inco _request = build_get_account_info_request( url=self._config.url, + timeout=timeout, + request_id_parameter=request_id_parameter, restype=restype, comp=comp, version=self._config.version, 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 3d9374f41030..c412a42591ea 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 @@ -67,7 +67,7 @@ def build_create_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_type: Literal["AppendBlob"] = kwargs.pop("blob_type", _headers.pop("x-ms-blob-type", "AppendBlob")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -175,7 +175,7 @@ def build_append_block_request( comp: Literal["appendblock"] = kwargs.pop("comp", _params.pop("comp", "appendblock")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -271,7 +271,7 @@ def build_append_block_from_url_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) comp: Literal["appendblock"] = kwargs.pop("comp", _params.pop("comp", "appendblock")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -369,7 +369,7 @@ def build_seal_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) comp: Literal["seal"] = kwargs.pop("comp", _params.pop("comp", "seal")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL 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 00f174331846..b3eba6f4a8c1 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 @@ -58,7 +58,7 @@ def build_download_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -137,7 +137,7 @@ def build_get_properties_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -205,7 +205,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -256,7 +256,7 @@ def build_undelete_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) comp: Literal["undelete"] = kwargs.pop("comp", _params.pop("comp", "undelete")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -294,7 +294,7 @@ def build_set_expiry_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) comp: Literal["expiry"] = kwargs.pop("comp", _params.pop("comp", "expiry")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -345,7 +345,7 @@ def build_set_http_headers_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) comp: Literal["properties"] = kwargs.pop("comp", _params.pop("comp", "properties")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -414,7 +414,7 @@ def build_set_immutability_policy_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) comp: Literal["immutabilityPolicies"] = kwargs.pop("comp", _params.pop("comp", "immutabilityPolicies")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -456,7 +456,7 @@ def build_delete_immutability_policy_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) comp: Literal["immutabilityPolicies"] = kwargs.pop("comp", _params.pop("comp", "immutabilityPolicies")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -493,7 +493,7 @@ def build_set_legal_hold_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) comp: Literal["legalhold"] = kwargs.pop("comp", _params.pop("comp", "legalhold")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -541,7 +541,7 @@ def build_set_metadata_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) comp: Literal["metadata"] = kwargs.pop("comp", _params.pop("comp", "metadata")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -609,7 +609,7 @@ def build_acquire_lease_request( comp: Literal["lease"] = kwargs.pop("comp", _params.pop("comp", "lease")) action: Literal["acquire"] = kwargs.pop("action", _headers.pop("x-ms-lease-action", "acquire")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -667,7 +667,7 @@ def build_release_lease_request( comp: Literal["lease"] = kwargs.pop("comp", _params.pop("comp", "lease")) action: Literal["release"] = kwargs.pop("action", _headers.pop("x-ms-lease-action", "release")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -722,7 +722,7 @@ def build_renew_lease_request( comp: Literal["lease"] = kwargs.pop("comp", _params.pop("comp", "lease")) action: Literal["renew"] = kwargs.pop("action", _headers.pop("x-ms-lease-action", "renew")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -778,7 +778,7 @@ def build_change_lease_request( comp: Literal["lease"] = kwargs.pop("comp", _params.pop("comp", "lease")) action: Literal["change"] = kwargs.pop("action", _headers.pop("x-ms-lease-action", "change")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -834,7 +834,7 @@ def build_break_lease_request( comp: Literal["lease"] = kwargs.pop("comp", _params.pop("comp", "lease")) action: Literal["break"] = kwargs.pop("action", _headers.pop("x-ms-lease-action", "break")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -894,7 +894,7 @@ def build_create_snapshot_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) comp: Literal["snapshot"] = kwargs.pop("comp", _params.pop("comp", "snapshot")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -973,7 +973,7 @@ def build_start_copy_from_url_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -1076,7 +1076,7 @@ def build_copy_from_url_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) x_ms_requires_sync: Literal["true"] = kwargs.pop("x_ms_requires_sync", _headers.pop("x-ms-requires-sync", "true")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -1168,7 +1168,7 @@ def build_abort_copy_from_url_request( copy_action_abort_constant: Literal["abort"] = kwargs.pop( "copy_action_abort_constant", _headers.pop("x-ms-copy-action", "abort") ) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -1214,7 +1214,7 @@ def build_set_tier_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) comp: Literal["tier"] = kwargs.pop("comp", _params.pop("comp", "tier")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -1250,13 +1250,15 @@ def build_set_tier_request( return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_get_account_info_request(url: str, **kwargs: Any) -> HttpRequest: +def build_get_account_info_request( + url: str, *, timeout: Optional[int] = None, request_id_parameter: Optional[str] = None, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) restype: Literal["account"] = kwargs.pop("restype", _params.pop("restype", "account")) comp: Literal["properties"] = kwargs.pop("comp", _params.pop("comp", "properties")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -1270,9 +1272,13 @@ def build_get_account_info_request(url: str, **kwargs: Any) -> HttpRequest: # Construct parameters _params["restype"] = _SERIALIZER.query("restype", restype, "str") _params["comp"] = _SERIALIZER.query("comp", comp, "str") + if timeout is not None: + _params["timeout"] = _SERIALIZER.query("timeout", timeout, "int", minimum=0) # Construct headers _headers["x-ms-version"] = _SERIALIZER.header("version", version, "str") + if request_id_parameter is not None: + _headers["x-ms-client-request-id"] = _SERIALIZER.header("request_id_parameter", request_id_parameter, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) @@ -1301,7 +1307,7 @@ def build_query_request( comp: Literal["query"] = kwargs.pop("comp", _params.pop("comp", "query")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -1365,7 +1371,7 @@ def build_get_tags_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) comp: Literal["tags"] = kwargs.pop("comp", _params.pop("comp", "tags")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -1416,7 +1422,7 @@ def build_set_tags_request( comp: Literal["tags"] = kwargs.pop("comp", _params.pop("comp", "tags")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -4003,9 +4009,20 @@ def set_tier( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace - def get_account_info(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + def get_account_info( # pylint: disable=inconsistent-return-statements + self, timeout: Optional[int] = None, request_id_parameter: Optional[str] = None, **kwargs: Any + ) -> None: """Returns the sku name and account kind. + :param timeout: The timeout parameter is expressed in seconds. For more information, see + :code:`Setting + Timeouts for Blob Service Operations.`. Default value is None. + :type timeout: int + :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. Default + value is None. + :type request_id_parameter: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -4027,6 +4044,8 @@ def get_account_info(self, **kwargs: Any) -> None: # pylint: disable=inconsiste _request = build_get_account_info_request( url=self._config.url, + timeout=timeout, + request_id_parameter=request_id_parameter, restype=restype, comp=comp, version=self._config.version, @@ -4057,6 +4076,7 @@ def get_account_info(self, **kwargs: Any) -> None: # pylint: disable=inconsiste response_headers["Date"] = self._deserialize("rfc-1123", response.headers.get("Date")) response_headers["x-ms-sku-name"] = self._deserialize("str", response.headers.get("x-ms-sku-name")) response_headers["x-ms-account-kind"] = self._deserialize("str", response.headers.get("x-ms-account-kind")) + response_headers["x-ms-is-hns-enabled"] = self._deserialize("bool", response.headers.get("x-ms-is-hns-enabled")) if cls: return cls(pipeline_response, None, response_headers) # type: ignore 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 e0c427ea8fc3..35164fd08cb6 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 @@ -72,7 +72,7 @@ def build_upload_request( blob_type: Literal["BlockBlob"] = kwargs.pop("blob_type", _headers.pop("x-ms-blob-type", "BlockBlob")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -206,7 +206,7 @@ def build_put_blob_from_url_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_type: Literal["BlockBlob"] = kwargs.pop("blob_type", _headers.pop("x-ms-blob-type", "BlockBlob")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -331,7 +331,7 @@ def build_stage_block_request( comp: Literal["block"] = kwargs.pop("comp", _params.pop("comp", "block")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -407,7 +407,7 @@ def build_stage_block_from_url_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) comp: Literal["block"] = kwargs.pop("comp", _params.pop("comp", "block")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -508,7 +508,7 @@ def build_commit_block_list_request( comp: Literal["blocklist"] = kwargs.pop("comp", _params.pop("comp", "blocklist")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -614,7 +614,7 @@ def build_get_block_list_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) comp: Literal["blocklist"] = kwargs.pop("comp", _params.pop("comp", "blocklist")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_container_operations.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_container_operations.py index f715fc59ce3e..b14eabb97e42 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_container_operations.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_container_operations.py @@ -49,7 +49,7 @@ def build_create_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) restype: Literal["container"] = kwargs.pop("restype", _params.pop("restype", "container")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -98,7 +98,7 @@ def build_get_properties_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) restype: Literal["container"] = kwargs.pop("restype", _params.pop("restype", "container")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -139,7 +139,7 @@ def build_delete_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) restype: Literal["container"] = kwargs.pop("restype", _params.pop("restype", "container")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -185,7 +185,7 @@ def build_set_metadata_request( restype: Literal["container"] = kwargs.pop("restype", _params.pop("restype", "container")) comp: Literal["metadata"] = kwargs.pop("comp", _params.pop("comp", "metadata")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -230,7 +230,7 @@ def build_get_access_policy_request( restype: Literal["container"] = kwargs.pop("restype", _params.pop("restype", "container")) comp: Literal["acl"] = kwargs.pop("comp", _params.pop("comp", "acl")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -276,7 +276,7 @@ def build_set_access_policy_request( restype: Literal["container"] = kwargs.pop("restype", _params.pop("restype", "container")) comp: Literal["acl"] = kwargs.pop("comp", _params.pop("comp", "acl")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -326,7 +326,7 @@ def build_restore_request( restype: Literal["container"] = kwargs.pop("restype", _params.pop("restype", "container")) comp: Literal["undelete"] = kwargs.pop("comp", _params.pop("comp", "undelete")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -374,7 +374,7 @@ def build_rename_request( restype: Literal["container"] = kwargs.pop("restype", _params.pop("restype", "container")) comp: Literal["rename"] = kwargs.pop("comp", _params.pop("comp", "rename")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -418,7 +418,7 @@ def build_submit_batch_request( restype: Literal["container"] = kwargs.pop("restype", _params.pop("restype", "container")) comp: Literal["batch"] = kwargs.pop("comp", _params.pop("comp", "batch")) multipart_content_type: Optional[str] = kwargs.pop("multipart_content_type", _headers.pop("Content-Type", None)) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -463,7 +463,7 @@ def build_filter_blobs_request( restype: Literal["container"] = kwargs.pop("restype", _params.pop("restype", "container")) comp: Literal["blobs"] = kwargs.pop("comp", _params.pop("comp", "blobs")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -514,7 +514,7 @@ def build_acquire_lease_request( comp: Literal["lease"] = kwargs.pop("comp", _params.pop("comp", "lease")) restype: Literal["container"] = kwargs.pop("restype", _params.pop("restype", "container")) action: Literal["acquire"] = kwargs.pop("action", _headers.pop("x-ms-lease-action", "acquire")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -565,7 +565,7 @@ def build_release_lease_request( comp: Literal["lease"] = kwargs.pop("comp", _params.pop("comp", "lease")) restype: Literal["container"] = kwargs.pop("restype", _params.pop("restype", "container")) action: Literal["release"] = kwargs.pop("action", _headers.pop("x-ms-lease-action", "release")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -613,7 +613,7 @@ def build_renew_lease_request( comp: Literal["lease"] = kwargs.pop("comp", _params.pop("comp", "lease")) restype: Literal["container"] = kwargs.pop("restype", _params.pop("restype", "container")) action: Literal["renew"] = kwargs.pop("action", _headers.pop("x-ms-lease-action", "renew")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -661,7 +661,7 @@ def build_break_lease_request( comp: Literal["lease"] = kwargs.pop("comp", _params.pop("comp", "lease")) restype: Literal["container"] = kwargs.pop("restype", _params.pop("restype", "container")) action: Literal["break"] = kwargs.pop("action", _headers.pop("x-ms-lease-action", "break")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -711,7 +711,7 @@ def build_change_lease_request( comp: Literal["lease"] = kwargs.pop("comp", _params.pop("comp", "lease")) restype: Literal["container"] = kwargs.pop("restype", _params.pop("restype", "container")) action: Literal["change"] = kwargs.pop("action", _headers.pop("x-ms-lease-action", "change")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -760,7 +760,7 @@ def build_list_blob_flat_segment_request( restype: Literal["container"] = kwargs.pop("restype", _params.pop("restype", "container")) comp: Literal["list"] = kwargs.pop("comp", _params.pop("comp", "list")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -811,7 +811,7 @@ def build_list_blob_hierarchy_segment_request( # pylint: disable=name-too-long restype: Literal["container"] = kwargs.pop("restype", _params.pop("restype", "container")) comp: Literal["list"] = kwargs.pop("comp", _params.pop("comp", "list")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -846,13 +846,15 @@ def build_list_blob_hierarchy_segment_request( # pylint: disable=name-too-long return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_get_account_info_request(url: str, **kwargs: Any) -> HttpRequest: +def build_get_account_info_request( + url: str, *, timeout: Optional[int] = None, request_id_parameter: Optional[str] = None, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) restype: Literal["account"] = kwargs.pop("restype", _params.pop("restype", "account")) comp: Literal["properties"] = kwargs.pop("comp", _params.pop("comp", "properties")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -866,9 +868,13 @@ def build_get_account_info_request(url: str, **kwargs: Any) -> HttpRequest: # Construct parameters _params["restype"] = _SERIALIZER.query("restype", restype, "str") _params["comp"] = _SERIALIZER.query("comp", comp, "str") + if timeout is not None: + _params["timeout"] = _SERIALIZER.query("timeout", timeout, "int", minimum=0) # Construct headers _headers["x-ms-version"] = _SERIALIZER.header("version", version, "str") + if request_id_parameter is not None: + _headers["x-ms-client-request-id"] = _SERIALIZER.header("request_id_parameter", request_id_parameter, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) @@ -2557,9 +2563,20 @@ def list_blob_hierarchy_segment( return deserialized # type: ignore @distributed_trace - def get_account_info(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + def get_account_info( # pylint: disable=inconsistent-return-statements + self, timeout: Optional[int] = None, request_id_parameter: Optional[str] = None, **kwargs: Any + ) -> None: """Returns the sku name and account kind. + :param timeout: The timeout parameter is expressed in seconds. For more information, see + :code:`Setting + Timeouts for Blob Service Operations.`. Default value is None. + :type timeout: int + :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. Default + value is None. + :type request_id_parameter: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -2581,6 +2598,8 @@ def get_account_info(self, **kwargs: Any) -> None: # pylint: disable=inconsiste _request = build_get_account_info_request( url=self._config.url, + timeout=timeout, + request_id_parameter=request_id_parameter, restype=restype, comp=comp, version=self._config.version, @@ -2611,6 +2630,7 @@ def get_account_info(self, **kwargs: Any) -> None: # pylint: disable=inconsiste response_headers["Date"] = self._deserialize("rfc-1123", response.headers.get("Date")) response_headers["x-ms-sku-name"] = self._deserialize("str", response.headers.get("x-ms-sku-name")) response_headers["x-ms-account-kind"] = self._deserialize("str", response.headers.get("x-ms-account-kind")) + response_headers["x-ms-is-hns-enabled"] = self._deserialize("bool", response.headers.get("x-ms-is-hns-enabled")) if cls: return cls(pipeline_response, None, response_headers) # type: ignore 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 8ff281ca5e1c..63d50d3331a3 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 @@ -70,7 +70,7 @@ def build_create_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_type: Literal["PageBlob"] = kwargs.pop("blob_type", _headers.pop("x-ms-blob-type", "PageBlob")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -186,7 +186,7 @@ def build_upload_pages_request( comp: Literal["page"] = kwargs.pop("comp", _params.pop("comp", "page")) page_write: Literal["update"] = kwargs.pop("page_write", _headers.pop("x-ms-page-write", "update")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -286,7 +286,7 @@ def build_clear_pages_request( comp: Literal["page"] = kwargs.pop("comp", _params.pop("comp", "page")) page_write: Literal["clear"] = kwargs.pop("page_write", _headers.pop("x-ms-page-write", "clear")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -385,7 +385,7 @@ def build_upload_pages_from_url_request( comp: Literal["page"] = kwargs.pop("comp", _params.pop("comp", "page")) page_write: Literal["update"] = kwargs.pop("page_write", _headers.pop("x-ms-page-write", "update")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -492,7 +492,7 @@ def build_get_page_ranges_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) comp: Literal["pagelist"] = kwargs.pop("comp", _params.pop("comp", "pagelist")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -560,7 +560,7 @@ def build_get_page_ranges_diff_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) comp: Literal["pagelist"] = kwargs.pop("comp", _params.pop("comp", "pagelist")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -631,7 +631,7 @@ def build_resize_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) comp: Literal["properties"] = kwargs.pop("comp", _params.pop("comp", "properties")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -698,7 +698,7 @@ def build_update_sequence_number_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) comp: Literal["properties"] = kwargs.pop("comp", _params.pop("comp", "properties")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -757,7 +757,7 @@ def build_copy_incremental_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) comp: Literal["incrementalcopy"] = kwargs.pop("comp", _params.pop("comp", "incrementalcopy")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_service_operations.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_service_operations.py index aa830c3fb769..9f2529836450 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_service_operations.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_service_operations.py @@ -42,7 +42,7 @@ def build_set_properties_request( restype: Literal["service"] = kwargs.pop("restype", _params.pop("restype", "service")) comp: Literal["properties"] = kwargs.pop("comp", _params.pop("comp", "properties")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -78,7 +78,7 @@ def build_get_properties_request( restype: Literal["service"] = kwargs.pop("restype", _params.pop("restype", "service")) comp: Literal["properties"] = kwargs.pop("comp", _params.pop("comp", "properties")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -112,7 +112,7 @@ def build_get_statistics_request( restype: Literal["service"] = kwargs.pop("restype", _params.pop("restype", "service")) comp: Literal["stats"] = kwargs.pop("comp", _params.pop("comp", "stats")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -153,7 +153,7 @@ def build_list_containers_segment_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) comp: Literal["list"] = kwargs.pop("comp", _params.pop("comp", "list")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -195,7 +195,7 @@ def build_get_user_delegation_key_request( restype: Literal["service"] = kwargs.pop("restype", _params.pop("restype", "service")) comp: Literal["userdelegationkey"] = kwargs.pop("comp", _params.pop("comp", "userdelegationkey")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -223,13 +223,15 @@ def build_get_user_delegation_key_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, content=content, **kwargs) -def build_get_account_info_request(url: str, **kwargs: Any) -> HttpRequest: +def build_get_account_info_request( + url: str, *, timeout: Optional[int] = None, request_id_parameter: Optional[str] = None, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) restype: Literal["account"] = kwargs.pop("restype", _params.pop("restype", "account")) comp: Literal["properties"] = kwargs.pop("comp", _params.pop("comp", "properties")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -243,9 +245,13 @@ def build_get_account_info_request(url: str, **kwargs: Any) -> HttpRequest: # Construct parameters _params["restype"] = _SERIALIZER.query("restype", restype, "str") _params["comp"] = _SERIALIZER.query("comp", comp, "str") + if timeout is not None: + _params["timeout"] = _SERIALIZER.query("timeout", timeout, "int", minimum=0) # Construct headers _headers["x-ms-version"] = _SERIALIZER.header("version", version, "str") + if request_id_parameter is not None: + _headers["x-ms-client-request-id"] = _SERIALIZER.header("request_id_parameter", request_id_parameter, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) @@ -265,7 +271,7 @@ def build_submit_batch_request( comp: Literal["batch"] = kwargs.pop("comp", _params.pop("comp", "batch")) multipart_content_type: Optional[str] = kwargs.pop("multipart_content_type", _headers.pop("Content-Type", None)) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -308,7 +314,7 @@ def build_filter_blobs_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) comp: Literal["blobs"] = kwargs.pop("comp", _params.pop("comp", "blobs")) - version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) + version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04")) accept = _headers.pop("Accept", "application/xml") # Construct URL @@ -781,9 +787,20 @@ def get_user_delegation_key( return deserialized # type: ignore @distributed_trace - def get_account_info(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + def get_account_info( # pylint: disable=inconsistent-return-statements + self, timeout: Optional[int] = None, request_id_parameter: Optional[str] = None, **kwargs: Any + ) -> None: """Returns the sku name and account kind. + :param timeout: The timeout parameter is expressed in seconds. For more information, see + :code:`Setting + Timeouts for Blob Service Operations.`. Default value is None. + :type timeout: int + :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. Default + value is None. + :type request_id_parameter: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -805,6 +822,8 @@ def get_account_info(self, **kwargs: Any) -> None: # pylint: disable=inconsiste _request = build_get_account_info_request( url=self._config.url, + timeout=timeout, + request_id_parameter=request_id_parameter, restype=restype, comp=comp, version=self._config.version, diff --git a/sdk/storage/azure-storage-blob/tests/test_common_blob.py b/sdk/storage/azure-storage-blob/tests/test_common_blob.py index fb220012a954..a19f8b003b78 100644 --- a/sdk/storage/azure-storage-blob/tests/test_common_blob.py +++ b/sdk/storage/azure-storage-blob/tests/test_common_blob.py @@ -2601,11 +2601,85 @@ def test_get_account_information(self, **kwargs): # Act self._setup(storage_account_name, storage_account_key) - info = self.bsc.get_account_information() + bsc_info = self.bsc.get_account_information() + container_client = self.bsc.get_container_client(self.container_name) + cc_info = container_client.get_account_information() + blob_client = self._create_blob() + bc_info = blob_client.get_account_information() # Assert - assert info.get('sku_name') is not None - assert info.get('account_kind') is not None + assert bsc_info.get('sku_name') is not None + assert bsc_info.get('account_kind') is not None + assert not bsc_info.get('is_hns_enabled') + assert cc_info.get('sku_name') is not None + assert cc_info.get('account_kind') is not None + assert not cc_info.get('is_hns_enabled') + assert bc_info.get('sku_name') is not None + assert bc_info.get('account_kind') is not None + assert not bc_info.get('is_hns_enabled') + + @BlobPreparer() + @recorded_by_proxy + def test_get_account_information_sas(self, **kwargs): + storage_account_name = kwargs.pop("storage_account_name") + storage_account_key = kwargs.pop("storage_account_key") + self._setup(storage_account_name, storage_account_key) + + account_token = self.generate_sas( + generate_account_sas, + account_name=storage_account_name, + account_key=storage_account_key, + resource_types=ResourceTypes(service=True), + permission=AccountSasPermissions(read=True), + expiry=datetime.utcnow() + timedelta(hours=1), + ) + + container_token = self.generate_sas( + generate_container_sas, + account_name=storage_account_name, + container_name=self.container_name, + account_key=storage_account_key, + permission=ContainerSasPermissions(read=True), + expiry=datetime.utcnow() + timedelta(hours=1), + ) + + blob_token = self.generate_sas( + generate_blob_sas, + account_name=storage_account_name, + container_name=self.container_name, + blob_name=self._get_blob_reference(), + account_key=storage_account_key, + permission=BlobSasPermissions(read=True), + expiry=datetime.utcnow() + timedelta(hours=1), + ) + + # Act + bsc = BlobServiceClient( + self.account_url(storage_account_name, "blob"), + credential=account_token) + bsc_info = bsc.get_account_information() + container_client = ContainerClient( + self.account_url(storage_account_name, "blob"), + self.container_name, + credential=container_token) + cc_info = container_client.get_account_information() + blob_client = BlobClient( + self.account_url(storage_account_name, "blob"), + self.container_name, + self._get_blob_reference(), + credential=blob_token) + bc_info = blob_client.get_account_information() + + # Assert + assert bsc_info.get('sku_name') is not None + assert bsc_info.get('account_kind') is not None + assert not bsc_info.get('is_hns_enabled') + assert cc_info.get('sku_name') is not None + assert cc_info.get('account_kind') is not None + assert not cc_info.get('is_hns_enabled') + assert bc_info.get('sku_name') is not None + assert bc_info.get('account_kind') is not None + assert not bc_info.get('is_hns_enabled') @BlobPreparer() @recorded_by_proxy diff --git a/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py b/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py index 17122ed31dda..9c1f4c2f0464 100644 --- a/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py +++ b/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py @@ -2573,11 +2573,85 @@ async def test_get_account_information(self, **kwargs): # Act await self._setup(storage_account_name, storage_account_key) - info = await self.bsc.get_account_information() + bsc_info = await self.bsc.get_account_information() + container_client = self.bsc.get_container_client(self.container_name) + cc_info = await container_client.get_account_information() + blob_client = await self._create_blob() + bc_info = await blob_client.get_account_information() # Assert - assert info.get('sku_name') is not None - assert info.get('account_kind') is not None + assert bsc_info.get('sku_name') is not None + assert bsc_info.get('account_kind') is not None + assert not bsc_info.get('is_hns_enabled') + assert cc_info.get('sku_name') is not None + assert cc_info.get('account_kind') is not None + assert not cc_info.get('is_hns_enabled') + assert bc_info.get('sku_name') is not None + assert bc_info.get('account_kind') is not None + assert not bc_info.get('is_hns_enabled') + + @BlobPreparer() + @recorded_by_proxy_async + async def test_get_account_information_sas(self, **kwargs): + storage_account_name = kwargs.pop("storage_account_name") + storage_account_key = kwargs.pop("storage_account_key") + await self._setup(storage_account_name, storage_account_key) + + account_token = self.generate_sas( + generate_account_sas, + account_name=storage_account_name, + account_key=storage_account_key, + resource_types=ResourceTypes(service=True), + permission=AccountSasPermissions(read=True), + expiry=datetime.utcnow() + timedelta(hours=1), + ) + + container_token = self.generate_sas( + generate_container_sas, + account_name=storage_account_name, + container_name=self.container_name, + account_key=storage_account_key, + permission=ContainerSasPermissions(read=True), + expiry=datetime.utcnow() + timedelta(hours=1), + ) + + blob_token = self.generate_sas( + generate_blob_sas, + account_name=storage_account_name, + container_name=self.container_name, + blob_name=self._get_blob_reference(), + account_key=storage_account_key, + permission=BlobSasPermissions(read=True), + expiry=datetime.utcnow() + timedelta(hours=1), + ) + + # Act + bsc = BlobServiceClient( + self.account_url(storage_account_name, "blob"), + credential=account_token) + bsc_info = await bsc.get_account_information() + container_client = ContainerClient( + self.account_url(storage_account_name, "blob"), + self.container_name, + credential=container_token) + cc_info = await container_client.get_account_information() + blob_client = BlobClient( + self.account_url(storage_account_name, "blob"), + self.container_name, + self._get_blob_reference(), + credential=blob_token) + bc_info = await blob_client.get_account_information() + + # Assert + assert bsc_info.get('sku_name') is not None + assert bsc_info.get('account_kind') is not None + assert not bsc_info.get('is_hns_enabled') + assert cc_info.get('sku_name') is not None + assert cc_info.get('account_kind') is not None + assert not cc_info.get('is_hns_enabled') + assert bc_info.get('sku_name') is not None + assert bc_info.get('account_kind') is not None + assert not bc_info.get('is_hns_enabled') @BlobPreparer() @recorded_by_proxy_async