Skip to content

Commit 4e49da2

Browse files
committed
feat: fmt and whitespace
1 parent 5f5f64b commit 4e49da2

2 files changed

Lines changed: 43 additions & 43 deletions

File tree

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

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

@@ -296,12 +296,12 @@ public CompletableFuture<ClientReadChangesResponse> readChanges(
296296
var options = readChangesOptions != null ? readChangesOptions : new ClientReadChangesOptions();
297297
var overrides = new ConfigurationOverride().addHeaders(options);
298298
return call(() -> api.readChanges(
299-
storeId,
300-
request.getType(),
301-
options.getPageSize(),
302-
options.getContinuationToken(),
303-
request.getStartTime(),
304-
overrides))
299+
storeId,
300+
request.getType(),
301+
options.getPageSize(),
302+
options.getContinuationToken(),
303+
request.getStartTime(),
304+
overrides))
305305
.thenApply(ClientReadChangesResponse::new);
306306
}
307307

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

499499
List<ClientWriteSingleResponse> deleteResponses = deleteTuples != null
500500
? deleteTuples.stream()
501-
.map(tuple -> new ClientWriteSingleResponse(
502-
new TupleKey()
503-
.user(tuple.getUser())
504-
.relation(tuple.getRelation())
505-
._object(tuple.getObject()),
506-
ClientWriteStatus.SUCCESS))
507-
.collect(Collectors.toList())
501+
.map(tuple -> new ClientWriteSingleResponse(
502+
new TupleKey()
503+
.user(tuple.getUser())
504+
.relation(tuple.getRelation())
505+
._object(tuple.getObject()),
506+
ClientWriteStatus.SUCCESS))
507+
.collect(Collectors.toList())
508508
: new ArrayList<>();
509509

