aws / aws/aws-sdk-java-v2

CloudFrontAsyncClient client should provide listDistributionsPaginator method

Open
#6,636 1 comment 0 reactions 0 assignees View on GitHub
bug service-api
Dominant language
Java
Stars
2.6k
Forks
1k
Avg merge
2d 9h
Merged PRs (30d)
51

Description

### Describe the bug

According to the documentation and the definition here https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/cloudfront/paginators/ListDistributionsIterable.html and the paginator information defined here https://github.com/aws/aws-sdk-java-v2/blob/master/services/directconnect/src/main/resources/codegen-resources/paginators-1.json#L3, the `CloudFrontAsyncClient` class should provide a method named `listDistributionsPaginator`.
However it doesn't exist, at least in version 2.4.11.

### Regression Issue

- [ ] Select this option if this issue appears to be a regression.

### Expected Behavior

The class `CloudFrontAsyncClient` should provide a method named `listDistributionsPaginator`.

### Current Behavior

The method doesn't exist. There is an alternative approach by using the following code:
```java
package com.example;

import software.amazon.awssdk.services.cloudfront.CloudFrontClient;
import software.amazon.awssdk.services.cloudfront.model.ListDistributionsRequest;
import software.amazon.awssdk.services.cloudfront.paginators.ListDistributionsIterable;

public class ListDistributions {
public static void main(String[] args) {
try (CloudFrontClient client = CloudFrontClient.create()) {
ListDistributionsRequest request = ListDistributionsRequest.builder().build();
ListDistributionsIterable iterable = new ListDistributionsIterable(client, request);

iterable.items().stream()
.forEach(dist -> System.out.println("ID: " + dist.id() +
", Domain: " + dist.domainName() +
", Status: " + dist.status()));
}
}
}
```

However, our solution is based on the use of paginators, and this solution requires a huge rework.

### Reproduction Steps

Here is the code that we would need to work:
```java
software.amazon.awssdk.services.cloudfront.paginators.ListDistributionsIterable responses = client.listDistributionsPaginator(request);
responses.iterator().forEachRemaining(....);
```

### Possible Solution

_No response_

### Additional Information/Context

I already opened a case at AWS support, for reference [CASE 176579724400345].
I'm opening this issue for tracking.

### AWS Java SDK version used

2.40.11

### JDK version used

openjdk version "21" 2023-09-19 LTS OpenJDK Runtime Environment Temurin-21+35 (build 21+35-LTS) OpenJDK 64-Bit Server VM Temurin-21+35 (build 21+35-LTS, mixed mode, sharing)

### Operating System and version

Ubuntu 24.04.3 LTS

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.