public static class SdkRequestConfig.Builder extends Object
SdkRequestConfig object.| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
SdkRequestConfig |
build()
Builds the
SdkRequestConfig with the current state of the builder. |
SdkRequestConfig.Builder |
customHeader(String name,
String value)
Put a new custom header to the map of custom header names to custom header values.
|
SdkRequestConfig.Builder |
customQueryParam(String name,
String value)
Add a custom query parameter for the request.
|
SdkRequestConfig.Builder |
httpRequestTimeout(int httpRequestTimeout)
Sets the amount of time to wait (in milliseconds) for a single HTTP request to complete before giving
up and timing out.
|
SdkRequestConfig.Builder |
totalExecutionTimeout(int totalExecutionTimeout)
Sets the amount of time (in milliseconds) to allow the client to complete the execution of
an API call.
|
public SdkRequestConfig.Builder httpRequestTimeout(int httpRequestTimeout)
This feature requires buffering the entire response (for non-streaming APIs) into memory to enforce a hard timeout when reading the response. For APIs that return large responses this could be expensive.
The http request timeout feature doesn't have strict guarantees on how quickly a request is aborted when the timeout is breached. The typical case aborts the request within a few milliseconds but there may occasionally be requests that don't get aborted until several seconds after the timer has been breached. Because of this, this feature should not be used when absolute precision is needed.
This timeout is disabled by default.
httpRequestTimeout - The amount of time to wait (in milliseconds) for the request to
complete before giving up and timing out. A non-positive value
disables the timeout for this request.#totalExecutionTimeout(int)} to enforce a timeout across all retriespublic SdkRequestConfig.Builder totalExecutionTimeout(int totalExecutionTimeout)
This feature requires buffering the entire response (for non-streaming APIs) into memory to enforce a hard timeout when reading the response. For APIs that return large responses this could be expensive.
The total execution timeout feature doesn't have strict guarantees on how quickly a request is aborted when the timeout is breached. The typical case aborts the request within a few milliseconds but there may occasionally be requests that don't get aborted until several seconds after the timer has been breached. Because of this, the client execution timeout feature should not be used when absolute precision is needed.
This timeout is disabled by default.
totalExecutionTimeout - The amount of time (in milliseconds) to allow the client to
complete the execution of an API call. A non-positive value
disables the timeout for this request.#httpRequestTimeout(int)} to enforce a timeout per HTTP requestpublic SdkRequestConfig.Builder customHeader(String name, String value)
NOTE: Custom header values set via this method will overwrite any conflicting values coming from the request parameters.
name - The name of the header to addvalue - The value of the header to addpublic SdkRequestConfig.Builder customQueryParam(String name, String value)
name - The name of the query parametervalue - The value of the query parameter. Only the parameter name will be added in
the URI if the value is set to null. For example, customQueryParameter("param",
null) will be serialized to "?param", while customQueryParameter("param",
"") will be serialized to "?param=".public SdkRequestConfig build()
SdkRequestConfig with the current state of the builder.SdkRequestConfig object. See BaseRequest.sdkRequestConfig(SdkRequestConfig).Copyright © 2019. All rights reserved.