Interface SheetRowResources


  • public interface SheetRowResources
    This interface provides methods to access row resources that are associated to a sheet object.

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

    • Method Detail

      • addRows

        java.util.List<Row> addRows​(long sheetId,
                                    java.util.List<Row> rows)
                             throws SmartsheetException

        Insert rows to a sheet.

        It mirrors to the following Smartsheet REST API method: POST /sheets/{id}/rows

        Parameters:
        sheetId - the sheet id
        rows - the list of rows to create
        Returns:
        the list of created rows
        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
      • addRows

        java.util.List<Row> addRows​(long sheetId,
                                    java.util.List<Row> rows,
                                    java.util.EnumSet<RowInclusion> includes,
                                    java.util.EnumSet<ObjectExclusion> excludes)
                             throws SmartsheetException

        Insert rows to a sheet.

        It mirrors to the following Smartsheet REST API method: POST /sheets/{id}/rows

        Parameters:
        sheetId - the sheet id
        rows - the list of rows to create
        includes - optional objects to include
        excludes - optional objects to exclude
        Returns:
        the list of created rows
        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
      • addRowsAllowPartialSuccess

        PartialRowUpdateResult addRowsAllowPartialSuccess​(long sheetId,
                                                          java.util.List<Row> rows)
                                                   throws SmartsheetException

        Insert rows to a sheet, allowing partial success. If a row cannot be inserted, it will fail, while the others may succeed..

        It mirrors to the following Smartsheet REST API method: POST /sheets/{id}/rows

        Parameters:
        sheetId - the sheet id
        rows - the list of rows to create
        Returns:
        the list of created rows
        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
      • addRowsAllowPartialSuccess

        PartialRowUpdateResult addRowsAllowPartialSuccess​(long sheetId,
                                                          java.util.List<Row> rows,
                                                          java.util.EnumSet<RowInclusion> includes,
                                                          java.util.EnumSet<ObjectExclusion> excludes)
                                                   throws SmartsheetException

        Insert rows to a sheet, allowing partial success. If a row cannot be inserted, it will fail, while the others may succeed..

        It mirrors to the following Smartsheet REST API method: POST /sheets/{id}/rows

        Parameters:
        sheetId - the sheet id
        rows - the list of rows to create
        includes - optional objects to include
        excludes - optional objects to exclude
        Returns:
        the list of created rows
        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
      • getRow

        Row getRow​(long sheetId,
                   long rowId,
                   java.util.EnumSet<RowInclusion> includes,
                   java.util.EnumSet<ObjectExclusion> excludes)
            throws SmartsheetException

        Get a row.

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

        Parameters:
        sheetId - the id of the sheet
        rowId - the id of the row
        includes - optional objects to include
        excludes - optional objects to exclude
        Returns:
        the created row (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
      • deleteRow

        @Deprecated(since="2.0.2",
                    forRemoval=true)
        void deleteRow​(long sheetId,
                       long rowId)
                throws SmartsheetException
        Deprecated, for removal: This API element is subject to removal in a future version.
        as of API 2.0.2 release, replaced by deleteRows(long, Set, boolean)

        Delete a row.

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

        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
        rowId - the row id
        Throws:
        SmartsheetException - the smartsheet exception
      • sendRow

        @Deprecated(since="2.0.2",
                    forRemoval=true)
        void sendRow​(long sheetId,
                     long rowId,
                     RowEmail email)
              throws SmartsheetException
        Deprecated, for removal: This API element is subject to removal in a future version.
        as of API V2.0.2, replaced by sendRows(long, MultiRowEmail)

        Send a row via email to the designated recipients.

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

        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) 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 id of the sheet
        rowId - the id of the row
        email - the row email
        Throws:
        SmartsheetException - the smartsheet exception
      • sendRows

        void sendRows​(long sheetId,
                      MultiRowEmail email)
               throws SmartsheetException

        Send a row via email to the designated recipients.

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

        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) 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 id of the sheet
        email - the multi row email
        Throws:
        SmartsheetException - the smartsheet exception
      • deleteRows

        java.util.List<java.lang.Long> deleteRows​(long sheetId,
                                                  java.util.Set<java.lang.Long> rowIds,
                                                  boolean ignoreRowsNotFound)
                                           throws SmartsheetException

        Deletes one or more row(s) from the Sheet specified in the URL.

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

        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
        rowIds - the row ids
        ignoreRowsNotFound - boolean for ignoring row ids not found
        Returns:
        a list of deleted rows
        Throws:
        SmartsheetException - the smartsheet exception
      • updateRows

        java.util.List<Row> updateRows​(long sheetId,
                                       java.util.List<Row> rows)
                                throws SmartsheetException

        Update rows.

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

        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) 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 id of the sheet
        rows - the list of rows
        Returns:
        a list of rows
        Throws:
        SmartsheetException - the smartsheet exception
      • updateRows

        java.util.List<Row> updateRows​(long sheetId,
                                       java.util.List<Row> rows,
                                       java.util.EnumSet<RowInclusion> includes,
                                       java.util.EnumSet<ObjectExclusion> excludes)
                                throws SmartsheetException

        Update rows.

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

        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) 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 id of the sheet
        rows - the list of rows
        includes - optional objects to include
        excludes - optional objects to exclude
        Returns:
        a list of rows
        Throws:
        SmartsheetException - the smartsheet exception
      • updateCell

        Row updateCell​(long sheetId,
                       Cell cell)
                throws SmartsheetException

        Helper method: Update a single cell

        Parameters:
        sheetId - the sheet ID the cell should be written to
        cell - the cell object to be written. Must include a rowId and columnId
        Returns:
        The returned Row object from the api
        Throws:
        SmartsheetException - the smartsheet exception
      • updateCell

        Row updateCell​(long sheetId,
                       int rowIdx,
                       int colIdx,
                       java.lang.String newValue)
                throws SmartsheetException

        Helper method: Update a single with a string value

        NOTE: This method internally fetches the sheet. To avoid this step, fetch the sheet in advance and use the method by the same name

        Parameters:
        sheetId - the sheet ID the cell should be written to
        rowIdx - the row index of the cell (base 1 indexed)
        colIdx - the column index of the cell (base 1 indexed)
        newValue - the new value of the cell
        Returns:
        The returned Row object from the api
        Throws:
        SmartsheetException - the smartsheet exception
      • updateCell

        Row updateCell​(Sheet sheet,
                       int rowIdx,
                       int colIdx,
                       java.lang.String newValue)
                throws SmartsheetException

        Helper method: Update a single with a string value

        Parameters:
        sheet - The sheet to update the cell in. Must include rowId and cell information
        rowIdx - The row index of the cell (base 1 indexed)
        colIdx - The column index of the cell (base 1 indexed)
        newValue - The new value of the cell
        Returns:
        The returned Row object from the api
        Throws:
        SmartsheetException - the smartsheet exception
      • updateRowsAllowPartialSuccess

        PartialRowUpdateResult updateRowsAllowPartialSuccess​(long sheetId,
                                                             java.util.List<Row> rows)
                                                      throws SmartsheetException

        Update rows, but allow partial success. The PartialRowUpdateResult will contain the successful rows and those that failed, with specific messages for each.

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

        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) 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 id of the sheet
        rows - the list of rows
        Returns:
        a list of rows
        Throws:
        SmartsheetException - the smartsheet exception
      • updateRowsAllowPartialSuccess

        PartialRowUpdateResult updateRowsAllowPartialSuccess​(long sheetId,
                                                             java.util.List<Row> rows,
                                                             java.util.EnumSet<RowInclusion> includes,
                                                             java.util.EnumSet<ObjectExclusion> excludes)
                                                      throws SmartsheetException

        Update rows, but allow partial success. The PartialRowUpdateResult will contain the successful rows and those that failed, with specific messages for each.

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

        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) 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 id of the sheet
        rows - the list of rows
        includes - optional objects to include
        excludes - optional objects to exclude
        Returns:
        a list of rows
        Throws:
        SmartsheetException - the smartsheet exception
      • moveRows

        CopyOrMoveRowResult moveRows​(java.lang.Long sheetId,
                                     java.util.EnumSet<RowMoveInclusion> includes,
                                     java.lang.Boolean ignoreRowsNotFound,
                                     CopyOrMoveRowDirective moveParameters)
                              throws SmartsheetException

        Moves Row(s) from the Sheet specified in the URL to (the bottom of) another sheet.

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

        Exceptions: IllegalArgumentException : if any argument is null, or path is 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) 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 to move
        includes - the parameters to include
        ignoreRowsNotFound - optional,specifying row Ids that do not exist within the source sheet
        moveParameters - CopyOrMoveRowDirective object
        Returns:
        the result object
        Throws:
        SmartsheetException - the smartsheet exception
      • copyRows

        CopyOrMoveRowResult copyRows​(java.lang.Long sheetId,
                                     java.util.EnumSet<RowCopyInclusion> includes,
                                     java.lang.Boolean ignoreRowsNotFound,
                                     CopyOrMoveRowDirective copyParameters)
                              throws SmartsheetException

        Copies Row(s) from the Sheet specified in the URL to (the bottom of) another sheet.

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

        Exceptions: IllegalArgumentException : if any argument is null, or path is 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) 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 to move
        includes - the parameters to include
        ignoreRowsNotFound - optional,specifying row Ids that do not exist within the source sheet
        copyParameters - CopyOrMoveRowDirective object
        Returns:
        the result object
        Throws:
        SmartsheetException - the smartsheet exception
      • attachmentResources

        RowAttachmentResources attachmentResources()

        Creates an object of RowAttachmentResources.

        Returns:
        the created RowAttachmentResources object
      • discussionResources

        RowDiscussionResources discussionResources()

        Creates an object of RowDiscussionResources.

        Returns:
        the created RowDiscussionResources object
      • cellResources

        RowColumnResources cellResources()

        Creates an object of RowColumnResources.

        Returns:
        the created RowColumnResources object