async function removeAnyoneWithLinkResponder(formId) {
  const authClient = await authenticate({
    keyfilePath: CREDENTIALS_PATH,
    scopes: SCOPES,
  });

  const driveService = drive({version: 'v3', auth: authClient});
  let permissionIdToDelete = null;

  try {
    const res = await driveService.permissions.list({
      fileId: formId,
      fields: 'permissions(id,type,role,view)',
      includePermissionsForView: 'published',
    });

    const permissions = res.data.permissions || [];
    for (const permission of permissions) {
      if (permission.type === 'anyone' && permission.role === 'reader' &&
          permission.view === 'published') {
        permissionIdToDelete = permission.id;
        break;
      }
    }

    if (permissionIdToDelete) {
      await driveService.permissions.delete({
        fileId: formId,
        permissionId: permissionIdToDelete,
      });
      console.log(
          `Successfully removed 'Anyone with the link' permission (ID: ${
              permissionIdToDelete}) from form '${formId}'.`);
    } else {
      console.log(
          `'Anyone with the link can respond' permission not found for form '${
              formId}'. Nothing to remove.`);
    }
  } catch (err) {
    console.error(
        'Error removing "anyone with link" permission:', err.message || err);
  }
}
Removes anyone with the link as a responder for the form.

@param {string} formId The ID of the Google Form.