-
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
39
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.
Open
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
5d631f1
Updated waiter template to accept a templated PathMatcher per accepto…
sbaluja b246899
Waiter codegen project
sbaluja 19bc266
Waiter codegen tests
sbaluja f700f38
Update crtp client inheritance & python script for smithy codegen
sbaluja 783be61
Add proper state chaining in Waiter.h
sbaluja ba9349d
Add mapping for lost c2j errors to error code
sbaluja 5cbf5ec
Updated clients
sbaluja 9c4b029
Add namespace mapping to WaiterCodeGenPlugin
sbaluja 9370dfe
generate Waiter.h for clients that don't have waiters modeled
sbaluja 40911e0
Seperate different acceptors into seperate structs/classes
sbaluja b177281
Update codegen to use new Acceptor structs
sbaluja f2e44ae
Return Optional<Shape> in private methods of CollectionElementTypeRes…
sbaluja afa51ac
Add userAgent metrics for waiters
sbaluja f00cbb5
Updated waiters
sbaluja 6bf3525
Transition the waiter to the failure state if none of the acceptors a…
sbaluja dbffbb8
change std::vector to Aws::Vector (why do i forget this everytime)
sbaluja 5ae8e83
Updated waiter files
sbaluja 8529c18
Include handling for smithy 1.0 enum modeling (string shape with enum…
sbaluja 9e44c7e
Resolve cpp type from FilterPredicateEmitter for inner types instead …
sbaluja 88107c9
Updated waiters
sbaluja 802694f
Resolve enum for filterOperandEmitter paths
sbaluja b3ce9aa
Fix type resolution for map types
sbaluja 1d479bd
Empty waiter generation for legacy services (no smithy model)
sbaluja 8e774b6
Add medialive XXXSdkResult.h mappings
sbaluja 8e1df58
Enum resolution for ScalarEmitters (OR edge case)
sbaluja 2788e39
dont generate waiters for deprecated operations
sbaluja c754c7f
fix .template dependent compilation error
sbaluja 7f7d767
Refactor client integ tests that use polling logic to use waiters now
sbaluja c31cdc1
Fix windows ambigious lambda constructor issue
sbaluja 5eab42b
Explicitly define bool return type for pathMatcher lambdas
sbaluja 688851d
Updated waiters
sbaluja a686cc0
Fix map collision for waiter name's that are generated and stored
sbaluja 9ef2fb9
Updated waiters
sbaluja 1f0be13
Fix namespace mapping default to be '{}' (dev purposes)
sbaluja 8e5b6a6
Remove && for pathacceptor argument
sbaluja bb4f2d9
cast std::count_if to size_t since it returns a signed value
sbaluja 6ff5b99
Updated waiters
sbaluja cdc547f
ONLY static cast when we are comparing to a collection.size()
sbaluja c5ef048
Updated waiters
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) -> bool { | ||
| 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) -> bool { | ||
| 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) -> bool { | ||
| 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) -> bool { | ||
| 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) -> bool { | ||
| 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.