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

Name Type
def AssetInventory.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

Name Type
def AssetInventory.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

Name Type
targetId System.Int32
id System.Int32
target AssetInventory.MetadataAssignment.Target
fromAssetStore System.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

Name Type
info AssetInventory.AssetInfo
id System.Int32
target AssetInventory.MetadataAssignment.Target
byUser System.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

Name Type
info AssetInventory.AssetInfo
metadataInfo AssetInventory.MetadataInfo
autoReload System.Boolean
byUser System.Boolean
public static List<MetadataInfo> GetPackageMetadata(int assetId)

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

Parameters

Name Type
assetId System.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