public static class NightfallClient.Builder extends Object
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
NightfallClient |
build()
Builds the client using the configured values, falling back on defaults if any values
were not explicitly set.
|
static NightfallClient |
defaultClient()
Builds and returns the client with all default values.
|
NightfallClient.Builder |
withAPIKey(String apiKey)
Sets the API key for the Nightfall Client.
|
NightfallClient.Builder |
withConnectionTimeout(Duration connectionTimeout)
Sets the connection timeout for the underlying HTTP client.
|
NightfallClient.Builder |
withFileUploadConcurrency(int concurrency)
Sets the concurrency for file upload operations.
|
NightfallClient.Builder |
withInterceptor(okhttp3.Interceptor interceptor)
Adds an interceptor to the HTTP client used to preform requests.
|
NightfallClient.Builder |
withKeepAliveDuration(Duration keepAliveDuration)
Sets the keep-alive duration for a connection in the underlying HTTP connection pool.
|
NightfallClient.Builder |
withMaxIdleConnections(int maxIdleConnections)
Sets the maximum number of idle connections in the underlying HTTP client.
|
NightfallClient.Builder |
withReadTimeout(Duration readTimeout)
Sets the read timeout for the underlying HTTP client.
|
NightfallClient.Builder |
withWriteTimeout(Duration writeTimeout)
Sets the write timeout for the underlying HTTP client.
|
public static NightfallClient defaultClient()
NIGHTFALL_API_KEY. The underlying client manages an HTTP connection pool, so instantiating
more than one Nightfall client is not necessary.IllegalArgumentException - if no value is set for the API keypublic NightfallClient.Builder withAPIKey(String apiKey)
apiKey - a valid Nightfall API keypublic NightfallClient.Builder withFileUploadConcurrency(int concurrency)
concurrency - an integer in the range [1, 100]IllegalArgumentException - if the argument falls outside the allowed rangepublic NightfallClient.Builder withConnectionTimeout(Duration connectionTimeout)
connectionTimeout - a non-negative duration less than or equal to 60 secondsIllegalArgumentException - if the argument falls outside the allowed rangepublic NightfallClient.Builder withReadTimeout(Duration readTimeout)
readTimeout - a non-negative duration less than or equal to 120 secondsIllegalArgumentException - if the argument falls outside the allowed rangepublic NightfallClient.Builder withWriteTimeout(Duration writeTimeout)
writeTimeout - a non-negative duration less than or equal to 120 secondsIllegalArgumentException - if the argument falls outside the allowed rangepublic NightfallClient.Builder withMaxIdleConnections(int maxIdleConnections)
fileUploadConcurrency. If unset, defaults to 100.maxIdleConnections - an integer in the range [1, 500]IllegalArgumentException - if the argument falls outside the allowed rangepublic NightfallClient.Builder withKeepAliveDuration(Duration keepAliveDuration)
keepAliveDuration - a positive duration less than or equal to 120 secondsIllegalArgumentException - if the argument falls outside the allowed rangepublic NightfallClient.Builder withInterceptor(okhttp3.Interceptor interceptor)
interceptor - a OkHttpClient interceptorpublic NightfallClient build()
IllegalArgumentException - if the API key was not setCopyright © 2022. All rights reserved.