diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 72db90d..57f091d 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -115,7 +115,7 @@ src/main/java/dev/openfga/sdk/api/client/ClientReadRequest.java src/main/java/dev/openfga/sdk/api/client/ClientReadResponse.java src/main/java/dev/openfga/sdk/api/client/ClientRelationshipCondition.java src/main/java/dev/openfga/sdk/api/client/ClientTupleKey.java -src/main/java/dev/openfga/sdk/api/client/ClientTupleKeyWithCondition.java +src/main/java/dev/openfga/sdk/api/client/ClientTupleKeyWithoutCondition.java src/main/java/dev/openfga/sdk/api/client/ClientWriteAssertionsResponse.java src/main/java/dev/openfga/sdk/api/client/ClientWriteAuthorizationModelResponse.java src/main/java/dev/openfga/sdk/api/client/ClientWriteRequest.java diff --git a/README.md b/README.md index 8dd1010..de21721 100644 --- a/README.md +++ b/README.md @@ -483,7 +483,7 @@ var request = new ClientWriteRequest() ._object("document:budget") )) .deletes(List.of( - new ClientTupleKey() + new ClientTupleKeyWithoutCondition() .user("user:81684243-9356-4421-8fbf-a4f8d36aa31b") .relation("writer") ._object("document:roadmap") diff --git a/src/main/java/dev/openfga/sdk/api/client/ClientCheckRequest.java b/src/main/java/dev/openfga/sdk/api/client/ClientCheckRequest.java index 9ac6fda..6cd4a88 100644 --- a/src/main/java/dev/openfga/sdk/api/client/ClientCheckRequest.java +++ b/src/main/java/dev/openfga/sdk/api/client/ClientCheckRequest.java @@ -19,7 +19,7 @@ public class ClientCheckRequest { private String user; private String relation; private String _object; - private List contextualTuples; + private List contextualTuples; public CheckRequestTupleKey asCheckRequestTupleKey() { return new CheckRequestTupleKey().user(user).relation(relation)._object(_object); @@ -64,12 +64,12 @@ public String getUser() { return user; } - public ClientCheckRequest contextualTuples(List contextualTuples) { + public ClientCheckRequest contextualTuples(List contextualTuples) { this.contextualTuples = contextualTuples; return this; } - public List getContextualTuples() { + public List getContextualTuples() { return contextualTuples; } } diff --git a/src/main/java/dev/openfga/sdk/api/client/ClientListObjectsRequest.java b/src/main/java/dev/openfga/sdk/api/client/ClientListObjectsRequest.java index 9a03bda..9f25b34 100644 --- a/src/main/java/dev/openfga/sdk/api/client/ClientListObjectsRequest.java +++ b/src/main/java/dev/openfga/sdk/api/client/ClientListObjectsRequest.java @@ -18,7 +18,7 @@ public class ClientListObjectsRequest { private String user; private String relation; private String type; - private List contextualTupleKeys; + private List contextualTupleKeys; public ClientListObjectsRequest user(String user) { this.user = user; @@ -55,12 +55,12 @@ public String getType() { return type; } - public ClientListObjectsRequest contextualTupleKeys(List contextualTupleKeys) { + public ClientListObjectsRequest contextualTupleKeys(List contextualTupleKeys) { this.contextualTupleKeys = contextualTupleKeys; return this; } - public List getContextualTupleKeys() { + public List getContextualTupleKeys() { return contextualTupleKeys; } } diff --git a/src/main/java/dev/openfga/sdk/api/client/ClientTupleKey.java b/src/main/java/dev/openfga/sdk/api/client/ClientTupleKey.java index 319c555..e1b4539 100644 --- a/src/main/java/dev/openfga/sdk/api/client/ClientTupleKey.java +++ b/src/main/java/dev/openfga/sdk/api/client/ClientTupleKey.java @@ -12,77 +12,61 @@ package dev.openfga.sdk.api.client; -import dev.openfga.sdk.api.model.TupleKeyWithoutCondition; -import dev.openfga.sdk.api.model.WriteRequestDeletes; +import dev.openfga.sdk.api.model.ContextualTupleKeys; +import dev.openfga.sdk.api.model.TupleKey; +import dev.openfga.sdk.api.model.WriteRequestWrites; import java.util.Collection; import java.util.stream.Collectors; -public class ClientTupleKey { - private String user; - private String relation; - private String _object; +public class ClientTupleKey extends ClientTupleKeyWithoutCondition { + private ClientRelationshipCondition condition; - public TupleKeyWithoutCondition asTupleKeyWithoutCondition() { - return new TupleKeyWithoutCondition().user(user).relation(relation)._object(_object); + public ClientTupleKey condition(ClientRelationshipCondition condition) { + this.condition = condition; + return this; } - public static WriteRequestDeletes asWriteRequestDeletes(Collection tupleKeys) { - return new WriteRequestDeletes() - .tupleKeys(tupleKeys.stream() - .map(ClientTupleKey::asTupleKeyWithoutCondition) - .collect(Collectors.toList())); + public ClientRelationshipCondition getCondition() { + return condition; } - public ClientTupleKey _object(String _object) { - this._object = _object; - return this; - } + public TupleKey asTupleKey() { + var tupleKey = new TupleKey().user(getUser()).relation(getRelation())._object(getObject()); + + if (condition != null) { + tupleKey.condition(condition.asRelationshipCondition()); + } - /** - * Get _object - * @return _object - **/ - public String getObject() { - return _object; + return tupleKey; } - public ClientTupleKey relation(String relation) { - this.relation = relation; - return this; + public static ContextualTupleKeys asContextualTupleKeys(Collection tupleKeys) { + return new ContextualTupleKeys() + .tupleKeys(tupleKeys.stream().map(ClientTupleKey::asTupleKey).collect(Collectors.toList())); } - /** - * Get relation - * @return relation - **/ - public String getRelation() { - return relation; + public static WriteRequestWrites asWriteRequestWrites(Collection tupleKeys) { + return new WriteRequestWrites() + .tupleKeys(tupleKeys.stream().map(ClientTupleKey::asTupleKey).collect(Collectors.toList())); } + /* Overrides for correct typing */ + + @Override public ClientTupleKey user(String user) { - this.user = user; + super.user(user); return this; } - /** - * Get user - * @return user - **/ - public String getUser() { - return user; + @Override + public ClientTupleKey relation(String relation) { + super.relation(relation); + return this; } - /** - * Adds a condition to the tuple key. - * @param condition a {@link ClientRelationshipCondition} - * @return a new {@link ClientTupleKeyWithCondition} with this {@link ClientTupleKey}'s - * user, relation, and object, and the passed condition. - */ - public ClientTupleKeyWithCondition condition(ClientRelationshipCondition condition) { - return new ClientTupleKeyWithCondition() - .user(user) - .relation(relation) - ._object(_object) - .condition(condition); + @Override + public ClientTupleKey _object(String _object) { + super._object(_object); + return this; } } diff --git a/src/main/java/dev/openfga/sdk/api/client/ClientTupleKeyWithCondition.java b/src/main/java/dev/openfga/sdk/api/client/ClientTupleKeyWithCondition.java deleted file mode 100644 index 097f1a8..0000000 --- a/src/main/java/dev/openfga/sdk/api/client/ClientTupleKeyWithCondition.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * OpenFGA - * A high performance and flexible authorization/permission engine built for developers and inspired by Google Zanzibar. - * - * The version of the OpenAPI document: 0.1 - * Contact: community@openfga.dev - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package dev.openfga.sdk.api.client; - -import dev.openfga.sdk.api.model.ContextualTupleKeys; -import dev.openfga.sdk.api.model.TupleKey; -import dev.openfga.sdk.api.model.WriteRequestWrites; -import java.util.Collection; -import java.util.stream.Collectors; - -public class ClientTupleKeyWithCondition extends ClientTupleKey { - private ClientRelationshipCondition condition; - - public ClientTupleKeyWithCondition condition(ClientRelationshipCondition condition) { - this.condition = condition; - return this; - } - - public ClientRelationshipCondition getCondition() { - return condition; - } - - public TupleKey asTupleKey() { - var tupleKey = new TupleKey().user(getUser()).relation(getRelation())._object(getObject()); - - if (condition != null) { - tupleKey.condition(condition.asRelationshipCondition()); - } - - return tupleKey; - } - - public static ContextualTupleKeys asContextualTupleKeys(Collection tupleKeys) { - return new ContextualTupleKeys() - .tupleKeys(tupleKeys.stream() - .map(ClientTupleKeyWithCondition::asTupleKey) - .collect(Collectors.toList())); - } - - public static WriteRequestWrites asWriteRequestWrites(Collection tupleKeys) { - return new WriteRequestWrites() - .tupleKeys(tupleKeys.stream() - .map(ClientTupleKeyWithCondition::asTupleKey) - .collect(Collectors.toList())); - } - - /* Overrides for correct typing */ - - @Override - public ClientTupleKeyWithCondition user(String user) { - super.user(user); - return this; - } - - @Override - public ClientTupleKeyWithCondition relation(String relation) { - super.relation(relation); - return this; - } - - @Override - public ClientTupleKeyWithCondition _object(String _object) { - super._object(_object); - return this; - } -} diff --git a/src/main/java/dev/openfga/sdk/api/client/ClientTupleKeyWithoutCondition.java b/src/main/java/dev/openfga/sdk/api/client/ClientTupleKeyWithoutCondition.java new file mode 100644 index 0000000..7efad4d --- /dev/null +++ b/src/main/java/dev/openfga/sdk/api/client/ClientTupleKeyWithoutCondition.java @@ -0,0 +1,88 @@ +/* + * OpenFGA + * A high performance and flexible authorization/permission engine built for developers and inspired by Google Zanzibar. + * + * The version of the OpenAPI document: 0.1 + * Contact: community@openfga.dev + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package dev.openfga.sdk.api.client; + +import dev.openfga.sdk.api.model.TupleKeyWithoutCondition; +import dev.openfga.sdk.api.model.WriteRequestDeletes; +import java.util.Collection; +import java.util.stream.Collectors; + +public class ClientTupleKeyWithoutCondition { + private String user; + private String relation; + private String _object; + + public TupleKeyWithoutCondition asTupleKeyWithoutCondition() { + return new TupleKeyWithoutCondition().user(user).relation(relation)._object(_object); + } + + public static WriteRequestDeletes asWriteRequestDeletes(Collection tupleKeys) { + return new WriteRequestDeletes() + .tupleKeys(tupleKeys.stream() + .map(ClientTupleKeyWithoutCondition::asTupleKeyWithoutCondition) + .collect(Collectors.toList())); + } + + public ClientTupleKeyWithoutCondition _object(String _object) { + this._object = _object; + return this; + } + + /** + * Get _object + * @return _object + **/ + public String getObject() { + return _object; + } + + public ClientTupleKeyWithoutCondition relation(String relation) { + this.relation = relation; + return this; + } + + /** + * Get relation + * @return relation + **/ + public String getRelation() { + return relation; + } + + public ClientTupleKeyWithoutCondition user(String user) { + this.user = user; + return this; + } + + /** + * Get user + * @return user + **/ + public String getUser() { + return user; + } + + /** + * Adds a condition to the tuple key. + * @param condition a {@link ClientRelationshipCondition} + * @return a new {@link ClientTupleKey} with this {@link ClientTupleKeyWithoutCondition}'s + * user, relation, and object, and the passed condition. + */ + public ClientTupleKey condition(ClientRelationshipCondition condition) { + return new ClientTupleKey() + .user(user) + .relation(relation) + ._object(_object) + .condition(condition); + } +} diff --git a/src/main/java/dev/openfga/sdk/api/client/ClientWriteRequest.java b/src/main/java/dev/openfga/sdk/api/client/ClientWriteRequest.java index 189f39a..fe854c9 100644 --- a/src/main/java/dev/openfga/sdk/api/client/ClientWriteRequest.java +++ b/src/main/java/dev/openfga/sdk/api/client/ClientWriteRequest.java @@ -15,32 +15,32 @@ import java.util.List; public class ClientWriteRequest { - private List writes; - private List deletes; + private List writes; + private List deletes; - public static ClientWriteRequest ofWrites(List writes) { + public static ClientWriteRequest ofWrites(List writes) { return new ClientWriteRequest().writes(writes); } - public ClientWriteRequest writes(List writes) { + public ClientWriteRequest writes(List writes) { this.writes = writes; return this; } - public List getWrites() { + public List getWrites() { return writes; } - public static ClientWriteRequest ofDeletes(List deletes) { + public static ClientWriteRequest ofDeletes(List deletes) { return new ClientWriteRequest().deletes(deletes); } - public ClientWriteRequest deletes(List deletes) { + public ClientWriteRequest deletes(List deletes) { this.deletes = deletes; return this; } - public List getDeletes() { + public List getDeletes() { return deletes; } } diff --git a/src/main/java/dev/openfga/sdk/api/client/OpenFgaClient.java b/src/main/java/dev/openfga/sdk/api/client/OpenFgaClient.java index 7d89eb6..0f301a5 100644 --- a/src/main/java/dev/openfga/sdk/api/client/OpenFgaClient.java +++ b/src/main/java/dev/openfga/sdk/api/client/OpenFgaClient.java @@ -292,12 +292,12 @@ private CompletableFuture writeNonTransaction( var writeTuples = request.getWrites(); if (writeTuples != null && !writeTuples.isEmpty()) { - body.writes(ClientTupleKeyWithCondition.asWriteRequestWrites(writeTuples)); + body.writes(ClientTupleKey.asWriteRequestWrites(writeTuples)); } var deleteTuples = request.getDeletes(); if (deleteTuples != null && !deleteTuples.isEmpty()) { - body.deletes(ClientTupleKey.asWriteRequestDeletes(deleteTuples)); + body.deletes(ClientTupleKeyWithoutCondition.asWriteRequestDeletes(deleteTuples)); } if (options != null && !isNullOrWhitespace(options.getAuthorizationModelId())) { @@ -357,14 +357,14 @@ private Stream> chunksOf(int chunkSize, List list) { * * @throws FgaInvalidParameterException When the Store ID is null, empty, or whitespace */ - public CompletableFuture writeTuples(List tupleKeys) + public CompletableFuture writeTuples(List tupleKeys) throws FgaInvalidParameterException { configuration.assertValid(); String storeId = configuration.getStoreIdChecked(); var body = new WriteRequest(); - body.writes(ClientTupleKeyWithCondition.asWriteRequestWrites(tupleKeys)); + body.writes(ClientTupleKey.asWriteRequestWrites(tupleKeys)); String authorizationModelId = configuration.getAuthorizationModelId(); if (!isNullOrWhitespace(authorizationModelId)) { @@ -379,14 +379,14 @@ public CompletableFuture writeTuples(List deleteTuples(List tupleKeys) + public CompletableFuture deleteTuples(List tupleKeys) throws FgaInvalidParameterException { configuration.assertValid(); String storeId = configuration.getStoreIdChecked(); var body = new WriteRequest(); - body.deletes(ClientTupleKey.asWriteRequestDeletes(tupleKeys)); + body.deletes(ClientTupleKeyWithoutCondition.asWriteRequestDeletes(tupleKeys)); String authorizationModelId = configuration.getAuthorizationModelId(); if (!isNullOrWhitespace(authorizationModelId)) { @@ -427,7 +427,7 @@ public CompletableFuture check(ClientCheckRequest request, var contextualTuples = request.getContextualTuples(); if (contextualTuples != null && !contextualTuples.isEmpty()) { - body.contextualTuples(ClientTupleKeyWithCondition.asContextualTupleKeys(contextualTuples)); + body.contextualTuples(ClientTupleKey.asContextualTupleKeys(contextualTuples)); } } @@ -539,7 +539,7 @@ public CompletableFuture listObjects( body.user(request.getUser()).relation(request.getRelation()).type(request.getType()); if (request.getContextualTupleKeys() != null) { var contextualTuples = request.getContextualTupleKeys(); - var bodyContextualTuples = ClientTupleKeyWithCondition.asContextualTupleKeys(contextualTuples); + var bodyContextualTuples = ClientTupleKey.asContextualTupleKeys(contextualTuples); body.contextualTuples(bodyContextualTuples); } } diff --git a/src/test-integration/java/dev/openfga/sdk/api/client/OpenFgaClientIntegrationTest.java b/src/test-integration/java/dev/openfga/sdk/api/client/OpenFgaClientIntegrationTest.java index 374169e..872b33a 100644 --- a/src/test-integration/java/dev/openfga/sdk/api/client/OpenFgaClientIntegrationTest.java +++ b/src/test-integration/java/dev/openfga/sdk/api/client/OpenFgaClientIntegrationTest.java @@ -29,8 +29,10 @@ public class OpenFgaClientIntegrationTest { "{\"schema_version\":\"1.1\",\"type_definitions\":[{\"type\":\"user\"},{\"type\":\"document\",\"relations\":{\"reader\":{\"this\":{}},\"writer\":{\"this\":{}},\"owner\":{\"this\":{}}},\"metadata\":{\"relations\":{\"reader\":{\"directly_related_user_types\":[{\"type\":\"user\"}]},\"writer\":{\"directly_related_user_types\":[{\"type\":\"user\"}]},\"owner\":{\"directly_related_user_types\":[{\"type\":\"user\"}]}}}}]}"; private static final String DEFAULT_USER = "user:81684243-9356-4421-8fbf-a4f8d36aa31b"; private static final String DEFAULT_DOC = "document:2021-budget"; - private static final ClientTupleKey DEFAULT_TUPLE_KEY = - new ClientTupleKey().user(DEFAULT_USER).relation("reader")._object(DEFAULT_DOC); + private static final ClientTupleKeyWithoutCondition DEFAULT_TUPLE_KEY = new ClientTupleKeyWithoutCondition() + .user(DEFAULT_USER) + .relation("reader") + ._object(DEFAULT_DOC); private static final ClientRelationshipCondition DEFAULT_CONDITION = new ClientRelationshipCondition().name("condition").context(Map.of("some", "context")); private static final ClientAssertion DEFAULT_ASSERTION = new ClientAssertion() diff --git a/src/test/java/dev/openfga/sdk/api/client/OpenFgaClientTest.java b/src/test/java/dev/openfga/sdk/api/client/OpenFgaClientTest.java index 157c904..619e25a 100644 --- a/src/test/java/dev/openfga/sdk/api/client/OpenFgaClientTest.java +++ b/src/test/java/dev/openfga/sdk/api/client/OpenFgaClientTest.java @@ -1058,7 +1058,7 @@ public void writeTest_writes() throws Exception { DEFAULT_USER, DEFAULT_RELATION, DEFAULT_OBJECT, DEFAULT_AUTH_MODEL_ID); mockHttpClient.onPost(postPath).withBody(is(expectedBody)).doReturn(200, EMPTY_RESPONSE_BODY); ClientWriteRequest request = new ClientWriteRequest() - .writes(List.of(new ClientTupleKeyWithCondition() + .writes(List.of(new ClientTupleKey() ._object(DEFAULT_OBJECT) .relation(DEFAULT_RELATION) .user(DEFAULT_USER))); @@ -1083,7 +1083,7 @@ public void writeTest_deletes() throws Exception { DEFAULT_USER, DEFAULT_RELATION, DEFAULT_OBJECT, DEFAULT_AUTH_MODEL_ID); mockHttpClient.onPost(postPath).withBody(is(expectedBody)).doReturn(200, EMPTY_RESPONSE_BODY); ClientWriteRequest request = new ClientWriteRequest() - .deletes(List.of(new ClientTupleKey() + .deletes(List.of(new ClientTupleKeyWithoutCondition() ._object(DEFAULT_OBJECT) .relation(DEFAULT_RELATION) .user(DEFAULT_USER))); @@ -1102,11 +1102,11 @@ public void writeTest_transactions() throws Exception { String writeTupleBody = String.format( "{\"user\":\"%s\",\"relation\":\"%s\",\"object\":\"%s\",\"condition\":{\"name\":\"condition\",\"context\":{\"some\":\"context\"}}}", DEFAULT_USER, DEFAULT_RELATION, DEFAULT_OBJECT); - ClientTupleKey tuple = new ClientTupleKey() + ClientTupleKeyWithoutCondition tuple = new ClientTupleKeyWithoutCondition() ._object(DEFAULT_OBJECT) .relation(DEFAULT_RELATION) .user(DEFAULT_USER); - ClientTupleKeyWithCondition writeTuple = tuple.condition(DEFAULT_CONDITION); + ClientTupleKey writeTuple = tuple.condition(DEFAULT_CONDITION); String write2Body = String.format( "{\"writes\":{\"tuple_keys\":[%s,%s]},\"deletes\":null,\"authorization_model_id\":\"%s\"}", writeTupleBody, writeTupleBody, DEFAULT_AUTH_MODEL_ID); @@ -1163,7 +1163,7 @@ public void writeTest_transactionsWithFailure() throws Exception { .doReturn(400, "{\"code\":\"validation_error\",\"message\":\"Generic validation error\"}"); ClientWriteRequest request = new ClientWriteRequest() .writes(Stream.of(firstUser, failedUser, skippedUser) - .map(user -> new ClientTupleKeyWithCondition() + .map(user -> new ClientTupleKey() ._object(DEFAULT_OBJECT) .relation(DEFAULT_RELATION) .user(user) @@ -1216,7 +1216,7 @@ public void writeTest_nonTransaction() throws Exception { deleteTupleBody, DEFAULT_AUTH_MODEL_ID); mockHttpClient.onPost(postPath).withBody(is(expectedBody)).doReturn(200, EMPTY_RESPONSE_BODY); - var tuple = new ClientTupleKeyWithCondition() + var tuple = new ClientTupleKey() ._object(DEFAULT_OBJECT) .relation(DEFAULT_RELATION) .user(DEFAULT_USER) @@ -1259,7 +1259,7 @@ public void writeTest_nonTransactionsWithFailure() throws Exception { .onPost(postPath) .withBody(is(expectedBody)) .doReturn(400, "{\"code\":\"validation_error\",\"message\":\"Generic validation error\"}"); - var tuple = new ClientTupleKeyWithCondition() + var tuple = new ClientTupleKey() ._object(DEFAULT_OBJECT) .relation(DEFAULT_RELATION) .user(DEFAULT_USER) @@ -1290,7 +1290,7 @@ public void writeTuplesTest() throws Exception { + "\"deletes\":null,\"authorization_model_id\":\"%s\"}", DEFAULT_USER, DEFAULT_RELATION, DEFAULT_OBJECT, DEFAULT_AUTH_MODEL_ID); mockHttpClient.onPost(postPath).withBody(is(expectedBody)).doReturn(200, EMPTY_RESPONSE_BODY); - List tuples = List.of(new ClientTupleKeyWithCondition() + List tuples = List.of(new ClientTupleKey() ._object(DEFAULT_OBJECT) .relation(DEFAULT_RELATION) .user(DEFAULT_USER) @@ -1312,7 +1312,7 @@ public void deleteTuplesTest() throws Exception { "{\"writes\":null,\"deletes\":{\"tuple_keys\":[{\"user\":\"%s\",\"relation\":\"%s\",\"object\":\"%s\"}]},\"authorization_model_id\":\"%s\"}", DEFAULT_USER, DEFAULT_RELATION, DEFAULT_OBJECT, DEFAULT_AUTH_MODEL_ID); mockHttpClient.onPost(postPath).withBody(is(expectedBody)).doReturn(200, EMPTY_RESPONSE_BODY); - List tuples = List.of(new ClientTupleKey() + List tuples = List.of(new ClientTupleKeyWithoutCondition() ._object(DEFAULT_OBJECT) .relation(DEFAULT_RELATION) .user(DEFAULT_USER)); @@ -1347,7 +1347,7 @@ public void write_400() throws Exception { .onPost(postUrl) .doReturn(400, "{\"code\":\"validation_error\",\"message\":\"Generic validation error\"}"); ClientWriteRequest request = new ClientWriteRequest() - .writes(List.of(new ClientTupleKeyWithCondition() + .writes(List.of(new ClientTupleKey() ._object(DEFAULT_OBJECT) .relation(DEFAULT_RELATION) .user(DEFAULT_USER) @@ -1374,7 +1374,7 @@ public void write_404() throws Exception { .onPost(postUrl) .doReturn(404, "{\"code\":\"undefined_endpoint\",\"message\":\"Endpoint not enabled\"}"); ClientWriteRequest request = new ClientWriteRequest() - .writes(List.of(new ClientTupleKeyWithCondition() + .writes(List.of(new ClientTupleKey() ._object(DEFAULT_OBJECT) .relation(DEFAULT_RELATION) .user(DEFAULT_USER) @@ -1400,7 +1400,7 @@ public void write_500() throws Exception { .onPost(postUrl) .doReturn(500, "{\"code\":\"internal_error\",\"message\":\"Internal Server Error\"}"); ClientWriteRequest request = new ClientWriteRequest() - .writes(List.of(new ClientTupleKeyWithCondition() + .writes(List.of(new ClientTupleKey() ._object(DEFAULT_OBJECT) .relation(DEFAULT_RELATION) .user(DEFAULT_USER) @@ -1435,7 +1435,7 @@ public void check() throws Exception { ._object(DEFAULT_OBJECT) .relation(DEFAULT_RELATION) .user(DEFAULT_USER) - .contextualTuples(List.of(new ClientTupleKeyWithCondition() + .contextualTuples(List.of(new ClientTupleKey() ._object(DEFAULT_OBJECT) .relation("owner") .user(DEFAULT_USER)