rename BlockListTypeOption -> BlockListType (#1945)

This commit is contained in:
JinmingHu 2021-03-19 17:54:57 +08:00 committed by GitHub
parent ea2186bee3
commit c3a9d67d01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 15 deletions

View File

@ -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)

View File

@ -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.

View File

@ -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<int32_t> Timeout;
BlockListTypeOption ListType = BlockListTypeOption::Committed;
BlockListType ListType = BlockListType::Committed;
Azure::Nullable<std::string> LeaseId;
Azure::Nullable<std::string> IfTags;
}; // struct GetBlockListOptions

View File

@ -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");

View File

@ -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<int64_t>(block1Content.size()));
ASSERT_FALSE(res->UncommittedBlocks.empty());