diff --git a/src/main/java/com/smartsheet/api/AssociatedAttachmentResources.java b/src/main/java/com/smartsheet/api/AssociatedAttachmentResources.java deleted file mode 100644 index d383ec00..00000000 --- a/src/main/java/com/smartsheet/api/AssociatedAttachmentResources.java +++ /dev/null @@ -1,68 +0,0 @@ -/* -* 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.Attachment; - -import java.io.File; -import java.io.InputStream; -import java.util.List; - -/** - * @deprecated As of release 2.0. Please use the corresponding method in the [Row/Sheet/etc]AttachmentResources classes - */ -@Deprecated(since = "2.0.0", forRemoval = true) -public interface AssociatedAttachmentResources { - /** - * @param objectId the ID of the object to which the attachments are associated - * @return the attachments (note that empty list will be returned if there is none) - * @deprecated As of release 2.0. Please use the corresponding method in the [Row/Sheet/etc]AttachmentResources classes - */ - @Deprecated(since = "2.0.0", forRemoval = true) - List listAttachments(long objectId); - - /** - * @param objectId the id of the object - * @param file the file to attach - * @param contentType the content type of the file - * @return the created attachment - * @deprecated As of release 2.0. Please use the corresponding method in the [Row/Sheet/etc]AttachmentResources classes - */ - @Deprecated(since = "2.0.0", forRemoval = true) - Attachment attachFile(long objectId, File file, String contentType); - - /** - * @param objectId the id of the object - * @param inputStream the file to attach - * @param contentType the content type of the file - * @param contentLength the size of the file in bytes. - * @param attachmentName the name of the file. - * @return the created attachment - * @deprecated As of release 2.0. Please use the corresponding method in the [Row/Sheet/etc]AttachmentResources classes - */ - @Deprecated(since = "2.0.0", forRemoval = true) - Attachment attachFile(long objectId, InputStream inputStream, String contentType, long contentLength, String attachmentName); - - /** - * @param objectId the object id - * @param attachment the attachment object - * @return the created attachment - * @deprecated As of release 2.0. Please use the corresponding method in the [Row/Sheet/etc]AttachmentResources classes - */ - @Deprecated(since = "2.0.0", forRemoval = true) - Attachment attachURL(long objectId, Attachment attachment); -} diff --git a/src/main/java/com/smartsheet/api/AssociatedDiscussionResources.java b/src/main/java/com/smartsheet/api/AssociatedDiscussionResources.java deleted file mode 100644 index 3e313ab2..00000000 --- a/src/main/java/com/smartsheet/api/AssociatedDiscussionResources.java +++ /dev/null @@ -1,35 +0,0 @@ -/* -* 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.Discussion; - -/** - * @deprecated As of release 2.0. Please use {@link RowDiscussionResources} or {@link SheetDiscussionResources} - */ -@Deprecated(since = "2.0.0", forRemoval = true) -public interface AssociatedDiscussionResources { - /** - * @param objectId the object id (sheet id or row id) - * @param discussion the discussion object - * @return the created discussion - * @throws SmartsheetException if there is any other error during the operation - * @deprecated As of release 2.0. Please use {@link RowDiscussionResources} or {@link SheetDiscussionResources} - */ - @Deprecated(since = "2.0.0", forRemoval = true) - Discussion createDiscussion(long objectId, Discussion discussion) throws SmartsheetException; -} diff --git a/src/main/java/com/smartsheet/api/AttachmentResources.java b/src/main/java/com/smartsheet/api/AttachmentResources.java deleted file mode 100644 index e433d36a..00000000 --- a/src/main/java/com/smartsheet/api/AttachmentResources.java +++ /dev/null @@ -1,55 +0,0 @@ -/* -* 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.Attachment; - -import java.io.File; -import java.io.InputStream; - -/** - *

This interface provides methods to access Attachment resources by their id.

- * - *

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

- * @deprecated As of release 2.0. Please use {@link AttachmentVersioningResources} instead - */ -@Deprecated(since = "2.0.0", forRemoval = true) -public interface AttachmentResources { - - /** - * @param attachmentId the id - * @param file the file - * @param contentType the content type - * @return the attachment (note that if there is no such resource, this method will throw ResourceNotFoundException - * rather than returning null). - * @deprecated As of release 2.0. Please use {@link AttachmentVersioningResources} instead - */ - @Deprecated(since = "2.0.0", forRemoval = true) - Attachment attachNewVersion(long attachmentId, File file, String contentType); - - /** - * @param attachmentId the id of the attachment to upload a new version. - * @param inputStream the file to attach - * @param contentType the content type of the file - * @param attachmentName attachment name - * @param contentLength content length - * @return the created attachment - * @deprecated As of release 2.0. Please use {@link AttachmentVersioningResources} instead - */ - @Deprecated(since = "2.0.0", forRemoval = true) - Attachment attachNewVersion(long attachmentId, InputStream inputStream, String contentType, long contentLength, String attachmentName); -} diff --git a/src/main/java/com/smartsheet/api/ColumnResources.java b/src/main/java/com/smartsheet/api/ColumnResources.java deleted file mode 100644 index 05fcdddf..00000000 --- a/src/main/java/com/smartsheet/api/ColumnResources.java +++ /dev/null @@ -1,46 +0,0 @@ -/* -* 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.Column; - -/** - *

This interface provides methods to access Column resources.

- * - *

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

- * @deprecated As of release 2.0. Please use {@link SheetCommentResources} instead - */ -@Deprecated(since = "2.0.0", forRemoval = true) -public interface ColumnResources { - - /** - * @param column the column to update - * @return the updated Column (note that if there is no such resource, this method will throw - * ResourceNotFoundException rather than returning null). - * @deprecated As of release 2.0. Please use {@link SheetCommentResources} instead - */ - @Deprecated(since = "2.0.0", forRemoval = true) - Column updateColumn(Column column); - - /** - * @param id id of the column - * @param sheetId the sheet id - * @deprecated As of release 2.0. Please use {@link SheetCommentResources} instead - */ - @Deprecated(since = "2.0.0", forRemoval = true) - void deleteColumn(long id, long sheetId); -} diff --git a/src/main/java/com/smartsheet/api/CommentResources.java b/src/main/java/com/smartsheet/api/CommentResources.java deleted file mode 100644 index 6b87f690..00000000 --- a/src/main/java/com/smartsheet/api/CommentResources.java +++ /dev/null @@ -1,50 +0,0 @@ -/* -* 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.Comment; - -/** - * @deprecated As of release 2.0. Please use {@link SheetCommentResources} instead - */ -@Deprecated(since = "2.0.0", forRemoval = true) -public interface CommentResources { - /** - * @param sheetId the id - * @param commentId the commentid - * @return the comment (note that if there is no such resource, this method will throw ResourceNotFoundException - * rather than returning null). - * @deprecated As of release 2.0. Please use {@link SheetCommentResources} instead - */ - @Deprecated(since = "2.0.0", forRemoval = true) - Comment getComment(long sheetId, long commentId); - - /** - * @param sheetId the id - * @param commentId the commentid - * @deprecated As of release 2.0. Please use {@link SheetCommentResources} instead - */ - @Deprecated(since = "2.0.0", forRemoval = true) - void deleteComment(long sheetId, long commentId); - - /** - * @return associated resources - * @deprecated As of release 2.0. Please use {@link SheetCommentResources} instead - */ - @Deprecated(since = "2.0.0", forRemoval = true) - AssociatedAttachmentResources attachments(); -} diff --git a/src/main/java/com/smartsheet/api/DiscussionResources.java b/src/main/java/com/smartsheet/api/DiscussionResources.java index 99addaa8..29e8c29c 100644 --- a/src/main/java/com/smartsheet/api/DiscussionResources.java +++ b/src/main/java/com/smartsheet/api/DiscussionResources.java @@ -42,13 +42,6 @@ public interface DiscussionResources { */ Comment addDiscussionComment(long id, Comment comment) throws SmartsheetException; - /** - * @return associated resources - * @deprecated As of release 2.0. Please use the corresponding method in the [Row/Sheet/etc]AttachmentResources classes - */ - @Deprecated(since = "2.0.0", forRemoval = true) - AssociatedAttachmentResources attachments(); - /** *

Represents the DiscussionCommentResources.

*

It will be initialized in constructor and will not change afterwards.

diff --git a/src/main/java/com/smartsheet/api/ShareResources.java b/src/main/java/com/smartsheet/api/ShareResources.java index 6ce290b1..a7b37c8a 100644 --- a/src/main/java/com/smartsheet/api/ShareResources.java +++ b/src/main/java/com/smartsheet/api/ShareResources.java @@ -29,27 +29,6 @@ */ public interface ShareResources { - /** - *

List shares of a given object.

- * - *

It mirrors to the following Smartsheet REST API method:

- *

GET /workspace/{id}/shares

- *

GET /sheet/{id}/shares

- * - * @param objectId the object id - * @param parameters the pagination parameters - * @return the list of Share objects (note that an empty list will be returned if there is none). - * @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 - * @deprecated As of release 2.0. Please use the other listShares method in this class and pass `includeWorkspaceShares` as `false` - */ - @Deprecated(since = "2.0.0", forRemoval = true) - PagedResult listShares(long objectId, PaginationParameters parameters) throws SmartsheetException; - /** *

List shares of a given object.

* diff --git a/src/main/java/com/smartsheet/api/SheetResources.java b/src/main/java/com/smartsheet/api/SheetResources.java index e54a4fd7..4f8c7ecc 100644 --- a/src/main/java/com/smartsheet/api/SheetResources.java +++ b/src/main/java/com/smartsheet/api/SheetResources.java @@ -17,14 +17,12 @@ package com.smartsheet.api; import com.smartsheet.api.models.ContainerDestination; -import com.smartsheet.api.models.MultiRowEmail; import com.smartsheet.api.models.PagedResult; import com.smartsheet.api.models.PaginationParameters; import com.smartsheet.api.models.Sheet; import com.smartsheet.api.models.SheetEmail; import com.smartsheet.api.models.SheetPublish; import com.smartsheet.api.models.SortSpecifier; -import com.smartsheet.api.models.UpdateRequest; import com.smartsheet.api.models.enums.CopyExclusion; import com.smartsheet.api.models.enums.ObjectExclusion; import com.smartsheet.api.models.enums.PaperSize; @@ -84,24 +82,6 @@ PagedResult listSheets( */ PagedResult listSheets(EnumSet includes, PaginationParameters pagination) throws SmartsheetException; - /** - *

List all sheets in the organization.

- * - *

It mirrors to the following Smartsheet REST API method: GET /users/sheets

- * - * @param parameters the object containing the pagination parameters - * @return the list of all sheets (note that an empty list will be returned if there are none) - * @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 - * @deprecated As of release 2.0. Please use {@link UserResources} instead - */ - @Deprecated(since = "2.0.0", forRemoval = true) - PagedResult listOrganizationSheets(PaginationParameters parameters) throws SmartsheetException; - /** *

Get a sheet.

* @@ -671,28 +651,6 @@ Sheet copySheet(long sheetId, ContainerDestination containerDestination, EnumSet */ Sheet moveSheet(long sheetId, ContainerDestination containerDestination) throws SmartsheetException; - /** - *

Creates an Update Request for the specified Row(s) within the Sheet.

- * - *

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

- * - * 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 - * - * @param sheetId the sheet id - * @param email the email - * @return the update request object - * @throws SmartsheetException the smartsheet exception - * @deprecated As of release 2.0. Please use {@link SheetUpdateRequestResources} instead. - */ - @Deprecated(since = "2.0.0", forRemoval = true) - UpdateRequest createUpdateRequest(long sheetId, MultiRowEmail email) throws SmartsheetException; - /** *

Sort a sheet according to the sort criteria.

* diff --git a/src/main/java/com/smartsheet/api/SheetRowResources.java b/src/main/java/com/smartsheet/api/SheetRowResources.java index 1a82691a..f0a88b8f 100644 --- a/src/main/java/com/smartsheet/api/SheetRowResources.java +++ b/src/main/java/com/smartsheet/api/SheetRowResources.java @@ -21,7 +21,6 @@ import com.smartsheet.api.models.MultiRowEmail; import com.smartsheet.api.models.PartialRowUpdateResult; import com.smartsheet.api.models.Row; -import com.smartsheet.api.models.RowEmail; import com.smartsheet.api.models.enums.ObjectExclusion; import com.smartsheet.api.models.enums.RowCopyInclusion; import com.smartsheet.api.models.enums.RowInclusion; @@ -140,49 +139,6 @@ PartialRowUpdateResult addRowsAllowPartialSuccess( */ Row getRow(long sheetId, long rowId, EnumSet includes, EnumSet excludes) throws SmartsheetException; - /** - *

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 - * - * @param sheetId the sheet id - * @param rowId the row id - * @throws SmartsheetException the smartsheet exception - * @deprecated as of API 2.0.2 release, replaced by {@link #deleteRows(long, Set, boolean)} - */ - @Deprecated(since = "2.0.2", forRemoval = true) - void deleteRow(long sheetId, long rowId) throws SmartsheetException; - - /** - *

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 - * - * @param sheetId the id of the sheet - * @param rowId the id of the row - * @param email the row email - * @throws SmartsheetException the smartsheet exception - * @deprecated as of API V2.0.2, replaced by {@link #sendRows(long, MultiRowEmail)} - */ - @Deprecated(since = "2.0.2", forRemoval = true) - void sendRow(long sheetId, long rowId, RowEmail email) throws SmartsheetException; - /** *

Send a row via email to the designated recipients.

* diff --git a/src/main/java/com/smartsheet/api/WorkspaceResources.java b/src/main/java/com/smartsheet/api/WorkspaceResources.java index d6ac66e7..340fe2b9 100644 --- a/src/main/java/com/smartsheet/api/WorkspaceResources.java +++ b/src/main/java/com/smartsheet/api/WorkspaceResources.java @@ -20,7 +20,6 @@ import com.smartsheet.api.models.PagedResult; import com.smartsheet.api.models.PaginationParameters; import com.smartsheet.api.models.Workspace; -import com.smartsheet.api.models.enums.CopyExclusion; import com.smartsheet.api.models.enums.SourceInclusion; import com.smartsheet.api.models.enums.WorkspaceCopyInclusion; import com.smartsheet.api.models.enums.WorkspaceRemapExclusion; @@ -144,32 +143,6 @@ Workspace copyWorkspace( EnumSet skipRemap ) throws SmartsheetException; - /** - *

Creates a copy of the specified workspace.

- * - *

It mirrors to the following Smartsheet REST API method: POST /workspaces/{workspaceId}/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 workspaceId 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 - * @deprecated As of release 2.0. `excludes` param is deprecated. Please use the `copyWorkspace` method with `includes` instead. - */ - @Deprecated(since = "2.0.0", forRemoval = true) - Workspace copyWorkspace(long workspaceId, ContainerDestination containerDestination, EnumSet includes, - EnumSet skipRemap, EnumSet excludes) throws SmartsheetException; - /** *

Return the WorkspaceFolderResources object that provides access to Folder resources associated with Workspace * resources.

diff --git a/src/main/java/com/smartsheet/api/internal/AbstractResources.java b/src/main/java/com/smartsheet/api/internal/AbstractResources.java index ae23abbe..deda9030 100644 --- a/src/main/java/com/smartsheet/api/internal/AbstractResources.java +++ b/src/main/java/com/smartsheet/api/internal/AbstractResources.java @@ -914,7 +914,7 @@ public void getResourceAsFile(String path, String fileType, OutputStream outputS switch (response.getStatusCode()) { case 200: try { - copyStream(response.getEntity().getContent(), outputStream); + StreamUtil.copyContentIntoOutputStream(response.getEntity().getContent(), outputStream, BUFFER_SIZE, true); } catch (IOException e) { throw new SmartsheetException(e); } @@ -927,32 +927,6 @@ public void getResourceAsFile(String path, String fileType, OutputStream outputS } } - /* - * Copy an input stream to an output stream. - * - * @param input The input stream to copy. - * - * @param output the output stream to write to. - * - * @throws IOException if there is trouble reading or writing to the streams. - */ - /** - * Copy stream. - * - * @param input the input - * @param output the output - * @throws IOException Signals that an I/O exception has occurred. - * @deprecated replace with StreamUtil.copyContentIntoOutputStream() - */ - @Deprecated(since = "2.0.0", forRemoval = true) - private static void copyStream(InputStream input, OutputStream output) throws IOException { - byte[] buffer = new byte[BUFFER_SIZE]; - int len; - while ((len = input.read(buffer)) != -1) { - output.write(buffer, 0, len); - } - } - /** * @return a map of headers to be used when making requests. */ diff --git a/src/main/java/com/smartsheet/api/internal/AssociatedAttachmentResourcesImpl.java b/src/main/java/com/smartsheet/api/internal/AssociatedAttachmentResourcesImpl.java deleted file mode 100644 index 53508d2f..00000000 --- a/src/main/java/com/smartsheet/api/internal/AssociatedAttachmentResourcesImpl.java +++ /dev/null @@ -1,71 +0,0 @@ -/* -* 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.internal; - -import com.smartsheet.api.AssociatedAttachmentResources; -import com.smartsheet.api.models.Attachment; - -import java.io.File; -import java.io.InputStream; -import java.util.List; - -/** - * @deprecated As of release 2.0. Please use the corresponding method in the [Row/Sheet/etc]AttachmentResources classes - */ -@Deprecated(since = "2.0.0", forRemoval = true) -public class AssociatedAttachmentResourcesImpl extends AbstractAssociatedResources implements AssociatedAttachmentResources { - - /** - * @deprecated As of release 2.0. Please use the corresponding method in the [Row/Sheet/etc]AttachmentResources classes - */ - @Deprecated(since = "2.0.0", forRemoval = true) - public AssociatedAttachmentResourcesImpl(SmartsheetImpl smartsheet, String masterResourceType) { - super(smartsheet, masterResourceType); - } - - /** - * @deprecated As of release 2.0. Please use the corresponding method in the [Row/Sheet/etc]AttachmentResources classes - */ - @Deprecated(since = "2.0.0", forRemoval = true) - public List listAttachments(long objectId) { - throw new UnsupportedOperationException(); - } - - /** - * @deprecated As of release 2.0. Please use the corresponding method in the [Row/Sheet/etc]AttachmentResources classes - */ - @Deprecated(since = "2.0.0", forRemoval = true) - public Attachment attachFile(long objectId, File file, String contentType) { - throw new UnsupportedOperationException(); - } - - /** - * @deprecated As of release 2.0. Please use the corresponding method in the [Row/Sheet/etc]AttachmentResources classes - */ - @Deprecated(since = "2.0.0", forRemoval = true) - public Attachment attachFile(long objectId, InputStream inputStream, String contentType, long contentLength, String attachmentName) { - throw new UnsupportedOperationException(); - } - - /** - * @deprecated As of release 2.0. Please use the corresponding method in the [Row/Sheet/etc]AttachmentResources classes - */ - @Deprecated(since = "2.0.0", forRemoval = true) - public Attachment attachURL(long objectId, Attachment attachment) { - throw new UnsupportedOperationException(); - } -} diff --git a/src/main/java/com/smartsheet/api/internal/AssociatedDiscussionResourcesImpl.java b/src/main/java/com/smartsheet/api/internal/AssociatedDiscussionResourcesImpl.java deleted file mode 100644 index 339064d3..00000000 --- a/src/main/java/com/smartsheet/api/internal/AssociatedDiscussionResourcesImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -/* -* 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.internal; - -import com.smartsheet.api.AssociatedDiscussionResources; -import com.smartsheet.api.RowDiscussionResources; -import com.smartsheet.api.SheetDiscussionResources; -import com.smartsheet.api.SmartsheetException; -import com.smartsheet.api.internal.util.Util; -import com.smartsheet.api.models.Discussion; - -/** - * @deprecated As of release 2.0. Please use {@link RowDiscussionResources} or {@link SheetDiscussionResources} - */ -@Deprecated(since = "2.0.0", forRemoval = true) -public class AssociatedDiscussionResourcesImpl extends AbstractAssociatedResources implements AssociatedDiscussionResources { - - /** - * @deprecated As of release 2.0. Please use {@link RowDiscussionResources} or {@link SheetDiscussionResources} - */ - @Deprecated(since = "2.0.0", forRemoval = true) - public AssociatedDiscussionResourcesImpl(SmartsheetImpl smartsheet, String masterResourceType) { - super(smartsheet, masterResourceType); - } - - /** - * @deprecated As of release 2.0. Please use {@link RowDiscussionResources} or {@link SheetDiscussionResources} - */ - @Deprecated(since = "2.0.0", forRemoval = true) - public Discussion createDiscussion(long objectId, Discussion discussion) throws SmartsheetException { - Util.throwIfNull(objectId, discussion); - return this.createResource(getMasterResourceType() + "/" + objectId + "/discussions", - Discussion.class, discussion); - } -} diff --git a/src/main/java/com/smartsheet/api/internal/AttachmentResourcesImpl.java b/src/main/java/com/smartsheet/api/internal/AttachmentResourcesImpl.java deleted file mode 100644 index b1b796ec..00000000 --- a/src/main/java/com/smartsheet/api/internal/AttachmentResourcesImpl.java +++ /dev/null @@ -1,69 +0,0 @@ -/* -* 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.internal; - -import com.smartsheet.api.AttachmentResources; -import com.smartsheet.api.AttachmentVersioningResources; -import com.smartsheet.api.models.Attachment; - -import java.io.File; -import java.io.InputStream; - -/** - * This is the implementation of the AttachmentResources. - *

- * Thread Safety: This class is thread safe because it is immutable and its base class is thread safe. - * @deprecated As of release 2.0. Please use {@link AttachmentVersioningResources} instead - */ -@Deprecated(since = "2.0.0", forRemoval = true) -public class AttachmentResourcesImpl extends AbstractResources implements AttachmentResources { - - /** - * Constructor. - *

- * Exceptions: - IllegalArgumentException : if any argument is null - * - * @param smartsheet the smartsheet - */ - public AttachmentResourcesImpl(SmartsheetImpl smartsheet) { - super(smartsheet); - } - - /** - * @return the attachment - * @deprecated As of release 2.0. Please use {@link AttachmentVersioningResources} instead - */ - @Deprecated(since = "2.0.0", forRemoval = true) - public Attachment attachNewVersion(long attachmentId, File file, String contentType) { - throw new UnsupportedOperationException(); - } - - /** - * @return the attachment - * @deprecated As of release 2.0. Please use {@link AttachmentVersioningResources} instead - */ - @Deprecated(since = "2.0.0", forRemoval = true) - public Attachment attachNewVersion( - long attachmentId, - InputStream inputStream, - String contentType, - long contentLength, - String attachmentName - ) { - throw new UnsupportedOperationException(); - } -} diff --git a/src/main/java/com/smartsheet/api/internal/ColumnResourcesImpl.java b/src/main/java/com/smartsheet/api/internal/ColumnResourcesImpl.java deleted file mode 100644 index bbb849f0..00000000 --- a/src/main/java/com/smartsheet/api/internal/ColumnResourcesImpl.java +++ /dev/null @@ -1,55 +0,0 @@ -/* -* 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.internal; - -import com.smartsheet.api.ColumnResources; -import com.smartsheet.api.SheetCommentResources; -import com.smartsheet.api.models.Column; - -/** - * This is the implementation of the ColumnResources. - *

- * Thread Safety: This class is thread safe because it is immutable and its base class is thread safe. - * @deprecated As of release 2.0. Please use {@link SheetCommentResources} instead - */ -@Deprecated(since = "2.0.0", forRemoval = true) -public class ColumnResourcesImpl implements ColumnResources { - - /** - * @deprecated As of release 2.0. Please use {@link SheetCommentResources} instead - */ - @Deprecated(since = "2.0.0", forRemoval = true) - public ColumnResourcesImpl() { - - } - - /** - * @deprecated As of release 2.0. Please use {@link SheetCommentResources} instead - */ - @Deprecated(since = "2.0.0", forRemoval = true) - public Column updateColumn(Column column) { - throw new UnsupportedOperationException(); - } - - /** - * @deprecated As of release 2.0. Please use {@link SheetCommentResources} instead - */ - @Deprecated(since = "2.0.0", forRemoval = true) - public void deleteColumn(long id, long sheetId) { - throw new UnsupportedOperationException(); - } -} diff --git a/src/main/java/com/smartsheet/api/internal/CommentResourcesImpl.java b/src/main/java/com/smartsheet/api/internal/CommentResourcesImpl.java deleted file mode 100644 index 8bc3eb27..00000000 --- a/src/main/java/com/smartsheet/api/internal/CommentResourcesImpl.java +++ /dev/null @@ -1,62 +0,0 @@ -/* -* 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.internal; - -import com.smartsheet.api.AssociatedAttachmentResources; -import com.smartsheet.api.CommentResources; -import com.smartsheet.api.SheetCommentResources; -import com.smartsheet.api.models.Comment; - -/** - * @deprecated As of release 2.0. Please use {@link SheetCommentResources} instead - */ -@Deprecated(since = "2.0.0", forRemoval = true) -public class CommentResourcesImpl extends AbstractResources implements CommentResources { - private static final String METHOD_MOVED_MESSAGE = "Method moved to SheetCommentResources."; - - /** - * @deprecated As of release 2.0. Please use {@link SheetCommentResources} instead - */ - @Deprecated(since = "2.0.0", forRemoval = true) - public CommentResourcesImpl(SmartsheetImpl smartsheet) { - super(smartsheet); - } - - /** - * @deprecated As of release 2.0. Please use {@link SheetCommentResources} instead - */ - @Deprecated(since = "2.0.0", forRemoval = true) - public AssociatedAttachmentResources attachments() { - throw new UnsupportedOperationException(METHOD_MOVED_MESSAGE); - } - - /** - * @deprecated As of release 2.0. Please use {@link SheetCommentResources} instead - */ - @Deprecated(since = "2.0.0", forRemoval = true) - public Comment getComment(long sheetId, long commentId) { - throw new UnsupportedOperationException(METHOD_MOVED_MESSAGE); - } - - /** - * @deprecated As of release 2.0. Please use {@link SheetCommentResources} instead - */ - @Deprecated(since = "2.0.0", forRemoval = true) - public void deleteComment(long sheetId, long commentId) { - throw new UnsupportedOperationException(METHOD_MOVED_MESSAGE); - } -} diff --git a/src/main/java/com/smartsheet/api/internal/DiscussionResourcesImpl.java b/src/main/java/com/smartsheet/api/internal/DiscussionResourcesImpl.java index f5828ef2..bf1a1ae1 100644 --- a/src/main/java/com/smartsheet/api/internal/DiscussionResourcesImpl.java +++ b/src/main/java/com/smartsheet/api/internal/DiscussionResourcesImpl.java @@ -16,7 +16,6 @@ package com.smartsheet.api.internal; -import com.smartsheet.api.AssociatedAttachmentResources; import com.smartsheet.api.DiscussionCommentResources; import com.smartsheet.api.DiscussionResources; import com.smartsheet.api.SmartsheetException; @@ -28,12 +27,6 @@ * Thread Safety: This class is thread safe because it is immutable and its base class is thread safe. */ public class DiscussionResourcesImpl extends AbstractResources implements DiscussionResources { - /** - * Represents the AssociatedAttachmentResources. - *

- * It will be initialized in constructor and will not change afterward. - */ - private AssociatedAttachmentResources attachments; /** * Represents the DiscussionCommentResources. @@ -75,16 +68,6 @@ public Comment addDiscussionComment(long id, Comment comment) throws SmartsheetE return this.createResource("discussion/" + id + "/comments", Comment.class, comment); } - /** - * Return the AssociatedAttachmentResources object that provides access to attachment resources associated with - * Discussion resources. - * - * @return the associated attachment resources - */ - public AssociatedAttachmentResources attachments() { - return this.attachments; - } - /** * Return the DiscussionCommentResources object that provides access to attachment resources associated with * Discussion resources. diff --git a/src/main/java/com/smartsheet/api/internal/ShareResourcesImpl.java b/src/main/java/com/smartsheet/api/internal/ShareResourcesImpl.java index 2153edd1..4b5f6d99 100644 --- a/src/main/java/com/smartsheet/api/internal/ShareResourcesImpl.java +++ b/src/main/java/com/smartsheet/api/internal/ShareResourcesImpl.java @@ -52,32 +52,6 @@ public ShareResourcesImpl(SmartsheetImpl smartsheet, String masterResourceType) super(smartsheet, masterResourceType); } - /** - * List shares of a given object. - *

- * It mirrors to the following Smartsheet REST API method: - * GET /workspace/{id}/shares - * GET /sheet/{id}/shares - * GET /sights/{id}/shares - * GET /reports/{id}/shares - *

- * 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 - * - * @param objectId the id of the object to share. - * @param pagination the pagination parameters - * @return the shares (note that empty list will be returned if there is none) - * @throws SmartsheetException the smartsheet exception - */ - public PagedResult listShares(long objectId, PaginationParameters pagination) throws SmartsheetException { - return this.listShares(objectId, pagination, false); - } - /** * List shares of a given object. */ diff --git a/src/main/java/com/smartsheet/api/internal/SheetResourcesImpl.java b/src/main/java/com/smartsheet/api/internal/SheetResourcesImpl.java index fe48285a..3c87325f 100644 --- a/src/main/java/com/smartsheet/api/internal/SheetResourcesImpl.java +++ b/src/main/java/com/smartsheet/api/internal/SheetResourcesImpl.java @@ -34,22 +34,20 @@ import com.smartsheet.api.SheetUpdateRequestResources; import com.smartsheet.api.SmartsheetException; import com.smartsheet.api.SmartsheetRestException; -import com.smartsheet.api.UserResources; import com.smartsheet.api.internal.http.HttpEntity; import com.smartsheet.api.internal.http.HttpMethod; import com.smartsheet.api.internal.http.HttpRequest; import com.smartsheet.api.internal.http.HttpResponse; import com.smartsheet.api.internal.util.QueryUtil; +import com.smartsheet.api.internal.util.StreamUtil; import com.smartsheet.api.internal.util.Util; import com.smartsheet.api.models.ContainerDestination; -import com.smartsheet.api.models.MultiRowEmail; import com.smartsheet.api.models.PagedResult; import com.smartsheet.api.models.PaginationParameters; import com.smartsheet.api.models.Sheet; import com.smartsheet.api.models.SheetEmail; import com.smartsheet.api.models.SheetPublish; import com.smartsheet.api.models.SortSpecifier; -import com.smartsheet.api.models.UpdateRequest; import com.smartsheet.api.models.enums.CopyExclusion; import com.smartsheet.api.models.enums.ObjectExclusion; import com.smartsheet.api.models.enums.PaperSize; @@ -226,29 +224,6 @@ public PagedResult listSheets( return this.listResourcesWithWrapper(path, Sheet.class); } - /** - * List all sheets in the organization. - *

- * It mirrors to the following Smartsheet REST API method: GET /users/sheets - * @param parameters the object containing the pagination parameters - * @return all sheets (note that empty list will be returned if there is none) - * @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 ServiceUnavailableException : if the REST API service is not available (possibly due to rate limiting) - * @throws SmartsheetRestException : if there is any other REST API related error occurred during the operation - * @throws SmartsheetException : if there is any other error occurred during the operation - * @deprecated As of release 2.0. Please use {@link UserResources} instead - */ - @Deprecated(since = "2.0.0", forRemoval = true) - public PagedResult listOrganizationSheets(PaginationParameters parameters) throws SmartsheetException { - String path = "users/sheets"; - - if (parameters != null) { - path += parameters.toQueryString(); - } - return this.listResourcesWithWrapper(path, Sheet.class); - } - /** * Get a sheet. *

@@ -930,24 +905,6 @@ public Sheet moveSheet(long sheetId, ContainerDestination containerDestination) return this.createResource(path, Sheet.class, containerDestination); } - /** - * Creates an Update Request for the specified Row(s) within the Sheet. - *

- * It mirrors to the following Smartsheet REST API method: POST /sheets/{sheetId}/updaterequests - * @param sheetId the sheet id - * @param email the email - * @return the update request object - * @throws IllegalArgumentException : if any argument is null - * @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 ServiceUnavailableException : if the REST API service is not available (possibly due to rate limiting) - * @throws SmartsheetRestException : if there is any other REST API related error occurred during the operation - * @throws SmartsheetException : if there is any other error occurred during the operation - */ - public UpdateRequest createUpdateRequest(long sheetId, MultiRowEmail email) throws SmartsheetException { - return this.createResource(SHEETS + "/" + sheetId + "/updaterequests", UpdateRequest.class, email); - } - /** * Sort a sheet according to the sort criteria. *

@@ -1227,7 +1184,7 @@ private void getSheetAsFile(long id, PaperSize paperSize, OutputStream outputStr switch (response.getStatusCode()) { case 200: try { - copyStream(response.getEntity().getContent(), outputStream); + StreamUtil.copyContentIntoOutputStream(response.getEntity().getContent(), outputStream, BUFFER_SIZE, true); } catch (IOException e) { throw new SmartsheetException(e); } @@ -1238,22 +1195,4 @@ private void getSheetAsFile(long id, PaperSize paperSize, OutputStream outputStr getSmartsheet().getHttpClient().releaseConnection(); } - - /** - * Copy stream. - * - * @param input the input - * @param output the output - * @throws IOException Signals that an I/O exception has occurred. - * @deprecated replace with StreamUtil.copyContentIntoOutputStream() - */ - @Deprecated(since = "2.0.0", forRemoval = true) - private static void copyStream(InputStream input, OutputStream output) throws IOException { - byte[] buffer = new byte[BUFFER_SIZE]; - int len; - while ((len = input.read(buffer)) != -1) { - output.write(buffer, 0, len); - } - } - } diff --git a/src/main/java/com/smartsheet/api/internal/SheetRowResourcesImpl.java b/src/main/java/com/smartsheet/api/internal/SheetRowResourcesImpl.java index 5acbd1c3..44119ebb 100644 --- a/src/main/java/com/smartsheet/api/internal/SheetRowResourcesImpl.java +++ b/src/main/java/com/smartsheet/api/internal/SheetRowResourcesImpl.java @@ -35,13 +35,11 @@ import com.smartsheet.api.models.BulkItemFailure; import com.smartsheet.api.models.BulkItemResult; import com.smartsheet.api.models.BulkRowFailedItem; -import com.smartsheet.api.models.Cell; import com.smartsheet.api.models.CopyOrMoveRowDirective; import com.smartsheet.api.models.CopyOrMoveRowResult; import com.smartsheet.api.models.MultiRowEmail; import com.smartsheet.api.models.PartialRowUpdateResult; import com.smartsheet.api.models.Row; -import com.smartsheet.api.models.RowEmail; import com.smartsheet.api.models.enums.ObjectExclusion; import com.smartsheet.api.models.enums.RowCopyInclusion; import com.smartsheet.api.models.enums.RowInclusion; @@ -216,25 +214,6 @@ public Row getRow( return this.getResource(path, Row.class); } - /** - * Delete a row. - *

- * It mirrors to the following Smartsheet REST API method: DELETE /sheets/{sheetId}/rows/{rowId} - * @param sheetId the sheet id - * @param rowId the ID of the row - * @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 can not be found - * @throws ServiceUnavailableException : if the REST API service is not available (possibly due to rate limiting) - * @throws SmartsheetRestException : if there is any other REST API related error occurred during the operation - * @throws SmartsheetException : if there is any other error occurred during the operation - * @deprecated as of API 2.0.2 release, replaced by {@link #deleteRows(long, Set, boolean)} - */ - @Deprecated(since = "2.0.2", forRemoval = true) - public void deleteRow(long sheetId, long rowId) throws SmartsheetException { - this.deleteResource(SHEETS_PATH + sheetId + "/" + ROWS + "/" + rowId, Row.class); - } - /** * Deletes one or more row(s) from the Sheet specified in the URL. *

@@ -262,26 +241,6 @@ public List deleteRows(long sheetId, Set rowIds, boolean ignoreRowsN return this.deleteListResources(path, Long.class); } - /** - * Send a row via email to the designated recipients. - *

- * It mirrors to the following Smartsheet REST API method: POST /sheets/{sheetId}/rows/{rowId}/emails - * @param sheetId the id of the sheet - * @param rowId the id of the row - * @param email the row email - * @throws IllegalArgumentException : if any argument is null - * @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 ServiceUnavailableException : if the REST API service is not available (possibly due to rate limiting) - * @throws SmartsheetRestException : if there is any other REST API related error occurred during the operation - * @throws SmartsheetException : if there is any other error occurred during the operation - * @deprecated as of API V2.0.2, replaced by {@link #sendRows(long, MultiRowEmail)} - */ - @Deprecated(since = "2.0.2", forRemoval = true) - public void sendRow(long sheetId, long rowId, RowEmail email) throws SmartsheetException { - this.createResource(SHEETS_PATH + sheetId + "/" + ROWS + "/" + rowId + "/emails", RowEmail.class, email); - } - /** * Send a row via email to the designated recipients. *

@@ -532,30 +491,6 @@ public CopyOrMoveRowResult copyRows( return this.postAndReceiveRowObject(path, copyParameters); } - /** - /** - * Update the values of the Cells in a Row. - *

- * It mirrors to the following Smartsheet REST API method: PUT /row/{id}/cells - * @param rowId the row id - * @param cells the cells to update (Cells must have the following attributes set: * - * columnId * value * strict (optional) - * @return the updated cells (note that if there is no such resource, this method will throw - * ResourceNotFoundException rather than returning null). - * @throws IllegalArgumentException : if any argument is null - * @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 can not be found - * @throws ServiceUnavailableException : if the REST API service is not available (possibly due to rate limiting) - * @throws SmartsheetRestException : if there is any other REST API related error occurred during the operation - * @throws SmartsheetException : if there is any other error occurred during the operation - * @deprecated replaced by {@link #updateRows(long, List)} - */ - @Deprecated(since = "2.0.0", forRemoval = true) - public List updateCells(long rowId, List cells) throws SmartsheetException { - return this.putAndReceiveList("row/" + rowId + "/cells", cells, Cell.class); - } - /** * Creates an object of RowAttachmentResources. * diff --git a/src/main/java/com/smartsheet/api/internal/WorkspaceResourcesImpl.java b/src/main/java/com/smartsheet/api/internal/WorkspaceResourcesImpl.java index 2444f079..c8111a29 100644 --- a/src/main/java/com/smartsheet/api/internal/WorkspaceResourcesImpl.java +++ b/src/main/java/com/smartsheet/api/internal/WorkspaceResourcesImpl.java @@ -25,7 +25,6 @@ import com.smartsheet.api.models.PagedResult; import com.smartsheet.api.models.PaginationParameters; import com.smartsheet.api.models.Workspace; -import com.smartsheet.api.models.enums.CopyExclusion; import com.smartsheet.api.models.enums.SourceInclusion; import com.smartsheet.api.models.enums.WorkspaceCopyInclusion; import com.smartsheet.api.models.enums.WorkspaceRemapExclusion; @@ -221,41 +220,11 @@ public Workspace copyWorkspace( EnumSet includes, EnumSet skipRemap ) throws SmartsheetException { - return copyWorkspace(workspaceId, containerDestination, includes, skipRemap, null); - } - - /** - * Creates a copy of the specified workspace. - *

- * It mirrors to the following Smartsheet REST API method: POST /workspaces/{workspaceId}/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 workspaceId 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 - * @deprecated As of release 2.0. `excludes` param is deprecated. Please use the `copyWorkspace` method with `includes` instead. - */ - @Deprecated(since = "2.0.0", forRemoval = true) - public Workspace copyWorkspace(long workspaceId, ContainerDestination containerDestination, EnumSet includes, - EnumSet skipRemap, EnumSet excludes) throws SmartsheetException { - String path = WORKSPACES + "/" + workspaceId + "/copy"; Map parameters = new HashMap<>(); parameters.put("include", QueryUtil.generateCommaSeparatedList(includes)); parameters.put("skipRemap", QueryUtil.generateCommaSeparatedList(skipRemap)); - parameters.put("exclude", QueryUtil.generateCommaSeparatedList(excludes)); path += QueryUtil.generateUrl(null, parameters);