From c3a9d67d01f5e75f050048514f80b9826fce76d8 Mon Sep 17 00:00:00 2001 From: JinmingHu Date: Fri, 19 Mar 2021 17:54:57 +0800 Subject: [PATCH] rename BlockListTypeOption -> BlockListType (#1945) --- sdk/storage/azure-storage-blobs/CHANGELOG.md | 1 + .../inc/azure/storage/blobs/blob_options.hpp | 2 +- .../blobs/protocol/blob_rest_client.hpp | 20 +++++++++---------- .../src/blob_rest_client.cpp | 6 +++--- .../test/ut/block_blob_client_test.cpp | 2 +- 5 files changed, 16 insertions(+), 15 deletions(-) diff --git a/sdk/storage/azure-storage-blobs/CHANGELOG.md b/sdk/storage/azure-storage-blobs/CHANGELOG.md index 965d147ca..08559d0b7 100644 --- a/sdk/storage/azure-storage-blobs/CHANGELOG.md +++ b/sdk/storage/azure-storage-blobs/CHANGELOG.md @@ -41,6 +41,7 @@ - Removed `RequestId` from return types. - Changed `BodyStream` parameter of `UploadBlob`, `Upload`, `UploadPages` and `AppendBlock`functions from pointer to reference. - Renamed access tier members in return types and options from `Tier` to `AccessTier`. +- Renamed `BlockListTypeOption` to `BlockListType`. ## 12.0.0-beta.8 (2021-02-12) diff --git a/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/blob_options.hpp b/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/blob_options.hpp index 278df5e89..8a07d32c3 100644 --- a/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/blob_options.hpp +++ b/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/blob_options.hpp @@ -829,7 +829,7 @@ namespace Azure { namespace Storage { namespace Blobs { * @brief Specifies whether to return the list of committed blocks, the list of uncommitted * blocks, or both lists together. */ - Models::BlockListTypeOption ListType = Models::BlockListTypeOption::Committed; + Models::BlockListType ListType = Models::BlockListType::Committed; /** * @brief Optional conditions that must be met to perform this operation. diff --git a/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/protocol/blob_rest_client.hpp b/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/protocol/blob_rest_client.hpp index 4be862aca..ad6e3da5d 100644 --- a/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/protocol/blob_rest_client.hpp +++ b/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/protocol/blob_rest_client.hpp @@ -138,20 +138,20 @@ namespace Azure { namespace Storage { namespace Blobs { std::string m_value; }; // extensible enum BlobType - class BlockListTypeOption { + class BlockListType { public: - BlockListTypeOption() = default; - explicit BlockListTypeOption(std::string value) : m_value(std::move(value)) {} - bool operator==(const BlockListTypeOption& other) const { return m_value == other.m_value; } - bool operator!=(const BlockListTypeOption& other) const { return !(*this == other); } + BlockListType() = default; + explicit BlockListType(std::string value) : m_value(std::move(value)) {} + bool operator==(const BlockListType& other) const { return m_value == other.m_value; } + bool operator!=(const BlockListType& other) const { return !(*this == other); } const std::string& ToString() const { return m_value; } - AZ_STORAGE_BLOBS_DLLEXPORT const static BlockListTypeOption Committed; - AZ_STORAGE_BLOBS_DLLEXPORT const static BlockListTypeOption Uncommitted; - AZ_STORAGE_BLOBS_DLLEXPORT const static BlockListTypeOption All; + AZ_STORAGE_BLOBS_DLLEXPORT const static BlockListType Committed; + AZ_STORAGE_BLOBS_DLLEXPORT const static BlockListType Uncommitted; + AZ_STORAGE_BLOBS_DLLEXPORT const static BlockListType All; private: std::string m_value; - }; // extensible enum BlockListTypeOption + }; // extensible enum BlockListType class BlockType { public: @@ -7312,7 +7312,7 @@ namespace Azure { namespace Storage { namespace Blobs { struct GetBlockListOptions { Azure::Nullable Timeout; - BlockListTypeOption ListType = BlockListTypeOption::Committed; + BlockListType ListType = BlockListType::Committed; Azure::Nullable LeaseId; Azure::Nullable IfTags; }; // struct GetBlockListOptions diff --git a/sdk/storage/azure-storage-blobs/src/blob_rest_client.cpp b/sdk/storage/azure-storage-blobs/src/blob_rest_client.cpp index 879321c26..1930fa821 100644 --- a/sdk/storage/azure-storage-blobs/src/blob_rest_client.cpp +++ b/sdk/storage/azure-storage-blobs/src/blob_rest_client.cpp @@ -36,9 +36,9 @@ namespace Azure { namespace Storage { namespace Blobs { namespace Models { const BlobType BlobType::PageBlob("PageBlob"); const BlobType BlobType::AppendBlob("AppendBlob"); - const BlockListTypeOption BlockListTypeOption::Committed("committed"); - const BlockListTypeOption BlockListTypeOption::Uncommitted("uncommitted"); - const BlockListTypeOption BlockListTypeOption::All("all"); + const BlockListType BlockListType::Committed("committed"); + const BlockListType BlockListType::Uncommitted("uncommitted"); + const BlockListType BlockListType::All("all"); const BlockType BlockType::Committed("Committed"); const BlockType BlockType::Uncommitted("Uncommitted"); diff --git a/sdk/storage/azure-storage-blobs/test/ut/block_blob_client_test.cpp b/sdk/storage/azure-storage-blobs/test/ut/block_blob_client_test.cpp index 6961df443..2656554de 100644 --- a/sdk/storage/azure-storage-blobs/test/ut/block_blob_client_test.cpp +++ b/sdk/storage/azure-storage-blobs/test/ut/block_blob_client_test.cpp @@ -406,7 +406,7 @@ namespace Azure { namespace Storage { namespace Test { blockBlobClient.StageBlockFromUri(blockId2, m_blockBlobClient->GetUrl() + GetSas()); Blobs::GetBlockListOptions options2; - options2.ListType = Blobs::Models::BlockListTypeOption::All; + options2.ListType = Blobs::Models::BlockListType::All; res = blockBlobClient.GetBlockList(options2); EXPECT_EQ(res->BlobSize, static_cast(block1Content.size())); ASSERT_FALSE(res->UncommittedBlocks.empty());