All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.smartsheet.api.FolderResources Maven / Gradle / Ivy

There is a newer version: 3.2.3
Show newest version
/*
 * 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.ContainerDestination;
import com.smartsheet.api.models.Folder;
import com.smartsheet.api.models.PagedResult;
import com.smartsheet.api.models.PaginationParameters;
import com.smartsheet.api.models.enums.CopyExclusion;
import com.smartsheet.api.models.enums.FolderCopyInclusion;
import com.smartsheet.api.models.enums.FolderRemapExclusion;
import com.smartsheet.api.models.enums.SourceInclusion;

import java.util.EnumSet;

/**
 * 

This interface provides methods to access Folder resources.

* *

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

*/ public interface FolderResources { /** *

Get a folder.

* *

It mirrors to the following Smartsheet REST API method: GET /folder/{id}

* * @param folderId the folder id * @param includes the include parameters * @return the folder (note that if there is no such resource, this method will throw ResourceNotFoundException * rather than returning null) * @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 */ Folder getFolder(long folderId, EnumSet includes) throws SmartsheetException; /** *

Update a folder.

* * @param folder the folder to update * @return the updated folder (note that if there is no such folder, this method will throw Resource Not Found * Exception rather than returning null). * @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 */ Folder updateFolder(Folder folder) throws SmartsheetException; /** *

Delete a folder.

* *

It mirrors to the following Smartsheet REST API method: DELETE /folder{id}

* * @param folderId the folder id * @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 */ void deleteFolder(long folderId) throws SmartsheetException; /** *

List child folders of a given folder.

* *

It mirrors to the following Smartsheet REST API method: GET /folder/{id}/folders

* * @param parentFolderId the parent folder id * @param parameters the parameters for pagination * @return the child folders (note that an empty list will be returned if no child folder is found). * @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 listFolders(long parentFolderId, PaginationParameters parameters) throws SmartsheetException; /** *

Create a folder.

* *

It mirrors to the following Smartsheet REST API method: POST /folder/{id}/folders

* * @param parentFolderId the parent folder id * @param folder the folder to create * @return the created folder * @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 */ Folder createFolder(long parentFolderId, Folder folder) throws SmartsheetException; /** *

Creates a copy of the specified Folder.

* *

It mirrors to the following Smartsheet REST API method: POST /folders/{folderId}/copy

*

* Exceptions: * IllegalArgumentException : if folder 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 * * @param folderId the folder id * @param containerDestination describes the destination container * @param includes optional parameters to include * @param skipRemap optional parameters to exclude * @return the folder * @throws SmartsheetException the smartsheet exception */ Folder copyFolder( long folderId, ContainerDestination containerDestination, EnumSet includes, EnumSet skipRemap ) throws SmartsheetException; /** *

Creates a copy of the specified Folder.

* *

It mirrors to the following Smartsheet REST API method: POST /folders/{folderId}/copy

*

* Exceptions: * IllegalArgumentException : if folder 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 * * @param folderId the folder id * @param containerDestination describes the destination container * @param includes optional parameters to include * @param skipRemap optional parameters to NOT re-map in the new folder * @param excludes optional parameters to exclude * @return the folder * @throws SmartsheetException the smartsheet exception */ Folder copyFolder( long folderId, ContainerDestination containerDestination, EnumSet includes, EnumSet skipRemap, EnumSet excludes ) throws SmartsheetException; /** *

Moves the specified Folder to another location.

* *

It mirrors to the following Smartsheet REST API method: POST /folders/{folderId}/move

*

* Exceptions: * IllegalArgumentException : if folder 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 * * @param folderId the folder id * @param containerDestination describes the destination container * @return the folder * @throws SmartsheetException the smartsheet exception */ Folder moveFolder(long folderId, ContainerDestination containerDestination) throws SmartsheetException; }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy