AWS SDK for C++

AWS SDK for C++ Version 1.11.778

Loading...
Searching...
No Matches
CodeDeployWaiter.h
1
6#pragma once
7#include <aws/codedeploy/CodeDeployClient.h>
8#include <aws/codedeploy/model/DeploymentStatus.h>
9#include <aws/codedeploy/model/GetDeploymentRequest.h>
10#include <aws/codedeploy/model/GetDeploymentResult.h>
11#include <aws/core/utils/Waiter.h>
12#include <aws/core/utils/memory/AWSMemory.h>
13
14#include <algorithm>
15
16namespace Aws {
17namespace CodeDeploy {
18
19template <typename DerivedClient = CodeDeployClient>
21 public:
23 using OutcomeT = Model::GetDeploymentOutcome;
24 using RequestT = Model::GetDeploymentRequest;
27 "DeploymentSuccessfulWaiter", Aws::Utils::WaiterState::SUCCESS, Aws::String("Succeeded"),
28 [](const Model::GetDeploymentOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
29 if (!outcome.IsSuccess()) return false;
30 const auto& result = outcome.GetResult();
31 return Model::DeploymentStatusMapper::GetNameForDeploymentStatus(result.GetDeploymentInfo().GetStatus()) ==
32 expected.get<Aws::String>();
33 }));
35 "DeploymentSuccessfulWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("Failed"),
36 [](const Model::GetDeploymentOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
37 if (!outcome.IsSuccess()) return false;
38 const auto& result = outcome.GetResult();
39 return Model::DeploymentStatusMapper::GetNameForDeploymentStatus(result.GetDeploymentInfo().GetStatus()) ==
40 expected.get<Aws::String>();
41 }));
43 "DeploymentSuccessfulWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("Stopped"),
44 [](const Model::GetDeploymentOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
45 if (!outcome.IsSuccess()) return false;
46 const auto& result = outcome.GetResult();
47 return Model::DeploymentStatusMapper::GetNameForDeploymentStatus(result.GetDeploymentInfo().GetStatus()) ==
48 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(15, 8, std::move(acceptors), operation, "WaitUntilDeploymentSuccessful");
53 return waiter.Wait(request);
54 }
55};
56} // namespace CodeDeploy
57} // namespace Aws
Aws::Utils::WaiterOutcome< Model::GetDeploymentOutcome > WaitUntilDeploymentSuccessful(const Model::GetDeploymentRequest &request)
bool IsSuccess() const
const R & GetResult() const
WaiterOutcome< OutcomeT > Wait(const RequestT &request)
AWS_CODEDEPLOY_API Aws::String GetNameForDeploymentStatus(DeploymentStatus value)
Aws::Utils::Outcome< GetDeploymentResult, CodeDeployError > GetDeploymentOutcome
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