From fb2f4c614997e30abc68227ea28037a7e2695324 Mon Sep 17 00:00:00 2001 From: "J.R. Hill" Date: Tue, 12 Dec 2023 14:41:17 -0800 Subject: [PATCH 1/6] feat(client): add headers for Write/BatchCheck/ListRelations, add header overriding to client --- .openapi-generator/FILES | 12 + README.md | 2 + docs/AbortedMessageResponse.md | 14 ++ docs/OpenFgaApi.md | 30 +++ .../java/dev/openfga/sdk/api/OpenFgaApi.java | 65 ++++++ .../dev/openfga/sdk/api/client/ApiClient.java | 13 ++ .../api/client/ClientReadChangesRequest.java | 26 +++ .../openfga/sdk/api/client/OpenFgaClient.java | 213 ++++++++++++++++-- .../AdditionalHeadersSupplier.java | 19 ++ .../ClientBatchCheckOptions.java | 17 +- .../api/configuration/ClientCheckOptions.java | 15 +- .../ClientCreateStoreOptions.java | 29 +++ .../ClientDeleteStoreOptions.java | 29 +++ .../ClientDeleteTuplesOptions.java | 29 +++ .../configuration/ClientExpandOptions.java | 15 +- .../configuration/ClientGetStoreOptions.java | 29 +++ .../ClientListObjectsOptions.java | 15 +- .../ClientListRelationsOptions.java | 15 +- .../ClientListStoresOptions.java | 15 +- .../ClientReadAssertionsOptions.java | 14 +- .../ClientReadAuthorizationModelOptions.java | 14 +- .../ClientReadAuthorizationModelsOptions.java | 15 +- .../ClientReadChangesOptions.java | 15 +- ...ntReadLatestAuthorizationModelOptions.java | 29 +++ .../api/configuration/ClientReadOptions.java | 15 +- .../ClientWriteAssertionsOptions.java | 14 +- .../ClientWriteAuthorizationModelOptions.java | 29 +++ .../api/configuration/ClientWriteOptions.java | 15 +- .../ClientWriteTuplesOptions.java | 29 +++ .../sdk/api/configuration/Configuration.java | 20 ++ .../configuration/ConfigurationOverride.java | 27 +++ .../sdk/api/model/AbortedMessageResponse.java | 176 +++++++++++++++ .../dev/openfga/sdk/api/model/NullValue.java | 2 +- .../sdk/api/client/OpenFgaClientTest.java | 152 +++++++++++-- .../api/model/AbortedMessageResponseTest.java | 46 ++++ 35 files changed, 1155 insertions(+), 59 deletions(-) create mode 100644 docs/AbortedMessageResponse.md create mode 100644 src/main/java/dev/openfga/sdk/api/client/ClientReadChangesRequest.java create mode 100644 src/main/java/dev/openfga/sdk/api/configuration/AdditionalHeadersSupplier.java create mode 100644 src/main/java/dev/openfga/sdk/api/configuration/ClientCreateStoreOptions.java create mode 100644 src/main/java/dev/openfga/sdk/api/configuration/ClientDeleteStoreOptions.java create mode 100644 src/main/java/dev/openfga/sdk/api/configuration/ClientDeleteTuplesOptions.java create mode 100644 src/main/java/dev/openfga/sdk/api/configuration/ClientGetStoreOptions.java create mode 100644 src/main/java/dev/openfga/sdk/api/configuration/ClientReadLatestAuthorizationModelOptions.java create mode 100644 src/main/java/dev/openfga/sdk/api/configuration/ClientWriteAuthorizationModelOptions.java create mode 100644 src/main/java/dev/openfga/sdk/api/configuration/ClientWriteTuplesOptions.java create mode 100644 src/main/java/dev/openfga/sdk/api/model/AbortedMessageResponse.java create mode 100644 src/test/java/dev/openfga/sdk/api/model/AbortedMessageResponseTest.java diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index f828c98..edee303 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -14,6 +14,7 @@ README.md VERSION.txt api/openapi.yaml build.gradle +docs/AbortedMessageResponse.md docs/Any.md docs/Assertion.md docs/AssertionTupleKey.md @@ -111,6 +112,7 @@ src/main/java/dev/openfga/sdk/api/client/ClientListStoresResponse.java src/main/java/dev/openfga/sdk/api/client/ClientReadAssertionsResponse.java src/main/java/dev/openfga/sdk/api/client/ClientReadAuthorizationModelResponse.java src/main/java/dev/openfga/sdk/api/client/ClientReadAuthorizationModelsResponse.java +src/main/java/dev/openfga/sdk/api/client/ClientReadChangesRequest.java src/main/java/dev/openfga/sdk/api/client/ClientReadChangesResponse.java src/main/java/dev/openfga/sdk/api/client/ClientReadRequest.java src/main/java/dev/openfga/sdk/api/client/ClientReadResponse.java @@ -123,13 +125,18 @@ src/main/java/dev/openfga/sdk/api/client/ClientWriteRequest.java src/main/java/dev/openfga/sdk/api/client/ClientWriteResponse.java src/main/java/dev/openfga/sdk/api/client/HttpRequestAttempt.java src/main/java/dev/openfga/sdk/api/client/OpenFgaClient.java +src/main/java/dev/openfga/sdk/api/configuration/AdditionalHeadersSupplier.java src/main/java/dev/openfga/sdk/api/configuration/ApiToken.java src/main/java/dev/openfga/sdk/api/configuration/BaseConfiguration.java src/main/java/dev/openfga/sdk/api/configuration/ClientBatchCheckOptions.java src/main/java/dev/openfga/sdk/api/configuration/ClientCheckOptions.java src/main/java/dev/openfga/sdk/api/configuration/ClientConfiguration.java +src/main/java/dev/openfga/sdk/api/configuration/ClientCreateStoreOptions.java src/main/java/dev/openfga/sdk/api/configuration/ClientCredentials.java +src/main/java/dev/openfga/sdk/api/configuration/ClientDeleteStoreOptions.java +src/main/java/dev/openfga/sdk/api/configuration/ClientDeleteTuplesOptions.java src/main/java/dev/openfga/sdk/api/configuration/ClientExpandOptions.java +src/main/java/dev/openfga/sdk/api/configuration/ClientGetStoreOptions.java src/main/java/dev/openfga/sdk/api/configuration/ClientListObjectsOptions.java src/main/java/dev/openfga/sdk/api/configuration/ClientListRelationsOptions.java src/main/java/dev/openfga/sdk/api/configuration/ClientListStoresOptions.java @@ -137,13 +144,17 @@ src/main/java/dev/openfga/sdk/api/configuration/ClientReadAssertionsOptions.java src/main/java/dev/openfga/sdk/api/configuration/ClientReadAuthorizationModelOptions.java src/main/java/dev/openfga/sdk/api/configuration/ClientReadAuthorizationModelsOptions.java src/main/java/dev/openfga/sdk/api/configuration/ClientReadChangesOptions.java +src/main/java/dev/openfga/sdk/api/configuration/ClientReadLatestAuthorizationModelOptions.java src/main/java/dev/openfga/sdk/api/configuration/ClientReadOptions.java src/main/java/dev/openfga/sdk/api/configuration/ClientWriteAssertionsOptions.java +src/main/java/dev/openfga/sdk/api/configuration/ClientWriteAuthorizationModelOptions.java src/main/java/dev/openfga/sdk/api/configuration/ClientWriteOptions.java +src/main/java/dev/openfga/sdk/api/configuration/ClientWriteTuplesOptions.java src/main/java/dev/openfga/sdk/api/configuration/Configuration.java src/main/java/dev/openfga/sdk/api/configuration/ConfigurationOverride.java src/main/java/dev/openfga/sdk/api/configuration/Credentials.java src/main/java/dev/openfga/sdk/api/configuration/CredentialsMethod.java +src/main/java/dev/openfga/sdk/api/model/AbortedMessageResponse.java src/main/java/dev/openfga/sdk/api/model/AbstractOpenApiSchema.java src/main/java/dev/openfga/sdk/api/model/Any.java src/main/java/dev/openfga/sdk/api/model/Assertion.java @@ -231,6 +242,7 @@ src/test/java/dev/openfga/sdk/api/auth/OAuth2ClientTest.java src/test/java/dev/openfga/sdk/api/client/OpenFgaClientTest.java src/test/java/dev/openfga/sdk/api/configuration/ClientCredentialsTest.java src/test/java/dev/openfga/sdk/api/configuration/ConfigurationTest.java +src/test/java/dev/openfga/sdk/api/model/AbortedMessageResponseTest.java src/test/java/dev/openfga/sdk/api/model/AnyTest.java src/test/java/dev/openfga/sdk/api/model/AssertionTest.java src/test/java/dev/openfga/sdk/api/model/AssertionTupleKeyTest.java diff --git a/README.md b/README.md index 0335407..679e556 100644 --- a/README.md +++ b/README.md @@ -736,6 +736,8 @@ fgaClient.writeAssertions(assertions, options).get(); ### Models +- [AbortedMessageResponse](https://github.com/openfga/java-sdk/blob/main/docs/AbortedMessageResponse.md) + - [Any](https://github.com/openfga/java-sdk/blob/main/docs/Any.md) - [Assertion](https://github.com/openfga/java-sdk/blob/main/docs/Assertion.md) diff --git a/docs/AbortedMessageResponse.md b/docs/AbortedMessageResponse.md new file mode 100644 index 0000000..e70c587 --- /dev/null +++ b/docs/AbortedMessageResponse.md @@ -0,0 +1,14 @@ + + +# AbortedMessageResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**code** | **String** | | [optional] | +|**message** | **String** | | [optional] | + + + diff --git a/docs/OpenFgaApi.md b/docs/OpenFgaApi.md index 390227f..0406205 100644 --- a/docs/OpenFgaApi.md +++ b/docs/OpenFgaApi.md @@ -106,6 +106,7 @@ No authorization required | **200** | A successful response. | - | | **400** | Request failed due to invalid input. | - | | **404** | Request failed due to incorrect path. | - | +| **409** | Request was aborted due a transaction conflict. | - | | **500** | Request failed due to internal server error. | - | ## checkWithHttpInfo @@ -187,6 +188,7 @@ No authorization required | **200** | A successful response. | - | | **400** | Request failed due to invalid input. | - | | **404** | Request failed due to incorrect path. | - | +| **409** | Request was aborted due a transaction conflict. | - | | **500** | Request failed due to internal server error. | - | @@ -257,6 +259,7 @@ No authorization required | **201** | A successful response. | - | | **400** | Request failed due to invalid input. | - | | **404** | Request failed due to incorrect path. | - | +| **409** | Request was aborted due a transaction conflict. | - | | **500** | Request failed due to internal server error. | - | ## createStoreWithHttpInfo @@ -336,6 +339,7 @@ No authorization required | **201** | A successful response. | - | | **400** | Request failed due to invalid input. | - | | **404** | Request failed due to incorrect path. | - | +| **409** | Request was aborted due a transaction conflict. | - | | **500** | Request failed due to internal server error. | - | @@ -405,6 +409,7 @@ No authorization required | **204** | A successful response. | - | | **400** | Request failed due to invalid input. | - | | **404** | Request failed due to incorrect path. | - | +| **409** | Request was aborted due a transaction conflict. | - | | **500** | Request failed due to internal server error. | - | ## deleteStoreWithHttpInfo @@ -483,6 +488,7 @@ No authorization required | **204** | A successful response. | - | | **400** | Request failed due to invalid input. | - | | **404** | Request failed due to incorrect path. | - | +| **409** | Request was aborted due a transaction conflict. | - | | **500** | Request failed due to internal server error. | - | @@ -555,6 +561,7 @@ No authorization required | **200** | A successful response. | - | | **400** | Request failed due to invalid input. | - | | **404** | Request failed due to incorrect path. | - | +| **409** | Request was aborted due a transaction conflict. | - | | **500** | Request failed due to internal server error. | - | ## expandWithHttpInfo @@ -636,6 +643,7 @@ No authorization required | **200** | A successful response. | - | | **400** | Request failed due to invalid input. | - | | **404** | Request failed due to incorrect path. | - | +| **409** | Request was aborted due a transaction conflict. | - | | **500** | Request failed due to internal server error. | - | @@ -706,6 +714,7 @@ No authorization required | **200** | A successful response. | - | | **400** | Request failed due to invalid input. | - | | **404** | Request failed due to incorrect path. | - | +| **409** | Request was aborted due a transaction conflict. | - | | **500** | Request failed due to internal server error. | - | ## getStoreWithHttpInfo @@ -785,6 +794,7 @@ No authorization required | **200** | A successful response. | - | | **400** | Request failed due to invalid input. | - | | **404** | Request failed due to incorrect path. | - | +| **409** | Request was aborted due a transaction conflict. | - | | **500** | Request failed due to internal server error. | - | @@ -857,6 +867,7 @@ No authorization required | **200** | A successful response. | - | | **400** | Request failed due to invalid input. | - | | **404** | Request failed due to incorrect path. | - | +| **409** | Request was aborted due a transaction conflict. | - | | **500** | Request failed due to internal server error. | - | ## listObjectsWithHttpInfo @@ -938,6 +949,7 @@ No authorization required | **200** | A successful response. | - | | **400** | Request failed due to invalid input. | - | | **404** | Request failed due to incorrect path. | - | +| **409** | Request was aborted due a transaction conflict. | - | | **500** | Request failed due to internal server error. | - | @@ -1010,6 +1022,7 @@ No authorization required | **200** | A successful response. | - | | **400** | Request failed due to invalid input. | - | | **404** | Request failed due to incorrect path. | - | +| **409** | Request was aborted due a transaction conflict. | - | | **500** | Request failed due to internal server error. | - | ## listStoresWithHttpInfo @@ -1091,6 +1104,7 @@ No authorization required | **200** | A successful response. | - | | **400** | Request failed due to invalid input. | - | | **404** | Request failed due to incorrect path. | - | +| **409** | Request was aborted due a transaction conflict. | - | | **500** | Request failed due to internal server error. | - | @@ -1163,6 +1177,7 @@ No authorization required | **200** | A successful response. | - | | **400** | Request failed due to invalid input. | - | | **404** | Request failed due to incorrect path. | - | +| **409** | Request was aborted due a transaction conflict. | - | | **500** | Request failed due to internal server error. | - | ## readWithHttpInfo @@ -1244,6 +1259,7 @@ No authorization required | **200** | A successful response. | - | | **400** | Request failed due to invalid input. | - | | **404** | Request failed due to incorrect path. | - | +| **409** | Request was aborted due a transaction conflict. | - | | **500** | Request failed due to internal server error. | - | @@ -1316,6 +1332,7 @@ No authorization required | **200** | A successful response. | - | | **400** | Request failed due to invalid input. | - | | **404** | Request failed due to incorrect path. | - | +| **409** | Request was aborted due a transaction conflict. | - | | **500** | Request failed due to internal server error. | - | ## readAssertionsWithHttpInfo @@ -1397,6 +1414,7 @@ No authorization required | **200** | A successful response. | - | | **400** | Request failed due to invalid input. | - | | **404** | Request failed due to incorrect path. | - | +| **409** | Request was aborted due a transaction conflict. | - | | **500** | Request failed due to internal server error. | - | @@ -1469,6 +1487,7 @@ No authorization required | **200** | A successful response. | - | | **400** | Request failed due to invalid input. | - | | **404** | Request failed due to incorrect path. | - | +| **409** | Request was aborted due a transaction conflict. | - | | **500** | Request failed due to internal server error. | - | ## readAuthorizationModelWithHttpInfo @@ -1550,6 +1569,7 @@ No authorization required | **200** | A successful response. | - | | **400** | Request failed due to invalid input. | - | | **404** | Request failed due to incorrect path. | - | +| **409** | Request was aborted due a transaction conflict. | - | | **500** | Request failed due to internal server error. | - | @@ -1624,6 +1644,7 @@ No authorization required | **200** | A successful response. | - | | **400** | Request failed due to invalid input. | - | | **404** | Request failed due to incorrect path. | - | +| **409** | Request was aborted due a transaction conflict. | - | | **500** | Request failed due to internal server error. | - | ## readAuthorizationModelsWithHttpInfo @@ -1707,6 +1728,7 @@ No authorization required | **200** | A successful response. | - | | **400** | Request failed due to invalid input. | - | | **404** | Request failed due to incorrect path. | - | +| **409** | Request was aborted due a transaction conflict. | - | | **500** | Request failed due to internal server error. | - | @@ -1783,6 +1805,7 @@ No authorization required | **200** | A successful response. | - | | **400** | Request failed due to invalid input. | - | | **404** | Request failed due to incorrect path. | - | +| **409** | Request was aborted due a transaction conflict. | - | | **500** | Request failed due to internal server error. | - | ## readChangesWithHttpInfo @@ -1868,6 +1891,7 @@ No authorization required | **200** | A successful response. | - | | **400** | Request failed due to invalid input. | - | | **404** | Request failed due to incorrect path. | - | +| **409** | Request was aborted due a transaction conflict. | - | | **500** | Request failed due to internal server error. | - | @@ -1940,6 +1964,7 @@ No authorization required | **200** | A successful response. | - | | **400** | Request failed due to invalid input. | - | | **404** | Request failed due to incorrect path. | - | +| **409** | Request was aborted due a transaction conflict. | - | | **500** | Request failed due to internal server error. | - | ## writeWithHttpInfo @@ -2021,6 +2046,7 @@ No authorization required | **200** | A successful response. | - | | **400** | Request failed due to invalid input. | - | | **404** | Request failed due to incorrect path. | - | +| **409** | Request was aborted due a transaction conflict. | - | | **500** | Request failed due to internal server error. | - | @@ -2094,6 +2120,7 @@ No authorization required | **204** | A successful response. | - | | **400** | Request failed due to invalid input. | - | | **404** | Request failed due to incorrect path. | - | +| **409** | Request was aborted due a transaction conflict. | - | | **500** | Request failed due to internal server error. | - | ## writeAssertionsWithHttpInfo @@ -2176,6 +2203,7 @@ No authorization required | **204** | A successful response. | - | | **400** | Request failed due to invalid input. | - | | **404** | Request failed due to incorrect path. | - | +| **409** | Request was aborted due a transaction conflict. | - | | **500** | Request failed due to internal server error. | - | @@ -2248,6 +2276,7 @@ No authorization required | **201** | A successful response. | - | | **400** | Request failed due to invalid input. | - | | **404** | Request failed due to incorrect path. | - | +| **409** | Request was aborted due a transaction conflict. | - | | **500** | Request failed due to internal server error. | - | ## writeAuthorizationModelWithHttpInfo @@ -2329,5 +2358,6 @@ No authorization required | **201** | A successful response. | - | | **400** | Request failed due to invalid input. | - | | **404** | Request failed due to incorrect path. | - | +| **409** | Request was aborted due a transaction conflict. | - | | **500** | Request failed due to internal server error. | - | diff --git a/src/main/java/dev/openfga/sdk/api/OpenFgaApi.java b/src/main/java/dev/openfga/sdk/api/OpenFgaApi.java index 9666ab8..8b48705 100644 --- a/src/main/java/dev/openfga/sdk/api/OpenFgaApi.java +++ b/src/main/java/dev/openfga/sdk/api/OpenFgaApi.java @@ -70,6 +70,11 @@ public OpenFgaApi(Configuration configuration, ApiClient apiClient) throws FgaIn } else { this.oAuth2Client = null; } + + var additionalHeaders = configuration.getAdditionalHeaders(); + if (additionalHeaders != null) { + apiClient.addRequestInterceptor(httpRequest -> additionalHeaders.forEach(httpRequest::setHeader)); + } } /** @@ -141,6 +146,10 @@ private HttpRequest.Builder checkRequestBuilder(String storeId, CheckRequest bod localVarRequestBuilder.header("Authorization", "Bearer " + accessToken); } + if (configuration.getAdditionalHeaders() != null) { + configuration.getAdditionalHeaders().forEach(localVarRequestBuilder::header); + } + try { byte[] localVarPostBody = apiClient.getObjectMapper().writeValueAsBytes(body); localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); @@ -218,6 +227,10 @@ private HttpRequest.Builder createStoreRequestBuilder(CreateStoreRequest body, C localVarRequestBuilder.header("Authorization", "Bearer " + accessToken); } + if (configuration.getAdditionalHeaders() != null) { + configuration.getAdditionalHeaders().forEach(localVarRequestBuilder::header); + } + try { byte[] localVarPostBody = apiClient.getObjectMapper().writeValueAsBytes(body); localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); @@ -294,6 +307,10 @@ private HttpRequest.Builder deleteStoreRequestBuilder(String storeId, Configurat localVarRequestBuilder.header("Authorization", "Bearer " + accessToken); } + if (configuration.getAdditionalHeaders() != null) { + configuration.getAdditionalHeaders().forEach(localVarRequestBuilder::header); + } + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); Duration readTimeout = configuration.getReadTimeout(); if (readTimeout != null) { @@ -375,6 +392,10 @@ private HttpRequest.Builder expandRequestBuilder(String storeId, ExpandRequest b localVarRequestBuilder.header("Authorization", "Bearer " + accessToken); } + if (configuration.getAdditionalHeaders() != null) { + configuration.getAdditionalHeaders().forEach(localVarRequestBuilder::header); + } + try { byte[] localVarPostBody = apiClient.getObjectMapper().writeValueAsBytes(body); localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); @@ -451,6 +472,10 @@ private HttpRequest.Builder getStoreRequestBuilder(String storeId, Configuration localVarRequestBuilder.header("Authorization", "Bearer " + accessToken); } + if (configuration.getAdditionalHeaders() != null) { + configuration.getAdditionalHeaders().forEach(localVarRequestBuilder::header); + } + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); Duration readTimeout = configuration.getReadTimeout(); if (readTimeout != null) { @@ -533,6 +558,10 @@ private HttpRequest.Builder listObjectsRequestBuilder( localVarRequestBuilder.header("Authorization", "Bearer " + accessToken); } + if (configuration.getAdditionalHeaders() != null) { + configuration.getAdditionalHeaders().forEach(localVarRequestBuilder::header); + } + try { byte[] localVarPostBody = apiClient.getObjectMapper().writeValueAsBytes(body); localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); @@ -628,6 +657,10 @@ private HttpRequest.Builder listStoresRequestBuilder( localVarRequestBuilder.header("Authorization", "Bearer " + accessToken); } + if (configuration.getAdditionalHeaders() != null) { + configuration.getAdditionalHeaders().forEach(localVarRequestBuilder::header); + } + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); Duration readTimeout = configuration.getReadTimeout(); if (readTimeout != null) { @@ -708,6 +741,10 @@ private HttpRequest.Builder readRequestBuilder(String storeId, ReadRequest body, localVarRequestBuilder.header("Authorization", "Bearer " + accessToken); } + if (configuration.getAdditionalHeaders() != null) { + configuration.getAdditionalHeaders().forEach(localVarRequestBuilder::header); + } + try { byte[] localVarPostBody = apiClient.getObjectMapper().writeValueAsBytes(body); localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); @@ -797,6 +834,10 @@ private HttpRequest.Builder readAssertionsRequestBuilder( localVarRequestBuilder.header("Authorization", "Bearer " + accessToken); } + if (configuration.getAdditionalHeaders() != null) { + configuration.getAdditionalHeaders().forEach(localVarRequestBuilder::header); + } + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); Duration readTimeout = configuration.getReadTimeout(); if (readTimeout != null) { @@ -882,6 +923,10 @@ private HttpRequest.Builder readAuthorizationModelRequestBuilder( localVarRequestBuilder.header("Authorization", "Bearer " + accessToken); } + if (configuration.getAdditionalHeaders() != null) { + configuration.getAdditionalHeaders().forEach(localVarRequestBuilder::header); + } + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); Duration readTimeout = configuration.getReadTimeout(); if (readTimeout != null) { @@ -988,6 +1033,10 @@ private HttpRequest.Builder readAuthorizationModelsRequestBuilder( localVarRequestBuilder.header("Authorization", "Bearer " + accessToken); } + if (configuration.getAdditionalHeaders() != null) { + configuration.getAdditionalHeaders().forEach(localVarRequestBuilder::header); + } + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); Duration readTimeout = configuration.getReadTimeout(); if (readTimeout != null) { @@ -1095,6 +1144,10 @@ private HttpRequest.Builder readChangesRequestBuilder( localVarRequestBuilder.header("Authorization", "Bearer " + accessToken); } + if (configuration.getAdditionalHeaders() != null) { + configuration.getAdditionalHeaders().forEach(localVarRequestBuilder::header); + } + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); Duration readTimeout = configuration.getReadTimeout(); if (readTimeout != null) { @@ -1174,6 +1227,10 @@ private HttpRequest.Builder writeRequestBuilder(String storeId, WriteRequest bod localVarRequestBuilder.header("Authorization", "Bearer " + accessToken); } + if (configuration.getAdditionalHeaders() != null) { + configuration.getAdditionalHeaders().forEach(localVarRequestBuilder::header); + } + try { byte[] localVarPostBody = apiClient.getObjectMapper().writeValueAsBytes(body); localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); @@ -1273,6 +1330,10 @@ private HttpRequest.Builder writeAssertionsRequestBuilder( localVarRequestBuilder.header("Authorization", "Bearer " + accessToken); } + if (configuration.getAdditionalHeaders() != null) { + configuration.getAdditionalHeaders().forEach(localVarRequestBuilder::header); + } + try { byte[] localVarPostBody = apiClient.getObjectMapper().writeValueAsBytes(body); localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); @@ -1366,6 +1427,10 @@ private HttpRequest.Builder writeAuthorizationModelRequestBuilder( localVarRequestBuilder.header("Authorization", "Bearer " + accessToken); } + if (configuration.getAdditionalHeaders() != null) { + configuration.getAdditionalHeaders().forEach(localVarRequestBuilder::header); + } + try { byte[] localVarPostBody = apiClient.getObjectMapper().writeValueAsBytes(body); localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); diff --git a/src/main/java/dev/openfga/sdk/api/client/ApiClient.java b/src/main/java/dev/openfga/sdk/api/client/ApiClient.java index 89ae992..8fa1c79 100644 --- a/src/main/java/dev/openfga/sdk/api/client/ApiClient.java +++ b/src/main/java/dev/openfga/sdk/api/client/ApiClient.java @@ -318,6 +318,19 @@ public ApiClient setRequestInterceptor(Consumer interceptor return this; } + /** + * Add a custom request interceptor. This interceptor will be run after any + * other interceptor(s) already in place. + * + *

