AWS SDK for C++

AWS SDK for C++ Version 1.11.785

Loading...
Searching...
No Matches
ElementalInferenceWaiter.h
1
6#pragma once
7#include <aws/core/utils/Waiter.h>
8#include <aws/core/utils/memory/AWSMemory.h>
9#include <aws/elementalinference/ElementalInferenceClient.h>
10#include <aws/elementalinference/model/FeedStatus.h>
11#include <aws/elementalinference/model/GetFeedRequest.h>
12#include <aws/elementalinference/model/GetFeedResult.h>
13
14#include <algorithm>
15
16namespace Aws {
17namespace ElementalInference {
18
19template <typename DerivedClient = ElementalInferenceClient>
21 public:
23 using OutcomeT = Model::GetFeedOutcome;
24 using RequestT = Model::GetFeedRequest;
26 acceptors.emplace_back(Aws::MakeUnique<Aws::Utils::ErrorAcceptor<OutcomeT>>("FeedDeletedWaiter", Aws::Utils::WaiterState::SUCCESS,
27 Aws::String("ResourceNotFoundException")));
29 "FeedDeletedWaiter", Aws::Utils::WaiterState::SUCCESS, Aws::String("DELETED"),
30 [](const Model::GetFeedOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
31 if (!outcome.IsSuccess()) return false;
32 const auto& result = outcome.GetResult();
33 return Model::FeedStatusMapper::GetNameForFeedStatus(result.GetStatus()) == expected.get<Aws::String>();
34 }));
36 "FeedDeletedWaiter", Aws::Utils::WaiterState::RETRY, Aws::String("DELETING"),
37 [](const Model::GetFeedOutcome& outcome, const Aws::Utils::ExpectedValue& expected) -> bool {
38 if (!outcome.IsSuccess()) return false;
39 const auto& result = outcome.GetResult();
40 return Model::FeedStatusMapper::GetNameForFeedStatus(result.GetStatus()) == expected.get<Aws::String>();
41 }));
42 acceptors.emplace_back(Aws::MakeUnique<Aws::Utils::ErrorAcceptor<OutcomeT>>("FeedDeletedWaiter", Aws::Utils::WaiterState::RETRY,
43 Aws::String("InternalServerErrorException")));
44 acceptors.emplace_back(Aws::MakeUnique<Aws::Utils::ErrorAcceptor<OutcomeT>>("FeedDeletedWaiter", Aws::Utils::WaiterState::RETRY,
45 Aws::String("TooManyRequestException")));
46
47 auto operation = [this](const RequestT& req) { return static_cast<DerivedClient*>(this)->GetFeed(req); };
48 Aws::Utils::Waiter<RequestT, OutcomeT> waiter(3, 40, std::move(acceptors), operation, "WaitUntilFeedDeleted");
49 return waiter.Wait(request);
50 }
51};
52} // namespace ElementalInference
53} // namespace Aws
Aws::Utils::WaiterOutcome< Model::GetFeedOutcome > WaitUntilFeedDeleted(const Model::GetFeedRequest &request)
bool IsSuccess() const
const R & GetResult() const
WaiterOutcome< OutcomeT > Wait(const RequestT &request)
AWS_ELEMENTALINFERENCE_API Aws::String GetNameForFeedStatus(FeedStatus value)
Aws::Utils::Outcome< GetFeedResult, ElementalInferenceError > GetFeedOutcome
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