
com.smartsheet.api.SheetSummaryResources Maven / Gradle / Ivy
Show all versions of smartsheet-sdk-java Show documentation
/*
* Copyright (C) 2024 Smartsheet
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.smartsheet.api;
import com.smartsheet.api.models.BulkItemResult;
import com.smartsheet.api.models.PagedResult;
import com.smartsheet.api.models.PaginationParameters;
import com.smartsheet.api.models.Result;
import com.smartsheet.api.models.SheetSummary;
import com.smartsheet.api.models.SummaryField;
import com.smartsheet.api.models.enums.SummaryFieldExclusion;
import com.smartsheet.api.models.enums.SummaryFieldInclusion;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.util.EnumSet;
import java.util.List;
import java.util.Set;
public interface SheetSummaryResources {
/**
* Gets the sheet summary
*
* It mirrors to the following Smartsheet REST API method: GET /sheets/{id}/summary
*
* @param sheetId the sheet id
* @param includes optional objects to include
* @param excludes optional objects to exclude
* @return the sheet summary
* @throws IllegalArgumentException if any argument is null or empty string
* @throws InvalidRequestException if there is any problem with the REST API request
* @throws AuthorizationException if there is any problem with the REST API authorization (access token)
* @throws ResourceNotFoundException if the resource cannot be found
* @throws ServiceUnavailableException if the REST API service is not available (possibly due to rate limiting)
* @throws SmartsheetException if there is any other error during the operation
*/
SheetSummary getSheetSummary(long sheetId, EnumSet includes,
EnumSet excludes) throws SmartsheetException;
/**
* Gets the sheet summary fields
*
* It mirrors to the following Smartsheet REST API method: GET /sheets/{id}/summary/fields
*
* @param sheetId the sheet id
* @param includes optional objects to include
* @param excludes optional objects to exclude
* @param pagination pagination parameters for the response
* @return the list of sheet summary fields
* @throws IllegalArgumentException if any argument is null or empty string
* @throws InvalidRequestException if there is any problem with the REST API request
* @throws AuthorizationException if there is any problem with the REST API authorization (access token)
* @throws ResourceNotFoundException if the resource cannot be found
* @throws ServiceUnavailableException if the REST API service is not available (possibly due to rate limiting)
* @throws SmartsheetException if there is any other error during the operation
*/
PagedResult getSheetSummaryFields(long sheetId, EnumSet includes,
EnumSet excludes,
PaginationParameters pagination) throws SmartsheetException;
/**
* Insert fields into a sheet summary.
*
* It mirrors to the following Smartsheet REST API method: POST /sheets/{sheetId}/summary/fields
*
* @param sheetId the sheet id
* @param fields list of fields to be added
* @param renameIfConflict true if the call should rename conflicting field titles
* @return the created fields
* @throws IllegalArgumentException if any argument is null or empty string
* @throws InvalidRequestException if there is any problem with the REST API request
* @throws AuthorizationException if there is any problem with the REST API authorization (access token)
* @throws ResourceNotFoundException if the resource cannot be found
* @throws ServiceUnavailableException if the REST API service is not available (possibly due to rate limiting)
* @throws SmartsheetException if there is any other error during the operation
*/
List addSheetSummaryFields(long sheetId, List fields, Boolean renameIfConflict) throws SmartsheetException;
/**
* Insert fields into a sheet summary.
*
* It mirrors to the following Smartsheet REST API method: POST /sheets/{sheetId}/summary/fields
*
* @param sheetId the sheet id
* @param fields list of fields to be added
* @param renameIfConflict true if the call should rename conflicting field titles
* @return a bulk item result containing the created fields
* @throws IllegalArgumentException if any argument is null or empty string
* @throws InvalidRequestException if there is any problem with the REST API request
* @throws AuthorizationException if there is any problem with the REST API authorization (access token)
* @throws ResourceNotFoundException if the resource cannot be found
* @throws ServiceUnavailableException if the REST API service is not available (possibly due to rate limiting)
* @throws SmartsheetException if there is any other error during the operation
*/
BulkItemResult addSheetSummaryFieldsWithPartialSuccess(long sheetId, List fields,
Boolean renameIfConflict) throws SmartsheetException;
/**
* Update fields in a sheet summary.
*
* It mirrors to the following Smartsheet REST API method: PUT /sheets/{sheetId}/summary/fields
*
* @param sheetId the sheet id
* @param fields list of summary fields to be updated
* @param renameIfConflict true if the call should rename conflicting field titles
* @return the updated fields
* @throws IllegalArgumentException if any argument is null or empty string
* @throws InvalidRequestException if there is any problem with the REST API request
* @throws AuthorizationException if there is any problem with the REST API authorization (access token)
* @throws ResourceNotFoundException if the resource cannot be found
* @throws ServiceUnavailableException if the REST API service is not available (possibly due to rate limiting)
* @throws SmartsheetException if there is any other error during the operation
*/
List updateSheetSummaryFields(
long sheetId,
List fields,
Boolean renameIfConflict
) throws SmartsheetException;
/**
* Update fields in a sheet summary.
*
* It mirrors to the following Smartsheet REST API method: PUT /sheets/{sheetId}/summary/fields
*
* @param sheetId the sheet id
* @param fields list of summary fields to be updated
* @param renameIfConflict true if the call should rename conflicting field titles
* @return a bulk item result containing the updated fields
* @throws IllegalArgumentException if any argument is null or empty string
* @throws InvalidRequestException if there is any problem with the REST API request
* @throws AuthorizationException if there is any problem with the REST API authorization (access token)
* @throws ResourceNotFoundException if the resource cannot be found
* @throws ServiceUnavailableException if the REST API service is not available (possibly due to rate limiting)
* @throws SmartsheetException if there is any other error during the operation
*/
BulkItemResult updateSheetSummaryFieldsWithPartialSuccess(long sheetId, List fields,
Boolean renameIfConflict) throws SmartsheetException;
/**
* Delete fields in a sheet summary.
*
* It mirrors to the following Smartsheet REST API method: DELETE /sheets/{sheetId}/summary/fields
*
* @param sheetId the sheet id
* @param fieldIds List of field Ids
* @param ignoreSummaryFieldsNotFound true if the call should ignore fields not found
* @return List of field Ids deleted
* @throws IllegalArgumentException if any argument is null or empty string
* @throws InvalidRequestException if there is any problem with the REST API request
* @throws AuthorizationException if there is any problem with the REST API authorization (access token)
* @throws ResourceNotFoundException if the resource cannot be found
* @throws ServiceUnavailableException if the REST API service is not available (possibly due to rate limiting)
* @throws SmartsheetException if there is any other error during the operation
*/
List deleteSheetSummaryFields(long sheetId, Set fieldIds, Boolean ignoreSummaryFieldsNotFound) throws SmartsheetException;
/**
* Adds an image to the sheet summary field.
*
* It mirrors to the following Smartsheet REST API method: POST /sheets/{sheetId}/summary/fields/{fieldId}/images
*
* @param sheetId the sheet id
* @param fieldId the summary field id
* @param file path to image file to upload
* @param contentType content-type of the file being uploaded
* @param altText alternate text for the image
* @return Result
* @throws IllegalArgumentException if any argument is null or empty string
* @throws InvalidRequestException if there is any problem with the REST API request
* @throws AuthorizationException if there is any problem with the REST API authorization (access token)
* @throws ResourceNotFoundException if the resource cannot be found
* @throws ServiceUnavailableException if the REST API service is not available (possibly due to rate limiting)
* @throws SmartsheetException if there is any other error during the operation
*/
Result addSheetSummaryFieldImage(long sheetId, long fieldId, String file, String contentType, String altText)
throws SmartsheetException, FileNotFoundException;
/**
* Adds an image to the sheet summary field.
*
* It mirrors to the following Smartsheet REST API method: POST /sheets/{sheetId}/summary/fields/{fieldId}/images
*
* @param sheetId the sheet id
* @param fieldId the summary field id
* @param file File to upload
* @param contentType content-type of the file being uploaded
* @param altText alternate text for the image
* @return Result
* @throws IllegalArgumentException if any argument is null or empty string
* @throws InvalidRequestException if there is any problem with the REST API request
* @throws AuthorizationException if there is any problem with the REST API authorization (access token)
* @throws ResourceNotFoundException if the resource cannot be found
* @throws ServiceUnavailableException if the REST API service is not available (possibly due to rate limiting)
* @throws SmartsheetException if there is any other error during the operation
*/
Result addSheetSummaryFieldImage(
long sheetId,
long fieldId,
File file,
String contentType,
String altText
) throws SmartsheetException, FileNotFoundException;
/**
* Adds an image to the sheet summary field.
*
* It mirrors to the following Smartsheet REST API method: POST /sheets/{sheetId}/summary/fields/{fieldId}/images
*
* @param sheetId the sheet id
* @param fieldId the summary field id
* @param inputStream File to upload
* @param contentType content-type of the file being uploaded
* @param contentLength content length
* @param altText alternate text for the image
* @return Result
* @throws IllegalArgumentException if any argument is null or empty string
* @throws InvalidRequestException if there is any problem with the REST API request
* @throws AuthorizationException if there is any problem with the REST API authorization (access token)
* @throws ResourceNotFoundException if the resource cannot be found
* @throws ServiceUnavailableException if the REST API service is not available (possibly due to rate limiting)
* @throws SmartsheetException if there is any other error during the operation
*/
Result addSheetSummaryFieldImage(
long sheetId,
long fieldId,
InputStream inputStream,
String contentType,
long contentLength,
String altText
) throws SmartsheetException, FileNotFoundException;
}