import{GenericActivityError}from"../../Errors.js";import{validation}from"../../Validation.js";import{addToPath,inline,schedulePromiseCancellation,post}from"./tools.js";import{isArcGisApiVersion3x}from"./ArcGisApiVersion.js";class DeleteAttachments{execute(t,e){var i=validation.urlOrLayer(t,isArcGisApiVersion3x).trim(),n=validation.number("objectId",t.objectId,validation.never),r=validation.array("attachmentIds",t.attachmentIds,validation.never).join(","),t=validation.number("timeout",t.timeout,void 0),n=addToPath(i,`${n}/deleteAttachments`),r={attachmentIds:r},t=post(n,r,t,e.cancellationToken.signal);return schedulePromiseCancellation(e,t),inline(t,function(t){t=t.deleteAttachmentResults;if(!t)throw new GenericActivityError('Error running the "Delete Attachments" activity. The response did not include the required "deleteAttachmentResults" property.');return{results:t}})}}DeleteAttachments.action="gcx:wf:arcgis::DeleteAttachments",DeleteAttachments.suite="gcx:wf:builtin";export{DeleteAttachments};