AWS SDK for C++

AWS SDK for C++ Version 1.11.778

Loading...
Searching...
No Matches
RepostspaceWaiter.h
1
6#pragma once
7#include <aws/core/utils/Waiter.h>
8#include <aws/core/utils/memory/AWSMemory.h>
9#include <aws/repostspace/RepostspaceClient.h>
10#include <aws/repostspace/model/ChannelStatus.h>
11#include <aws/repostspace/model/GetChannelRequest.h>
12#include <aws/repostspace/model/GetChannelResult.h>
13#include <aws/repostspace/model/GetSpaceRequest.h>
14#include <aws/repostspace/model/GetSpaceResult.h>
15
16#include <algorithm>
17
18namespace Aws {
19namespace repostspace {
20
21template <typename DerivedClient = RepostspaceClient>
23 public:
25 using OutcomeT = Model::GetChannelOutcome;
26 using RequestT = Model::GetChannelRequest;
29 "ChannelCreatedWaiter", Aws::Utils::WaiterState::SUCCESS, Aws::String("CREATED"),
30 [](const Model::GetChannelOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
31 if (!outcome.IsSuccess()) return false;
32 const auto& result = outcome.GetResult();
33 return Model::ChannelStatusMapper::GetNameForChannelStatus(result.GetChannelStatus()) == expected.get<Aws::String>();
34 }));
36 "ChannelCreatedWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("CREATE_FAILED"),
37 [](const Model::GetChannelOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
38 if (!outcome.IsSuccess()) return false;
39 const auto& result = outcome.GetResult();
40 return Model::ChannelStatusMapper::GetNameForChannelStatus(result.GetChannelStatus()) == expected.get<Aws::String>();
41 }));
43 "ChannelCreatedWaiter", Aws::Utils::WaiterState::RETRY, Aws::String("CREATING"),
44 [](const Model::GetChannelOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
45 if (!outcome.IsSuccess()) return false;
46 const auto& result = outcome.GetResult();
47 return Model::ChannelStatusMapper::GetNameForChannelStatus(result.GetChannelStatus()) == expected.get<Aws::String>();
48 }));
49
50 auto operation = [this](const RequestT& req) { return static_cast<DerivedClient*>(this)->GetChannel(req); };
51 Aws::Utils::Waiter<RequestT, OutcomeT> waiter(2, 60, std::move(acceptors), operation, "WaitUntilChannelCreated");
52 return waiter.Wait(request);
53 }
54
56 using OutcomeT = Model::GetChannelOutcome;
57 using RequestT = Model::GetChannelRequest;
59 acceptors.emplace_back(Aws::MakeUnique<Aws::Utils::ErrorAcceptor<OutcomeT>>("ChannelDeletedWaiter", Aws::Utils::WaiterState::SUCCESS,
60 Aws::String("ResourceNotFoundException")));
62 "ChannelDeletedWaiter", Aws::Utils::WaiterState::SUCCESS, Aws::String("DELETED"),
63 [](const Model::GetChannelOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
64 if (!outcome.IsSuccess()) return false;
65 const auto& result = outcome.GetResult();
66 return Model::ChannelStatusMapper::GetNameForChannelStatus(result.GetChannelStatus()) == expected.get<Aws::String>();
67 }));
69 "ChannelDeletedWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("DELETE_FAILED"),
70 [](const Model::GetChannelOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
71 if (!outcome.IsSuccess()) return false;
72 const auto& result = outcome.GetResult();
73 return Model::ChannelStatusMapper::GetNameForChannelStatus(result.GetChannelStatus()) == expected.get<Aws::String>();
74 }));
76 "ChannelDeletedWaiter", Aws::Utils::WaiterState::RETRY, Aws::String("DELETING"),
77 [](const Model::GetChannelOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
78 if (!outcome.IsSuccess()) return false;
79 const auto& result = outcome.GetResult();
80 return Model::ChannelStatusMapper::GetNameForChannelStatus(result.GetChannelStatus()) == expected.get<Aws::String>();
81 }));
82
83 auto operation = [this](const RequestT& req) { return static_cast<DerivedClient*>(this)->GetChannel(req); };
84 Aws::Utils::Waiter<RequestT, OutcomeT> waiter(2, 60, std::move(acceptors), operation, "WaitUntilChannelDeleted");
85 return waiter.Wait(request);
86 }
87
89 using OutcomeT = Model::GetSpaceOutcome;
90 using RequestT = Model::GetSpaceRequest;
93 "SpaceCreatedWaiter", Aws::Utils::WaiterState::SUCCESS, Aws::String("CREATED"),
94 [](const Model::GetSpaceOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
95 if (!outcome.IsSuccess()) return false;
96 const auto& result = outcome.GetResult();
97 return result.GetStatus() == expected.get<Aws::String>();
98 }));
100 "SpaceCreatedWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("CREATE_FAILED"),
101 [](const Model::GetSpaceOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
102 if (!outcome.IsSuccess()) return false;
103 const auto& result = outcome.GetResult();
104 return result.GetStatus() == expected.get<Aws::String>();
105 }));
107 "SpaceCreatedWaiter", Aws::Utils::WaiterState::RETRY, Aws::String("CREATING"),
108 [](const Model::GetSpaceOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
109 if (!outcome.IsSuccess()) return false;
110 const auto& result = outcome.GetResult();
111 return result.GetStatus() == expected.get<Aws::String>();
112 }));
113
114 auto operation = [this](const RequestT& req) { return static_cast<DerivedClient*>(this)->GetSpace(req); };
115 Aws::Utils::Waiter<RequestT, OutcomeT> waiter(300, 24, std::move(acceptors), operation, "WaitUntilSpaceCreated");
116 return waiter.Wait(request);
117 }
118
120 using OutcomeT = Model::GetSpaceOutcome;
121 using RequestT = Model::GetSpaceRequest;
123 acceptors.emplace_back(Aws::MakeUnique<Aws::Utils::ErrorAcceptor<OutcomeT>>("SpaceDeletedWaiter", Aws::Utils::WaiterState::SUCCESS,
124 Aws::String("ResourceNotFoundException")));
126 "SpaceDeletedWaiter", Aws::Utils::WaiterState::SUCCESS, Aws::String("DELETED"),
127 [](const Model::GetSpaceOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
128 if (!outcome.IsSuccess()) return false;
129 const auto& result = outcome.GetResult();
130 return result.GetStatus() == expected.get<Aws::String>();
131 }));
133 "SpaceDeletedWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("DELETE_FAILED"),
134 [](const Model::GetSpaceOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
135 if (!outcome.IsSuccess()) return false;
136 const auto& result = outcome.GetResult();
137 return result.GetStatus() == expected.get<Aws::String>();
138 }));
140 "SpaceDeletedWaiter", Aws::Utils::WaiterState::RETRY, Aws::String("DELETING"),
141 [](const Model::GetSpaceOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
142 if (!outcome.IsSuccess()) return false;
143 const auto& result = outcome.GetResult();
144 return result.GetStatus() == expected.get<Aws::String>();
145 }));
146
147 auto operation = [this](const RequestT& req) { return static_cast<DerivedClient*>(this)->GetSpace(req); };
148 Aws::Utils::Waiter<RequestT, OutcomeT> waiter(300, 24, std::move(acceptors), operation, "WaitUntilSpaceDeleted");
149 return waiter.Wait(request);
150 }
151};
152} // namespace repostspace
153} // namespace Aws
bool IsSuccess() const
const R & GetResult() const
WaiterOutcome< OutcomeT > Wait(const RequestT &request)
Aws::Utils::WaiterOutcome< Model::GetChannelOutcome > WaitUntilChannelCreated(const Model::GetChannelRequest &request)
Aws::Utils::WaiterOutcome< Model::GetSpaceOutcome > WaitUntilSpaceCreated(const Model::GetSpaceRequest &request)
Aws::Utils::WaiterOutcome< Model::GetChannelOutcome > WaitUntilChannelDeleted(const Model::GetChannelRequest &request)
Aws::Utils::WaiterOutcome< Model::GetSpaceOutcome > WaitUntilSpaceDeleted(const Model::GetSpaceRequest &request)
Crt::Variant< int, bool, Aws::String > ExpectedValue
AWS_REPOSTSPACE_API Aws::String GetNameForChannelStatus(ChannelStatus value)
Aws::Utils::Outcome< GetSpaceResult, RepostspaceError > GetSpaceOutcome
Aws::Utils::Outcome< GetChannelResult, RepostspaceError > GetChannelOutcome
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