Skip to content

Metadata

ClassAssetInventoryAssetInventory.Editor
public static class Metadata

Stateless API for metadata definitions, assignments, typed values, and package metadata lookup.

public static List<MetadataDefinition> LoadDefinitions()

Loads metadata field definitions in their configured display order.

Returns

System.Collections.Generic.List{AssetInventory.MetadataDefinition}

public static MetadataDefinition AddDefinition(MetadataDefinition def)

Creates and persists a metadata field definition after validating its name and type.

Parameters

NameType
defAssetInventory.MetadataDefinition

Returns

AssetInventory.MetadataDefinition

public static void DeleteDefinition(MetadataDefinition def)

Deletes a metadata definition and its assignments after the caller confirms that destructive operation.

Parameters

NameType
defAssetInventory.MetadataDefinition
public static bool AddAssignment(int targetId, int id, MetadataAssignment.Target target, bool fromAssetStore = false)

Assigns the selected metadata definition and value to a package or indexed file, replacing an existing value for the same definition.

Parameters

NameType
targetIdSystem.Int32
idSystem.Int32
targetAssetInventory.MetadataAssignment.Target
fromAssetStoreSystem.Boolean

Returns

System.Boolean

AddAssignment(AssetInfo, int, Target, bool)

Section titled “AddAssignment(AssetInfo, int, Target, bool)”
public static bool AddAssignment(AssetInfo info, int id, MetadataAssignment.Target target, bool byUser = false)

Assigns the selected metadata definition and value to a package or indexed file, replacing an existing value for the same definition.

Parameters

NameType
infoAssetInventory.AssetInfo
idSystem.Int32
targetAssetInventory.MetadataAssignment.Target
byUserSystem.Boolean

Returns

System.Boolean

RemoveAssignment(AssetInfo, MetadataInfo, bool, bool)

Section titled “RemoveAssignment(AssetInfo, MetadataInfo, bool, bool)”
public static void RemoveAssignment(AssetInfo info, MetadataInfo metadataInfo, bool autoReload = true, bool byUser = false)

Removes the selected metadata value from its package or file target without deleting the field definition.

Parameters

NameType
infoAssetInventory.AssetInfo
metadataInfoAssetInventory.MetadataInfo
autoReloadSystem.Boolean
byUserSystem.Boolean
public static List<MetadataInfo> GetPackageMetadata(int assetId)

Returns resolved metadata values for the selected package keyed by definition.

Parameters

NameType
assetIdSystem.Int32

Returns

System.Collections.Generic.List{AssetInventory.MetadataInfo}

public static Dictionary<int, List<string>> GetHidePatterns()

Returns metadata field values currently configured as file-path hide patterns.

Returns

System.Collections.Generic.Dictionary{System.Int32,System.Collections.Generic.List{System.String}}

public static event Action OnDefinitionsChanged

Raised after definitions changed so open views and integrations can refresh their cached catalog state.

Returns

System.Action