Interface ReportResources
-
public interface ReportResources
This 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 ReportPublish
getPublishStatus(long id)
Get the publish status of a report.Report
getReport(long reportId, java.util.EnumSet<ReportInclusion> includes, java.lang.Integer pageSize, java.lang.Integer page)
Get a report.Report
getReport(long reportId, java.util.EnumSet<ReportInclusion> includes, java.lang.Integer pageSize, java.lang.Integer page, java.lang.Integer level)
Get a report.void
getReportAsCsv(long id, java.io.OutputStream outputStream)
Get a Report as an csv file.void
getReportAsExcel(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.void
sendReport(long reportId, SheetEmail email)
Send a sheet as a PDF attachment via Email To the designated recipients.ShareResources
shareResources()
Creates an object of ShareResources.ReportPublish
updatePublishStatus(long id, ReportPublish reportPublish)
Sets the publish status of a report and returns the new status, including the URLs of any enabled publishing.
-
-
-
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 SmartsheetException
Send 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 SmartsheetException
Get 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 SmartsheetException
Get 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
-
shareResources
ShareResources shareResources()
Creates an object of ShareResources.
- Returns:
- the created ShareResources object
-
-