Skip to content

Commit fde2193

Browse files
committed
fmt: apply spotless
1 parent 86fcbc7 commit fde2193

6 files changed

Lines changed: 52 additions & 52 deletions

File tree

src/main/java/dev/openfga/sdk/api/StreamedListObjectsApi.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,15 @@ public CompletableFuture<ApiResponse<StreamingResponseBody>> streamedListObjects
6161
telemetryAttributes.put(Attributes.FGA_CLIENT_REQUEST_METHOD, "StreamedListObjects");
6262

6363
return new HttpRequestAttempt<>(
64-
httpRequest,
65-
"streamedListObjects",
66-
StreamingResponseBody.class,
67-
apiClient,
68-
requestConfiguration)
64+
httpRequest,
65+
"streamedListObjects",
66+
StreamingResponseBody.class,
67+
apiClient,
68+
requestConfiguration)
6969
.addTelemetryAttributes(telemetryAttributes)
7070
.attemptHttpRequest();
7171
} catch (Exception e) {
7272
return CompletableFuture.failedFuture(new ApiException(e));
7373
}
7474
}
75-
}
75+
}

src/main/java/dev/openfga/sdk/api/client/HttpRequestAttempt.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,4 +371,4 @@ public void onComplete() {
371371
out.flush();
372372
}
373373
}
374-
}
374+
}

src/main/java/dev/openfga/sdk/api/client/OpenFgaClient.java

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public CompletableFuture<ClientListStoresResponse> listStores(ClientListStoresOp
8282
configuration.assertValid();
8383
var overrides = new ConfigurationOverride().addHeaders(options);
8484
return call(() -> api.listStores(
85-
options.getPageSize(), options.getContinuationToken(), options.getName(), overrides))
85+
options.getPageSize(), options.getContinuationToken(), options.getName(), overrides))
8686
.thenApply(ClientListStoresResponse::new);
8787
}
8888

@@ -299,12 +299,12 @@ public CompletableFuture<ClientReadChangesResponse> readChanges(
299299
var options = readChangesOptions != null ? readChangesOptions : new ClientReadChangesOptions();
300300
var overrides = new ConfigurationOverride().addHeaders(options);
301301
return call(() -> api.readChanges(
302-
storeId,
303-
request.getType(),
304-
options.getPageSize(),
305-
options.getContinuationToken(),
306-
request.getStartTime(),
307-
overrides))
302+
storeId,
303+
request.getType(),
304+
options.getPageSize(),
305+
options.getContinuationToken(),
306+
request.getStartTime(),
307+
overrides))
308308
.thenApply(ClientReadChangesResponse::new);
309309
}
310310

