AWS SDK for C++

AWS SDK for C++ Version 1.11.938

Loading...
Searching...
No Matches
ELBProxyWaiter.h
1
6#pragma once
7#include <aws/core/utils/Waiter.h>
8#include <aws/core/utils/memory/AWSMemory.h>
9#include <aws/elb-proxy/ELBProxyClient.h>
10#include <aws/elb-proxy/model/GetProxyRequest.h>
11#include <aws/elb-proxy/model/GetProxyResult.h>
12#include <aws/elb-proxy/model/GetProxyUpdateRequest.h>
13#include <aws/elb-proxy/model/GetProxyUpdateResult.h>
14#include <aws/elb-proxy/model/ProxyStatusCode.h>
15#include <aws/elb-proxy/model/ProxyUpdatePropagationStatus.h>
16#include <aws/elb-proxy/model/ProxyUpdateValidationStatus.h>
17
18#include <algorithm>
19
20namespace Aws {
21namespace ELBProxy {
22
23template <typename DerivedClient = ELBProxyClient>
25 public:
27 using OutcomeT = Model::GetProxyOutcome;
28 using RequestT = Model::GetProxyRequest;
31 "ProxyActiveWaiter", Aws::Utils::WaiterState::SUCCESS, Aws::String("active"),
32 [](const Model::GetProxyOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
33 if (!outcome.IsSuccess()) return false;
34 const auto& result = outcome.GetResult();
35 return Model::ProxyStatusCodeMapper::GetNameForProxyStatusCode(result.GetStatus().GetCode()) == expected.get<Aws::String>();
36 }));
38 "ProxyActiveWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("create-failed"),
39 [](const Model::GetProxyOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
40 if (!outcome.IsSuccess()) return false;
41 const auto& result = outcome.GetResult();
42 return Model::ProxyStatusCodeMapper::GetNameForProxyStatusCode(result.GetStatus().GetCode()) == expected.get<Aws::String>();
43 }));
45 "ProxyActiveWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("action-required"),
46 [](const Model::GetProxyOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
47 if (!outcome.IsSuccess()) return false;
48 const auto& result = outcome.GetResult();
49 return Model::ProxyStatusCodeMapper::GetNameForProxyStatusCode(result.GetStatus().GetCode()) == expected.get<Aws::String>();
50 }));
51
52 auto operation = [this](const RequestT& req) { return static_cast<DerivedClient*>(this)->GetProxy(req); };
53 Aws::Utils::Waiter<RequestT, OutcomeT> waiter(15, 40, std::move(acceptors), operation, "WaitUntilProxyActive");
54 return waiter.Wait(request);
55 }
56
58 using OutcomeT = Model::GetProxyOutcome;
59 using RequestT = Model::GetProxyRequest;
61 acceptors.emplace_back(Aws::MakeUnique<Aws::Utils::ErrorAcceptor<OutcomeT>>("ProxyDeletedWaiter", Aws::Utils::WaiterState::SUCCESS,
62 Aws::String("ResourceNotFoundException")));
63
64 auto operation = [this](const RequestT& req) { return static_cast<DerivedClient*>(this)->GetProxy(req); };
65 Aws::Utils::Waiter<RequestT, OutcomeT> waiter(15, 40, std::move(acceptors), operation, "WaitUntilProxyDeleted");
66 return waiter.Wait(request);
67 }
68
70 using OutcomeT = Model::GetProxyUpdateOutcome;
71 using RequestT = Model::GetProxyUpdateRequest;
74 "ProxyUpdateCompleteWaiter", Aws::Utils::WaiterState::SUCCESS, Aws::String("complete"),
75 [](const Model::GetProxyUpdateOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
76 if (!outcome.IsSuccess()) return false;
77 const auto& result = outcome.GetResult();
79 result.GetState().GetPropagationStatus()) == expected.get<Aws::String>();
80 }));
82 "ProxyUpdateCompleteWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("failed"),
83 [](const Model::GetProxyUpdateOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
84 if (!outcome.IsSuccess()) return false;
85 const auto& result = outcome.GetResult();
87 result.GetState().GetPropagationStatus()) == expected.get<Aws::String>();
88 }));
90 "ProxyUpdateCompleteWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("cancelled"),
91 [](const Model::GetProxyUpdateOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
92 if (!outcome.IsSuccess()) return false;
93 const auto& result = outcome.GetResult();
95 result.GetState().GetPropagationStatus()) == expected.get<Aws::String>();
96 }));
98 "ProxyUpdateCompleteWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("skipped"),
99 [](const Model::GetProxyUpdateOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
100 if (!outcome.IsSuccess()) return false;
101 const auto& result = outcome.GetResult();
103 result.GetState().GetPropagationStatus()) == expected.get<Aws::String>();
104 }));
106 "ProxyUpdateCompleteWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("invalid"),
107 [](const Model::GetProxyUpdateOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
108 if (!outcome.IsSuccess()) return false;
109 const auto& result = outcome.GetResult();
110 return Model::ProxyUpdateValidationStatusMapper::GetNameForProxyUpdateValidationStatus(result.GetState().GetValidationStatus()) ==
111 expected.get<Aws::String>();
112 }));
113
114 auto operation = [this](const RequestT& req) { return static_cast<DerivedClient*>(this)->GetProxyUpdate(req); };
115 Aws::Utils::Waiter<RequestT, OutcomeT> waiter(5, 24, std::move(acceptors), operation, "WaitUntilProxyUpdateComplete");
116 return waiter.Wait(request);
117 }
118};
119} // namespace ELBProxy
120} // namespace Aws
Aws::Utils::WaiterOutcome< Model::GetProxyOutcome > WaitUntilProxyActive(const Model::GetProxyRequest &request)
Aws::Utils::WaiterOutcome< Model::GetProxyOutcome > WaitUntilProxyDeleted(const Model::GetProxyRequest &request)
Aws::Utils::WaiterOutcome< Model::GetProxyUpdateOutcome > WaitUntilProxyUpdateComplete(const Model::GetProxyUpdateRequest &request)
bool IsSuccess() const
const R & GetResult() const
WaiterOutcome< OutcomeT > Wait(const RequestT &request)
AWS_ELBPROXY_API Aws::String GetNameForProxyStatusCode(ProxyStatusCode value)
AWS_ELBPROXY_API Aws::String GetNameForProxyUpdatePropagationStatus(ProxyUpdatePropagationStatus value)
AWS_ELBPROXY_API Aws::String GetNameForProxyUpdateValidationStatus(ProxyUpdateValidationStatus value)
Aws::Utils::Outcome< GetProxyUpdateResult, ELBProxyError > GetProxyUpdateOutcome
Aws::Utils::Outcome< GetProxyResult, ELBProxyError > GetProxyOutcome
Crt::Variant< int, bool, Aws::String > ExpectedValue
UniquePtr< T > MakeUnique(const char *allocationTag, ArgTypes &&... args)
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
std::vector< T, Aws::Allocator< T > > Vector