remove public fields from operation<T> (#1939)
This commit is contained in:
parent
1b316d3b44
commit
b88eb6d785
@ -66,13 +66,6 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
} // namespace Models
|
||||
|
||||
class StartCopyBlobOperation : public Azure::Core::Operation<Models::BlobProperties> {
|
||||
public:
|
||||
Azure::ETag ETag;
|
||||
Azure::DateTime LastModified;
|
||||
std::string CopyId;
|
||||
Models::CopyStatus CopyStatus;
|
||||
Azure::Nullable<std::string> VersionId;
|
||||
|
||||
public:
|
||||
Models::BlobProperties Value() const override { return m_pollResult; }
|
||||
|
||||
|
||||
@ -562,11 +562,6 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
*m_pipeline, m_blobUrl, protocolLayerOptions, context);
|
||||
StartCopyBlobOperation res;
|
||||
res.m_rawResponse = response.ExtractRawResponse();
|
||||
res.ETag = std::move(response->ETag);
|
||||
res.LastModified = std::move(response->LastModified);
|
||||
res.CopyId = std::move(response->CopyId);
|
||||
res.CopyStatus = std::move(response->CopyStatus);
|
||||
res.VersionId = std::move(response->VersionId);
|
||||
res.m_blobClient = std::make_shared<BlobClient>(*this);
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -302,11 +302,6 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
*m_pipeline, m_blobUrl, protocolLayerOptions, context);
|
||||
StartCopyBlobOperation res;
|
||||
res.m_rawResponse = response.ExtractRawResponse();
|
||||
res.ETag = std::move(response->ETag);
|
||||
res.LastModified = std::move(response->LastModified);
|
||||
res.CopyId = std::move(response->CopyId);
|
||||
res.CopyStatus = std::move(response->CopyStatus);
|
||||
res.VersionId = std::move(response->VersionId);
|
||||
res.m_blobClient = std::make_shared<BlobClient>(*this);
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -206,16 +206,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
auto blobClient = m_blobContainerClient->GetBlobClient(RandomString());
|
||||
auto res = blobClient.StartCopyFromUri(m_blockBlobClient->GetUrl());
|
||||
EXPECT_EQ(res.GetRawResponse().GetStatusCode(), Azure::Core::Http::HttpStatusCode::Accepted);
|
||||
EXPECT_TRUE(res.ETag.HasValue());
|
||||
EXPECT_TRUE(IsValidTime(res.LastModified));
|
||||
EXPECT_FALSE(res.CopyId.empty());
|
||||
EXPECT_TRUE(res.VersionId.HasValue());
|
||||
EXPECT_FALSE(res.VersionId.GetValue().empty());
|
||||
EXPECT_TRUE(
|
||||
res.CopyStatus == Azure::Storage::Blobs::Models::CopyStatus::Pending
|
||||
|| res.CopyStatus == Azure::Storage::Blobs::Models::CopyStatus::Success);
|
||||
auto properties = *blobClient.GetProperties();
|
||||
EXPECT_EQ(properties.CopyId.GetValue(), res.CopyId);
|
||||
EXPECT_FALSE(properties.CopySource.GetValue().empty());
|
||||
EXPECT_TRUE(
|
||||
properties.CopyStatus.GetValue() == Azure::Storage::Blobs::Models::CopyStatus::Pending
|
||||
@ -230,7 +221,6 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
EXPECT_FALSE(properties.IncrementalCopyDestinationSnapshot.HasValue());
|
||||
|
||||
auto downloadResult = blobClient.Download();
|
||||
EXPECT_EQ(downloadResult->Details.CopyId.GetValue(), res.CopyId);
|
||||
EXPECT_FALSE(downloadResult->Details.CopySource.GetValue().empty());
|
||||
EXPECT_TRUE(
|
||||
downloadResult->Details.CopyStatus.GetValue()
|
||||
|
||||
@ -151,12 +151,6 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
auto copyInfo = pageBlobClient.StartCopyIncremental(sourceUri.GetAbsoluteUrl());
|
||||
EXPECT_EQ(
|
||||
copyInfo.GetRawResponse().GetStatusCode(), Azure::Core::Http::HttpStatusCode::Accepted);
|
||||
EXPECT_TRUE(copyInfo.ETag.HasValue());
|
||||
EXPECT_TRUE(IsValidTime(copyInfo.LastModified));
|
||||
EXPECT_FALSE(copyInfo.CopyId.empty());
|
||||
EXPECT_FALSE(copyInfo.CopyStatus.ToString().empty());
|
||||
EXPECT_TRUE(copyInfo.VersionId.HasValue());
|
||||
EXPECT_FALSE(copyInfo.VersionId.GetValue().empty());
|
||||
auto getPropertiesResult = copyInfo.PollUntilDone(std::chrono::seconds(1));
|
||||
ASSERT_TRUE(getPropertiesResult->CopyStatus.HasValue());
|
||||
EXPECT_EQ(getPropertiesResult->CopyStatus.GetValue(), Blobs::Models::CopyStatus::Success);
|
||||
|
||||
@ -171,13 +171,6 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
} // namespace Models
|
||||
|
||||
class StartCopyFileOperation : public Azure::Core::Operation<Models::FileProperties> {
|
||||
public:
|
||||
Azure::ETag ETag;
|
||||
Azure::DateTime LastModified;
|
||||
std::string CopyId;
|
||||
Models::CopyStatusType CopyStatus;
|
||||
Nullable<std::string> VersionId;
|
||||
|
||||
public:
|
||||
Models::FileProperties Value() const override { return m_pollResult; }
|
||||
|
||||
|
||||
@ -373,10 +373,6 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
|
||||
StartCopyFileOperation res;
|
||||
res.m_rawResponse = response.ExtractRawResponse();
|
||||
res.ETag = std::move(response->ETag);
|
||||
res.LastModified = std::move(response->LastModified);
|
||||
res.CopyId = std::move(response->CopyId);
|
||||
res.CopyStatus = std::move(response->CopyStatus);
|
||||
res.m_fileClient = std::make_shared<ShareFileClient>(*this);
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -682,10 +682,6 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
EXPECT_EQ(
|
||||
copyOperation.GetRawResponse().GetStatusCode(),
|
||||
Azure::Core::Http::HttpStatusCode::Accepted);
|
||||
EXPECT_TRUE(copyOperation.ETag.HasValue());
|
||||
EXPECT_TRUE(IsValidTime(copyOperation.LastModified));
|
||||
EXPECT_FALSE(copyOperation.CopyId.empty());
|
||||
EXPECT_FALSE(copyOperation.CopyStatus.ToString().empty());
|
||||
auto fileProperties = *copyOperation.PollUntilDone(std::chrono::milliseconds(1000));
|
||||
EXPECT_EQ(
|
||||
fileProperties.CopyStatus.GetValue(), Files::Shares::Models::CopyStatusType::Success);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user