From 292ce40b4408a53f9d583c80e64d0f2749d71cfb Mon Sep 17 00:00:00 2001 From: awstools Date: Mon, 9 Sep 2024 18:17:41 +0000 Subject: [PATCH] feat(client-elastic-load-balancing-v2): Add paginators for the ELBv2 DescribeListenerCertificates and DescribeRules APIs. Fix broken waiter for the ELBv2 DescribeLoadBalancers API. --- .../DescribeListenerCertificatesPaginator.ts | 24 +++++++++++++++++++ .../src/pagination/DescribeRulesPaginator.ts | 24 +++++++++++++++++++ .../src/pagination/index.ts | 4 ++++ .../waiters/waitForLoadBalancerAvailable.ts | 2 +- .../src/waiters/waitForLoadBalancerExists.ts | 2 +- .../waiters/waitForLoadBalancersDeleted.ts | 2 +- .../aws-models/elastic-load-balancing-v2.json | 21 +++++++++++----- 7 files changed, 70 insertions(+), 9 deletions(-) create mode 100644 clients/client-elastic-load-balancing-v2/src/pagination/DescribeListenerCertificatesPaginator.ts create mode 100644 clients/client-elastic-load-balancing-v2/src/pagination/DescribeRulesPaginator.ts diff --git a/clients/client-elastic-load-balancing-v2/src/pagination/DescribeListenerCertificatesPaginator.ts b/clients/client-elastic-load-balancing-v2/src/pagination/DescribeListenerCertificatesPaginator.ts new file mode 100644 index 000000000000..665b1c98e91d --- /dev/null +++ b/clients/client-elastic-load-balancing-v2/src/pagination/DescribeListenerCertificatesPaginator.ts @@ -0,0 +1,24 @@ +// smithy-typescript generated code +import { createPaginator } from "@smithy/core"; +import { Paginator } from "@smithy/types"; + +import { + DescribeListenerCertificatesCommand, + DescribeListenerCertificatesCommandInput, + DescribeListenerCertificatesCommandOutput, +} from "../commands/DescribeListenerCertificatesCommand"; +import { ElasticLoadBalancingV2Client } from "../ElasticLoadBalancingV2Client"; +import { ElasticLoadBalancingV2PaginationConfiguration } from "./Interfaces"; + +/** + * @public + */ +export const paginateDescribeListenerCertificates: ( + config: ElasticLoadBalancingV2PaginationConfiguration, + input: DescribeListenerCertificatesCommandInput, + ...rest: any[] +) => Paginator = createPaginator< + ElasticLoadBalancingV2PaginationConfiguration, + DescribeListenerCertificatesCommandInput, + DescribeListenerCertificatesCommandOutput +>(ElasticLoadBalancingV2Client, DescribeListenerCertificatesCommand, "Marker", "NextMarker", ""); diff --git a/clients/client-elastic-load-balancing-v2/src/pagination/DescribeRulesPaginator.ts b/clients/client-elastic-load-balancing-v2/src/pagination/DescribeRulesPaginator.ts new file mode 100644 index 000000000000..cc1840ade302 --- /dev/null +++ b/clients/client-elastic-load-balancing-v2/src/pagination/DescribeRulesPaginator.ts @@ -0,0 +1,24 @@ +// smithy-typescript generated code +import { createPaginator } from "@smithy/core"; +import { Paginator } from "@smithy/types"; + +import { + DescribeRulesCommand, + DescribeRulesCommandInput, + DescribeRulesCommandOutput, +} from "../commands/DescribeRulesCommand"; +import { ElasticLoadBalancingV2Client } from "../ElasticLoadBalancingV2Client"; +import { ElasticLoadBalancingV2PaginationConfiguration } from "./Interfaces"; + +/** + * @public + */ +export const paginateDescribeRules: ( + config: ElasticLoadBalancingV2PaginationConfiguration, + input: DescribeRulesCommandInput, + ...rest: any[] +) => Paginator = createPaginator< + ElasticLoadBalancingV2PaginationConfiguration, + DescribeRulesCommandInput, + DescribeRulesCommandOutput +>(ElasticLoadBalancingV2Client, DescribeRulesCommand, "Marker", "NextMarker", ""); diff --git a/clients/client-elastic-load-balancing-v2/src/pagination/index.ts b/clients/client-elastic-load-balancing-v2/src/pagination/index.ts index c949e5117424..e30d6982814f 100644 --- a/clients/client-elastic-load-balancing-v2/src/pagination/index.ts +++ b/clients/client-elastic-load-balancing-v2/src/pagination/index.ts @@ -1,7 +1,11 @@ +export * from "./DescribeListenerCertificatesPaginator"; + export * from "./DescribeListenersPaginator"; export * from "./DescribeLoadBalancersPaginator"; +export * from "./DescribeRulesPaginator"; + export * from "./DescribeTargetGroupsPaginator"; export * from "./DescribeTrustStoreAssociationsPaginator"; diff --git a/clients/client-elastic-load-balancing-v2/src/waiters/waitForLoadBalancerAvailable.ts b/clients/client-elastic-load-balancing-v2/src/waiters/waitForLoadBalancerAvailable.ts index 78e74c15de5a..5c1658dcaa9f 100644 --- a/clients/client-elastic-load-balancing-v2/src/waiters/waitForLoadBalancerAvailable.ts +++ b/clients/client-elastic-load-balancing-v2/src/waiters/waitForLoadBalancerAvailable.ts @@ -47,7 +47,7 @@ const checkState = async ( } catch (e) {} } catch (exception) { reason = exception; - if (exception.name && exception.name == "LoadBalancerNotFound") { + if (exception.name && exception.name == "LoadBalancerNotFoundException") { return { state: WaiterState.RETRY, reason }; } } diff --git a/clients/client-elastic-load-balancing-v2/src/waiters/waitForLoadBalancerExists.ts b/clients/client-elastic-load-balancing-v2/src/waiters/waitForLoadBalancerExists.ts index 0a6bd555efa4..23d1a4f6e8de 100644 --- a/clients/client-elastic-load-balancing-v2/src/waiters/waitForLoadBalancerExists.ts +++ b/clients/client-elastic-load-balancing-v2/src/waiters/waitForLoadBalancerExists.ts @@ -18,7 +18,7 @@ const checkState = async ( return { state: WaiterState.SUCCESS, reason }; } catch (exception) { reason = exception; - if (exception.name && exception.name == "LoadBalancerNotFound") { + if (exception.name && exception.name == "LoadBalancerNotFoundException") { return { state: WaiterState.RETRY, reason }; } } diff --git a/clients/client-elastic-load-balancing-v2/src/waiters/waitForLoadBalancersDeleted.ts b/clients/client-elastic-load-balancing-v2/src/waiters/waitForLoadBalancersDeleted.ts index 1266d742f87f..130a08eab9ab 100644 --- a/clients/client-elastic-load-balancing-v2/src/waiters/waitForLoadBalancersDeleted.ts +++ b/clients/client-elastic-load-balancing-v2/src/waiters/waitForLoadBalancersDeleted.ts @@ -33,7 +33,7 @@ const checkState = async ( } catch (e) {} } catch (exception) { reason = exception; - if (exception.name && exception.name == "LoadBalancerNotFound") { + if (exception.name && exception.name == "LoadBalancerNotFoundException") { return { state: WaiterState.SUCCESS, reason }; } } diff --git a/codegen/sdk-codegen/aws-models/elastic-load-balancing-v2.json b/codegen/sdk-codegen/aws-models/elastic-load-balancing-v2.json index 324ded3eeaf3..40f977a53b2c 100644 --- a/codegen/sdk-codegen/aws-models/elastic-load-balancing-v2.json +++ b/codegen/sdk-codegen/aws-models/elastic-load-balancing-v2.json @@ -2281,7 +2281,12 @@ } ], "traits": { - "smithy.api#documentation": "

