class SystemFlagsDeployResult {

    WireSystemFlagsDeployResult toWire() {
        var wireResult = new WireSystemFlagsDeployResult();
        wireResult.changes = new ArrayList<>();
        for (FlagDataChange change : flagChanges) {
            var wireChange = new WireFlagDataChange();
            wireChange.flagId = change.flagId().toString();
            wireChange.operation = change.operation().asString();
            wireChange.targets = change.targets().stream().map(FlagsTarget::asString).collect(toList());
            wireChange.data = change.data().map(FlagData::toWire).orElse(null);
            wireChange.previousData = change.previousData().map(FlagData::toWire).orElse(null);
            wireResult.changes.add(wireChange);
        }
        wireResult.errors = new ArrayList<>();
        for (OperationError error : errors) {
            var wireError = new WireOperationFailure();
            wireError.message = error.message();
            wireError.operation = error.operation().asString();
            wireError.targets = error.targets().stream().map(FlagsTarget::asString).collect(toList());
            wireError.flagId = error.flagId().map(FlagId::toString).orElse(null);
            wireError.data = error.flagData().map(FlagData::toWire).orElse(null);
            wireResult.errors.add(wireError);
        }
        wireResult.warnings = new ArrayList<>();
        for (Warning warning : warnings) {
            var wireWarning = new WireWarning();
            wireWarning.message = warning.message();
            wireWarning.flagId = warning.flagId().toString();
            wireWarning.targets = warning.targets().stream().map(FlagsTarget::asString).collect(toList());
            wireResult.warnings.add(wireWarning);
        }
        return wireResult;
    }

      SystemFlagsDeployResult(List<FlagDataChange> flagChanges, List<OperationError> errors, List<Warning> warnings);
      SystemFlagsDeployResult(List<OperationError> errors);

}