Package com.dnsimple
Class Client.Builder
java.lang.Object
com.dnsimple.Client.Builder
- Enclosing class:
- Client
Builder class to obtain Client instances. By default, builders will
provide a Client instance pointing to the production environment, a default
user agent header, no access token, and using the default Java11 native HTTP
client implementation of HttpRequestFactory.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaccessToken(String accessToken) Set a the access token for all API requests.Use a custom API base URLUse a custom API base URLbuild()Builds a Client object with the configured values and returns it.extraUserAgent(String userAgent) Set an extra user agent that will be prefixed to the defaulthttpRequestFactory(HttpRequestFactory factory) Use a custom HTTP request factory objectsandbox()Use DNSimple API's sandbox environment
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
sandbox
Use DNSimple API's sandbox environment- Returns:
- this Builder object
-
apiBase
Use a custom API base URL- Parameters:
url- the base URL of the API to be used- Returns:
- this Builder object
-
apiBase
Use a custom API base URL- Parameters:
url- the base URL of the API to be used- Returns:
- this Builder object
-
httpRequestFactory
Use a custom HTTP request factory object- Parameters:
factory- factory of HTTP requests to be used- Returns:
- this Builder object
-
extraUserAgent
Set an extra user agent that will be prefixed to the default- Parameters:
userAgent- userAgent string to be prefixed- Returns:
- this Builder object
-
accessToken
Set a the access token for all API requests. You can set it later directly on the Client object as well.- Parameters:
accessToken- the access token to be used- Returns:
- this Builder object
-
build
Builds a Client object with the configured values and returns it.- Returns:
- the Client object
-