remove response<void> (#1785)
* not return response<void> anymore * remove response<void> template specialization * changelog
This commit is contained in:
parent
35e7f292fc
commit
d6e88c2603
@ -96,35 +96,4 @@ namespace Azure { namespace Core {
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Wraps raw HTTP response into a response of a void type.
|
||||
*/
|
||||
template <> class Response<void> {
|
||||
std::unique_ptr<Http::RawResponse> m_rawResponse;
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Initialize a #Azure::Core::Response<void> with a raw response.
|
||||
*
|
||||
* @param rawResponse Raw HTTP response.
|
||||
*/
|
||||
explicit Response(std::unique_ptr<Http::RawResponse>&& rawResponse)
|
||||
: m_rawResponse(std::move(rawResponse))
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get raw HTTP response.
|
||||
*/
|
||||
// Do not give up raw response ownership.
|
||||
Http::RawResponse& GetRawResponse() { return *this->m_rawResponse; }
|
||||
|
||||
/**
|
||||
* @brief Get a smart pointer rvalue reference to the value of a specific type.
|
||||
*/
|
||||
std::unique_ptr<Http::RawResponse>&& ExtractRawResponse()
|
||||
{
|
||||
return std::move(this->m_rawResponse);
|
||||
}
|
||||
};
|
||||
}} // namespace Azure::Core
|
||||
|
||||
@ -11,6 +11,11 @@
|
||||
- Changed the return type of `StartCopyFromUri` and `StartCopyIncremental` API from a `Response<T>` to the particular `Operation<T>` type called `StartCopyBlobOperation` directly.
|
||||
- String conversion functions of extensible enums were renamed from `Get()` to `ToString()`.
|
||||
|
||||
### Other Changes and Improvements
|
||||
|
||||
- Changed return type of `BlobServiceClient::DeleteBlobContainer` to `Azure::Core::Response<Models::DeleteBlobContainerResult>`.
|
||||
- Changed return type of `BlobContainerClient::DeleteBlob` to `Azure::Core::Response<Models::DeleteBlobResult>`.
|
||||
|
||||
## 12.0.0-beta.8 (2021-02-12)
|
||||
|
||||
### Breaking Changes
|
||||
|
||||
@ -266,9 +266,9 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
* @param blobName The name of the blob to delete.
|
||||
* @param options Optional parameters to execute this function.
|
||||
* @param context Context for cancelling long running operations.
|
||||
* @return Nothing.
|
||||
* @return A DeleteBlobResult on successfully deleting.
|
||||
*/
|
||||
Azure::Core::Response<void> DeleteBlob(
|
||||
Azure::Core::Response<Models::DeleteBlobResult> DeleteBlob(
|
||||
const std::string& blobName,
|
||||
const DeleteBlobOptions& options = DeleteBlobOptions(),
|
||||
const Azure::Core::Context& context = Azure::Core::Context()) const;
|
||||
|
||||
@ -209,9 +209,9 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
* @param blobContainerName The name of the container to delete.
|
||||
* @param options Optional parameters to execute this function.
|
||||
* @param context Context for cancelling long running operations.
|
||||
* @return Nothing.
|
||||
* @return A DeleteBlobContainerResult if successful.
|
||||
*/
|
||||
Azure::Core::Response<void> DeleteBlobContainer(
|
||||
Azure::Core::Response<Models::DeleteBlobContainerResult> DeleteBlobContainer(
|
||||
const std::string& blobContainerName,
|
||||
const DeleteBlobContainerOptions& options = DeleteBlobContainerOptions(),
|
||||
const Azure::Core::Context& context = Azure::Core::Context()) const;
|
||||
|
||||
@ -291,14 +291,13 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
context, *m_pipeline, m_blobContainerUrl, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<void> BlobContainerClient::DeleteBlob(
|
||||
Azure::Core::Response<Models::DeleteBlobResult> BlobContainerClient::DeleteBlob(
|
||||
const std::string& blobName,
|
||||
const DeleteBlobOptions& options,
|
||||
const Azure::Core::Context& context) const
|
||||
{
|
||||
auto blobClient = GetBlobClient(blobName);
|
||||
auto response = blobClient.Delete(options, context);
|
||||
return Azure::Core::Response<void>(response.ExtractRawResponse());
|
||||
return blobClient.Delete(options, context);
|
||||
}
|
||||
|
||||
Azure::Core::Response<BlockBlobClient> BlobContainerClient::UploadBlob(
|
||||
|
||||
@ -188,14 +188,13 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
std::move(blobContainerClient), response.ExtractRawResponse());
|
||||
}
|
||||
|
||||
Azure::Core::Response<void> BlobServiceClient::DeleteBlobContainer(
|
||||
Azure::Core::Response<Models::DeleteBlobContainerResult> BlobServiceClient::DeleteBlobContainer(
|
||||
const std::string& blobContainerName,
|
||||
const DeleteBlobContainerOptions& options,
|
||||
const Azure::Core::Context& context) const
|
||||
{
|
||||
auto blobContainerClient = GetBlobContainerClient(blobContainerName);
|
||||
auto response = blobContainerClient.Delete(options, context);
|
||||
return Azure::Core::Response<void>(response.ExtractRawResponse());
|
||||
return blobContainerClient.Delete(options, context);
|
||||
}
|
||||
|
||||
Azure::Core::Response<BlobContainerClient> BlobServiceClient::UndeleteBlobContainer(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user