AWS SDK for C++

AWS SDK for C++ Version 1.11.791

Loading...
Searching...
No Matches
InterconnectWaiter.h
1
6#pragma once
7#include <aws/core/utils/Waiter.h>
8#include <aws/core/utils/memory/AWSMemory.h>
9#include <aws/interconnect/InterconnectClient.h>
10#include <aws/interconnect/model/ConnectionState.h>
11#include <aws/interconnect/model/GetConnectionRequest.h>
12#include <aws/interconnect/model/GetConnectionResult.h>
13
14#include <algorithm>
15
16namespace Aws {
17namespace Interconnect {
18
19template <typename DerivedClient = InterconnectClient>
21 public:
23 using OutcomeT = Model::GetConnectionOutcome;
24 using RequestT = Model::GetConnectionRequest;
27 "ConnectionAvailableWaiter", Aws::Utils::WaiterState::SUCCESS, Aws::String("available"),
28 [](const Model::GetConnectionOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
29 if (!outcome.IsSuccess()) return false;
30 const auto& result = outcome.GetResult();
31 return Model::ConnectionStateMapper::GetNameForConnectionState(result.GetConnection().GetState()) == expected.get<Aws::String>();
32 }));
34 "ConnectionAvailableWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("deleted"),
35 [](const Model::GetConnectionOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
36 if (!outcome.IsSuccess()) return false;
37 const auto& result = outcome.GetResult();
38 return Model::ConnectionStateMapper::GetNameForConnectionState(result.GetConnection().GetState()) == expected.get<Aws::String>();
39 }));
41 "ConnectionAvailableWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("down"),
42 [](const Model::GetConnectionOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
43 if (!outcome.IsSuccess()) return false;
44 const auto& result = outcome.GetResult();
45 return Model::ConnectionStateMapper::GetNameForConnectionState(result.GetConnection().GetState()) == expected.get<Aws::String>();
46 }));
47
48 auto operation = [this](const RequestT& req) { return static_cast<DerivedClient*>(this)->GetConnection(req); };
49 Aws::Utils::Waiter<RequestT, OutcomeT> waiter(30, 4, std::move(acceptors), operation, "WaitUntilConnectionAvailable");
50 return waiter.Wait(request);
51 }
52
54 using OutcomeT = Model::GetConnectionOutcome;
55 using RequestT = Model::GetConnectionRequest;
58 "ConnectionDeletedWaiter", Aws::Utils::WaiterState::SUCCESS, Aws::String("deleted"),
59 [](const Model::GetConnectionOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
60 if (!outcome.IsSuccess()) return false;
61 const auto& result = outcome.GetResult();
62 return Model::ConnectionStateMapper::GetNameForConnectionState(result.GetConnection().GetState()) == expected.get<Aws::String>();
63 }));
64
65 auto operation = [this](const RequestT& req) { return static_cast<DerivedClient*>(this)->GetConnection(req); };
66 Aws::Utils::Waiter<RequestT, OutcomeT> waiter(30, 4, std::move(acceptors), operation, "WaitUntilConnectionDeleted");
67 return waiter.Wait(request);
68 }
69};
70} // namespace Interconnect
71} // namespace Aws
Aws::Utils::WaiterOutcome< Model::GetConnectionOutcome > WaitUntilConnectionAvailable(const Model::GetConnectionRequest &request)
Aws::Utils::WaiterOutcome< Model::GetConnectionOutcome > WaitUntilConnectionDeleted(const Model::GetConnectionRequest &request)
bool IsSuccess() const
const R & GetResult() const
WaiterOutcome< OutcomeT > Wait(const RequestT &request)
AWS_INTERCONNECT_API Aws::String GetNameForConnectionState(ConnectionState value)
Aws::Utils::Outcome< GetConnectionResult, InterconnectError > GetConnectionOutcome
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