-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Waiter codegen plugin + waiters #3752
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sbaluja
wants to merge
21
commits into
main
Choose a base branch
from
waiter-codegen
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+23,846
−519
Open
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
e65bca3
Updated waiter template to accept a templated PathMatcher per accepto…
sbaluja f055c62
Waiter codegen project
sbaluja 5ee519a
Waiter codegen tests
sbaluja 6e1ee56
Update crtp client inheritance & python script for smithy codegen
sbaluja 9847658
Add proper state chaining in Waiter.h
sbaluja 42c2d31
Add mapping for lost c2j errors to error code
sbaluja 8957fc9
Updated clients
sbaluja 473e1e5
Add namespace mapping to WaiterCodeGenPlugin
sbaluja b550a2e
generate Waiter.h for clients that don't have waiters modeled
sbaluja d78cc48
Seperate different acceptors into seperate structs/classes
sbaluja 37964bf
Update codegen to use new Acceptor structs
sbaluja ac02439
Return Optional<Shape> in private methods of CollectionElementTypeRes…
sbaluja 3bed506
Add userAgent metrics for waiters
sbaluja 7211b70
Updated waiters
sbaluja eec297b
Transition the waiter to the failure state if none of the acceptors a…
sbaluja 0bb04ec
change std::vector to Aws::Vector (why do i forget this everytime)
sbaluja a2fc448
Updated waiter files
sbaluja 059a254
Include handling for smithy 1.0 enum modeling (string shape with enum…
sbaluja 62eddc4
Resolve cpp type from FilterPredicateEmitter for inner types instead …
sbaluja 7de1e79
Updated waiters
sbaluja add6ebc
Resolve enum for filterOperandEmitter paths
sbaluja File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
generated/src/aws-cpp-sdk-AWSMigrationHub/include/aws/AWSMigrationHub/MigrationHubWaiter.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| /** | ||
| * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| * SPDX-License-Identifier: Apache-2.0. | ||
| */ | ||
|
|
||
| #pragma once | ||
| #include <aws/AWSMigrationHub/MigrationHubClient.h> | ||
| #include <aws/core/utils/Waiter.h> | ||
| #include <aws/core/utils/memory/AWSMemory.h> | ||
|
|
||
| #include <algorithm> | ||
|
|
||
| namespace Aws { | ||
| namespace MigrationHub { | ||
|
|
||
| template <typename DerivedClient = MigrationHubClient> | ||
| class MigrationHubWaiter { | ||
| public: | ||
| }; | ||
| } // namespace MigrationHub | ||
| } // namespace Aws |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
generated/src/aws-cpp-sdk-accessanalyzer/include/aws/accessanalyzer/AccessAnalyzerWaiter.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| /** | ||
| * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| * SPDX-License-Identifier: Apache-2.0. | ||
| */ | ||
|
|
||
| #pragma once | ||
| #include <aws/accessanalyzer/AccessAnalyzerClient.h> | ||
| #include <aws/core/utils/Waiter.h> | ||
| #include <aws/core/utils/memory/AWSMemory.h> | ||
|
|
||
| #include <algorithm> | ||
|
|
||
| namespace Aws { | ||
| namespace AccessAnalyzer { | ||
|
|
||
| template <typename DerivedClient = AccessAnalyzerClient> | ||
| class AccessAnalyzerWaiter { | ||
| public: | ||
| }; | ||
| } // namespace AccessAnalyzer | ||
| } // namespace Aws |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
generated/src/aws-cpp-sdk-account/include/aws/account/AccountWaiter.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| /** | ||
| * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| * SPDX-License-Identifier: Apache-2.0. | ||
| */ | ||
|
|
||
| #pragma once | ||
| #include <aws/account/AccountClient.h> | ||
| #include <aws/core/utils/Waiter.h> | ||
| #include <aws/core/utils/memory/AWSMemory.h> | ||
|
|
||
| #include <algorithm> | ||
|
|
||
| namespace Aws { | ||
| namespace Account { | ||
|
|
||
| template <typename DerivedClient = AccountClient> | ||
| class AccountWaiter { | ||
| public: | ||
| }; | ||
| } // namespace Account | ||
| } // namespace Aws |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 89 additions & 0 deletions
89
generated/src/aws-cpp-sdk-acm-pca/include/aws/acm-pca/ACMPCAWaiter.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| /** | ||
| * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| * SPDX-License-Identifier: Apache-2.0. | ||
| */ | ||
|
|
||
| #pragma once | ||
| #include <aws/acm-pca/ACMPCAClient.h> | ||
| #include <aws/acm-pca/model/AuditReportStatus.h> | ||
| #include <aws/acm-pca/model/DescribeCertificateAuthorityAuditReportRequest.h> | ||
| #include <aws/acm-pca/model/DescribeCertificateAuthorityAuditReportResult.h> | ||
| #include <aws/acm-pca/model/GetCertificateAuthorityCsrRequest.h> | ||
| #include <aws/acm-pca/model/GetCertificateAuthorityCsrResult.h> | ||
| #include <aws/acm-pca/model/GetCertificateRequest.h> | ||
| #include <aws/acm-pca/model/GetCertificateResult.h> | ||
| #include <aws/core/utils/Waiter.h> | ||
| #include <aws/core/utils/memory/AWSMemory.h> | ||
|
|
||
| #include <algorithm> | ||
|
|
||
| namespace Aws { | ||
| namespace ACMPCA { | ||
|
|
||
| template <typename DerivedClient = ACMPCAClient> | ||
| class ACMPCAWaiter { | ||
| public: | ||
| Aws::Utils::WaiterOutcome<Model::DescribeCertificateAuthorityAuditReportOutcome> WaitUntilAuditReportCreated( | ||
| const Model::DescribeCertificateAuthorityAuditReportRequest& request) { | ||
| using OutcomeT = Model::DescribeCertificateAuthorityAuditReportOutcome; | ||
| using RequestT = Model::DescribeCertificateAuthorityAuditReportRequest; | ||
| Aws::Vector<Aws::UniquePtr<Aws::Utils::Acceptor<OutcomeT>>> acceptors; | ||
| acceptors.emplace_back(Aws::MakeUnique<Aws::Utils::PathAcceptor<OutcomeT>>( | ||
| "AuditReportCreatedWaiter", Aws::Utils::WaiterState::SUCCESS, Aws::String("SUCCESS"), | ||
| [](const Model::DescribeCertificateAuthorityAuditReportOutcome& outcome, const Aws::Utils::ExpectedValue& expected) { | ||
| if (!outcome.IsSuccess()) return false; | ||
| const auto& result = outcome.GetResult(); | ||
| return Model::AuditReportStatusMapper::GetNameForAuditReportStatus(result.GetAuditReportStatus()) == expected.get<Aws::String>(); | ||
| })); | ||
| acceptors.emplace_back(Aws::MakeUnique<Aws::Utils::PathAcceptor<OutcomeT>>( | ||
| "AuditReportCreatedWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("FAILED"), | ||
| [](const Model::DescribeCertificateAuthorityAuditReportOutcome& outcome, const Aws::Utils::ExpectedValue& expected) { | ||
| if (!outcome.IsSuccess()) return false; | ||
| const auto& result = outcome.GetResult(); | ||
| return Model::AuditReportStatusMapper::GetNameForAuditReportStatus(result.GetAuditReportStatus()) == expected.get<Aws::String>(); | ||
| })); | ||
| acceptors.emplace_back(Aws::MakeUnique<Aws::Utils::ErrorAcceptor<OutcomeT>>( | ||
| "AuditReportCreatedWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("AccessDeniedException"))); | ||
|
|
||
| auto operation = [this](const RequestT& req) { | ||
| return static_cast<DerivedClient*>(this)->DescribeCertificateAuthorityAuditReport(req); | ||
| }; | ||
| Aws::Utils::Waiter<RequestT, OutcomeT> waiter(3, 60, std::move(acceptors), operation, "WaitUntilAuditReportCreated"); | ||
| return waiter.Wait(request); | ||
| } | ||
|
|
||
| Aws::Utils::WaiterOutcome<Model::GetCertificateOutcome> WaitUntilCertificateIssued(const Model::GetCertificateRequest& request) { | ||
| using OutcomeT = Model::GetCertificateOutcome; | ||
| using RequestT = Model::GetCertificateRequest; | ||
| Aws::Vector<Aws::UniquePtr<Aws::Utils::Acceptor<OutcomeT>>> acceptors; | ||
| acceptors.emplace_back( | ||
| Aws::MakeUnique<Aws::Utils::ErrorAcceptor<OutcomeT>>("CertificateIssuedWaiter", Aws::Utils::WaiterState::SUCCESS, false)); | ||
| acceptors.emplace_back(Aws::MakeUnique<Aws::Utils::ErrorAcceptor<OutcomeT>>("CertificateIssuedWaiter", Aws::Utils::WaiterState::RETRY, | ||
| Aws::String("RequestInProgressException"))); | ||
| acceptors.emplace_back(Aws::MakeUnique<Aws::Utils::ErrorAcceptor<OutcomeT>>("CertificateIssuedWaiter", Aws::Utils::WaiterState::FAILURE, | ||
| Aws::String("AccessDeniedException"))); | ||
|
|
||
| auto operation = [this](const RequestT& req) { return static_cast<DerivedClient*>(this)->GetCertificate(req); }; | ||
| Aws::Utils::Waiter<RequestT, OutcomeT> waiter(1, 60, std::move(acceptors), operation, "WaitUntilCertificateIssued"); | ||
| return waiter.Wait(request); | ||
| } | ||
|
|
||
| Aws::Utils::WaiterOutcome<Model::GetCertificateAuthorityCsrOutcome> WaitUntilCertificateAuthorityCSRCreated( | ||
| const Model::GetCertificateAuthorityCsrRequest& request) { | ||
| using OutcomeT = Model::GetCertificateAuthorityCsrOutcome; | ||
| using RequestT = Model::GetCertificateAuthorityCsrRequest; | ||
| Aws::Vector<Aws::UniquePtr<Aws::Utils::Acceptor<OutcomeT>>> acceptors; | ||
| acceptors.emplace_back(Aws::MakeUnique<Aws::Utils::ErrorAcceptor<OutcomeT>>("CertificateAuthorityCSRCreatedWaiter", | ||
| Aws::Utils::WaiterState::SUCCESS, false)); | ||
| acceptors.emplace_back(Aws::MakeUnique<Aws::Utils::ErrorAcceptor<OutcomeT>>( | ||
| "CertificateAuthorityCSRCreatedWaiter", Aws::Utils::WaiterState::RETRY, Aws::String("RequestInProgressException"))); | ||
| acceptors.emplace_back(Aws::MakeUnique<Aws::Utils::ErrorAcceptor<OutcomeT>>( | ||
| "CertificateAuthorityCSRCreatedWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("AccessDeniedException"))); | ||
|
|
||
| auto operation = [this](const RequestT& req) { return static_cast<DerivedClient*>(this)->GetCertificateAuthorityCsr(req); }; | ||
| Aws::Utils::Waiter<RequestT, OutcomeT> waiter(3, 60, std::move(acceptors), operation, "WaitUntilCertificateAuthorityCSRCreated"); | ||
| return waiter.Wait(request); | ||
| } | ||
| }; | ||
| } // namespace ACMPCA | ||
| } // namespace Aws |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| /** | ||
| * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| * SPDX-License-Identifier: Apache-2.0. | ||
| */ | ||
|
|
||
| #pragma once | ||
| #include <aws/acm/ACMClient.h> | ||
| #include <aws/acm/model/CertificateStatus.h> | ||
| #include <aws/acm/model/DescribeCertificateRequest.h> | ||
| #include <aws/acm/model/DescribeCertificateResult.h> | ||
| #include <aws/acm/model/DomainStatus.h> | ||
| #include <aws/core/utils/Waiter.h> | ||
| #include <aws/core/utils/memory/AWSMemory.h> | ||
|
|
||
| #include <algorithm> | ||
|
|
||
| namespace Aws { | ||
| namespace ACM { | ||
|
|
||
| template <typename DerivedClient = ACMClient> | ||
| class ACMWaiter { | ||
| public: | ||
| Aws::Utils::WaiterOutcome<Model::DescribeCertificateOutcome> WaitUntilCertificateValidated( | ||
| const Model::DescribeCertificateRequest& request) { | ||
| using OutcomeT = Model::DescribeCertificateOutcome; | ||
| using RequestT = Model::DescribeCertificateRequest; | ||
| Aws::Vector<Aws::UniquePtr<Aws::Utils::Acceptor<OutcomeT>>> acceptors; | ||
| acceptors.emplace_back(Aws::MakeUnique<Aws::Utils::PathAcceptor<OutcomeT>>( | ||
| "CertificateValidatedWaiter", Aws::Utils::WaiterState::SUCCESS, Aws::String("SUCCESS"), | ||
| [](const Model::DescribeCertificateOutcome& outcome, const Aws::Utils::ExpectedValue& expected) { | ||
| if (!outcome.IsSuccess()) return false; | ||
| const auto& result = outcome.GetResult(); | ||
| return std::all_of(result.GetCertificate().GetDomainValidationOptions().begin(), | ||
| result.GetCertificate().GetDomainValidationOptions().end(), [&](const Model::DomainValidation& item) { | ||
| return Model::DomainStatusMapper::GetNameForDomainStatus(item.GetValidationStatus()) == | ||
| expected.get<Aws::String>(); | ||
| }); | ||
| })); | ||
| acceptors.emplace_back(Aws::MakeUnique<Aws::Utils::PathAcceptor<OutcomeT>>( | ||
| "CertificateValidatedWaiter", Aws::Utils::WaiterState::RETRY, Aws::String("PENDING_VALIDATION"), | ||
| [](const Model::DescribeCertificateOutcome& outcome, const Aws::Utils::ExpectedValue& expected) { | ||
| if (!outcome.IsSuccess()) return false; | ||
| const auto& result = outcome.GetResult(); | ||
| return std::any_of(result.GetCertificate().GetDomainValidationOptions().begin(), | ||
| result.GetCertificate().GetDomainValidationOptions().end(), [&](const Model::DomainValidation& item) { | ||
| return Model::DomainStatusMapper::GetNameForDomainStatus(item.GetValidationStatus()) == | ||
| expected.get<Aws::String>(); | ||
| }); | ||
| })); | ||
| acceptors.emplace_back(Aws::MakeUnique<Aws::Utils::PathAcceptor<OutcomeT>>( | ||
| "CertificateValidatedWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("FAILED"), | ||
| [](const Model::DescribeCertificateOutcome& outcome, const Aws::Utils::ExpectedValue& expected) { | ||
| if (!outcome.IsSuccess()) return false; | ||
| const auto& result = outcome.GetResult(); | ||
| return Model::CertificateStatusMapper::GetNameForCertificateStatus(result.GetCertificate().GetStatus()) == | ||
| expected.get<Aws::String>(); | ||
| })); | ||
| acceptors.emplace_back(Aws::MakeUnique<Aws::Utils::ErrorAcceptor<OutcomeT>>( | ||
| "CertificateValidatedWaiter", Aws::Utils::WaiterState::FAILURE, Aws::String("ResourceNotFoundException"))); | ||
|
|
||
| auto operation = [this](const RequestT& req) { return static_cast<DerivedClient*>(this)->DescribeCertificate(req); }; | ||
| Aws::Utils::Waiter<RequestT, OutcomeT> waiter(60, 2, std::move(acceptors), operation, "WaitUntilCertificateValidated"); | ||
| return waiter.Wait(request); | ||
| } | ||
| }; | ||
| } // namespace ACM | ||
| } // namespace Aws |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
generated/src/aws-cpp-sdk-aiops/include/aws/aiops/AIOpsWaiter.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| /** | ||
| * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| * SPDX-License-Identifier: Apache-2.0. | ||
| */ | ||
|
|
||
| #pragma once | ||
| #include <aws/aiops/AIOpsClient.h> | ||
| #include <aws/core/utils/Waiter.h> | ||
| #include <aws/core/utils/memory/AWSMemory.h> | ||
|
|
||
| #include <algorithm> | ||
|
|
||
| namespace Aws { | ||
| namespace AIOps { | ||
|
|
||
| template <typename DerivedClient = AIOpsClient> | ||
| class AIOpsWaiter { | ||
| public: | ||
| }; | ||
| } // namespace AIOps | ||
| } // namespace Aws |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.