Class ApiAppOauth


  • public class ApiAppOauth
    extends AbstractResource
    An object describing an API app's OAuth properties.
    • 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 HelloSignException
        Constructor 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