File tree Expand file tree Collapse file tree
src/main/java/dev/openfga/sdk/api Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ This is an autogenerated Java SDK for OpenFGA. It provides a wrapper around the
1919- [ Installation] ( #installation )
2020- [ Getting Started] ( #getting-started )
2121 - [ Initializing the API Client] ( #initializing-the-api-client )
22+ - [ Custom Headers] ( #custom-headers )
2223 - [ Get your Store ID] ( #get-your-store-id )
2324 - [ Calling the API] ( #calling-the-api )
2425 - [ Stores] ( #stores )
@@ -294,6 +295,7 @@ public class Example {
294295 " X-Custom-Header" , " overridden-value" // this will override the default value for this request only
295296 )
296297 );
298+ var response = fgaClient. read(request, options). get();
297299 }
298300}
299301```
Original file line number Diff line number Diff line change @@ -248,11 +248,13 @@ public CompletableFuture<ClientReadAuthorizationModelResponse> readAuthorization
248248 ClientReadAuthorizationModelOptions options ) throws FgaInvalidParameterException {
249249 configuration .assertValid ();
250250 String storeId = configuration .getStoreIdChecked ();
251- // Set authorizationModelId from options if available; otherwise, use the default from configuration
252- String authorizationModelId = !isNullOrWhitespace (options .getAuthorizationModelId ())
253- ? options .getAuthorizationModelIdChecked ()
254- : configuration .getAuthorizationModelId ();
255-
251+ // Set authorizationModelId from options if available; otherwise, require a valid configuration value
252+ String authorizationModelId ;
253+ if (options != null && !isNullOrWhitespace (options .getAuthorizationModelId ())) {
254+ authorizationModelId = options .getAuthorizationModelIdChecked ();
255+ } else {
256+ authorizationModelId = configuration .getAuthorizationModelIdChecked ();
257+ }
256258 var overrides = new ConfigurationOverride ().addHeaders (options );
257259 return call (() -> api .readAuthorizationModel (storeId , authorizationModelId , overrides ))
258260 .thenApply (ClientReadAuthorizationModelResponse ::new );
Original file line number Diff line number Diff line change 1313package dev .openfga .sdk .api .configuration ;
1414
1515import dev .openfga .sdk .api .model .ConsistencyPreference ;
16+ import java .util .HashMap ;
1617import java .util .Map ;
1718
1819public class ClientBatchCheckClientOptions implements AdditionalHeadersSupplier {
@@ -60,7 +61,7 @@ public ConsistencyPreference getConsistency() {
6061
6162 public ClientCheckOptions asClientCheckOptions () {
6263 return new ClientCheckOptions ()
63- .additionalHeaders (additionalHeaders )
64+ .additionalHeaders (additionalHeaders != null ? new HashMap <>( additionalHeaders ) : null )
6465 .authorizationModelId (authorizationModelId )
6566 .consistency (consistency );
6667 }
Original file line number Diff line number Diff line change 1313package dev .openfga .sdk .api .configuration ;
1414
1515import dev .openfga .sdk .api .model .ConsistencyPreference ;
16+ import java .util .HashMap ;
1617import java .util .Map ;
1718
1819public class ClientListRelationsOptions implements AdditionalHeadersSupplier {
@@ -61,7 +62,7 @@ public ConsistencyPreference getConsistency() {
6162 public ClientBatchCheckClientOptions asClientBatchCheckClientOptions () {
6263 return new ClientBatchCheckClientOptions ()
6364 .authorizationModelId (authorizationModelId )
64- .additionalHeaders (additionalHeaders )
65+ .additionalHeaders (additionalHeaders != null ? new HashMap <>( additionalHeaders ) : null )
6566 .maxParallelRequests (maxParallelRequests )
6667 .consistency (consistency );
6768 }
You can’t perform that action at this time.
0 commit comments