@@ -495,19 +495,19 @@ private CompletableFuture<ClientWriteResponse> writeTransactions(
495495
// For transaction-based writes, all tuples are successful if the call succeeds
496496
List<ClientWriteSingleResponse> writeResponses = writeTuples != null
497497
? writeTuples.stream()
498-
.map(tuple -> new ClientWriteSingleResponse(tuple.asTupleKey(), ClientWriteStatus.SUCCESS))
499-
.collect(Collectors.toList())
498+
.map(tuple -> new ClientWriteSingleResponse(tuple.asTupleKey(), ClientWriteStatus.SUCCESS))
499+
.collect(Collectors.toList())
500500
: new ArrayList<>();
501501

502502
List<ClientWriteSingleResponse> deleteResponses = deleteTuples != null
503503
? deleteTuples.stream()
504-
.map(tuple -> new ClientWriteSingleResponse(
505-
new TupleKey()
506-
.user(tuple.getUser())
507-
.relation(tuple.getRelation())
508-
._object(tuple.getObject()),
509-
ClientWriteStatus.SUCCESS))
510-
.collect(Collectors.toList())
504+
.map(tuple -> new ClientWriteSingleResponse(
505+
new TupleKey()
506+
.user(tuple.getUser())
507+
.relation(tuple.getRelation())
508+
._object(tuple.getObject()),
509+
ClientWriteStatus.SUCCESS))
510+
.collect(Collectors.toList())
511511
: new ArrayList<>();
512512

513513
return new ClientWriteResponse(writeResponses, deleteResponses);
@@ -642,18 +642,18 @@ private CompletableFuture<ClientWriteResponse> writeNonTransaction(
642642
CompletableFuture<List<ClientWriteSingleResponse>> allWritesFuture = writeFutures.isEmpty()
643643
? CompletableFuture.completedFuture(new ArrayList<>())
644644
: CompletableFuture.allOf(writeFutures.toArray(new CompletableFuture[0]))
645-
.thenApply(v -> writeFutures.stream()
646-
.map(CompletableFuture::join)
647-
.flatMap(List::stream)
648-
.collect(Collectors.toList()));
645+
.thenApply(v -> writeFutures.stream()
646+
.map(CompletableFuture::join)
647+
.flatMap(List::stream)
648+
.collect(Collectors.toList()));
649649

650650
CompletableFuture<List<ClientWriteSingleResponse>> allDeletesFuture = deleteFutures.isEmpty()
651651
? CompletableFuture.completedFuture(new ArrayList<>())
652652
: CompletableFuture.allOf(deleteFutures.toArray(new CompletableFuture[0]))
653-
.thenApply(v -> deleteFutures.stream()
654-
.map(CompletableFuture::join)
655-
.flatMap(List::stream)
656-
.collect(Collectors.toList()));
653+
.thenApply(v -> deleteFutures.stream()
654+
.map(CompletableFuture::join)
655+
.flatMap(List::stream)
656+
.collect(Collectors.toList()));
657657

658658
return CompletableFuture.allOf(allWritesFuture, allDeletesFuture)
659659
.thenApply(v -> new ClientWriteResponse(allWritesFuture.join(), allDeletesFuture.join()));
@@ -831,7 +831,7 @@ public CompletableFuture<List<ClientBatchCheckClientResponse>> clientBatchCheck(
831831
var options = batchCheckOptions != null
832832
? batchCheckOptions
833833
: new ClientBatchCheckClientOptions()
834-
.maxParallelRequests(FgaConstants.CLIENT_MAX_METHOD_PARALLEL_REQUESTS);
834+
.maxParallelRequests(FgaConstants.CLIENT_MAX_METHOD_PARALLEL_REQUESTS);
835835

836836
HashMap<String, String> headers = options.getAdditionalHeaders() != null
837837
? new HashMap<>(options.getAdditionalHeaders())
@@ -892,8 +892,8 @@ public CompletableFuture<ClientBatchCheckResponse> batchCheck(
892892
var options = batchCheckOptions != null
893893
? batchCheckOptions
894894
: new ClientBatchCheckOptions()
895-
.maxParallelRequests(FgaConstants.CLIENT_MAX_METHOD_PARALLEL_REQUESTS)
896-
.maxBatchSize(FgaConstants.CLIENT_MAX_BATCH_SIZE);
895+
.maxParallelRequests(FgaConstants.CLIENT_MAX_METHOD_PARALLEL_REQUESTS)
896+
.maxBatchSize(FgaConstants.CLIENT_MAX_BATCH_SIZE);
897897

898898
HashMap<String, String> headers = options.getAdditionalHeaders() != null
899899
? new HashMap<>(options.getAdditionalHeaders())
@@ -954,22 +954,22 @@ public CompletableFuture<ClientBatchCheckResponse> batchCheck(
954954
var override = new ConfigurationOverride().addHeaders(options);
955955

956956
Consumer<List<BatchCheckItem>> singleBatchCheckRequest = request -> call(() -> {
957-
BatchCheckRequest body = new BatchCheckRequest().checks(request);
958-
if (options.getConsistency() != null) {
959-
body.consistency(options.getConsistency());
960-
}
957+
BatchCheckRequest body = new BatchCheckRequest().checks(request);
958+
if (options.getConsistency() != null) {
959+
body.consistency(options.getConsistency());
960+
}
961961

962-
// Set authorizationModelId from options if available; otherwise, use the default from configuration
963-
String authorizationModelId = !isNullOrWhitespace(options.getAuthorizationModelId())
964-
? options.getAuthorizationModelId()
965-
: configuration.getAuthorizationModelId();
962+
// Set authorizationModelId from options if available; otherwise, use the default from configuration
963+
String authorizationModelId = !isNullOrWhitespace(options.getAuthorizationModelId())
964+
? options.getAuthorizationModelId()
965+
: configuration.getAuthorizationModelId();
966966

967-
if (!isNullOrWhitespace(authorizationModelId)) {
968-
body.authorizationModelId(authorizationModelId);
969-
}
967+
if (!isNullOrWhitespace(authorizationModelId)) {
968+
body.authorizationModelId(authorizationModelId);
969+
}
970970

971-
return api.batchCheck(configuration.getStoreId(), body, override);
972-
})
971+
return api.batchCheck(configuration.getStoreId(), body, override);
972+
})
973973
.whenComplete((batchCheckResponseApiResponse, throwable) -> {
974974
try {
975975
if (throwable != null) {
@@ -1205,7 +1205,7 @@ public CompletableFuture<ClientListRelationsResponse> listRelations(
12051205
var options = listRelationsOptions != null
12061206
? listRelationsOptions
12071207
: new ClientListRelationsOptions()
1208-
.maxParallelRequests(FgaConstants.CLIENT_MAX_METHOD_PARALLEL_REQUESTS);
1208+
.maxParallelRequests(FgaConstants.CLIENT_MAX_METHOD_PARALLEL_REQUESTS);
12091209

12101210
HashMap<String, String> headers = options.getAdditionalHeaders() != null
12111211
? new HashMap<>(options.getAdditionalHeaders())
@@ -1390,4 +1390,4 @@ private <T> CompletableFuture<T> call(CheckedInvocation<T> action) {
13901390
return CompletableFuture.failedFuture(throwable);
13911391
}
13921392
}
1393-
}
1393+
}

src/main/java/dev/openfga/sdk/api/client/StreamedResponseIterator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,4 @@ public StreamedListObjectsResponse next() {
9292

9393
return current;
9494
}
95-
}
95+
}

src/main/java/dev/openfga/sdk/api/client/StreamingException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ private static String formatErrorMessage(Status error) {
2828
String messageStr = error.getMessage() != null ? error.getMessage() : "Unknown error";
2929
return String.format("Error in streaming response: code=%s, message=%s", codeStr, messageStr);
3030
}
31-
}
31+
}

src/main/java/dev/openfga/sdk/api/client/StreamingResponseBody.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ public void close() throws IOException {
2121
body.close();
2222
}
2323
}
24-
}
24+
}

0 commit comments

Comments
 (0)