Package com.smartsheet.api.oauth
Class OAuthFlowBuilder
- java.lang.Object
-
- com.smartsheet.api.oauth.OAuthFlowBuilder
-
public class OAuthFlowBuilder extends java.lang.ObjectThis is the builder that is used to build
OAuthFlowinstances.Thread Safety: This class is not thread safe since it's mutable, one builder instance is NOT expected to be used in multiple threads.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEFAULT_AUTHORIZATION_URLRepresents the default OAuth authorization URLstatic java.lang.StringDEFAULT_TOKEN_URLRepresents the default token URL
-
Constructor Summary
Constructors Constructor Description OAuthFlowBuilder()Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description OAuthFlowbuild()Build the OAuthFlow instance.java.lang.StringgetAuthorizationURL()Gets the authorization url.java.lang.StringgetClientId()Gets the client id.java.lang.StringgetClientSecret()Gets the client secret.static java.lang.StringgetDefaultAuthorizationUrl()Gets the default authorization url.static java.lang.StringgetDefaultTokenUrl()Gets the default token url.com.smartsheet.api.internal.http.HttpClientgetHttpClient()Gets the http client.com.smartsheet.api.internal.json.JsonSerializergetJsonSerializer()Gets the json serializer.java.lang.StringgetRedirectURL()Gets the redirect url.java.lang.StringgetTokenURL()Gets the token url.OAuthFlowBuildersetAuthorizationURL(java.lang.String authorizationURL)Set the authorization URL.OAuthFlowBuildersetClientId(java.lang.String clientId)Set the client IDOAuthFlowBuildersetClientSecret(java.lang.String clientSecret)Set the client secret.OAuthFlowBuildersetHttpClient(com.smartsheet.api.internal.http.HttpClient httpClient)Set the HttpClient.OAuthFlowBuildersetJsonSerializer(com.smartsheet.api.internal.json.JsonSerializer jsonSerializer)Set the JsonSerializer.OAuthFlowBuildersetRedirectURL(java.lang.String redirectURL)Set the redirect URLOAuthFlowBuildersetTokenURL(java.lang.String tokenURL)Set the token URL.
-
-
-
Field Detail
-
DEFAULT_AUTHORIZATION_URL
public static final java.lang.String DEFAULT_AUTHORIZATION_URL
Represents the default OAuth authorization URL
It is a constant with value "https://www.smartsheet.com/b/authorize".
- See Also:
- Constant Field Values
-
DEFAULT_TOKEN_URL
public static final java.lang.String DEFAULT_TOKEN_URL
Represents the default token URL
It is a constant with value "https://api.smartsheet.com/1.1/token".
- See Also:
- Constant Field Values
-
-
Method Detail
-
setHttpClient
public OAuthFlowBuilder setHttpClient(com.smartsheet.api.internal.http.HttpClient httpClient)
Set the HttpClient.- Parameters:
httpClient- the httpClient- Returns:
- the OAuthFlowBuilder
-
setJsonSerializer
public OAuthFlowBuilder setJsonSerializer(com.smartsheet.api.internal.json.JsonSerializer jsonSerializer)
Set the JsonSerializer.
- Parameters:
jsonSerializer- the JsonSerializer- Returns:
- the oAuthFlowBuilder
- Throws:
java.lang.IllegalArgumentException- if any argument is null/empty string
-
setClientId
public OAuthFlowBuilder setClientId(java.lang.String clientId)
Set the client ID- Parameters:
clientId- the value to set- Returns:
- the OAuthFlowBuilder
- Throws:
java.lang.IllegalArgumentException- if any argument is null/empty string
-
setClientSecret
public OAuthFlowBuilder setClientSecret(java.lang.String clientSecret)
Set the client secret.- Parameters:
clientSecret- the client secret- Returns:
- the OAuthFlowBuilder
- Throws:
java.lang.IllegalArgumentException- if any argument is null/empty string
-
setRedirectURL
public OAuthFlowBuilder setRedirectURL(java.lang.String redirectURL)
Set the redirect URL- Parameters:
redirectURL- the redirect url- Returns:
- the OAuthFlowBuilder
- Throws:
java.lang.IllegalArgumentException- if any argument is null/empty string
-
setAuthorizationURL
public OAuthFlowBuilder setAuthorizationURL(java.lang.String authorizationURL)
Set the authorization URL.- Parameters:
authorizationURL- the authorization URL- Returns:
- the OAuthFlowBuilder
- Throws:
java.lang.IllegalArgumentException- if any argument is null/empty string
-
setTokenURL
public OAuthFlowBuilder setTokenURL(java.lang.String tokenURL)
Set the token URL.- Parameters:
tokenURL- the token url- Returns:
- the OAuthFlowBuilder
- Throws:
java.lang.IllegalArgumentException- if any argument is null/empty string
-
getDefaultAuthorizationUrl
public static java.lang.String getDefaultAuthorizationUrl()
Gets the default authorization url.- Returns:
- the default authorization url
-
getDefaultTokenUrl
public static java.lang.String getDefaultTokenUrl()
Gets the default token url.- Returns:
- the default token url
-
getHttpClient
public com.smartsheet.api.internal.http.HttpClient getHttpClient()
Gets the http client.- Returns:
- the http client
-
getJsonSerializer
public com.smartsheet.api.internal.json.JsonSerializer getJsonSerializer()
Gets the json serializer.- Returns:
- the json serializer
-
getClientId
public java.lang.String getClientId()
Gets the client id.- Returns:
- the client id
-
getClientSecret
public java.lang.String getClientSecret()
Gets the client secret.- Returns:
- the client secret
-
getRedirectURL
public java.lang.String getRedirectURL()
Gets the redirect url.- Returns:
- the redirect url
-
getAuthorizationURL
public java.lang.String getAuthorizationURL()
Gets the authorization url.- Returns:
- the authorization url
-
getTokenURL
public java.lang.String getTokenURL()
Gets the token url.- Returns:
- the token url
-
build
public OAuthFlow build()
Build the OAuthFlow instance.- Returns:
- the OAuthFlow instance
- Throws:
java.lang.IllegalArgumentException- if clientId, clientSecret or redirectURL isn't set yet.
-
-