20namespace Azure {
namespace Core {
30 virtual std::unique_ptr<Http::RawResponse> PollInternal(
Context const& context) = 0;
31 virtual Response<T> PollUntilDoneInternal(std::chrono::milliseconds period,
Context& context)
35 GetRawResponseInternal()
const
42 std::unique_ptr<Azure::Core::Http::RawResponse>
m_rawResponse =
nullptr;
89 this->m_rawResponse = std::move(other.m_rawResponse);
90 this->m_status = other.m_status;
105 this->m_rawResponse = std::make_unique<Http::RawResponse>(other.
GetRawResponse());
141 throw std::runtime_error(
"The raw response was not yet set for the Operation.");
225 return PollUntilDoneInternal(period, context);
A context is a node within a unidirectional tree that represents deadlines and key/value pairs.
Definition context.hpp:72
void ThrowIfCancelled() const
Throws if the context is cancelled.
Definition context.hpp:364
After receiving and interpreting a request message, a server responds with an HTTP response message.
Definition raw_response.hpp:24
Methods starting long-running operations return Operation<T> types.
Definition operation.hpp:27
Operation()=default
Constructs a default instance of Operation.
std::unique_ptr< Azure::Core::Http::RawResponse > m_rawResponse
the underlying raw response for this operation.
Definition operation.hpp:42
Response< T > PollUntilDone(std::chrono::milliseconds period, Context &context)
Periodically polls till the long-running operation completes;.
Definition operation.hpp:222
bool IsDone() const noexcept
Checks if the long-running operation is completed.
Definition operation.hpp:157
Http::RawResponse const & Poll(Context const &context)
Gets updated status of the long-running operation.
Definition operation.hpp:192
virtual std::string GetResumeToken() const =0
Gets a token representing the operation that can be used to poll for the status of the long-running o...
Operation(Operation &&other)
Constructs an instance of Operation by moving in another instance.
Definition operation.hpp:60
OperationStatus m_status
the current status of the operation.
Definition operation.hpp:45
virtual ~Operation()
Destructs the Operation.
Definition operation.hpp:115
Operation(Operation const &other)
Constructs an instance of Operation by copying another instance.
Definition operation.hpp:72
Http::RawResponse const & Poll()
Gets updated status of the long-running operation.
Definition operation.hpp:178
Operation & operator=(Operation const &other)
Assigns another Operation instance by copying.
Definition operation.hpp:103
OperationStatus const & Status() const noexcept
Gets the current Azure::Core::OperationStatus of the long-running operation.
Definition operation.hpp:150
Operation & operator=(Operation &&other)
Assigns an instance of Operation by moving in another instance.
Definition operation.hpp:87
virtual T Value() const =0
Final result of the long-running operation.
Azure::Core::Http::RawResponse const & GetRawResponse() const
Gets the raw HTTP response.
Definition operation.hpp:137
bool HasValue() const noexcept
Checks if the long-running operation completed successfully and has produced a final result.
Definition operation.hpp:171
Response< T > PollUntilDone(std::chrono::milliseconds period)
Periodically polls till the long-running operation completes.
Definition operation.hpp:206
Long-running operation states.
Definition operation_status.hpp:23
static AZ_CORE_DLLEXPORT const OperationStatus Failed
The Azure::Core::Operation Failed.
Definition operation_status.hpp:100
static AZ_CORE_DLLEXPORT const OperationStatus Cancelled
The Azure::Core::Operation was Cancelled.
Definition operation_status.hpp:95
static AZ_CORE_DLLEXPORT const OperationStatus NotStarted
The Azure::Core::Operation is Not Started.
Definition operation_status.hpp:80
static AZ_CORE_DLLEXPORT const OperationStatus Succeeded
The Azure::Core::Operation Succeeded.
Definition operation_status.hpp:90
Represents the result of an Azure operation over HTTP by wrapping the raw HTTP response from a reques...
Definition response.hpp:26
Context for canceling long running operations.
Compute the hash value for the input binary data, using SHA256, SHA384 and SHA512.
Definition azure_assert.hpp:57
Valid states for long-running Operations. Services can extend upon the default set of values.
Wraps the raw HTTP response from a request made to the service into a response of a specific type.