Package com.stripe.net
Class RequestOptions.RequestOptionsBuilder
- java.lang.Object
-
- com.stripe.net.RequestOptions.RequestOptionsBuilder
-
- Enclosing class:
- RequestOptions
public static final class RequestOptions.RequestOptionsBuilder extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description RequestOptionsBuilder()
Constructs a request options builder with the global parameters (API key, client ID and API version) as default values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RequestOptions
build()
Constructs aRequestOptions
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
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
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.
-
-
-
Method Detail
-
getApiKey
public java.lang.String getApiKey()
-
setApiKey
public RequestOptions.RequestOptionsBuilder setApiKey(java.lang.String apiKey)
-
clearApiKey
public RequestOptions.RequestOptionsBuilder clearApiKey()
-
getClientId
public java.lang.String getClientId()
-
setClientId
public RequestOptions.RequestOptionsBuilder setClientId(java.lang.String clientId)
-
clearClientId
public RequestOptions.RequestOptionsBuilder clearClientId()
-
setIdempotencyKey
public RequestOptions.RequestOptionsBuilder setIdempotencyKey(java.lang.String idempotencyKey)
-
getConnectTimeout
public int getConnectTimeout()
-
setConnectTimeout
public RequestOptions.RequestOptionsBuilder setConnectTimeout(int timeout)
Sets the timeout value that will be used for making new connections to the Stripe API (in milliseconds).- Parameters:
timeout
- timeout value in milliseconds
-
getReadTimeout
public int getReadTimeout()
-
setReadTimeout
public 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).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.
- Parameters:
timeout
- timeout value in milliseconds
-
clearIdempotencyKey
public RequestOptions.RequestOptionsBuilder clearIdempotencyKey()
-
getIdempotencyKey
public java.lang.String getIdempotencyKey()
-
getStripeAccount
public java.lang.String getStripeAccount()
-
setStripeAccount
public RequestOptions.RequestOptionsBuilder setStripeAccount(java.lang.String stripeAccount)
-
clearStripeAccount
public RequestOptions.RequestOptionsBuilder clearStripeAccount()
-
getStripeVersionOverride
public java.lang.String getStripeVersionOverride()
-
setStripeVersionOverride
public 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. One example is inEphemeralKey.create(Map, RequestOptions)
. Setting this value in a typical scenario will result in deserialization error as the model classes have schema according to the pinnedStripe.API_VERSION
and not thestripeVersionOverride
- Parameters:
stripeVersionOverride
- stripe version override which belongs to the client to make request on behalf of.- Returns:
- option builder
-
clearStripeVersionOverride
public RequestOptions.RequestOptionsBuilder clearStripeVersionOverride()
-
build
public RequestOptions build()
Constructs aRequestOptions
with the specified values.
-
-