AWS SDK for C++

AWS SDK for C++ Version 1.11.812

Loading...
Searching...
No Matches
LocationServiceWaiter.h
1
6#pragma once
7#include <aws/core/utils/Waiter.h>
8#include <aws/core/utils/memory/AWSMemory.h>
9#include <aws/location/LocationServiceClient.h>
10#include <aws/location/model/GetJobRequest.h>
11#include <aws/location/model/GetJobResult.h>
12#include <aws/location/model/JobStatus.h>
13
14#include <algorithm>
15
16namespace Aws {
17namespace LocationService {
18
19template <typename DerivedClient = LocationServiceClient>
21 public:
23 using OutcomeT = Model::GetJobOutcome;
24 using RequestT = Model::GetJobRequest;
27 "JobCompletedWaiter", Aws::Utils::WaiterState::SUCCESS, Aws::String("Completed"),
28 [](const Model::GetJobOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
29 if (!outcome.IsSuccess()) return false;
30 const auto& result = outcome.GetResult();
31 return Model::JobStatusMapper::GetNameForJobStatus(result.GetStatus()) == expected.get<Aws::String>();
32 }));
34 "JobCompletedWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("Failed"),
35 [](const Model::GetJobOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
36 if (!outcome.IsSuccess()) return false;
37 const auto& result = outcome.GetResult();
38 return Model::JobStatusMapper::GetNameForJobStatus(result.GetStatus()) == expected.get<Aws::String>();
39 }));
41 "JobCompletedWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("Cancelled"),
42 [](const Model::GetJobOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
43 if (!outcome.IsSuccess()) return false;
44 const auto& result = outcome.GetResult();
45 return Model::JobStatusMapper::GetNameForJobStatus(result.GetStatus()) == expected.get<Aws::String>();
46 }));
47
48 auto operation = [this](const RequestT& req) { return static_cast<DerivedClient*>(this)->GetJob(req); };
49 Aws::Utils::Waiter<RequestT, OutcomeT> waiter(60, 2, std::move(acceptors), operation, "WaitUntilJobCompleted");
50 return waiter.Wait(request);
51 }
52};
53} // namespace LocationService
54} // namespace Aws
Aws::Utils::WaiterOutcome< Model::GetJobOutcome > WaitUntilJobCompleted(const Model::GetJobRequest &request)
bool IsSuccess() const
const R & GetResult() const
WaiterOutcome< OutcomeT > Wait(const RequestT &request)
AWS_LOCATIONSERVICE_API Aws::String GetNameForJobStatus(JobStatus value)
Aws::Utils::Outcome< GetJobResult, LocationServiceError > GetJobOutcome
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