Interface SheetColumnResources


  • public interface SheetColumnResources

    This interface provides methods to access column resources that are associated to a sheet object.

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

    • Method Detail

      • listColumns

        PagedResult<Column> listColumns​(long sheetId,
                                        java.util.EnumSet<ColumnInclusion> includes,
                                        PaginationParameters pagination)
                                 throws SmartsheetException

        List columns of a given sheet.

        It mirrors to the following Smartsheet REST API method: GET /sheets/{sheetId}/columns

        Parameters:
        sheetId - the sheet id
        includes - list of includes
        pagination - the object containing the pagination parameters
        Returns:
        the list of Columns (note that an empty list will be returned if there is none)
        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
      • listColumns

        PagedResult<Column> listColumns​(long sheetId,
                                        java.util.EnumSet<ColumnInclusion> includes,
                                        PaginationParameters pagination,
                                        java.lang.Integer level)
                                 throws SmartsheetException

        List columns of a given sheet.

        It mirrors to the following Smartsheet REST API method: GET /sheets/{sheetId}/columns

        Parameters:
        sheetId - the sheet id
        includes - list of includes
        pagination - the object containing the pagination parameters
        level - compatibility level
        Returns:
        the list of Columns (note that an empty list will be returned if there is none)
        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
      • addColumns

        java.util.List<Column> addColumns​(long sheetId,
                                          java.util.List<Column> columns)
                                   throws SmartsheetException

        Add column to a sheet.

        It mirrors to the following Smartsheet REST API method: POST /sheets/{sheetId}/columns

        Parameters:
        sheetId - the sheet id
        columns - the list of column object
        Returns:
        the list of created column
        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
      • deleteColumn

        void deleteColumn​(long sheetId,
                          long columnId)
                   throws SmartsheetException

        Delete column.

        It mirrors to the following Smartsheet REST API method: DELETE /sheets/{sheetId}/columns/{columnId}

        Parameters:
        sheetId - the sheet id
        columnId - the column id
        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
      • updateColumn

        Column updateColumn​(long sheetId,
                            Column column)
                     throws SmartsheetException

        Update a column.

        It mirrors to the following Smartsheet REST API method: PUT /sheets/{sheetId}/columns/{columnId}

        Exceptions: IllegalArgumentException : if any argument is null 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 can not be found ServiceUnavailableException : if the REST API service is not available (possibly due to rate limiting) SmartsheetRestException : if there is any other REST API related error occurred during the operation SmartsheetException : if there is any other error occurred during the operation

        Parameters:
        sheetId - the sheetId
        column - the column to update limited to the following attributes: index (column's new index in the sheet), title, sheetId, type, options (optional), symbol (optional), systemColumnType (optional), autoNumberFormat (optional)
        Returns:
        the updated sheet (note that if there is no such resource, this method will throw ResourceNotFoundException rather than returning null).
        Throws:
        SmartsheetException - the smartsheet exception
      • getColumn

        Column getColumn​(long sheetId,
                         long columnId,
                         java.util.EnumSet<ColumnInclusion> includes)
                  throws SmartsheetException

        Gets the Column specified in the URL.

        It mirrors to the following Smartsheet REST API method: GET /sheets/{sheetId}/columns/{columnId}

        Exceptions: 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 can not be found ServiceUnavailableException : if the REST API service is not available (possibly due to rate limiting) SmartsheetRestException : if there is any other REST API related error occurred during the operation SmartsheetException : if there is any other error occurred during the operation

        Parameters:
        sheetId - the sheet id
        columnId - the column id
        includes - list of includes
        Returns:
        the column (note that empty list will be returned if there is none)
        Throws:
        SmartsheetException - the smartsheet exception