Go to the documentation of this file.
20 namespace 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)
36 std::unique_ptr<Azure::Core::Http::RawResponse> m_rawResponse =
nullptr;
53 : m_rawResponse(std::move(other.m_rawResponse)), m_status(other.m_status)
65 : m_rawResponse(std::make_unique<Http::RawResponse>(other.
GetRawResponse())),
66 m_status(other.m_status)
81 this->m_rawResponse = std::move(other.m_rawResponse);
82 this->m_status = other.m_status;
97 this->m_rawResponse = std::make_unique<Http::RawResponse>(other.
GetRawResponse());
98 this->m_status = other.m_status;
133 throw std::runtime_error(
"The raw response was not yet set for the Operation.");
135 return *m_rawResponse;
187 m_rawResponse = PollInternal(context);
188 return *m_rawResponse;
216 return PollUntilDoneInternal(period, context);
Http::RawResponse const & Poll()
Gets updated status of the long-running operation.
Definition: operation.hpp:170
static AZ_CORE_DLLEXPORT const OperationStatus Succeeded
The Azure::Core::Operation Succeeded.
Definition: operation_status.hpp:91
void ThrowIfCancelled() const
Checks if the context is cancelled.
Definition: context.hpp:248
bool IsDone() const noexcept
Checks if the long-running operation is completed.
Definition: operation.hpp:149
Response< T > PollUntilDone(std::chrono::milliseconds period)
Periodically polls till the long-running operation completes.
Definition: operation.hpp:198
Azure::Core::Http::RawResponse const & GetRawResponse() const
Gets the raw HTTP response.
Definition: operation.hpp:129
Context for canceling long running operations.
virtual ~Operation()
Destructs the Operation.
Definition: operation.hpp:107
static AZ_CORE_DLLEXPORT const OperationStatus NotStarted
The Azure::Core::Operation is Not Started.
Definition: operation_status.hpp:81
Operation & operator=(Operation &&other)
Assigns an instance of Operation by moving in another instance.
Definition: operation.hpp:79
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...
Methods starting long-running operations return Operation<T> types.
Definition: operation.hpp:27
Operation(Operation &&other)
Constructs an instance of Operation by moving in another instance.
Definition: operation.hpp:52
Wraps the raw HTTP response from a request made to the service into a response of a specific type.
Represents the result of an Azure operation over HTTP by wrapping the raw HTTP response from a reques...
Definition: response.hpp:25
After receiving and interpreting a request message, a server responds with an HTTP response message.
Definition: raw_response.hpp:24
Azure SDK abstractions.
Definition: azure_assert.hpp:55
Operation(Operation const &other)
Constructs an instance of Operation by copying another instance.
Definition: operation.hpp:64
Http::RawResponse const & Poll(Context const &context)
Gets updated status of the long-running operation.
Definition: operation.hpp:184
Long-running operation states.
Definition: operation_status.hpp:24
static AZ_CORE_DLLEXPORT const OperationStatus Failed
The Azure::Core::Operation Failed.
Definition: operation_status.hpp:101
Operation & operator=(Operation const &other)
Assigns another Operation instance by copying.
Definition: operation.hpp:95
Response< T > PollUntilDone(std::chrono::milliseconds period, Context &context)
Periodically polls till the long-running operation completes;.
Definition: operation.hpp:213
bool HasValue() const noexcept
Checks if the long-running operation completed successfully and has produced a final result.
Definition: operation.hpp:163
Operation()=default
Constructs a default instance of Operation.
static AZ_CORE_DLLEXPORT const OperationStatus Cancelled
The Azure::Core::Operation was Cancelled.
Definition: operation_status.hpp:96
virtual T Value() const =0
Final result of the long-running operation.
Valid states for long-running Operations. Services can extend upon the default set of values.
A context is a node within a tree that represents deadlines and key/value pairs.
Definition: context.hpp:45
OperationStatus Status() const noexcept
Gets the current Azure::Core::OperationStatus of the long-running operation.
Definition: operation.hpp:142
static AZ_CORE_DLLEXPORT Context ApplicationContext
The application context (root).
Definition: context.hpp:276