Class ClientConfiguration
- java.lang.Object
-
- dev.openfga.sdk.api.configuration.Configuration
-
- dev.openfga.sdk.api.configuration.ClientConfiguration
-
- All Implemented Interfaces:
BaseConfiguration
public class ClientConfiguration extends Configuration
-
-
Field Summary
-
Fields inherited from class dev.openfga.sdk.api.configuration.Configuration
VERSION
-
-
Constructor Summary
Constructors Constructor Description ClientConfiguration()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ClientConfigurationapiUrl(java.lang.String apiUrl)Set the API URL for the http client.voidassertValidAuthorizationModelId()voidassertValidStoreId()ClientConfigurationauthorizationModelId(java.lang.String authorizationModelId)Set the Authorization Model ID.ClientConfigurationconnectTimeout(java.time.Duration connectTimeout)Sets the connect timeout (in milliseconds) for the http client.ClientConfigurationcredentials(Credentials credentials)Set the credentials.java.lang.StringgetAuthorizationModelId()Get the Authorization Model ID.java.lang.StringgetAuthorizationModelIdChecked()Get the Authorization Model ID.java.lang.StringgetStoreId()Get the Authorization Model ID.java.lang.StringgetStoreIdChecked()Get the Store ID.ClientConfigurationmaxRetries(int maxRetries)ClientConfigurationminimumRetryDelay(java.time.Duration minimumRetryDelay)ClientConfigurationreadTimeout(java.time.Duration readTimeout)Set the read timeout for the http client.ClientConfigurationstoreId(java.lang.String storeId)Set the Store ID.ClientConfigurationuserAgent(java.lang.String userAgent)Set the user agent.-
Methods inherited from class dev.openfga.sdk.api.configuration.Configuration
assertValid, defaultHeaders, getApiUrl, getConnectTimeout, getCredentials, getDefaultHeaders, getMaxRetries, getMinimumRetryDelay, getReadTimeout, getUserAgent, override
-
-
-
-
Method Detail
-
assertValidStoreId
public void assertValidStoreId() throws FgaInvalidParameterException- Throws:
FgaInvalidParameterException
-
assertValidAuthorizationModelId
public void assertValidAuthorizationModelId() throws FgaInvalidParameterException- Throws:
FgaInvalidParameterException
-
storeId
public ClientConfiguration storeId(java.lang.String storeId)
Set the Store ID.- Parameters:
storeId- The URL.- Returns:
- This object.
-
getStoreId
public java.lang.String getStoreId()
Get the Authorization Model ID.- Returns:
- The Authorization Model ID.
-
getStoreIdChecked
public java.lang.String getStoreIdChecked() throws FgaInvalidParameterExceptionGet the Store ID.- Returns:
- The Store ID.
- Throws:
FgaInvalidParameterException- when the Store ID is null, empty, or whitespace
-
authorizationModelId
public ClientConfiguration authorizationModelId(java.lang.String authorizationModelId)
Set the Authorization Model ID.- Parameters:
authorizationModelId- The URL.- Returns:
- This object.
-
getAuthorizationModelId
public java.lang.String getAuthorizationModelId()
Get the Authorization Model ID.- Returns:
- The Authorization Model ID.
-
getAuthorizationModelIdChecked
public java.lang.String getAuthorizationModelIdChecked() throws FgaInvalidParameterExceptionGet the Authorization Model ID.- Returns:
- The Authorization Model ID.
- Throws:
FgaInvalidParameterException- when the Authorization Model ID is null, empty, or whitespace
-
apiUrl
public ClientConfiguration apiUrl(java.lang.String apiUrl)
Description copied from class:ConfigurationSet the API URL for the http client.- Overrides:
apiUrlin classConfiguration- Parameters:
apiUrl- The URL.- Returns:
- This object.
-
credentials
public ClientConfiguration credentials(Credentials credentials)
Description copied from class:ConfigurationSet the credentials.- Overrides:
credentialsin classConfiguration- Parameters:
credentials- The credentials.- Returns:
- This object.
-
userAgent
public ClientConfiguration userAgent(java.lang.String userAgent)
Description copied from class:ConfigurationSet the user agent.Within the context of a single request, a "User-Agent" header from either
Configuration.defaultHeaders(Map)orConfigurationOverride.additionalHeaders(Map)will take precedence over this value.- Overrides:
userAgentin classConfiguration- Parameters:
userAgent- The user agent.- Returns:
- This object.
-
readTimeout
public ClientConfiguration readTimeout(java.time.Duration readTimeout)
Description copied from class:ConfigurationSet 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.
- Overrides:
readTimeoutin classConfiguration- Parameters:
readTimeout- The read timeout used by default by the http client. Setting this value to null resets the timeout to an effectively infinite value.- Returns:
- This object.
-
connectTimeout
public ClientConfiguration connectTimeout(java.time.Duration connectTimeout)
Description copied from class:ConfigurationSets 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
duration, thenHttpClient::sendthrows anHttpConnectTimeoutException, orHttpClient::sendAsynccompletes exceptionally with anHttpConnectTimeoutException. 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.- Overrides:
connectTimeoutin classConfiguration- Parameters:
connectTimeout- connection timeout in milliseconds- Returns:
- This object.
-
maxRetries
public ClientConfiguration maxRetries(int maxRetries)
- Overrides:
maxRetriesin classConfiguration
-
minimumRetryDelay
public ClientConfiguration minimumRetryDelay(java.time.Duration minimumRetryDelay)
- Overrides:
minimumRetryDelayin classConfiguration
-
-