From be29d332c253862141cc08fe7cd7dd8fd76ca09a Mon Sep 17 00:00:00 2001 From: Kan Tang Date: Fri, 21 May 2021 00:08:23 -0700 Subject: [PATCH] Change ContentLength to FileSize. (#2338) Fixes https://github.com/Azure/azure-sdk-for-cpp/issues/2334 # Pull Request Checklist Please leverage this checklist as a reminder to address commonly occurring feedback when submitting a pull request to make sure your PR can be reviewed quickly: See the detailed list in the [contributing guide](https://github.com/Azure/azure-sdk-for-cpp/blob/master/CONTRIBUTING.md#pull-requests). - [x] [C++ Guidelines](https://azure.github.io/azure-sdk/cpp_introduction.html) - [x] Doxygen docs - [x] Unit tests - [x] No unwanted commits/changes - [x] Descriptive title/description - [x] PR is single purpose - [x] Related issue listed - [x] Comments in source - [x] No typos - [x] Update changelog - [x] Not work-in-progress - [x] External references or docs updated - [x] Self review of PR done - [x] Any breaking changes? --- sdk/storage/azure-storage-files-datalake/CHANGELOG.md | 1 + .../storage/files/datalake/protocol/datalake_rest_client.hpp | 5 ++--- sdk/storage/azure-storage-files-shares/CHANGELOG.md | 1 + .../storage/files/shares/protocol/share_rest_client.hpp | 4 ++-- .../test/share_directory_client_test.cpp | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/sdk/storage/azure-storage-files-datalake/CHANGELOG.md b/sdk/storage/azure-storage-files-datalake/CHANGELOG.md index 59ffa7970..d6e90881d 100644 --- a/sdk/storage/azure-storage-files-datalake/CHANGELOG.md +++ b/sdk/storage/azure-storage-files-datalake/CHANGELOG.md @@ -15,6 +15,7 @@ - Renamed `HasMorePages()` in paged response to `HasPage()`. - Default chunk size for concurrent upload was changed to nullable. - `DataLakeLeaseClient::Change()` updates internal lease id. +- Renamed `ContentLength` in `FlushFileResult` to `FileSize`. ## 12.0.0-beta.10 (2021-04-16) diff --git a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/protocol/datalake_rest_client.hpp b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/protocol/datalake_rest_client.hpp index 94f0b6a73..6c3e289fe 100644 --- a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/protocol/datalake_rest_client.hpp +++ b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/protocol/datalake_rest_client.hpp @@ -265,7 +265,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { /** * The size of the resource in bytes. */ - int64_t ContentLength = int64_t(); + int64_t FileSize = int64_t(); }; /** @@ -1634,8 +1634,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { if (response.GetHeaders().find(_detail::HeaderContentLength) != response.GetHeaders().end()) { - result.ContentLength - = std::stoll(response.GetHeaders().at(_detail::HeaderContentLength)); + result.FileSize = std::stoll(response.GetHeaders().at(_detail::HeaderContentLength)); } return Azure::Response( std::move(result), std::move(responsePtr)); diff --git a/sdk/storage/azure-storage-files-shares/CHANGELOG.md b/sdk/storage/azure-storage-files-shares/CHANGELOG.md index 27ae9b7f5..8fb92fb72 100644 --- a/sdk/storage/azure-storage-files-shares/CHANGELOG.md +++ b/sdk/storage/azure-storage-files-shares/CHANGELOG.md @@ -15,6 +15,7 @@ - Renamed `HasMorePages()` in paged response to `HasPage()`. - `ShareLeaseClient::Change()` updates internal lease id. - `ShareItem::ShareMetadata` was renamed to `ShareItem::Metadata`. +- Renamed `ContentLength` in `FileItemDetails` to `FileSize`. ## 12.0.0-beta.10 (2021-04-16) diff --git a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/protocol/share_rest_client.hpp b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/protocol/share_rest_client.hpp index 2e7e246a7..029d35e65 100644 --- a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/protocol/share_rest_client.hpp +++ b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/protocol/share_rest_client.hpp @@ -251,7 +251,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { * handle is closed or the op-lock is broken. To retrieve current property values, call Get * File Properties. */ - int64_t ContentLength = int64_t(); + int64_t FileSize = int64_t(); }; /** @@ -5805,7 +5805,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { if (path.size() == 1 && path[0] == XmlTagName::ContentLength) { - result.ContentLength = std::stoll(node.Value); + result.FileSize = std::stoll(node.Value); } } } diff --git a/sdk/storage/azure-storage-files-shares/test/share_directory_client_test.cpp b/sdk/storage/azure-storage-files-shares/test/share_directory_client_test.cpp index 6507f2cc9..31e8136af 100644 --- a/sdk/storage/azure-storage-files-shares/test/share_directory_client_test.cpp +++ b/sdk/storage/azure-storage-files-shares/test/share_directory_client_test.cpp @@ -391,7 +391,7 @@ namespace Azure { namespace Storage { namespace Test { result.first.end(), [&name](const Files::Shares::Models::FileItem& item) { return item.Name == name; }); EXPECT_EQ(iter->Name, name); - EXPECT_EQ(1024, iter->Details.ContentLength); + EXPECT_EQ(1024, iter->Details.FileSize); EXPECT_NE(result.first.end(), iter); } for (const auto& name : directoryNameSetB)