createVersion method

Future<ServiceVersionInfo> createVersion({
  1. required ServiceVersionParameters newVersion,
})

Creates a new version in the service based on the default version.

Branch versioning requires that the default version always be the ancestor of all other versions.

If the service isn't branch versioned, an ArcGISExceptionType.mappingBranchVersioningNotSupportedByService is thrown.

If the version parameters do not include a name, an error is thrown.

Parameters:

  • newVersion — The properties of the new version.

Return Value: A Future which returns the full metadata for the new version.

Implementation

Future<ServiceVersionInfo> createVersion({
  required ServiceVersionParameters newVersion,
}) {
  final taskHandle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_ServiceGeodatabase_createVersionAsync(
      _handle,
      newVersion._handle,
      errorHandler,
    );
  });
  return taskHandle.toFuture(
    (element) => element.getValueAsServiceVersionInfo()!,
  );
}