AWS SDK for C++

AWS SDK for C++ Version 1.11.777

Loading...
Searching...
No Matches
GameLiftStreamsWaiter.h
1
6#pragma once
7#include <aws/core/utils/Waiter.h>
8#include <aws/core/utils/memory/AWSMemory.h>
9#include <aws/gameliftstreams/GameLiftStreamsClient.h>
10#include <aws/gameliftstreams/model/ApplicationStatus.h>
11#include <aws/gameliftstreams/model/GetApplicationRequest.h>
12#include <aws/gameliftstreams/model/GetApplicationResult.h>
13#include <aws/gameliftstreams/model/GetStreamGroupRequest.h>
14#include <aws/gameliftstreams/model/GetStreamGroupResult.h>
15#include <aws/gameliftstreams/model/GetStreamSessionRequest.h>
16#include <aws/gameliftstreams/model/GetStreamSessionResult.h>
17#include <aws/gameliftstreams/model/StreamGroupStatus.h>
18#include <aws/gameliftstreams/model/StreamSessionStatus.h>
19
20#include <algorithm>
21
22namespace Aws {
23namespace GameLiftStreams {
24
25template <typename DerivedClient = GameLiftStreamsClient>
27 public:
29 using OutcomeT = Model::GetApplicationOutcome;
30 using RequestT = Model::GetApplicationRequest;
33 "ApplicationReadyWaiter", Aws::Utils::WaiterState::SUCCESS, Aws::String("READY"),
34 [](const Model::GetApplicationOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
35 if (!outcome.IsSuccess()) return false;
36 const auto& result = outcome.GetResult();
37 return Model::ApplicationStatusMapper::GetNameForApplicationStatus(result.GetStatus()) == expected.get<Aws::String>();
38 }));
40 "ApplicationReadyWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("ERROR"),
41 [](const Model::GetApplicationOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
42 if (!outcome.IsSuccess()) return false;
43 const auto& result = outcome.GetResult();
44 return Model::ApplicationStatusMapper::GetNameForApplicationStatus(result.GetStatus()) == expected.get<Aws::String>();
45 }));
46
47 auto operation = [this](const RequestT& req) { return static_cast<DerivedClient*>(this)->GetApplication(req); };
48 Aws::Utils::Waiter<RequestT, OutcomeT> waiter(2, 60, std::move(acceptors), operation, "WaitUntilApplicationReady");
49 return waiter.Wait(request);
50 }
51
53 using OutcomeT = Model::GetApplicationOutcome;
54 using RequestT = Model::GetApplicationRequest;
57 "ApplicationDeletedWaiter", Aws::Utils::WaiterState::SUCCESS, Aws::String("ResourceNotFoundException")));
58
59 auto operation = [this](const RequestT& req) { return static_cast<DerivedClient*>(this)->GetApplication(req); };
60 Aws::Utils::Waiter<RequestT, OutcomeT> waiter(2, 60, std::move(acceptors), operation, "WaitUntilApplicationDeleted");
61 return waiter.Wait(request);
62 }
63
65 using OutcomeT = Model::GetStreamGroupOutcome;
66 using RequestT = Model::GetStreamGroupRequest;
69 "StreamGroupActiveWaiter", Aws::Utils::WaiterState::SUCCESS, Aws::String("ACTIVE"),
70 [](const Model::GetStreamGroupOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
71 if (!outcome.IsSuccess()) return false;
72 const auto& result = outcome.GetResult();
73 return Model::StreamGroupStatusMapper::GetNameForStreamGroupStatus(result.GetStatus()) == expected.get<Aws::String>();
74 }));
76 "StreamGroupActiveWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("ERROR"),
77 [](const Model::GetStreamGroupOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
78 if (!outcome.IsSuccess()) return false;
79 const auto& result = outcome.GetResult();
80 return Model::StreamGroupStatusMapper::GetNameForStreamGroupStatus(result.GetStatus()) == expected.get<Aws::String>();
81 }));
83 "StreamGroupActiveWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("ACTIVE_WITH_ERRORS"),
84 [](const Model::GetStreamGroupOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
85 if (!outcome.IsSuccess()) return false;
86 const auto& result = outcome.GetResult();
87 return Model::StreamGroupStatusMapper::GetNameForStreamGroupStatus(result.GetStatus()) == expected.get<Aws::String>();
88 }));
90 "StreamGroupActiveWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("DELETING"),
91 [](const Model::GetStreamGroupOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
92 if (!outcome.IsSuccess()) return false;
93 const auto& result = outcome.GetResult();
94 return Model::StreamGroupStatusMapper::GetNameForStreamGroupStatus(result.GetStatus()) == expected.get<Aws::String>();
95 }));
96
97 auto operation = [this](const RequestT& req) { return static_cast<DerivedClient*>(this)->GetStreamGroup(req); };
98 Aws::Utils::Waiter<RequestT, OutcomeT> waiter(30, 120, std::move(acceptors), operation, "WaitUntilStreamGroupActive");
99 return waiter.Wait(request);
100 }
101
103 using OutcomeT = Model::GetStreamGroupOutcome;
104 using RequestT = Model::GetStreamGroupRequest;
107 "StreamGroupDeletedWaiter", Aws::Utils::WaiterState::SUCCESS, Aws::String("ResourceNotFoundException")));
108
109 auto operation = [this](const RequestT& req) { return static_cast<DerivedClient*>(this)->GetStreamGroup(req); };
110 Aws::Utils::Waiter<RequestT, OutcomeT> waiter(30, 60, std::move(acceptors), operation, "WaitUntilStreamGroupDeleted");
111 return waiter.Wait(request);
112 }
113
115 using OutcomeT = Model::GetStreamSessionOutcome;
116 using RequestT = Model::GetStreamSessionRequest;
119 "StreamSessionActiveWaiter", Aws::Utils::WaiterState::SUCCESS, Aws::String("ACTIVE"),
120 [](const Model::GetStreamSessionOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
121 if (!outcome.IsSuccess()) return false;
122 const auto& result = outcome.GetResult();
123 return Model::StreamSessionStatusMapper::GetNameForStreamSessionStatus(result.GetStatus()) == expected.get<Aws::String>();
124 }));
126 "StreamSessionActiveWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("ERROR"),
127 [](const Model::GetStreamSessionOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
128 if (!outcome.IsSuccess()) return false;
129 const auto& result = outcome.GetResult();
130 return Model::StreamSessionStatusMapper::GetNameForStreamSessionStatus(result.GetStatus()) == expected.get<Aws::String>();
131 }));
132
133 auto operation = [this](const RequestT& req) { return static_cast<DerivedClient*>(this)->GetStreamSession(req); };
134 Aws::Utils::Waiter<RequestT, OutcomeT> waiter(2, 60, std::move(acceptors), operation, "WaitUntilStreamSessionActive");
135 return waiter.Wait(request);
136 }
137};
138} // namespace GameLiftStreams
139} // namespace Aws
Aws::Utils::WaiterOutcome< Model::GetStreamGroupOutcome > WaitUntilStreamGroupActive(const Model::GetStreamGroupRequest &request)
Aws::Utils::WaiterOutcome< Model::GetApplicationOutcome > WaitUntilApplicationDeleted(const Model::GetApplicationRequest &request)
Aws::Utils::WaiterOutcome< Model::GetStreamSessionOutcome > WaitUntilStreamSessionActive(const Model::GetStreamSessionRequest &request)
Aws::Utils::WaiterOutcome< Model::GetApplicationOutcome > WaitUntilApplicationReady(const Model::GetApplicationRequest &request)
Aws::Utils::WaiterOutcome< Model::GetStreamGroupOutcome > WaitUntilStreamGroupDeleted(const Model::GetStreamGroupRequest &request)
bool IsSuccess() const
const R & GetResult() const
WaiterOutcome< OutcomeT > Wait(const RequestT &request)
AWS_GAMELIFTSTREAMS_API Aws::String GetNameForApplicationStatus(ApplicationStatus value)
AWS_GAMELIFTSTREAMS_API Aws::String GetNameForStreamGroupStatus(StreamGroupStatus value)
AWS_GAMELIFTSTREAMS_API Aws::String GetNameForStreamSessionStatus(StreamSessionStatus value)
Aws::Utils::Outcome< GetApplicationResult, GameLiftStreamsError > GetApplicationOutcome
Aws::Utils::Outcome< GetStreamGroupResult, GameLiftStreamsError > GetStreamGroupOutcome
Aws::Utils::Outcome< GetStreamSessionResult, GameLiftStreamsError > GetStreamSessionOutcome
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