public static final class RequestOptions.RequestOptionsBuilder
extends java.lang.Object
Constructor and Description |
---|
RequestOptionsBuilder()
Constructs a request options builder with the global parameters (API key and client ID) as
default values.
|
Modifier and Type | Method and Description |
---|---|
RequestOptions |
build()
Constructs a
RequestOptions with the specified values. |
RequestOptions.RequestOptionsBuilder |
clearApiKey() |
RequestOptions.RequestOptionsBuilder |
clearClientId() |
RequestOptions.RequestOptionsBuilder |
clearIdempotencyKey() |
RequestOptions.RequestOptionsBuilder |
clearStripeAccount() |
RequestOptions.RequestOptionsBuilder |
clearStripeVersionOverride() |
java.lang.String |
getApiKey() |
java.lang.String |
getClientId() |
int |
getConnectTimeout() |
java.lang.String |
getIdempotencyKey() |
int |
getMaxNetworkRetries() |
int |
getReadTimeout() |
java.lang.String |
getStripeAccount() |
java.lang.String |
getStripeVersionOverride() |
RequestOptions.RequestOptionsBuilder |
setApiKey(java.lang.String apiKey) |
RequestOptions.RequestOptionsBuilder |
setClientId(java.lang.String clientId) |
RequestOptions.RequestOptionsBuilder |
setConnectTimeout(int timeout)
Sets the timeout value that will be used for making new connections to the Stripe API (in
milliseconds).
|
RequestOptions.RequestOptionsBuilder |
setIdempotencyKey(java.lang.String idempotencyKey) |
RequestOptions.RequestOptionsBuilder |
setMaxNetworkRetries(int maxNetworkRetries)
Sets the maximum number of times the request will be retried in the event of a failure.
|
RequestOptions.RequestOptionsBuilder |
setReadTimeout(int timeout)
Sets the timeout value that will be used when reading data from an established connection to
the Stripe API (in milliseconds).
|
RequestOptions.RequestOptionsBuilder |
setStripeAccount(java.lang.String stripeAccount) |
RequestOptions.RequestOptionsBuilder |
setStripeVersionOverride(java.lang.String stripeVersionOverride)
Do not use this except for in API where JSON response is not fully deserialized into explicit
Stripe classes, but only passed to other clients as raw data -- essentially making request on
behalf of others with their API version.
|
public RequestOptionsBuilder()
public java.lang.String getApiKey()
public RequestOptions.RequestOptionsBuilder setApiKey(java.lang.String apiKey)
public RequestOptions.RequestOptionsBuilder clearApiKey()
public java.lang.String getClientId()
public RequestOptions.RequestOptionsBuilder setClientId(java.lang.String clientId)
public RequestOptions.RequestOptionsBuilder clearClientId()
public RequestOptions.RequestOptionsBuilder setIdempotencyKey(java.lang.String idempotencyKey)
public int getConnectTimeout()
public RequestOptions.RequestOptionsBuilder setConnectTimeout(int timeout)
timeout
- timeout value in millisecondspublic int getReadTimeout()
public RequestOptions.RequestOptionsBuilder setReadTimeout(int timeout)
Note that this value should be set conservatively because some API requests can take time and a short timeout increases the likelihood of causing a problem in the backend.
timeout
- timeout value in millisecondspublic int getMaxNetworkRetries()
public RequestOptions.RequestOptionsBuilder setMaxNetworkRetries(int maxNetworkRetries)
maxNetworkRetries
- the number of times to retry the requestpublic RequestOptions.RequestOptionsBuilder clearIdempotencyKey()
public java.lang.String getIdempotencyKey()
public java.lang.String getStripeAccount()
public RequestOptions.RequestOptionsBuilder setStripeAccount(java.lang.String stripeAccount)
public RequestOptions.RequestOptionsBuilder clearStripeAccount()
public java.lang.String getStripeVersionOverride()
public RequestOptions.RequestOptionsBuilder setStripeVersionOverride(java.lang.String stripeVersionOverride)
EphemeralKey.create(Map, RequestOptions)
. Setting this value in a typical
scenario will result in deserialization error as the model classes have schema according to
the pinned Stripe.API_VERSION
and not the stripeVersionOverride
stripeVersionOverride
- stripe version override which belongs to the client to make
request on behalf of.public RequestOptions.RequestOptionsBuilder clearStripeVersionOverride()
public RequestOptions build()
RequestOptions
with the specified values.