Interface ReportResources
-
public interface ReportResourcesThis interface provides methods to access Report resources.
Thread Safety: Implementation of this interface must be thread safe.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.List<ReportColumn>addReportColumns(long reportId, java.util.List<ReportColumn> reportColumns)Add columns to a report.voidaddReportScope(long id, java.util.List<ReportScopeInclusion> scopes)Adds one or more specified sheet or workspace to the report scope.CreateReportResultcreateReport(CreateReportRequest request)Create a new report.voiddeleteReport(long id)Deletes a report.ReportPublishgetPublishStatus(long id)Get the publish status of a report.ReportgetReport(long reportId, java.util.EnumSet<ReportInclusion> includes, java.lang.Integer pageSize, java.lang.Integer page)Get a report.ReportgetReport(long reportId, java.util.EnumSet<ReportInclusion> includes, java.lang.Integer pageSize, java.lang.Integer page, java.lang.Integer level)Get a report.voidgetReportAsCsv(long id, java.io.OutputStream outputStream)Get a Report as an csv file.voidgetReportAsExcel(long id, java.io.OutputStream outputStream)Get a Report as an excel file.PagedResult<Report>listReports(PaginationParameters parameters)List all reports.PagedResult<Report>listReports(PaginationParameters parameters, java.util.Date modifiedSince)List all reports.voidremoveReportScope(long id, java.util.List<ReportScopeInclusion> scopes)Removes one or more specified sheet or workspace from the report scope.voidsendReport(long reportId, SheetEmail email)Send a sheet as a PDF attachment via Email To the designated recipients.ShareResourcesshareResources()Creates an object of ShareResources.ReportPublishupdatePublishStatus(long id, ReportPublish reportPublish)Sets the publish status of a report and returns the new status, including the URLs of any enabled publishing.voidupdateReportDefinition(long id, ReportDefinition reportDefinition)Updates a report's definition (filters, grouping, summarize, and sorting).
-
-
-
Method Detail
-
getReport
Report getReport(long reportId, java.util.EnumSet<ReportInclusion> includes, java.lang.Integer pageSize, java.lang.Integer page) throws SmartsheetException
Get a report.
It mirrors to the following Smartsheet REST API method: GET /report/{reportId}
- Parameters:
reportId- the reportId of the reportincludes- used To specify the optional objects to include.pageSize- page size parameter for paginationpage- page parameter for pagination- Returns:
- the report (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 stringInvalidRequestException- if there is any problem with the REST API requestAuthorizationException- if there is any problem with the REST API authorization (access token)ResourceNotFoundException- if the resource cannot be foundServiceUnavailableException- if the REST API service is not available (possibly due to rate limiting)SmartsheetException- if there is any other error during the operation
-
getReport
Report getReport(long reportId, java.util.EnumSet<ReportInclusion> includes, java.lang.Integer pageSize, java.lang.Integer page, java.lang.Integer level) throws SmartsheetException
Get a report.
It mirrors to the following Smartsheet REST API method: GET /report/{reportId}
- Parameters:
reportId- the reportId of the reportincludes- used To specify the optional objects to include.pageSize- page size parameter for paginationpage- page parameter for paginationlevel- compatibility level- Returns:
- the report (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 stringInvalidRequestException- if there is any problem with the REST API requestAuthorizationException- if there is any problem with the REST API authorization (access token)ResourceNotFoundException- if the resource cannot be foundServiceUnavailableException- if the REST API service is not available (possibly due to rate limiting)SmartsheetException- if there is any other error during the operation
-
sendReport
void sendReport(long reportId, SheetEmail email) throws SmartsheetExceptionSend a sheet as a PDF attachment via Email To the designated recipients.
It mirrors to the following Smartsheet REST API method: POST /reports/{reportId}/emails
- Parameters:
reportId- the reportId of the reportemail- email of designated recipient.- Throws:
java.lang.IllegalArgumentException- if any argument is null or empty stringInvalidRequestException- if there is any problem with the REST API requestAuthorizationException- if there is any problem with the REST API authorization (access token)ResourceNotFoundException- if the resource cannot be foundServiceUnavailableException- if the REST API service is not available (possibly due to rate limiting)SmartsheetException- if there is any other error during the operation
-
listReports
PagedResult<Report> listReports(PaginationParameters parameters, java.util.Date modifiedSince) throws SmartsheetException
List all reports.
It mirrors to the following Smartsheet REST API method: GET /reports
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) - 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:
parameters- pagination parameters for paging resultmodifiedSince- restrict results to sheets modified on or after this date- Returns:
- all sheets (note that empty list will be returned if there is none)
- Throws:
SmartsheetException- the smartsheet exception
-
listReports
PagedResult<Report> listReports(PaginationParameters parameters) throws SmartsheetException
List all reports.
It mirrors to the following Smartsheet REST API method: GET /reports
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) - 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:
parameters- pagination parameters for paging result- Returns:
- all sheets (note that empty list will be returned if there is none)
- Throws:
SmartsheetException- the smartsheet exception
-
getReportAsExcel
void getReportAsExcel(long id, java.io.OutputStream outputStream) throws SmartsheetExceptionGet a Report as an excel file.
It mirrors to the following Smartsheet REST API method: GET /reports/{id} with "application/vnd.ms-excel" Accept HTTP header
Exceptions: IllegalArgumentException : if outputStream 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:
id- the idoutputStream- the OutputStream to which the Excel file will be written- Throws:
SmartsheetException- the smartsheet exception
-
getReportAsCsv
void getReportAsCsv(long id, java.io.OutputStream outputStream) throws SmartsheetExceptionGet a Report as an csv file.
It mirrors to the following Smartsheet REST API method: GET /reports/{id} with "application/vnd.ms-excel" Accept HTTP header
Exceptions: IllegalArgumentException : if outputStream 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:
id- the idoutputStream- the OutputStream to which the Excel file will be written- Throws:
SmartsheetException- the smartsheet exception
-
getPublishStatus
ReportPublish getPublishStatus(long id) throws SmartsheetException
Get the publish status of a report.
It mirrors to the following Smartsheet REST API method: GET /reports/{id}/publish
- Parameters:
id- the ID of the report- Returns:
- the report publish status (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 stringInvalidRequestException- if there is any problem with the REST API requestAuthorizationException- if there is any problem with the REST API authorization (access token)ResourceNotFoundException- if the resource cannot be foundServiceUnavailableException- if the REST API service is not available (possibly due to rate limiting)SmartsheetException- if there is any other error during the operation
-
updatePublishStatus
ReportPublish updatePublishStatus(long id, ReportPublish reportPublish) throws SmartsheetException
Sets the publish status of a report and returns the new status, including the URLs of any enabled publishing.
It mirrors to the following Smartsheet REST API method: PUT /reports/{id}/publish
- Parameters:
id- the ID of the reportreportPublish- the ReportPublish object- Returns:
- the updated ReportPublish (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 stringInvalidRequestException- if there is any problem with the REST API requestAuthorizationException- if there is any problem with the REST API authorization (access token)ResourceNotFoundException- if the resource cannot be foundServiceUnavailableException- if the REST API service is not available (possibly due to rate limiting)SmartsheetException- if there is any other error during the operation
-
updateReportDefinition
void updateReportDefinition(long id, ReportDefinition reportDefinition) throws SmartsheetExceptionUpdates a report's definition (filters, grouping, summarize, and sorting).
It mirrors to the following Smartsheet REST API method: PUT /reports/{id}/definition
This endpoint supports partial updates only on root level properties of the report definition, such as
filters,groupingCriteria, andsummarizingCriteria. For example, you can update the report's filters without affecting its grouping criteria. However, nested properties within these objects, such as a specific filter or grouping criterion, cannot be updated individually and require a full replacement of the respective section.- Parameters:
id- the ID of the reportreportDefinition- the ReportDefinition object containing the updated definition- Throws:
java.lang.IllegalArgumentException- if any argument is nullInvalidRequestException- if there is any problem with the REST API requestAuthorizationException- if there is any problem with the REST API authorization (access token)ResourceNotFoundException- if the resource cannot be foundServiceUnavailableException- if the REST API service is not available (possibly due to rate limiting)SmartsheetException- if there is any other error during the operation
-
shareResources
ShareResources shareResources()
Creates an object of ShareResources.
- Returns:
- the created ShareResources object
-
deleteReport
void deleteReport(long id) throws SmartsheetExceptionDeletes a report.
Mirrors the following Smartsheet REST API method: DELETE /reports/{reportId}
- Parameters:
id- the id of the report- Throws:
java.lang.IllegalArgumentException- if any argument is null or empty stringInvalidRequestException- if there is any problem with the REST API requestAuthorizationException- if there is any problem with the REST API authorization (access token)ResourceNotFoundException- if the resource cannot be foundServiceUnavailableException- if the REST API service is not available (possibly due to rate limiting)SmartsheetException- if there is any other error during the operation
-
addReportScope
void addReportScope(long id, java.util.List<ReportScopeInclusion> scopes) throws SmartsheetExceptionAdds one or more specified sheet or workspace to the report scope.
- Parameters:
id- the ID of the reportscopes- A list of one or more objects denoting the sheets or workspaces associated with the report to be added to the report scope.- Throws:
java.lang.IllegalArgumentException- if any argument is null or empty stringInvalidRequestException- if there is any problem with the REST API requestAuthorizationException- if there is any problem with the REST API authorization (access token)ResourceNotFoundException- if the resource cannot be foundServiceUnavailableException- if the REST API service is not available (possibly due to rate limiting)SmartsheetException- if there is any other error during the operation
-
removeReportScope
void removeReportScope(long id, java.util.List<ReportScopeInclusion> scopes) throws SmartsheetExceptionRemoves one or more specified sheet or workspace from the report scope.
- Parameters:
id- the ID of the reportscopes- A list of one or more objects denoting the sheets or workspaces associated with the report to be removed from the report scope.- Throws:
java.lang.IllegalArgumentException- if any argument is null or empty stringInvalidRequestException- if there is any problem with the REST API requestAuthorizationException- if there is any problem with the REST API authorization (access token)ResourceNotFoundException- if the resource cannot be foundServiceUnavailableException- if the REST API service is not available (possibly due to rate limiting)SmartsheetException- if there is any other error during the operation
-
addReportColumns
java.util.List<ReportColumn> addReportColumns(long reportId, java.util.List<ReportColumn> reportColumns) throws SmartsheetException
Add columns to a report.
It mirrors to the following Smartsheet REST API method: POST /reports/{reportId}/columns
Note: All indexes of the columns must be equal.
- Parameters:
reportId- the ID of the reportreportColumns- the list of columns to add (must contain 1-400 items)- Returns:
- the list of columns that were added
- Throws:
java.lang.IllegalArgumentException- if any argument is null or empty stringInvalidRequestException- if there is any problem with the REST API requestAuthorizationException- if there is any problem with the REST API authorization (access token)ResourceNotFoundException- if the resource cannot be foundServiceUnavailableException- if the REST API service is not available (possibly due to rate limiting)SmartsheetException- if there is any other error during the operation
-
createReport
CreateReportResult createReport(CreateReportRequest request) throws SmartsheetException
Create a new report.
It mirrors to the following Smartsheet REST API method: POST /reports
Creates a new report by specifying name, destination, scope, columns and definition.
- Parameters:
request- the CreateReportRequest containing report specifications- Returns:
- the CreateReportResult containing the newly created report information
- Throws:
java.lang.IllegalArgumentException- if any argument is nullInvalidRequestException- if there is any problem with the REST API requestAuthorizationException- 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)SmartsheetException- if there is any other error during the operation
-
-