export type ErrorDetails = {errorCode?: string | undefined, message?: string | undefined}; export type WorkspaceUser = {accountId?: string | undefined, accountName?: string | undefined, activeSince?: string | undefined, created?: string | undefined, createdById?: string | undefined, email?: string | undefined, errorDetails?: ErrorDetails | undefined, invitationEmailBlurb?: string | undefined, invitationEmailSubject?: string | undefined, lastModified?: string | undefined, lastModifiedById?: string | undefined, status?: string | undefined, type?: string | undefined, userId?: string | undefined, userName?: string | undefined, workspaceId?: string | undefined, workspaceUserBaseUrl?: string | undefined, workspaceUserId?: string | undefined, workspaceUserUri?: string | undefined}; export type WorkspaceUserAuthorization = {canDelete?: string | undefined, canMove?: string | undefined, canTransact?: string | undefined, canView?: string | undefined, created?: string | undefined, createdById?: string | undefined, errorDetails?: ErrorDetails | undefined, modified?: string | undefined, modifiedById?: string | undefined, workspaceUserId?: string | undefined, workspaceUserInformation?: WorkspaceUser | undefined}; export type Page = {dpi?: string | undefined, errorDetails?: ErrorDetails | undefined, height?: string | undefined, imageBytes?: string | undefined, mimeType?: string | undefined, pageId?: string | undefined, sequence?: string | undefined, width?: string | undefined}; export type WorkspaceItem = {callerAuthorization?: WorkspaceUserAuthorization | undefined, contentType?: string | undefined, created?: string | undefined, createdById?: string | undefined, createdByInformation?: WorkspaceUser | undefined, extension?: string | undefined, fileSize?: string | undefined, fileUri?: string | undefined, id?: string | undefined, isPublic?: string | undefined, lastModified?: string | undefined, lastModifiedById?: string | undefined, lastModifiedByInformation?: WorkspaceUser | undefined, name?: string | undefined, pageCount?: string | undefined, parentFolderId?: string | undefined, parentFolderUri?: string | undefined, sha256?: string | undefined, thumbHeight?: string | undefined, thumbnail?: Page | undefined, thumbWidth?: string | undefined, type?: string | undefined, uri?: string | undefined, userAuthorization?: WorkspaceUserAuthorization | undefined}; export type WorkspaceItemList = {items?: Array | undefined}; export type DeleteApiV21AccountsAccountIdWorkspacesWorkspaceIdFoldersFolderIdArgs = {accountId: string, folderId: string, workspaceId: string, body: WorkspaceItemList}; export type DeleteApiV21AccountsAccountIdWorkspacesWorkspaceIdFoldersFolderIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Deletes files or sub-folders from a workspace. * * DELETE /v2.1/accounts/{accountId}/workspaces/{workspaceId}/folders/{folderId} */ export const deleteApiV21AccountsAccountIdWorkspacesWorkspaceIdFoldersFolderId = async (args: DeleteApiV21AccountsAccountIdWorkspacesWorkspaceIdFoldersFolderIdArgs, options?: DeleteApiV21AccountsAccountIdWorkspacesWorkspaceIdFoldersFolderIdOptions) => { const {baseUrl = "https://www.docusign.net/restapi", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/v2.1/accounts/${encodeURIComponent(String(args.accountId))}/workspaces/${encodeURIComponent(String(args.workspaceId))}/folders/${encodeURIComponent(String(args.folderId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };