Item class
A versioned asset in the Kumiho system.
Items represent assets that can have multiple revisions, such as 3D models, textures, workflows, or any other type of creative content. They are the main entry-point for client tools: each API in this class returns a high-level model object rather than the protobuf response so dartdoc can generate user-facing documentation without exposing transport details.
final item = await kumiho.getItem('kref://my-project/models/hero.model');
// Create a new revision
final v1 = await item.createRevision(metadata: {'artist': 'john'});
// Add artifacts to the revision
await v1.createArtifact('mesh', '/assets/hero_v1.fbx');
// Tag the revision
await v1.tag('approved');
// Get all revisions
for (final revision in await item.getRevisions()) {
print('v${revision.number}: ${revision.tags}');
}
- Inheritance
-
- Object
- KumihoObject
- Item
Constructors
- Item(ItemResponse response, dynamic client)
- Creates an Item from a protobuf response.
Properties
-
The user ID who created the item.
latefinal
- client → dynamic
-
The client instance for making API calls.
finalinherited
- createdAt ↔ String?
-
ISO timestamp when the item was created.
latefinal
- deprecated ↔ bool
-
Whether the item is deprecated.
latefinal
- hashCode → int
-
The hash code for this object.
no setterinherited
- itemName ↔ String
-
The base name of the item (e.g., "hero").
latefinal
- kind ↔ String
-
The kind of item (e.g., "model", "texture").
latefinal
- kref ↔ Kref
-
The unique reference URI for this item.
latefinal
-
metadata
↔ Map<
String, String> -
Custom metadata key-value pairs.
latefinal
- name ↔ String
-
The full name including kind (e.g., "hero.model").
latefinal
- projectName → String
-
Gets the project name from the kref.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- space → Future
-
Gets the parent space of this item.
no setter
- spacePath → String
-
Gets the space path from the kref.
no setter
- username ↔ String
-
Display name of the creator.
latefinal
Methods
-
createRevision(
{Map< String, String> ? metadata}) → Future<Revision> - Creates a new revision of this item.
-
delete(
) → Future< void> - Deletes this item.
-
getLatestRevision(
) → Future< Revision?> - Gets the latest revision of this item.
-
getRevision(
int number) → Future< Revision> - Gets a specific revision by number.
-
getRevisionByTag(
String tag) → Future< Revision?> - Gets a revision by tag.
-
getRevisions(
) → Future< List< Revision> > - Gets all revisions of this item.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setDeprecated(
bool deprecated) → Future< void> - Sets the deprecated status of this item.
-
setMetadata(
Map< String, String> metadata) → Future<void> - Sets metadata for this item.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited