Interface SearchResources


  • public interface SearchResources
    This interface provides methods to access search resources.

    Thread Safety: Implementation of this interface must be thread safe.

    • Method Detail

      • search

        SearchResult search​(java.lang.String query)
                     throws SmartsheetException

        Performs a search across all Sheets to which user has access.

        It mirrors to the following Smartsheet REST API method: GET /search

        Parameters:
        query - the query text
        Returns:
        the search result (note that if there is no such resource, this method will throw ResourceNotFoundException rather than returning null).
        Throws:
        java.lang.IllegalArgumentException - if any argument is null or empty string
        InvalidRequestException - if there is any problem with the REST API request
        AuthorizationException - if there is any problem with the REST API authorization (access token)
        ResourceNotFoundException - if the resource cannot be found
        ServiceUnavailableException - if the REST API service is not available (possibly due to rate limiting)
        SmartsheetException - if there is any other error during the operation
      • search

        SearchResult search​(java.lang.String query,
                            java.util.EnumSet<SearchInclusion> includes,
                            SearchLocation location,
                            java.util.Date modifiedSince,
                            java.util.EnumSet<SearchScope> scopes)
                     throws SmartsheetException

        Performs a search across all Sheets to which user has access.

        It mirrors to the following Smartsheet REST API method: GET /search

        Parameters:
        query - the query text
        includes - enum set of inclusions
        location - when specified with a value of "personalWorkspace" limits response to only those items in the user's Workspace
        modifiedSince - only return items modified since this date
        scopes - enum set of search filters
        Returns:
        the search result (note that if there is no such resource, this method will throw ResourceNotFoundException rather than returning null).
        Throws:
        java.lang.IllegalArgumentException - if any argument is null or empty string
        InvalidRequestException - if there is any problem with the REST API request
        AuthorizationException - if there is any problem with the REST API authorization (access token)
        ResourceNotFoundException - if the resource cannot be found
        ServiceUnavailableException - if the REST API service is not available (possibly due to rate limiting)
        SmartsheetException - if there is any other error during the operation
      • searchSheet

        SearchResult searchSheet​(long sheetId,
                                 java.lang.String query)
                          throws SmartsheetException

        Performs a search within a sheet.

        It mirrors to the following Smartsheet REST API method: GET /search/sheet/{sheetId}

        Parameters:
        sheetId - the sheet id
        query - the query text
        Returns:
        the search result (note that if there is no such resource, this method will throw ResourceNotFoundException rather than returning null).
        Throws:
        java.lang.IllegalArgumentException - if any argument is null or empty string
        InvalidRequestException - if there is any problem with the REST API request
        AuthorizationException - if there is any problem with the REST API authorization (access token)
        ResourceNotFoundException - if the resource cannot be found
        ServiceUnavailableException - if the REST API service is not available (possibly due to rate limiting)
        SmartsheetException - if there is any other error during the operation