510510
return new ClientWriteResponse(apiResponse, writeResponses, deleteResponses);
@@ -639,18 +639,18 @@ private CompletableFuture<ClientWriteResponse> writeNonTransaction(
639639
CompletableFuture<List<ClientWriteSingleResponse>> allWritesFuture = writeFutures.isEmpty()
640640
? CompletableFuture.completedFuture(new ArrayList<>())
641641
: CompletableFuture.allOf(writeFutures.toArray(new CompletableFuture[0]))
642-
.thenApply(v -> writeFutures.stream()
643-
.map(CompletableFuture::join)
644-
.flatMap(List::stream)
645-
.collect(Collectors.toList()));
642+
.thenApply(v -> writeFutures.stream()
643+
.map(CompletableFuture::join)
644+
.flatMap(List::stream)
645+
.collect(Collectors.toList()));
646646

647647
CompletableFuture<List<ClientWriteSingleResponse>> allDeletesFuture = deleteFutures.isEmpty()
648648
? CompletableFuture.completedFuture(new ArrayList<>())
649649
: CompletableFuture.allOf(deleteFutures.toArray(new CompletableFuture[0]))
650-
.thenApply(v -> deleteFutures.stream()
651-
.map(CompletableFuture::join)
652-
.flatMap(List::stream)
653-
.collect(Collectors.toList()));
650+
.thenApply(v -> deleteFutures.stream()
651+
.map(CompletableFuture::join)
652+
.flatMap(List::stream)
653+
.collect(Collectors.toList()));
654654

655655
return CompletableFuture.allOf(allWritesFuture, allDeletesFuture)
656656
.thenApply(v -> new ClientWriteResponse(allWritesFuture.join(), allDeletesFuture.join()));
@@ -828,7 +828,7 @@ public CompletableFuture<List<ClientBatchCheckClientResponse>> clientBatchCheck(
828828
var options = batchCheckOptions != null
829829
? batchCheckOptions
830830
: new ClientBatchCheckClientOptions()
831-
.maxParallelRequests(FgaConstants.CLIENT_MAX_METHOD_PARALLEL_REQUESTS);
831+
.maxParallelRequests(FgaConstants.CLIENT_MAX_METHOD_PARALLEL_REQUESTS);
832832

833833
HashMap<String, String> headers = options.getAdditionalHeaders() != null
834834
? new HashMap<>(options.getAdditionalHeaders())
@@ -889,8 +889,8 @@ public CompletableFuture<ClientBatchCheckResponse> batchCheck(
889889
var options = batchCheckOptions != null
890890
? batchCheckOptions
891891
: new ClientBatchCheckOptions()
892-
.maxParallelRequests(FgaConstants.CLIENT_MAX_METHOD_PARALLEL_REQUESTS)
893-
.maxBatchSize(FgaConstants.CLIENT_MAX_BATCH_SIZE);
892+
.maxParallelRequests(FgaConstants.CLIENT_MAX_METHOD_PARALLEL_REQUESTS)
893+
.maxBatchSize(FgaConstants.CLIENT_MAX_BATCH_SIZE);
894894

895895
HashMap<String, String> headers = options.getAdditionalHeaders() != null
896896
? new HashMap<>(options.getAdditionalHeaders())
@@ -951,22 +951,22 @@ public CompletableFuture<ClientBatchCheckResponse> batchCheck(
951951
var override = new ConfigurationOverride().addHeaders(options);
952952

953953
Consumer<List<BatchCheckItem>> singleBatchCheckRequest = request -> call(() -> {
954-
BatchCheckRequest body = new BatchCheckRequest().checks(request);
955-
if (options.getConsistency() != null) {
956-
body.consistency(options.getConsistency());
957-
}
954+
BatchCheckRequest body = new BatchCheckRequest().checks(request);
955+
if (options.getConsistency() != null) {
956+
body.consistency(options.getConsistency());
957+
}
958958

959-
// Set authorizationModelId from options if available; otherwise, use the default from configuration
960-
String authorizationModelId = !isNullOrWhitespace(options.getAuthorizationModelId())
961-
? options.getAuthorizationModelId()
962-
: configuration.getAuthorizationModelId();
959+
// Set authorizationModelId from options if available; otherwise, use the default from configuration
960+
String authorizationModelId = !isNullOrWhitespace(options.getAuthorizationModelId())
961+
? options.getAuthorizationModelId()
962+
: configuration.getAuthorizationModelId();
963963

964-
if (!isNullOrWhitespace(authorizationModelId)) {
965-
body.authorizationModelId(authorizationModelId);
966-
}
964+
if (!isNullOrWhitespace(authorizationModelId)) {
965+
body.authorizationModelId(authorizationModelId);
966+
}
967967

968-
return api.batchCheck(configuration.getStoreId(), body, override);
969-
})
968+
return api.batchCheck(configuration.getStoreId(), body, override);
969+
})
970970
.whenComplete((batchCheckResponseApiResponse, throwable) -> {
971971
try {
972972
if (throwable != null) {
@@ -1126,7 +1126,7 @@ public CompletableFuture<ClientListRelationsResponse> listRelations(
11261126
var options = listRelationsOptions != null
11271127
? listRelationsOptions
11281128
: new ClientListRelationsOptions()
1129-
.maxParallelRequests(FgaConstants.CLIENT_MAX_METHOD_PARALLEL_REQUESTS);
1129+
.maxParallelRequests(FgaConstants.CLIENT_MAX_METHOD_PARALLEL_REQUESTS);
11301130

11311131
HashMap<String, String> headers = options.getAdditionalHeaders() != null
11321132
? new HashMap<>(options.getAdditionalHeaders())
@@ -1311,4 +1311,4 @@ private <T> CompletableFuture<T> call(CheckedInvocation<T> action) {
13111311
return CompletableFuture.failedFuture(throwable);
13121312
}
13131313
}
1314-
}
1314+
}

src/test/java/dev/openfga/sdk/api/client/OpenFgaClientWriteResponseHeadersTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,4 +321,4 @@ void writeTransactionMode_shouldMaintainBackwardCompatibility() throws Exception
321321
assertNotNull(response.getHeaders());
322322
assertFalse(response.getHeaders().isEmpty());
323323
}
324-
}
324+
}

0 commit comments

Comments
 (0)