Package com.styra.opa.openapi
Class OpaApiClient.Builder
java.lang.Object
com.styra.opa.openapi.OpaApiClient.Builder
- Enclosing class:
- OpaApiClient
The Builder class allows the configuration of a new instance of the SDK.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a new instance of the SDK.client
(HTTPClient client) Allows the default HTTP client to be overridden with a custom implementation.retryConfig
(RetryConfig retryConfig) Overrides the default configuration for retriesConfigures the SDK to use the provided security details.securitySource
(SecuritySource securitySource) Configures the SDK to use a custom security source.serverIndex
(int serverIdx) Overrides the default server by index.Overrides the default server URL.Overrides the default server URL with a templated URL populated with the provided parameters.
-
Method Details
-
client
Allows the default HTTP client to be overridden with a custom implementation.- Parameters:
client
- The HTTP client to use for all requests.- Returns:
- The builder instance.
-
securitySource
Configures the SDK to use a custom security source.- Parameters:
securitySource
- The security source to use for all requests.- Returns:
- The builder instance.
-
serverURL
Overrides the default server URL.- Parameters:
serverUrl
- The server URL to use for all requests.- Returns:
- The builder instance.
-
serverURL
Overrides the default server URL with a templated URL populated with the provided parameters.- Parameters:
serverUrl
- The server URL to use for all requests.params
- The parameters to use when templating the URL.- Returns:
- The builder instance.
-
serverIndex
Overrides the default server by index.- Parameters:
serverIdx
- The server to use for all requests.- Returns:
- The builder instance.
-
retryConfig
Overrides the default configuration for retries- Parameters:
retryConfig
- The retry configuration to use for all requests.- Returns:
- The builder instance.
-
build
Builds a new instance of the SDK.- Returns:
- The SDK instance.
-