Class ApiAppOauth
- java.lang.Object
-
- com.hellosign.sdk.resource.AbstractResource
-
- com.hellosign.sdk.resource.support.ApiAppOauth
-
public class ApiAppOauth extends AbstractResource
An object describing an API app's OAuth properties.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringAPIAPP_OAUTH_CALLBACK_URLstatic java.lang.StringAPIAPP_OAUTH_KEYstatic java.lang.StringAPIAPP_OAUTH_SCOPESstatic java.lang.StringAPIAPP_OAUTH_SECRET-
Fields inherited from class com.hellosign.sdk.resource.AbstractResource
dataObj, warnings
-
-
Constructor Summary
Constructors Constructor Description ApiAppOauth()Default constructor.ApiAppOauth(org.json.JSONObject json)Constructor that instantiates an ApiApp OAuth object based on the JSON response from the HelloSign API.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddScope(ApiAppOauthScopeType scope)Add a scope to this API App's OAuth scope list.voidclearScopes()Clear all OAuth scopes for this API App.java.lang.StringgetCallbackUrl()The app's OAuth callback URL.java.util.Set<ApiAppOauthScopeType>getScopes()Array of OAuth scopes used by the app.java.lang.StringgetSecret()The app's OAuth secret.java.lang.BooleanhasCallbackUrl()True if the OAuth callback is set.voidremoveScope(ApiAppOauthScopeType scope)Remove the specified OAuth scope from this API App.voidsetCallbackUrl(java.lang.String url)Set this API app OAuth callback.voidsetScopes(java.util.Set<ApiAppOauthScopeType> scopes)Set this API app's OAuth scopes.-
Methods inherited from class com.hellosign.sdk.resource.AbstractResource
add, addToList, clearList, get, getBoolean, getConstructor, getDate, getInteger, getJSONObject, getList, getList, getLong, getString, getWarnings, has, hasString, set, toString, toString
-
-
-
-
Field Detail
-
APIAPP_OAUTH_KEY
public static final java.lang.String APIAPP_OAUTH_KEY
- See Also:
- Constant Field Values
-
APIAPP_OAUTH_CALLBACK_URL
public static final java.lang.String APIAPP_OAUTH_CALLBACK_URL
- See Also:
- Constant Field Values
-
APIAPP_OAUTH_SCOPES
public static final java.lang.String APIAPP_OAUTH_SCOPES
- See Also:
- Constant Field Values
-
APIAPP_OAUTH_SECRET
public static final java.lang.String APIAPP_OAUTH_SECRET
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ApiAppOauth
public ApiAppOauth()
Default constructor.
-
ApiAppOauth
public ApiAppOauth(org.json.JSONObject json) throws HelloSignExceptionConstructor that instantiates an ApiApp OAuth object based on the JSON response from the HelloSign API.- Parameters:
json- JSONObject- Throws:
HelloSignException- thrown if there is a problem updating the OAuth scopes.
-
-
Method Detail
-
getCallbackUrl
public java.lang.String getCallbackUrl()
The app's OAuth callback URL.- Returns:
- String callback URL or null
-
setCallbackUrl
public void setCallbackUrl(java.lang.String url)
Set this API app OAuth callback.- Parameters:
url- String
-
hasCallbackUrl
public java.lang.Boolean hasCallbackUrl()
True if the OAuth callback is set.- Returns:
- Boolean
-
getSecret
public java.lang.String getSecret()
The app's OAuth secret.- Returns:
- String or null
-
getScopes
public java.util.Set<ApiAppOauthScopeType> getScopes()
Array of OAuth scopes used by the app.- Returns:
- List
-
setScopes
public void setScopes(java.util.Set<ApiAppOauthScopeType> scopes)
Set this API app's OAuth scopes.- Parameters:
scopes- List
-
addScope
public void addScope(ApiAppOauthScopeType scope)
Add a scope to this API App's OAuth scope list. Duplicates will be ignored.- Parameters:
scope- ApiAppOauthScopeType
-
clearScopes
public void clearScopes()
Clear all OAuth scopes for this API App.
-
removeScope
public void removeScope(ApiAppOauthScopeType scope)
Remove the specified OAuth scope from this API App.- Parameters:
scope- ApiAppOauthScopeType
-
-