docs: @Restricted(DoNotUse.class)
      public Categories doItemCategories(StaplerRequest req, StaplerResponse rsp, @QueryParameter String iconStyle) throws IOException, ServletException {
          getOwner().checkPermission(Item.CREATE);
  
          rsp.addHeader("Cache-Control", "no-cache, no-store, must-revalidate");
          rsp.addHeader("Pragma", "no-cache");
          rsp.addHeader("Expires", "0");
          Categories categories = new Categories();
          int order = 0;
          JellyContext ctx;
  
          if (StringUtils.isNotBlank(iconStyle)) {
              ctx = new JellyContext();
              ctx.setVariable("resURL", req.getContextPath() + Jenkins.RESOURCE_PATH);
          } else {
              ctx = null;
          }
          for (TopLevelItemDescriptor descriptor : DescriptorVisibilityFilter.apply(getOwner().getItemGroup(), Items.all(Jenkins.getAuthentication(), getOwner().getItemGroup()))) {
              ItemCategory ic = ItemCategory.getCategory(descriptor);
              Map<String, Serializable> metadata = new HashMap<>();
  
              // Information about Item.
              metadata.put("class", descriptor.getId());
              metadata.put("order", ++order);
              metadata.put("displayName", descriptor.getDisplayName());
              metadata.put("description", descriptor.getDescription());
              metadata.put("iconFilePathPattern", descriptor.getIconFilePathPattern());
              String iconClassName = descriptor.getIconClassName();
              if (StringUtils.isNotBlank(iconClassName)) {
                  metadata.put("iconClassName", iconClassName);
                  if (ctx != null) {
                      Icon icon = IconSet.icons
                              .getIconByClassSpec(StringUtils.join(new String[]{iconClassName, iconStyle}, " "));
                      if (icon != null) {
                          metadata.put("iconQualifiedUrl", icon.getQualifiedUrl(ctx));
                      }
                  }
              }
  
              Category category = categories.getItem(ic.getId());
              if (category != null) {
                  category.getItems().add(metadata);
              } else {
                  List<Map<String, Serializable>> temp = new ArrayList<>();
                  temp.add(metadata);
                  category = new Category(ic.getId(), ic.getDisplayName(), ic.getDescription(), ic.getOrder(), ic.getMinToShow(), temp);
                  categories.getItems().add(category);
              }
          }
          return categories;
      }