diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 503fc48..08f0b5a 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -83,6 +83,7 @@ src/main/java/dev/openfga/sdk/api/client/BaseConfiguration.java src/main/java/dev/openfga/sdk/api/client/ClientCredentials.java src/main/java/dev/openfga/sdk/api/client/Configuration.java src/main/java/dev/openfga/sdk/api/client/Configuration.java +src/main/java/dev/openfga/sdk/api/client/ConfigurationOverride.java src/main/java/dev/openfga/sdk/api/client/CredentialsMethod.java src/main/java/dev/openfga/sdk/api/client/JSON.java src/main/java/dev/openfga/sdk/api/client/Pair.java diff --git a/src/main/java/dev/openfga/sdk/api/OpenFgaApi.java b/src/main/java/dev/openfga/sdk/api/OpenFgaApi.java index 212bd0e..4a381f1 100644 --- a/src/main/java/dev/openfga/sdk/api/OpenFgaApi.java +++ b/src/main/java/dev/openfga/sdk/api/OpenFgaApi.java @@ -18,6 +18,7 @@ import dev.openfga.sdk.api.client.ApiException; import dev.openfga.sdk.api.client.ApiResponse; import dev.openfga.sdk.api.client.Configuration; +import dev.openfga.sdk.api.client.ConfigurationOverride; import dev.openfga.sdk.api.client.Pair; import dev.openfga.sdk.api.model.CheckRequest; import dev.openfga.sdk.api.model.CheckResponse; @@ -39,6 +40,7 @@ import dev.openfga.sdk.api.model.WriteAuthorizationModelRequest; import dev.openfga.sdk.api.model.WriteAuthorizationModelResponse; import dev.openfga.sdk.api.model.WriteRequest; +import dev.openfga.sdk.errors.FgaInvalidParameterException; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -54,11 +56,11 @@ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class OpenFgaApi { private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; - private final Configuration memberVarConfiguration; + private final Configuration configuration; private final Consumer memberVarInterceptor; private final Consumer> memberVarResponseInterceptor; private final Consumer> memberVarAsyncResponseInterceptor; @@ -66,7 +68,7 @@ public class OpenFgaApi { public OpenFgaApi(ApiClient apiClient, Configuration configuration) { memberVarHttpClient = apiClient.getHttpClient(); memberVarObjectMapper = apiClient.getObjectMapper(); - memberVarConfiguration = configuration; + this.configuration = configuration; memberVarInterceptor = apiClient.getRequestInterceptor(); memberVarResponseInterceptor = apiClient.getResponseInterceptor(); memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); @@ -92,8 +94,9 @@ private String formatExceptionMessage(String operationId, int statusCode, String * @return CompletableFuture<CheckResponse> * @throws ApiException if fails to make API call */ - public CompletableFuture check(String storeId, CheckRequest body) throws ApiException { - return check(storeId, body, memberVarConfiguration); + public CompletableFuture check(String storeId, CheckRequest body) + throws ApiException, FgaInvalidParameterException { + return check(storeId, body, this.configuration); } /** @@ -101,12 +104,18 @@ public CompletableFuture check(String storeId, CheckRequest body) * The Check API queries to check if the user has a certain relationship with an object in a certain store. A `contextual_tuples` object may also be included in the body of the request. This object contains one field `tuple_keys`, which is an array of tuple keys. You may also provide an `authorization_model_id` in the body. This will be used to assert that the input `tuple_key` is valid for the model specified. If not specified, the assertion will be made against the latest authorization model ID. It is strongly recommended to specify authorization model id for better performance. The response will return whether the relationship exists in the field `allowed`. ## Example In order to check if user `user:anne` of type `user` has a `reader` relationship with object `document:2021-budget` given the following contextual tuple ```json { \"user\": \"user:anne\", \"relation\": \"member\", \"object\": \"time_slot:office_hours\" } ``` the Check API can be used with the following request body: ```json { \"tuple_key\": { \"user\": \"user:anne\", \"relation\": \"reader\", \"object\": \"document:2021-budget\" }, \"contextual_tuples\": { \"tuple_keys\": [ { \"user\": \"user:anne\", \"relation\": \"member\", \"object\": \"time_slot:office_hours\" } ] }, \"authorization_model_id\": \"01G50QVV17PECNVAHX1GG4Y5NC\" } ``` OpenFGA's response will include `{ \"allowed\": true }` if there is a relationship and `{ \"allowed\": false }` if there isn't. * @param storeId (required) * @param body (required) - * @param configuration Override the configuration this OpenFgaApi was constructed with + * @param configurationOverride Override the {@link Configuration} this OpenFgaApi was constructed with * @return CompletableFuture<CheckResponse> * @throws ApiException if fails to make API call */ - public CompletableFuture check(String storeId, CheckRequest body, Configuration configuration) - throws ApiException { + public CompletableFuture check( + String storeId, CheckRequest body, ConfigurationOverride configurationOverride) + throws ApiException, FgaInvalidParameterException { + return check(storeId, body, this.configuration.override(configurationOverride)); + } + + private CompletableFuture check(String storeId, CheckRequest body, Configuration configuration) + throws ApiException, FgaInvalidParameterException { try { HttpRequest.Builder localVarRequestBuilder = checkRequestBuilder(storeId, body, configuration); return memberVarHttpClient @@ -140,8 +149,8 @@ public CompletableFuture check(String storeId, CheckRequest body, * @throws ApiException if fails to make API call */ public CompletableFuture> checkWithHttpInfo(String storeId, CheckRequest body) - throws ApiException { - return checkWithHttpInfo(storeId, body, memberVarConfiguration); + throws ApiException, FgaInvalidParameterException { + return checkWithHttpInfo(storeId, body, this.configuration); } /** @@ -149,14 +158,21 @@ public CompletableFuture> checkWithHttpInfo(String st * The Check API queries to check if the user has a certain relationship with an object in a certain store. A `contextual_tuples` object may also be included in the body of the request. This object contains one field `tuple_keys`, which is an array of tuple keys. You may also provide an `authorization_model_id` in the body. This will be used to assert that the input `tuple_key` is valid for the model specified. If not specified, the assertion will be made against the latest authorization model ID. It is strongly recommended to specify authorization model id for better performance. The response will return whether the relationship exists in the field `allowed`. ## Example In order to check if user `user:anne` of type `user` has a `reader` relationship with object `document:2021-budget` given the following contextual tuple ```json { \"user\": \"user:anne\", \"relation\": \"member\", \"object\": \"time_slot:office_hours\" } ``` the Check API can be used with the following request body: ```json { \"tuple_key\": { \"user\": \"user:anne\", \"relation\": \"reader\", \"object\": \"document:2021-budget\" }, \"contextual_tuples\": { \"tuple_keys\": [ { \"user\": \"user:anne\", \"relation\": \"member\", \"object\": \"time_slot:office_hours\" } ] }, \"authorization_model_id\": \"01G50QVV17PECNVAHX1GG4Y5NC\" } ``` OpenFGA's response will include `{ \"allowed\": true }` if there is a relationship and `{ \"allowed\": false }` if there isn't. * @param storeId (required) * @param body (required) - * @param configuration Override the configuration this OpenFgaApi was constructed with + * @param configurationOverride Override the {@link Configuration} this OpenFgaApi was constructed with * @return CompletableFuture<ApiResponse<CheckResponse>> * @throws ApiException if fails to make API call */ public CompletableFuture> checkWithHttpInfo( - String storeId, CheckRequest body, Configuration configuration) throws ApiException { + String storeId, CheckRequest body, ConfigurationOverride configurationOverride) + throws ApiException, FgaInvalidParameterException { + return checkWithHttpInfo(storeId, body, this.configuration.override(configurationOverride)); + } + + private CompletableFuture> checkWithHttpInfo( + String storeId, CheckRequest body, Configuration configuration) + throws ApiException, FgaInvalidParameterException { try { - HttpRequest.Builder localVarRequestBuilder = checkRequestBuilder(storeId, body, memberVarConfiguration); + HttpRequest.Builder localVarRequestBuilder = checkRequestBuilder(storeId, body, configuration); return memberVarHttpClient .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) .thenComposeAsync(localVarResponse -> { @@ -185,7 +201,7 @@ public CompletableFuture> checkWithHttpInfo( } private HttpRequest.Builder checkRequestBuilder(String storeId, CheckRequest body, Configuration configuration) - throws ApiException { + throws ApiException, FgaInvalidParameterException { // verify the required parameter 'storeId' is set if (storeId == null) { throw new ApiException(400, "Missing the required parameter 'storeId' when calling check"); @@ -195,11 +211,14 @@ private HttpRequest.Builder checkRequestBuilder(String storeId, CheckRequest bod throw new ApiException(400, "Missing the required parameter 'body' when calling check"); } + // verify the Configuration is valid + configuration.assertValid(); + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); String localVarPath = "/stores/{store_id}/check".replace("{store_id}", ApiClient.urlEncode(storeId.toString())); - localVarRequestBuilder.uri(URI.create(memberVarConfiguration.getApiUrl() + localVarPath)); + localVarRequestBuilder.uri(URI.create(configuration.getApiUrl() + localVarPath)); localVarRequestBuilder.header("Content-Type", "application/json"); localVarRequestBuilder.header("Accept", "application/json"); @@ -210,7 +229,7 @@ private HttpRequest.Builder checkRequestBuilder(String storeId, CheckRequest bod } catch (IOException e) { throw new ApiException(e); } - Duration readTimeout = memberVarConfiguration.getReadTimeout(); + Duration readTimeout = configuration.getReadTimeout(); if (readTimeout != null) { localVarRequestBuilder.timeout(readTimeout); } @@ -227,20 +246,27 @@ private HttpRequest.Builder checkRequestBuilder(String storeId, CheckRequest bod * @return CompletableFuture<CreateStoreResponse> * @throws ApiException if fails to make API call */ - public CompletableFuture createStore(CreateStoreRequest body) throws ApiException { - return createStore(body, memberVarConfiguration); + public CompletableFuture createStore(CreateStoreRequest body) + throws ApiException, FgaInvalidParameterException { + return createStore(body, this.configuration); } /** * Create a store * Create a unique OpenFGA store which will be used to store authorization models and relationship tuples. * @param body (required) - * @param configuration Override the configuration this OpenFgaApi was constructed with + * @param configurationOverride Override the {@link Configuration} this OpenFgaApi was constructed with * @return CompletableFuture<CreateStoreResponse> * @throws ApiException if fails to make API call */ - public CompletableFuture createStore(CreateStoreRequest body, Configuration configuration) - throws ApiException { + public CompletableFuture createStore( + CreateStoreRequest body, ConfigurationOverride configurationOverride) + throws ApiException, FgaInvalidParameterException { + return createStore(body, this.configuration.override(configurationOverride)); + } + + private CompletableFuture createStore(CreateStoreRequest body, Configuration configuration) + throws ApiException, FgaInvalidParameterException { try { HttpRequest.Builder localVarRequestBuilder = createStoreRequestBuilder(body, configuration); return memberVarHttpClient @@ -273,22 +299,28 @@ public CompletableFuture createStore(CreateStoreRequest bod * @throws ApiException if fails to make API call */ public CompletableFuture> createStoreWithHttpInfo(CreateStoreRequest body) - throws ApiException { - return createStoreWithHttpInfo(body, memberVarConfiguration); + throws ApiException, FgaInvalidParameterException { + return createStoreWithHttpInfo(body, this.configuration); } /** * Create a store * Create a unique OpenFGA store which will be used to store authorization models and relationship tuples. * @param body (required) - * @param configuration Override the configuration this OpenFgaApi was constructed with + * @param configurationOverride Override the {@link Configuration} this OpenFgaApi was constructed with * @return CompletableFuture<ApiResponse<CreateStoreResponse>> * @throws ApiException if fails to make API call */ public CompletableFuture> createStoreWithHttpInfo( - CreateStoreRequest body, Configuration configuration) throws ApiException { + CreateStoreRequest body, ConfigurationOverride configurationOverride) + throws ApiException, FgaInvalidParameterException { + return createStoreWithHttpInfo(body, this.configuration.override(configurationOverride)); + } + + private CompletableFuture> createStoreWithHttpInfo( + CreateStoreRequest body, Configuration configuration) throws ApiException, FgaInvalidParameterException { try { - HttpRequest.Builder localVarRequestBuilder = createStoreRequestBuilder(body, memberVarConfiguration); + HttpRequest.Builder localVarRequestBuilder = createStoreRequestBuilder(body, configuration); return memberVarHttpClient .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) .thenComposeAsync(localVarResponse -> { @@ -317,17 +349,20 @@ public CompletableFuture> createStoreWithHttpIn } private HttpRequest.Builder createStoreRequestBuilder(CreateStoreRequest body, Configuration configuration) - throws ApiException { + throws ApiException, FgaInvalidParameterException { // verify the required parameter 'body' is set if (body == null) { throw new ApiException(400, "Missing the required parameter 'body' when calling createStore"); } + // verify the Configuration is valid + configuration.assertValid(); + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); String localVarPath = "/stores"; - localVarRequestBuilder.uri(URI.create(memberVarConfiguration.getApiUrl() + localVarPath)); + localVarRequestBuilder.uri(URI.create(configuration.getApiUrl() + localVarPath)); localVarRequestBuilder.header("Content-Type", "application/json"); localVarRequestBuilder.header("Accept", "application/json"); @@ -338,7 +373,7 @@ private HttpRequest.Builder createStoreRequestBuilder(CreateStoreRequest body, C } catch (IOException e) { throw new ApiException(e); } - Duration readTimeout = memberVarConfiguration.getReadTimeout(); + Duration readTimeout = configuration.getReadTimeout(); if (readTimeout != null) { localVarRequestBuilder.timeout(readTimeout); } @@ -355,19 +390,25 @@ private HttpRequest.Builder createStoreRequestBuilder(CreateStoreRequest body, C * @return CompletableFuture<Void> * @throws ApiException if fails to make API call */ - public CompletableFuture deleteStore(String storeId) throws ApiException { - return deleteStore(storeId, memberVarConfiguration); + public CompletableFuture deleteStore(String storeId) throws ApiException, FgaInvalidParameterException { + return deleteStore(storeId, this.configuration); } /** * Delete a store * Delete an OpenFGA store. This does not delete the data associated with the store, like tuples or authorization models. * @param storeId (required) - * @param configuration Override the configuration this OpenFgaApi was constructed with + * @param configurationOverride Override the {@link Configuration} this OpenFgaApi was constructed with * @return CompletableFuture<Void> * @throws ApiException if fails to make API call */ - public CompletableFuture deleteStore(String storeId, Configuration configuration) throws ApiException { + public CompletableFuture deleteStore(String storeId, ConfigurationOverride configurationOverride) + throws ApiException, FgaInvalidParameterException { + return deleteStore(storeId, this.configuration.override(configurationOverride)); + } + + private CompletableFuture deleteStore(String storeId, Configuration configuration) + throws ApiException, FgaInvalidParameterException { try { HttpRequest.Builder localVarRequestBuilder = deleteStoreRequestBuilder(storeId, configuration); return memberVarHttpClient @@ -390,22 +431,29 @@ public CompletableFuture deleteStore(String storeId, Configuration configu * @return CompletableFuture<ApiResponse<Void>> * @throws ApiException if fails to make API call */ - public CompletableFuture> deleteStoreWithHttpInfo(String storeId) throws ApiException { - return deleteStoreWithHttpInfo(storeId, memberVarConfiguration); + public CompletableFuture> deleteStoreWithHttpInfo(String storeId) + throws ApiException, FgaInvalidParameterException { + return deleteStoreWithHttpInfo(storeId, this.configuration); } /** * Delete a store * Delete an OpenFGA store. This does not delete the data associated with the store, like tuples or authorization models. * @param storeId (required) - * @param configuration Override the configuration this OpenFgaApi was constructed with + * @param configurationOverride Override the {@link Configuration} this OpenFgaApi was constructed with * @return CompletableFuture<ApiResponse<Void>> * @throws ApiException if fails to make API call */ - public CompletableFuture> deleteStoreWithHttpInfo(String storeId, Configuration configuration) - throws ApiException { + public CompletableFuture> deleteStoreWithHttpInfo( + String storeId, ConfigurationOverride configurationOverride) + throws ApiException, FgaInvalidParameterException { + return deleteStoreWithHttpInfo(storeId, this.configuration.override(configurationOverride)); + } + + private CompletableFuture> deleteStoreWithHttpInfo(String storeId, Configuration configuration) + throws ApiException, FgaInvalidParameterException { try { - HttpRequest.Builder localVarRequestBuilder = deleteStoreRequestBuilder(storeId, memberVarConfiguration); + HttpRequest.Builder localVarRequestBuilder = deleteStoreRequestBuilder(storeId, configuration); return memberVarHttpClient .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) .thenComposeAsync(localVarResponse -> { @@ -426,22 +474,25 @@ public CompletableFuture> deleteStoreWithHttpInfo(String store } private HttpRequest.Builder deleteStoreRequestBuilder(String storeId, Configuration configuration) - throws ApiException { + throws ApiException, FgaInvalidParameterException { // verify the required parameter 'storeId' is set if (storeId == null) { throw new ApiException(400, "Missing the required parameter 'storeId' when calling deleteStore"); } + // verify the Configuration is valid + configuration.assertValid(); + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); String localVarPath = "/stores/{store_id}".replace("{store_id}", ApiClient.urlEncode(storeId.toString())); - localVarRequestBuilder.uri(URI.create(memberVarConfiguration.getApiUrl() + localVarPath)); + localVarRequestBuilder.uri(URI.create(configuration.getApiUrl() + localVarPath)); localVarRequestBuilder.header("Accept", "application/json"); localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); - Duration readTimeout = memberVarConfiguration.getReadTimeout(); + Duration readTimeout = configuration.getReadTimeout(); if (readTimeout != null) { localVarRequestBuilder.timeout(readTimeout); } @@ -459,8 +510,9 @@ private HttpRequest.Builder deleteStoreRequestBuilder(String storeId, Configurat * @return CompletableFuture<ExpandResponse> * @throws ApiException if fails to make API call */ - public CompletableFuture expand(String storeId, ExpandRequest body) throws ApiException { - return expand(storeId, body, memberVarConfiguration); + public CompletableFuture expand(String storeId, ExpandRequest body) + throws ApiException, FgaInvalidParameterException { + return expand(storeId, body, this.configuration); } /** @@ -468,12 +520,18 @@ public CompletableFuture expand(String storeId, ExpandRequest bo * The Expand API will return all users and usersets that have certain relationship with an object in a certain store. This is different from the `/stores/{store_id}/read` API in that both users and computed usersets are returned. Body parameters `tuple_key.object` and `tuple_key.relation` are all required. The response will return a tree whose leaves are the specific users and usersets. Union, intersection and difference operator are located in the intermediate nodes. ## Example To expand all users that have the `reader` relationship with object `document:2021-budget`, use the Expand API with the following request body ```json { \"tuple_key\": { \"object\": \"document:2021-budget\", \"relation\": \"reader\" }, \"authorization_model_id\": \"01G50QVV17PECNVAHX1GG4Y5NC\" } ``` OpenFGA's response will be a userset tree of the users and usersets that have read access to the document. ```json { \"tree\":{ \"root\":{ \"type\":\"document:2021-budget#reader\", \"union\":{ \"nodes\":[ { \"type\":\"document:2021-budget#reader\", \"leaf\":{ \"users\":{ \"users\":[ \"user:bob\" ] } } }, { \"type\":\"document:2021-budget#reader\", \"leaf\":{ \"computed\":{ \"userset\":\"document:2021-budget#writer\" } } } ] } } } } ``` The caller can then call expand API for the `writer` relationship for the `document:2021-budget`. * @param storeId (required) * @param body (required) - * @param configuration Override the configuration this OpenFgaApi was constructed with + * @param configurationOverride Override the {@link Configuration} this OpenFgaApi was constructed with * @return CompletableFuture<ExpandResponse> * @throws ApiException if fails to make API call */ - public CompletableFuture expand(String storeId, ExpandRequest body, Configuration configuration) - throws ApiException { + public CompletableFuture expand( + String storeId, ExpandRequest body, ConfigurationOverride configurationOverride) + throws ApiException, FgaInvalidParameterException { + return expand(storeId, body, this.configuration.override(configurationOverride)); + } + + private CompletableFuture expand(String storeId, ExpandRequest body, Configuration configuration) + throws ApiException, FgaInvalidParameterException { try { HttpRequest.Builder localVarRequestBuilder = expandRequestBuilder(storeId, body, configuration); return memberVarHttpClient @@ -507,8 +565,8 @@ public CompletableFuture expand(String storeId, ExpandRequest bo * @throws ApiException if fails to make API call */ public CompletableFuture> expandWithHttpInfo(String storeId, ExpandRequest body) - throws ApiException { - return expandWithHttpInfo(storeId, body, memberVarConfiguration); + throws ApiException, FgaInvalidParameterException { + return expandWithHttpInfo(storeId, body, this.configuration); } /** @@ -516,14 +574,21 @@ public CompletableFuture> expandWithHttpInfo(String * The Expand API will return all users and usersets that have certain relationship with an object in a certain store. This is different from the `/stores/{store_id}/read` API in that both users and computed usersets are returned. Body parameters `tuple_key.object` and `tuple_key.relation` are all required. The response will return a tree whose leaves are the specific users and usersets. Union, intersection and difference operator are located in the intermediate nodes. ## Example To expand all users that have the `reader` relationship with object `document:2021-budget`, use the Expand API with the following request body ```json { \"tuple_key\": { \"object\": \"document:2021-budget\", \"relation\": \"reader\" }, \"authorization_model_id\": \"01G50QVV17PECNVAHX1GG4Y5NC\" } ``` OpenFGA's response will be a userset tree of the users and usersets that have read access to the document. ```json { \"tree\":{ \"root\":{ \"type\":\"document:2021-budget#reader\", \"union\":{ \"nodes\":[ { \"type\":\"document:2021-budget#reader\", \"leaf\":{ \"users\":{ \"users\":[ \"user:bob\" ] } } }, { \"type\":\"document:2021-budget#reader\", \"leaf\":{ \"computed\":{ \"userset\":\"document:2021-budget#writer\" } } } ] } } } } ``` The caller can then call expand API for the `writer` relationship for the `document:2021-budget`. * @param storeId (required) * @param body (required) - * @param configuration Override the configuration this OpenFgaApi was constructed with + * @param configurationOverride Override the {@link Configuration} this OpenFgaApi was constructed with * @return CompletableFuture<ApiResponse<ExpandResponse>> * @throws ApiException if fails to make API call */ public CompletableFuture> expandWithHttpInfo( - String storeId, ExpandRequest body, Configuration configuration) throws ApiException { + String storeId, ExpandRequest body, ConfigurationOverride configurationOverride) + throws ApiException, FgaInvalidParameterException { + return expandWithHttpInfo(storeId, body, this.configuration.override(configurationOverride)); + } + + private CompletableFuture> expandWithHttpInfo( + String storeId, ExpandRequest body, Configuration configuration) + throws ApiException, FgaInvalidParameterException { try { - HttpRequest.Builder localVarRequestBuilder = expandRequestBuilder(storeId, body, memberVarConfiguration); + HttpRequest.Builder localVarRequestBuilder = expandRequestBuilder(storeId, body, configuration); return memberVarHttpClient .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) .thenComposeAsync(localVarResponse -> { @@ -552,7 +617,7 @@ public CompletableFuture> expandWithHttpInfo( } private HttpRequest.Builder expandRequestBuilder(String storeId, ExpandRequest body, Configuration configuration) - throws ApiException { + throws ApiException, FgaInvalidParameterException { // verify the required parameter 'storeId' is set if (storeId == null) { throw new ApiException(400, "Missing the required parameter 'storeId' when calling expand"); @@ -562,12 +627,15 @@ private HttpRequest.Builder expandRequestBuilder(String storeId, ExpandRequest b throw new ApiException(400, "Missing the required parameter 'body' when calling expand"); } + // verify the Configuration is valid + configuration.assertValid(); + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); String localVarPath = "/stores/{store_id}/expand".replace("{store_id}", ApiClient.urlEncode(storeId.toString())); - localVarRequestBuilder.uri(URI.create(memberVarConfiguration.getApiUrl() + localVarPath)); + localVarRequestBuilder.uri(URI.create(configuration.getApiUrl() + localVarPath)); localVarRequestBuilder.header("Content-Type", "application/json"); localVarRequestBuilder.header("Accept", "application/json"); @@ -578,7 +646,7 @@ private HttpRequest.Builder expandRequestBuilder(String storeId, ExpandRequest b } catch (IOException e) { throw new ApiException(e); } - Duration readTimeout = memberVarConfiguration.getReadTimeout(); + Duration readTimeout = configuration.getReadTimeout(); if (readTimeout != null) { localVarRequestBuilder.timeout(readTimeout); } @@ -595,20 +663,26 @@ private HttpRequest.Builder expandRequestBuilder(String storeId, ExpandRequest b * @return CompletableFuture<GetStoreResponse> * @throws ApiException if fails to make API call */ - public CompletableFuture getStore(String storeId) throws ApiException { - return getStore(storeId, memberVarConfiguration); + public CompletableFuture getStore(String storeId) + throws ApiException, FgaInvalidParameterException { + return getStore(storeId, this.configuration); } /** * Get a store * Returns an OpenFGA store by its identifier * @param storeId (required) - * @param configuration Override the configuration this OpenFgaApi was constructed with + * @param configurationOverride Override the {@link Configuration} this OpenFgaApi was constructed with * @return CompletableFuture<GetStoreResponse> * @throws ApiException if fails to make API call */ - public CompletableFuture getStore(String storeId, Configuration configuration) - throws ApiException { + public CompletableFuture getStore(String storeId, ConfigurationOverride configurationOverride) + throws ApiException, FgaInvalidParameterException { + return getStore(storeId, this.configuration.override(configurationOverride)); + } + + private CompletableFuture getStore(String storeId, Configuration configuration) + throws ApiException, FgaInvalidParameterException { try { HttpRequest.Builder localVarRequestBuilder = getStoreRequestBuilder(storeId, configuration); return memberVarHttpClient @@ -640,22 +714,29 @@ public CompletableFuture getStore(String storeId, Configuratio * @return CompletableFuture<ApiResponse<GetStoreResponse>> * @throws ApiException if fails to make API call */ - public CompletableFuture> getStoreWithHttpInfo(String storeId) throws ApiException { - return getStoreWithHttpInfo(storeId, memberVarConfiguration); + public CompletableFuture> getStoreWithHttpInfo(String storeId) + throws ApiException, FgaInvalidParameterException { + return getStoreWithHttpInfo(storeId, this.configuration); } /** * Get a store * Returns an OpenFGA store by its identifier * @param storeId (required) - * @param configuration Override the configuration this OpenFgaApi was constructed with + * @param configurationOverride Override the {@link Configuration} this OpenFgaApi was constructed with * @return CompletableFuture<ApiResponse<GetStoreResponse>> * @throws ApiException if fails to make API call */ public CompletableFuture> getStoreWithHttpInfo( - String storeId, Configuration configuration) throws ApiException { + String storeId, ConfigurationOverride configurationOverride) + throws ApiException, FgaInvalidParameterException { + return getStoreWithHttpInfo(storeId, this.configuration.override(configurationOverride)); + } + + private CompletableFuture> getStoreWithHttpInfo( + String storeId, Configuration configuration) throws ApiException, FgaInvalidParameterException { try { - HttpRequest.Builder localVarRequestBuilder = getStoreRequestBuilder(storeId, memberVarConfiguration); + HttpRequest.Builder localVarRequestBuilder = getStoreRequestBuilder(storeId, configuration); return memberVarHttpClient .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) .thenComposeAsync(localVarResponse -> { @@ -684,22 +765,25 @@ public CompletableFuture> getStoreWithHttpInfo( } private HttpRequest.Builder getStoreRequestBuilder(String storeId, Configuration configuration) - throws ApiException { + throws ApiException, FgaInvalidParameterException { // verify the required parameter 'storeId' is set if (storeId == null) { throw new ApiException(400, "Missing the required parameter 'storeId' when calling getStore"); } + // verify the Configuration is valid + configuration.assertValid(); + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); String localVarPath = "/stores/{store_id}".replace("{store_id}", ApiClient.urlEncode(storeId.toString())); - localVarRequestBuilder.uri(URI.create(memberVarConfiguration.getApiUrl() + localVarPath)); + localVarRequestBuilder.uri(URI.create(configuration.getApiUrl() + localVarPath)); localVarRequestBuilder.header("Accept", "application/json"); localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); - Duration readTimeout = memberVarConfiguration.getReadTimeout(); + Duration readTimeout = configuration.getReadTimeout(); if (readTimeout != null) { localVarRequestBuilder.timeout(readTimeout); } @@ -718,8 +802,8 @@ private HttpRequest.Builder getStoreRequestBuilder(String storeId, Configuration * @throws ApiException if fails to make API call */ public CompletableFuture listObjects(String storeId, ListObjectsRequest body) - throws ApiException { - return listObjects(storeId, body, memberVarConfiguration); + throws ApiException, FgaInvalidParameterException { + return listObjects(storeId, body, this.configuration); } /** @@ -727,12 +811,19 @@ public CompletableFuture listObjects(String storeId, ListOb * The ListObjects API returns a list of all the objects of the given type that the user has a relation with. To achieve this, both the store tuples and the authorization model are used. An `authorization_model_id` may be specified in the body. If it is not specified, the latest authorization model ID will be used. It is strongly recommended to specify authorization model id for better performance. You may also specify `contextual_tuples` that will be treated as regular tuples. The response will contain the related objects in an array in the \"objects\" field of the response and they will be strings in the object format `<type>:<id>` (e.g. \"document:roadmap\"). The number of objects in the response array will be limited by the execution timeout specified in the flag OPENFGA_LIST_OBJECTS_DEADLINE and by the upper bound specified in the flag OPENFGA_LIST_OBJECTS_MAX_RESULTS, whichever is hit first. * @param storeId (required) * @param body (required) - * @param configuration Override the configuration this OpenFgaApi was constructed with + * @param configurationOverride Override the {@link Configuration} this OpenFgaApi was constructed with * @return CompletableFuture<ListObjectsResponse> * @throws ApiException if fails to make API call */ public CompletableFuture listObjects( - String storeId, ListObjectsRequest body, Configuration configuration) throws ApiException { + String storeId, ListObjectsRequest body, ConfigurationOverride configurationOverride) + throws ApiException, FgaInvalidParameterException { + return listObjects(storeId, body, this.configuration.override(configurationOverride)); + } + + private CompletableFuture listObjects( + String storeId, ListObjectsRequest body, Configuration configuration) + throws ApiException, FgaInvalidParameterException { try { HttpRequest.Builder localVarRequestBuilder = listObjectsRequestBuilder(storeId, body, configuration); return memberVarHttpClient @@ -766,8 +857,8 @@ public CompletableFuture listObjects( * @throws ApiException if fails to make API call */ public CompletableFuture> listObjectsWithHttpInfo( - String storeId, ListObjectsRequest body) throws ApiException { - return listObjectsWithHttpInfo(storeId, body, memberVarConfiguration); + String storeId, ListObjectsRequest body) throws ApiException, FgaInvalidParameterException { + return listObjectsWithHttpInfo(storeId, body, this.configuration); } /** @@ -775,15 +866,21 @@ public CompletableFuture> listObjectsWithHttpIn * The ListObjects API returns a list of all the objects of the given type that the user has a relation with. To achieve this, both the store tuples and the authorization model are used. An `authorization_model_id` may be specified in the body. If it is not specified, the latest authorization model ID will be used. It is strongly recommended to specify authorization model id for better performance. You may also specify `contextual_tuples` that will be treated as regular tuples. The response will contain the related objects in an array in the \"objects\" field of the response and they will be strings in the object format `<type>:<id>` (e.g. \"document:roadmap\"). The number of objects in the response array will be limited by the execution timeout specified in the flag OPENFGA_LIST_OBJECTS_DEADLINE and by the upper bound specified in the flag OPENFGA_LIST_OBJECTS_MAX_RESULTS, whichever is hit first. * @param storeId (required) * @param body (required) - * @param configuration Override the configuration this OpenFgaApi was constructed with + * @param configurationOverride Override the {@link Configuration} this OpenFgaApi was constructed with * @return CompletableFuture<ApiResponse<ListObjectsResponse>> * @throws ApiException if fails to make API call */ public CompletableFuture> listObjectsWithHttpInfo( - String storeId, ListObjectsRequest body, Configuration configuration) throws ApiException { + String storeId, ListObjectsRequest body, ConfigurationOverride configurationOverride) + throws ApiException, FgaInvalidParameterException { + return listObjectsWithHttpInfo(storeId, body, this.configuration.override(configurationOverride)); + } + + private CompletableFuture> listObjectsWithHttpInfo( + String storeId, ListObjectsRequest body, Configuration configuration) + throws ApiException, FgaInvalidParameterException { try { - HttpRequest.Builder localVarRequestBuilder = - listObjectsRequestBuilder(storeId, body, memberVarConfiguration); + HttpRequest.Builder localVarRequestBuilder = listObjectsRequestBuilder(storeId, body, configuration); return memberVarHttpClient .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) .thenComposeAsync(localVarResponse -> { @@ -812,7 +909,8 @@ public CompletableFuture> listObjectsWithHttpIn } private HttpRequest.Builder listObjectsRequestBuilder( - String storeId, ListObjectsRequest body, Configuration configuration) throws ApiException { + String storeId, ListObjectsRequest body, Configuration configuration) + throws ApiException, FgaInvalidParameterException { // verify the required parameter 'storeId' is set if (storeId == null) { throw new ApiException(400, "Missing the required parameter 'storeId' when calling listObjects"); @@ -822,12 +920,15 @@ private HttpRequest.Builder listObjectsRequestBuilder( throw new ApiException(400, "Missing the required parameter 'body' when calling listObjects"); } + // verify the Configuration is valid + configuration.assertValid(); + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); String localVarPath = "/stores/{store_id}/list-objects".replace("{store_id}", ApiClient.urlEncode(storeId.toString())); - localVarRequestBuilder.uri(URI.create(memberVarConfiguration.getApiUrl() + localVarPath)); + localVarRequestBuilder.uri(URI.create(configuration.getApiUrl() + localVarPath)); localVarRequestBuilder.header("Content-Type", "application/json"); localVarRequestBuilder.header("Accept", "application/json"); @@ -838,7 +939,7 @@ private HttpRequest.Builder listObjectsRequestBuilder( } catch (IOException e) { throw new ApiException(e); } - Duration readTimeout = memberVarConfiguration.getReadTimeout(); + Duration readTimeout = configuration.getReadTimeout(); if (readTimeout != null) { localVarRequestBuilder.timeout(readTimeout); } @@ -857,8 +958,8 @@ private HttpRequest.Builder listObjectsRequestBuilder( * @throws ApiException if fails to make API call */ public CompletableFuture listStores(Integer pageSize, String continuationToken) - throws ApiException { - return listStores(pageSize, continuationToken, memberVarConfiguration); + throws ApiException, FgaInvalidParameterException { + return listStores(pageSize, continuationToken, this.configuration); } /** @@ -866,12 +967,19 @@ public CompletableFuture listStores(Integer pageSize, String * Returns a paginated list of OpenFGA stores and a continuation token to get additional stores. The continuation token will be empty if there are no more stores. * @param pageSize (optional) * @param continuationToken (optional) - * @param configuration Override the configuration this OpenFgaApi was constructed with + * @param configurationOverride Override the {@link Configuration} this OpenFgaApi was constructed with * @return CompletableFuture<ListStoresResponse> * @throws ApiException if fails to make API call */ public CompletableFuture listStores( - Integer pageSize, String continuationToken, Configuration configuration) throws ApiException { + Integer pageSize, String continuationToken, ConfigurationOverride configurationOverride) + throws ApiException, FgaInvalidParameterException { + return listStores(pageSize, continuationToken, this.configuration.override(configurationOverride)); + } + + private CompletableFuture listStores( + Integer pageSize, String continuationToken, Configuration configuration) + throws ApiException, FgaInvalidParameterException { try { HttpRequest.Builder localVarRequestBuilder = listStoresRequestBuilder(pageSize, continuationToken, configuration); @@ -906,8 +1014,8 @@ public CompletableFuture listStores( * @throws ApiException if fails to make API call */ public CompletableFuture> listStoresWithHttpInfo( - Integer pageSize, String continuationToken) throws ApiException { - return listStoresWithHttpInfo(pageSize, continuationToken, memberVarConfiguration); + Integer pageSize, String continuationToken) throws ApiException, FgaInvalidParameterException { + return listStoresWithHttpInfo(pageSize, continuationToken, this.configuration); } /** @@ -915,15 +1023,22 @@ public CompletableFuture> listStoresWithHttpInfo * Returns a paginated list of OpenFGA stores and a continuation token to get additional stores. The continuation token will be empty if there are no more stores. * @param pageSize (optional) * @param continuationToken (optional) - * @param configuration Override the configuration this OpenFgaApi was constructed with + * @param configurationOverride Override the {@link Configuration} this OpenFgaApi was constructed with * @return CompletableFuture<ApiResponse<ListStoresResponse>> * @throws ApiException if fails to make API call */ public CompletableFuture> listStoresWithHttpInfo( - Integer pageSize, String continuationToken, Configuration configuration) throws ApiException { + Integer pageSize, String continuationToken, ConfigurationOverride configurationOverride) + throws ApiException, FgaInvalidParameterException { + return listStoresWithHttpInfo(pageSize, continuationToken, this.configuration.override(configurationOverride)); + } + + private CompletableFuture> listStoresWithHttpInfo( + Integer pageSize, String continuationToken, Configuration configuration) + throws ApiException, FgaInvalidParameterException { try { HttpRequest.Builder localVarRequestBuilder = - listStoresRequestBuilder(pageSize, continuationToken, memberVarConfiguration); + listStoresRequestBuilder(pageSize, continuationToken, configuration); return memberVarHttpClient .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) .thenComposeAsync(localVarResponse -> { @@ -952,7 +1067,11 @@ public CompletableFuture> listStoresWithHttpInfo } private HttpRequest.Builder listStoresRequestBuilder( - Integer pageSize, String continuationToken, Configuration configuration) throws ApiException { + Integer pageSize, String continuationToken, Configuration configuration) + throws ApiException, FgaInvalidParameterException { + + // verify the Configuration is valid + configuration.assertValid(); HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -973,15 +1092,15 @@ private HttpRequest.Builder listStoresRequestBuilder( queryJoiner.add(localVarQueryStringJoiner.toString()); } localVarRequestBuilder.uri( - URI.create(memberVarConfiguration.getApiUrl() + localVarPath + '?' + queryJoiner.toString())); + URI.create(configuration.getApiUrl() + localVarPath + '?' + queryJoiner.toString())); } else { - localVarRequestBuilder.uri(URI.create(memberVarConfiguration.getApiUrl() + localVarPath)); + localVarRequestBuilder.uri(URI.create(configuration.getApiUrl() + localVarPath)); } localVarRequestBuilder.header("Accept", "application/json"); localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); - Duration readTimeout = memberVarConfiguration.getReadTimeout(); + Duration readTimeout = configuration.getReadTimeout(); if (readTimeout != null) { localVarRequestBuilder.timeout(readTimeout); } @@ -999,8 +1118,9 @@ private HttpRequest.Builder listStoresRequestBuilder( * @return CompletableFuture<ReadResponse> * @throws ApiException if fails to make API call */ - public CompletableFuture read(String storeId, ReadRequest body) throws ApiException { - return read(storeId, body, memberVarConfiguration); + public CompletableFuture read(String storeId, ReadRequest body) + throws ApiException, FgaInvalidParameterException { + return read(storeId, body, this.configuration); } /** @@ -1008,12 +1128,18 @@ public CompletableFuture read(String storeId, ReadRequest body) th * The Read API will return the tuples for a certain store that match a query filter specified in the body of the request. It is different from the `/stores/{store_id}/expand` API in that it only returns relationship tuples that are stored in the system and satisfy the query. In the body: 1. `tuple_key` is optional. If not specified, it will return all tuples in the store. 2. `tuple_key.object` is mandatory if `tuple_key` is specified. It can be a full object (e.g., `type:object_id`) or type only (e.g., `type:`). 3. `tuple_key.user` is mandatory if tuple_key is specified in the case the `tuple_key.object` is a type only. ## Examples ### Query for all objects in a type definition To query for all objects that `user:bob` has `reader` relationship in the `document` type definition, call read API with body of ```json { \"tuple_key\": { \"user\": \"user:bob\", \"relation\": \"reader\", \"object\": \"document:\" } } ``` The API will return tuples and a continuation token, something like ```json { \"tuples\": [ { \"key\": { \"user\": \"user:bob\", \"relation\": \"reader\", \"object\": \"document:2021-budget\" }, \"timestamp\": \"2021-10-06T15:32:11.128Z\" } ], \"continuation_token\": \"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ==\" } ``` This means that `user:bob` has a `reader` relationship with 1 document `document:2021-budget`. Note that this API, unlike the List Objects API, does not evaluate the tuples in the store. The continuation token will be empty if there are no more tuples to query.### Query for all stored relationship tuples that have a particular relation and object To query for all users that have `reader` relationship with `document:2021-budget`, call read API with body of ```json { \"tuple_key\": { \"object\": \"document:2021-budget\", \"relation\": \"reader\" } } ``` The API will return something like ```json { \"tuples\": [ { \"key\": { \"user\": \"user:bob\", \"relation\": \"reader\", \"object\": \"document:2021-budget\" }, \"timestamp\": \"2021-10-06T15:32:11.128Z\" } ], \"continuation_token\": \"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ==\" } ``` This means that `document:2021-budget` has 1 `reader` (`user:bob`). Note that, even if the model said that all `writers` are also `readers`, the API will not return writers such as `user:anne` because it only returns tuples and does not evaluate them. ### Query for all users with all relationships for a particular document To query for all users that have any relationship with `document:2021-budget`, call read API with body of ```json { \"tuple_key\": { \"object\": \"document:2021-budget\" } } ``` The API will return something like ```json { \"tuples\": [ { \"key\": { \"user\": \"user:anne\", \"relation\": \"writer\", \"object\": \"document:2021-budget\" }, \"timestamp\": \"2021-10-05T13:42:12.356Z\" }, { \"key\": { \"user\": \"user:bob\", \"relation\": \"reader\", \"object\": \"document:2021-budget\" }, \"timestamp\": \"2021-10-06T15:32:11.128Z\" } ], \"continuation_token\": \"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ==\" } ``` This means that `document:2021-budget` has 1 `reader` (`user:bob`) and 1 `writer` (`user:anne`). * @param storeId (required) * @param body (required) - * @param configuration Override the configuration this OpenFgaApi was constructed with + * @param configurationOverride Override the {@link Configuration} this OpenFgaApi was constructed with * @return CompletableFuture<ReadResponse> * @throws ApiException if fails to make API call */ - public CompletableFuture read(String storeId, ReadRequest body, Configuration configuration) - throws ApiException { + public CompletableFuture read( + String storeId, ReadRequest body, ConfigurationOverride configurationOverride) + throws ApiException, FgaInvalidParameterException { + return read(storeId, body, this.configuration.override(configurationOverride)); + } + + private CompletableFuture read(String storeId, ReadRequest body, Configuration configuration) + throws ApiException, FgaInvalidParameterException { try { HttpRequest.Builder localVarRequestBuilder = readRequestBuilder(storeId, body, configuration); return memberVarHttpClient @@ -1047,8 +1173,8 @@ public CompletableFuture read(String storeId, ReadRequest body, Co * @throws ApiException if fails to make API call */ public CompletableFuture> readWithHttpInfo(String storeId, ReadRequest body) - throws ApiException { - return readWithHttpInfo(storeId, body, memberVarConfiguration); + throws ApiException, FgaInvalidParameterException { + return readWithHttpInfo(storeId, body, this.configuration); } /** @@ -1056,14 +1182,21 @@ public CompletableFuture> readWithHttpInfo(String stor * The Read API will return the tuples for a certain store that match a query filter specified in the body of the request. It is different from the `/stores/{store_id}/expand` API in that it only returns relationship tuples that are stored in the system and satisfy the query. In the body: 1. `tuple_key` is optional. If not specified, it will return all tuples in the store. 2. `tuple_key.object` is mandatory if `tuple_key` is specified. It can be a full object (e.g., `type:object_id`) or type only (e.g., `type:`). 3. `tuple_key.user` is mandatory if tuple_key is specified in the case the `tuple_key.object` is a type only. ## Examples ### Query for all objects in a type definition To query for all objects that `user:bob` has `reader` relationship in the `document` type definition, call read API with body of ```json { \"tuple_key\": { \"user\": \"user:bob\", \"relation\": \"reader\", \"object\": \"document:\" } } ``` The API will return tuples and a continuation token, something like ```json { \"tuples\": [ { \"key\": { \"user\": \"user:bob\", \"relation\": \"reader\", \"object\": \"document:2021-budget\" }, \"timestamp\": \"2021-10-06T15:32:11.128Z\" } ], \"continuation_token\": \"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ==\" } ``` This means that `user:bob` has a `reader` relationship with 1 document `document:2021-budget`. Note that this API, unlike the List Objects API, does not evaluate the tuples in the store. The continuation token will be empty if there are no more tuples to query.### Query for all stored relationship tuples that have a particular relation and object To query for all users that have `reader` relationship with `document:2021-budget`, call read API with body of ```json { \"tuple_key\": { \"object\": \"document:2021-budget\", \"relation\": \"reader\" } } ``` The API will return something like ```json { \"tuples\": [ { \"key\": { \"user\": \"user:bob\", \"relation\": \"reader\", \"object\": \"document:2021-budget\" }, \"timestamp\": \"2021-10-06T15:32:11.128Z\" } ], \"continuation_token\": \"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ==\" } ``` This means that `document:2021-budget` has 1 `reader` (`user:bob`). Note that, even if the model said that all `writers` are also `readers`, the API will not return writers such as `user:anne` because it only returns tuples and does not evaluate them. ### Query for all users with all relationships for a particular document To query for all users that have any relationship with `document:2021-budget`, call read API with body of ```json { \"tuple_key\": { \"object\": \"document:2021-budget\" } } ``` The API will return something like ```json { \"tuples\": [ { \"key\": { \"user\": \"user:anne\", \"relation\": \"writer\", \"object\": \"document:2021-budget\" }, \"timestamp\": \"2021-10-05T13:42:12.356Z\" }, { \"key\": { \"user\": \"user:bob\", \"relation\": \"reader\", \"object\": \"document:2021-budget\" }, \"timestamp\": \"2021-10-06T15:32:11.128Z\" } ], \"continuation_token\": \"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ==\" } ``` This means that `document:2021-budget` has 1 `reader` (`user:bob`) and 1 `writer` (`user:anne`). * @param storeId (required) * @param body (required) - * @param configuration Override the configuration this OpenFgaApi was constructed with + * @param configurationOverride Override the {@link Configuration} this OpenFgaApi was constructed with * @return CompletableFuture<ApiResponse<ReadResponse>> * @throws ApiException if fails to make API call */ public CompletableFuture> readWithHttpInfo( - String storeId, ReadRequest body, Configuration configuration) throws ApiException { + String storeId, ReadRequest body, ConfigurationOverride configurationOverride) + throws ApiException, FgaInvalidParameterException { + return readWithHttpInfo(storeId, body, this.configuration.override(configurationOverride)); + } + + private CompletableFuture> readWithHttpInfo( + String storeId, ReadRequest body, Configuration configuration) + throws ApiException, FgaInvalidParameterException { try { - HttpRequest.Builder localVarRequestBuilder = readRequestBuilder(storeId, body, memberVarConfiguration); + HttpRequest.Builder localVarRequestBuilder = readRequestBuilder(storeId, body, configuration); return memberVarHttpClient .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) .thenComposeAsync(localVarResponse -> { @@ -1092,7 +1225,7 @@ public CompletableFuture> readWithHttpInfo( } private HttpRequest.Builder readRequestBuilder(String storeId, ReadRequest body, Configuration configuration) - throws ApiException { + throws ApiException, FgaInvalidParameterException { // verify the required parameter 'storeId' is set if (storeId == null) { throw new ApiException(400, "Missing the required parameter 'storeId' when calling read"); @@ -1102,11 +1235,14 @@ private HttpRequest.Builder readRequestBuilder(String storeId, ReadRequest body, throw new ApiException(400, "Missing the required parameter 'body' when calling read"); } + // verify the Configuration is valid + configuration.assertValid(); + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); String localVarPath = "/stores/{store_id}/read".replace("{store_id}", ApiClient.urlEncode(storeId.toString())); - localVarRequestBuilder.uri(URI.create(memberVarConfiguration.getApiUrl() + localVarPath)); + localVarRequestBuilder.uri(URI.create(configuration.getApiUrl() + localVarPath)); localVarRequestBuilder.header("Content-Type", "application/json"); localVarRequestBuilder.header("Accept", "application/json"); @@ -1117,7 +1253,7 @@ private HttpRequest.Builder readRequestBuilder(String storeId, ReadRequest body, } catch (IOException e) { throw new ApiException(e); } - Duration readTimeout = memberVarConfiguration.getReadTimeout(); + Duration readTimeout = configuration.getReadTimeout(); if (readTimeout != null) { localVarRequestBuilder.timeout(readTimeout); } @@ -1136,8 +1272,8 @@ private HttpRequest.Builder readRequestBuilder(String storeId, ReadRequest body, * @throws ApiException if fails to make API call */ public CompletableFuture readAssertions(String storeId, String authorizationModelId) - throws ApiException { - return readAssertions(storeId, authorizationModelId, memberVarConfiguration); + throws ApiException, FgaInvalidParameterException { + return readAssertions(storeId, authorizationModelId, this.configuration); } /** @@ -1145,12 +1281,19 @@ public CompletableFuture readAssertions(String storeId, * The ReadAssertions API will return, for a given authorization model id, all the assertions stored for it. An assertion is an object that contains a tuple key, and the expectation of whether a call to the Check API of that tuple key will return true or false. * @param storeId (required) * @param authorizationModelId (required) - * @param configuration Override the configuration this OpenFgaApi was constructed with + * @param configurationOverride Override the {@link Configuration} this OpenFgaApi was constructed with * @return CompletableFuture<ReadAssertionsResponse> * @throws ApiException if fails to make API call */ public CompletableFuture readAssertions( - String storeId, String authorizationModelId, Configuration configuration) throws ApiException { + String storeId, String authorizationModelId, ConfigurationOverride configurationOverride) + throws ApiException, FgaInvalidParameterException { + return readAssertions(storeId, authorizationModelId, this.configuration.override(configurationOverride)); + } + + private CompletableFuture readAssertions( + String storeId, String authorizationModelId, Configuration configuration) + throws ApiException, FgaInvalidParameterException { try { HttpRequest.Builder localVarRequestBuilder = readAssertionsRequestBuilder(storeId, authorizationModelId, configuration); @@ -1185,8 +1328,8 @@ public CompletableFuture readAssertions( * @throws ApiException if fails to make API call */ public CompletableFuture> readAssertionsWithHttpInfo( - String storeId, String authorizationModelId) throws ApiException { - return readAssertionsWithHttpInfo(storeId, authorizationModelId, memberVarConfiguration); + String storeId, String authorizationModelId) throws ApiException, FgaInvalidParameterException { + return readAssertionsWithHttpInfo(storeId, authorizationModelId, this.configuration); } /** @@ -1194,15 +1337,23 @@ public CompletableFuture> readAssertionsWith * The ReadAssertions API will return, for a given authorization model id, all the assertions stored for it. An assertion is an object that contains a tuple key, and the expectation of whether a call to the Check API of that tuple key will return true or false. * @param storeId (required) * @param authorizationModelId (required) - * @param configuration Override the configuration this OpenFgaApi was constructed with + * @param configurationOverride Override the {@link Configuration} this OpenFgaApi was constructed with * @return CompletableFuture<ApiResponse<ReadAssertionsResponse>> * @throws ApiException if fails to make API call */ public CompletableFuture> readAssertionsWithHttpInfo( - String storeId, String authorizationModelId, Configuration configuration) throws ApiException { + String storeId, String authorizationModelId, ConfigurationOverride configurationOverride) + throws ApiException, FgaInvalidParameterException { + return readAssertionsWithHttpInfo( + storeId, authorizationModelId, this.configuration.override(configurationOverride)); + } + + private CompletableFuture> readAssertionsWithHttpInfo( + String storeId, String authorizationModelId, Configuration configuration) + throws ApiException, FgaInvalidParameterException { try { HttpRequest.Builder localVarRequestBuilder = - readAssertionsRequestBuilder(storeId, authorizationModelId, memberVarConfiguration); + readAssertionsRequestBuilder(storeId, authorizationModelId, configuration); return memberVarHttpClient .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) .thenComposeAsync(localVarResponse -> { @@ -1231,7 +1382,8 @@ public CompletableFuture> readAssertionsWith } private HttpRequest.Builder readAssertionsRequestBuilder( - String storeId, String authorizationModelId, Configuration configuration) throws ApiException { + String storeId, String authorizationModelId, Configuration configuration) + throws ApiException, FgaInvalidParameterException { // verify the required parameter 'storeId' is set if (storeId == null) { throw new ApiException(400, "Missing the required parameter 'storeId' when calling readAssertions"); @@ -1242,18 +1394,21 @@ private HttpRequest.Builder readAssertionsRequestBuilder( 400, "Missing the required parameter 'authorizationModelId' when calling readAssertions"); } + // verify the Configuration is valid + configuration.assertValid(); + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); String localVarPath = "/stores/{store_id}/assertions/{authorization_model_id}" .replace("{store_id}", ApiClient.urlEncode(storeId.toString())) .replace("{authorization_model_id}", ApiClient.urlEncode(authorizationModelId.toString())); - localVarRequestBuilder.uri(URI.create(memberVarConfiguration.getApiUrl() + localVarPath)); + localVarRequestBuilder.uri(URI.create(configuration.getApiUrl() + localVarPath)); localVarRequestBuilder.header("Accept", "application/json"); localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); - Duration readTimeout = memberVarConfiguration.getReadTimeout(); + Duration readTimeout = configuration.getReadTimeout(); if (readTimeout != null) { localVarRequestBuilder.timeout(readTimeout); } @@ -1272,8 +1427,8 @@ private HttpRequest.Builder readAssertionsRequestBuilder( * @throws ApiException if fails to make API call */ public CompletableFuture readAuthorizationModel(String storeId, String id) - throws ApiException { - return readAuthorizationModel(storeId, id, memberVarConfiguration); + throws ApiException, FgaInvalidParameterException { + return readAuthorizationModel(storeId, id, this.configuration); } /** @@ -1281,12 +1436,18 @@ public CompletableFuture readAuthorizationModel( * The ReadAuthorizationModel API returns an authorization model by its identifier. The response will return the authorization model for the particular version. ## Example To retrieve the authorization model with ID `01G5JAVJ41T49E9TT3SKVS7X1J` for the store, call the GET authorization-models by ID API with `01G5JAVJ41T49E9TT3SKVS7X1J` as the `id` path parameter. The API will return: ```json { \"authorization_model\":{ \"id\":\"01G5JAVJ41T49E9TT3SKVS7X1J\", \"type_definitions\":[ { \"type\":\"user\" }, { \"type\":\"document\", \"relations\":{ \"reader\":{ \"union\":{ \"child\":[ { \"this\":{} }, { \"computedUserset\":{ \"object\":\"\", \"relation\":\"writer\" } } ] } }, \"writer\":{ \"this\":{} } } } ] } } ``` In the above example, there are 2 types (`user` and `document`). The `document` type has 2 relations (`writer` and `reader`). * @param storeId (required) * @param id (required) - * @param configuration Override the configuration this OpenFgaApi was constructed with + * @param configurationOverride Override the {@link Configuration} this OpenFgaApi was constructed with * @return CompletableFuture<ReadAuthorizationModelResponse> * @throws ApiException if fails to make API call */ public CompletableFuture readAuthorizationModel( - String storeId, String id, Configuration configuration) throws ApiException { + String storeId, String id, ConfigurationOverride configurationOverride) + throws ApiException, FgaInvalidParameterException { + return readAuthorizationModel(storeId, id, this.configuration.override(configurationOverride)); + } + + private CompletableFuture readAuthorizationModel( + String storeId, String id, Configuration configuration) throws ApiException, FgaInvalidParameterException { try { HttpRequest.Builder localVarRequestBuilder = readAuthorizationModelRequestBuilder(storeId, id, configuration); @@ -1323,8 +1484,8 @@ public CompletableFuture readAuthorizationModel( * @throws ApiException if fails to make API call */ public CompletableFuture> readAuthorizationModelWithHttpInfo( - String storeId, String id) throws ApiException { - return readAuthorizationModelWithHttpInfo(storeId, id, memberVarConfiguration); + String storeId, String id) throws ApiException, FgaInvalidParameterException { + return readAuthorizationModelWithHttpInfo(storeId, id, this.configuration); } /** @@ -1332,15 +1493,21 @@ public CompletableFuture> readAuthor * The ReadAuthorizationModel API returns an authorization model by its identifier. The response will return the authorization model for the particular version. ## Example To retrieve the authorization model with ID `01G5JAVJ41T49E9TT3SKVS7X1J` for the store, call the GET authorization-models by ID API with `01G5JAVJ41T49E9TT3SKVS7X1J` as the `id` path parameter. The API will return: ```json { \"authorization_model\":{ \"id\":\"01G5JAVJ41T49E9TT3SKVS7X1J\", \"type_definitions\":[ { \"type\":\"user\" }, { \"type\":\"document\", \"relations\":{ \"reader\":{ \"union\":{ \"child\":[ { \"this\":{} }, { \"computedUserset\":{ \"object\":\"\", \"relation\":\"writer\" } } ] } }, \"writer\":{ \"this\":{} } } } ] } } ``` In the above example, there are 2 types (`user` and `document`). The `document` type has 2 relations (`writer` and `reader`). * @param storeId (required) * @param id (required) - * @param configuration Override the configuration this OpenFgaApi was constructed with + * @param configurationOverride Override the {@link Configuration} this OpenFgaApi was constructed with * @return CompletableFuture<ApiResponse<ReadAuthorizationModelResponse>> * @throws ApiException if fails to make API call */ public CompletableFuture> readAuthorizationModelWithHttpInfo( - String storeId, String id, Configuration configuration) throws ApiException { + String storeId, String id, ConfigurationOverride configurationOverride) + throws ApiException, FgaInvalidParameterException { + return readAuthorizationModelWithHttpInfo(storeId, id, this.configuration.override(configurationOverride)); + } + + private CompletableFuture> readAuthorizationModelWithHttpInfo( + String storeId, String id, Configuration configuration) throws ApiException, FgaInvalidParameterException { try { HttpRequest.Builder localVarRequestBuilder = - readAuthorizationModelRequestBuilder(storeId, id, memberVarConfiguration); + readAuthorizationModelRequestBuilder(storeId, id, configuration); return memberVarHttpClient .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) .thenComposeAsync(localVarResponse -> { @@ -1371,7 +1538,7 @@ public CompletableFuture> readAuthor } private HttpRequest.Builder readAuthorizationModelRequestBuilder( - String storeId, String id, Configuration configuration) throws ApiException { + String storeId, String id, Configuration configuration) throws ApiException, FgaInvalidParameterException { // verify the required parameter 'storeId' is set if (storeId == null) { throw new ApiException(400, "Missing the required parameter 'storeId' when calling readAuthorizationModel"); @@ -1381,18 +1548,21 @@ private HttpRequest.Builder readAuthorizationModelRequestBuilder( throw new ApiException(400, "Missing the required parameter 'id' when calling readAuthorizationModel"); } + // verify the Configuration is valid + configuration.assertValid(); + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); String localVarPath = "/stores/{store_id}/authorization-models/{id}" .replace("{store_id}", ApiClient.urlEncode(storeId.toString())) .replace("{id}", ApiClient.urlEncode(id.toString())); - localVarRequestBuilder.uri(URI.create(memberVarConfiguration.getApiUrl() + localVarPath)); + localVarRequestBuilder.uri(URI.create(configuration.getApiUrl() + localVarPath)); localVarRequestBuilder.header("Accept", "application/json"); localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); - Duration readTimeout = memberVarConfiguration.getReadTimeout(); + Duration readTimeout = configuration.getReadTimeout(); if (readTimeout != null) { localVarRequestBuilder.timeout(readTimeout); } @@ -1412,8 +1582,9 @@ private HttpRequest.Builder readAuthorizationModelRequestBuilder( * @throws ApiException if fails to make API call */ public CompletableFuture readAuthorizationModels( - String storeId, Integer pageSize, String continuationToken) throws ApiException { - return readAuthorizationModels(storeId, pageSize, continuationToken, memberVarConfiguration); + String storeId, Integer pageSize, String continuationToken) + throws ApiException, FgaInvalidParameterException { + return readAuthorizationModels(storeId, pageSize, continuationToken, this.configuration); } /** @@ -1422,13 +1593,20 @@ public CompletableFuture readAuthorizationModel * @param storeId (required) * @param pageSize (optional) * @param continuationToken (optional) - * @param configuration Override the configuration this OpenFgaApi was constructed with + * @param configurationOverride Override the {@link Configuration} this OpenFgaApi was constructed with * @return CompletableFuture<ReadAuthorizationModelsResponse> * @throws ApiException if fails to make API call */ public CompletableFuture readAuthorizationModels( + String storeId, Integer pageSize, String continuationToken, ConfigurationOverride configurationOverride) + throws ApiException, FgaInvalidParameterException { + return readAuthorizationModels( + storeId, pageSize, continuationToken, this.configuration.override(configurationOverride)); + } + + private CompletableFuture readAuthorizationModels( String storeId, Integer pageSize, String continuationToken, Configuration configuration) - throws ApiException { + throws ApiException, FgaInvalidParameterException { try { HttpRequest.Builder localVarRequestBuilder = readAuthorizationModelsRequestBuilder(storeId, pageSize, continuationToken, configuration); @@ -1466,8 +1644,9 @@ public CompletableFuture readAuthorizationModel * @throws ApiException if fails to make API call */ public CompletableFuture> readAuthorizationModelsWithHttpInfo( - String storeId, Integer pageSize, String continuationToken) throws ApiException { - return readAuthorizationModelsWithHttpInfo(storeId, pageSize, continuationToken, memberVarConfiguration); + String storeId, Integer pageSize, String continuationToken) + throws ApiException, FgaInvalidParameterException { + return readAuthorizationModelsWithHttpInfo(storeId, pageSize, continuationToken, this.configuration); } /** @@ -1476,16 +1655,23 @@ public CompletableFuture> readAutho * @param storeId (required) * @param pageSize (optional) * @param continuationToken (optional) - * @param configuration Override the configuration this OpenFgaApi was constructed with + * @param configurationOverride Override the {@link Configuration} this OpenFgaApi was constructed with * @return CompletableFuture<ApiResponse<ReadAuthorizationModelsResponse>> * @throws ApiException if fails to make API call */ public CompletableFuture> readAuthorizationModelsWithHttpInfo( + String storeId, Integer pageSize, String continuationToken, ConfigurationOverride configurationOverride) + throws ApiException, FgaInvalidParameterException { + return readAuthorizationModelsWithHttpInfo( + storeId, pageSize, continuationToken, this.configuration.override(configurationOverride)); + } + + private CompletableFuture> readAuthorizationModelsWithHttpInfo( String storeId, Integer pageSize, String continuationToken, Configuration configuration) - throws ApiException { + throws ApiException, FgaInvalidParameterException { try { HttpRequest.Builder localVarRequestBuilder = - readAuthorizationModelsRequestBuilder(storeId, pageSize, continuationToken, memberVarConfiguration); + readAuthorizationModelsRequestBuilder(storeId, pageSize, continuationToken, configuration); return memberVarHttpClient .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) .thenComposeAsync(localVarResponse -> { @@ -1517,13 +1703,16 @@ public CompletableFuture> readAutho private HttpRequest.Builder readAuthorizationModelsRequestBuilder( String storeId, Integer pageSize, String continuationToken, Configuration configuration) - throws ApiException { + throws ApiException, FgaInvalidParameterException { // verify the required parameter 'storeId' is set if (storeId == null) { throw new ApiException( 400, "Missing the required parameter 'storeId' when calling readAuthorizationModels"); } + // verify the Configuration is valid + configuration.assertValid(); + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); String localVarPath = "/stores/{store_id}/authorization-models" @@ -1544,15 +1733,15 @@ private HttpRequest.Builder readAuthorizationModelsRequestBuilder( queryJoiner.add(localVarQueryStringJoiner.toString()); } localVarRequestBuilder.uri( - URI.create(memberVarConfiguration.getApiUrl() + localVarPath + '?' + queryJoiner.toString())); + URI.create(configuration.getApiUrl() + localVarPath + '?' + queryJoiner.toString())); } else { - localVarRequestBuilder.uri(URI.create(memberVarConfiguration.getApiUrl() + localVarPath)); + localVarRequestBuilder.uri(URI.create(configuration.getApiUrl() + localVarPath)); } localVarRequestBuilder.header("Accept", "application/json"); localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); - Duration readTimeout = memberVarConfiguration.getReadTimeout(); + Duration readTimeout = configuration.getReadTimeout(); if (readTimeout != null) { localVarRequestBuilder.timeout(readTimeout); } @@ -1573,8 +1762,9 @@ private HttpRequest.Builder readAuthorizationModelsRequestBuilder( * @throws ApiException if fails to make API call */ public CompletableFuture readChanges( - String storeId, String type, Integer pageSize, String continuationToken) throws ApiException { - return readChanges(storeId, type, pageSize, continuationToken, memberVarConfiguration); + String storeId, String type, Integer pageSize, String continuationToken) + throws ApiException, FgaInvalidParameterException { + return readChanges(storeId, type, pageSize, continuationToken, this.configuration); } /** @@ -1584,13 +1774,24 @@ public CompletableFuture readChanges( * @param type (optional) * @param pageSize (optional) * @param continuationToken (optional) - * @param configuration Override the configuration this OpenFgaApi was constructed with + * @param configurationOverride Override the {@link Configuration} this OpenFgaApi was constructed with * @return CompletableFuture<ReadChangesResponse> * @throws ApiException if fails to make API call */ public CompletableFuture readChanges( + String storeId, + String type, + Integer pageSize, + String continuationToken, + ConfigurationOverride configurationOverride) + throws ApiException, FgaInvalidParameterException { + return readChanges( + storeId, type, pageSize, continuationToken, this.configuration.override(configurationOverride)); + } + + private CompletableFuture readChanges( String storeId, String type, Integer pageSize, String continuationToken, Configuration configuration) - throws ApiException { + throws ApiException, FgaInvalidParameterException { try { HttpRequest.Builder localVarRequestBuilder = readChangesRequestBuilder(storeId, type, pageSize, continuationToken, configuration); @@ -1627,8 +1828,9 @@ public CompletableFuture readChanges( * @throws ApiException if fails to make API call */ public CompletableFuture> readChangesWithHttpInfo( - String storeId, String type, Integer pageSize, String continuationToken) throws ApiException { - return readChangesWithHttpInfo(storeId, type, pageSize, continuationToken, memberVarConfiguration); + String storeId, String type, Integer pageSize, String continuationToken) + throws ApiException, FgaInvalidParameterException { + return readChangesWithHttpInfo(storeId, type, pageSize, continuationToken, this.configuration); } /** @@ -1638,16 +1840,27 @@ public CompletableFuture> readChangesWithHttpIn * @param type (optional) * @param pageSize (optional) * @param continuationToken (optional) - * @param configuration Override the configuration this OpenFgaApi was constructed with + * @param configurationOverride Override the {@link Configuration} this OpenFgaApi was constructed with * @return CompletableFuture<ApiResponse<ReadChangesResponse>> * @throws ApiException if fails to make API call */ public CompletableFuture> readChangesWithHttpInfo( + String storeId, + String type, + Integer pageSize, + String continuationToken, + ConfigurationOverride configurationOverride) + throws ApiException, FgaInvalidParameterException { + return readChangesWithHttpInfo( + storeId, type, pageSize, continuationToken, this.configuration.override(configurationOverride)); + } + + private CompletableFuture> readChangesWithHttpInfo( String storeId, String type, Integer pageSize, String continuationToken, Configuration configuration) - throws ApiException { + throws ApiException, FgaInvalidParameterException { try { HttpRequest.Builder localVarRequestBuilder = - readChangesRequestBuilder(storeId, type, pageSize, continuationToken, memberVarConfiguration); + readChangesRequestBuilder(storeId, type, pageSize, continuationToken, configuration); return memberVarHttpClient .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) .thenComposeAsync(localVarResponse -> { @@ -1677,12 +1890,15 @@ public CompletableFuture> readChangesWithHttpIn private HttpRequest.Builder readChangesRequestBuilder( String storeId, String type, Integer pageSize, String continuationToken, Configuration configuration) - throws ApiException { + throws ApiException, FgaInvalidParameterException { // verify the required parameter 'storeId' is set if (storeId == null) { throw new ApiException(400, "Missing the required parameter 'storeId' when calling readChanges"); } + // verify the Configuration is valid + configuration.assertValid(); + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); String localVarPath = @@ -1705,15 +1921,15 @@ private HttpRequest.Builder readChangesRequestBuilder( queryJoiner.add(localVarQueryStringJoiner.toString()); } localVarRequestBuilder.uri( - URI.create(memberVarConfiguration.getApiUrl() + localVarPath + '?' + queryJoiner.toString())); + URI.create(configuration.getApiUrl() + localVarPath + '?' + queryJoiner.toString())); } else { - localVarRequestBuilder.uri(URI.create(memberVarConfiguration.getApiUrl() + localVarPath)); + localVarRequestBuilder.uri(URI.create(configuration.getApiUrl() + localVarPath)); } localVarRequestBuilder.header("Accept", "application/json"); localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); - Duration readTimeout = memberVarConfiguration.getReadTimeout(); + Duration readTimeout = configuration.getReadTimeout(); if (readTimeout != null) { localVarRequestBuilder.timeout(readTimeout); } @@ -1731,8 +1947,9 @@ private HttpRequest.Builder readChangesRequestBuilder( * @return CompletableFuture<Object> * @throws ApiException if fails to make API call */ - public CompletableFuture write(String storeId, WriteRequest body) throws ApiException { - return write(storeId, body, memberVarConfiguration); + public CompletableFuture write(String storeId, WriteRequest body) + throws ApiException, FgaInvalidParameterException { + return write(storeId, body, this.configuration); } /** @@ -1740,12 +1957,18 @@ public CompletableFuture write(String storeId, WriteRequest body) throws * The Write API will update the tuples for a certain store. Tuples and type definitions allow OpenFGA to determine whether a relationship exists between an object and an user. In the body, `writes` adds new tuples while `deletes` removes existing tuples. The API is not idempotent: if, later on, you try to add the same tuple, or if you try to delete a non-existing tuple, it will throw an error. An `authorization_model_id` may be specified in the body. If it is, it will be used to assert that each written tuple (not deleted) is valid for the model specified. If it is not specified, the latest authorization model ID will be used. ## Example ### Adding relationships To add `user:anne` as a `writer` for `document:2021-budget`, call write API with the following ```json { \"writes\": { \"tuple_keys\": [ { \"user\": \"user:anne\", \"relation\": \"writer\", \"object\": \"document:2021-budget\" } ] }, \"authorization_model_id\": \"01G50QVV17PECNVAHX1GG4Y5NC\" } ``` ### Removing relationships To remove `user:bob` as a `reader` for `document:2021-budget`, call write API with the following ```json { \"deletes\": { \"tuple_keys\": [ { \"user\": \"user:bob\", \"relation\": \"reader\", \"object\": \"document:2021-budget\" } ] } } ``` * @param storeId (required) * @param body (required) - * @param configuration Override the configuration this OpenFgaApi was constructed with + * @param configurationOverride Override the {@link Configuration} this OpenFgaApi was constructed with * @return CompletableFuture<Object> * @throws ApiException if fails to make API call */ - public CompletableFuture write(String storeId, WriteRequest body, Configuration configuration) - throws ApiException { + public CompletableFuture write( + String storeId, WriteRequest body, ConfigurationOverride configurationOverride) + throws ApiException, FgaInvalidParameterException { + return write(storeId, body, this.configuration.override(configurationOverride)); + } + + private CompletableFuture write(String storeId, WriteRequest body, Configuration configuration) + throws ApiException, FgaInvalidParameterException { try { HttpRequest.Builder localVarRequestBuilder = writeRequestBuilder(storeId, body, configuration); return memberVarHttpClient @@ -1779,8 +2002,8 @@ public CompletableFuture write(String storeId, WriteRequest body, Config * @throws ApiException if fails to make API call */ public CompletableFuture> writeWithHttpInfo(String storeId, WriteRequest body) - throws ApiException { - return writeWithHttpInfo(storeId, body, memberVarConfiguration); + throws ApiException, FgaInvalidParameterException { + return writeWithHttpInfo(storeId, body, this.configuration); } /** @@ -1788,14 +2011,21 @@ public CompletableFuture> writeWithHttpInfo(String storeId, * The Write API will update the tuples for a certain store. Tuples and type definitions allow OpenFGA to determine whether a relationship exists between an object and an user. In the body, `writes` adds new tuples while `deletes` removes existing tuples. The API is not idempotent: if, later on, you try to add the same tuple, or if you try to delete a non-existing tuple, it will throw an error. An `authorization_model_id` may be specified in the body. If it is, it will be used to assert that each written tuple (not deleted) is valid for the model specified. If it is not specified, the latest authorization model ID will be used. ## Example ### Adding relationships To add `user:anne` as a `writer` for `document:2021-budget`, call write API with the following ```json { \"writes\": { \"tuple_keys\": [ { \"user\": \"user:anne\", \"relation\": \"writer\", \"object\": \"document:2021-budget\" } ] }, \"authorization_model_id\": \"01G50QVV17PECNVAHX1GG4Y5NC\" } ``` ### Removing relationships To remove `user:bob` as a `reader` for `document:2021-budget`, call write API with the following ```json { \"deletes\": { \"tuple_keys\": [ { \"user\": \"user:bob\", \"relation\": \"reader\", \"object\": \"document:2021-budget\" } ] } } ``` * @param storeId (required) * @param body (required) - * @param configuration Override the configuration this OpenFgaApi was constructed with + * @param configurationOverride Override the {@link Configuration} this OpenFgaApi was constructed with * @return CompletableFuture<ApiResponse<Object>> * @throws ApiException if fails to make API call */ public CompletableFuture> writeWithHttpInfo( - String storeId, WriteRequest body, Configuration configuration) throws ApiException { + String storeId, WriteRequest body, ConfigurationOverride configurationOverride) + throws ApiException, FgaInvalidParameterException { + return writeWithHttpInfo(storeId, body, this.configuration.override(configurationOverride)); + } + + private CompletableFuture> writeWithHttpInfo( + String storeId, WriteRequest body, Configuration configuration) + throws ApiException, FgaInvalidParameterException { try { - HttpRequest.Builder localVarRequestBuilder = writeRequestBuilder(storeId, body, memberVarConfiguration); + HttpRequest.Builder localVarRequestBuilder = writeRequestBuilder(storeId, body, configuration); return memberVarHttpClient .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) .thenComposeAsync(localVarResponse -> { @@ -1824,7 +2054,7 @@ public CompletableFuture> writeWithHttpInfo( } private HttpRequest.Builder writeRequestBuilder(String storeId, WriteRequest body, Configuration configuration) - throws ApiException { + throws ApiException, FgaInvalidParameterException { // verify the required parameter 'storeId' is set if (storeId == null) { throw new ApiException(400, "Missing the required parameter 'storeId' when calling write"); @@ -1834,11 +2064,14 @@ private HttpRequest.Builder writeRequestBuilder(String storeId, WriteRequest bod throw new ApiException(400, "Missing the required parameter 'body' when calling write"); } + // verify the Configuration is valid + configuration.assertValid(); + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); String localVarPath = "/stores/{store_id}/write".replace("{store_id}", ApiClient.urlEncode(storeId.toString())); - localVarRequestBuilder.uri(URI.create(memberVarConfiguration.getApiUrl() + localVarPath)); + localVarRequestBuilder.uri(URI.create(configuration.getApiUrl() + localVarPath)); localVarRequestBuilder.header("Content-Type", "application/json"); localVarRequestBuilder.header("Accept", "application/json"); @@ -1849,7 +2082,7 @@ private HttpRequest.Builder writeRequestBuilder(String storeId, WriteRequest bod } catch (IOException e) { throw new ApiException(e); } - Duration readTimeout = memberVarConfiguration.getReadTimeout(); + Duration readTimeout = configuration.getReadTimeout(); if (readTimeout != null) { localVarRequestBuilder.timeout(readTimeout); } @@ -1869,8 +2102,9 @@ private HttpRequest.Builder writeRequestBuilder(String storeId, WriteRequest bod * @throws ApiException if fails to make API call */ public CompletableFuture writeAssertions( - String storeId, String authorizationModelId, WriteAssertionsRequest body) throws ApiException { - return writeAssertions(storeId, authorizationModelId, body, memberVarConfiguration); + String storeId, String authorizationModelId, WriteAssertionsRequest body) + throws ApiException, FgaInvalidParameterException { + return writeAssertions(storeId, authorizationModelId, body, this.configuration); } /** @@ -1879,13 +2113,22 @@ public CompletableFuture writeAssertions( * @param storeId (required) * @param authorizationModelId (required) * @param body (required) - * @param configuration Override the configuration this OpenFgaApi was constructed with + * @param configurationOverride Override the {@link Configuration} this OpenFgaApi was constructed with * @return CompletableFuture<Void> * @throws ApiException if fails to make API call */ public CompletableFuture writeAssertions( + String storeId, + String authorizationModelId, + WriteAssertionsRequest body, + ConfigurationOverride configurationOverride) + throws ApiException, FgaInvalidParameterException { + return writeAssertions(storeId, authorizationModelId, body, this.configuration.override(configurationOverride)); + } + + private CompletableFuture writeAssertions( String storeId, String authorizationModelId, WriteAssertionsRequest body, Configuration configuration) - throws ApiException { + throws ApiException, FgaInvalidParameterException { try { HttpRequest.Builder localVarRequestBuilder = writeAssertionsRequestBuilder(storeId, authorizationModelId, body, configuration); @@ -1912,8 +2155,9 @@ public CompletableFuture writeAssertions( * @throws ApiException if fails to make API call */ public CompletableFuture> writeAssertionsWithHttpInfo( - String storeId, String authorizationModelId, WriteAssertionsRequest body) throws ApiException { - return writeAssertionsWithHttpInfo(storeId, authorizationModelId, body, memberVarConfiguration); + String storeId, String authorizationModelId, WriteAssertionsRequest body) + throws ApiException, FgaInvalidParameterException { + return writeAssertionsWithHttpInfo(storeId, authorizationModelId, body, this.configuration); } /** @@ -1922,16 +2166,26 @@ public CompletableFuture> writeAssertionsWithHttpInfo( * @param storeId (required) * @param authorizationModelId (required) * @param body (required) - * @param configuration Override the configuration this OpenFgaApi was constructed with + * @param configurationOverride Override the {@link Configuration} this OpenFgaApi was constructed with * @return CompletableFuture<ApiResponse<Void>> * @throws ApiException if fails to make API call */ public CompletableFuture> writeAssertionsWithHttpInfo( + String storeId, + String authorizationModelId, + WriteAssertionsRequest body, + ConfigurationOverride configurationOverride) + throws ApiException, FgaInvalidParameterException { + return writeAssertionsWithHttpInfo( + storeId, authorizationModelId, body, this.configuration.override(configurationOverride)); + } + + private CompletableFuture> writeAssertionsWithHttpInfo( String storeId, String authorizationModelId, WriteAssertionsRequest body, Configuration configuration) - throws ApiException { + throws ApiException, FgaInvalidParameterException { try { HttpRequest.Builder localVarRequestBuilder = - writeAssertionsRequestBuilder(storeId, authorizationModelId, body, memberVarConfiguration); + writeAssertionsRequestBuilder(storeId, authorizationModelId, body, configuration); return memberVarHttpClient .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) .thenComposeAsync(localVarResponse -> { @@ -1953,7 +2207,7 @@ public CompletableFuture> writeAssertionsWithHttpInfo( private HttpRequest.Builder writeAssertionsRequestBuilder( String storeId, String authorizationModelId, WriteAssertionsRequest body, Configuration configuration) - throws ApiException { + throws ApiException, FgaInvalidParameterException { // verify the required parameter 'storeId' is set if (storeId == null) { throw new ApiException(400, "Missing the required parameter 'storeId' when calling writeAssertions"); @@ -1968,13 +2222,16 @@ private HttpRequest.Builder writeAssertionsRequestBuilder( throw new ApiException(400, "Missing the required parameter 'body' when calling writeAssertions"); } + // verify the Configuration is valid + configuration.assertValid(); + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); String localVarPath = "/stores/{store_id}/assertions/{authorization_model_id}" .replace("{store_id}", ApiClient.urlEncode(storeId.toString())) .replace("{authorization_model_id}", ApiClient.urlEncode(authorizationModelId.toString())); - localVarRequestBuilder.uri(URI.create(memberVarConfiguration.getApiUrl() + localVarPath)); + localVarRequestBuilder.uri(URI.create(configuration.getApiUrl() + localVarPath)); localVarRequestBuilder.header("Content-Type", "application/json"); localVarRequestBuilder.header("Accept", "application/json"); @@ -1985,7 +2242,7 @@ private HttpRequest.Builder writeAssertionsRequestBuilder( } catch (IOException e) { throw new ApiException(e); } - Duration readTimeout = memberVarConfiguration.getReadTimeout(); + Duration readTimeout = configuration.getReadTimeout(); if (readTimeout != null) { localVarRequestBuilder.timeout(readTimeout); } @@ -2004,8 +2261,8 @@ private HttpRequest.Builder writeAssertionsRequestBuilder( * @throws ApiException if fails to make API call */ public CompletableFuture writeAuthorizationModel( - String storeId, WriteAuthorizationModelRequest body) throws ApiException { - return writeAuthorizationModel(storeId, body, memberVarConfiguration); + String storeId, WriteAuthorizationModelRequest body) throws ApiException, FgaInvalidParameterException { + return writeAuthorizationModel(storeId, body, this.configuration); } /** @@ -2013,12 +2270,19 @@ public CompletableFuture writeAuthorizationMode * The WriteAuthorizationModel API will add a new authorization model to a store. Each item in the `type_definitions` array is a type definition as specified in the field `type_definition`. The response will return the authorization model's ID in the `id` field. ## Example To add an authorization model with `user` and `document` type definitions, call POST authorization-models API with the body: ```json { \"type_definitions\":[ { \"type\":\"user\" }, { \"type\":\"document\", \"relations\":{ \"reader\":{ \"union\":{ \"child\":[ { \"this\":{} }, { \"computedUserset\":{ \"object\":\"\", \"relation\":\"writer\" } } ] } }, \"writer\":{ \"this\":{} } } } ] } ``` OpenFGA's response will include the version id for this authorization model, which will look like ``` {\"authorization_model_id\": \"01G50QVV17PECNVAHX1GG4Y5NC\"} ``` * @param storeId (required) * @param body (required) - * @param configuration Override the configuration this OpenFgaApi was constructed with + * @param configurationOverride Override the {@link Configuration} this OpenFgaApi was constructed with * @return CompletableFuture<WriteAuthorizationModelResponse> * @throws ApiException if fails to make API call */ public CompletableFuture writeAuthorizationModel( - String storeId, WriteAuthorizationModelRequest body, Configuration configuration) throws ApiException { + String storeId, WriteAuthorizationModelRequest body, ConfigurationOverride configurationOverride) + throws ApiException, FgaInvalidParameterException { + return writeAuthorizationModel(storeId, body, this.configuration.override(configurationOverride)); + } + + private CompletableFuture writeAuthorizationModel( + String storeId, WriteAuthorizationModelRequest body, Configuration configuration) + throws ApiException, FgaInvalidParameterException { try { HttpRequest.Builder localVarRequestBuilder = writeAuthorizationModelRequestBuilder(storeId, body, configuration); @@ -2055,8 +2319,8 @@ public CompletableFuture writeAuthorizationMode * @throws ApiException if fails to make API call */ public CompletableFuture> writeAuthorizationModelWithHttpInfo( - String storeId, WriteAuthorizationModelRequest body) throws ApiException { - return writeAuthorizationModelWithHttpInfo(storeId, body, memberVarConfiguration); + String storeId, WriteAuthorizationModelRequest body) throws ApiException, FgaInvalidParameterException { + return writeAuthorizationModelWithHttpInfo(storeId, body, this.configuration); } /** @@ -2064,15 +2328,22 @@ public CompletableFuture> writeAuth * The WriteAuthorizationModel API will add a new authorization model to a store. Each item in the `type_definitions` array is a type definition as specified in the field `type_definition`. The response will return the authorization model's ID in the `id` field. ## Example To add an authorization model with `user` and `document` type definitions, call POST authorization-models API with the body: ```json { \"type_definitions\":[ { \"type\":\"user\" }, { \"type\":\"document\", \"relations\":{ \"reader\":{ \"union\":{ \"child\":[ { \"this\":{} }, { \"computedUserset\":{ \"object\":\"\", \"relation\":\"writer\" } } ] } }, \"writer\":{ \"this\":{} } } } ] } ``` OpenFGA's response will include the version id for this authorization model, which will look like ``` {\"authorization_model_id\": \"01G50QVV17PECNVAHX1GG4Y5NC\"} ``` * @param storeId (required) * @param body (required) - * @param configuration Override the configuration this OpenFgaApi was constructed with + * @param configurationOverride Override the {@link Configuration} this OpenFgaApi was constructed with * @return CompletableFuture<ApiResponse<WriteAuthorizationModelResponse>> * @throws ApiException if fails to make API call */ public CompletableFuture> writeAuthorizationModelWithHttpInfo( - String storeId, WriteAuthorizationModelRequest body, Configuration configuration) throws ApiException { + String storeId, WriteAuthorizationModelRequest body, ConfigurationOverride configurationOverride) + throws ApiException, FgaInvalidParameterException { + return writeAuthorizationModelWithHttpInfo(storeId, body, this.configuration.override(configurationOverride)); + } + + private CompletableFuture> writeAuthorizationModelWithHttpInfo( + String storeId, WriteAuthorizationModelRequest body, Configuration configuration) + throws ApiException, FgaInvalidParameterException { try { HttpRequest.Builder localVarRequestBuilder = - writeAuthorizationModelRequestBuilder(storeId, body, memberVarConfiguration); + writeAuthorizationModelRequestBuilder(storeId, body, configuration); return memberVarHttpClient .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) .thenComposeAsync(localVarResponse -> { @@ -2103,7 +2374,8 @@ public CompletableFuture> writeAuth } private HttpRequest.Builder writeAuthorizationModelRequestBuilder( - String storeId, WriteAuthorizationModelRequest body, Configuration configuration) throws ApiException { + String storeId, WriteAuthorizationModelRequest body, Configuration configuration) + throws ApiException, FgaInvalidParameterException { // verify the required parameter 'storeId' is set if (storeId == null) { throw new ApiException( @@ -2114,12 +2386,15 @@ private HttpRequest.Builder writeAuthorizationModelRequestBuilder( throw new ApiException(400, "Missing the required parameter 'body' when calling writeAuthorizationModel"); } + // verify the Configuration is valid + configuration.assertValid(); + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); String localVarPath = "/stores/{store_id}/authorization-models" .replace("{store_id}", ApiClient.urlEncode(storeId.toString())); - localVarRequestBuilder.uri(URI.create(memberVarConfiguration.getApiUrl() + localVarPath)); + localVarRequestBuilder.uri(URI.create(configuration.getApiUrl() + localVarPath)); localVarRequestBuilder.header("Content-Type", "application/json"); localVarRequestBuilder.header("Accept", "application/json"); @@ -2130,7 +2405,7 @@ private HttpRequest.Builder writeAuthorizationModelRequestBuilder( } catch (IOException e) { throw new ApiException(e); } - Duration readTimeout = memberVarConfiguration.getReadTimeout(); + Duration readTimeout = configuration.getReadTimeout(); if (readTimeout != null) { localVarRequestBuilder.timeout(readTimeout); } 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 4544bb9..582d8fa 100644 --- a/src/main/java/dev/openfga/sdk/api/client/ApiClient.java +++ b/src/main/java/dev/openfga/sdk/api/client/ApiClient.java @@ -49,7 +49,7 @@ */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class ApiClient { private HttpClient.Builder builder; diff --git a/src/main/java/dev/openfga/sdk/api/client/ApiException.java b/src/main/java/dev/openfga/sdk/api/client/ApiException.java index 7a57dc3..721412b 100644 --- a/src/main/java/dev/openfga/sdk/api/client/ApiException.java +++ b/src/main/java/dev/openfga/sdk/api/client/ApiException.java @@ -16,7 +16,7 @@ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class ApiException extends Exception { private int code = 0; private HttpHeaders responseHeaders = null; diff --git a/src/main/java/dev/openfga/sdk/api/client/BaseConfiguration.java b/src/main/java/dev/openfga/sdk/api/client/BaseConfiguration.java index d1f4ce0..52af3fc 100644 --- a/src/main/java/dev/openfga/sdk/api/client/BaseConfiguration.java +++ b/src/main/java/dev/openfga/sdk/api/client/BaseConfiguration.java @@ -12,12 +12,9 @@ package dev.openfga.sdk.api.client; -import dev.openfga.sdk.errors.FgaInvalidParameterException; import java.time.Duration; public interface BaseConfiguration { - void assertValid() throws FgaInvalidParameterException; - String getApiUrl(); String getUserAgent(); diff --git a/src/main/java/dev/openfga/sdk/api/client/Configuration.java b/src/main/java/dev/openfga/sdk/api/client/Configuration.java index aa9af11..18fbb79 100644 --- a/src/main/java/dev/openfga/sdk/api/client/Configuration.java +++ b/src/main/java/dev/openfga/sdk/api/client/Configuration.java @@ -24,7 +24,7 @@ import java.time.Duration; /** - * Configurations for an ApiClient. + * Configurations for an api client. */ public class Configuration implements BaseConfiguration { public static final String VERSION = "0.0.1"; @@ -49,7 +49,6 @@ public Configuration(String apiUrl) { /** * Assert that the configuration is valid. */ - @Override public void assertValid() throws FgaInvalidParameterException { // If apiUrl is null/empty/whitespace it will resolve to // DEFAULT_API_URL when getApiUrl is called. @@ -73,13 +72,39 @@ public void assertValid() throws FgaInvalidParameterException { } } + /** + * Construct a new {@link Configuration} with any non-null values of a {@link ConfigurationOverride} and remaining values from this {@link Configuration}. + * + * @param configurationOverride The values to override + * @return A new {@link Configuration} with values of this Configuration mixed with non-null values of configurationOverride + */ + public Configuration override(ConfigurationOverride configurationOverride) { + Configuration result = new Configuration(apiUrl); + + String overrideApiUrl = configurationOverride.getApiUrl(); + if (overrideApiUrl != null) { + result.apiUrl(overrideApiUrl); + } + + String overrideUserAgent = configurationOverride.getUserAgent(); + result.userAgent(overrideUserAgent != null ? overrideUserAgent : userAgent); + + Duration overrideReadTimeout = configurationOverride.getReadTimeout(); + result.readTimeout(overrideReadTimeout != null ? overrideReadTimeout : readTimeout); + + Duration overrideConnectTimeout = configurationOverride.getConnectTimeout(); + result.connectTimeout(overrideConnectTimeout != null ? overrideConnectTimeout : connectTimeout); + + return result; + } + /** * Set the API URL for the http client. * * @param apiUrl The URL. * @return This object. */ - public BaseConfiguration apiUrl(String apiUrl) { + public Configuration apiUrl(String apiUrl) { this.apiUrl = apiUrl; return this; } @@ -104,7 +129,7 @@ public String getApiUrl() { * @param userAgent The user agent. * @return This object. */ - public BaseConfiguration userAgent(String userAgent) { + public Configuration userAgent(String userAgent) { this.userAgent = userAgent; return this; } @@ -130,7 +155,7 @@ public String getUserAgent() { * effectively infinite value. * @return This object. */ - public BaseConfiguration readTimeout(Duration readTimeout) { + public Configuration readTimeout(Duration readTimeout) { this.readTimeout = readTimeout; return this; } @@ -162,7 +187,7 @@ public Duration getReadTimeout() { * @param connectTimeout connection timeout in milliseconds * @return This object. */ - public BaseConfiguration connectTimeout(Duration connectTimeout) { + public Configuration connectTimeout(Duration connectTimeout) { this.connectTimeout = connectTimeout; return this; } diff --git a/src/main/java/dev/openfga/sdk/api/client/ConfigurationOverride.java b/src/main/java/dev/openfga/sdk/api/client/ConfigurationOverride.java new file mode 100644 index 0000000..5a17623 --- /dev/null +++ b/src/main/java/dev/openfga/sdk/api/client/ConfigurationOverride.java @@ -0,0 +1,138 @@ +/* + * OpenFGA + * A high performance and flexible authorization/permission engine built for developers and inspired by Google Zanzibar. + * + * The version of the OpenAPI document: 0.1 + * Contact: community@openfga.dev + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package dev.openfga.sdk.api.client; + +import java.net.http.HttpClient; +import java.net.http.HttpConnectTimeoutException; +import java.net.http.HttpRequest; +import java.time.Duration; + +/** + * Configuration overrides for an api client. Values are initialized to null, and any values unset are intended to fall + * through to the values of a {@link Configuration}. + *

+ * More details on intended usage of this class can be found in the documentation of the {@link Configuration#override(ConfigurationOverride)} method. + */ +public class ConfigurationOverride implements BaseConfiguration { + private String apiUrl; + private String userAgent; + private Duration readTimeout; + private Duration connectTimeout; + + public ConfigurationOverride() { + this.apiUrl = null; + this.userAgent = null; + this.readTimeout = null; + this.connectTimeout = null; + } + + /** + * Set the API URL for the http client. + * + * @param apiUrl The URL. + * @return This object. + */ + public BaseConfiguration apiUrl(String apiUrl) { + this.apiUrl = apiUrl; + return this; + } + + /** + * Get the API URL that was set. + * + * @return The url. + */ + @Override + public String getApiUrl() { + return apiUrl; + } + + /** + * Set the user agent. + * + * @param userAgent The user agent. + * @return This object. + */ + public BaseConfiguration userAgent(String userAgent) { + this.userAgent = userAgent; + return this; + } + + /** + * Get the user agent. + * + * @return The user agent. + */ + @Override + public String getUserAgent() { + return userAgent; + } + + /** + * Set the read timeout for the http client. + * + *

This is the value used by default for each request, though it can be + * overridden on a per-request basis with a request interceptor.

+ * + * @param readTimeout The read timeout used by default by the http client. + * Setting this value to null resets the timeout to an + * effectively infinite value. + * @return This object. + */ + public BaseConfiguration readTimeout(Duration readTimeout) { + this.readTimeout = readTimeout; + return this; + } + + /** + * Get the read timeout that was set. + * + * @return The read timeout, or null if no timeout was set. Null represents + * an infinite wait time. + */ + @Override + public Duration getReadTimeout() { + return readTimeout; + } + + /** + * Sets the connect timeout (in milliseconds) for the http client. + * + *

In the case where a new connection needs to be established, if + * the connection cannot be established within the given {@code + * duration}, then {@link HttpClient#send(HttpRequest, BodyHandler) + * HttpClient::send} throws an {@link HttpConnectTimeoutException}, or + * {@link HttpClient#sendAsync(HttpRequest, BodyHandler) + * HttpClient::sendAsync} completes exceptionally with an + * {@code HttpConnectTimeoutException}. If a new connection does not + * need to be established, for example if a connection can be reused + * from a previous request, then this timeout duration has no effect. + * + * @param connectTimeout connection timeout in milliseconds + * @return This object. + */ + public BaseConfiguration connectTimeout(Duration connectTimeout) { + this.connectTimeout = connectTimeout; + return this; + } + + /** + * Get connection timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + @Override + public Duration getConnectTimeout() { + return connectTimeout; + } +} diff --git a/src/main/java/dev/openfga/sdk/api/client/JSON.java b/src/main/java/dev/openfga/sdk/api/client/JSON.java index 38e94ff..056b6b9 100644 --- a/src/main/java/dev/openfga/sdk/api/client/JSON.java +++ b/src/main/java/dev/openfga/sdk/api/client/JSON.java @@ -14,7 +14,7 @@ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class JSON { private ObjectMapper mapper; diff --git a/src/main/java/dev/openfga/sdk/api/client/Pair.java b/src/main/java/dev/openfga/sdk/api/client/Pair.java index a458742..06e1ea9 100644 --- a/src/main/java/dev/openfga/sdk/api/client/Pair.java +++ b/src/main/java/dev/openfga/sdk/api/client/Pair.java @@ -14,7 +14,7 @@ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class Pair { private String name = ""; private String value = ""; diff --git a/src/main/java/dev/openfga/sdk/api/model/AbstractOpenApiSchema.java b/src/main/java/dev/openfga/sdk/api/model/AbstractOpenApiSchema.java index e964774..6e25c15 100644 --- a/src/main/java/dev/openfga/sdk/api/model/AbstractOpenApiSchema.java +++ b/src/main/java/dev/openfga/sdk/api/model/AbstractOpenApiSchema.java @@ -21,7 +21,7 @@ */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public abstract class AbstractOpenApiSchema { // store the actual instance of the schema/object diff --git a/src/main/java/dev/openfga/sdk/api/model/Any.java b/src/main/java/dev/openfga/sdk/api/model/Any.java index f8e4195..e15a5b6 100644 --- a/src/main/java/dev/openfga/sdk/api/model/Any.java +++ b/src/main/java/dev/openfga/sdk/api/model/Any.java @@ -30,7 +30,7 @@ @JsonPropertyOrder({Any.JSON_PROPERTY_AT_TYPE}) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class Any extends HashMap { public static final String JSON_PROPERTY_AT_TYPE = "@type"; private String atType; diff --git a/src/main/java/dev/openfga/sdk/api/model/Assertion.java b/src/main/java/dev/openfga/sdk/api/model/Assertion.java index 317ed27..06d3c36 100644 --- a/src/main/java/dev/openfga/sdk/api/model/Assertion.java +++ b/src/main/java/dev/openfga/sdk/api/model/Assertion.java @@ -26,7 +26,7 @@ @JsonPropertyOrder({Assertion.JSON_PROPERTY_TUPLE_KEY, Assertion.JSON_PROPERTY_EXPECTATION}) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class Assertion { public static final String JSON_PROPERTY_TUPLE_KEY = "tuple_key"; private TupleKey tupleKey; diff --git a/src/main/java/dev/openfga/sdk/api/model/AuthorizationModel.java b/src/main/java/dev/openfga/sdk/api/model/AuthorizationModel.java index 05d08e1..b41164b 100644 --- a/src/main/java/dev/openfga/sdk/api/model/AuthorizationModel.java +++ b/src/main/java/dev/openfga/sdk/api/model/AuthorizationModel.java @@ -32,7 +32,7 @@ }) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class AuthorizationModel { public static final String JSON_PROPERTY_ID = "id"; private String id; diff --git a/src/main/java/dev/openfga/sdk/api/model/CheckRequest.java b/src/main/java/dev/openfga/sdk/api/model/CheckRequest.java index c182f4a..9c1bf7a 100644 --- a/src/main/java/dev/openfga/sdk/api/model/CheckRequest.java +++ b/src/main/java/dev/openfga/sdk/api/model/CheckRequest.java @@ -32,7 +32,7 @@ }) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class CheckRequest { public static final String JSON_PROPERTY_TUPLE_KEY = "tuple_key"; private TupleKey tupleKey; diff --git a/src/main/java/dev/openfga/sdk/api/model/CheckResponse.java b/src/main/java/dev/openfga/sdk/api/model/CheckResponse.java index 539804c..8909069 100644 --- a/src/main/java/dev/openfga/sdk/api/model/CheckResponse.java +++ b/src/main/java/dev/openfga/sdk/api/model/CheckResponse.java @@ -26,7 +26,7 @@ @JsonPropertyOrder({CheckResponse.JSON_PROPERTY_ALLOWED, CheckResponse.JSON_PROPERTY_RESOLUTION}) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class CheckResponse { public static final String JSON_PROPERTY_ALLOWED = "allowed"; private Boolean allowed; diff --git a/src/main/java/dev/openfga/sdk/api/model/Computed.java b/src/main/java/dev/openfga/sdk/api/model/Computed.java index d7f15bd..9376b26 100644 --- a/src/main/java/dev/openfga/sdk/api/model/Computed.java +++ b/src/main/java/dev/openfga/sdk/api/model/Computed.java @@ -26,7 +26,7 @@ @JsonPropertyOrder({Computed.JSON_PROPERTY_USERSET}) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class Computed { public static final String JSON_PROPERTY_USERSET = "userset"; private String userset; diff --git a/src/main/java/dev/openfga/sdk/api/model/ContextualTupleKeys.java b/src/main/java/dev/openfga/sdk/api/model/ContextualTupleKeys.java index d03509c..f0dc900 100644 --- a/src/main/java/dev/openfga/sdk/api/model/ContextualTupleKeys.java +++ b/src/main/java/dev/openfga/sdk/api/model/ContextualTupleKeys.java @@ -26,7 +26,7 @@ @JsonPropertyOrder({ContextualTupleKeys.JSON_PROPERTY_TUPLE_KEYS}) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class ContextualTupleKeys { public static final String JSON_PROPERTY_TUPLE_KEYS = "tuple_keys"; private List tupleKeys = new ArrayList<>(); diff --git a/src/main/java/dev/openfga/sdk/api/model/CreateStoreRequest.java b/src/main/java/dev/openfga/sdk/api/model/CreateStoreRequest.java index a369c6a..0e9e488 100644 --- a/src/main/java/dev/openfga/sdk/api/model/CreateStoreRequest.java +++ b/src/main/java/dev/openfga/sdk/api/model/CreateStoreRequest.java @@ -26,7 +26,7 @@ @JsonPropertyOrder({CreateStoreRequest.JSON_PROPERTY_NAME}) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class CreateStoreRequest { public static final String JSON_PROPERTY_NAME = "name"; private String name; diff --git a/src/main/java/dev/openfga/sdk/api/model/CreateStoreResponse.java b/src/main/java/dev/openfga/sdk/api/model/CreateStoreResponse.java index 9fafa32..378b478 100644 --- a/src/main/java/dev/openfga/sdk/api/model/CreateStoreResponse.java +++ b/src/main/java/dev/openfga/sdk/api/model/CreateStoreResponse.java @@ -32,7 +32,7 @@ }) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class CreateStoreResponse { public static final String JSON_PROPERTY_ID = "id"; private String id; diff --git a/src/main/java/dev/openfga/sdk/api/model/Difference.java b/src/main/java/dev/openfga/sdk/api/model/Difference.java index 6335cab..366c5c2 100644 --- a/src/main/java/dev/openfga/sdk/api/model/Difference.java +++ b/src/main/java/dev/openfga/sdk/api/model/Difference.java @@ -24,7 +24,7 @@ @JsonPropertyOrder({Difference.JSON_PROPERTY_BASE, Difference.JSON_PROPERTY_SUBTRACT}) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class Difference { public static final String JSON_PROPERTY_BASE = "base"; private Userset base; diff --git a/src/main/java/dev/openfga/sdk/api/model/ExpandRequest.java b/src/main/java/dev/openfga/sdk/api/model/ExpandRequest.java index a1baeeb..6d99e59 100644 --- a/src/main/java/dev/openfga/sdk/api/model/ExpandRequest.java +++ b/src/main/java/dev/openfga/sdk/api/model/ExpandRequest.java @@ -26,7 +26,7 @@ @JsonPropertyOrder({ExpandRequest.JSON_PROPERTY_TUPLE_KEY, ExpandRequest.JSON_PROPERTY_AUTHORIZATION_MODEL_ID}) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class ExpandRequest { public static final String JSON_PROPERTY_TUPLE_KEY = "tuple_key"; private TupleKey tupleKey; diff --git a/src/main/java/dev/openfga/sdk/api/model/ExpandResponse.java b/src/main/java/dev/openfga/sdk/api/model/ExpandResponse.java index 538c10b..d5160fa 100644 --- a/src/main/java/dev/openfga/sdk/api/model/ExpandResponse.java +++ b/src/main/java/dev/openfga/sdk/api/model/ExpandResponse.java @@ -24,7 +24,7 @@ @JsonPropertyOrder({ExpandResponse.JSON_PROPERTY_TREE}) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class ExpandResponse { public static final String JSON_PROPERTY_TREE = "tree"; private UsersetTree tree; diff --git a/src/main/java/dev/openfga/sdk/api/model/GetStoreResponse.java b/src/main/java/dev/openfga/sdk/api/model/GetStoreResponse.java index 380a2f1..f6ea5b2 100644 --- a/src/main/java/dev/openfga/sdk/api/model/GetStoreResponse.java +++ b/src/main/java/dev/openfga/sdk/api/model/GetStoreResponse.java @@ -32,7 +32,7 @@ }) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class GetStoreResponse { public static final String JSON_PROPERTY_ID = "id"; private String id; diff --git a/src/main/java/dev/openfga/sdk/api/model/InternalErrorMessageResponse.java b/src/main/java/dev/openfga/sdk/api/model/InternalErrorMessageResponse.java index 78268a7..952e46c 100644 --- a/src/main/java/dev/openfga/sdk/api/model/InternalErrorMessageResponse.java +++ b/src/main/java/dev/openfga/sdk/api/model/InternalErrorMessageResponse.java @@ -27,7 +27,7 @@ }) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class InternalErrorMessageResponse { public static final String JSON_PROPERTY_CODE = "code"; private InternalErrorCode code = InternalErrorCode.NO_INTERNAL_ERROR; diff --git a/src/main/java/dev/openfga/sdk/api/model/Leaf.java b/src/main/java/dev/openfga/sdk/api/model/Leaf.java index cd1b94a..ff840d4 100644 --- a/src/main/java/dev/openfga/sdk/api/model/Leaf.java +++ b/src/main/java/dev/openfga/sdk/api/model/Leaf.java @@ -24,7 +24,7 @@ @JsonPropertyOrder({Leaf.JSON_PROPERTY_USERS, Leaf.JSON_PROPERTY_COMPUTED, Leaf.JSON_PROPERTY_TUPLE_TO_USERSET}) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class Leaf { public static final String JSON_PROPERTY_USERS = "users"; private Users users; diff --git a/src/main/java/dev/openfga/sdk/api/model/ListObjectsRequest.java b/src/main/java/dev/openfga/sdk/api/model/ListObjectsRequest.java index 696b194..c0c7632 100644 --- a/src/main/java/dev/openfga/sdk/api/model/ListObjectsRequest.java +++ b/src/main/java/dev/openfga/sdk/api/model/ListObjectsRequest.java @@ -32,7 +32,7 @@ }) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class ListObjectsRequest { public static final String JSON_PROPERTY_AUTHORIZATION_MODEL_ID = "authorization_model_id"; private String authorizationModelId; diff --git a/src/main/java/dev/openfga/sdk/api/model/ListObjectsResponse.java b/src/main/java/dev/openfga/sdk/api/model/ListObjectsResponse.java index 56c6ad8..a8d1830 100644 --- a/src/main/java/dev/openfga/sdk/api/model/ListObjectsResponse.java +++ b/src/main/java/dev/openfga/sdk/api/model/ListObjectsResponse.java @@ -28,7 +28,7 @@ @JsonPropertyOrder({ListObjectsResponse.JSON_PROPERTY_OBJECTS}) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class ListObjectsResponse { public static final String JSON_PROPERTY_OBJECTS = "objects"; private List objects = new ArrayList<>(); diff --git a/src/main/java/dev/openfga/sdk/api/model/ListStoresResponse.java b/src/main/java/dev/openfga/sdk/api/model/ListStoresResponse.java index 753fb8f..edb9ceb 100644 --- a/src/main/java/dev/openfga/sdk/api/model/ListStoresResponse.java +++ b/src/main/java/dev/openfga/sdk/api/model/ListStoresResponse.java @@ -28,7 +28,7 @@ @JsonPropertyOrder({ListStoresResponse.JSON_PROPERTY_STORES, ListStoresResponse.JSON_PROPERTY_CONTINUATION_TOKEN}) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class ListStoresResponse { public static final String JSON_PROPERTY_STORES = "stores"; private List stores = new ArrayList<>(); diff --git a/src/main/java/dev/openfga/sdk/api/model/Metadata.java b/src/main/java/dev/openfga/sdk/api/model/Metadata.java index 4091a70..8355c21 100644 --- a/src/main/java/dev/openfga/sdk/api/model/Metadata.java +++ b/src/main/java/dev/openfga/sdk/api/model/Metadata.java @@ -26,7 +26,7 @@ @JsonPropertyOrder({Metadata.JSON_PROPERTY_RELATIONS}) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class Metadata { public static final String JSON_PROPERTY_RELATIONS = "relations"; private Map relations = new HashMap<>(); diff --git a/src/main/java/dev/openfga/sdk/api/model/Node.java b/src/main/java/dev/openfga/sdk/api/model/Node.java index 095fc14..5ba6719 100644 --- a/src/main/java/dev/openfga/sdk/api/model/Node.java +++ b/src/main/java/dev/openfga/sdk/api/model/Node.java @@ -32,7 +32,7 @@ }) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class Node { public static final String JSON_PROPERTY_NAME = "name"; private String name; diff --git a/src/main/java/dev/openfga/sdk/api/model/Nodes.java b/src/main/java/dev/openfga/sdk/api/model/Nodes.java index dee2f00..c019b96 100644 --- a/src/main/java/dev/openfga/sdk/api/model/Nodes.java +++ b/src/main/java/dev/openfga/sdk/api/model/Nodes.java @@ -26,7 +26,7 @@ @JsonPropertyOrder({Nodes.JSON_PROPERTY_NODES}) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class Nodes { public static final String JSON_PROPERTY_NODES = "nodes"; private List nodes = new ArrayList<>(); diff --git a/src/main/java/dev/openfga/sdk/api/model/ObjectRelation.java b/src/main/java/dev/openfga/sdk/api/model/ObjectRelation.java index 9374ac7..8416187 100644 --- a/src/main/java/dev/openfga/sdk/api/model/ObjectRelation.java +++ b/src/main/java/dev/openfga/sdk/api/model/ObjectRelation.java @@ -26,7 +26,7 @@ @JsonPropertyOrder({ObjectRelation.JSON_PROPERTY_OBJECT, ObjectRelation.JSON_PROPERTY_RELATION}) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class ObjectRelation { public static final String JSON_PROPERTY_OBJECT = "object"; private String _object; diff --git a/src/main/java/dev/openfga/sdk/api/model/PathUnknownErrorMessageResponse.java b/src/main/java/dev/openfga/sdk/api/model/PathUnknownErrorMessageResponse.java index c69051a..164d7f8 100644 --- a/src/main/java/dev/openfga/sdk/api/model/PathUnknownErrorMessageResponse.java +++ b/src/main/java/dev/openfga/sdk/api/model/PathUnknownErrorMessageResponse.java @@ -29,7 +29,7 @@ }) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class PathUnknownErrorMessageResponse { public static final String JSON_PROPERTY_CODE = "code"; private NotFoundErrorCode code = NotFoundErrorCode.NO_NOT_FOUND_ERROR; diff --git a/src/main/java/dev/openfga/sdk/api/model/ReadAssertionsResponse.java b/src/main/java/dev/openfga/sdk/api/model/ReadAssertionsResponse.java index e919032..86bf28e 100644 --- a/src/main/java/dev/openfga/sdk/api/model/ReadAssertionsResponse.java +++ b/src/main/java/dev/openfga/sdk/api/model/ReadAssertionsResponse.java @@ -31,7 +31,7 @@ }) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class ReadAssertionsResponse { public static final String JSON_PROPERTY_AUTHORIZATION_MODEL_ID = "authorization_model_id"; private String authorizationModelId; diff --git a/src/main/java/dev/openfga/sdk/api/model/ReadAuthorizationModelResponse.java b/src/main/java/dev/openfga/sdk/api/model/ReadAuthorizationModelResponse.java index d743e35..0c26281 100644 --- a/src/main/java/dev/openfga/sdk/api/model/ReadAuthorizationModelResponse.java +++ b/src/main/java/dev/openfga/sdk/api/model/ReadAuthorizationModelResponse.java @@ -24,7 +24,7 @@ @JsonPropertyOrder({ReadAuthorizationModelResponse.JSON_PROPERTY_AUTHORIZATION_MODEL}) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class ReadAuthorizationModelResponse { public static final String JSON_PROPERTY_AUTHORIZATION_MODEL = "authorization_model"; private AuthorizationModel authorizationModel; diff --git a/src/main/java/dev/openfga/sdk/api/model/ReadAuthorizationModelsResponse.java b/src/main/java/dev/openfga/sdk/api/model/ReadAuthorizationModelsResponse.java index 310a232..ca99f70 100644 --- a/src/main/java/dev/openfga/sdk/api/model/ReadAuthorizationModelsResponse.java +++ b/src/main/java/dev/openfga/sdk/api/model/ReadAuthorizationModelsResponse.java @@ -31,7 +31,7 @@ }) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class ReadAuthorizationModelsResponse { public static final String JSON_PROPERTY_AUTHORIZATION_MODELS = "authorization_models"; private List authorizationModels = new ArrayList<>(); diff --git a/src/main/java/dev/openfga/sdk/api/model/ReadChangesResponse.java b/src/main/java/dev/openfga/sdk/api/model/ReadChangesResponse.java index 5408dbc..20406f9 100644 --- a/src/main/java/dev/openfga/sdk/api/model/ReadChangesResponse.java +++ b/src/main/java/dev/openfga/sdk/api/model/ReadChangesResponse.java @@ -28,7 +28,7 @@ @JsonPropertyOrder({ReadChangesResponse.JSON_PROPERTY_CHANGES, ReadChangesResponse.JSON_PROPERTY_CONTINUATION_TOKEN}) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class ReadChangesResponse { public static final String JSON_PROPERTY_CHANGES = "changes"; private List changes = new ArrayList<>(); diff --git a/src/main/java/dev/openfga/sdk/api/model/ReadRequest.java b/src/main/java/dev/openfga/sdk/api/model/ReadRequest.java index 308c39c..91f9d06 100644 --- a/src/main/java/dev/openfga/sdk/api/model/ReadRequest.java +++ b/src/main/java/dev/openfga/sdk/api/model/ReadRequest.java @@ -30,7 +30,7 @@ }) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class ReadRequest { public static final String JSON_PROPERTY_TUPLE_KEY = "tuple_key"; private TupleKey tupleKey; diff --git a/src/main/java/dev/openfga/sdk/api/model/ReadResponse.java b/src/main/java/dev/openfga/sdk/api/model/ReadResponse.java index 4ab79b3..5d186c2 100644 --- a/src/main/java/dev/openfga/sdk/api/model/ReadResponse.java +++ b/src/main/java/dev/openfga/sdk/api/model/ReadResponse.java @@ -28,7 +28,7 @@ @JsonPropertyOrder({ReadResponse.JSON_PROPERTY_TUPLES, ReadResponse.JSON_PROPERTY_CONTINUATION_TOKEN}) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class ReadResponse { public static final String JSON_PROPERTY_TUPLES = "tuples"; private List tuples = new ArrayList<>(); diff --git a/src/main/java/dev/openfga/sdk/api/model/RelationMetadata.java b/src/main/java/dev/openfga/sdk/api/model/RelationMetadata.java index 6451d42..49dacfd 100644 --- a/src/main/java/dev/openfga/sdk/api/model/RelationMetadata.java +++ b/src/main/java/dev/openfga/sdk/api/model/RelationMetadata.java @@ -26,7 +26,7 @@ @JsonPropertyOrder({RelationMetadata.JSON_PROPERTY_DIRECTLY_RELATED_USER_TYPES}) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class RelationMetadata { public static final String JSON_PROPERTY_DIRECTLY_RELATED_USER_TYPES = "directly_related_user_types"; private List directlyRelatedUserTypes = new ArrayList<>(); diff --git a/src/main/java/dev/openfga/sdk/api/model/RelationReference.java b/src/main/java/dev/openfga/sdk/api/model/RelationReference.java index 3adce54..5d1e228 100644 --- a/src/main/java/dev/openfga/sdk/api/model/RelationReference.java +++ b/src/main/java/dev/openfga/sdk/api/model/RelationReference.java @@ -30,7 +30,7 @@ }) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class RelationReference { public static final String JSON_PROPERTY_TYPE = "type"; private String type; diff --git a/src/main/java/dev/openfga/sdk/api/model/Status.java b/src/main/java/dev/openfga/sdk/api/model/Status.java index c2ee281..d0c08a2 100644 --- a/src/main/java/dev/openfga/sdk/api/model/Status.java +++ b/src/main/java/dev/openfga/sdk/api/model/Status.java @@ -28,7 +28,7 @@ @JsonPropertyOrder({Status.JSON_PROPERTY_CODE, Status.JSON_PROPERTY_MESSAGE, Status.JSON_PROPERTY_DETAILS}) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class Status { public static final String JSON_PROPERTY_CODE = "code"; private Integer code; diff --git a/src/main/java/dev/openfga/sdk/api/model/Store.java b/src/main/java/dev/openfga/sdk/api/model/Store.java index dc82bd1..7ef01f6 100644 --- a/src/main/java/dev/openfga/sdk/api/model/Store.java +++ b/src/main/java/dev/openfga/sdk/api/model/Store.java @@ -33,7 +33,7 @@ }) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class Store { public static final String JSON_PROPERTY_ID = "id"; private String id; diff --git a/src/main/java/dev/openfga/sdk/api/model/Tuple.java b/src/main/java/dev/openfga/sdk/api/model/Tuple.java index 109243d..d04b949 100644 --- a/src/main/java/dev/openfga/sdk/api/model/Tuple.java +++ b/src/main/java/dev/openfga/sdk/api/model/Tuple.java @@ -27,7 +27,7 @@ @JsonPropertyOrder({Tuple.JSON_PROPERTY_KEY, Tuple.JSON_PROPERTY_TIMESTAMP}) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class Tuple { public static final String JSON_PROPERTY_KEY = "key"; private TupleKey key; diff --git a/src/main/java/dev/openfga/sdk/api/model/TupleChange.java b/src/main/java/dev/openfga/sdk/api/model/TupleChange.java index 68ac6ce..8563760 100644 --- a/src/main/java/dev/openfga/sdk/api/model/TupleChange.java +++ b/src/main/java/dev/openfga/sdk/api/model/TupleChange.java @@ -31,7 +31,7 @@ }) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class TupleChange { public static final String JSON_PROPERTY_TUPLE_KEY = "tuple_key"; private TupleKey tupleKey; diff --git a/src/main/java/dev/openfga/sdk/api/model/TupleKey.java b/src/main/java/dev/openfga/sdk/api/model/TupleKey.java index 34e2b41..f630993 100644 --- a/src/main/java/dev/openfga/sdk/api/model/TupleKey.java +++ b/src/main/java/dev/openfga/sdk/api/model/TupleKey.java @@ -26,7 +26,7 @@ @JsonPropertyOrder({TupleKey.JSON_PROPERTY_OBJECT, TupleKey.JSON_PROPERTY_RELATION, TupleKey.JSON_PROPERTY_USER}) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class TupleKey { public static final String JSON_PROPERTY_OBJECT = "object"; private String _object; diff --git a/src/main/java/dev/openfga/sdk/api/model/TupleKeys.java b/src/main/java/dev/openfga/sdk/api/model/TupleKeys.java index 101c51a..25fe424 100644 --- a/src/main/java/dev/openfga/sdk/api/model/TupleKeys.java +++ b/src/main/java/dev/openfga/sdk/api/model/TupleKeys.java @@ -26,7 +26,7 @@ @JsonPropertyOrder({TupleKeys.JSON_PROPERTY_TUPLE_KEYS}) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class TupleKeys { public static final String JSON_PROPERTY_TUPLE_KEYS = "tuple_keys"; private List tupleKeys = new ArrayList<>(); diff --git a/src/main/java/dev/openfga/sdk/api/model/TupleToUserset.java b/src/main/java/dev/openfga/sdk/api/model/TupleToUserset.java index 800d123..3238ea5 100644 --- a/src/main/java/dev/openfga/sdk/api/model/TupleToUserset.java +++ b/src/main/java/dev/openfga/sdk/api/model/TupleToUserset.java @@ -24,7 +24,7 @@ @JsonPropertyOrder({TupleToUserset.JSON_PROPERTY_TUPLESET, TupleToUserset.JSON_PROPERTY_COMPUTED_USERSET}) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class TupleToUserset { public static final String JSON_PROPERTY_TUPLESET = "tupleset"; private ObjectRelation tupleset; diff --git a/src/main/java/dev/openfga/sdk/api/model/TypeDefinition.java b/src/main/java/dev/openfga/sdk/api/model/TypeDefinition.java index ccc5160..a781b8c 100644 --- a/src/main/java/dev/openfga/sdk/api/model/TypeDefinition.java +++ b/src/main/java/dev/openfga/sdk/api/model/TypeDefinition.java @@ -32,7 +32,7 @@ }) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class TypeDefinition { public static final String JSON_PROPERTY_TYPE = "type"; private String type; diff --git a/src/main/java/dev/openfga/sdk/api/model/Users.java b/src/main/java/dev/openfga/sdk/api/model/Users.java index 2e41362..02e8b04 100644 --- a/src/main/java/dev/openfga/sdk/api/model/Users.java +++ b/src/main/java/dev/openfga/sdk/api/model/Users.java @@ -28,7 +28,7 @@ @JsonPropertyOrder({Users.JSON_PROPERTY_USERS}) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class Users { public static final String JSON_PROPERTY_USERS = "users"; private List users = new ArrayList<>(); diff --git a/src/main/java/dev/openfga/sdk/api/model/Userset.java b/src/main/java/dev/openfga/sdk/api/model/Userset.java index 1e17f8d..096874a 100644 --- a/src/main/java/dev/openfga/sdk/api/model/Userset.java +++ b/src/main/java/dev/openfga/sdk/api/model/Userset.java @@ -33,7 +33,7 @@ }) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class Userset { public static final String JSON_PROPERTY_THIS = "this"; private Object _this; diff --git a/src/main/java/dev/openfga/sdk/api/model/UsersetTree.java b/src/main/java/dev/openfga/sdk/api/model/UsersetTree.java index 3ffe75c..32d7a5c 100644 --- a/src/main/java/dev/openfga/sdk/api/model/UsersetTree.java +++ b/src/main/java/dev/openfga/sdk/api/model/UsersetTree.java @@ -24,7 +24,7 @@ @JsonPropertyOrder({UsersetTree.JSON_PROPERTY_ROOT}) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class UsersetTree { public static final String JSON_PROPERTY_ROOT = "root"; private Node root; diff --git a/src/main/java/dev/openfga/sdk/api/model/UsersetTreeDifference.java b/src/main/java/dev/openfga/sdk/api/model/UsersetTreeDifference.java index 79e23a2..17dbc9b 100644 --- a/src/main/java/dev/openfga/sdk/api/model/UsersetTreeDifference.java +++ b/src/main/java/dev/openfga/sdk/api/model/UsersetTreeDifference.java @@ -24,7 +24,7 @@ @JsonPropertyOrder({UsersetTreeDifference.JSON_PROPERTY_BASE, UsersetTreeDifference.JSON_PROPERTY_SUBTRACT}) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class UsersetTreeDifference { public static final String JSON_PROPERTY_BASE = "base"; private Node base; diff --git a/src/main/java/dev/openfga/sdk/api/model/UsersetTreeTupleToUserset.java b/src/main/java/dev/openfga/sdk/api/model/UsersetTreeTupleToUserset.java index b443ac3..e240056 100644 --- a/src/main/java/dev/openfga/sdk/api/model/UsersetTreeTupleToUserset.java +++ b/src/main/java/dev/openfga/sdk/api/model/UsersetTreeTupleToUserset.java @@ -28,7 +28,7 @@ @JsonPropertyOrder({UsersetTreeTupleToUserset.JSON_PROPERTY_TUPLESET, UsersetTreeTupleToUserset.JSON_PROPERTY_COMPUTED}) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class UsersetTreeTupleToUserset { public static final String JSON_PROPERTY_TUPLESET = "tupleset"; private String tupleset; diff --git a/src/main/java/dev/openfga/sdk/api/model/Usersets.java b/src/main/java/dev/openfga/sdk/api/model/Usersets.java index dd9f2f2..78612fc 100644 --- a/src/main/java/dev/openfga/sdk/api/model/Usersets.java +++ b/src/main/java/dev/openfga/sdk/api/model/Usersets.java @@ -26,7 +26,7 @@ @JsonPropertyOrder({Usersets.JSON_PROPERTY_CHILD}) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class Usersets { public static final String JSON_PROPERTY_CHILD = "child"; private List child = new ArrayList<>(); diff --git a/src/main/java/dev/openfga/sdk/api/model/ValidationErrorMessageResponse.java b/src/main/java/dev/openfga/sdk/api/model/ValidationErrorMessageResponse.java index b941280..c2d8119 100644 --- a/src/main/java/dev/openfga/sdk/api/model/ValidationErrorMessageResponse.java +++ b/src/main/java/dev/openfga/sdk/api/model/ValidationErrorMessageResponse.java @@ -29,7 +29,7 @@ }) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class ValidationErrorMessageResponse { public static final String JSON_PROPERTY_CODE = "code"; private ErrorCode code = ErrorCode.NO_ERROR; diff --git a/src/main/java/dev/openfga/sdk/api/model/WriteAssertionsRequest.java b/src/main/java/dev/openfga/sdk/api/model/WriteAssertionsRequest.java index acb3eb0..9702a86 100644 --- a/src/main/java/dev/openfga/sdk/api/model/WriteAssertionsRequest.java +++ b/src/main/java/dev/openfga/sdk/api/model/WriteAssertionsRequest.java @@ -26,7 +26,7 @@ @JsonPropertyOrder({WriteAssertionsRequest.JSON_PROPERTY_ASSERTIONS}) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class WriteAssertionsRequest { public static final String JSON_PROPERTY_ASSERTIONS = "assertions"; private List assertions = new ArrayList<>(); diff --git a/src/main/java/dev/openfga/sdk/api/model/WriteAuthorizationModelRequest.java b/src/main/java/dev/openfga/sdk/api/model/WriteAuthorizationModelRequest.java index 6c530a5..932a2bf 100644 --- a/src/main/java/dev/openfga/sdk/api/model/WriteAuthorizationModelRequest.java +++ b/src/main/java/dev/openfga/sdk/api/model/WriteAuthorizationModelRequest.java @@ -31,7 +31,7 @@ }) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class WriteAuthorizationModelRequest { public static final String JSON_PROPERTY_TYPE_DEFINITIONS = "type_definitions"; private List typeDefinitions = new ArrayList<>(); diff --git a/src/main/java/dev/openfga/sdk/api/model/WriteAuthorizationModelResponse.java b/src/main/java/dev/openfga/sdk/api/model/WriteAuthorizationModelResponse.java index 690e1f1..917e270 100644 --- a/src/main/java/dev/openfga/sdk/api/model/WriteAuthorizationModelResponse.java +++ b/src/main/java/dev/openfga/sdk/api/model/WriteAuthorizationModelResponse.java @@ -26,7 +26,7 @@ @JsonPropertyOrder({WriteAuthorizationModelResponse.JSON_PROPERTY_AUTHORIZATION_MODEL_ID}) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class WriteAuthorizationModelResponse { public static final String JSON_PROPERTY_AUTHORIZATION_MODEL_ID = "authorization_model_id"; private String authorizationModelId; diff --git a/src/main/java/dev/openfga/sdk/api/model/WriteRequest.java b/src/main/java/dev/openfga/sdk/api/model/WriteRequest.java index c19bf55..42f3476 100644 --- a/src/main/java/dev/openfga/sdk/api/model/WriteRequest.java +++ b/src/main/java/dev/openfga/sdk/api/model/WriteRequest.java @@ -30,7 +30,7 @@ }) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - date = "2023-08-21T23:45:26.204414Z[Etc/UTC]") + date = "2023-08-22T23:54:43.912230Z[Etc/UTC]") public class WriteRequest { public static final String JSON_PROPERTY_WRITES = "writes"; private TupleKeys writes;