For details on request interceptors, see {@link ApiClient#setRequestInterceptor(Consumer)}

+ * + * @param interceptor A function invoked before creating each request. A value + * of null resets the interceptor to a no-op. + */ + public void addRequestInterceptor(Consumer interceptor) { + this.interceptor = this.interceptor != null ? this.interceptor.andThen(interceptor) : interceptor; + } + /** * Get the custom interceptor. * diff --git a/src/main/java/dev/openfga/sdk/api/client/ClientReadChangesRequest.java b/src/main/java/dev/openfga/sdk/api/client/ClientReadChangesRequest.java new file mode 100644 index 0000000..30fb60f --- /dev/null +++ b/src/main/java/dev/openfga/sdk/api/client/ClientReadChangesRequest.java @@ -0,0 +1,26 @@ +/* + * 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; + +public class ClientReadChangesRequest { + private String type; + + public ClientReadChangesRequest type(String type) { + this.type = type; + return this; + } + + public String getType() { + return type; + } +} 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 0f301a5..b5f9bbe 100644 --- a/src/main/java/dev/openfga/sdk/api/client/OpenFgaClient.java +++ b/src/main/java/dev/openfga/sdk/api/client/OpenFgaClient.java @@ -13,12 +13,14 @@ package dev.openfga.sdk.api.client; import static dev.openfga.sdk.util.StringUtil.isNullOrWhitespace; +import static java.util.UUID.randomUUID; import dev.openfga.sdk.api.*; import dev.openfga.sdk.api.configuration.*; import dev.openfga.sdk.api.model.*; import dev.openfga.sdk.errors.*; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.concurrent.*; import java.util.function.Consumer; @@ -73,10 +75,14 @@ public CompletableFuture listStores() throws FgaInvali return call(() -> api.listStores(null, null)).thenApply(ClientListStoresResponse::new); } + /** + * ListStores - Get a paginated list of stores. + */ public CompletableFuture listStores(ClientListStoresOptions options) throws FgaInvalidParameterException { configuration.assertValid(); - return call(() -> api.listStores(options.getPageSize(), options.getContinuationToken())) + var overrides = new ConfigurationOverride().addHeaders(options); + return call(() -> api.listStores(options.getPageSize(), options.getContinuationToken(), overrides)) .thenApply(ClientListStoresResponse::new); } @@ -85,8 +91,17 @@ public CompletableFuture listStores(ClientListStoresOp */ public CompletableFuture createStore(CreateStoreRequest request) throws FgaInvalidParameterException { + return createStore(request, null); + } + + /** + * CreateStore - Initialize a store + */ + public CompletableFuture createStore( + CreateStoreRequest request, ClientCreateStoreOptions options) throws FgaInvalidParameterException { configuration.assertValid(); - return call(() -> api.createStore(request)).thenApply(ClientCreateStoreResponse::new); + var overrides = new ConfigurationOverride().addHeaders(options); + return call(() -> api.createStore(request, overrides)).thenApply(ClientCreateStoreResponse::new); } /** @@ -94,9 +109,19 @@ public CompletableFuture createStore(CreateStoreReque * @throws FgaInvalidParameterException When the Store ID is null, empty, or whitespace */ public CompletableFuture getStore() throws FgaInvalidParameterException { + return getStore(null); + } + + /** + * GetStore - Get information about the current store. + * @throws FgaInvalidParameterException When the Store ID is null, empty, or whitespace + */ + public CompletableFuture getStore(ClientGetStoreOptions options) + throws FgaInvalidParameterException { configuration.assertValid(); String storeId = configuration.getStoreIdChecked(); - return call(() -> api.getStore(storeId)).thenApply(ClientGetStoreResponse::new); + var overrides = new ConfigurationOverride().addHeaders(options); + return call(() -> api.getStore(storeId, overrides)).thenApply(ClientGetStoreResponse::new); } /** @@ -105,9 +130,20 @@ public CompletableFuture getStore() throws FgaInvalidPar * @throws FgaInvalidParameterException When the Store ID is null, empty, or whitespace */ public CompletableFuture deleteStore() throws FgaInvalidParameterException { + return deleteStore(null); + } + + /** + * DeleteStore - Delete a store + * + * @throws FgaInvalidParameterException When the Store ID is null, empty, or whitespace + */ + public CompletableFuture deleteStore(ClientDeleteStoreOptions options) + throws FgaInvalidParameterException { configuration.assertValid(); String storeId = configuration.getStoreIdChecked(); - return call(() -> api.deleteStore(storeId)).thenApply(ClientDeleteStoreResponse::new); + var overrides = new ConfigurationOverride().addHeaders(options); + return call(() -> api.deleteStore(storeId, overrides)).thenApply(ClientDeleteStoreResponse::new); } /* ********************** @@ -146,7 +182,9 @@ public CompletableFuture readAuthorizatio pageSize = null; } - return call(() -> api.readAuthorizationModels(storeId, pageSize, continuationToken)) + var overrides = new ConfigurationOverride().addHeaders(options); + + return call(() -> api.readAuthorizationModels(storeId, pageSize, continuationToken, overrides)) .thenApply(ClientReadAuthorizationModelsResponse::new); } @@ -157,9 +195,21 @@ public CompletableFuture readAuthorizatio */ public CompletableFuture writeAuthorizationModel( WriteAuthorizationModelRequest request) throws FgaInvalidParameterException { + return writeAuthorizationModel(request, null); + } + + /** + * WriteAuthorizationModel - Create a new version of the authorization model + * + * @throws FgaInvalidParameterException When the Store ID is null, empty, or whitespace + */ + public CompletableFuture writeAuthorizationModel( + WriteAuthorizationModelRequest request, ClientWriteAuthorizationModelOptions options) + throws FgaInvalidParameterException { configuration.assertValid(); String storeId = configuration.getStoreIdChecked(); - return call(() -> api.writeAuthorizationModel(storeId, request)) + var overrides = new ConfigurationOverride().addHeaders(options); + return call(() -> api.writeAuthorizationModel(storeId, request, overrides)) .thenApply(ClientWriteAuthorizationModelResponse::new); } @@ -187,7 +237,8 @@ public CompletableFuture readAuthorization configuration.assertValid(); String storeId = configuration.getStoreIdChecked(); String authorizationModelId = options.getAuthorizationModelIdChecked(); - return call(() -> api.readAuthorizationModel(storeId, authorizationModelId)) + var overrides = new ConfigurationOverride().addHeaders(options); + return call(() -> api.readAuthorizationModel(storeId, authorizationModelId, overrides)) .thenApply(ClientReadAuthorizationModelResponse::new); } @@ -198,9 +249,20 @@ public CompletableFuture readAuthorization */ public CompletableFuture readLatestAuthorizationModel() throws FgaInvalidParameterException { + return readLatestAuthorizationModel(null); + } + + /** + * ReadLatestAuthorizationModel - Read the latest authorization model for the current store + * + * @throws FgaInvalidParameterException When the Store ID is null, empty, or whitespace + */ + public CompletableFuture readLatestAuthorizationModel( + ClientReadLatestAuthorizationModelOptions options) throws FgaInvalidParameterException { configuration.assertValid(); String storeId = configuration.getStoreIdChecked(); - return call(() -> api.readAuthorizationModels(storeId, 1, null)) + var overrides = new ConfigurationOverride().addHeaders(options); + return call(() -> api.readAuthorizationModels(storeId, 1, null, overrides)) .thenApply(ClientReadAuthorizationModelResponse::latestOf); } @@ -213,12 +275,25 @@ public CompletableFuture readLatestAuthori * * @throws FgaInvalidParameterException When the Store ID is null, empty, or whitespace */ - public CompletableFuture readChanges(ClientReadChangesOptions options) + public CompletableFuture readChanges(ClientReadChangesRequest request) + throws FgaInvalidParameterException { + return readChanges(request, null); + } + + /** + * Read Changes - Read the list of historical relationship tuple writes and deletes + * + * @throws FgaInvalidParameterException When the Store ID is null, empty, or whitespace + */ + public CompletableFuture readChanges( + ClientReadChangesRequest request, ClientReadChangesOptions readChangesOptions) throws FgaInvalidParameterException { configuration.assertValid(); String storeId = configuration.getStoreIdChecked(); + var options = readChangesOptions != null ? readChangesOptions : new ClientReadChangesOptions(); + var overrides = new ConfigurationOverride().addHeaders(options); return call(() -> api.readChanges( - storeId, options.getType(), options.getPageSize(), options.getContinuationToken())) + storeId, request.getType(), options.getPageSize(), options.getContinuationToken(), overrides)) .thenApply(ClientReadChangesResponse::new); } @@ -255,7 +330,9 @@ public CompletableFuture read(ClientReadRequest request, Cli body.pageSize(options.getPageSize()).continuationToken(options.getContinuationToken()); } - return call(() -> api.read(storeId, body)).thenApply(ClientReadResponse::new); + var overrides = new ConfigurationOverride().addHeaders(options); + + return call(() -> api.read(storeId, body, overrides)).thenApply(ClientReadResponse::new); } /** @@ -307,14 +384,26 @@ private CompletableFuture writeNonTransaction( body.authorizationModelId(authorizationModelId); } - return call(() -> api.write(storeId, body)).thenApply(ClientWriteResponse::new); + var overrides = new ConfigurationOverride().addHeaders(options); + + return call(() -> api.write(storeId, body, overrides)).thenApply(ClientWriteResponse::new); } private CompletableFuture writeTransactions( - String storeId, ClientWriteRequest request, ClientWriteOptions options) { + String storeId, ClientWriteRequest request, ClientWriteOptions writeOptions) { + + var options = writeOptions != null + ? writeOptions + : new ClientWriteOptions().transactionChunkSize(DEFAULT_MAX_METHOD_PARALLEL_REQS); - int chunkSize = options == null ? DEFAULT_MAX_METHOD_PARALLEL_REQS : options.getTransactionChunkSize(); + if (options.getAdditionalHeaders() == null) { + options.additionalHeaders(new HashMap<>()); + } + options.getAdditionalHeaders().putIfAbsent(CLIENT_METHOD_HEADER, "Write"); + options.getAdditionalHeaders() + .putIfAbsent(CLIENT_BULK_REQUEST_ID_HEADER, randomUUID().toString()); + int chunkSize = options.getTransactionChunkSize(); var writeTransactions = chunksOf(chunkSize, request.getWrites()).map(ClientWriteRequest::ofWrites); var deleteTransactions = chunksOf(chunkSize, request.getDeletes()).map(ClientWriteRequest::ofDeletes); @@ -359,6 +448,16 @@ private Stream> chunksOf(int chunkSize, List list) { */ public CompletableFuture writeTuples(List tupleKeys) throws FgaInvalidParameterException { + return writeTuples(tupleKeys, null); + } + + /** + * WriteTuples - Utility method to write tuples, wraps Write + * + * @throws FgaInvalidParameterException When the Store ID is null, empty, or whitespace + */ + public CompletableFuture writeTuples( + List tupleKeys, ClientWriteTuplesOptions options) throws FgaInvalidParameterException { configuration.assertValid(); String storeId = configuration.getStoreIdChecked(); @@ -371,7 +470,9 @@ public CompletableFuture writeTuples(List t body.authorizationModelId(authorizationModelId); } - return call(() -> api.write(storeId, body)).thenApply(ClientWriteResponse::new); + var overrides = new ConfigurationOverride().addHeaders(options); + + return call(() -> api.write(storeId, body, overrides)).thenApply(ClientWriteResponse::new); } /** @@ -381,6 +482,17 @@ public CompletableFuture writeTuples(List t */ public CompletableFuture deleteTuples(List tupleKeys) throws FgaInvalidParameterException { + return deleteTuples(tupleKeys, null); + } + + /** + * DeleteTuples - Utility method to delete tuples, wraps Write + * + * @throws FgaInvalidParameterException When the Store ID is null, empty, or whitespace + */ + public CompletableFuture deleteTuples( + List tupleKeys, ClientDeleteTuplesOptions options) + throws FgaInvalidParameterException { configuration.assertValid(); String storeId = configuration.getStoreIdChecked(); @@ -393,7 +505,9 @@ public CompletableFuture deleteTuples(List api.write(storeId, body)).thenApply(ClientWriteResponse::new); + var overrides = new ConfigurationOverride().addHeaders(options); + + return call(() -> api.write(storeId, body, overrides)).thenApply(ClientWriteResponse::new); } /* ********************** @@ -438,7 +552,19 @@ public CompletableFuture check(ClientCheckRequest request, body.authorizationModelId(authorizationModelId); } - return call(() -> api.check(storeId, body)).thenApply(ClientCheckResponse::new); + var overrides = new ConfigurationOverride().addHeaders(options); + + return call(() -> api.check(storeId, body, overrides)).thenApply(ClientCheckResponse::new); + } + + /** + * BatchCheck - Run a set of checks (evaluates) + * + * @throws FgaInvalidParameterException When the Store ID is null, empty, or whitespace + */ + public CompletableFuture> batchCheck(List requests) + throws FgaInvalidParameterException { + return batchCheck(requests, null); } /** @@ -447,10 +573,21 @@ public CompletableFuture check(ClientCheckRequest request, * @throws FgaInvalidParameterException When the Store ID is null, empty, or whitespace */ public CompletableFuture> batchCheck( - List requests, ClientBatchCheckOptions options) throws FgaInvalidParameterException { + List requests, ClientBatchCheckOptions batchCheckOptions) + throws FgaInvalidParameterException { configuration.assertValid(); configuration.assertValidStoreId(); + var options = batchCheckOptions != null + ? batchCheckOptions + : new ClientBatchCheckOptions().maxParallelRequests(DEFAULT_MAX_METHOD_PARALLEL_REQS); + if (options.getAdditionalHeaders() == null) { + options.additionalHeaders(new HashMap<>()); + } + options.getAdditionalHeaders().putIfAbsent(CLIENT_METHOD_HEADER, "BatchCheck"); + options.getAdditionalHeaders() + .putIfAbsent(CLIENT_BULK_REQUEST_ID_HEADER, randomUUID().toString()); + int maxParallelRequests = options.getMaxParallelRequests() != null ? options.getMaxParallelRequests() : DEFAULT_MAX_METHOD_PARALLEL_REQS; @@ -510,7 +647,9 @@ public CompletableFuture expand(ClientExpandRequest reques body.authorizationModelId(authorizationModelId); } - return call(() -> api.expand(storeId, body)).thenApply(ClientExpandResponse::new); + var overrides = new ConfigurationOverride().addHeaders(options); + + return call(() -> api.expand(storeId, body, overrides)).thenApply(ClientExpandResponse::new); } /** @@ -551,20 +690,40 @@ public CompletableFuture listObjects( body.authorizationModelId(authorizationModelId); } - return call(() -> api.listObjects(storeId, body)).thenApply(ClientListObjectsResponse::new); + var overrides = new ConfigurationOverride().addHeaders(options); + + return call(() -> api.listObjects(storeId, body, overrides)).thenApply(ClientListObjectsResponse::new); + } + + /** + * ListRelations - List allowed relations a user has with an object (evaluates) + */ + public CompletableFuture listRelations(ClientListRelationsRequest request) + throws FgaInvalidParameterException { + return listRelations(request, null); } - /* + /** * ListRelations - List allowed relations a user has with an object (evaluates) */ public CompletableFuture listRelations( - ClientListRelationsRequest request, ClientListRelationsOptions options) + ClientListRelationsRequest request, ClientListRelationsOptions listRelationsOptions) throws FgaInvalidParameterException { if (request.getRelations() == null || request.getRelations().isEmpty()) { throw new FgaInvalidParameterException( "At least 1 relation to check has to be provided when calling ListRelations"); } + var options = listRelationsOptions != null + ? listRelationsOptions + : new ClientListRelationsOptions().maxParallelRequests(DEFAULT_MAX_METHOD_PARALLEL_REQS); + if (options.getAdditionalHeaders() == null) { + options.additionalHeaders(new HashMap<>()); + } + options.getAdditionalHeaders().putIfAbsent(CLIENT_METHOD_HEADER, "ListRelations"); + options.getAdditionalHeaders() + .putIfAbsent(CLIENT_BULK_REQUEST_ID_HEADER, randomUUID().toString()); + var batchCheckRequests = request.getRelations().stream() .map(relation -> new ClientCheckRequest() .user(request.getUser()) @@ -572,7 +731,7 @@ public CompletableFuture listRelations( ._object(request.getObject())) .collect(Collectors.toList()); - return batchCheck(batchCheckRequests, options.asClientBatchCheckOptions()) + return this.batchCheck(batchCheckRequests, options.asClientBatchCheckOptions()) .thenCompose(responses -> call(() -> ClientListRelationsResponse.fromBatchCheckResponses(responses))); } @@ -606,7 +765,9 @@ public CompletableFuture readAssertions(ClientRead authorizationModelId = configuration.getAuthorizationModelIdChecked(); } - return call(() -> api.readAssertions(storeId, authorizationModelId)) + var overrides = new ConfigurationOverride().addHeaders(options); + + return call(() -> api.readAssertions(storeId, authorizationModelId, overrides)) .thenApply(ClientReadAssertionsResponse::new); } @@ -640,7 +801,9 @@ public CompletableFuture writeAssertions( WriteAssertionsRequest body = new WriteAssertionsRequest().assertions(ClientAssertion.asAssertions(assertions)); - return call(() -> api.writeAssertions(storeId, authorizationModelId, body)) + var overrides = new ConfigurationOverride().addHeaders(options); + + return call(() -> api.writeAssertions(storeId, authorizationModelId, body, overrides)) .thenApply(ClientWriteAssertionsResponse::new); } diff --git a/src/main/java/dev/openfga/sdk/api/configuration/AdditionalHeadersSupplier.java b/src/main/java/dev/openfga/sdk/api/configuration/AdditionalHeadersSupplier.java new file mode 100644 index 0000000..c500d72 --- /dev/null +++ b/src/main/java/dev/openfga/sdk/api/configuration/AdditionalHeadersSupplier.java @@ -0,0 +1,19 @@ +/* + * 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.configuration; + +import java.util.Map; + +public interface AdditionalHeadersSupplier { + Map getAdditionalHeaders(); +} diff --git a/src/main/java/dev/openfga/sdk/api/configuration/ClientBatchCheckOptions.java b/src/main/java/dev/openfga/sdk/api/configuration/ClientBatchCheckOptions.java index abc4a80..5ba3f3d 100644 --- a/src/main/java/dev/openfga/sdk/api/configuration/ClientBatchCheckOptions.java +++ b/src/main/java/dev/openfga/sdk/api/configuration/ClientBatchCheckOptions.java @@ -12,10 +12,23 @@ package dev.openfga.sdk.api.configuration; -public class ClientBatchCheckOptions { +import java.util.Map; + +public class ClientBatchCheckOptions implements AdditionalHeadersSupplier { + private Map additionalHeaders; private Integer maxParallelRequests; private String authorizationModelId; + public ClientBatchCheckOptions additionalHeaders(Map additionalHeaders) { + this.additionalHeaders = additionalHeaders; + return this; + } + + @Override + public Map getAdditionalHeaders() { + return this.additionalHeaders; + } + public ClientBatchCheckOptions maxParallelRequests(Integer maxParallelRequests) { this.maxParallelRequests = maxParallelRequests; return this; @@ -35,6 +48,6 @@ public String getAuthorizationModelId() { } public ClientCheckOptions asClientCheckOptions() { - return new ClientCheckOptions().authorizationModelId(authorizationModelId); + return new ClientCheckOptions().additionalHeaders(additionalHeaders).authorizationModelId(authorizationModelId); } } diff --git a/src/main/java/dev/openfga/sdk/api/configuration/ClientCheckOptions.java b/src/main/java/dev/openfga/sdk/api/configuration/ClientCheckOptions.java index b69a4cf..1b0e374 100644 --- a/src/main/java/dev/openfga/sdk/api/configuration/ClientCheckOptions.java +++ b/src/main/java/dev/openfga/sdk/api/configuration/ClientCheckOptions.java @@ -12,9 +12,22 @@ package dev.openfga.sdk.api.configuration; -public class ClientCheckOptions { +import java.util.Map; + +public class ClientCheckOptions implements AdditionalHeadersSupplier { + private Map additionalHeaders; private String authorizationModelId; + public ClientCheckOptions additionalHeaders(Map additionalHeaders) { + this.additionalHeaders = additionalHeaders; + return this; + } + + @Override + public Map getAdditionalHeaders() { + return this.additionalHeaders; + } + public ClientCheckOptions authorizationModelId(String authorizationModelId) { this.authorizationModelId = authorizationModelId; return this; diff --git a/src/main/java/dev/openfga/sdk/api/configuration/ClientCreateStoreOptions.java b/src/main/java/dev/openfga/sdk/api/configuration/ClientCreateStoreOptions.java new file mode 100644 index 0000000..363ee22 --- /dev/null +++ b/src/main/java/dev/openfga/sdk/api/configuration/ClientCreateStoreOptions.java @@ -0,0 +1,29 @@ +/* + * 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.configuration; + +import java.util.Map; + +public class ClientCreateStoreOptions implements AdditionalHeadersSupplier { + private Map additionalHeaders; + + public ClientCreateStoreOptions additionalHeaders(Map additionalHeaders) { + this.additionalHeaders = additionalHeaders; + return this; + } + + @Override + public Map getAdditionalHeaders() { + return this.additionalHeaders; + } +} diff --git a/src/main/java/dev/openfga/sdk/api/configuration/ClientDeleteStoreOptions.java b/src/main/java/dev/openfga/sdk/api/configuration/ClientDeleteStoreOptions.java new file mode 100644 index 0000000..2776b6d --- /dev/null +++ b/src/main/java/dev/openfga/sdk/api/configuration/ClientDeleteStoreOptions.java @@ -0,0 +1,29 @@ +/* + * 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.configuration; + +import java.util.Map; + +public class ClientDeleteStoreOptions implements AdditionalHeadersSupplier { + private Map additionalHeaders; + + public ClientDeleteStoreOptions additionalHeaders(Map additionalHeaders) { + this.additionalHeaders = additionalHeaders; + return this; + } + + @Override + public Map getAdditionalHeaders() { + return this.additionalHeaders; + } +} diff --git a/src/main/java/dev/openfga/sdk/api/configuration/ClientDeleteTuplesOptions.java b/src/main/java/dev/openfga/sdk/api/configuration/ClientDeleteTuplesOptions.java new file mode 100644 index 0000000..de548cd --- /dev/null +++ b/src/main/java/dev/openfga/sdk/api/configuration/ClientDeleteTuplesOptions.java @@ -0,0 +1,29 @@ +/* + * 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.configuration; + +import java.util.Map; + +public class ClientDeleteTuplesOptions implements AdditionalHeadersSupplier { + private Map additionalHeaders; + + public ClientDeleteTuplesOptions additionalHeaders(Map additionalHeaders) { + this.additionalHeaders = additionalHeaders; + return this; + } + + @Override + public Map getAdditionalHeaders() { + return this.additionalHeaders; + } +} diff --git a/src/main/java/dev/openfga/sdk/api/configuration/ClientExpandOptions.java b/src/main/java/dev/openfga/sdk/api/configuration/ClientExpandOptions.java index 66dc5b5..5b3487d 100644 --- a/src/main/java/dev/openfga/sdk/api/configuration/ClientExpandOptions.java +++ b/src/main/java/dev/openfga/sdk/api/configuration/ClientExpandOptions.java @@ -12,9 +12,22 @@ package dev.openfga.sdk.api.configuration; -public class ClientExpandOptions { +import java.util.Map; + +public class ClientExpandOptions implements AdditionalHeadersSupplier { + private Map additionalHeaders; private String authorizationModelId; + public ClientExpandOptions additionalHeaders(Map additionalHeaders) { + this.additionalHeaders = additionalHeaders; + return this; + } + + @Override + public Map getAdditionalHeaders() { + return this.additionalHeaders; + } + public ClientExpandOptions authorizationModelId(String authorizationModelId) { this.authorizationModelId = authorizationModelId; return this; diff --git a/src/main/java/dev/openfga/sdk/api/configuration/ClientGetStoreOptions.java b/src/main/java/dev/openfga/sdk/api/configuration/ClientGetStoreOptions.java new file mode 100644 index 0000000..c8adf6e --- /dev/null +++ b/src/main/java/dev/openfga/sdk/api/configuration/ClientGetStoreOptions.java @@ -0,0 +1,29 @@ +/* + * 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.configuration; + +import java.util.Map; + +public class ClientGetStoreOptions implements AdditionalHeadersSupplier { + private Map additionalHeaders; + + public ClientGetStoreOptions additionalHeaders(Map additionalHeaders) { + this.additionalHeaders = additionalHeaders; + return this; + } + + @Override + public Map getAdditionalHeaders() { + return this.additionalHeaders; + } +} diff --git a/src/main/java/dev/openfga/sdk/api/configuration/ClientListObjectsOptions.java b/src/main/java/dev/openfga/sdk/api/configuration/ClientListObjectsOptions.java index 67ba5f4..1d51072 100644 --- a/src/main/java/dev/openfga/sdk/api/configuration/ClientListObjectsOptions.java +++ b/src/main/java/dev/openfga/sdk/api/configuration/ClientListObjectsOptions.java @@ -12,9 +12,22 @@ package dev.openfga.sdk.api.configuration; -public class ClientListObjectsOptions { +import java.util.Map; + +public class ClientListObjectsOptions implements AdditionalHeadersSupplier { + private Map additionalHeaders; private String authorizationModelId; + public ClientListObjectsOptions additionalHeaders(Map additionalHeaders) { + this.additionalHeaders = additionalHeaders; + return this; + } + + @Override + public Map getAdditionalHeaders() { + return this.additionalHeaders; + } + public ClientListObjectsOptions authorizationModelId(String authorizationModelId) { this.authorizationModelId = authorizationModelId; return this; diff --git a/src/main/java/dev/openfga/sdk/api/configuration/ClientListRelationsOptions.java b/src/main/java/dev/openfga/sdk/api/configuration/ClientListRelationsOptions.java index 344379c..6d9cc2d 100644 --- a/src/main/java/dev/openfga/sdk/api/configuration/ClientListRelationsOptions.java +++ b/src/main/java/dev/openfga/sdk/api/configuration/ClientListRelationsOptions.java @@ -12,10 +12,23 @@ package dev.openfga.sdk.api.configuration; -public class ClientListRelationsOptions { +import java.util.Map; + +public class ClientListRelationsOptions implements AdditionalHeadersSupplier { + private Map additionalHeaders; private Integer maxParallelRequests; private String authorizationModelId; + public ClientListRelationsOptions additionalHeaders(Map additionalHeaders) { + this.additionalHeaders = additionalHeaders; + return this; + } + + @Override + public Map getAdditionalHeaders() { + return this.additionalHeaders; + } + public ClientListRelationsOptions maxParallelRequests(Integer maxParallelRequests) { this.maxParallelRequests = maxParallelRequests; return this; diff --git a/src/main/java/dev/openfga/sdk/api/configuration/ClientListStoresOptions.java b/src/main/java/dev/openfga/sdk/api/configuration/ClientListStoresOptions.java index 7ada22d..d427a53 100644 --- a/src/main/java/dev/openfga/sdk/api/configuration/ClientListStoresOptions.java +++ b/src/main/java/dev/openfga/sdk/api/configuration/ClientListStoresOptions.java @@ -12,10 +12,23 @@ package dev.openfga.sdk.api.configuration; -public class ClientListStoresOptions { +import java.util.Map; + +public class ClientListStoresOptions implements AdditionalHeadersSupplier { + private Map additionalHeaders; private Integer pageSize; private String continuationToken; + public ClientListStoresOptions additionalHeaders(Map additionalHeaders) { + this.additionalHeaders = additionalHeaders; + return this; + } + + @Override + public Map getAdditionalHeaders() { + return this.additionalHeaders; + } + public ClientListStoresOptions pageSize(Integer pageSize) { this.pageSize = pageSize; return this; diff --git a/src/main/java/dev/openfga/sdk/api/configuration/ClientReadAssertionsOptions.java b/src/main/java/dev/openfga/sdk/api/configuration/ClientReadAssertionsOptions.java index f639b3f..c02ec03 100644 --- a/src/main/java/dev/openfga/sdk/api/configuration/ClientReadAssertionsOptions.java +++ b/src/main/java/dev/openfga/sdk/api/configuration/ClientReadAssertionsOptions.java @@ -15,10 +15,22 @@ import static dev.openfga.sdk.util.StringUtil.isNullOrWhitespace; import dev.openfga.sdk.errors.FgaInvalidParameterException; +import java.util.Map; -public class ClientReadAssertionsOptions { +public class ClientReadAssertionsOptions implements AdditionalHeadersSupplier { + private Map additionalHeaders; private String authorizationModelId; + public ClientReadAssertionsOptions additionalHeaders(Map additionalHeaders) { + this.additionalHeaders = additionalHeaders; + return this; + } + + @Override + public Map getAdditionalHeaders() { + return this.additionalHeaders; + } + public boolean hasValidAuthorizationModelId() throws FgaInvalidParameterException { return !isNullOrWhitespace(authorizationModelId); } diff --git a/src/main/java/dev/openfga/sdk/api/configuration/ClientReadAuthorizationModelOptions.java b/src/main/java/dev/openfga/sdk/api/configuration/ClientReadAuthorizationModelOptions.java index 478de20..e1716a9 100644 --- a/src/main/java/dev/openfga/sdk/api/configuration/ClientReadAuthorizationModelOptions.java +++ b/src/main/java/dev/openfga/sdk/api/configuration/ClientReadAuthorizationModelOptions.java @@ -15,10 +15,22 @@ import static dev.openfga.sdk.util.StringUtil.isNullOrWhitespace; import dev.openfga.sdk.errors.FgaInvalidParameterException; +import java.util.Map; -public class ClientReadAuthorizationModelOptions { +public class ClientReadAuthorizationModelOptions implements AdditionalHeadersSupplier { + private Map additionalHeaders; private String authorizationModelId; + public ClientReadAuthorizationModelOptions additionalHeaders(Map additionalHeaders) { + this.additionalHeaders = additionalHeaders; + return this; + } + + @Override + public Map getAdditionalHeaders() { + return this.additionalHeaders; + } + public void assertValidAuthorizationModelId() throws FgaInvalidParameterException { if (isNullOrWhitespace(authorizationModelId)) { throw new FgaInvalidParameterException("authorizationModelId", "ClientConfiguration"); diff --git a/src/main/java/dev/openfga/sdk/api/configuration/ClientReadAuthorizationModelsOptions.java b/src/main/java/dev/openfga/sdk/api/configuration/ClientReadAuthorizationModelsOptions.java index 2cf80bb..f4c81d6 100644 --- a/src/main/java/dev/openfga/sdk/api/configuration/ClientReadAuthorizationModelsOptions.java +++ b/src/main/java/dev/openfga/sdk/api/configuration/ClientReadAuthorizationModelsOptions.java @@ -12,10 +12,23 @@ package dev.openfga.sdk.api.configuration; -public class ClientReadAuthorizationModelsOptions { +import java.util.Map; + +public class ClientReadAuthorizationModelsOptions implements AdditionalHeadersSupplier { + private Map additionalHeaders; private Integer pageSize; private String continuationToken; + public ClientReadAuthorizationModelsOptions additionalHeaders(Map additionalHeaders) { + this.additionalHeaders = additionalHeaders; + return this; + } + + @Override + public Map getAdditionalHeaders() { + return this.additionalHeaders; + } + public ClientReadAuthorizationModelsOptions pageSize(Integer pageSize) { this.pageSize = pageSize; return this; diff --git a/src/main/java/dev/openfga/sdk/api/configuration/ClientReadChangesOptions.java b/src/main/java/dev/openfga/sdk/api/configuration/ClientReadChangesOptions.java index 612049c..2321386 100644 --- a/src/main/java/dev/openfga/sdk/api/configuration/ClientReadChangesOptions.java +++ b/src/main/java/dev/openfga/sdk/api/configuration/ClientReadChangesOptions.java @@ -12,18 +12,21 @@ package dev.openfga.sdk.api.configuration; -public class ClientReadChangesOptions { - private String type; +import java.util.Map; + +public class ClientReadChangesOptions implements AdditionalHeadersSupplier { + private Map additionalHeaders; private Integer pageSize; private String continuationToken; - public ClientReadChangesOptions type(String type) { - this.type = type; + public ClientReadChangesOptions additionalHeaders(Map additionalHeaders) { + this.additionalHeaders = additionalHeaders; return this; } - public String getType() { - return type; + @Override + public Map getAdditionalHeaders() { + return this.additionalHeaders; } public ClientReadChangesOptions pageSize(Integer pageSize) { diff --git a/src/main/java/dev/openfga/sdk/api/configuration/ClientReadLatestAuthorizationModelOptions.java b/src/main/java/dev/openfga/sdk/api/configuration/ClientReadLatestAuthorizationModelOptions.java new file mode 100644 index 0000000..2f96351 --- /dev/null +++ b/src/main/java/dev/openfga/sdk/api/configuration/ClientReadLatestAuthorizationModelOptions.java @@ -0,0 +1,29 @@ +/* + * 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.configuration; + +import java.util.Map; + +public class ClientReadLatestAuthorizationModelOptions implements AdditionalHeadersSupplier { + private Map additionalHeaders; + + public ClientReadLatestAuthorizationModelOptions additionalHeaders(Map additionalHeaders) { + this.additionalHeaders = additionalHeaders; + return this; + } + + @Override + public Map getAdditionalHeaders() { + return this.additionalHeaders; + } +} diff --git a/src/main/java/dev/openfga/sdk/api/configuration/ClientReadOptions.java b/src/main/java/dev/openfga/sdk/api/configuration/ClientReadOptions.java index c3a44b2..3daff2a 100644 --- a/src/main/java/dev/openfga/sdk/api/configuration/ClientReadOptions.java +++ b/src/main/java/dev/openfga/sdk/api/configuration/ClientReadOptions.java @@ -12,10 +12,23 @@ package dev.openfga.sdk.api.configuration; -public class ClientReadOptions { +import java.util.Map; + +public class ClientReadOptions implements AdditionalHeadersSupplier { + private Map additionalHeaders; private Integer pageSize; private String continuationToken; + public ClientReadOptions additionalHeaders(Map additionalHeaders) { + this.additionalHeaders = additionalHeaders; + return this; + } + + @Override + public Map getAdditionalHeaders() { + return this.additionalHeaders; + } + public ClientReadOptions pageSize(Integer pageSize) { this.pageSize = pageSize; return this; diff --git a/src/main/java/dev/openfga/sdk/api/configuration/ClientWriteAssertionsOptions.java b/src/main/java/dev/openfga/sdk/api/configuration/ClientWriteAssertionsOptions.java index 1755e20..ac88c7f 100644 --- a/src/main/java/dev/openfga/sdk/api/configuration/ClientWriteAssertionsOptions.java +++ b/src/main/java/dev/openfga/sdk/api/configuration/ClientWriteAssertionsOptions.java @@ -15,10 +15,22 @@ import static dev.openfga.sdk.util.StringUtil.isNullOrWhitespace; import dev.openfga.sdk.errors.FgaInvalidParameterException; +import java.util.Map; -public class ClientWriteAssertionsOptions { +public class ClientWriteAssertionsOptions implements AdditionalHeadersSupplier { + private Map additionalHeaders; private String authorizationModelId; + public ClientWriteAssertionsOptions additionalHeaders(Map additionalHeaders) { + this.additionalHeaders = additionalHeaders; + return this; + } + + @Override + public Map getAdditionalHeaders() { + return this.additionalHeaders; + } + public boolean hasValidAuthorizationModelId() throws FgaInvalidParameterException { return !isNullOrWhitespace(authorizationModelId); } diff --git a/src/main/java/dev/openfga/sdk/api/configuration/ClientWriteAuthorizationModelOptions.java b/src/main/java/dev/openfga/sdk/api/configuration/ClientWriteAuthorizationModelOptions.java new file mode 100644 index 0000000..a6b56f9 --- /dev/null +++ b/src/main/java/dev/openfga/sdk/api/configuration/ClientWriteAuthorizationModelOptions.java @@ -0,0 +1,29 @@ +/* + * 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.configuration; + +import java.util.Map; + +public class ClientWriteAuthorizationModelOptions implements AdditionalHeadersSupplier { + private Map additionalHeaders; + + public ClientWriteAuthorizationModelOptions additionalHeaders(Map additionalHeaders) { + this.additionalHeaders = additionalHeaders; + return this; + } + + @Override + public Map getAdditionalHeaders() { + return this.additionalHeaders; + } +} diff --git a/src/main/java/dev/openfga/sdk/api/configuration/ClientWriteOptions.java b/src/main/java/dev/openfga/sdk/api/configuration/ClientWriteOptions.java index fde80af..c18634b 100644 --- a/src/main/java/dev/openfga/sdk/api/configuration/ClientWriteOptions.java +++ b/src/main/java/dev/openfga/sdk/api/configuration/ClientWriteOptions.java @@ -12,11 +12,24 @@ package dev.openfga.sdk.api.configuration; -public class ClientWriteOptions { +import java.util.Map; + +public class ClientWriteOptions implements AdditionalHeadersSupplier { + private Map additionalHeaders; private String authorizationModelId; private Boolean disableTransactions = false; private int transactionChunkSize; + public ClientWriteOptions additionalHeaders(Map additionalHeaders) { + this.additionalHeaders = additionalHeaders; + return this; + } + + @Override + public Map getAdditionalHeaders() { + return this.additionalHeaders; + } + public ClientWriteOptions authorizationModelId(String authorizationModelId) { this.authorizationModelId = authorizationModelId; return this; diff --git a/src/main/java/dev/openfga/sdk/api/configuration/ClientWriteTuplesOptions.java b/src/main/java/dev/openfga/sdk/api/configuration/ClientWriteTuplesOptions.java new file mode 100644 index 0000000..1dca679 --- /dev/null +++ b/src/main/java/dev/openfga/sdk/api/configuration/ClientWriteTuplesOptions.java @@ -0,0 +1,29 @@ +/* + * 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.configuration; + +import java.util.Map; + +public class ClientWriteTuplesOptions implements AdditionalHeadersSupplier { + private Map additionalHeaders; + + public ClientWriteTuplesOptions additionalHeaders(Map additionalHeaders) { + this.additionalHeaders = additionalHeaders; + return this; + } + + @Override + public Map getAdditionalHeaders() { + return this.additionalHeaders; + } +} diff --git a/src/main/java/dev/openfga/sdk/api/configuration/Configuration.java b/src/main/java/dev/openfga/sdk/api/configuration/Configuration.java index 1cb7058..3c2a820 100644 --- a/src/main/java/dev/openfga/sdk/api/configuration/Configuration.java +++ b/src/main/java/dev/openfga/sdk/api/configuration/Configuration.java @@ -22,6 +22,7 @@ import java.net.http.HttpConnectTimeoutException; import java.net.http.HttpRequest; import java.time.Duration; +import java.util.Map; /** * Configurations for an api client. @@ -41,6 +42,7 @@ public class Configuration implements BaseConfiguration { private Duration connectTimeout; private int maxRetries; private Duration minimumRetryDelay; + private Map additionalHeaders; public Configuration() { this.apiUrl = DEFAULT_API_URL; @@ -109,6 +111,15 @@ public Configuration override(ConfigurationOverride configurationOverride) { Duration overrideMinimumRetryDelay = configurationOverride.getMinimumRetryDelay(); result.minimumRetryDelay(overrideMinimumRetryDelay != null ? overrideMinimumRetryDelay : minimumRetryDelay); + Map overrideAdditionalHeaders = configurationOverride.getAdditionalHeaders(); + if (overrideAdditionalHeaders != null) { + if (this.additionalHeaders == null) { + this.additionalHeaders = overrideAdditionalHeaders; + } else { + this.additionalHeaders.putAll(overrideAdditionalHeaders); + } + } + return result; } @@ -259,4 +270,13 @@ public Configuration minimumRetryDelay(Duration minimumRetryDelay) { public Duration getMinimumRetryDelay() { return minimumRetryDelay; } + + public Configuration additionalHeaders(Map additionalHeaders) { + this.additionalHeaders = additionalHeaders; + return this; + } + + public Map getAdditionalHeaders() { + return this.additionalHeaders; + } } diff --git a/src/main/java/dev/openfga/sdk/api/configuration/ConfigurationOverride.java b/src/main/java/dev/openfga/sdk/api/configuration/ConfigurationOverride.java index 1d54a00..ba7e5ae 100644 --- a/src/main/java/dev/openfga/sdk/api/configuration/ConfigurationOverride.java +++ b/src/main/java/dev/openfga/sdk/api/configuration/ConfigurationOverride.java @@ -16,6 +16,7 @@ import java.net.http.HttpConnectTimeoutException; import java.net.http.HttpRequest; import java.time.Duration; +import java.util.Map; /** * Configuration overrides for an api client. Values are initialized to null, and any values unset are intended to fall @@ -31,6 +32,7 @@ public class ConfigurationOverride implements BaseConfiguration { private Duration connectTimeout; private Integer maxRetries; private Duration minimumRetryDelay; + private Map additionalHeaders; public ConfigurationOverride() { this.apiUrl = null; @@ -38,6 +40,7 @@ public ConfigurationOverride() { this.userAgent = null; this.readTimeout = null; this.connectTimeout = null; + this.additionalHeaders = null; } /** @@ -179,4 +182,28 @@ public ConfigurationOverride minimumRetryDelay(Duration minimumRetryDelay) { public Duration getMinimumRetryDelay() { return minimumRetryDelay; } + + public ConfigurationOverride additionalHeaders(Map additionalHeaders) { + this.additionalHeaders = additionalHeaders; + return this; + } + + public ConfigurationOverride addHeaders(AdditionalHeadersSupplier supplier) { + if (supplier == null || supplier.getAdditionalHeaders() == null) { + // No headers to add. + return this; + } + + var additionalHeaders = supplier.getAdditionalHeaders(); + if (this.additionalHeaders != null) { + this.additionalHeaders.putAll(additionalHeaders); + } else { + this.additionalHeaders = additionalHeaders; + } + return this; + } + + public Map getAdditionalHeaders() { + return this.additionalHeaders; + } } diff --git a/src/main/java/dev/openfga/sdk/api/model/AbortedMessageResponse.java b/src/main/java/dev/openfga/sdk/api/model/AbortedMessageResponse.java new file mode 100644 index 0000000..90527a9 --- /dev/null +++ b/src/main/java/dev/openfga/sdk/api/model/AbortedMessageResponse.java @@ -0,0 +1,176 @@ +/* + * 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.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; + +/** + * AbortedMessageResponse + */ +@JsonPropertyOrder({AbortedMessageResponse.JSON_PROPERTY_CODE, AbortedMessageResponse.JSON_PROPERTY_MESSAGE}) +public class AbortedMessageResponse { + public static final String JSON_PROPERTY_CODE = "code"; + private String code; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; + + public AbortedMessageResponse() {} + + public AbortedMessageResponse code(String code) { + this.code = code; + return this; + } + + /** + * Get code + * @return code + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCode() { + return code; + } + + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCode(String code) { + this.code = code; + } + + public AbortedMessageResponse message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(String message) { + this.message = message; + } + + /** + * Return true if this AbortedMessageResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbortedMessageResponse abortedMessageResponse = (AbortedMessageResponse) o; + return Objects.equals(this.code, abortedMessageResponse.code) + && Objects.equals(this.message, abortedMessageResponse.message); + } + + @Override + public int hashCode() { + return Objects.hash(code, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AbortedMessageResponse {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `code` to the URL query string + if (getCode() != null) { + joiner.add(String.format( + "%scode%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getCode()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add(String.format( + "%smessage%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getMessage()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} diff --git a/src/main/java/dev/openfga/sdk/api/model/NullValue.java b/src/main/java/dev/openfga/sdk/api/model/NullValue.java index d2718bf..d72381e 100644 --- a/src/main/java/dev/openfga/sdk/api/model/NullValue.java +++ b/src/main/java/dev/openfga/sdk/api/model/NullValue.java @@ -16,7 +16,7 @@ import com.fasterxml.jackson.annotation.JsonValue; /** - * `NullValue` is a singleton enumeration to represent the null value for the `Value` type union. The JSON representation for `NullValue` is JSON `null`. - NULL_VALUE: Null value. + * `NullValue` is a singleton enumeration to represent the null value for the `Value` type union. The JSON representation for `NullValue` is JSON `null`. - NULL_VALUE: Null value. */ public enum NullValue { NULL_VALUE("NULL_VALUE"), 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 a113a7d..b4f3bd3 100644 --- a/src/test/java/dev/openfga/sdk/api/client/OpenFgaClientTest.java +++ b/src/test/java/dev/openfga/sdk/api/client/OpenFgaClientTest.java @@ -25,11 +25,15 @@ import java.time.Duration; import java.util.List; import java.util.Map; +import java.util.UUID; import java.util.concurrent.ExecutionException; import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.IntStream; import java.util.stream.Stream; +import org.hamcrest.BaseMatcher; +import org.hamcrest.Description; +import org.hamcrest.Matcher; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -50,6 +54,8 @@ public class OpenFgaClientTest { new ClientRelationshipCondition().name("condition").context(Map.of("some", "context")); private static final int DEFAULT_MAX_RETRIES = 3; private static final Duration DEFAULT_RETRY_DELAY = Duration.ofMillis(100); + private static final String CLIENT_METHOD_HEADER = "X-OpenFGA-Client-Method"; + private static final String CLIENT_BULK_REQUEST_ID_HEADER = "X-OpenFGA-Client-Bulk-Request-Id"; private OpenFgaClient fga; private ClientConfiguration clientConfiguration; @@ -639,7 +645,7 @@ public void readChanges() throws Exception { String continuationToken = "eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ"; - ClientReadChangesOptions options = new ClientReadChangesOptions().type(changeType); + ClientReadChangesRequest request = new ClientReadChangesRequest().type(changeType); String getUrl = String.format("https://localhost/stores/%s/changes?type=%s", DEFAULT_STORE_ID, changeType); String responseBody = String.format( "{\"changes\":[{\"tuple_key\":{\"user\":\"%s\",\"relation\":\"%s\",\"object\":\"%s\"},\"operation\":\"TUPLE_OPERATION_WRITE\"}],\"continuation_token\":\"%s\"}", @@ -647,7 +653,7 @@ public void readChanges() throws Exception { mockHttpClient.onGet(getUrl).doReturn(200, responseBody); // When - ClientReadChangesResponse response = fga.readChanges(options).get(); + ClientReadChangesResponse response = fga.readChanges(request).get(); // Then mockHttpClient.verify().get(getUrl).called(1); @@ -1125,6 +1131,8 @@ public void writeTest_transactions() throws Exception { mockHttpClient .onPost(postPath) .withBody(isOneOf(write2Body, write1Body, delete2Body, delete1Body)) + .withHeader(CLIENT_METHOD_HEADER, "Write") + .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, isUUID()) .doReturn(200, EMPTY_RESPONSE_BODY); ClientWriteRequest request = new ClientWriteRequest() .writes(List.of(writeTuple, writeTuple, writeTuple, writeTuple, writeTuple)) @@ -1136,10 +1144,34 @@ public void writeTest_transactions() throws Exception { var response = fga.write(request, options).get(); // Then - mockHttpClient.verify().post(postPath).withBody(is(write2Body)).called(2); - mockHttpClient.verify().post(postPath).withBody(is(write1Body)).called(1); - mockHttpClient.verify().post(postPath).withBody(is(delete2Body)).called(2); - mockHttpClient.verify().post(postPath).withBody(is(delete1Body)).called(1); + mockHttpClient + .verify() + .post(postPath) + .withBody(is(write2Body)) + .withHeader(CLIENT_METHOD_HEADER, "Write") + .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, isUUID()) + .called(2); + mockHttpClient + .verify() + .post(postPath) + .withBody(is(write1Body)) + .withHeader(CLIENT_METHOD_HEADER, "Write") + .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, isUUID()) + .called(1); + mockHttpClient + .verify() + .post(postPath) + .withBody(is(delete2Body)) + .withHeader(CLIENT_METHOD_HEADER, "Write") + .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, isUUID()) + .called(2); + mockHttpClient + .verify() + .post(postPath) + .withBody(is(delete1Body)) + .withHeader(CLIENT_METHOD_HEADER, "Write") + .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, isUUID()) + .called(1); assertEquals(200, response.getStatusCode()); } @@ -1156,10 +1188,14 @@ public void writeTest_transactionsWithFailure() throws Exception { mockHttpClient .onPost(postPath) .withBody(isOneOf(writeBody.apply(firstUser), writeBody.apply(skippedUser))) + .withHeader(CLIENT_METHOD_HEADER, "Write") + .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, isUUID()) .doReturn(200, EMPTY_RESPONSE_BODY); mockHttpClient .onPost(postPath) .withBody(is(writeBody.apply(failedUser))) + .withHeader(CLIENT_METHOD_HEADER, "Write") + .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, isUUID()) .doReturn(400, "{\"code\":\"validation_error\",\"message\":\"Generic validation error\"}"); ClientWriteRequest request = new ClientWriteRequest() .writes(Stream.of(firstUser, failedUser, skippedUser) @@ -1181,16 +1217,22 @@ public void writeTest_transactionsWithFailure() throws Exception { .verify() .post(postPath) .withBody(is(writeBody.apply(firstUser))) + .withHeader(CLIENT_METHOD_HEADER, "Write") + .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, isUUID()) .called(1); mockHttpClient .verify() .post(postPath) .withBody(is(writeBody.apply(failedUser))) + .withHeader(CLIENT_METHOD_HEADER, "Write") + .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, isUUID()) .called(1); mockHttpClient .verify() .post(postPath) .withBody(is(writeBody.apply(skippedUser))) + .withHeader(CLIENT_METHOD_HEADER, "Write") + .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, isUUID()) .called(0); var exception = assertInstanceOf(FgaApiValidationError.class, execException.getCause()); assertEquals(400, exception.getStatusCode()); @@ -1538,7 +1580,12 @@ public void batchCheck() throws Exception { String expectedBody = String.format( "{\"tuple_key\":{\"user\":\"%s\",\"relation\":\"%s\",\"object\":\"%s\"},\"contextual_tuples\":null,\"authorization_model_id\":\"01G5JAVJ41T49E9TT3SKVS7X1J\",\"trace\":null,\"context\":null}", DEFAULT_USER, DEFAULT_RELATION, DEFAULT_OBJECT); - mockHttpClient.onPost(postUrl).withBody(is(expectedBody)).doReturn(200, "{\"allowed\":true}"); + mockHttpClient + .onPost(postUrl) + .withBody(is(expectedBody)) + .withHeader(CLIENT_METHOD_HEADER, "BatchCheck") + .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, isUUID()) + .doReturn(200, "{\"allowed\":true}"); ClientCheckRequest request = new ClientCheckRequest() ._object(DEFAULT_OBJECT) .relation(DEFAULT_RELATION) @@ -1550,7 +1597,13 @@ public void batchCheck() throws Exception { fga.batchCheck(List.of(request), options).get(); // Then - mockHttpClient.verify().post(postUrl).withBody(is(expectedBody)).called(1); + mockHttpClient + .verify() + .post(postUrl) + .withBody(is(expectedBody)) + .withHeader(CLIENT_METHOD_HEADER, "BatchCheck") + .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, isUUID()) + .called(1); assertEquals(Boolean.TRUE, response.get(0).getAllowed()); } @@ -1561,7 +1614,12 @@ public void batchCheck_twentyTimes() throws Exception { String expectedBody = String.format( "{\"tuple_key\":{\"user\":\"%s\",\"relation\":\"%s\",\"object\":\"%s\"},\"contextual_tuples\":null,\"authorization_model_id\":\"01G5JAVJ41T49E9TT3SKVS7X1J\",\"trace\":null,\"context\":null}", DEFAULT_USER, DEFAULT_RELATION, DEFAULT_OBJECT); - mockHttpClient.onPost(postUrl).withBody(is(expectedBody)).doReturn(200, "{\"allowed\":true}"); + mockHttpClient + .onPost(postUrl) + .withBody(is(expectedBody)) + .withHeader(CLIENT_METHOD_HEADER, "BatchCheck") + .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, isUUID()) + .doReturn(200, "{\"allowed\":true}"); List requests = IntStream.range(0, 20) .mapToObj(ignored -> new ClientCheckRequest() ._object(DEFAULT_OBJECT) @@ -1574,7 +1632,13 @@ public void batchCheck_twentyTimes() throws Exception { fga.batchCheck(requests, options).get(); // Then - mockHttpClient.verify().post(postUrl).withBody(is(expectedBody)).called(20); + mockHttpClient + .verify() + .post(postUrl) + .withBody(is(expectedBody)) + .withHeader(CLIENT_METHOD_HEADER, "BatchCheck") + .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, isUUID()) + .called(20); } @Test @@ -1898,7 +1962,12 @@ public void listRelations() throws Exception { String expectedBody = String.format( "{\"tuple_key\":{\"user\":\"%s\",\"relation\":\"%s\",\"object\":\"%s\"},\"contextual_tuples\":null,\"authorization_model_id\":\"01G5JAVJ41T49E9TT3SKVS7X1J\",\"trace\":null,\"context\":null}", DEFAULT_USER, DEFAULT_RELATION, DEFAULT_OBJECT); - mockHttpClient.onPost(postUrl).withBody(is(expectedBody)).doReturn(200, "{\"allowed\":true}"); + mockHttpClient + .onPost(postUrl) + .withBody(is(expectedBody)) + .withHeader(CLIENT_METHOD_HEADER, "BatchCheck") + .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, isUUID()) + .doReturn(200, "{\"allowed\":true}"); ClientListRelationsRequest request = new ClientListRelationsRequest() .relations(List.of(DEFAULT_RELATION)) .user(DEFAULT_USER) @@ -1911,7 +1980,13 @@ public void listRelations() throws Exception { fga.listRelations(request, options).get(); // Then - mockHttpClient.verify().post(postUrl).withBody(is(expectedBody)).called(1); + mockHttpClient + .verify() + .post(postUrl) + .withBody(is(expectedBody)) + .withHeader(CLIENT_METHOD_HEADER, "BatchCheck") + .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, isUUID()) + .called(1); assertNotNull(response); assertNotNull(response.getRelations()); assertEquals(1, response.getRelations().size()); @@ -1925,7 +2000,12 @@ public void listRelations_deny() throws Exception { String expectedBody = String.format( "{\"tuple_key\":{\"user\":\"%s\",\"relation\":\"%s\",\"object\":\"%s\"},\"contextual_tuples\":null,\"authorization_model_id\":\"%s\",\"trace\":null,\"context\":null}", DEFAULT_USER, "owner", DEFAULT_OBJECT, DEFAULT_AUTH_MODEL_ID); - mockHttpClient.onPost(postUrl).withBody(is(expectedBody)).doReturn(200, "{\"allowed\":false}"); + mockHttpClient + .onPost(postUrl) + .withBody(is(expectedBody)) + .withHeader(CLIENT_METHOD_HEADER, "BatchCheck") + .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, isUUID()) + .doReturn(200, "{\"allowed\":false}"); ClientListRelationsRequest request = new ClientListRelationsRequest() .relations(List.of("owner")) ._object(DEFAULT_OBJECT) @@ -1938,7 +2018,13 @@ public void listRelations_deny() throws Exception { fga.listRelations(request, options).get(); // Then - mockHttpClient.verify().post(postUrl).withBody(is(expectedBody)).called(1); + mockHttpClient + .verify() + .post(postUrl) + .withBody(is(expectedBody)) + .withHeader(CLIENT_METHOD_HEADER, "BatchCheck") + .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, isUUID()) + .called(1); assertNotNull(response); assertNotNull(response.getRelations()); assertTrue(response.getRelations().isEmpty()); @@ -2380,4 +2466,42 @@ public void setAuthorizationModelId() throws Exception { "OpenFgaClient.setAuthorizationModelId(String) is expected to persist its Authorization Model ID in its ClientConfiguration." + "If this behavior ever changes, it could be a subtle breaking change."); } + + private Matcher isUUID() { + return new UUIDMatcher(); + } + + private static class UUIDMatcher extends BaseMatcher { + private boolean wasNotString = false; + private boolean wasInvalidUUID = false; + + @Override + public void describeTo(Description description) {} + + @Override + public boolean matches(Object item) { + if (!(item instanceof String)) { + return wasNotString = false; + } + + var string = (String) item; + + try { + UUID.fromString(string); + return true; + } catch (IllegalArgumentException ex) { + wasInvalidUUID = true; + return false; + } + } + + @Override + public void describeMismatch(Object item, Description mismatchDescription) { + if (wasNotString) { + System.err.printf("Expected an instance of String but found class: %s\n", item.getClass()); + } else if (wasInvalidUUID) { + System.err.printf("Expected a valid UUID but found \"%s\"\n", item); + } + } + } } diff --git a/src/test/java/dev/openfga/sdk/api/model/AbortedMessageResponseTest.java b/src/test/java/dev/openfga/sdk/api/model/AbortedMessageResponseTest.java new file mode 100644 index 0000000..7058a78 --- /dev/null +++ b/src/test/java/dev/openfga/sdk/api/model/AbortedMessageResponseTest.java @@ -0,0 +1,46 @@ +/* + * 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.model; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for AbortedMessageResponse + */ +public class AbortedMessageResponseTest { + private final AbortedMessageResponse model = new AbortedMessageResponse(); + + /** + * Model tests for AbortedMessageResponse + */ + @Test + public void testAbortedMessageResponse() { + // TODO: test AbortedMessageResponse + } + + /** + * Test the property 'code' + */ + @Test + public void codeTest() { + // TODO: test code + } + + /** + * Test the property 'message' + */ + @Test + public void messageTest() { + // TODO: test message + } +} From 9fcdbf278975fc86e6a086657cb99f5b74b2a8e6 Mon Sep 17 00:00:00 2001 From: "J.R. Hill" Date: Tue, 12 Dec 2023 17:00:05 -0800 Subject: [PATCH 2/6] docs: Update README for header overrides --- README.md | 80 ++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 70 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 679e556..770d214 100644 --- a/README.md +++ b/README.md @@ -212,8 +212,11 @@ Get a paginated list of stores. [API Documentation](https://openfga.dev/api/service/docs/api#/Stores/ListStores) +> Passing `ClientListStoresOptions` is optional. All fields of `ClientListStoresOptions` are optional. + ```java var options = new ClientListStoresOptions() + .additionalHeaders(Map.of("Some-Http-Header", "Some value")) .pageSize(10) .continuationToken("..."); var stores = fgaClient.listStores(options); @@ -227,9 +230,12 @@ Initialize a store. [API Documentation](https://openfga.dev/api/service/docs/api#/Stores/CreateStore) +> Passing `ClientCreateStoreOptions` is optional. All fields of `ClientCreateStoreOptions` are optional. + ```java var request = new CreateStoreRequest().name("FGA Demo"); -var store = fgaClient.createStore(request).get(); +var options = new ClientCreateStoreOptions().additionalHeaders(Map.of("Some-Http-Header", "Some value")); +var store = fgaClient.createStore(request, options).get(); // store.getId() = "01FQH7V8BEG3GPQW93KTRFR8JB" @@ -249,8 +255,11 @@ Get information about the current store. > Requires a client initialized with a storeId +> Passing `ClientGetStoreOptions` is optional. All fields of `ClientGetStoreOptions` are optional. + ```java -var store = fgaClient.getStore().get(); +var options = new ClientGetStoreOptions().additionalHeaders(Map.of("Some-Http-Header", "Some value")); +var store = fgaClient.getStore(options).get(); // store = { "id": "01FQH7V8BEG3GPQW93KTRFR8JB", "name": "FGA Demo Store", "created_at": "2022-01-01T00:00:00.000Z", "updated_at": "2022-01-01T00:00:00.000Z" } ``` @@ -263,8 +272,11 @@ Delete a store. > Requires a client initialized with a storeId +> Passing `ClientDeleteStoreOptions` is optional. All fields of `ClientDeleteStoreOptions` are optional. + ```java -var store = fgaClient.deleteStore().get(); +var options = new ClientDeleteStoreOptions().additionalHeaders(Map.of("Some-Http-Header", "Some value")); +var store = fgaClient.deleteStore(options).get(); ``` #### Authorization Models @@ -275,8 +287,11 @@ Read all authorization models in the store. [API Documentation](https://openfga.dev/api/service#/Authorization%20Models/ReadAuthorizationModels) +> Passing `ClientReadAuthorizationModelsOptions` is optional. All fields of `ClientReadAuthorizationModelsOptions` are optional. + ```java var options = new ClientReadAuthorizationModelsOptions() + .additionalHeaders(Map.of("Some-Http-Header", "Some value")) .pageSize(10) .continuationToken("..."); var response = fgaClient.readAuthorizationModels(options).get(); @@ -298,6 +313,8 @@ Create a new authorization model. > You can use the OpenFGA [CLI](https://github.com/openfga/cli) or [Syntax Transformer](https://github.com/openfga/syntax-transformer) to convert between the OpenFGA DSL and the JSON authorization model. +> Passing `ClientWriteAuthorizationModelOptions` is optional. All fields of `ClientWriteAuthorizationModelOptions` are optional. + ```java var request = new WriteAuthorizationModelRequest() @@ -326,8 +343,9 @@ var request = new WriteAuthorizationModelRequest() )) ) )); +var options = new ClientWriteAuthorizationModelOptions().additionalHeaders(Map.of("Some-Http-Header", "Some value")); -var response = fgaClient.writeAuthorizationModel(request).get(); +var response = fgaClient.writeAuthorizationModel(request, options).get(); // response.getAuthorizationModelId() = "01GXSA8YR785C4FYS3C0RTG7B1" ``` @@ -338,8 +356,11 @@ Read a particular authorization model. [API Documentation](https://openfga.dev/api/service#/Authorization%20Models/ReadAuthorizationModel) +> Passing `ClientReadAuthorizationModelOptions` is optional. All fields of `ClientReadAuthorizationModelOptions` are optional. + ```java var options = new ClientReadAuthorizationModelOptions() + .additionalHeaders(Map.of("Some-Http-Header", "Some value")) // You can rely on the model id set in the configuration or override it for this specific request .authorizationModelId("01GXSA8YR785C4FYS3C0RTG7B1"); @@ -356,8 +377,11 @@ Reads the latest authorization model (note: this ignores the model id in configu [API Documentation](https://openfga.dev/api/service#/Authorization%20Models/ReadAuthorizationModel) +> Passing `ClientReadLatestAuthorizationModelOptions` is optional. All fields of `ClientReadLatestAuthorizationModelOptions` are optional. + ```java -var response = fgaClient.readLatestAuthorizationModel().get(); +var options = new ClientReadLatestAuthorizationModelOptions().additionalHeaders(Map.of("Some-Http-Header", "Some value")); +var response = fgaClient.readLatestAuthorizationModel(options).get(); // response.getAuthorizationModel().getId() = "01GXSA8YR785C4FYS3C0RTG7B1" // response.getAuthorizationModel().SchemaVersion() = "1.1" @@ -372,13 +396,16 @@ Reads the list of historical relationship tuple writes and deletes. [API Documentation](https://openfga.dev/api/service#/Relationship%20Tuples/ReadChanges) +> Passing `ClientReadChangesOptions` is optional. All fields of `ClientReadChangesOptions` are optional. + ```java +var request = new ClientReadChangesRequest().type("document"); var options = new ClientReadChangesOptions() - .type("document") + .additionalHeaders(Map.of("Some-Http-Header", "Some value")) .pageSize(10) .continuationToken("..."); -var response = fgaClient.readChanges(options).get(); +var response = fgaClient.readChanges(request, options).get(); // response.getContinuationToken() = ... // response.getChanges() = [ @@ -393,6 +420,8 @@ Reads the relationship tuples stored in the database. It does not evaluate nor e [API Documentation](https://openfga.dev/api/service#/Relationship%20Tuples/Read) +> Passing `ClientReadOptions` is optional. All fields of `ClientReadOptions` are optional. + ```java // Find if a relationship tuple stating that a certain user is a viewer of a certain document var request = new ClientReadRequest() @@ -419,6 +448,7 @@ var request = new ClientReadRequest() var request = new ClientReadRequest(); var options = new ClientReadOptions() + .additionalHeaders(Map.of("Some-Http-Header", "Some value")) .pageSize(10) .continuationToken("..."); @@ -434,6 +464,8 @@ Create and/or delete relationship tuples to update the system state. [API Documentation](https://openfga.dev/api/service#/Relationship%20Tuples/Write) +> Passing `ClientWriteOptions` is optional. All fields of `ClientWriteOptions` are optional. + ###### Transaction mode (default) By default, write runs in a transaction mode where any invalid operation (deleting a non-existing tuple, creating an existing tuple, one of the tuples was invalid) or a server error will fail the entire operation. @@ -457,9 +489,11 @@ var request = new ClientWriteRequest() ._object("document:roadmap") )); -// You can rely on the model id set in the configuration or override it for this specific request var options = new ClientWriteOptions() - .authorizationModelId("01GXSA8YR785C4FYS3C0RTG7B1"); + .additionalHeaders(Map.of("Some-Http-Header", "Some value")) + // You can rely on the model id set in the configuration or override it for this specific request + .authorizationModelId("01GXSA8YR785C4FYS3C0RTG7B1") + .disableTransactions(false); var response = fgaClient.write(request, options).get(); ``` @@ -470,6 +504,9 @@ Convenience `WriteTuples` and `DeleteTuples` methods are also available. The SDK will split the writes into separate requests and send them sequentially to avoid violating rate limits. +> Passing `ClientWriteOptions` with `.disableTransactions(true)` is required to use non-transaction mode. +> All other fields of `ClientWriteOptions` are optional. + ```java var request = new ClientWriteRequest() .writes(List.of( @@ -489,6 +526,7 @@ var request = new ClientWriteRequest() ._object("document:roadmap") )); var options = new ClientWriteOptions() + .additionalHeaders(Map.of("Some-Http-Header", "Some value")) // You can rely on the model id set in the configuration or override it for this specific request .authorizationModelId("01GXSA8YR785C4FYS3C0RTG7B1") .disableTransactions(true) @@ -505,12 +543,15 @@ Check if a user has a particular relation with an object. [API Documentation](https://openfga.dev/api/service#/Relationship%20Queries/Check) +> Passing `ClientCheckOptions` is optional. All fields of `ClientCheckOptions` are optional. + ```java var request = new ClientCheckRequest() .user("user:81684243-9356-4421-8fbf-a4f8d36aa31b") .relation("writer") ._object("document:roadmap"); var options = new ClientCheckOptions() + .additionalHeaders(Map.of("Some-Http-Header", "Some value")) // You can rely on the model id set in the configuration or override it for this specific request .authorizationModelId("01GXSA8YR785C4FYS3C0RTG7B1"); @@ -523,6 +564,8 @@ var response = fgaClient.check(request, options).get(); Run a set of [checks](#check). Batch Check will return `allowed: false` if it encounters an error, and will return the error in the body. If 429s or 5xxs are encountered, the underlying check will retry up to 15 times before giving up. +> Passing `ClientBatchCheckOptions` is optional. All fields of `ClientBatchCheckOptions` are optional. + ```java var request = List.of( new ClientCheckRequest() @@ -555,6 +598,7 @@ var request = List.of( ._object("document:roadmap") ); var options = new ClientBatchCheckOptions() + .additionalHeaders(Map.of("Some-Http-Header", "Some value")) // You can rely on the model id set in the configuration or override it for this specific request .authorizationModelId("01GXSA8YR785C4FYS3C0RTG7B1") .maxParallelRequests(5); // Max number of requests to issue in parallel, defaults to 10 @@ -611,11 +655,14 @@ Expands the relationships in userset tree format. [API Documentation](https://openfga.dev/api/service#/Relationship%20Queries/Expand) +> Passing `ClientExpandOptions` is optional. All fields of `ClientExpandOptions` are optional. + ```java var request = new ClientExpandRequest() .relation("viewer") ._object("document:roadmap"); -var options = new ClientCheckOptions() +var options = new ClientExpandOptions() + .additionalHeaders(Map.of("Some-Http-Header", "Some value")) // You can rely on the model id set in the configuration or override it for this specific request .authorizationModelId("01GXSA8YR785C4FYS3C0RTG7B1"); @@ -630,6 +677,8 @@ List the objects of a particular type a user has access to. [API Documentation](https://openfga.dev/api/service#/Relationship%20Queries/ListObjects) +> Passing `ClientListObjectsOptions` is optional. All fields of `ClientListObjectsOptions` are optional. + ```java var request = new ClientListObjectsRequest() .user("user:81684243-9356-4421-8fbf-a4f8d36aa31b") @@ -642,6 +691,7 @@ var request = new ClientListObjectsRequest() ._object("document:budget") )); var options = new ClientListObjectsOptions() + .additionalHeaders(Map.of("Some-Http-Header", "Some value")) // You can rely on the model id set in the configuration or override it for this specific request .authorizationModelId("01GXSA8YR785C4FYS3C0RTG7B1"); @@ -654,6 +704,8 @@ var response = fgaClient.listObjects(request, options).get(); List the relations a user has on an object. +> Passing `ClientListRelationsOptions` is optional. All fields of `ClientListRelationsOptions` are optional. + ```java var request = new ClientListRelationsRequest() .user("user:81684243-9356-4421-8fbf-a4f8d36aa31b") @@ -667,6 +719,7 @@ var request = new ClientListRelationsRequest() ) ); var options = new ClientListRelationsOptions() + .additionalHeaders(Map.of("Some-Http-Header", "Some value")) // When unspecified, defaults to 10 .maxParallelRequests() // You can rely on the model id set in the configuration or override it for this specific request @@ -685,8 +738,12 @@ Read assertions for a particular authorization model. [API Documentation](https://openfga.dev/api/service#/Assertions/Read%20Assertions) +> Passing `ClientReadAssertionsOptions` is optional. All fields of `ClientReadAssertionsOptions` are optional. + ```java var options = new ClientReadAssertionsOptions() + .additionalHeaders(Map.of("Some-Http-Header", "Some value")) + // You can rely on the model id set in the configuration or override it for this specific request .authorizationModelId("01GXSA8YR785C4FYS3C0RTG7B1"); var response = fgaClient.readAssertions(options).get(); ``` @@ -697,8 +754,11 @@ Update the assertions for a particular authorization model. [API Documentation](https://openfga.dev/api/service#/Assertions/Write%20Assertions) +> Passing `ClientWriteAssertionsOptions` is optional. All fields of `ClientWriteAssertionsOptions` are optional. + ```java var options = new ClientWriteAssertionsOptions() + .additionalHeaders(Map.of("Some-Http-Header", "Some value")) .authorizationModelId("01GXSA8YR785C4FYS3C0RTG7B1"); var assertions = List.of( new ClientAssertion() From cc3df4bd01f69a63064454c641ac11bc87493cae Mon Sep 17 00:00:00 2001 From: "J.R. Hill" Date: Wed, 13 Dec 2023 13:22:12 -0800 Subject: [PATCH 3/6] feat: add configurable apiTokenIssuer Co-authored-by: Yann D'Isanto --- .../openfga/sdk/api/auth/OAuth2Client.java | 45 ++++++-- .../sdk/api/auth/OAuth2ClientTest.java | 101 +++++++++++++----- 2 files changed, 110 insertions(+), 36 deletions(-) diff --git a/src/main/java/dev/openfga/sdk/api/auth/OAuth2Client.java b/src/main/java/dev/openfga/sdk/api/auth/OAuth2Client.java index 9b4aa5f..8e0ac92 100644 --- a/src/main/java/dev/openfga/sdk/api/auth/OAuth2Client.java +++ b/src/main/java/dev/openfga/sdk/api/auth/OAuth2Client.java @@ -17,16 +17,18 @@ import dev.openfga.sdk.errors.ApiException; import dev.openfga.sdk.errors.FgaInvalidParameterException; import java.io.IOException; +import java.net.URI; import java.net.http.HttpRequest; import java.time.Instant; import java.util.concurrent.CompletableFuture; public class OAuth2Client { + private static final String DEFAULT_API_TOKEN_ISSUER_PATH = "/oauth/token"; + private final ApiClient apiClient; - private final Credentials credentials; + private final String apiTokenIssuer; private final AccessToken token = new AccessToken(); private final CredentialsFlowRequest authRequest; - private final String apiTokenIssuer; /** * Initializes a new instance of the {@link OAuth2Client} class @@ -34,14 +36,14 @@ public class OAuth2Client { * @param configuration Configuration, including credentials, that can be used to retrieve an access tokens */ public OAuth2Client(Configuration configuration, ApiClient apiClient) throws FgaInvalidParameterException { - this.credentials = configuration.getCredentials(); + var clientCredentials = configuration.getCredentials().getClientCredentials(); this.apiClient = apiClient; - this.apiTokenIssuer = credentials.getClientCredentials().getApiTokenIssuer(); + this.apiTokenIssuer = buildApiTokenIssuer(clientCredentials.getApiTokenIssuer()); this.authRequest = new CredentialsFlowRequest(); - this.authRequest.setClientId(credentials.getClientCredentials().getClientId()); - this.authRequest.setClientSecret(credentials.getClientCredentials().getClientSecret()); - this.authRequest.setAudience(credentials.getClientCredentials().getApiAudience()); + this.authRequest.setClientId(clientCredentials.getClientId()); + this.authRequest.setClientSecret(clientCredentials.getClientSecret()); + this.authRequest.setAudience(clientCredentials.getApiAudience()); this.authRequest.setGrantType("client_credentials"); } @@ -72,10 +74,11 @@ private CompletableFuture exchangeToken() try { byte[] body = apiClient.getObjectMapper().writeValueAsBytes(authRequest); - Configuration config = new Configuration().apiUrl("https://" + apiTokenIssuer); + Configuration config = new Configuration().apiUrl(apiTokenIssuer); + + HttpRequest.Builder requestBuilder = ApiClient.requestBuilder("POST", "", body, config); - HttpRequest request = ApiClient.requestBuilder("POST", "/oauth/token", body, config) - .build(); + HttpRequest request = requestBuilder.build(); return new HttpRequestAttempt<>(request, "exchangeToken", CredentialsFlowResponse.class, apiClient, config) .attemptHttpRequest() @@ -84,4 +87,26 @@ private CompletableFuture exchangeToken() throw new ApiException(e); } } + + private static String buildApiTokenIssuer(String issuer) throws FgaInvalidParameterException { + URI uri; + try { + uri = URI.create(issuer); + } catch (IllegalArgumentException cause) { + throw new FgaInvalidParameterException("apiTokenIssuer", "ClientCredentials", cause); + } + + var scheme = uri.getScheme(); + if (scheme == null) { + uri = URI.create("https://" + issuer); + } else if (!"https".equals(scheme) && !"http".equals(scheme)) { + throw new FgaInvalidParameterException("scheme", "apiTokenIssuer"); + } + + if (uri.getPath().isEmpty() || uri.getPath().equals("/")) { + uri = URI.create(uri.getScheme() + "://" + uri.getAuthority() + DEFAULT_API_TOKEN_ISSUER_PATH); + } + + return uri.toString(); + } } diff --git a/src/test/java/dev/openfga/sdk/api/auth/OAuth2ClientTest.java b/src/test/java/dev/openfga/sdk/api/auth/OAuth2ClientTest.java index a894001..30c34e6 100644 --- a/src/test/java/dev/openfga/sdk/api/auth/OAuth2ClientTest.java +++ b/src/test/java/dev/openfga/sdk/api/auth/OAuth2ClientTest.java @@ -1,7 +1,7 @@ package dev.openfga.sdk.api.auth; import static org.hamcrest.Matchers.is; -import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -10,25 +10,91 @@ import dev.openfga.sdk.api.client.ApiClient; import dev.openfga.sdk.api.configuration.*; import dev.openfga.sdk.errors.FgaInvalidParameterException; -import org.junit.jupiter.api.BeforeEach; +import java.util.stream.Stream; import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; class OAuth2ClientTest { private static final String CLIENT_ID = "client"; private static final String CLIENT_SECRET = "secret"; private static final String AUDIENCE = "audience"; private static final String GRANT_TYPE = "client_credentials"; - private static final String API_TOKEN_ISSUER = "test.fga.dev"; - private static final String POST_URL = "https://" + API_TOKEN_ISSUER + "/oauth/token"; private static final String ACCESS_TOKEN = "0123456789"; private final ObjectMapper mapper = new ObjectMapper(); private HttpClientMock mockHttpClient; - private OAuth2Client oAuth2; + private static Stream apiTokenIssuers() { + return Stream.of( + Arguments.of("issuer.fga.example", "https://issuer.fga.example/oauth/token"), + Arguments.of("https://issuer.fga.example", "https://issuer.fga.example/oauth/token"), + Arguments.of("https://issuer.fga.example/", "https://issuer.fga.example/oauth/token"), + Arguments.of("https://issuer.fga.example:8080", "https://issuer.fga.example:8080/oauth/token"), + Arguments.of("https://issuer.fga.example:8080/", "https://issuer.fga.example:8080/oauth/token"), + Arguments.of("issuer.fga.example/some_endpoint", "https://issuer.fga.example/some_endpoint"), + Arguments.of("https://issuer.fga.example/some_endpoint", "https://issuer.fga.example/some_endpoint"), + Arguments.of( + "https://issuer.fga.example:8080/some_endpoint", + "https://issuer.fga.example:8080/some_endpoint")); + } - @BeforeEach - public void setup() throws FgaInvalidParameterException { + @ParameterizedTest + @MethodSource("apiTokenIssuers") + public void exchangeToken(String apiTokenIssuer, String tokenEndpointUrl) throws Exception { + // Given + OAuth2Client oAuth2 = newOAuth2Client(apiTokenIssuer); + String expectedPostBody = String.format( + "{\"client_id\":\"%s\",\"client_secret\":\"%s\",\"audience\":\"%s\",\"grant_type\":\"%s\"}", + CLIENT_ID, CLIENT_SECRET, AUDIENCE, GRANT_TYPE); + String responseBody = String.format("{\"access_token\":\"%s\"}", ACCESS_TOKEN); + mockHttpClient.onPost(tokenEndpointUrl).withBody(is(expectedPostBody)).doReturn(200, responseBody); + + // When + String result = oAuth2.getAccessToken().get(); + + // Then + mockHttpClient + .verify() + .post(tokenEndpointUrl) + .withBody(is(expectedPostBody)) + .called(); + assertEquals(ACCESS_TOKEN, result); + } + + @Test + public void apiTokenIssuer_invalidScheme() { + // When + var exception = + assertThrows(FgaInvalidParameterException.class, () -> newOAuth2Client("ftp://issuer.fga.example")); + + // Then + assertEquals("Required parameter scheme was invalid when calling apiTokenIssuer.", exception.getMessage()); + } + + private static Stream invalidApiTokenIssuers() { + return Stream.of( + Arguments.of("://issuer.fga.example"), + Arguments.of("http://issuer.fga.example#bad#fragment"), + Arguments.of("http://issuer.fga.example/space in path"), + Arguments.of("http://")); + } + + @ParameterizedTest + @MethodSource("invalidApiTokenIssuers") + public void apiTokenIssuers_invalidURI(String invalidApiTokenIssuer) { + // When + var exception = assertThrows(FgaInvalidParameterException.class, () -> newOAuth2Client(invalidApiTokenIssuer)); + + // Then + assertEquals( + "Required parameter apiTokenIssuer was invalid when calling ClientCredentials.", + exception.getMessage()); + assertInstanceOf(IllegalArgumentException.class, exception.getCause()); + } + + private OAuth2Client newOAuth2Client(String apiTokenIssuer) throws FgaInvalidParameterException { System.setProperty("HttpRequestAttempt.debug-logging", "enable"); mockHttpClient = new HttpClientMock(); @@ -38,7 +104,7 @@ public void setup() throws FgaInvalidParameterException { .clientId(CLIENT_ID) .clientSecret(CLIENT_SECRET) .apiAudience(AUDIENCE) - .apiTokenIssuer(API_TOKEN_ISSUER)); + .apiTokenIssuer(apiTokenIssuer)); var configuration = new Configuration().apiUrl("").credentials(credentials); @@ -46,23 +112,6 @@ public void setup() throws FgaInvalidParameterException { when(apiClient.getHttpClient()).thenReturn(mockHttpClient); when(apiClient.getObjectMapper()).thenReturn(mapper); - oAuth2 = new OAuth2Client(configuration, apiClient); - } - - @Test - public void exchangeToken() throws Exception { - // Given - String expectedPostBody = String.format( - "{\"client_id\":\"%s\",\"client_secret\":\"%s\",\"audience\":\"%s\",\"grant_type\":\"%s\"}", - CLIENT_ID, CLIENT_SECRET, AUDIENCE, GRANT_TYPE); - String responseBody = String.format("{\"access_token\":\"%s\"}", ACCESS_TOKEN); - mockHttpClient.onPost(POST_URL).withBody(is(expectedPostBody)).doReturn(200, responseBody); - - // When - String result = oAuth2.getAccessToken().get(); - - // Then - mockHttpClient.verify().post(POST_URL).withBody(is(expectedPostBody)).called(); - assertEquals(ACCESS_TOKEN, result); + return new OAuth2Client(configuration, apiClient); } } From 23603940828703435405356892b57c14add3cfcb Mon Sep 17 00:00:00 2001 From: "J.R. Hill" Date: Wed, 13 Dec 2023 15:21:50 -0800 Subject: [PATCH 4/6] chore: updates based on PR feedback --- .../java/dev/openfga/sdk/api/OpenFgaApi.java | 126 +++++++++++++----- .../configuration/ClientConfiguration.java | 6 - .../sdk/api/configuration/Configuration.java | 39 ++++-- .../sdk/api/client/OpenFgaClientTest.java | 42 +++--- .../api/configuration/ConfigurationTest.java | 75 ++++++++++- 5 files changed, 216 insertions(+), 72 deletions(-) diff --git a/src/main/java/dev/openfga/sdk/api/OpenFgaApi.java b/src/main/java/dev/openfga/sdk/api/OpenFgaApi.java index 8b48705..3eaeb30 100644 --- a/src/main/java/dev/openfga/sdk/api/OpenFgaApi.java +++ b/src/main/java/dev/openfga/sdk/api/OpenFgaApi.java @@ -71,9 +71,9 @@ public OpenFgaApi(Configuration configuration, ApiClient apiClient) throws FgaIn this.oAuth2Client = null; } - var additionalHeaders = configuration.getAdditionalHeaders(); - if (additionalHeaders != null) { - apiClient.addRequestInterceptor(httpRequest -> additionalHeaders.forEach(httpRequest::setHeader)); + var defaultHeaders = configuration.getDefaultHeaders(); + if (defaultHeaders != null) { + apiClient.addRequestInterceptor(httpRequest -> defaultHeaders.forEach(httpRequest::setHeader)); } } @@ -146,8 +146,12 @@ private HttpRequest.Builder checkRequestBuilder(String storeId, CheckRequest bod localVarRequestBuilder.header("Authorization", "Bearer " + accessToken); } - if (configuration.getAdditionalHeaders() != null) { - configuration.getAdditionalHeaders().forEach(localVarRequestBuilder::header); + if (configuration.getUserAgent() != null) { + localVarRequestBuilder.header("User-Agent", configuration.getUserAgent()); + } + + if (configuration.getDefaultHeaders() != null) { + configuration.getDefaultHeaders().forEach(localVarRequestBuilder::header); } try { @@ -227,8 +231,12 @@ private HttpRequest.Builder createStoreRequestBuilder(CreateStoreRequest body, C localVarRequestBuilder.header("Authorization", "Bearer " + accessToken); } - if (configuration.getAdditionalHeaders() != null) { - configuration.getAdditionalHeaders().forEach(localVarRequestBuilder::header); + if (configuration.getUserAgent() != null) { + localVarRequestBuilder.header("User-Agent", configuration.getUserAgent()); + } + + if (configuration.getDefaultHeaders() != null) { + configuration.getDefaultHeaders().forEach(localVarRequestBuilder::header); } try { @@ -307,8 +315,12 @@ private HttpRequest.Builder deleteStoreRequestBuilder(String storeId, Configurat localVarRequestBuilder.header("Authorization", "Bearer " + accessToken); } - if (configuration.getAdditionalHeaders() != null) { - configuration.getAdditionalHeaders().forEach(localVarRequestBuilder::header); + if (configuration.getUserAgent() != null) { + localVarRequestBuilder.header("User-Agent", configuration.getUserAgent()); + } + + if (configuration.getDefaultHeaders() != null) { + configuration.getDefaultHeaders().forEach(localVarRequestBuilder::header); } localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); @@ -392,8 +404,12 @@ private HttpRequest.Builder expandRequestBuilder(String storeId, ExpandRequest b localVarRequestBuilder.header("Authorization", "Bearer " + accessToken); } - if (configuration.getAdditionalHeaders() != null) { - configuration.getAdditionalHeaders().forEach(localVarRequestBuilder::header); + if (configuration.getUserAgent() != null) { + localVarRequestBuilder.header("User-Agent", configuration.getUserAgent()); + } + + if (configuration.getDefaultHeaders() != null) { + configuration.getDefaultHeaders().forEach(localVarRequestBuilder::header); } try { @@ -472,8 +488,12 @@ private HttpRequest.Builder getStoreRequestBuilder(String storeId, Configuration localVarRequestBuilder.header("Authorization", "Bearer " + accessToken); } - if (configuration.getAdditionalHeaders() != null) { - configuration.getAdditionalHeaders().forEach(localVarRequestBuilder::header); + if (configuration.getUserAgent() != null) { + localVarRequestBuilder.header("User-Agent", configuration.getUserAgent()); + } + + if (configuration.getDefaultHeaders() != null) { + configuration.getDefaultHeaders().forEach(localVarRequestBuilder::header); } localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); @@ -558,8 +578,12 @@ private HttpRequest.Builder listObjectsRequestBuilder( localVarRequestBuilder.header("Authorization", "Bearer " + accessToken); } - if (configuration.getAdditionalHeaders() != null) { - configuration.getAdditionalHeaders().forEach(localVarRequestBuilder::header); + if (configuration.getUserAgent() != null) { + localVarRequestBuilder.header("User-Agent", configuration.getUserAgent()); + } + + if (configuration.getDefaultHeaders() != null) { + configuration.getDefaultHeaders().forEach(localVarRequestBuilder::header); } try { @@ -657,8 +681,12 @@ private HttpRequest.Builder listStoresRequestBuilder( localVarRequestBuilder.header("Authorization", "Bearer " + accessToken); } - if (configuration.getAdditionalHeaders() != null) { - configuration.getAdditionalHeaders().forEach(localVarRequestBuilder::header); + if (configuration.getUserAgent() != null) { + localVarRequestBuilder.header("User-Agent", configuration.getUserAgent()); + } + + if (configuration.getDefaultHeaders() != null) { + configuration.getDefaultHeaders().forEach(localVarRequestBuilder::header); } localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); @@ -741,8 +769,12 @@ private HttpRequest.Builder readRequestBuilder(String storeId, ReadRequest body, localVarRequestBuilder.header("Authorization", "Bearer " + accessToken); } - if (configuration.getAdditionalHeaders() != null) { - configuration.getAdditionalHeaders().forEach(localVarRequestBuilder::header); + if (configuration.getUserAgent() != null) { + localVarRequestBuilder.header("User-Agent", configuration.getUserAgent()); + } + + if (configuration.getDefaultHeaders() != null) { + configuration.getDefaultHeaders().forEach(localVarRequestBuilder::header); } try { @@ -834,8 +866,12 @@ private HttpRequest.Builder readAssertionsRequestBuilder( localVarRequestBuilder.header("Authorization", "Bearer " + accessToken); } - if (configuration.getAdditionalHeaders() != null) { - configuration.getAdditionalHeaders().forEach(localVarRequestBuilder::header); + if (configuration.getUserAgent() != null) { + localVarRequestBuilder.header("User-Agent", configuration.getUserAgent()); + } + + if (configuration.getDefaultHeaders() != null) { + configuration.getDefaultHeaders().forEach(localVarRequestBuilder::header); } localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); @@ -923,8 +959,12 @@ private HttpRequest.Builder readAuthorizationModelRequestBuilder( localVarRequestBuilder.header("Authorization", "Bearer " + accessToken); } - if (configuration.getAdditionalHeaders() != null) { - configuration.getAdditionalHeaders().forEach(localVarRequestBuilder::header); + if (configuration.getUserAgent() != null) { + localVarRequestBuilder.header("User-Agent", configuration.getUserAgent()); + } + + if (configuration.getDefaultHeaders() != null) { + configuration.getDefaultHeaders().forEach(localVarRequestBuilder::header); } localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); @@ -1033,8 +1073,12 @@ private HttpRequest.Builder readAuthorizationModelsRequestBuilder( localVarRequestBuilder.header("Authorization", "Bearer " + accessToken); } - if (configuration.getAdditionalHeaders() != null) { - configuration.getAdditionalHeaders().forEach(localVarRequestBuilder::header); + if (configuration.getUserAgent() != null) { + localVarRequestBuilder.header("User-Agent", configuration.getUserAgent()); + } + + if (configuration.getDefaultHeaders() != null) { + configuration.getDefaultHeaders().forEach(localVarRequestBuilder::header); } localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); @@ -1144,8 +1188,12 @@ private HttpRequest.Builder readChangesRequestBuilder( localVarRequestBuilder.header("Authorization", "Bearer " + accessToken); } - if (configuration.getAdditionalHeaders() != null) { - configuration.getAdditionalHeaders().forEach(localVarRequestBuilder::header); + if (configuration.getUserAgent() != null) { + localVarRequestBuilder.header("User-Agent", configuration.getUserAgent()); + } + + if (configuration.getDefaultHeaders() != null) { + configuration.getDefaultHeaders().forEach(localVarRequestBuilder::header); } localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); @@ -1227,8 +1275,12 @@ private HttpRequest.Builder writeRequestBuilder(String storeId, WriteRequest bod localVarRequestBuilder.header("Authorization", "Bearer " + accessToken); } - if (configuration.getAdditionalHeaders() != null) { - configuration.getAdditionalHeaders().forEach(localVarRequestBuilder::header); + if (configuration.getUserAgent() != null) { + localVarRequestBuilder.header("User-Agent", configuration.getUserAgent()); + } + + if (configuration.getDefaultHeaders() != null) { + configuration.getDefaultHeaders().forEach(localVarRequestBuilder::header); } try { @@ -1330,8 +1382,12 @@ private HttpRequest.Builder writeAssertionsRequestBuilder( localVarRequestBuilder.header("Authorization", "Bearer " + accessToken); } - if (configuration.getAdditionalHeaders() != null) { - configuration.getAdditionalHeaders().forEach(localVarRequestBuilder::header); + if (configuration.getUserAgent() != null) { + localVarRequestBuilder.header("User-Agent", configuration.getUserAgent()); + } + + if (configuration.getDefaultHeaders() != null) { + configuration.getDefaultHeaders().forEach(localVarRequestBuilder::header); } try { @@ -1427,8 +1483,12 @@ private HttpRequest.Builder writeAuthorizationModelRequestBuilder( localVarRequestBuilder.header("Authorization", "Bearer " + accessToken); } - if (configuration.getAdditionalHeaders() != null) { - configuration.getAdditionalHeaders().forEach(localVarRequestBuilder::header); + if (configuration.getUserAgent() != null) { + localVarRequestBuilder.header("User-Agent", configuration.getUserAgent()); + } + + if (configuration.getDefaultHeaders() != null) { + configuration.getDefaultHeaders().forEach(localVarRequestBuilder::header); } try { diff --git a/src/main/java/dev/openfga/sdk/api/configuration/ClientConfiguration.java b/src/main/java/dev/openfga/sdk/api/configuration/ClientConfiguration.java index 3d10d0f..bff4655 100644 --- a/src/main/java/dev/openfga/sdk/api/configuration/ClientConfiguration.java +++ b/src/main/java/dev/openfga/sdk/api/configuration/ClientConfiguration.java @@ -97,12 +97,6 @@ public String getAuthorizationModelIdChecked() throws FgaInvalidParameterExcepti /* Overrides beyond this point required for typing. */ - @Override - public ClientConfiguration override(ConfigurationOverride configurationOverride) { - super.override(configurationOverride); - return this; - } - @Override public ClientConfiguration apiUrl(String apiUrl) { super.apiUrl(apiUrl); diff --git a/src/main/java/dev/openfga/sdk/api/configuration/Configuration.java b/src/main/java/dev/openfga/sdk/api/configuration/Configuration.java index 3c2a820..040df1f 100644 --- a/src/main/java/dev/openfga/sdk/api/configuration/Configuration.java +++ b/src/main/java/dev/openfga/sdk/api/configuration/Configuration.java @@ -22,6 +22,7 @@ import java.net.http.HttpConnectTimeoutException; import java.net.http.HttpRequest; import java.time.Duration; +import java.util.HashMap; import java.util.Map; /** @@ -42,7 +43,7 @@ public class Configuration implements BaseConfiguration { private Duration connectTimeout; private int maxRetries; private Duration minimumRetryDelay; - private Map additionalHeaders; + private Map defaultHeaders; public Configuration() { this.apiUrl = DEFAULT_API_URL; @@ -111,14 +112,21 @@ public Configuration override(ConfigurationOverride configurationOverride) { Duration overrideMinimumRetryDelay = configurationOverride.getMinimumRetryDelay(); result.minimumRetryDelay(overrideMinimumRetryDelay != null ? overrideMinimumRetryDelay : minimumRetryDelay); - Map overrideAdditionalHeaders = configurationOverride.getAdditionalHeaders(); - if (overrideAdditionalHeaders != null) { - if (this.additionalHeaders == null) { - this.additionalHeaders = overrideAdditionalHeaders; - } else { - this.additionalHeaders.putAll(overrideAdditionalHeaders); - } + Map headers = new HashMap<>(); + if (defaultHeaders != null) { + headers.putAll(defaultHeaders); + } + Map additionalHeaders = configurationOverride.getAdditionalHeaders(); + if (additionalHeaders != null) { + additionalHeaders.forEach((header, value) -> { + if (value == null) { + headers.remove(header); + } else { + headers.put(header, value); + } + }); } + result.defaultHeaders(headers); return result; } @@ -151,6 +159,10 @@ public String getApiUrl() { /** * Set the user agent. * + *

Within the context of a single request, a "User-Agent" header from either + * {@link Configuration#defaultHeaders(Map)} or {@link ConfigurationOverride#additionalHeaders(Map)} + * will take precedence over this value.

+ * * @param userAgent The user agent. * @return This object. */ @@ -271,12 +283,15 @@ public Duration getMinimumRetryDelay() { return minimumRetryDelay; } - public Configuration additionalHeaders(Map additionalHeaders) { - this.additionalHeaders = additionalHeaders; + public Configuration defaultHeaders(Map defaultHeaders) { + this.defaultHeaders = defaultHeaders; return this; } - public Map getAdditionalHeaders() { - return this.additionalHeaders; + public Map getDefaultHeaders() { + if (this.defaultHeaders == null) { + this.defaultHeaders = Map.of(); + } + return this.defaultHeaders; } } 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 b4f3bd3..56083f0 100644 --- a/src/test/java/dev/openfga/sdk/api/client/OpenFgaClientTest.java +++ b/src/test/java/dev/openfga/sdk/api/client/OpenFgaClientTest.java @@ -1132,7 +1132,7 @@ public void writeTest_transactions() throws Exception { .onPost(postPath) .withBody(isOneOf(write2Body, write1Body, delete2Body, delete1Body)) .withHeader(CLIENT_METHOD_HEADER, "Write") - .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, isUUID()) + .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, anyValidUUID()) .doReturn(200, EMPTY_RESPONSE_BODY); ClientWriteRequest request = new ClientWriteRequest() .writes(List.of(writeTuple, writeTuple, writeTuple, writeTuple, writeTuple)) @@ -1149,28 +1149,28 @@ public void writeTest_transactions() throws Exception { .post(postPath) .withBody(is(write2Body)) .withHeader(CLIENT_METHOD_HEADER, "Write") - .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, isUUID()) + .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, anyValidUUID()) .called(2); mockHttpClient .verify() .post(postPath) .withBody(is(write1Body)) .withHeader(CLIENT_METHOD_HEADER, "Write") - .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, isUUID()) + .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, anyValidUUID()) .called(1); mockHttpClient .verify() .post(postPath) .withBody(is(delete2Body)) .withHeader(CLIENT_METHOD_HEADER, "Write") - .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, isUUID()) + .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, anyValidUUID()) .called(2); mockHttpClient .verify() .post(postPath) .withBody(is(delete1Body)) .withHeader(CLIENT_METHOD_HEADER, "Write") - .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, isUUID()) + .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, anyValidUUID()) .called(1); assertEquals(200, response.getStatusCode()); } @@ -1189,13 +1189,13 @@ public void writeTest_transactionsWithFailure() throws Exception { .onPost(postPath) .withBody(isOneOf(writeBody.apply(firstUser), writeBody.apply(skippedUser))) .withHeader(CLIENT_METHOD_HEADER, "Write") - .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, isUUID()) + .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, anyValidUUID()) .doReturn(200, EMPTY_RESPONSE_BODY); mockHttpClient .onPost(postPath) .withBody(is(writeBody.apply(failedUser))) .withHeader(CLIENT_METHOD_HEADER, "Write") - .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, isUUID()) + .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, anyValidUUID()) .doReturn(400, "{\"code\":\"validation_error\",\"message\":\"Generic validation error\"}"); ClientWriteRequest request = new ClientWriteRequest() .writes(Stream.of(firstUser, failedUser, skippedUser) @@ -1218,21 +1218,21 @@ public void writeTest_transactionsWithFailure() throws Exception { .post(postPath) .withBody(is(writeBody.apply(firstUser))) .withHeader(CLIENT_METHOD_HEADER, "Write") - .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, isUUID()) + .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, anyValidUUID()) .called(1); mockHttpClient .verify() .post(postPath) .withBody(is(writeBody.apply(failedUser))) .withHeader(CLIENT_METHOD_HEADER, "Write") - .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, isUUID()) + .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, anyValidUUID()) .called(1); mockHttpClient .verify() .post(postPath) .withBody(is(writeBody.apply(skippedUser))) .withHeader(CLIENT_METHOD_HEADER, "Write") - .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, isUUID()) + .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, anyValidUUID()) .called(0); var exception = assertInstanceOf(FgaApiValidationError.class, execException.getCause()); assertEquals(400, exception.getStatusCode()); @@ -1584,7 +1584,7 @@ public void batchCheck() throws Exception { .onPost(postUrl) .withBody(is(expectedBody)) .withHeader(CLIENT_METHOD_HEADER, "BatchCheck") - .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, isUUID()) + .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, anyValidUUID()) .doReturn(200, "{\"allowed\":true}"); ClientCheckRequest request = new ClientCheckRequest() ._object(DEFAULT_OBJECT) @@ -1602,7 +1602,7 @@ public void batchCheck() throws Exception { .post(postUrl) .withBody(is(expectedBody)) .withHeader(CLIENT_METHOD_HEADER, "BatchCheck") - .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, isUUID()) + .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, anyValidUUID()) .called(1); assertEquals(Boolean.TRUE, response.get(0).getAllowed()); } @@ -1618,7 +1618,7 @@ public void batchCheck_twentyTimes() throws Exception { .onPost(postUrl) .withBody(is(expectedBody)) .withHeader(CLIENT_METHOD_HEADER, "BatchCheck") - .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, isUUID()) + .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, anyValidUUID()) .doReturn(200, "{\"allowed\":true}"); List requests = IntStream.range(0, 20) .mapToObj(ignored -> new ClientCheckRequest() @@ -1637,7 +1637,7 @@ public void batchCheck_twentyTimes() throws Exception { .post(postUrl) .withBody(is(expectedBody)) .withHeader(CLIENT_METHOD_HEADER, "BatchCheck") - .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, isUUID()) + .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, anyValidUUID()) .called(20); } @@ -1966,7 +1966,7 @@ public void listRelations() throws Exception { .onPost(postUrl) .withBody(is(expectedBody)) .withHeader(CLIENT_METHOD_HEADER, "BatchCheck") - .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, isUUID()) + .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, anyValidUUID()) .doReturn(200, "{\"allowed\":true}"); ClientListRelationsRequest request = new ClientListRelationsRequest() .relations(List.of(DEFAULT_RELATION)) @@ -1985,7 +1985,7 @@ public void listRelations() throws Exception { .post(postUrl) .withBody(is(expectedBody)) .withHeader(CLIENT_METHOD_HEADER, "BatchCheck") - .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, isUUID()) + .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, anyValidUUID()) .called(1); assertNotNull(response); assertNotNull(response.getRelations()); @@ -2004,7 +2004,7 @@ public void listRelations_deny() throws Exception { .onPost(postUrl) .withBody(is(expectedBody)) .withHeader(CLIENT_METHOD_HEADER, "BatchCheck") - .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, isUUID()) + .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, anyValidUUID()) .doReturn(200, "{\"allowed\":false}"); ClientListRelationsRequest request = new ClientListRelationsRequest() .relations(List.of("owner")) @@ -2023,7 +2023,7 @@ public void listRelations_deny() throws Exception { .post(postUrl) .withBody(is(expectedBody)) .withHeader(CLIENT_METHOD_HEADER, "BatchCheck") - .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, isUUID()) + .withHeader(CLIENT_BULK_REQUEST_ID_HEADER, anyValidUUID()) .called(1); assertNotNull(response); assertNotNull(response.getRelations()); @@ -2467,7 +2467,7 @@ public void setAuthorizationModelId() throws Exception { + "If this behavior ever changes, it could be a subtle breaking change."); } - private Matcher isUUID() { + private Matcher anyValidUUID() { return new UUIDMatcher(); } @@ -2476,7 +2476,9 @@ private static class UUIDMatcher extends BaseMatcher { private boolean wasInvalidUUID = false; @Override - public void describeTo(Description description) {} + public void describeTo(Description description) { + description.appendText("any valid UUID"); + } @Override public boolean matches(Object item) { diff --git a/src/test/java/dev/openfga/sdk/api/configuration/ConfigurationTest.java b/src/test/java/dev/openfga/sdk/api/configuration/ConfigurationTest.java index bbf09fa..9226713 100644 --- a/src/test/java/dev/openfga/sdk/api/configuration/ConfigurationTest.java +++ b/src/test/java/dev/openfga/sdk/api/configuration/ConfigurationTest.java @@ -16,6 +16,8 @@ import dev.openfga.sdk.errors.*; import java.time.Duration; +import java.util.HashMap; +import java.util.Map; import org.junit.jupiter.api.Test; class ConfigurationTest { @@ -23,6 +25,7 @@ class ConfigurationTest { private static final String DEFAULT_USER_AGENT = "openfga-sdk java/0.2.3"; private static final Duration DEFAULT_READ_TIMEOUT = Duration.ofSeconds(10); private static final Duration DEFAULT_CONNECT_TIMEOUT = Duration.ofSeconds(10); + private static final Map DEFAULT_HEADERS = Map.of(); @Test void apiUrl_nullDefaults() throws FgaInvalidParameterException { @@ -129,13 +132,83 @@ void defaults() { Configuration config = new Configuration(); // NOTE: Failures in this test indicate that default values in Configuration have changed. Changing - // the defaults of Configuration can be a suprising and breaking change for consumers. + // the defaults of Configuration can be a surprising and breaking change for consumers. // Then assertEquals(DEFAULT_API_URL, config.getApiUrl()); assertEquals(DEFAULT_USER_AGENT, config.getUserAgent()); assertEquals(DEFAULT_READ_TIMEOUT, config.getReadTimeout()); assertEquals(DEFAULT_CONNECT_TIMEOUT, config.getConnectTimeout()); + assertEquals(DEFAULT_HEADERS, config.getDefaultHeaders()); + } + + @Test + void override_addHeader() { + // Given + var originalHeaders = Map.of("Original-Header", "from original"); + var original = new Configuration().defaultHeaders(originalHeaders); + + var overrideHeaders = Map.of("Override-Header", "from override"); + var override = new ConfigurationOverride().additionalHeaders(overrideHeaders); + + // When + Configuration result = original.override(override); + + // Then + assertEquals("from original", result.getDefaultHeaders().get("Original-Header")); + assertEquals("from override", result.getDefaultHeaders().get("Override-Header")); + assertEquals( + 2, + result.getDefaultHeaders().size(), + "Resulting configuration should have one header from the original configuration and one header from the override."); + assertEquals(1, originalHeaders.size(), "Original headers should not be modified."); + assertEquals(1, overrideHeaders.size(), "Override headers should not be modified."); + } + + @Test + void override_overwriteHeader() { + // Given + var originalHeaders = Map.of("Header-To-Overwrite", "from original"); + var original = new Configuration().defaultHeaders(originalHeaders); + + var overrideHeaders = Map.of("Header-To-Overwrite", "from override"); + var override = new ConfigurationOverride().additionalHeaders(overrideHeaders); + + // When + Configuration result = original.override(override); + + // Then + assertEquals("from override", result.getDefaultHeaders().get("Header-To-Overwrite")); + + assertEquals( + "from original", + originalHeaders.get("Header-To-Overwrite"), + "Original headers should not be modified."); + assertEquals(1, result.getDefaultHeaders().size(), "Original headers should not be modified."); + assertEquals(1, originalHeaders.size(), "Original headers should not be modified."); + assertEquals(1, overrideHeaders.size(), "Override headers should not be modified."); + } + + @Test + void override_unsetHeader() { + // Given + var originalHeaders = Map.of("Header-To-Unset", "from original"); + var original = new Configuration().defaultHeaders(originalHeaders); + + Map overrideHeaders = new HashMap<>(); + overrideHeaders.put("Header-To-Unset", null); + var override = new ConfigurationOverride().additionalHeaders(overrideHeaders); + + // When + Configuration result = original.override(override); + + // Then + assertEquals(0, result.getDefaultHeaders().size()); + + assertEquals( + "from original", originalHeaders.get("Header-To-Unset"), "Original headers should not be modified."); + assertEquals(1, originalHeaders.size(), "Original headers should not be modified."); + assertEquals(1, overrideHeaders.size(), "Override headers should not be modified."); } @Test From 61c8ca32a3fbf56765a1812a84fce3c40b158196 Mon Sep 17 00:00:00 2001 From: "J.R. Hill" Date: Thu, 14 Dec 2023 10:13:44 -0800 Subject: [PATCH 5/6] chore: stop generating (unused) model tests --- .openapi-generator-ignore | 3 + .openapi-generator/FILES | 66 ---------------- .../api/model/AbortedMessageResponseTest.java | 46 ----------- .../dev/openfga/sdk/api/model/AnyTest.java | 38 --------- .../openfga/sdk/api/model/AssertionTest.java | 46 ----------- .../sdk/api/model/AssertionTupleKeyTest.java | 54 ------------- .../sdk/api/model/AuthorizationModelTest.java | 62 --------------- .../sdk/api/model/CheckRequestTest.java | 70 ----------------- .../api/model/CheckRequestTupleKeyTest.java | 54 ------------- .../sdk/api/model/CheckResponseTest.java | 46 ----------- .../openfga/sdk/api/model/ComputedTest.java | 38 --------- .../api/model/ConditionParamTypeRefTest.java | 46 ----------- .../openfga/sdk/api/model/ConditionTest.java | 54 ------------- .../api/model/ContextualTupleKeysTest.java | 38 --------- .../sdk/api/model/CreateStoreRequestTest.java | 38 --------- .../api/model/CreateStoreResponseTest.java | 62 --------------- .../openfga/sdk/api/model/DifferenceTest.java | 46 ----------- .../openfga/sdk/api/model/ErrorCodeTest.java | 28 ------- .../sdk/api/model/ExpandRequestTest.java | 46 ----------- .../api/model/ExpandRequestTupleKeyTest.java | 46 ----------- .../sdk/api/model/ExpandResponseTest.java | 38 --------- .../sdk/api/model/GetStoreResponseTest.java | 62 --------------- .../sdk/api/model/InternalErrorCodeTest.java | 28 ------- .../InternalErrorMessageResponseTest.java | 46 ----------- .../dev/openfga/sdk/api/model/LeafTest.java | 54 ------------- .../sdk/api/model/ListObjectsRequestTest.java | 78 ------------------- .../api/model/ListObjectsResponseTest.java | 38 --------- .../sdk/api/model/ListStoresResponseTest.java | 46 ----------- .../openfga/sdk/api/model/MetadataTest.java | 38 --------- .../dev/openfga/sdk/api/model/NodeTest.java | 70 ----------------- .../dev/openfga/sdk/api/model/NodesTest.java | 38 --------- .../sdk/api/model/NotFoundErrorCodeTest.java | 28 ------- .../openfga/sdk/api/model/NullValueTest.java | 28 ------- .../sdk/api/model/ObjectRelationTest.java | 46 ----------- .../PathUnknownErrorMessageResponseTest.java | 46 ----------- .../api/model/ReadAssertionsResponseTest.java | 46 ----------- .../ReadAuthorizationModelResponseTest.java | 38 --------- .../ReadAuthorizationModelsResponseTest.java | 46 ----------- .../api/model/ReadChangesResponseTest.java | 46 ----------- .../sdk/api/model/ReadRequestTest.java | 54 ------------- .../api/model/ReadRequestTupleKeyTest.java | 54 ------------- .../sdk/api/model/ReadResponseTest.java | 46 ----------- .../sdk/api/model/RelationMetadataTest.java | 38 --------- .../sdk/api/model/RelationReferenceTest.java | 62 --------------- .../api/model/RelationshipConditionTest.java | 46 ----------- .../dev/openfga/sdk/api/model/StatusTest.java | 54 ------------- .../dev/openfga/sdk/api/model/StoreTest.java | 70 ----------------- .../sdk/api/model/TupleChangeTest.java | 54 ------------- .../openfga/sdk/api/model/TupleKeyTest.java | 62 --------------- .../model/TupleKeyWithoutConditionTest.java | 54 ------------- .../sdk/api/model/TupleOperationTest.java | 28 ------- .../dev/openfga/sdk/api/model/TupleTest.java | 46 ----------- .../sdk/api/model/TupleToUsersetTest.java | 46 ----------- .../sdk/api/model/TypeDefinitionTest.java | 54 ------------- .../openfga/sdk/api/model/TypeNameTest.java | 28 ------- .../dev/openfga/sdk/api/model/UsersTest.java | 38 --------- .../openfga/sdk/api/model/UsersetTest.java | 78 ------------------- .../api/model/UsersetTreeDifferenceTest.java | 46 ----------- .../sdk/api/model/UsersetTreeTest.java | 38 --------- .../model/UsersetTreeTupleToUsersetTest.java | 46 ----------- .../openfga/sdk/api/model/UsersetsTest.java | 38 --------- .../ValidationErrorMessageResponseTest.java | 46 ----------- .../api/model/WriteAssertionsRequestTest.java | 38 --------- .../WriteAuthorizationModelRequestTest.java | 54 ------------- .../WriteAuthorizationModelResponseTest.java | 38 --------- .../api/model/WriteRequestDeletesTest.java | 38 --------- .../sdk/api/model/WriteRequestTest.java | 54 ------------- .../sdk/api/model/WriteRequestWritesTest.java | 38 --------- 68 files changed, 3 insertions(+), 3170 deletions(-) delete mode 100644 src/test/java/dev/openfga/sdk/api/model/AbortedMessageResponseTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/AnyTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/AssertionTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/AssertionTupleKeyTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/AuthorizationModelTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/CheckRequestTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/CheckRequestTupleKeyTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/CheckResponseTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/ComputedTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/ConditionParamTypeRefTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/ConditionTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/ContextualTupleKeysTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/CreateStoreRequestTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/CreateStoreResponseTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/DifferenceTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/ErrorCodeTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/ExpandRequestTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/ExpandRequestTupleKeyTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/ExpandResponseTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/GetStoreResponseTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/InternalErrorCodeTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/InternalErrorMessageResponseTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/LeafTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/ListObjectsRequestTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/ListObjectsResponseTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/ListStoresResponseTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/MetadataTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/NodeTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/NodesTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/NotFoundErrorCodeTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/NullValueTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/ObjectRelationTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/PathUnknownErrorMessageResponseTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/ReadAssertionsResponseTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/ReadAuthorizationModelResponseTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/ReadAuthorizationModelsResponseTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/ReadChangesResponseTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/ReadRequestTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/ReadRequestTupleKeyTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/ReadResponseTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/RelationMetadataTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/RelationReferenceTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/RelationshipConditionTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/StatusTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/StoreTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/TupleChangeTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/TupleKeyTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/TupleKeyWithoutConditionTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/TupleOperationTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/TupleTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/TupleToUsersetTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/TypeDefinitionTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/TypeNameTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/UsersTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/UsersetTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/UsersetTreeDifferenceTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/UsersetTreeTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/UsersetTreeTupleToUsersetTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/UsersetsTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/ValidationErrorMessageResponseTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/WriteAssertionsRequestTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/WriteAuthorizationModelRequestTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/WriteAuthorizationModelResponseTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/WriteRequestDeletesTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/WriteRequestTest.java delete mode 100644 src/test/java/dev/openfga/sdk/api/model/WriteRequestWritesTest.java diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore index e3549f0..787ce9e 100644 --- a/.openapi-generator-ignore +++ b/.openapi-generator-ignore @@ -14,3 +14,6 @@ pom.xml .github/workflows/maven.yml git_push.sh .travis.yml + +# Model tests intentionally ignored +**/test/**/model/* diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index edee303..f985e47 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -242,70 +242,4 @@ src/test/java/dev/openfga/sdk/api/auth/OAuth2ClientTest.java src/test/java/dev/openfga/sdk/api/client/OpenFgaClientTest.java src/test/java/dev/openfga/sdk/api/configuration/ClientCredentialsTest.java src/test/java/dev/openfga/sdk/api/configuration/ConfigurationTest.java -src/test/java/dev/openfga/sdk/api/model/AbortedMessageResponseTest.java -src/test/java/dev/openfga/sdk/api/model/AnyTest.java -src/test/java/dev/openfga/sdk/api/model/AssertionTest.java -src/test/java/dev/openfga/sdk/api/model/AssertionTupleKeyTest.java -src/test/java/dev/openfga/sdk/api/model/AuthorizationModelTest.java -src/test/java/dev/openfga/sdk/api/model/CheckRequestTest.java -src/test/java/dev/openfga/sdk/api/model/CheckRequestTupleKeyTest.java -src/test/java/dev/openfga/sdk/api/model/CheckResponseTest.java -src/test/java/dev/openfga/sdk/api/model/ComputedTest.java -src/test/java/dev/openfga/sdk/api/model/ConditionParamTypeRefTest.java -src/test/java/dev/openfga/sdk/api/model/ConditionTest.java -src/test/java/dev/openfga/sdk/api/model/ContextualTupleKeysTest.java -src/test/java/dev/openfga/sdk/api/model/CreateStoreRequestTest.java -src/test/java/dev/openfga/sdk/api/model/CreateStoreResponseTest.java -src/test/java/dev/openfga/sdk/api/model/DifferenceTest.java -src/test/java/dev/openfga/sdk/api/model/ErrorCodeTest.java -src/test/java/dev/openfga/sdk/api/model/ExpandRequestTest.java -src/test/java/dev/openfga/sdk/api/model/ExpandRequestTupleKeyTest.java -src/test/java/dev/openfga/sdk/api/model/ExpandResponseTest.java -src/test/java/dev/openfga/sdk/api/model/GetStoreResponseTest.java -src/test/java/dev/openfga/sdk/api/model/InternalErrorCodeTest.java -src/test/java/dev/openfga/sdk/api/model/InternalErrorMessageResponseTest.java -src/test/java/dev/openfga/sdk/api/model/LeafTest.java -src/test/java/dev/openfga/sdk/api/model/ListObjectsRequestTest.java -src/test/java/dev/openfga/sdk/api/model/ListObjectsResponseTest.java -src/test/java/dev/openfga/sdk/api/model/ListStoresResponseTest.java -src/test/java/dev/openfga/sdk/api/model/MetadataTest.java -src/test/java/dev/openfga/sdk/api/model/NodeTest.java -src/test/java/dev/openfga/sdk/api/model/NodesTest.java -src/test/java/dev/openfga/sdk/api/model/NotFoundErrorCodeTest.java -src/test/java/dev/openfga/sdk/api/model/NullValueTest.java -src/test/java/dev/openfga/sdk/api/model/ObjectRelationTest.java -src/test/java/dev/openfga/sdk/api/model/PathUnknownErrorMessageResponseTest.java -src/test/java/dev/openfga/sdk/api/model/ReadAssertionsResponseTest.java -src/test/java/dev/openfga/sdk/api/model/ReadAuthorizationModelResponseTest.java -src/test/java/dev/openfga/sdk/api/model/ReadAuthorizationModelsResponseTest.java -src/test/java/dev/openfga/sdk/api/model/ReadChangesResponseTest.java -src/test/java/dev/openfga/sdk/api/model/ReadRequestTest.java -src/test/java/dev/openfga/sdk/api/model/ReadRequestTupleKeyTest.java -src/test/java/dev/openfga/sdk/api/model/ReadResponseTest.java -src/test/java/dev/openfga/sdk/api/model/RelationMetadataTest.java -src/test/java/dev/openfga/sdk/api/model/RelationReferenceTest.java -src/test/java/dev/openfga/sdk/api/model/RelationshipConditionTest.java -src/test/java/dev/openfga/sdk/api/model/StatusTest.java -src/test/java/dev/openfga/sdk/api/model/StoreTest.java -src/test/java/dev/openfga/sdk/api/model/TupleChangeTest.java -src/test/java/dev/openfga/sdk/api/model/TupleKeyTest.java -src/test/java/dev/openfga/sdk/api/model/TupleKeyWithoutConditionTest.java -src/test/java/dev/openfga/sdk/api/model/TupleOperationTest.java -src/test/java/dev/openfga/sdk/api/model/TupleTest.java -src/test/java/dev/openfga/sdk/api/model/TupleToUsersetTest.java -src/test/java/dev/openfga/sdk/api/model/TypeDefinitionTest.java -src/test/java/dev/openfga/sdk/api/model/TypeNameTest.java -src/test/java/dev/openfga/sdk/api/model/UsersTest.java -src/test/java/dev/openfga/sdk/api/model/UsersetTest.java -src/test/java/dev/openfga/sdk/api/model/UsersetTreeDifferenceTest.java -src/test/java/dev/openfga/sdk/api/model/UsersetTreeTest.java -src/test/java/dev/openfga/sdk/api/model/UsersetTreeTupleToUsersetTest.java -src/test/java/dev/openfga/sdk/api/model/UsersetsTest.java -src/test/java/dev/openfga/sdk/api/model/ValidationErrorMessageResponseTest.java -src/test/java/dev/openfga/sdk/api/model/WriteAssertionsRequestTest.java -src/test/java/dev/openfga/sdk/api/model/WriteAuthorizationModelRequestTest.java -src/test/java/dev/openfga/sdk/api/model/WriteAuthorizationModelResponseTest.java -src/test/java/dev/openfga/sdk/api/model/WriteRequestDeletesTest.java -src/test/java/dev/openfga/sdk/api/model/WriteRequestTest.java -src/test/java/dev/openfga/sdk/api/model/WriteRequestWritesTest.java src/test/java/dev/openfga/sdk/util/StringUtilTest.java diff --git a/src/test/java/dev/openfga/sdk/api/model/AbortedMessageResponseTest.java b/src/test/java/dev/openfga/sdk/api/model/AbortedMessageResponseTest.java deleted file mode 100644 index 7058a78..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/AbortedMessageResponseTest.java +++ /dev/null @@ -1,46 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for AbortedMessageResponse - */ -public class AbortedMessageResponseTest { - private final AbortedMessageResponse model = new AbortedMessageResponse(); - - /** - * Model tests for AbortedMessageResponse - */ - @Test - public void testAbortedMessageResponse() { - // TODO: test AbortedMessageResponse - } - - /** - * Test the property 'code' - */ - @Test - public void codeTest() { - // TODO: test code - } - - /** - * Test the property 'message' - */ - @Test - public void messageTest() { - // TODO: test message - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/AnyTest.java b/src/test/java/dev/openfga/sdk/api/model/AnyTest.java deleted file mode 100644 index c01467f..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/AnyTest.java +++ /dev/null @@ -1,38 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for Any - */ -public class AnyTest { - private final Any model = new Any(); - - /** - * Model tests for Any - */ - @Test - public void testAny() { - // TODO: test Any - } - - /** - * Test the property 'atType' - */ - @Test - public void atTypeTest() { - // TODO: test atType - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/AssertionTest.java b/src/test/java/dev/openfga/sdk/api/model/AssertionTest.java deleted file mode 100644 index c2b1703..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/AssertionTest.java +++ /dev/null @@ -1,46 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for Assertion - */ -public class AssertionTest { - private final Assertion model = new Assertion(); - - /** - * Model tests for Assertion - */ - @Test - public void testAssertion() { - // TODO: test Assertion - } - - /** - * Test the property 'tupleKey' - */ - @Test - public void tupleKeyTest() { - // TODO: test tupleKey - } - - /** - * Test the property 'expectation' - */ - @Test - public void expectationTest() { - // TODO: test expectation - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/AssertionTupleKeyTest.java b/src/test/java/dev/openfga/sdk/api/model/AssertionTupleKeyTest.java deleted file mode 100644 index 1340c16..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/AssertionTupleKeyTest.java +++ /dev/null @@ -1,54 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for AssertionTupleKey - */ -public class AssertionTupleKeyTest { - private final AssertionTupleKey model = new AssertionTupleKey(); - - /** - * Model tests for AssertionTupleKey - */ - @Test - public void testAssertionTupleKey() { - // TODO: test AssertionTupleKey - } - - /** - * Test the property '_object' - */ - @Test - public void _objectTest() { - // TODO: test _object - } - - /** - * Test the property 'relation' - */ - @Test - public void relationTest() { - // TODO: test relation - } - - /** - * Test the property 'user' - */ - @Test - public void userTest() { - // TODO: test user - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/AuthorizationModelTest.java b/src/test/java/dev/openfga/sdk/api/model/AuthorizationModelTest.java deleted file mode 100644 index 5a53deb..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/AuthorizationModelTest.java +++ /dev/null @@ -1,62 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for AuthorizationModel - */ -public class AuthorizationModelTest { - private final AuthorizationModel model = new AuthorizationModel(); - - /** - * Model tests for AuthorizationModel - */ - @Test - public void testAuthorizationModel() { - // TODO: test AuthorizationModel - } - - /** - * Test the property 'id' - */ - @Test - public void idTest() { - // TODO: test id - } - - /** - * Test the property 'schemaVersion' - */ - @Test - public void schemaVersionTest() { - // TODO: test schemaVersion - } - - /** - * Test the property 'typeDefinitions' - */ - @Test - public void typeDefinitionsTest() { - // TODO: test typeDefinitions - } - - /** - * Test the property 'conditions' - */ - @Test - public void conditionsTest() { - // TODO: test conditions - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/CheckRequestTest.java b/src/test/java/dev/openfga/sdk/api/model/CheckRequestTest.java deleted file mode 100644 index 517a4da..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/CheckRequestTest.java +++ /dev/null @@ -1,70 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for CheckRequest - */ -public class CheckRequestTest { - private final CheckRequest model = new CheckRequest(); - - /** - * Model tests for CheckRequest - */ - @Test - public void testCheckRequest() { - // TODO: test CheckRequest - } - - /** - * Test the property 'tupleKey' - */ - @Test - public void tupleKeyTest() { - // TODO: test tupleKey - } - - /** - * Test the property 'contextualTuples' - */ - @Test - public void contextualTuplesTest() { - // TODO: test contextualTuples - } - - /** - * Test the property 'authorizationModelId' - */ - @Test - public void authorizationModelIdTest() { - // TODO: test authorizationModelId - } - - /** - * Test the property 'trace' - */ - @Test - public void traceTest() { - // TODO: test trace - } - - /** - * Test the property 'context' - */ - @Test - public void contextTest() { - // TODO: test context - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/CheckRequestTupleKeyTest.java b/src/test/java/dev/openfga/sdk/api/model/CheckRequestTupleKeyTest.java deleted file mode 100644 index 5b4274e..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/CheckRequestTupleKeyTest.java +++ /dev/null @@ -1,54 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for CheckRequestTupleKey - */ -public class CheckRequestTupleKeyTest { - private final CheckRequestTupleKey model = new CheckRequestTupleKey(); - - /** - * Model tests for CheckRequestTupleKey - */ - @Test - public void testCheckRequestTupleKey() { - // TODO: test CheckRequestTupleKey - } - - /** - * Test the property 'user' - */ - @Test - public void userTest() { - // TODO: test user - } - - /** - * Test the property 'relation' - */ - @Test - public void relationTest() { - // TODO: test relation - } - - /** - * Test the property '_object' - */ - @Test - public void _objectTest() { - // TODO: test _object - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/CheckResponseTest.java b/src/test/java/dev/openfga/sdk/api/model/CheckResponseTest.java deleted file mode 100644 index 4d02dfc..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/CheckResponseTest.java +++ /dev/null @@ -1,46 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for CheckResponse - */ -public class CheckResponseTest { - private final CheckResponse model = new CheckResponse(); - - /** - * Model tests for CheckResponse - */ - @Test - public void testCheckResponse() { - // TODO: test CheckResponse - } - - /** - * Test the property 'allowed' - */ - @Test - public void allowedTest() { - // TODO: test allowed - } - - /** - * Test the property 'resolution' - */ - @Test - public void resolutionTest() { - // TODO: test resolution - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/ComputedTest.java b/src/test/java/dev/openfga/sdk/api/model/ComputedTest.java deleted file mode 100644 index 2bc4d98..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/ComputedTest.java +++ /dev/null @@ -1,38 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for Computed - */ -public class ComputedTest { - private final Computed model = new Computed(); - - /** - * Model tests for Computed - */ - @Test - public void testComputed() { - // TODO: test Computed - } - - /** - * Test the property 'userset' - */ - @Test - public void usersetTest() { - // TODO: test userset - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/ConditionParamTypeRefTest.java b/src/test/java/dev/openfga/sdk/api/model/ConditionParamTypeRefTest.java deleted file mode 100644 index 12a9a7c..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/ConditionParamTypeRefTest.java +++ /dev/null @@ -1,46 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for ConditionParamTypeRef - */ -public class ConditionParamTypeRefTest { - private final ConditionParamTypeRef model = new ConditionParamTypeRef(); - - /** - * Model tests for ConditionParamTypeRef - */ - @Test - public void testConditionParamTypeRef() { - // TODO: test ConditionParamTypeRef - } - - /** - * Test the property 'typeName' - */ - @Test - public void typeNameTest() { - // TODO: test typeName - } - - /** - * Test the property 'genericTypes' - */ - @Test - public void genericTypesTest() { - // TODO: test genericTypes - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/ConditionTest.java b/src/test/java/dev/openfga/sdk/api/model/ConditionTest.java deleted file mode 100644 index 29a118e..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/ConditionTest.java +++ /dev/null @@ -1,54 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for Condition - */ -public class ConditionTest { - private final Condition model = new Condition(); - - /** - * Model tests for Condition - */ - @Test - public void testCondition() { - // TODO: test Condition - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'expression' - */ - @Test - public void expressionTest() { - // TODO: test expression - } - - /** - * Test the property 'parameters' - */ - @Test - public void parametersTest() { - // TODO: test parameters - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/ContextualTupleKeysTest.java b/src/test/java/dev/openfga/sdk/api/model/ContextualTupleKeysTest.java deleted file mode 100644 index 5b14e72..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/ContextualTupleKeysTest.java +++ /dev/null @@ -1,38 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for ContextualTupleKeys - */ -public class ContextualTupleKeysTest { - private final ContextualTupleKeys model = new ContextualTupleKeys(); - - /** - * Model tests for ContextualTupleKeys - */ - @Test - public void testContextualTupleKeys() { - // TODO: test ContextualTupleKeys - } - - /** - * Test the property 'tupleKeys' - */ - @Test - public void tupleKeysTest() { - // TODO: test tupleKeys - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/CreateStoreRequestTest.java b/src/test/java/dev/openfga/sdk/api/model/CreateStoreRequestTest.java deleted file mode 100644 index 4472a9b..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/CreateStoreRequestTest.java +++ /dev/null @@ -1,38 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for CreateStoreRequest - */ -public class CreateStoreRequestTest { - private final CreateStoreRequest model = new CreateStoreRequest(); - - /** - * Model tests for CreateStoreRequest - */ - @Test - public void testCreateStoreRequest() { - // TODO: test CreateStoreRequest - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/CreateStoreResponseTest.java b/src/test/java/dev/openfga/sdk/api/model/CreateStoreResponseTest.java deleted file mode 100644 index 143a3cd..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/CreateStoreResponseTest.java +++ /dev/null @@ -1,62 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for CreateStoreResponse - */ -public class CreateStoreResponseTest { - private final CreateStoreResponse model = new CreateStoreResponse(); - - /** - * Model tests for CreateStoreResponse - */ - @Test - public void testCreateStoreResponse() { - // TODO: test CreateStoreResponse - } - - /** - * Test the property 'id' - */ - @Test - public void idTest() { - // TODO: test id - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'createdAt' - */ - @Test - public void createdAtTest() { - // TODO: test createdAt - } - - /** - * Test the property 'updatedAt' - */ - @Test - public void updatedAtTest() { - // TODO: test updatedAt - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/DifferenceTest.java b/src/test/java/dev/openfga/sdk/api/model/DifferenceTest.java deleted file mode 100644 index ca28ecd..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/DifferenceTest.java +++ /dev/null @@ -1,46 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for Difference - */ -public class DifferenceTest { - private final Difference model = new Difference(); - - /** - * Model tests for Difference - */ - @Test - public void testDifference() { - // TODO: test Difference - } - - /** - * Test the property 'base' - */ - @Test - public void baseTest() { - // TODO: test base - } - - /** - * Test the property 'subtract' - */ - @Test - public void subtractTest() { - // TODO: test subtract - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/ErrorCodeTest.java b/src/test/java/dev/openfga/sdk/api/model/ErrorCodeTest.java deleted file mode 100644 index 56d0cde..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/ErrorCodeTest.java +++ /dev/null @@ -1,28 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for ErrorCode - */ -public class ErrorCodeTest { - /** - * Model tests for ErrorCode - */ - @Test - public void testErrorCode() { - // TODO: test ErrorCode - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/ExpandRequestTest.java b/src/test/java/dev/openfga/sdk/api/model/ExpandRequestTest.java deleted file mode 100644 index 127a496..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/ExpandRequestTest.java +++ /dev/null @@ -1,46 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for ExpandRequest - */ -public class ExpandRequestTest { - private final ExpandRequest model = new ExpandRequest(); - - /** - * Model tests for ExpandRequest - */ - @Test - public void testExpandRequest() { - // TODO: test ExpandRequest - } - - /** - * Test the property 'tupleKey' - */ - @Test - public void tupleKeyTest() { - // TODO: test tupleKey - } - - /** - * Test the property 'authorizationModelId' - */ - @Test - public void authorizationModelIdTest() { - // TODO: test authorizationModelId - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/ExpandRequestTupleKeyTest.java b/src/test/java/dev/openfga/sdk/api/model/ExpandRequestTupleKeyTest.java deleted file mode 100644 index 65ddfd7..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/ExpandRequestTupleKeyTest.java +++ /dev/null @@ -1,46 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for ExpandRequestTupleKey - */ -public class ExpandRequestTupleKeyTest { - private final ExpandRequestTupleKey model = new ExpandRequestTupleKey(); - - /** - * Model tests for ExpandRequestTupleKey - */ - @Test - public void testExpandRequestTupleKey() { - // TODO: test ExpandRequestTupleKey - } - - /** - * Test the property 'relation' - */ - @Test - public void relationTest() { - // TODO: test relation - } - - /** - * Test the property '_object' - */ - @Test - public void _objectTest() { - // TODO: test _object - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/ExpandResponseTest.java b/src/test/java/dev/openfga/sdk/api/model/ExpandResponseTest.java deleted file mode 100644 index 24eeb39..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/ExpandResponseTest.java +++ /dev/null @@ -1,38 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for ExpandResponse - */ -public class ExpandResponseTest { - private final ExpandResponse model = new ExpandResponse(); - - /** - * Model tests for ExpandResponse - */ - @Test - public void testExpandResponse() { - // TODO: test ExpandResponse - } - - /** - * Test the property 'tree' - */ - @Test - public void treeTest() { - // TODO: test tree - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/GetStoreResponseTest.java b/src/test/java/dev/openfga/sdk/api/model/GetStoreResponseTest.java deleted file mode 100644 index aad87d4..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/GetStoreResponseTest.java +++ /dev/null @@ -1,62 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for GetStoreResponse - */ -public class GetStoreResponseTest { - private final GetStoreResponse model = new GetStoreResponse(); - - /** - * Model tests for GetStoreResponse - */ - @Test - public void testGetStoreResponse() { - // TODO: test GetStoreResponse - } - - /** - * Test the property 'id' - */ - @Test - public void idTest() { - // TODO: test id - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'createdAt' - */ - @Test - public void createdAtTest() { - // TODO: test createdAt - } - - /** - * Test the property 'updatedAt' - */ - @Test - public void updatedAtTest() { - // TODO: test updatedAt - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/InternalErrorCodeTest.java b/src/test/java/dev/openfga/sdk/api/model/InternalErrorCodeTest.java deleted file mode 100644 index 0a74ca7..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/InternalErrorCodeTest.java +++ /dev/null @@ -1,28 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for InternalErrorCode - */ -public class InternalErrorCodeTest { - /** - * Model tests for InternalErrorCode - */ - @Test - public void testInternalErrorCode() { - // TODO: test InternalErrorCode - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/InternalErrorMessageResponseTest.java b/src/test/java/dev/openfga/sdk/api/model/InternalErrorMessageResponseTest.java deleted file mode 100644 index a08a34d..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/InternalErrorMessageResponseTest.java +++ /dev/null @@ -1,46 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for InternalErrorMessageResponse - */ -public class InternalErrorMessageResponseTest { - private final InternalErrorMessageResponse model = new InternalErrorMessageResponse(); - - /** - * Model tests for InternalErrorMessageResponse - */ - @Test - public void testInternalErrorMessageResponse() { - // TODO: test InternalErrorMessageResponse - } - - /** - * Test the property 'code' - */ - @Test - public void codeTest() { - // TODO: test code - } - - /** - * Test the property 'message' - */ - @Test - public void messageTest() { - // TODO: test message - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/LeafTest.java b/src/test/java/dev/openfga/sdk/api/model/LeafTest.java deleted file mode 100644 index 5c2cb5c..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/LeafTest.java +++ /dev/null @@ -1,54 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for Leaf - */ -public class LeafTest { - private final Leaf model = new Leaf(); - - /** - * Model tests for Leaf - */ - @Test - public void testLeaf() { - // TODO: test Leaf - } - - /** - * Test the property 'users' - */ - @Test - public void usersTest() { - // TODO: test users - } - - /** - * Test the property 'computed' - */ - @Test - public void computedTest() { - // TODO: test computed - } - - /** - * Test the property 'tupleToUserset' - */ - @Test - public void tupleToUsersetTest() { - // TODO: test tupleToUserset - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/ListObjectsRequestTest.java b/src/test/java/dev/openfga/sdk/api/model/ListObjectsRequestTest.java deleted file mode 100644 index 21d9669..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/ListObjectsRequestTest.java +++ /dev/null @@ -1,78 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for ListObjectsRequest - */ -public class ListObjectsRequestTest { - private final ListObjectsRequest model = new ListObjectsRequest(); - - /** - * Model tests for ListObjectsRequest - */ - @Test - public void testListObjectsRequest() { - // TODO: test ListObjectsRequest - } - - /** - * Test the property 'authorizationModelId' - */ - @Test - public void authorizationModelIdTest() { - // TODO: test authorizationModelId - } - - /** - * Test the property 'type' - */ - @Test - public void typeTest() { - // TODO: test type - } - - /** - * Test the property 'relation' - */ - @Test - public void relationTest() { - // TODO: test relation - } - - /** - * Test the property 'user' - */ - @Test - public void userTest() { - // TODO: test user - } - - /** - * Test the property 'contextualTuples' - */ - @Test - public void contextualTuplesTest() { - // TODO: test contextualTuples - } - - /** - * Test the property 'context' - */ - @Test - public void contextTest() { - // TODO: test context - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/ListObjectsResponseTest.java b/src/test/java/dev/openfga/sdk/api/model/ListObjectsResponseTest.java deleted file mode 100644 index 67d15cd..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/ListObjectsResponseTest.java +++ /dev/null @@ -1,38 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for ListObjectsResponse - */ -public class ListObjectsResponseTest { - private final ListObjectsResponse model = new ListObjectsResponse(); - - /** - * Model tests for ListObjectsResponse - */ - @Test - public void testListObjectsResponse() { - // TODO: test ListObjectsResponse - } - - /** - * Test the property 'objects' - */ - @Test - public void objectsTest() { - // TODO: test objects - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/ListStoresResponseTest.java b/src/test/java/dev/openfga/sdk/api/model/ListStoresResponseTest.java deleted file mode 100644 index 1fb61eb..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/ListStoresResponseTest.java +++ /dev/null @@ -1,46 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for ListStoresResponse - */ -public class ListStoresResponseTest { - private final ListStoresResponse model = new ListStoresResponse(); - - /** - * Model tests for ListStoresResponse - */ - @Test - public void testListStoresResponse() { - // TODO: test ListStoresResponse - } - - /** - * Test the property 'stores' - */ - @Test - public void storesTest() { - // TODO: test stores - } - - /** - * Test the property 'continuationToken' - */ - @Test - public void continuationTokenTest() { - // TODO: test continuationToken - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/MetadataTest.java b/src/test/java/dev/openfga/sdk/api/model/MetadataTest.java deleted file mode 100644 index b85bb35..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/MetadataTest.java +++ /dev/null @@ -1,38 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for Metadata - */ -public class MetadataTest { - private final Metadata model = new Metadata(); - - /** - * Model tests for Metadata - */ - @Test - public void testMetadata() { - // TODO: test Metadata - } - - /** - * Test the property 'relations' - */ - @Test - public void relationsTest() { - // TODO: test relations - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/NodeTest.java b/src/test/java/dev/openfga/sdk/api/model/NodeTest.java deleted file mode 100644 index e7ca0e8..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/NodeTest.java +++ /dev/null @@ -1,70 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for Node - */ -public class NodeTest { - private final Node model = new Node(); - - /** - * Model tests for Node - */ - @Test - public void testNode() { - // TODO: test Node - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'leaf' - */ - @Test - public void leafTest() { - // TODO: test leaf - } - - /** - * Test the property 'difference' - */ - @Test - public void differenceTest() { - // TODO: test difference - } - - /** - * Test the property 'union' - */ - @Test - public void unionTest() { - // TODO: test union - } - - /** - * Test the property 'intersection' - */ - @Test - public void intersectionTest() { - // TODO: test intersection - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/NodesTest.java b/src/test/java/dev/openfga/sdk/api/model/NodesTest.java deleted file mode 100644 index 12c0331..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/NodesTest.java +++ /dev/null @@ -1,38 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for Nodes - */ -public class NodesTest { - private final Nodes model = new Nodes(); - - /** - * Model tests for Nodes - */ - @Test - public void testNodes() { - // TODO: test Nodes - } - - /** - * Test the property 'nodes' - */ - @Test - public void nodesTest() { - // TODO: test nodes - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/NotFoundErrorCodeTest.java b/src/test/java/dev/openfga/sdk/api/model/NotFoundErrorCodeTest.java deleted file mode 100644 index 89a6a20..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/NotFoundErrorCodeTest.java +++ /dev/null @@ -1,28 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for NotFoundErrorCode - */ -public class NotFoundErrorCodeTest { - /** - * Model tests for NotFoundErrorCode - */ - @Test - public void testNotFoundErrorCode() { - // TODO: test NotFoundErrorCode - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/NullValueTest.java b/src/test/java/dev/openfga/sdk/api/model/NullValueTest.java deleted file mode 100644 index cba8ce3..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/NullValueTest.java +++ /dev/null @@ -1,28 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for NullValue - */ -public class NullValueTest { - /** - * Model tests for NullValue - */ - @Test - public void testNullValue() { - // TODO: test NullValue - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/ObjectRelationTest.java b/src/test/java/dev/openfga/sdk/api/model/ObjectRelationTest.java deleted file mode 100644 index 4250939..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/ObjectRelationTest.java +++ /dev/null @@ -1,46 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for ObjectRelation - */ -public class ObjectRelationTest { - private final ObjectRelation model = new ObjectRelation(); - - /** - * Model tests for ObjectRelation - */ - @Test - public void testObjectRelation() { - // TODO: test ObjectRelation - } - - /** - * Test the property '_object' - */ - @Test - public void _objectTest() { - // TODO: test _object - } - - /** - * Test the property 'relation' - */ - @Test - public void relationTest() { - // TODO: test relation - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/PathUnknownErrorMessageResponseTest.java b/src/test/java/dev/openfga/sdk/api/model/PathUnknownErrorMessageResponseTest.java deleted file mode 100644 index 587ba31..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/PathUnknownErrorMessageResponseTest.java +++ /dev/null @@ -1,46 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for PathUnknownErrorMessageResponse - */ -public class PathUnknownErrorMessageResponseTest { - private final PathUnknownErrorMessageResponse model = new PathUnknownErrorMessageResponse(); - - /** - * Model tests for PathUnknownErrorMessageResponse - */ - @Test - public void testPathUnknownErrorMessageResponse() { - // TODO: test PathUnknownErrorMessageResponse - } - - /** - * Test the property 'code' - */ - @Test - public void codeTest() { - // TODO: test code - } - - /** - * Test the property 'message' - */ - @Test - public void messageTest() { - // TODO: test message - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/ReadAssertionsResponseTest.java b/src/test/java/dev/openfga/sdk/api/model/ReadAssertionsResponseTest.java deleted file mode 100644 index 521492e..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/ReadAssertionsResponseTest.java +++ /dev/null @@ -1,46 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for ReadAssertionsResponse - */ -public class ReadAssertionsResponseTest { - private final ReadAssertionsResponse model = new ReadAssertionsResponse(); - - /** - * Model tests for ReadAssertionsResponse - */ - @Test - public void testReadAssertionsResponse() { - // TODO: test ReadAssertionsResponse - } - - /** - * Test the property 'authorizationModelId' - */ - @Test - public void authorizationModelIdTest() { - // TODO: test authorizationModelId - } - - /** - * Test the property 'assertions' - */ - @Test - public void assertionsTest() { - // TODO: test assertions - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/ReadAuthorizationModelResponseTest.java b/src/test/java/dev/openfga/sdk/api/model/ReadAuthorizationModelResponseTest.java deleted file mode 100644 index 845a766..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/ReadAuthorizationModelResponseTest.java +++ /dev/null @@ -1,38 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for ReadAuthorizationModelResponse - */ -public class ReadAuthorizationModelResponseTest { - private final ReadAuthorizationModelResponse model = new ReadAuthorizationModelResponse(); - - /** - * Model tests for ReadAuthorizationModelResponse - */ - @Test - public void testReadAuthorizationModelResponse() { - // TODO: test ReadAuthorizationModelResponse - } - - /** - * Test the property 'authorizationModel' - */ - @Test - public void authorizationModelTest() { - // TODO: test authorizationModel - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/ReadAuthorizationModelsResponseTest.java b/src/test/java/dev/openfga/sdk/api/model/ReadAuthorizationModelsResponseTest.java deleted file mode 100644 index 80d9821..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/ReadAuthorizationModelsResponseTest.java +++ /dev/null @@ -1,46 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for ReadAuthorizationModelsResponse - */ -public class ReadAuthorizationModelsResponseTest { - private final ReadAuthorizationModelsResponse model = new ReadAuthorizationModelsResponse(); - - /** - * Model tests for ReadAuthorizationModelsResponse - */ - @Test - public void testReadAuthorizationModelsResponse() { - // TODO: test ReadAuthorizationModelsResponse - } - - /** - * Test the property 'authorizationModels' - */ - @Test - public void authorizationModelsTest() { - // TODO: test authorizationModels - } - - /** - * Test the property 'continuationToken' - */ - @Test - public void continuationTokenTest() { - // TODO: test continuationToken - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/ReadChangesResponseTest.java b/src/test/java/dev/openfga/sdk/api/model/ReadChangesResponseTest.java deleted file mode 100644 index 8b11f6c..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/ReadChangesResponseTest.java +++ /dev/null @@ -1,46 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for ReadChangesResponse - */ -public class ReadChangesResponseTest { - private final ReadChangesResponse model = new ReadChangesResponse(); - - /** - * Model tests for ReadChangesResponse - */ - @Test - public void testReadChangesResponse() { - // TODO: test ReadChangesResponse - } - - /** - * Test the property 'changes' - */ - @Test - public void changesTest() { - // TODO: test changes - } - - /** - * Test the property 'continuationToken' - */ - @Test - public void continuationTokenTest() { - // TODO: test continuationToken - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/ReadRequestTest.java b/src/test/java/dev/openfga/sdk/api/model/ReadRequestTest.java deleted file mode 100644 index 955310a..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/ReadRequestTest.java +++ /dev/null @@ -1,54 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for ReadRequest - */ -public class ReadRequestTest { - private final ReadRequest model = new ReadRequest(); - - /** - * Model tests for ReadRequest - */ - @Test - public void testReadRequest() { - // TODO: test ReadRequest - } - - /** - * Test the property 'tupleKey' - */ - @Test - public void tupleKeyTest() { - // TODO: test tupleKey - } - - /** - * Test the property 'pageSize' - */ - @Test - public void pageSizeTest() { - // TODO: test pageSize - } - - /** - * Test the property 'continuationToken' - */ - @Test - public void continuationTokenTest() { - // TODO: test continuationToken - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/ReadRequestTupleKeyTest.java b/src/test/java/dev/openfga/sdk/api/model/ReadRequestTupleKeyTest.java deleted file mode 100644 index 38a8866..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/ReadRequestTupleKeyTest.java +++ /dev/null @@ -1,54 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for ReadRequestTupleKey - */ -public class ReadRequestTupleKeyTest { - private final ReadRequestTupleKey model = new ReadRequestTupleKey(); - - /** - * Model tests for ReadRequestTupleKey - */ - @Test - public void testReadRequestTupleKey() { - // TODO: test ReadRequestTupleKey - } - - /** - * Test the property 'user' - */ - @Test - public void userTest() { - // TODO: test user - } - - /** - * Test the property 'relation' - */ - @Test - public void relationTest() { - // TODO: test relation - } - - /** - * Test the property '_object' - */ - @Test - public void _objectTest() { - // TODO: test _object - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/ReadResponseTest.java b/src/test/java/dev/openfga/sdk/api/model/ReadResponseTest.java deleted file mode 100644 index 59fb83d..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/ReadResponseTest.java +++ /dev/null @@ -1,46 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for ReadResponse - */ -public class ReadResponseTest { - private final ReadResponse model = new ReadResponse(); - - /** - * Model tests for ReadResponse - */ - @Test - public void testReadResponse() { - // TODO: test ReadResponse - } - - /** - * Test the property 'tuples' - */ - @Test - public void tuplesTest() { - // TODO: test tuples - } - - /** - * Test the property 'continuationToken' - */ - @Test - public void continuationTokenTest() { - // TODO: test continuationToken - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/RelationMetadataTest.java b/src/test/java/dev/openfga/sdk/api/model/RelationMetadataTest.java deleted file mode 100644 index 82763ae..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/RelationMetadataTest.java +++ /dev/null @@ -1,38 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for RelationMetadata - */ -public class RelationMetadataTest { - private final RelationMetadata model = new RelationMetadata(); - - /** - * Model tests for RelationMetadata - */ - @Test - public void testRelationMetadata() { - // TODO: test RelationMetadata - } - - /** - * Test the property 'directlyRelatedUserTypes' - */ - @Test - public void directlyRelatedUserTypesTest() { - // TODO: test directlyRelatedUserTypes - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/RelationReferenceTest.java b/src/test/java/dev/openfga/sdk/api/model/RelationReferenceTest.java deleted file mode 100644 index c673e09..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/RelationReferenceTest.java +++ /dev/null @@ -1,62 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for RelationReference - */ -public class RelationReferenceTest { - private final RelationReference model = new RelationReference(); - - /** - * Model tests for RelationReference - */ - @Test - public void testRelationReference() { - // TODO: test RelationReference - } - - /** - * Test the property 'type' - */ - @Test - public void typeTest() { - // TODO: test type - } - - /** - * Test the property 'relation' - */ - @Test - public void relationTest() { - // TODO: test relation - } - - /** - * Test the property 'wildcard' - */ - @Test - public void wildcardTest() { - // TODO: test wildcard - } - - /** - * Test the property 'condition' - */ - @Test - public void conditionTest() { - // TODO: test condition - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/RelationshipConditionTest.java b/src/test/java/dev/openfga/sdk/api/model/RelationshipConditionTest.java deleted file mode 100644 index 0140027..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/RelationshipConditionTest.java +++ /dev/null @@ -1,46 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for RelationshipCondition - */ -public class RelationshipConditionTest { - private final RelationshipCondition model = new RelationshipCondition(); - - /** - * Model tests for RelationshipCondition - */ - @Test - public void testRelationshipCondition() { - // TODO: test RelationshipCondition - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'context' - */ - @Test - public void contextTest() { - // TODO: test context - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/StatusTest.java b/src/test/java/dev/openfga/sdk/api/model/StatusTest.java deleted file mode 100644 index 0262f9f..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/StatusTest.java +++ /dev/null @@ -1,54 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for Status - */ -public class StatusTest { - private final Status model = new Status(); - - /** - * Model tests for Status - */ - @Test - public void testStatus() { - // TODO: test Status - } - - /** - * Test the property 'code' - */ - @Test - public void codeTest() { - // TODO: test code - } - - /** - * Test the property 'message' - */ - @Test - public void messageTest() { - // TODO: test message - } - - /** - * Test the property 'details' - */ - @Test - public void detailsTest() { - // TODO: test details - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/StoreTest.java b/src/test/java/dev/openfga/sdk/api/model/StoreTest.java deleted file mode 100644 index 2ed2f53..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/StoreTest.java +++ /dev/null @@ -1,70 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for Store - */ -public class StoreTest { - private final Store model = new Store(); - - /** - * Model tests for Store - */ - @Test - public void testStore() { - // TODO: test Store - } - - /** - * Test the property 'id' - */ - @Test - public void idTest() { - // TODO: test id - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'createdAt' - */ - @Test - public void createdAtTest() { - // TODO: test createdAt - } - - /** - * Test the property 'updatedAt' - */ - @Test - public void updatedAtTest() { - // TODO: test updatedAt - } - - /** - * Test the property 'deletedAt' - */ - @Test - public void deletedAtTest() { - // TODO: test deletedAt - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/TupleChangeTest.java b/src/test/java/dev/openfga/sdk/api/model/TupleChangeTest.java deleted file mode 100644 index 43a626f..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/TupleChangeTest.java +++ /dev/null @@ -1,54 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for TupleChange - */ -public class TupleChangeTest { - private final TupleChange model = new TupleChange(); - - /** - * Model tests for TupleChange - */ - @Test - public void testTupleChange() { - // TODO: test TupleChange - } - - /** - * Test the property 'tupleKey' - */ - @Test - public void tupleKeyTest() { - // TODO: test tupleKey - } - - /** - * Test the property 'operation' - */ - @Test - public void operationTest() { - // TODO: test operation - } - - /** - * Test the property 'timestamp' - */ - @Test - public void timestampTest() { - // TODO: test timestamp - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/TupleKeyTest.java b/src/test/java/dev/openfga/sdk/api/model/TupleKeyTest.java deleted file mode 100644 index 3081c14..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/TupleKeyTest.java +++ /dev/null @@ -1,62 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for TupleKey - */ -public class TupleKeyTest { - private final TupleKey model = new TupleKey(); - - /** - * Model tests for TupleKey - */ - @Test - public void testTupleKey() { - // TODO: test TupleKey - } - - /** - * Test the property 'user' - */ - @Test - public void userTest() { - // TODO: test user - } - - /** - * Test the property 'relation' - */ - @Test - public void relationTest() { - // TODO: test relation - } - - /** - * Test the property '_object' - */ - @Test - public void _objectTest() { - // TODO: test _object - } - - /** - * Test the property 'condition' - */ - @Test - public void conditionTest() { - // TODO: test condition - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/TupleKeyWithoutConditionTest.java b/src/test/java/dev/openfga/sdk/api/model/TupleKeyWithoutConditionTest.java deleted file mode 100644 index c3a6348..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/TupleKeyWithoutConditionTest.java +++ /dev/null @@ -1,54 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for TupleKeyWithoutCondition - */ -public class TupleKeyWithoutConditionTest { - private final TupleKeyWithoutCondition model = new TupleKeyWithoutCondition(); - - /** - * Model tests for TupleKeyWithoutCondition - */ - @Test - public void testTupleKeyWithoutCondition() { - // TODO: test TupleKeyWithoutCondition - } - - /** - * Test the property 'user' - */ - @Test - public void userTest() { - // TODO: test user - } - - /** - * Test the property 'relation' - */ - @Test - public void relationTest() { - // TODO: test relation - } - - /** - * Test the property '_object' - */ - @Test - public void _objectTest() { - // TODO: test _object - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/TupleOperationTest.java b/src/test/java/dev/openfga/sdk/api/model/TupleOperationTest.java deleted file mode 100644 index 4bc1458..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/TupleOperationTest.java +++ /dev/null @@ -1,28 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for TupleOperation - */ -public class TupleOperationTest { - /** - * Model tests for TupleOperation - */ - @Test - public void testTupleOperation() { - // TODO: test TupleOperation - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/TupleTest.java b/src/test/java/dev/openfga/sdk/api/model/TupleTest.java deleted file mode 100644 index c56c98c..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/TupleTest.java +++ /dev/null @@ -1,46 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for Tuple - */ -public class TupleTest { - private final Tuple model = new Tuple(); - - /** - * Model tests for Tuple - */ - @Test - public void testTuple() { - // TODO: test Tuple - } - - /** - * Test the property 'key' - */ - @Test - public void keyTest() { - // TODO: test key - } - - /** - * Test the property 'timestamp' - */ - @Test - public void timestampTest() { - // TODO: test timestamp - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/TupleToUsersetTest.java b/src/test/java/dev/openfga/sdk/api/model/TupleToUsersetTest.java deleted file mode 100644 index 00d0944..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/TupleToUsersetTest.java +++ /dev/null @@ -1,46 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for TupleToUserset - */ -public class TupleToUsersetTest { - private final TupleToUserset model = new TupleToUserset(); - - /** - * Model tests for TupleToUserset - */ - @Test - public void testTupleToUserset() { - // TODO: test TupleToUserset - } - - /** - * Test the property 'tupleset' - */ - @Test - public void tuplesetTest() { - // TODO: test tupleset - } - - /** - * Test the property 'computedUserset' - */ - @Test - public void computedUsersetTest() { - // TODO: test computedUserset - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/TypeDefinitionTest.java b/src/test/java/dev/openfga/sdk/api/model/TypeDefinitionTest.java deleted file mode 100644 index f0b4f6b..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/TypeDefinitionTest.java +++ /dev/null @@ -1,54 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for TypeDefinition - */ -public class TypeDefinitionTest { - private final TypeDefinition model = new TypeDefinition(); - - /** - * Model tests for TypeDefinition - */ - @Test - public void testTypeDefinition() { - // TODO: test TypeDefinition - } - - /** - * Test the property 'type' - */ - @Test - public void typeTest() { - // TODO: test type - } - - /** - * Test the property 'relations' - */ - @Test - public void relationsTest() { - // TODO: test relations - } - - /** - * Test the property 'metadata' - */ - @Test - public void metadataTest() { - // TODO: test metadata - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/TypeNameTest.java b/src/test/java/dev/openfga/sdk/api/model/TypeNameTest.java deleted file mode 100644 index 3a58cb4..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/TypeNameTest.java +++ /dev/null @@ -1,28 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for TypeName - */ -public class TypeNameTest { - /** - * Model tests for TypeName - */ - @Test - public void testTypeName() { - // TODO: test TypeName - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/UsersTest.java b/src/test/java/dev/openfga/sdk/api/model/UsersTest.java deleted file mode 100644 index a3fb034..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/UsersTest.java +++ /dev/null @@ -1,38 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for Users - */ -public class UsersTest { - private final Users model = new Users(); - - /** - * Model tests for Users - */ - @Test - public void testUsers() { - // TODO: test Users - } - - /** - * Test the property 'users' - */ - @Test - public void usersTest() { - // TODO: test users - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/UsersetTest.java b/src/test/java/dev/openfga/sdk/api/model/UsersetTest.java deleted file mode 100644 index 819e997..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/UsersetTest.java +++ /dev/null @@ -1,78 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for Userset - */ -public class UsersetTest { - private final Userset model = new Userset(); - - /** - * Model tests for Userset - */ - @Test - public void testUserset() { - // TODO: test Userset - } - - /** - * Test the property '_this' - */ - @Test - public void _thisTest() { - // TODO: test _this - } - - /** - * Test the property 'computedUserset' - */ - @Test - public void computedUsersetTest() { - // TODO: test computedUserset - } - - /** - * Test the property 'tupleToUserset' - */ - @Test - public void tupleToUsersetTest() { - // TODO: test tupleToUserset - } - - /** - * Test the property 'union' - */ - @Test - public void unionTest() { - // TODO: test union - } - - /** - * Test the property 'intersection' - */ - @Test - public void intersectionTest() { - // TODO: test intersection - } - - /** - * Test the property 'difference' - */ - @Test - public void differenceTest() { - // TODO: test difference - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/UsersetTreeDifferenceTest.java b/src/test/java/dev/openfga/sdk/api/model/UsersetTreeDifferenceTest.java deleted file mode 100644 index 43a13ac..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/UsersetTreeDifferenceTest.java +++ /dev/null @@ -1,46 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for UsersetTreeDifference - */ -public class UsersetTreeDifferenceTest { - private final UsersetTreeDifference model = new UsersetTreeDifference(); - - /** - * Model tests for UsersetTreeDifference - */ - @Test - public void testUsersetTreeDifference() { - // TODO: test UsersetTreeDifference - } - - /** - * Test the property 'base' - */ - @Test - public void baseTest() { - // TODO: test base - } - - /** - * Test the property 'subtract' - */ - @Test - public void subtractTest() { - // TODO: test subtract - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/UsersetTreeTest.java b/src/test/java/dev/openfga/sdk/api/model/UsersetTreeTest.java deleted file mode 100644 index 9aea5c0..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/UsersetTreeTest.java +++ /dev/null @@ -1,38 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for UsersetTree - */ -public class UsersetTreeTest { - private final UsersetTree model = new UsersetTree(); - - /** - * Model tests for UsersetTree - */ - @Test - public void testUsersetTree() { - // TODO: test UsersetTree - } - - /** - * Test the property 'root' - */ - @Test - public void rootTest() { - // TODO: test root - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/UsersetTreeTupleToUsersetTest.java b/src/test/java/dev/openfga/sdk/api/model/UsersetTreeTupleToUsersetTest.java deleted file mode 100644 index d730491..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/UsersetTreeTupleToUsersetTest.java +++ /dev/null @@ -1,46 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for UsersetTreeTupleToUserset - */ -public class UsersetTreeTupleToUsersetTest { - private final UsersetTreeTupleToUserset model = new UsersetTreeTupleToUserset(); - - /** - * Model tests for UsersetTreeTupleToUserset - */ - @Test - public void testUsersetTreeTupleToUserset() { - // TODO: test UsersetTreeTupleToUserset - } - - /** - * Test the property 'tupleset' - */ - @Test - public void tuplesetTest() { - // TODO: test tupleset - } - - /** - * Test the property 'computed' - */ - @Test - public void computedTest() { - // TODO: test computed - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/UsersetsTest.java b/src/test/java/dev/openfga/sdk/api/model/UsersetsTest.java deleted file mode 100644 index b9fa799..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/UsersetsTest.java +++ /dev/null @@ -1,38 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for Usersets - */ -public class UsersetsTest { - private final Usersets model = new Usersets(); - - /** - * Model tests for Usersets - */ - @Test - public void testUsersets() { - // TODO: test Usersets - } - - /** - * Test the property 'child' - */ - @Test - public void childTest() { - // TODO: test child - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/ValidationErrorMessageResponseTest.java b/src/test/java/dev/openfga/sdk/api/model/ValidationErrorMessageResponseTest.java deleted file mode 100644 index 43f6bd1..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/ValidationErrorMessageResponseTest.java +++ /dev/null @@ -1,46 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for ValidationErrorMessageResponse - */ -public class ValidationErrorMessageResponseTest { - private final ValidationErrorMessageResponse model = new ValidationErrorMessageResponse(); - - /** - * Model tests for ValidationErrorMessageResponse - */ - @Test - public void testValidationErrorMessageResponse() { - // TODO: test ValidationErrorMessageResponse - } - - /** - * Test the property 'code' - */ - @Test - public void codeTest() { - // TODO: test code - } - - /** - * Test the property 'message' - */ - @Test - public void messageTest() { - // TODO: test message - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/WriteAssertionsRequestTest.java b/src/test/java/dev/openfga/sdk/api/model/WriteAssertionsRequestTest.java deleted file mode 100644 index feb1e5c..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/WriteAssertionsRequestTest.java +++ /dev/null @@ -1,38 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for WriteAssertionsRequest - */ -public class WriteAssertionsRequestTest { - private final WriteAssertionsRequest model = new WriteAssertionsRequest(); - - /** - * Model tests for WriteAssertionsRequest - */ - @Test - public void testWriteAssertionsRequest() { - // TODO: test WriteAssertionsRequest - } - - /** - * Test the property 'assertions' - */ - @Test - public void assertionsTest() { - // TODO: test assertions - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/WriteAuthorizationModelRequestTest.java b/src/test/java/dev/openfga/sdk/api/model/WriteAuthorizationModelRequestTest.java deleted file mode 100644 index 40331b2..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/WriteAuthorizationModelRequestTest.java +++ /dev/null @@ -1,54 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for WriteAuthorizationModelRequest - */ -public class WriteAuthorizationModelRequestTest { - private final WriteAuthorizationModelRequest model = new WriteAuthorizationModelRequest(); - - /** - * Model tests for WriteAuthorizationModelRequest - */ - @Test - public void testWriteAuthorizationModelRequest() { - // TODO: test WriteAuthorizationModelRequest - } - - /** - * Test the property 'typeDefinitions' - */ - @Test - public void typeDefinitionsTest() { - // TODO: test typeDefinitions - } - - /** - * Test the property 'schemaVersion' - */ - @Test - public void schemaVersionTest() { - // TODO: test schemaVersion - } - - /** - * Test the property 'conditions' - */ - @Test - public void conditionsTest() { - // TODO: test conditions - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/WriteAuthorizationModelResponseTest.java b/src/test/java/dev/openfga/sdk/api/model/WriteAuthorizationModelResponseTest.java deleted file mode 100644 index 815f06f..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/WriteAuthorizationModelResponseTest.java +++ /dev/null @@ -1,38 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for WriteAuthorizationModelResponse - */ -public class WriteAuthorizationModelResponseTest { - private final WriteAuthorizationModelResponse model = new WriteAuthorizationModelResponse(); - - /** - * Model tests for WriteAuthorizationModelResponse - */ - @Test - public void testWriteAuthorizationModelResponse() { - // TODO: test WriteAuthorizationModelResponse - } - - /** - * Test the property 'authorizationModelId' - */ - @Test - public void authorizationModelIdTest() { - // TODO: test authorizationModelId - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/WriteRequestDeletesTest.java b/src/test/java/dev/openfga/sdk/api/model/WriteRequestDeletesTest.java deleted file mode 100644 index 98f4164..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/WriteRequestDeletesTest.java +++ /dev/null @@ -1,38 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for WriteRequestDeletes - */ -public class WriteRequestDeletesTest { - private final WriteRequestDeletes model = new WriteRequestDeletes(); - - /** - * Model tests for WriteRequestDeletes - */ - @Test - public void testWriteRequestDeletes() { - // TODO: test WriteRequestDeletes - } - - /** - * Test the property 'tupleKeys' - */ - @Test - public void tupleKeysTest() { - // TODO: test tupleKeys - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/WriteRequestTest.java b/src/test/java/dev/openfga/sdk/api/model/WriteRequestTest.java deleted file mode 100644 index 85966ca..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/WriteRequestTest.java +++ /dev/null @@ -1,54 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for WriteRequest - */ -public class WriteRequestTest { - private final WriteRequest model = new WriteRequest(); - - /** - * Model tests for WriteRequest - */ - @Test - public void testWriteRequest() { - // TODO: test WriteRequest - } - - /** - * Test the property 'writes' - */ - @Test - public void writesTest() { - // TODO: test writes - } - - /** - * Test the property 'deletes' - */ - @Test - public void deletesTest() { - // TODO: test deletes - } - - /** - * Test the property 'authorizationModelId' - */ - @Test - public void authorizationModelIdTest() { - // TODO: test authorizationModelId - } -} diff --git a/src/test/java/dev/openfga/sdk/api/model/WriteRequestWritesTest.java b/src/test/java/dev/openfga/sdk/api/model/WriteRequestWritesTest.java deleted file mode 100644 index 5a2b21c..0000000 --- a/src/test/java/dev/openfga/sdk/api/model/WriteRequestWritesTest.java +++ /dev/null @@ -1,38 +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.model; - -import org.junit.jupiter.api.Test; - -/** - * Model tests for WriteRequestWrites - */ -public class WriteRequestWritesTest { - private final WriteRequestWrites model = new WriteRequestWrites(); - - /** - * Model tests for WriteRequestWrites - */ - @Test - public void testWriteRequestWrites() { - // TODO: test WriteRequestWrites - } - - /** - * Test the property 'tupleKeys' - */ - @Test - public void tupleKeysTest() { - // TODO: test tupleKeys - } -} From cc9f9dfd25ce672de1e56c21f5f325f43556e494 Mon Sep 17 00:00:00 2001 From: "J.R. Hill" Date: Thu, 14 Dec 2023 10:54:25 -0800 Subject: [PATCH 6/6] chore(client): move model types to .model package --- .openapi-generator/FILES | 54 +++++++++---------- .../openfga/sdk/api/client/OpenFgaClient.java | 1 + .../{ => model}/ClientBatchCheckResponse.java | 2 +- .../{ => model}/ClientCheckRequest.java | 2 +- .../{ => model}/ClientCheckResponse.java | 3 +- .../ClientCreateStoreResponse.java | 3 +- .../ClientDeleteStoreResponse.java | 3 +- .../{ => model}/ClientExpandRequest.java | 2 +- .../{ => model}/ClientExpandResponse.java | 3 +- .../{ => model}/ClientGetStoreResponse.java | 3 +- .../{ => model}/ClientListObjectsRequest.java | 2 +- .../ClientListObjectsResponse.java | 3 +- .../ClientListRelationsRequest.java | 2 +- .../ClientListRelationsResponse.java | 2 +- .../{ => model}/ClientListStoresResponse.java | 3 +- .../ClientReadAssertionsResponse.java | 3 +- .../ClientReadAuthorizationModelResponse.java | 3 +- ...ClientReadAuthorizationModelsResponse.java | 3 +- .../{ => model}/ClientReadChangesRequest.java | 2 +- .../ClientReadChangesResponse.java | 3 +- .../client/{ => model}/ClientReadRequest.java | 2 +- .../{ => model}/ClientReadResponse.java | 3 +- .../ClientRelationshipCondition.java | 2 +- .../client/{ => model}/ClientTupleKey.java | 2 +- .../ClientTupleKeyWithoutCondition.java | 2 +- .../ClientWriteAssertionsResponse.java | 3 +- ...ClientWriteAuthorizationModelResponse.java | 3 +- .../{ => model}/ClientWriteRequest.java | 2 +- .../{ => model}/ClientWriteResponse.java | 3 +- .../sdk/api/OpenFgaApiIntegrationTest.java | 1 + .../client/OpenFgaClientIntegrationTest.java | 1 + .../dev/openfga/sdk/api/OpenFgaApiTest.java | 1 + .../sdk/api/client/OpenFgaClientTest.java | 1 + 33 files changed, 74 insertions(+), 54 deletions(-) rename src/main/java/dev/openfga/sdk/api/client/{ => model}/ClientBatchCheckResponse.java (98%) rename src/main/java/dev/openfga/sdk/api/client/{ => model}/ClientCheckRequest.java (97%) rename src/main/java/dev/openfga/sdk/api/client/{ => model}/ClientCheckResponse.java (93%) rename src/main/java/dev/openfga/sdk/api/client/{ => model}/ClientCreateStoreResponse.java (94%) rename src/main/java/dev/openfga/sdk/api/client/{ => model}/ClientDeleteStoreResponse.java (92%) rename src/main/java/dev/openfga/sdk/api/client/{ => model}/ClientExpandRequest.java (95%) rename src/main/java/dev/openfga/sdk/api/client/{ => model}/ClientExpandResponse.java (93%) rename src/main/java/dev/openfga/sdk/api/client/{ => model}/ClientGetStoreResponse.java (93%) rename src/main/java/dev/openfga/sdk/api/client/{ => model}/ClientListObjectsRequest.java (97%) rename src/main/java/dev/openfga/sdk/api/client/{ => model}/ClientListObjectsResponse.java (93%) rename src/main/java/dev/openfga/sdk/api/client/{ => model}/ClientListRelationsRequest.java (97%) rename src/main/java/dev/openfga/sdk/api/client/{ => model}/ClientListRelationsResponse.java (97%) rename src/main/java/dev/openfga/sdk/api/client/{ => model}/ClientListStoresResponse.java (93%) rename src/main/java/dev/openfga/sdk/api/client/{ => model}/ClientReadAssertionsResponse.java (93%) rename src/main/java/dev/openfga/sdk/api/client/{ => model}/ClientReadAuthorizationModelResponse.java (96%) rename src/main/java/dev/openfga/sdk/api/client/{ => model}/ClientReadAuthorizationModelsResponse.java (94%) rename src/main/java/dev/openfga/sdk/api/client/{ => model}/ClientReadChangesRequest.java (93%) rename src/main/java/dev/openfga/sdk/api/client/{ => model}/ClientReadChangesResponse.java (93%) rename src/main/java/dev/openfga/sdk/api/client/{ => model}/ClientReadRequest.java (96%) rename src/main/java/dev/openfga/sdk/api/client/{ => model}/ClientReadResponse.java (93%) rename src/main/java/dev/openfga/sdk/api/client/{ => model}/ClientRelationshipCondition.java (96%) rename src/main/java/dev/openfga/sdk/api/client/{ => model}/ClientTupleKey.java (98%) rename src/main/java/dev/openfga/sdk/api/client/{ => model}/ClientTupleKeyWithoutCondition.java (98%) rename src/main/java/dev/openfga/sdk/api/client/{ => model}/ClientWriteAssertionsResponse.java (92%) rename src/main/java/dev/openfga/sdk/api/client/{ => model}/ClientWriteAuthorizationModelResponse.java (93%) rename src/main/java/dev/openfga/sdk/api/client/{ => model}/ClientWriteRequest.java (96%) rename src/main/java/dev/openfga/sdk/api/client/{ => model}/ClientWriteResponse.java (92%) diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index f985e47..e448622 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -96,35 +96,35 @@ src/main/java/dev/openfga/sdk/api/auth/OAuth2Client.java src/main/java/dev/openfga/sdk/api/client/ApiClient.java src/main/java/dev/openfga/sdk/api/client/ApiResponse.java src/main/java/dev/openfga/sdk/api/client/ClientAssertion.java -src/main/java/dev/openfga/sdk/api/client/ClientBatchCheckResponse.java -src/main/java/dev/openfga/sdk/api/client/ClientCheckRequest.java -src/main/java/dev/openfga/sdk/api/client/ClientCheckResponse.java -src/main/java/dev/openfga/sdk/api/client/ClientCreateStoreResponse.java -src/main/java/dev/openfga/sdk/api/client/ClientDeleteStoreResponse.java -src/main/java/dev/openfga/sdk/api/client/ClientExpandRequest.java -src/main/java/dev/openfga/sdk/api/client/ClientExpandResponse.java -src/main/java/dev/openfga/sdk/api/client/ClientGetStoreResponse.java -src/main/java/dev/openfga/sdk/api/client/ClientListObjectsRequest.java -src/main/java/dev/openfga/sdk/api/client/ClientListObjectsResponse.java -src/main/java/dev/openfga/sdk/api/client/ClientListRelationsRequest.java -src/main/java/dev/openfga/sdk/api/client/ClientListRelationsResponse.java -src/main/java/dev/openfga/sdk/api/client/ClientListStoresResponse.java -src/main/java/dev/openfga/sdk/api/client/ClientReadAssertionsResponse.java -src/main/java/dev/openfga/sdk/api/client/ClientReadAuthorizationModelResponse.java -src/main/java/dev/openfga/sdk/api/client/ClientReadAuthorizationModelsResponse.java -src/main/java/dev/openfga/sdk/api/client/ClientReadChangesRequest.java -src/main/java/dev/openfga/sdk/api/client/ClientReadChangesResponse.java -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/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 -src/main/java/dev/openfga/sdk/api/client/ClientWriteResponse.java src/main/java/dev/openfga/sdk/api/client/HttpRequestAttempt.java src/main/java/dev/openfga/sdk/api/client/OpenFgaClient.java +src/main/java/dev/openfga/sdk/api/client/model/ClientBatchCheckResponse.java +src/main/java/dev/openfga/sdk/api/client/model/ClientCheckRequest.java +src/main/java/dev/openfga/sdk/api/client/model/ClientCheckResponse.java +src/main/java/dev/openfga/sdk/api/client/model/ClientCreateStoreResponse.java +src/main/java/dev/openfga/sdk/api/client/model/ClientDeleteStoreResponse.java +src/main/java/dev/openfga/sdk/api/client/model/ClientExpandRequest.java +src/main/java/dev/openfga/sdk/api/client/model/ClientExpandResponse.java +src/main/java/dev/openfga/sdk/api/client/model/ClientGetStoreResponse.java +src/main/java/dev/openfga/sdk/api/client/model/ClientListObjectsRequest.java +src/main/java/dev/openfga/sdk/api/client/model/ClientListObjectsResponse.java +src/main/java/dev/openfga/sdk/api/client/model/ClientListRelationsRequest.java +src/main/java/dev/openfga/sdk/api/client/model/ClientListRelationsResponse.java +src/main/java/dev/openfga/sdk/api/client/model/ClientListStoresResponse.java +src/main/java/dev/openfga/sdk/api/client/model/ClientReadAssertionsResponse.java +src/main/java/dev/openfga/sdk/api/client/model/ClientReadAuthorizationModelResponse.java +src/main/java/dev/openfga/sdk/api/client/model/ClientReadAuthorizationModelsResponse.java +src/main/java/dev/openfga/sdk/api/client/model/ClientReadChangesRequest.java +src/main/java/dev/openfga/sdk/api/client/model/ClientReadChangesResponse.java +src/main/java/dev/openfga/sdk/api/client/model/ClientReadRequest.java +src/main/java/dev/openfga/sdk/api/client/model/ClientReadResponse.java +src/main/java/dev/openfga/sdk/api/client/model/ClientRelationshipCondition.java +src/main/java/dev/openfga/sdk/api/client/model/ClientTupleKey.java +src/main/java/dev/openfga/sdk/api/client/model/ClientTupleKeyWithoutCondition.java +src/main/java/dev/openfga/sdk/api/client/model/ClientWriteAssertionsResponse.java +src/main/java/dev/openfga/sdk/api/client/model/ClientWriteAuthorizationModelResponse.java +src/main/java/dev/openfga/sdk/api/client/model/ClientWriteRequest.java +src/main/java/dev/openfga/sdk/api/client/model/ClientWriteResponse.java src/main/java/dev/openfga/sdk/api/configuration/AdditionalHeadersSupplier.java src/main/java/dev/openfga/sdk/api/configuration/ApiToken.java src/main/java/dev/openfga/sdk/api/configuration/BaseConfiguration.java 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 b5f9bbe..bf2ffb5 100644 --- a/src/main/java/dev/openfga/sdk/api/client/OpenFgaClient.java +++ b/src/main/java/dev/openfga/sdk/api/client/OpenFgaClient.java @@ -16,6 +16,7 @@ import static java.util.UUID.randomUUID; import dev.openfga.sdk.api.*; +import dev.openfga.sdk.api.client.model.*; import dev.openfga.sdk.api.configuration.*; import dev.openfga.sdk.api.model.*; import dev.openfga.sdk.errors.*; diff --git a/src/main/java/dev/openfga/sdk/api/client/ClientBatchCheckResponse.java b/src/main/java/dev/openfga/sdk/api/client/model/ClientBatchCheckResponse.java similarity index 98% rename from src/main/java/dev/openfga/sdk/api/client/ClientBatchCheckResponse.java rename to src/main/java/dev/openfga/sdk/api/client/model/ClientBatchCheckResponse.java index f853d36..2425908 100644 --- a/src/main/java/dev/openfga/sdk/api/client/ClientBatchCheckResponse.java +++ b/src/main/java/dev/openfga/sdk/api/client/model/ClientBatchCheckResponse.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package dev.openfga.sdk.api.client; +package dev.openfga.sdk.api.client.model; import dev.openfga.sdk.api.model.CheckResponse; import dev.openfga.sdk.errors.FgaError; diff --git a/src/main/java/dev/openfga/sdk/api/client/ClientCheckRequest.java b/src/main/java/dev/openfga/sdk/api/client/model/ClientCheckRequest.java similarity index 97% rename from src/main/java/dev/openfga/sdk/api/client/ClientCheckRequest.java rename to src/main/java/dev/openfga/sdk/api/client/model/ClientCheckRequest.java index 6cd4a88..0b6b5be 100644 --- a/src/main/java/dev/openfga/sdk/api/client/ClientCheckRequest.java +++ b/src/main/java/dev/openfga/sdk/api/client/model/ClientCheckRequest.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package dev.openfga.sdk.api.client; +package dev.openfga.sdk.api.client.model; import dev.openfga.sdk.api.model.CheckRequestTupleKey; import java.util.List; diff --git a/src/main/java/dev/openfga/sdk/api/client/ClientCheckResponse.java b/src/main/java/dev/openfga/sdk/api/client/model/ClientCheckResponse.java similarity index 93% rename from src/main/java/dev/openfga/sdk/api/client/ClientCheckResponse.java rename to src/main/java/dev/openfga/sdk/api/client/model/ClientCheckResponse.java index a369186..b5662a2 100644 --- a/src/main/java/dev/openfga/sdk/api/client/ClientCheckResponse.java +++ b/src/main/java/dev/openfga/sdk/api/client/model/ClientCheckResponse.java @@ -10,8 +10,9 @@ * Do not edit the class manually. */ -package dev.openfga.sdk.api.client; +package dev.openfga.sdk.api.client.model; +import dev.openfga.sdk.api.client.ApiResponse; import dev.openfga.sdk.api.model.CheckResponse; import java.util.List; import java.util.Map; diff --git a/src/main/java/dev/openfga/sdk/api/client/ClientCreateStoreResponse.java b/src/main/java/dev/openfga/sdk/api/client/model/ClientCreateStoreResponse.java similarity index 94% rename from src/main/java/dev/openfga/sdk/api/client/ClientCreateStoreResponse.java rename to src/main/java/dev/openfga/sdk/api/client/model/ClientCreateStoreResponse.java index 1aa11a3..5d3647a 100644 --- a/src/main/java/dev/openfga/sdk/api/client/ClientCreateStoreResponse.java +++ b/src/main/java/dev/openfga/sdk/api/client/model/ClientCreateStoreResponse.java @@ -10,8 +10,9 @@ * Do not edit the class manually. */ -package dev.openfga.sdk.api.client; +package dev.openfga.sdk.api.client.model; +import dev.openfga.sdk.api.client.ApiResponse; import dev.openfga.sdk.api.model.CreateStoreResponse; import java.util.List; import java.util.Map; diff --git a/src/main/java/dev/openfga/sdk/api/client/ClientDeleteStoreResponse.java b/src/main/java/dev/openfga/sdk/api/client/model/ClientDeleteStoreResponse.java similarity index 92% rename from src/main/java/dev/openfga/sdk/api/client/ClientDeleteStoreResponse.java rename to src/main/java/dev/openfga/sdk/api/client/model/ClientDeleteStoreResponse.java index 880dd7c..eae9117 100644 --- a/src/main/java/dev/openfga/sdk/api/client/ClientDeleteStoreResponse.java +++ b/src/main/java/dev/openfga/sdk/api/client/model/ClientDeleteStoreResponse.java @@ -10,8 +10,9 @@ * Do not edit the class manually. */ -package dev.openfga.sdk.api.client; +package dev.openfga.sdk.api.client.model; +import dev.openfga.sdk.api.client.ApiResponse; import java.util.List; import java.util.Map; diff --git a/src/main/java/dev/openfga/sdk/api/client/ClientExpandRequest.java b/src/main/java/dev/openfga/sdk/api/client/model/ClientExpandRequest.java similarity index 95% rename from src/main/java/dev/openfga/sdk/api/client/ClientExpandRequest.java rename to src/main/java/dev/openfga/sdk/api/client/model/ClientExpandRequest.java index c2bca29..b945481 100644 --- a/src/main/java/dev/openfga/sdk/api/client/ClientExpandRequest.java +++ b/src/main/java/dev/openfga/sdk/api/client/model/ClientExpandRequest.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package dev.openfga.sdk.api.client; +package dev.openfga.sdk.api.client.model; public class ClientExpandRequest { private String relation; diff --git a/src/main/java/dev/openfga/sdk/api/client/ClientExpandResponse.java b/src/main/java/dev/openfga/sdk/api/client/model/ClientExpandResponse.java similarity index 93% rename from src/main/java/dev/openfga/sdk/api/client/ClientExpandResponse.java rename to src/main/java/dev/openfga/sdk/api/client/model/ClientExpandResponse.java index 7af2f09..54eb9e9 100644 --- a/src/main/java/dev/openfga/sdk/api/client/ClientExpandResponse.java +++ b/src/main/java/dev/openfga/sdk/api/client/model/ClientExpandResponse.java @@ -10,8 +10,9 @@ * Do not edit the class manually. */ -package dev.openfga.sdk.api.client; +package dev.openfga.sdk.api.client.model; +import dev.openfga.sdk.api.client.ApiResponse; import dev.openfga.sdk.api.model.ExpandResponse; import java.util.List; import java.util.Map; diff --git a/src/main/java/dev/openfga/sdk/api/client/ClientGetStoreResponse.java b/src/main/java/dev/openfga/sdk/api/client/model/ClientGetStoreResponse.java similarity index 93% rename from src/main/java/dev/openfga/sdk/api/client/ClientGetStoreResponse.java rename to src/main/java/dev/openfga/sdk/api/client/model/ClientGetStoreResponse.java index b78f175..082ea94 100644 --- a/src/main/java/dev/openfga/sdk/api/client/ClientGetStoreResponse.java +++ b/src/main/java/dev/openfga/sdk/api/client/model/ClientGetStoreResponse.java @@ -10,8 +10,9 @@ * Do not edit the class manually. */ -package dev.openfga.sdk.api.client; +package dev.openfga.sdk.api.client.model; +import dev.openfga.sdk.api.client.ApiResponse; import dev.openfga.sdk.api.model.GetStoreResponse; import java.util.List; import java.util.Map; diff --git a/src/main/java/dev/openfga/sdk/api/client/ClientListObjectsRequest.java b/src/main/java/dev/openfga/sdk/api/client/model/ClientListObjectsRequest.java similarity index 97% rename from src/main/java/dev/openfga/sdk/api/client/ClientListObjectsRequest.java rename to src/main/java/dev/openfga/sdk/api/client/model/ClientListObjectsRequest.java index 9f25b34..b14af92 100644 --- a/src/main/java/dev/openfga/sdk/api/client/ClientListObjectsRequest.java +++ b/src/main/java/dev/openfga/sdk/api/client/model/ClientListObjectsRequest.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package dev.openfga.sdk.api.client; +package dev.openfga.sdk.api.client.model; import java.util.List; diff --git a/src/main/java/dev/openfga/sdk/api/client/ClientListObjectsResponse.java b/src/main/java/dev/openfga/sdk/api/client/model/ClientListObjectsResponse.java similarity index 93% rename from src/main/java/dev/openfga/sdk/api/client/ClientListObjectsResponse.java rename to src/main/java/dev/openfga/sdk/api/client/model/ClientListObjectsResponse.java index 195dabf..68db317 100644 --- a/src/main/java/dev/openfga/sdk/api/client/ClientListObjectsResponse.java +++ b/src/main/java/dev/openfga/sdk/api/client/model/ClientListObjectsResponse.java @@ -10,8 +10,9 @@ * Do not edit the class manually. */ -package dev.openfga.sdk.api.client; +package dev.openfga.sdk.api.client.model; +import dev.openfga.sdk.api.client.ApiResponse; import dev.openfga.sdk.api.model.ListObjectsResponse; import java.util.List; import java.util.Map; diff --git a/src/main/java/dev/openfga/sdk/api/client/ClientListRelationsRequest.java b/src/main/java/dev/openfga/sdk/api/client/model/ClientListRelationsRequest.java similarity index 97% rename from src/main/java/dev/openfga/sdk/api/client/ClientListRelationsRequest.java rename to src/main/java/dev/openfga/sdk/api/client/model/ClientListRelationsRequest.java index 1f122f5..c4d5179 100644 --- a/src/main/java/dev/openfga/sdk/api/client/ClientListRelationsRequest.java +++ b/src/main/java/dev/openfga/sdk/api/client/model/ClientListRelationsRequest.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package dev.openfga.sdk.api.client; +package dev.openfga.sdk.api.client.model; import java.util.List; diff --git a/src/main/java/dev/openfga/sdk/api/client/ClientListRelationsResponse.java b/src/main/java/dev/openfga/sdk/api/client/model/ClientListRelationsResponse.java similarity index 97% rename from src/main/java/dev/openfga/sdk/api/client/ClientListRelationsResponse.java rename to src/main/java/dev/openfga/sdk/api/client/model/ClientListRelationsResponse.java index 4d4d0e6..cd4b79c 100644 --- a/src/main/java/dev/openfga/sdk/api/client/ClientListRelationsResponse.java +++ b/src/main/java/dev/openfga/sdk/api/client/model/ClientListRelationsResponse.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package dev.openfga.sdk.api.client; +package dev.openfga.sdk.api.client.model; import java.util.List; import java.util.stream.Collectors; diff --git a/src/main/java/dev/openfga/sdk/api/client/ClientListStoresResponse.java b/src/main/java/dev/openfga/sdk/api/client/model/ClientListStoresResponse.java similarity index 93% rename from src/main/java/dev/openfga/sdk/api/client/ClientListStoresResponse.java rename to src/main/java/dev/openfga/sdk/api/client/model/ClientListStoresResponse.java index 4924e6f..8d209a4 100644 --- a/src/main/java/dev/openfga/sdk/api/client/ClientListStoresResponse.java +++ b/src/main/java/dev/openfga/sdk/api/client/model/ClientListStoresResponse.java @@ -10,8 +10,9 @@ * Do not edit the class manually. */ -package dev.openfga.sdk.api.client; +package dev.openfga.sdk.api.client.model; +import dev.openfga.sdk.api.client.ApiResponse; import dev.openfga.sdk.api.model.ListStoresResponse; import java.util.List; import java.util.Map; diff --git a/src/main/java/dev/openfga/sdk/api/client/ClientReadAssertionsResponse.java b/src/main/java/dev/openfga/sdk/api/client/model/ClientReadAssertionsResponse.java similarity index 93% rename from src/main/java/dev/openfga/sdk/api/client/ClientReadAssertionsResponse.java rename to src/main/java/dev/openfga/sdk/api/client/model/ClientReadAssertionsResponse.java index e0617d7..710fa50 100644 --- a/src/main/java/dev/openfga/sdk/api/client/ClientReadAssertionsResponse.java +++ b/src/main/java/dev/openfga/sdk/api/client/model/ClientReadAssertionsResponse.java @@ -10,8 +10,9 @@ * Do not edit the class manually. */ -package dev.openfga.sdk.api.client; +package dev.openfga.sdk.api.client.model; +import dev.openfga.sdk.api.client.ApiResponse; import dev.openfga.sdk.api.model.ReadAssertionsResponse; import java.util.List; import java.util.Map; diff --git a/src/main/java/dev/openfga/sdk/api/client/ClientReadAuthorizationModelResponse.java b/src/main/java/dev/openfga/sdk/api/client/model/ClientReadAuthorizationModelResponse.java similarity index 96% rename from src/main/java/dev/openfga/sdk/api/client/ClientReadAuthorizationModelResponse.java rename to src/main/java/dev/openfga/sdk/api/client/model/ClientReadAuthorizationModelResponse.java index 7ea0ac4..a7abb72 100644 --- a/src/main/java/dev/openfga/sdk/api/client/ClientReadAuthorizationModelResponse.java +++ b/src/main/java/dev/openfga/sdk/api/client/model/ClientReadAuthorizationModelResponse.java @@ -10,8 +10,9 @@ * Do not edit the class manually. */ -package dev.openfga.sdk.api.client; +package dev.openfga.sdk.api.client.model; +import dev.openfga.sdk.api.client.ApiResponse; import dev.openfga.sdk.api.model.ReadAuthorizationModelResponse; import dev.openfga.sdk.api.model.ReadAuthorizationModelsResponse; import java.util.List; diff --git a/src/main/java/dev/openfga/sdk/api/client/ClientReadAuthorizationModelsResponse.java b/src/main/java/dev/openfga/sdk/api/client/model/ClientReadAuthorizationModelsResponse.java similarity index 94% rename from src/main/java/dev/openfga/sdk/api/client/ClientReadAuthorizationModelsResponse.java rename to src/main/java/dev/openfga/sdk/api/client/model/ClientReadAuthorizationModelsResponse.java index 8ba5fb3..caa8580 100644 --- a/src/main/java/dev/openfga/sdk/api/client/ClientReadAuthorizationModelsResponse.java +++ b/src/main/java/dev/openfga/sdk/api/client/model/ClientReadAuthorizationModelsResponse.java @@ -10,8 +10,9 @@ * Do not edit the class manually. */ -package dev.openfga.sdk.api.client; +package dev.openfga.sdk.api.client.model; +import dev.openfga.sdk.api.client.ApiResponse; import dev.openfga.sdk.api.model.ReadAuthorizationModelsResponse; import java.util.List; import java.util.Map; diff --git a/src/main/java/dev/openfga/sdk/api/client/ClientReadChangesRequest.java b/src/main/java/dev/openfga/sdk/api/client/model/ClientReadChangesRequest.java similarity index 93% rename from src/main/java/dev/openfga/sdk/api/client/ClientReadChangesRequest.java rename to src/main/java/dev/openfga/sdk/api/client/model/ClientReadChangesRequest.java index 30fb60f..be49d9e 100644 --- a/src/main/java/dev/openfga/sdk/api/client/ClientReadChangesRequest.java +++ b/src/main/java/dev/openfga/sdk/api/client/model/ClientReadChangesRequest.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package dev.openfga.sdk.api.client; +package dev.openfga.sdk.api.client.model; public class ClientReadChangesRequest { private String type; diff --git a/src/main/java/dev/openfga/sdk/api/client/ClientReadChangesResponse.java b/src/main/java/dev/openfga/sdk/api/client/model/ClientReadChangesResponse.java similarity index 93% rename from src/main/java/dev/openfga/sdk/api/client/ClientReadChangesResponse.java rename to src/main/java/dev/openfga/sdk/api/client/model/ClientReadChangesResponse.java index 940ea9a..6087f28 100644 --- a/src/main/java/dev/openfga/sdk/api/client/ClientReadChangesResponse.java +++ b/src/main/java/dev/openfga/sdk/api/client/model/ClientReadChangesResponse.java @@ -10,8 +10,9 @@ * Do not edit the class manually. */ -package dev.openfga.sdk.api.client; +package dev.openfga.sdk.api.client.model; +import dev.openfga.sdk.api.client.ApiResponse; import dev.openfga.sdk.api.model.ReadChangesResponse; import java.util.List; import java.util.Map; diff --git a/src/main/java/dev/openfga/sdk/api/client/ClientReadRequest.java b/src/main/java/dev/openfga/sdk/api/client/model/ClientReadRequest.java similarity index 96% rename from src/main/java/dev/openfga/sdk/api/client/ClientReadRequest.java rename to src/main/java/dev/openfga/sdk/api/client/model/ClientReadRequest.java index 1b9df66..f933f59 100644 --- a/src/main/java/dev/openfga/sdk/api/client/ClientReadRequest.java +++ b/src/main/java/dev/openfga/sdk/api/client/model/ClientReadRequest.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package dev.openfga.sdk.api.client; +package dev.openfga.sdk.api.client.model; public class ClientReadRequest { private String user; diff --git a/src/main/java/dev/openfga/sdk/api/client/ClientReadResponse.java b/src/main/java/dev/openfga/sdk/api/client/model/ClientReadResponse.java similarity index 93% rename from src/main/java/dev/openfga/sdk/api/client/ClientReadResponse.java rename to src/main/java/dev/openfga/sdk/api/client/model/ClientReadResponse.java index e8cec2b..dac98c9 100644 --- a/src/main/java/dev/openfga/sdk/api/client/ClientReadResponse.java +++ b/src/main/java/dev/openfga/sdk/api/client/model/ClientReadResponse.java @@ -10,8 +10,9 @@ * Do not edit the class manually. */ -package dev.openfga.sdk.api.client; +package dev.openfga.sdk.api.client.model; +import dev.openfga.sdk.api.client.ApiResponse; import dev.openfga.sdk.api.model.ReadResponse; import java.util.List; import java.util.Map; diff --git a/src/main/java/dev/openfga/sdk/api/client/ClientRelationshipCondition.java b/src/main/java/dev/openfga/sdk/api/client/model/ClientRelationshipCondition.java similarity index 96% rename from src/main/java/dev/openfga/sdk/api/client/ClientRelationshipCondition.java rename to src/main/java/dev/openfga/sdk/api/client/model/ClientRelationshipCondition.java index 6af608e..af01934 100644 --- a/src/main/java/dev/openfga/sdk/api/client/ClientRelationshipCondition.java +++ b/src/main/java/dev/openfga/sdk/api/client/model/ClientRelationshipCondition.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package dev.openfga.sdk.api.client; +package dev.openfga.sdk.api.client.model; import dev.openfga.sdk.api.model.RelationshipCondition; diff --git a/src/main/java/dev/openfga/sdk/api/client/ClientTupleKey.java b/src/main/java/dev/openfga/sdk/api/client/model/ClientTupleKey.java similarity index 98% rename from src/main/java/dev/openfga/sdk/api/client/ClientTupleKey.java rename to src/main/java/dev/openfga/sdk/api/client/model/ClientTupleKey.java index e1b4539..b944176 100644 --- a/src/main/java/dev/openfga/sdk/api/client/ClientTupleKey.java +++ b/src/main/java/dev/openfga/sdk/api/client/model/ClientTupleKey.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package dev.openfga.sdk.api.client; +package dev.openfga.sdk.api.client.model; import dev.openfga.sdk.api.model.ContextualTupleKeys; import dev.openfga.sdk.api.model.TupleKey; diff --git a/src/main/java/dev/openfga/sdk/api/client/ClientTupleKeyWithoutCondition.java b/src/main/java/dev/openfga/sdk/api/client/model/ClientTupleKeyWithoutCondition.java similarity index 98% rename from src/main/java/dev/openfga/sdk/api/client/ClientTupleKeyWithoutCondition.java rename to src/main/java/dev/openfga/sdk/api/client/model/ClientTupleKeyWithoutCondition.java index 7efad4d..a891103 100644 --- a/src/main/java/dev/openfga/sdk/api/client/ClientTupleKeyWithoutCondition.java +++ b/src/main/java/dev/openfga/sdk/api/client/model/ClientTupleKeyWithoutCondition.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package dev.openfga.sdk.api.client; +package dev.openfga.sdk.api.client.model; import dev.openfga.sdk.api.model.TupleKeyWithoutCondition; import dev.openfga.sdk.api.model.WriteRequestDeletes; diff --git a/src/main/java/dev/openfga/sdk/api/client/ClientWriteAssertionsResponse.java b/src/main/java/dev/openfga/sdk/api/client/model/ClientWriteAssertionsResponse.java similarity index 92% rename from src/main/java/dev/openfga/sdk/api/client/ClientWriteAssertionsResponse.java rename to src/main/java/dev/openfga/sdk/api/client/model/ClientWriteAssertionsResponse.java index 038c9a4..704a8cc 100644 --- a/src/main/java/dev/openfga/sdk/api/client/ClientWriteAssertionsResponse.java +++ b/src/main/java/dev/openfga/sdk/api/client/model/ClientWriteAssertionsResponse.java @@ -10,8 +10,9 @@ * Do not edit the class manually. */ -package dev.openfga.sdk.api.client; +package dev.openfga.sdk.api.client.model; +import dev.openfga.sdk.api.client.ApiResponse; import java.util.List; import java.util.Map; diff --git a/src/main/java/dev/openfga/sdk/api/client/ClientWriteAuthorizationModelResponse.java b/src/main/java/dev/openfga/sdk/api/client/model/ClientWriteAuthorizationModelResponse.java similarity index 93% rename from src/main/java/dev/openfga/sdk/api/client/ClientWriteAuthorizationModelResponse.java rename to src/main/java/dev/openfga/sdk/api/client/model/ClientWriteAuthorizationModelResponse.java index 2de87fc..4678c87 100644 --- a/src/main/java/dev/openfga/sdk/api/client/ClientWriteAuthorizationModelResponse.java +++ b/src/main/java/dev/openfga/sdk/api/client/model/ClientWriteAuthorizationModelResponse.java @@ -10,8 +10,9 @@ * Do not edit the class manually. */ -package dev.openfga.sdk.api.client; +package dev.openfga.sdk.api.client.model; +import dev.openfga.sdk.api.client.ApiResponse; import dev.openfga.sdk.api.model.WriteAuthorizationModelResponse; import java.util.List; import java.util.Map; diff --git a/src/main/java/dev/openfga/sdk/api/client/ClientWriteRequest.java b/src/main/java/dev/openfga/sdk/api/client/model/ClientWriteRequest.java similarity index 96% rename from src/main/java/dev/openfga/sdk/api/client/ClientWriteRequest.java rename to src/main/java/dev/openfga/sdk/api/client/model/ClientWriteRequest.java index fe854c9..a5becff 100644 --- a/src/main/java/dev/openfga/sdk/api/client/ClientWriteRequest.java +++ b/src/main/java/dev/openfga/sdk/api/client/model/ClientWriteRequest.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package dev.openfga.sdk.api.client; +package dev.openfga.sdk.api.client.model; import java.util.List; diff --git a/src/main/java/dev/openfga/sdk/api/client/ClientWriteResponse.java b/src/main/java/dev/openfga/sdk/api/client/model/ClientWriteResponse.java similarity index 92% rename from src/main/java/dev/openfga/sdk/api/client/ClientWriteResponse.java rename to src/main/java/dev/openfga/sdk/api/client/model/ClientWriteResponse.java index 75bb356..aea47b1 100644 --- a/src/main/java/dev/openfga/sdk/api/client/ClientWriteResponse.java +++ b/src/main/java/dev/openfga/sdk/api/client/model/ClientWriteResponse.java @@ -10,8 +10,9 @@ * Do not edit the class manually. */ -package dev.openfga.sdk.api.client; +package dev.openfga.sdk.api.client.model; +import dev.openfga.sdk.api.client.ApiResponse; import java.util.List; import java.util.Map; diff --git a/src/test-integration/java/dev/openfga/sdk/api/OpenFgaApiIntegrationTest.java b/src/test-integration/java/dev/openfga/sdk/api/OpenFgaApiIntegrationTest.java index 8c75ae7..656f177 100644 --- a/src/test-integration/java/dev/openfga/sdk/api/OpenFgaApiIntegrationTest.java +++ b/src/test-integration/java/dev/openfga/sdk/api/OpenFgaApiIntegrationTest.java @@ -16,6 +16,7 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; +import dev.openfga.sdk.api.client.model.*; import dev.openfga.sdk.api.configuration.*; import dev.openfga.sdk.api.model.*; import java.io.IOException; 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 98c9021..76dc811 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 @@ -16,6 +16,7 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; +import dev.openfga.sdk.api.client.model.*; import dev.openfga.sdk.api.configuration.*; import dev.openfga.sdk.api.model.*; import java.io.IOException; diff --git a/src/test/java/dev/openfga/sdk/api/OpenFgaApiTest.java b/src/test/java/dev/openfga/sdk/api/OpenFgaApiTest.java index df99673..fe955ff 100644 --- a/src/test/java/dev/openfga/sdk/api/OpenFgaApiTest.java +++ b/src/test/java/dev/openfga/sdk/api/OpenFgaApiTest.java @@ -19,6 +19,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.pgssoft.httpclient.HttpClientMock; import dev.openfga.sdk.api.client.*; +import dev.openfga.sdk.api.client.model.*; import dev.openfga.sdk.api.configuration.*; import dev.openfga.sdk.api.model.*; import dev.openfga.sdk.errors.*; 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 56083f0..de09cf7 100644 --- a/src/test/java/dev/openfga/sdk/api/client/OpenFgaClientTest.java +++ b/src/test/java/dev/openfga/sdk/api/client/OpenFgaClientTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.pgssoft.httpclient.HttpClientMock; +import dev.openfga.sdk.api.client.model.*; import dev.openfga.sdk.api.configuration.*; import dev.openfga.sdk.api.model.*; import dev.openfga.sdk.errors.*;