-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client): implement listRelations
- Loading branch information
1 parent
eda3a36
commit 4b404f2
Showing
4 changed files
with
45 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/main/java/dev/openfga/sdk/api/client/ClientListRelationsResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package dev.openfga.sdk.api.client; | ||
|
||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
public class ClientListRelationsResponse { | ||
private final List<String> relations; | ||
|
||
public ClientListRelationsResponse(List<String> relations) { | ||
this.relations = relations; | ||
} | ||
|
||
public List<String> getRelations() { | ||
return relations; | ||
} | ||
|
||
public static ClientListRelationsResponse fromBatchCheckResponses(List<ClientBatchCheckResponse> responses) { | ||
return new ClientListRelationsResponse(responses.stream() | ||
.filter(ClientBatchCheckResponse::getAllowed) | ||
.map(batchCheckResponse -> batchCheckResponse.getRequest().getRelation()) | ||
.collect(Collectors.toList())); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
src/main/java/dev/openfga/sdk/errors/FgaInvalidParameterException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters