createRevision method
inherited
Creates a new revision for an item.
itemKref is the item's kref URI.
metadata is optional key-value pairs to attach.
number is optional; if not provided, uses the next available number.
existsError controls whether to throw if revision exists (default: true).
Implementation
Future<RevisionResponse> createRevision(
String itemKref, {
Map<String, String>? metadata,
int? number,
bool existsError = true,
}) async {
final request = CreateRevisionRequest()
..itemKref = Kref(uri: itemKref)
..existsError = existsError;
if (metadata != null) {
request.metadata.addAll(metadata);
}
if (number != null && number > 0) {
request.number = number;
}
return stub.createRevision(request, options: callOptions);
}