Operations need to provide the RawResponse (#1803)

* Operations should expose the RawResposne
Added the pure virtual method
This commit is contained in:
Rick Winter 2021-03-05 20:33:14 -08:00 committed by GitHub
parent 3b88c7bb83
commit 9dedcb0d4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 39 additions and 23 deletions

View File

@ -89,11 +89,6 @@
"name": "BUILD_PERFORMANCE_TESTS",
"value": "true",
"type": "BOOL"
},
{
"name": "CMAKE_BUILD_TYPE",
"value": "MinSizeRel",
"type": "STRING"
}
]
},
@ -137,11 +132,6 @@
"name": "BUILD_PERFORMANCE_TESTS",
"value": "True",
"type": "BOOL"
},
{
"name": "CMAKE_BUILD_TYPE",
"value": "MinSizeRel",
"type": "STRING"
}
]
},
@ -180,11 +170,6 @@
"name": "BUILD_PERFORMANCE_TESTS",
"value": "True",
"type": "BOOL"
},
{
"name": "CMAKE_BUILD_TYPE",
"value": "MinSizeRel",
"type": "STRING"
}
]
},
@ -218,11 +203,6 @@
"name": "BUILD_PERFORMANCE_TESTS",
"value": "True",
"type": "BOOL"
},
{
"name": "CMAKE_BUILD_TYPE",
"value": "MinSizeRel",
"type": "STRING"
}
]
}

View File

@ -11,6 +11,7 @@
- Removed `Azure::Core::Http::HttpPipeline` by making it internal, used only within the SDK.
- Split `Azure::Core::RequestConditions` into `Azure::Core::MatchConditions` and `Azure::Core::ModifiedConditions`.
- Removed `TransportKind` enum from `Azure::Core::Http`.
- Added `Azure::Core::Operation<T>::GetRawResponse().`
- Renamed `NoRevoke` to `EnableCertificateRevocationListCheck` for `Azure::Core::Http::CurlTransportSSLOptions`.
- Renamed `GetString()` to `ToString()` in `Azure::Core::DateTime`.
- Renamed `GetUuidString()` to `ToString()` in `Azure::Core::Uuid`.

View File

@ -51,6 +51,13 @@ namespace Azure { namespace Core {
*/
virtual std::string GetResumeToken() const = 0;
/**
* @brief Get the raw HTTP response.
* @return A pointer to #Azure::Core::Http::RawResponse.
* @note Does not give up ownership of the RawResponse.
*/
virtual Azure::Core::Http::RawResponse* GetRawResponse() const = 0;
/**
* @brief Returns the current #Azure::Core::OperationStatus of the long-running operation.
*/

View File

@ -19,9 +19,9 @@ namespace Azure { namespace Core { namespace Test {
class StringOperation : public Operation<std::string> {
private:
StringClient* m_client;
std::string m_operationToken;
std::string m_value;
std::unique_ptr<Azure::Core::Http::RawResponse> m_rawResponse;
private:
int m_count = 0;
@ -58,7 +58,7 @@ namespace Azure { namespace Core { namespace Test {
}
public:
StringOperation(StringClient* client) : m_client(client) { (void)m_client; }
Azure::Core::Http::RawResponse* GetRawResponse() const override { return m_rawResponse.get(); }
std::string GetResumeToken() const override { return m_operationToken; }
@ -82,7 +82,7 @@ namespace Azure { namespace Core { namespace Test {
StringOperation StartStringUpdate()
{
// Make initial String call
StringOperation operation = StringOperation(this);
StringOperation operation = StringOperation();
return operation;
}
};

View File

@ -77,6 +77,12 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Keys {
Azure::Core::Response<Azure::Security::KeyVault::Keys::DeletedKey> response);
public:
/**
* @brief Get the #Azure::Core::Http::RawResponse of the operation request.
* @return A pointer to #Azure::Core::Http::RawResponse or null.
*/
Azure::Core::Http::RawResponse* GetRawResponse() const override { return m_rawResponse.get(); }
/**
* @brief Get the #Azure::Security::KeyVault::Keys::DeletedKey object.
*

View File

@ -82,6 +82,17 @@ namespace Azure { namespace Storage { namespace Blobs {
public:
Models::GetBlobPropertiesResult Value() const override { return m_pollResult; }
/**
* @brief Get the raw HTTP response.
* @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;
}
~StartCopyBlobOperation() override {}
private:

View File

@ -198,6 +198,17 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
public:
Models::GetShareFilePropertiesResult Value() const override { return m_pollResult; }
/**
* @brief Get the raw HTTP response.
* @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;
}
~StartCopyShareFileOperation() override {}
private: