ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Core.Portal Namespace / PortalItem Class / PortalItemType Property
Example

In This Topic
    PortalItemType Property
    In This Topic
    Gets the GIS content type of this item.
    Syntax
    public PortalItemType PortalItemType {get;}
    Public ReadOnly Property PortalItemType As PortalItemType
    Remarks
    Example types include : "Web Map" and "Web Mapping Application"
    Example
    Portal: Download any package items in the user content
    //user content previously from...
    //var userContent = await portal.GetUserContentAsync(owner);
    
    var packages = new List<PortalItemType>
    {
      PortalItemType.BasemapPackage,
      PortalItemType.GeoprocessingPackage,
      PortalItemType.LayerPackage,
      PortalItemType.LocatorPackage,
      PortalItemType.MapPackage,
      PortalItemType.ProjectPackage,
      PortalItemType.ScenePackage,
      PortalItemType.RulePackage,
      PortalItemType.VectorTilePackage
    };
    var folder = @"E:\Temp\PortalAPITest\";
    foreach (var di in userContent.PortalItems.Where(pi => packages.Contains(pi.PortalItemType)))
    {
      var path = System.IO.Path.Combine(folder, di.Name);
      await di.GetItemDataAsync(path);
    }
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also