public class SmartsheetBuilder extends Object
A convenience class to help create a Smartsheet instance with the appropriate fields.
Thread Safety: This class is not thread safe since it's mutable, one builder instance is NOT expected to be used in multiple threads.
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_BASE_URI
Represents the default base URI of the Smartsheet REST API.
|
static String |
GOV_BASE_URI
Represents the default base URI of the Smartsheetgov REST API.
|
| Constructor and Description |
|---|
SmartsheetBuilder()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Smartsheet |
build()
Build the Smartsheet instance.
|
String |
getAccessToken()
Gets the access token.
|
String |
getAssumedUser()
Gets the assumed user.
|
String |
getBaseURI()
Gets the base uri.
|
String |
getChangeAgent()
Gets the Smartsheet Change-Agent
|
static String |
getDefaultBaseUri()
Gets the default base uri.
|
com.smartsheet.api.internal.http.HttpClient |
getHttpClient()
Gets the http client.
|
com.smartsheet.api.internal.json.JsonSerializer |
getJsonSerializer()
Gets the json serializer.
|
SmartsheetBuilder |
setAccessToken(String accessToken)
Set the access token.
|
SmartsheetBuilder |
setAssumedUser(String assumedUser)
Set the assumed user.
|
SmartsheetBuilder |
setBaseURI(String baseURI)
Set the base URI.
|
SmartsheetBuilder |
setChangeAgent(String changeAgent)
Set the assumed user.
|
SmartsheetBuilder |
setHttpClient(com.smartsheet.api.internal.http.HttpClient httpClient)
Set the HttpClient.
|
SmartsheetBuilder |
setJsonSerializer(com.smartsheet.api.internal.json.JsonSerializer jsonSerializer)
Set the JsonSerializer.
|
SmartsheetBuilder |
setMaxRetryTimeMillis(long maxRetryTimeMillis)
Store a user provided userCalcBackoff.
|
public static final String DEFAULT_BASE_URI
Represents the default base URI of the Smartsheet REST API.
It is a constant with value "https://api.smartsheet.com/2.0".
public static final String GOV_BASE_URI
Represents the default base URI of the Smartsheetgov REST API.
It is a constant with value "https://api.smartsheetgov.com/2.0".
public SmartsheetBuilder setHttpClient(com.smartsheet.api.internal.http.HttpClient httpClient)
Set the HttpClient.
httpClient - the http clientpublic SmartsheetBuilder setJsonSerializer(com.smartsheet.api.internal.json.JsonSerializer jsonSerializer)
Set the JsonSerializer.
jsonSerializer - the JsonSerializerpublic SmartsheetBuilder setBaseURI(String baseURI)
Set the base URI.
baseURI - the base uripublic SmartsheetBuilder setAccessToken(String accessToken)
Set the access token.
accessToken - the access tokenpublic SmartsheetBuilder setMaxRetryTimeMillis(long maxRetryTimeMillis)
Store a user provided userCalcBackoff.
This interface is only valid when the DefaultHttpClient is used.
maxRetryTimeMillis - public SmartsheetBuilder setAssumedUser(String assumedUser)
Set the assumed user.
assumedUser - the assumed userpublic SmartsheetBuilder setChangeAgent(String changeAgent)
Set the assumed user.
changeAgent - the identifier to include in the webhooks that result from the changes
made using the APIpublic com.smartsheet.api.internal.http.HttpClient getHttpClient()
Gets the http client.
public com.smartsheet.api.internal.json.JsonSerializer getJsonSerializer()
Gets the json serializer.
public String getBaseURI()
Gets the base uri.
public String getAccessToken()
Gets the access token.
public String getAssumedUser()
Gets the assumed user.
public static String getDefaultBaseUri()
Gets the default base uri.
public String getChangeAgent()
Gets the Smartsheet Change-Agent
public Smartsheet build()
Build the Smartsheet instance.
IllegalStateException - if accessToken isn't set yet.Copyright © 2014–2019 Smartsheet. All rights reserved.