createArtifact method
- String revisionKref,
- String name,
- String location, {
- Map<
String, String> ? metadata, - bool existsError = true,
inherited
Creates a new artifact for a revision.
revisionKref is the revision's kref URI (must include ?r=N).
name is the artifact name (e.g., 'mesh', 'textures').
location is the file path or URI where the artifact is stored.
metadata is optional key-value metadata for the artifact.
existsError controls whether to throw if artifact exists (default: true).
Implementation
Future<ArtifactResponse> createArtifact(
String revisionKref,
String name,
String location, {
Map<String, String>? metadata,
bool existsError = true,
}) async {
final request = CreateArtifactRequest()
..revisionKref = Kref(uri: revisionKref)
..name = name
..location = location
..existsError = existsError;
if (metadata != null) {
request.metadata.addAll(metadata);
}
return stub.createArtifact(request, options: callOptions);
}