Describes the default certificate and the certificate list for the specified HTTPS or TLS\n listener.

\n

If the default certificate is also in the certificate list, it appears twice in the\n results (once with IsDefault set to true and once with IsDefault set\n to false).

\n

For more information, see SSL certificates in the Application Load Balancers Guide or\n Server certificates in the Network Load Balancers\n Guide.

" + "smithy.api#documentation": "

Describes the default certificate and the certificate list for the specified HTTPS or TLS\n listener.

\n

If the default certificate is also in the certificate list, it appears twice in the\n results (once with IsDefault set to true and once with IsDefault set\n to false).

\n

For more information, see SSL certificates in the Application Load Balancers Guide or\n Server certificates in the Network Load Balancers\n Guide.

", + "smithy.api#paginated": { + "inputToken": "Marker", + "outputToken": "NextMarker", + "items": "Certificates" + } } }, "com.amazonaws.elasticloadbalancingv2#DescribeListenerCertificatesInput": { @@ -2578,7 +2583,6 @@ "outputToken": "NextMarker", "items": "LoadBalancers" }, - "smithy.api#suppress": ["WaitableTraitInvalidErrorType"], "smithy.waiters#waitable": { "LoadBalancerAvailable": { "acceptors": [ @@ -2605,7 +2609,7 @@ { "state": "retry", "matcher": { - "errorType": "LoadBalancerNotFound" + "errorType": "LoadBalancerNotFoundException" } } ], @@ -2622,7 +2626,7 @@ { "state": "retry", "matcher": { - "errorType": "LoadBalancerNotFound" + "errorType": "LoadBalancerNotFoundException" } } ], @@ -2643,7 +2647,7 @@ { "state": "success", "matcher": { - "errorType": "LoadBalancerNotFound" + "errorType": "LoadBalancerNotFoundException" } } ], @@ -2756,7 +2760,12 @@ ] } } - ] + ], + "smithy.api#paginated": { + "inputToken": "Marker", + "outputToken": "NextMarker", + "items": "Rules" + } } }, "com.amazonaws.elasticloadbalancingv2#DescribeRulesInput": {