return rawresponse for copy operation (#1807)
* return rawresponse for copy operation * also for file copy * remove noexcept
This commit is contained in:
parent
9dedcb0d4c
commit
01ae3714f1
@ -87,11 +87,13 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
* @return A pointer to #Azure::Core::Http::RawResponse.
|
||||
* @note Does not give up ownership of the RawResponse.
|
||||
*/
|
||||
Azure::Core::Http::RawResponse* GetRawResponse() const override
|
||||
{
|
||||
// TODO: Fix to return the rawResponse
|
||||
return nullptr;
|
||||
}
|
||||
Azure::Core::Http::RawResponse* GetRawResponse() const override { return m_rawResponse.get(); }
|
||||
|
||||
StartCopyBlobOperation() = default;
|
||||
|
||||
StartCopyBlobOperation(StartCopyBlobOperation&&) = default;
|
||||
|
||||
StartCopyBlobOperation& operator=(StartCopyBlobOperation&&) = default;
|
||||
|
||||
~StartCopyBlobOperation() override {}
|
||||
|
||||
@ -109,6 +111,7 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
std::chrono::milliseconds period,
|
||||
Azure::Core::Context& context) override;
|
||||
|
||||
std::unique_ptr<Azure::Core::Http::RawResponse> m_rawResponse;
|
||||
std::shared_ptr<BlobClient> m_blobClient;
|
||||
Models::GetBlobPropertiesResult m_pollResult;
|
||||
|
||||
|
||||
@ -545,6 +545,7 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
auto response = Details::BlobRestClient::Blob::StartCopyFromUri(
|
||||
context, *m_pipeline, m_blobUrl, protocolLayerOptions);
|
||||
StartCopyBlobOperation res;
|
||||
res.m_rawResponse = response.ExtractRawResponse();
|
||||
res.RequestId = std::move(response->RequestId);
|
||||
res.ETag = std::move(response->ETag);
|
||||
res.LastModified = std::move(response->LastModified);
|
||||
|
||||
@ -304,6 +304,7 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
auto response = Details::BlobRestClient::PageBlob::StartCopyIncremental(
|
||||
context, *m_pipeline, m_blobUrl, protocolLayerOptions);
|
||||
StartCopyBlobOperation res;
|
||||
res.m_rawResponse = response.ExtractRawResponse();
|
||||
res.RequestId = std::move(response->RequestId);
|
||||
res.ETag = std::move(response->ETag);
|
||||
res.LastModified = std::move(response->LastModified);
|
||||
|
||||
@ -205,6 +205,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
{
|
||||
auto blobClient = m_blobContainerClient->GetBlobClient(RandomString());
|
||||
auto res = blobClient.StartCopyFromUri(m_blockBlobClient->GetUrl());
|
||||
EXPECT_NE(res.GetRawResponse(), nullptr);
|
||||
EXPECT_FALSE(res.RequestId.empty());
|
||||
EXPECT_TRUE(res.ETag.HasValue());
|
||||
EXPECT_TRUE(IsValidTime(res.LastModified));
|
||||
|
||||
@ -150,6 +150,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
Azure::Core::Http::Url sourceUri(m_pageBlobClient->WithSnapshot(snapshot).GetUrl());
|
||||
sourceUri.AppendQueryParameters(GetSas());
|
||||
auto copyInfo = pageBlobClient.StartCopyIncremental(sourceUri.GetAbsoluteUrl());
|
||||
EXPECT_NE(copyInfo.GetRawResponse(), nullptr);
|
||||
EXPECT_FALSE(copyInfo.RequestId.empty());
|
||||
EXPECT_TRUE(copyInfo.ETag.HasValue());
|
||||
EXPECT_TRUE(IsValidTime(copyInfo.LastModified));
|
||||
|
||||
@ -203,11 +203,13 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
* @return A pointer to #Azure::Core::Http::RawResponse.
|
||||
* @note Does not give up ownership of the RawResponse.
|
||||
*/
|
||||
Azure::Core::Http::RawResponse* GetRawResponse() const override
|
||||
{
|
||||
// TODO: Fix to return the rawResponse
|
||||
return nullptr;
|
||||
}
|
||||
Azure::Core::Http::RawResponse* GetRawResponse() const override { return m_rawResponse.get(); }
|
||||
|
||||
StartCopyShareFileOperation() = default;
|
||||
|
||||
StartCopyShareFileOperation(StartCopyShareFileOperation&&) = default;
|
||||
|
||||
StartCopyShareFileOperation& operator=(StartCopyShareFileOperation&&) = default;
|
||||
|
||||
~StartCopyShareFileOperation() override {}
|
||||
|
||||
@ -225,6 +227,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
std::chrono::milliseconds period,
|
||||
Azure::Core::Context& context) override;
|
||||
|
||||
std::unique_ptr<Azure::Core::Http::RawResponse> m_rawResponse;
|
||||
std::shared_ptr<ShareFileClient> m_fileClient;
|
||||
Models::GetShareFilePropertiesResult m_pollResult;
|
||||
|
||||
|
||||
@ -374,6 +374,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_shareFileUrl, *m_pipeline, context, protocolLayerOptions);
|
||||
|
||||
StartCopyShareFileOperation res;
|
||||
res.m_rawResponse = response.ExtractRawResponse();
|
||||
res.RequestId = std::move(response->RequestId);
|
||||
res.ETag = std::move(response->ETag);
|
||||
res.LastModified = std::move(response->LastModified);
|
||||
|
||||
@ -680,6 +680,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
auto destFileClient
|
||||
= m_shareClient->GetRootDirectoryClient().GetFileClient(LowercaseRandomString(10));
|
||||
auto copyOperation = destFileClient.StartCopy(fileClient.GetUrl());
|
||||
EXPECT_NE(copyOperation.GetRawResponse(), nullptr);
|
||||
EXPECT_FALSE(copyOperation.RequestId.empty());
|
||||
EXPECT_TRUE(copyOperation.ETag.HasValue());
|
||||
EXPECT_TRUE(IsValidTime(copyOperation.LastModified));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user