AWS SDK for C++

AWS SDK for C++ Version 1.11.782

Loading...
Searching...
No Matches
SSMWaiter.h
1
6#pragma once
7#include <aws/core/utils/Waiter.h>
8#include <aws/core/utils/memory/AWSMemory.h>
9#include <aws/ssm/SSMClient.h>
10#include <aws/ssm/model/CommandInvocationStatus.h>
11#include <aws/ssm/model/GetCommandInvocationRequest.h>
12#include <aws/ssm/model/GetCommandInvocationResult.h>
13
14#include <algorithm>
15
16namespace Aws {
17namespace SSM {
18
19template <typename DerivedClient = SSMClient>
20class SSMWaiter {
21 public:
28 "CommandExecutedWaiter", Aws::Utils::WaiterState::RETRY, Aws::String("Pending"),
29 [](const Model::GetCommandInvocationOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
30 if (!outcome.IsSuccess()) return false;
31 const auto& result = outcome.GetResult();
33 }));
35 "CommandExecutedWaiter", Aws::Utils::WaiterState::RETRY, Aws::String("InProgress"),
36 [](const Model::GetCommandInvocationOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
37 if (!outcome.IsSuccess()) return false;
38 const auto& result = outcome.GetResult();
40 }));
42 "CommandExecutedWaiter", Aws::Utils::WaiterState::RETRY, Aws::String("Delayed"),
43 [](const Model::GetCommandInvocationOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
44 if (!outcome.IsSuccess()) return false;
45 const auto& result = outcome.GetResult();
47 }));
49 "CommandExecutedWaiter", Aws::Utils::WaiterState::SUCCESS, Aws::String("Success"),
50 [](const Model::GetCommandInvocationOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
51 if (!outcome.IsSuccess()) return false;
52 const auto& result = outcome.GetResult();
54 }));
56 "CommandExecutedWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("Cancelled"),
57 [](const Model::GetCommandInvocationOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
58 if (!outcome.IsSuccess()) return false;
59 const auto& result = outcome.GetResult();
61 }));
63 "CommandExecutedWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("TimedOut"),
64 [](const Model::GetCommandInvocationOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
65 if (!outcome.IsSuccess()) return false;
66 const auto& result = outcome.GetResult();
68 }));
70 "CommandExecutedWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("Failed"),
71 [](const Model::GetCommandInvocationOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
72 if (!outcome.IsSuccess()) return false;
73 const auto& result = outcome.GetResult();
75 }));
77 "CommandExecutedWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("Cancelling"),
78 [](const Model::GetCommandInvocationOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
79 if (!outcome.IsSuccess()) return false;
80 const auto& result = outcome.GetResult();
82 }));
83 acceptors.emplace_back(Aws::MakeUnique<Aws::Utils::ErrorAcceptor<OutcomeT>>("CommandExecutedWaiter", Aws::Utils::WaiterState::RETRY,
84 Aws::String("InvocationDoesNotExist")));
85
86 auto operation = [this](const RequestT& req) { return static_cast<DerivedClient*>(this)->GetCommandInvocation(req); };
87 Aws::Utils::Waiter<RequestT, OutcomeT> waiter(5, 24, std::move(acceptors), operation, "WaitUntilCommandExecuted");
88 return waiter.Wait(request);
89 }
90};
91} // namespace SSM
92} // namespace Aws
Aws::Utils::WaiterOutcome< Model::GetCommandInvocationOutcome > WaitUntilCommandExecuted(const Model::GetCommandInvocationRequest &request)
Definition SSMWaiter.h:22
bool IsSuccess() const
const R & GetResult() const
WaiterOutcome< OutcomeT > Wait(const RequestT &request)
AWS_SSM_API Aws::String GetNameForCommandInvocationStatus(CommandInvocationStatus value)
Aws::Utils::Outcome< GetCommandInvocationResult, SSMError > GetCommandInvocationOutcome
Crt::Variant< int, bool, Aws::String > ExpectedValue
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
UniquePtr< T > MakeUnique(const char *allocationTag, ArgTypes &&... args)
std::vector< T, Aws::Allocator< T > > Vector