AWS SDK for C++

AWS SDK for C++ Version 1.11.778

Loading...
Searching...
No Matches
AppConfigWaiter.h
1
6#pragma once
7#include <aws/appconfig/AppConfigClient.h>
8#include <aws/appconfig/model/DeploymentState.h>
9#include <aws/appconfig/model/EnvironmentState.h>
10#include <aws/appconfig/model/GetDeploymentRequest.h>
11#include <aws/appconfig/model/GetDeploymentResult.h>
12#include <aws/appconfig/model/GetEnvironmentRequest.h>
13#include <aws/appconfig/model/GetEnvironmentResult.h>
14#include <aws/core/utils/Waiter.h>
15#include <aws/core/utils/memory/AWSMemory.h>
16
17#include <algorithm>
18
19namespace Aws {
20namespace AppConfig {
21
22template <typename DerivedClient = AppConfigClient>
24 public:
26 using OutcomeT = Model::GetDeploymentOutcome;
27 using RequestT = Model::GetDeploymentRequest;
30 "DeploymentCompleteWaiter", Aws::Utils::WaiterState::SUCCESS, Aws::String("COMPLETE"),
31 [](const Model::GetDeploymentOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
32 if (!outcome.IsSuccess()) return false;
33 const auto& result = outcome.GetResult();
34 return Model::DeploymentStateMapper::GetNameForDeploymentState(result.GetState()) == expected.get<Aws::String>();
35 }));
37 "DeploymentCompleteWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("ROLLED_BACK"),
38 [](const Model::GetDeploymentOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
39 if (!outcome.IsSuccess()) return false;
40 const auto& result = outcome.GetResult();
41 return Model::DeploymentStateMapper::GetNameForDeploymentState(result.GetState()) == expected.get<Aws::String>();
42 }));
44 "DeploymentCompleteWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("REVERTED"),
45 [](const Model::GetDeploymentOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
46 if (!outcome.IsSuccess()) return false;
47 const auto& result = outcome.GetResult();
48 return Model::DeploymentStateMapper::GetNameForDeploymentState(result.GetState()) == expected.get<Aws::String>();
49 }));
50
51 auto operation = [this](const RequestT& req) { return static_cast<DerivedClient*>(this)->GetDeployment(req); };
52 Aws::Utils::Waiter<RequestT, OutcomeT> waiter(30, 4, std::move(acceptors), operation, "WaitUntilDeploymentComplete");
53 return waiter.Wait(request);
54 }
55
57 const Model::GetEnvironmentRequest& request) {
58 using OutcomeT = Model::GetEnvironmentOutcome;
59 using RequestT = Model::GetEnvironmentRequest;
62 "EnvironmentReadyForDeploymentWaiter", Aws::Utils::WaiterState::SUCCESS, Aws::String("ReadyForDeployment"),
63 [](const Model::GetEnvironmentOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
64 if (!outcome.IsSuccess()) return false;
65 const auto& result = outcome.GetResult();
66 return Model::EnvironmentStateMapper::GetNameForEnvironmentState(result.GetState()) == expected.get<Aws::String>();
67 }));
69 "EnvironmentReadyForDeploymentWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("RolledBack"),
70 [](const Model::GetEnvironmentOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
71 if (!outcome.IsSuccess()) return false;
72 const auto& result = outcome.GetResult();
73 return Model::EnvironmentStateMapper::GetNameForEnvironmentState(result.GetState()) == expected.get<Aws::String>();
74 }));
76 "EnvironmentReadyForDeploymentWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("Reverted"),
77 [](const Model::GetEnvironmentOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
78 if (!outcome.IsSuccess()) return false;
79 const auto& result = outcome.GetResult();
80 return Model::EnvironmentStateMapper::GetNameForEnvironmentState(result.GetState()) == expected.get<Aws::String>();
81 }));
82
83 auto operation = [this](const RequestT& req) { return static_cast<DerivedClient*>(this)->GetEnvironment(req); };
84 Aws::Utils::Waiter<RequestT, OutcomeT> waiter(30, 4, std::move(acceptors), operation, "WaitUntilEnvironmentReadyForDeployment");
85 return waiter.Wait(request);
86 }
87};
88} // namespace AppConfig
89} // namespace Aws
Aws::Utils::WaiterOutcome< Model::GetEnvironmentOutcome > WaitUntilEnvironmentReadyForDeployment(const Model::GetEnvironmentRequest &request)
Aws::Utils::WaiterOutcome< Model::GetDeploymentOutcome > WaitUntilDeploymentComplete(const Model::GetDeploymentRequest &request)
bool IsSuccess() const
const R & GetResult() const
WaiterOutcome< OutcomeT > Wait(const RequestT &request)
AWS_APPCONFIG_API Aws::String GetNameForDeploymentState(DeploymentState value)
AWS_APPCONFIG_API Aws::String GetNameForEnvironmentState(EnvironmentState value)
Aws::Utils::Outcome< GetDeploymentResult, AppConfigError > GetDeploymentOutcome
Aws::Utils::Outcome< GetEnvironmentResult, AppConfigError > GetEnvironmentOutcome
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