@@ -43,13 +43,13 @@ public StreamedListObjectsApi(Configuration configuration, ApiClient apiClient)
4343 *
4444 * @param storeId The store ID
4545 * @param body The list objects request
46- * @param consumer Callback to handle each streamed object response (invoked asynchronously)
46+ * @param consumer Callback to handle each StreamedListObjectsResponse (invoked asynchronously)
4747 * @return CompletableFuture<Void> that completes when streaming finishes
4848 * @throws ApiException if the API call fails immediately
4949 * @throws FgaInvalidParameterException if required parameters are missing
5050 */
5151 public CompletableFuture <Void > streamedListObjects (
52- String storeId , ListObjectsRequest body , Consumer <String > consumer )
52+ String storeId , ListObjectsRequest body , Consumer <StreamedListObjectsResponse > consumer )
5353 throws ApiException , FgaInvalidParameterException {
5454 return streamedListObjects (storeId , body , consumer , null , this .configuration );
5555 }
@@ -61,7 +61,7 @@ public CompletableFuture<Void> streamedListObjects(
6161 *
6262 * @param storeId The store ID
6363 * @param body The list objects request
64- * @param consumer Callback to handle each streamed object response (invoked asynchronously)
64+ * @param consumer Callback to handle each StreamedListObjectsResponse (invoked asynchronously)
6565 * @param configurationOverride Configuration overrides (e.g., additional headers)
6666 * @return CompletableFuture<Void> that completes when streaming finishes
6767 * @throws ApiException if the API call fails immediately
@@ -70,7 +70,7 @@ public CompletableFuture<Void> streamedListObjects(
7070 public CompletableFuture <Void > streamedListObjects (
7171 String storeId ,
7272 ListObjectsRequest body ,
73- Consumer <String > consumer ,
73+ Consumer <StreamedListObjectsResponse > consumer ,
7474 ConfigurationOverride configurationOverride )
7575 throws ApiException , FgaInvalidParameterException {
7676 return streamedListObjects (storeId , body , consumer , null , this .configuration .override (configurationOverride ));
@@ -83,14 +83,17 @@ public CompletableFuture<Void> streamedListObjects(
8383 *
8484 * @param storeId The store ID
8585 * @param body The list objects request
86- * @param consumer Callback to handle each streamed object response (invoked asynchronously)
86+ * @param consumer Callback to handle each StreamedListObjectsResponse (invoked asynchronously)
8787 * @param errorConsumer Optional callback to handle errors during streaming
8888 * @return CompletableFuture<Void> that completes when streaming finishes or exceptionally on error
8989 * @throws ApiException if the API call fails immediately
9090 * @throws FgaInvalidParameterException if required parameters are missing
9191 */
9292 public CompletableFuture <Void > streamedListObjects (
93- String storeId , ListObjectsRequest body , Consumer <String > consumer , Consumer <Throwable > errorConsumer )
93+ String storeId ,
94+ ListObjectsRequest body ,
95+ Consumer <StreamedListObjectsResponse > consumer ,
96+ Consumer <Throwable > errorConsumer )
9497 throws ApiException , FgaInvalidParameterException {
9598 return streamedListObjects (storeId , body , consumer , errorConsumer , this .configuration );
9699 }
@@ -102,7 +105,7 @@ public CompletableFuture<Void> streamedListObjects(
102105 *
103106 * @param storeId The store ID
104107 * @param body The list objects request
105- * @param consumer Callback to handle each streamed object response (invoked asynchronously)
108+ * @param consumer Callback to handle each StreamedListObjectsResponse (invoked asynchronously)
106109 * @param errorConsumer Optional callback to handle errors during streaming
107110 * @param configurationOverride Configuration overrides (e.g., additional headers)
108111 * @return CompletableFuture<Void> that completes when streaming finishes or exceptionally on error
@@ -112,7 +115,7 @@ public CompletableFuture<Void> streamedListObjects(
112115 public CompletableFuture <Void > streamedListObjects (
113116 String storeId ,
114117 ListObjectsRequest body ,
115- Consumer <String > consumer ,
118+ Consumer <StreamedListObjectsResponse > consumer ,
116119 Consumer <Throwable > errorConsumer ,
117120 ConfigurationOverride configurationOverride )
118121 throws ApiException , FgaInvalidParameterException {
@@ -126,7 +129,7 @@ public CompletableFuture<Void> streamedListObjects(
126129 private CompletableFuture <Void > streamedListObjects (
127130 String storeId ,
128131 ListObjectsRequest body ,
129- Consumer <String > consumer ,
132+ Consumer <StreamedListObjectsResponse > consumer ,
130133 Consumer <Throwable > errorConsumer ,
131134 Configuration configuration )
132135 throws ApiException , FgaInvalidParameterException {
@@ -198,7 +201,8 @@ private CompletableFuture<Void> streamedListObjects(
198201 /**
199202 * Process a single line from the NDJSON stream
200203 */
201- private void processLine (String line , Consumer <String > consumer , Consumer <Throwable > errorConsumer ) {
204+ private void processLine (
205+ String line , Consumer <StreamedListObjectsResponse > consumer , Consumer <Throwable > errorConsumer ) {
202206 try {
203207 // Parse the JSON line to extract the object
204208 StreamResultOfStreamedListObjectsResponse streamResult =
@@ -214,10 +218,10 @@ private void processLine(String line, Consumer<String> consumer, Consumer<Throwa
214218 errorConsumer .accept (new ApiException (errorMessage ));
215219 }
216220 } else if (streamResult .getResult () != null ) {
217- // Deliver the object to the consumer
221+ // Deliver the response object to the consumer
218222 StreamedListObjectsResponse result = streamResult .getResult ();
219- if (result . getObject () != null ) {
220- consumer .accept (result . getObject () );
223+ if (result != null ) {
224+ consumer .accept (result );
221225 }
222226 }
223227 } catch (Exception e ) {
0 commit comments