AWS SDK for C++

AWS SDK for C++ Version 1.11.782

Loading...
Searching...
No Matches
NeptuneGraphWaiter.h
1
6#pragma once
7#include <aws/core/utils/Waiter.h>
8#include <aws/core/utils/memory/AWSMemory.h>
9#include <aws/neptune-graph/NeptuneGraphClient.h>
10#include <aws/neptune-graph/model/ExportTaskStatus.h>
11#include <aws/neptune-graph/model/GetExportTaskRequest.h>
12#include <aws/neptune-graph/model/GetExportTaskResult.h>
13#include <aws/neptune-graph/model/GetGraphRequest.h>
14#include <aws/neptune-graph/model/GetGraphResult.h>
15#include <aws/neptune-graph/model/GetGraphSnapshotRequest.h>
16#include <aws/neptune-graph/model/GetGraphSnapshotResult.h>
17#include <aws/neptune-graph/model/GetImportTaskRequest.h>
18#include <aws/neptune-graph/model/GetImportTaskResult.h>
19#include <aws/neptune-graph/model/GetPrivateGraphEndpointRequest.h>
20#include <aws/neptune-graph/model/GetPrivateGraphEndpointResult.h>
21#include <aws/neptune-graph/model/GraphStatus.h>
22#include <aws/neptune-graph/model/ImportTaskStatus.h>
23#include <aws/neptune-graph/model/PrivateGraphEndpointStatus.h>
24#include <aws/neptune-graph/model/SnapshotStatus.h>
25
26#include <algorithm>
27
28namespace Aws {
29namespace NeptuneGraph {
30
31template <typename DerivedClient = NeptuneGraphClient>
33 public:
35 using OutcomeT = Model::GetExportTaskOutcome;
36 using RequestT = Model::GetExportTaskRequest;
39 "ExportTaskSuccessfulWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("CANCELLING"),
40 [](const Model::GetExportTaskOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
41 if (!outcome.IsSuccess()) return false;
42 const auto& result = outcome.GetResult();
43 return Model::ExportTaskStatusMapper::GetNameForExportTaskStatus(result.GetStatus()) == expected.get<Aws::String>();
44 }));
46 "ExportTaskSuccessfulWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("CANCELLED"),
47 [](const Model::GetExportTaskOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
48 if (!outcome.IsSuccess()) return false;
49 const auto& result = outcome.GetResult();
50 return Model::ExportTaskStatusMapper::GetNameForExportTaskStatus(result.GetStatus()) == expected.get<Aws::String>();
51 }));
53 "ExportTaskSuccessfulWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("FAILED"),
54 [](const Model::GetExportTaskOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
55 if (!outcome.IsSuccess()) return false;
56 const auto& result = outcome.GetResult();
57 return Model::ExportTaskStatusMapper::GetNameForExportTaskStatus(result.GetStatus()) == expected.get<Aws::String>();
58 }));
60 "ExportTaskSuccessfulWaiter", Aws::Utils::WaiterState::SUCCESS, Aws::String("SUCCEEDED"),
61 [](const Model::GetExportTaskOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
62 if (!outcome.IsSuccess()) return false;
63 const auto& result = outcome.GetResult();
64 return Model::ExportTaskStatusMapper::GetNameForExportTaskStatus(result.GetStatus()) == expected.get<Aws::String>();
65 }));
66
67 auto operation = [this](const RequestT& req) { return static_cast<DerivedClient*>(this)->GetExportTask(req); };
68 Aws::Utils::Waiter<RequestT, OutcomeT> waiter(60, 480, std::move(acceptors), operation, "WaitUntilExportTaskSuccessful");
69 return waiter.Wait(request);
70 }
71
73 using OutcomeT = Model::GetExportTaskOutcome;
74 using RequestT = Model::GetExportTaskRequest;
77 "ExportTaskCancelledWaiter", Aws::Utils::WaiterState::FAILURE, true,
78 [](const Model::GetExportTaskOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
79 if (!outcome.IsSuccess()) return false;
80 const auto& result = outcome.GetResult();
81 return ((Model::ExportTaskStatusMapper::GetNameForExportTaskStatus(result.GetStatus()) != "CANCELLING") &&
82 (Model::ExportTaskStatusMapper::GetNameForExportTaskStatus(result.GetStatus()) != "CANCELLED")) == expected.get<bool>();
83 }));
85 "ExportTaskCancelledWaiter", Aws::Utils::WaiterState::SUCCESS, Aws::String("CANCELLED"),
86 [](const Model::GetExportTaskOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
87 if (!outcome.IsSuccess()) return false;
88 const auto& result = outcome.GetResult();
89 return Model::ExportTaskStatusMapper::GetNameForExportTaskStatus(result.GetStatus()) == expected.get<Aws::String>();
90 }));
91
92 auto operation = [this](const RequestT& req) { return static_cast<DerivedClient*>(this)->GetExportTask(req); };
93 Aws::Utils::Waiter<RequestT, OutcomeT> waiter(60, 60, std::move(acceptors), operation, "WaitUntilExportTaskCancelled");
94 return waiter.Wait(request);
95 }
96
98 using OutcomeT = Model::GetGraphOutcome;
99 using RequestT = Model::GetGraphRequest;
102 "GraphAvailableWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("DELETING"),
103 [](const Model::GetGraphOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
104 if (!outcome.IsSuccess()) return false;
105 const auto& result = outcome.GetResult();
106 return Model::GraphStatusMapper::GetNameForGraphStatus(result.GetStatus()) == expected.get<Aws::String>();
107 }));
109 "GraphAvailableWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("FAILED"),
110 [](const Model::GetGraphOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
111 if (!outcome.IsSuccess()) return false;
112 const auto& result = outcome.GetResult();
113 return Model::GraphStatusMapper::GetNameForGraphStatus(result.GetStatus()) == expected.get<Aws::String>();
114 }));
116 "GraphAvailableWaiter", Aws::Utils::WaiterState::SUCCESS, Aws::String("AVAILABLE"),
117 [](const Model::GetGraphOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
118 if (!outcome.IsSuccess()) return false;
119 const auto& result = outcome.GetResult();
120 return Model::GraphStatusMapper::GetNameForGraphStatus(result.GetStatus()) == expected.get<Aws::String>();
121 }));
122
123 auto operation = [this](const RequestT& req) { return static_cast<DerivedClient*>(this)->GetGraph(req); };
124 Aws::Utils::Waiter<RequestT, OutcomeT> waiter(60, 480, std::move(acceptors), operation, "WaitUntilGraphAvailable");
125 return waiter.Wait(request);
126 }
127
129 using OutcomeT = Model::GetGraphOutcome;
130 using RequestT = Model::GetGraphRequest;
133 "GraphDeletedWaiter", Aws::Utils::WaiterState::FAILURE, true,
134 [](const Model::GetGraphOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
135 if (!outcome.IsSuccess()) return false;
136 const auto& result = outcome.GetResult();
137 return (Model::GraphStatusMapper::GetNameForGraphStatus(result.GetStatus()) != "DELETING") == expected.get<bool>();
138 }));
139 acceptors.emplace_back(Aws::MakeUnique<Aws::Utils::ErrorAcceptor<OutcomeT>>("GraphDeletedWaiter", Aws::Utils::WaiterState::SUCCESS,
140 Aws::String("ResourceNotFoundException")));
141
142 auto operation = [this](const RequestT& req) { return static_cast<DerivedClient*>(this)->GetGraph(req); };
143 Aws::Utils::Waiter<RequestT, OutcomeT> waiter(60, 60, std::move(acceptors), operation, "WaitUntilGraphDeleted");
144 return waiter.Wait(request);
145 }
146
148 using OutcomeT = Model::GetGraphOutcome;
149 using RequestT = Model::GetGraphRequest;
152 "GraphStoppedWaiter", Aws::Utils::WaiterState::SUCCESS, Aws::String("STOPPED"),
153 [](const Model::GetGraphOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
154 if (!outcome.IsSuccess()) return false;
155 const auto& result = outcome.GetResult();
156 return Model::GraphStatusMapper::GetNameForGraphStatus(result.GetStatus()) == expected.get<Aws::String>();
157 }));
159 "GraphStoppedWaiter", Aws::Utils::WaiterState::FAILURE, true,
160 [](const Model::GetGraphOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
161 if (!outcome.IsSuccess()) return false;
162 const auto& result = outcome.GetResult();
163 return (Model::GraphStatusMapper::GetNameForGraphStatus(result.GetStatus()) != "STOPPING") == expected.get<bool>();
164 }));
165
166 auto operation = [this](const RequestT& req) { return static_cast<DerivedClient*>(this)->GetGraph(req); };
167 Aws::Utils::Waiter<RequestT, OutcomeT> waiter(20, 90, std::move(acceptors), operation, "WaitUntilGraphStopped");
168 return waiter.Wait(request);
169 }
170
172 using OutcomeT = Model::GetGraphSnapshotOutcome;
173 using RequestT = Model::GetGraphSnapshotRequest;
176 "GraphSnapshotAvailableWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("DELETING"),
177 [](const Model::GetGraphSnapshotOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
178 if (!outcome.IsSuccess()) return false;
179 const auto& result = outcome.GetResult();
180 return Model::SnapshotStatusMapper::GetNameForSnapshotStatus(result.GetStatus()) == expected.get<Aws::String>();
181 }));
183 "GraphSnapshotAvailableWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("FAILED"),
184 [](const Model::GetGraphSnapshotOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
185 if (!outcome.IsSuccess()) return false;
186 const auto& result = outcome.GetResult();
187 return Model::SnapshotStatusMapper::GetNameForSnapshotStatus(result.GetStatus()) == expected.get<Aws::String>();
188 }));
190 "GraphSnapshotAvailableWaiter", Aws::Utils::WaiterState::SUCCESS, Aws::String("AVAILABLE"),
191 [](const Model::GetGraphSnapshotOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
192 if (!outcome.IsSuccess()) return false;
193 const auto& result = outcome.GetResult();
194 return Model::SnapshotStatusMapper::GetNameForSnapshotStatus(result.GetStatus()) == expected.get<Aws::String>();
195 }));
196
197 auto operation = [this](const RequestT& req) { return static_cast<DerivedClient*>(this)->GetGraphSnapshot(req); };
198 Aws::Utils::Waiter<RequestT, OutcomeT> waiter(60, 120, std::move(acceptors), operation, "WaitUntilGraphSnapshotAvailable");
199 return waiter.Wait(request);
200 }
201
203 using OutcomeT = Model::GetGraphSnapshotOutcome;
204 using RequestT = Model::GetGraphSnapshotRequest;
207 "GraphSnapshotDeletedWaiter", Aws::Utils::WaiterState::FAILURE, true,
208 [](const Model::GetGraphSnapshotOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
209 if (!outcome.IsSuccess()) return false;
210 const auto& result = outcome.GetResult();
211 return (Model::SnapshotStatusMapper::GetNameForSnapshotStatus(result.GetStatus()) != "DELETING") == expected.get<bool>();
212 }));
214 "GraphSnapshotDeletedWaiter", Aws::Utils::WaiterState::SUCCESS, Aws::String("ResourceNotFoundException")));
215
216 auto operation = [this](const RequestT& req) { return static_cast<DerivedClient*>(this)->GetGraphSnapshot(req); };
217 Aws::Utils::Waiter<RequestT, OutcomeT> waiter(60, 60, std::move(acceptors), operation, "WaitUntilGraphSnapshotDeleted");
218 return waiter.Wait(request);
219 }
220
222 using OutcomeT = Model::GetImportTaskOutcome;
223 using RequestT = Model::GetImportTaskRequest;
226 "ImportTaskSuccessfulWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("CANCELLING"),
227 [](const Model::GetImportTaskOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
228 if (!outcome.IsSuccess()) return false;
229 const auto& result = outcome.GetResult();
230 return Model::ImportTaskStatusMapper::GetNameForImportTaskStatus(result.GetStatus()) == expected.get<Aws::String>();
231 }));
233 "ImportTaskSuccessfulWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("CANCELLED"),
234 [](const Model::GetImportTaskOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
235 if (!outcome.IsSuccess()) return false;
236 const auto& result = outcome.GetResult();
237 return Model::ImportTaskStatusMapper::GetNameForImportTaskStatus(result.GetStatus()) == expected.get<Aws::String>();
238 }));
240 "ImportTaskSuccessfulWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("ROLLING_BACK"),
241 [](const Model::GetImportTaskOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
242 if (!outcome.IsSuccess()) return false;
243 const auto& result = outcome.GetResult();
244 return Model::ImportTaskStatusMapper::GetNameForImportTaskStatus(result.GetStatus()) == expected.get<Aws::String>();
245 }));
247 "ImportTaskSuccessfulWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("FAILED"),
248 [](const Model::GetImportTaskOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
249 if (!outcome.IsSuccess()) return false;
250 const auto& result = outcome.GetResult();
251 return Model::ImportTaskStatusMapper::GetNameForImportTaskStatus(result.GetStatus()) == expected.get<Aws::String>();
252 }));
254 "ImportTaskSuccessfulWaiter", Aws::Utils::WaiterState::SUCCESS, Aws::String("SUCCEEDED"),
255 [](const Model::GetImportTaskOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
256 if (!outcome.IsSuccess()) return false;
257 const auto& result = outcome.GetResult();
258 return Model::ImportTaskStatusMapper::GetNameForImportTaskStatus(result.GetStatus()) == expected.get<Aws::String>();
259 }));
260
261 auto operation = [this](const RequestT& req) { return static_cast<DerivedClient*>(this)->GetImportTask(req); };
262 Aws::Utils::Waiter<RequestT, OutcomeT> waiter(60, 480, std::move(acceptors), operation, "WaitUntilImportTaskSuccessful");
263 return waiter.Wait(request);
264 }
265
267 using OutcomeT = Model::GetImportTaskOutcome;
268 using RequestT = Model::GetImportTaskRequest;
271 "ImportTaskCancelledWaiter", Aws::Utils::WaiterState::FAILURE, true,
272 [](const Model::GetImportTaskOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
273 if (!outcome.IsSuccess()) return false;
274 const auto& result = outcome.GetResult();
275 return ((Model::ImportTaskStatusMapper::GetNameForImportTaskStatus(result.GetStatus()) != "CANCELLING") &&
276 (Model::ImportTaskStatusMapper::GetNameForImportTaskStatus(result.GetStatus()) != "CANCELLED")) == expected.get<bool>();
277 }));
279 "ImportTaskCancelledWaiter", Aws::Utils::WaiterState::SUCCESS, Aws::String("CANCELLED"),
280 [](const Model::GetImportTaskOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
281 if (!outcome.IsSuccess()) return false;
282 const auto& result = outcome.GetResult();
283 return Model::ImportTaskStatusMapper::GetNameForImportTaskStatus(result.GetStatus()) == expected.get<Aws::String>();
284 }));
285
286 auto operation = [this](const RequestT& req) { return static_cast<DerivedClient*>(this)->GetImportTask(req); };
287 Aws::Utils::Waiter<RequestT, OutcomeT> waiter(60, 60, std::move(acceptors), operation, "WaitUntilImportTaskCancelled");
288 return waiter.Wait(request);
289 }
290
297 "PrivateGraphEndpointAvailableWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("DELETING"),
298 [](const Model::GetPrivateGraphEndpointOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
299 if (!outcome.IsSuccess()) return false;
300 const auto& result = outcome.GetResult();
302 expected.get<Aws::String>();
303 }));
305 "PrivateGraphEndpointAvailableWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("FAILED"),
306 [](const Model::GetPrivateGraphEndpointOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
307 if (!outcome.IsSuccess()) return false;
308 const auto& result = outcome.GetResult();
310 expected.get<Aws::String>();
311 }));
313 "PrivateGraphEndpointAvailableWaiter", Aws::Utils::WaiterState::SUCCESS, Aws::String("AVAILABLE"),
314 [](const Model::GetPrivateGraphEndpointOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
315 if (!outcome.IsSuccess()) return false;
316 const auto& result = outcome.GetResult();
318 expected.get<Aws::String>();
319 }));
320
321 auto operation = [this](const RequestT& req) { return static_cast<DerivedClient*>(this)->GetPrivateGraphEndpoint(req); };
322 Aws::Utils::Waiter<RequestT, OutcomeT> waiter(10, 180, std::move(acceptors), operation, "WaitUntilPrivateGraphEndpointAvailable");
323 return waiter.Wait(request);
324 }
325
332 "PrivateGraphEndpointDeletedWaiter", Aws::Utils::WaiterState::FAILURE, true,
333 [](const Model::GetPrivateGraphEndpointOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
334 if (!outcome.IsSuccess()) return false;
335 const auto& result = outcome.GetResult();
337 expected.get<bool>();
338 }));
340 "PrivateGraphEndpointDeletedWaiter", Aws::Utils::WaiterState::SUCCESS, Aws::String("ResourceNotFoundException")));
341
342 auto operation = [this](const RequestT& req) { return static_cast<DerivedClient*>(this)->GetPrivateGraphEndpoint(req); };
343 Aws::Utils::Waiter<RequestT, OutcomeT> waiter(10, 180, std::move(acceptors), operation, "WaitUntilPrivateGraphEndpointDeleted");
344 return waiter.Wait(request);
345 }
346};
347} // namespace NeptuneGraph
348} // namespace Aws
Aws::Utils::WaiterOutcome< Model::GetImportTaskOutcome > WaitUntilImportTaskSuccessful(const Model::GetImportTaskRequest &request)
Aws::Utils::WaiterOutcome< Model::GetExportTaskOutcome > WaitUntilExportTaskCancelled(const Model::GetExportTaskRequest &request)
Aws::Utils::WaiterOutcome< Model::GetGraphSnapshotOutcome > WaitUntilGraphSnapshotDeleted(const Model::GetGraphSnapshotRequest &request)
Aws::Utils::WaiterOutcome< Model::GetGraphOutcome > WaitUntilGraphAvailable(const Model::GetGraphRequest &request)
Aws::Utils::WaiterOutcome< Model::GetGraphOutcome > WaitUntilGraphStopped(const Model::GetGraphRequest &request)
Aws::Utils::WaiterOutcome< Model::GetImportTaskOutcome > WaitUntilImportTaskCancelled(const Model::GetImportTaskRequest &request)
Aws::Utils::WaiterOutcome< Model::GetPrivateGraphEndpointOutcome > WaitUntilPrivateGraphEndpointDeleted(const Model::GetPrivateGraphEndpointRequest &request)
Aws::Utils::WaiterOutcome< Model::GetExportTaskOutcome > WaitUntilExportTaskSuccessful(const Model::GetExportTaskRequest &request)
Aws::Utils::WaiterOutcome< Model::GetPrivateGraphEndpointOutcome > WaitUntilPrivateGraphEndpointAvailable(const Model::GetPrivateGraphEndpointRequest &request)
Aws::Utils::WaiterOutcome< Model::GetGraphSnapshotOutcome > WaitUntilGraphSnapshotAvailable(const Model::GetGraphSnapshotRequest &request)
Aws::Utils::WaiterOutcome< Model::GetGraphOutcome > WaitUntilGraphDeleted(const Model::GetGraphRequest &request)
bool IsSuccess() const
const R & GetResult() const
WaiterOutcome< OutcomeT > Wait(const RequestT &request)
AWS_NEPTUNEGRAPH_API Aws::String GetNameForExportTaskStatus(ExportTaskStatus value)
AWS_NEPTUNEGRAPH_API Aws::String GetNameForGraphStatus(GraphStatus value)
AWS_NEPTUNEGRAPH_API Aws::String GetNameForImportTaskStatus(ImportTaskStatus value)
AWS_NEPTUNEGRAPH_API Aws::String GetNameForPrivateGraphEndpointStatus(PrivateGraphEndpointStatus value)
AWS_NEPTUNEGRAPH_API Aws::String GetNameForSnapshotStatus(SnapshotStatus value)
Aws::Utils::Outcome< GetExportTaskResult, NeptuneGraphError > GetExportTaskOutcome
Aws::Utils::Outcome< GetGraphSnapshotResult, NeptuneGraphError > GetGraphSnapshotOutcome
Aws::Utils::Outcome< GetImportTaskResult, NeptuneGraphError > GetImportTaskOutcome
Aws::Utils::Outcome< GetGraphResult, NeptuneGraphError > GetGraphOutcome
Aws::Utils::Outcome< GetPrivateGraphEndpointResult, NeptuneGraphError > GetPrivateGraphEndpointOutcome
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