From 2dd59305603dc150a7baf6fcf265c447e1bef818 Mon Sep 17 00:00:00 2001 From: appflowy Date: Mon, 11 Apr 2022 14:09:50 +0800 Subject: [PATCH] fix: deserial cells data from delta error --- .../grid/cell_bloc/cell_service.dart | 5 +- .../application/grid/field/field_service.dart | 1 - .../grid/src/widgets/cell/cell_builder.dart | 2 +- .../src/widgets/header/field_switcher.dart | 1 - .../widgets/header/field_type_extension.dart | 3 +- .../src/widgets/header/field_type_list.dart | 2 +- .../dart_event/flowy-grid/dart_event.dart | 2 +- .../flowy-grid-data-model/grid.pb.dart | 380 +- .../flowy-grid-data-model/grid.pbenum.dart | 27 + .../flowy-grid-data-model/grid.pbjson.dart | 58 + .../flowy-grid-data-model/meta.pb.dart | 1086 ----- .../flowy-grid-data-model/meta.pbenum.dart | 34 - .../flowy-grid-data-model/meta.pbjson.dart | 217 - .../flowy-grid-data-model/meta.pbserver.dart | 9 - .../flowy-grid-data-model/protobuf.dart | 1 - frontend/rust-lib/Cargo.lock | 7 +- frontend/rust-lib/flowy-grid/Cargo.toml | 1 + .../rust-lib/flowy-grid/src/event_handler.rs | 8 +- frontend/rust-lib/flowy-grid/src/event_map.rs | 2 +- .../src/services/block_meta_manager.rs | 4 +- .../src/services/field/field_builder.rs | 4 +- .../type_options/selection_type_option.rs | 6 +- .../field/type_options/text_type_option.rs | 2 +- .../flowy-grid/src/services/grid_editor.rs | 6 +- .../src/services/row/row_builder.rs | 3 +- .../flowy-grid/src/services/row/row_loader.rs | 5 +- .../flowy-grid/tests/grid/grid_test.rs | 6 +- .../rust-lib/flowy-grid/tests/grid/script.rs | 8 +- .../flowy-sdk/src/deps_resolve/folder_deps.rs | 4 +- shared-lib/Cargo.lock | 18 + shared-lib/flowy-grid-data-model/Cargo.toml | 2 +- shared-lib/flowy-grid-data-model/Flowy.toml | 2 +- .../src/entities/grid.rs | 173 +- .../src/entities/meta.rs | 276 +- .../src/protobuf/model/grid.rs | 1249 +++++- .../src/protobuf/model/meta.rs | 3520 ----------------- .../src/protobuf/model/mod.rs | 3 - .../src/protobuf/proto/grid.proto | 26 +- .../src/protobuf/proto/meta.proto | 76 - .../src/client_grid/grid_block_meta_pad.rs | 7 +- 40 files changed, 1908 insertions(+), 5338 deletions(-) delete mode 100644 frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-grid-data-model/meta.pb.dart delete mode 100644 frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-grid-data-model/meta.pbenum.dart delete mode 100644 frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-grid-data-model/meta.pbjson.dart delete mode 100644 frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-grid-data-model/meta.pbserver.dart delete mode 100644 shared-lib/flowy-grid-data-model/src/protobuf/model/meta.rs delete mode 100644 shared-lib/flowy-grid-data-model/src/protobuf/proto/meta.proto diff --git a/frontend/app_flowy/lib/workspace/application/grid/cell_bloc/cell_service.dart b/frontend/app_flowy/lib/workspace/application/grid/cell_bloc/cell_service.dart index 9bdd48c259..dfce5d3993 100644 --- a/frontend/app_flowy/lib/workspace/application/grid/cell_bloc/cell_service.dart +++ b/frontend/app_flowy/lib/workspace/application/grid/cell_bloc/cell_service.dart @@ -1,8 +1,7 @@ import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart'; import 'package:dartz/dartz.dart'; import 'package:flowy_sdk/dispatch/dispatch.dart'; -import 'package:flowy_sdk/protobuf/flowy-grid-data-model/grid.pb.dart' show Cell; -import 'package:flowy_sdk/protobuf/flowy-grid-data-model/meta.pb.dart'; +import 'package:flowy_sdk/protobuf/flowy-grid-data-model/grid.pb.dart'; import 'package:flowy_sdk/protobuf/flowy-grid/cell_entities.pb.dart'; class CellService { @@ -14,7 +13,7 @@ class CellService { required String rowId, required String data, }) { - final payload = CellMetaChangeset.create() + final payload = CellChangeset.create() ..gridId = gridId ..fieldId = fieldId ..rowId = rowId diff --git a/frontend/app_flowy/lib/workspace/application/grid/field/field_service.dart b/frontend/app_flowy/lib/workspace/application/grid/field/field_service.dart index 2336c4f340..bdf8c0d261 100644 --- a/frontend/app_flowy/lib/workspace/application/grid/field/field_service.dart +++ b/frontend/app_flowy/lib/workspace/application/grid/field/field_service.dart @@ -3,7 +3,6 @@ import 'package:equatable/equatable.dart'; import 'package:flowy_sdk/dispatch/dispatch.dart'; import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart'; import 'package:flowy_sdk/protobuf/flowy-grid-data-model/grid.pb.dart'; -import 'package:flowy_sdk/protobuf/flowy-grid-data-model/meta.pb.dart'; import 'package:flowy_sdk/protobuf/flowy-grid/field_entities.pb.dart'; class FieldService { diff --git a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/cell_builder.dart b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/cell_builder.dart index 3b84ac557a..2b00a13a10 100755 --- a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/cell_builder.dart +++ b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/cell_builder.dart @@ -1,5 +1,5 @@ import 'package:app_flowy/workspace/application/grid/row/row_service.dart'; -import 'package:flowy_sdk/protobuf/flowy-grid-data-model/meta.pb.dart'; +import 'package:flowy_sdk/protobuf/flowy-grid-data-model/grid.pb.dart' show FieldType; import 'package:flutter/widgets.dart'; import 'checkbox_cell.dart'; import 'date_cell.dart'; diff --git a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/header/field_switcher.dart b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/header/field_switcher.dart index decaaec611..80ebd456e7 100644 --- a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/header/field_switcher.dart +++ b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/header/field_switcher.dart @@ -10,7 +10,6 @@ import 'package:flowy_infra_ui/style_widget/text.dart'; import 'package:flowy_sdk/log.dart'; import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart'; import 'package:flowy_sdk/protobuf/flowy-grid-data-model/grid.pb.dart'; -import 'package:flowy_sdk/protobuf/flowy-grid-data-model/meta.pb.dart'; import 'package:flowy_sdk/protobuf/flowy-grid/checkbox_type_option.pbserver.dart'; import 'package:flowy_sdk/protobuf/flowy-grid/text_type_option.pb.dart'; import 'package:flutter/material.dart'; diff --git a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/header/field_type_extension.dart b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/header/field_type_extension.dart index ce37afe861..a4da8fa1b9 100644 --- a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/header/field_type_extension.dart +++ b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/header/field_type_extension.dart @@ -1,5 +1,4 @@ - -import 'package:flowy_sdk/protobuf/flowy-grid-data-model/meta.pb.dart'; +import 'package:flowy_sdk/protobuf/flowy-grid-data-model/grid.pb.dart' show FieldType; import 'package:app_flowy/generated/locale_keys.g.dart'; import 'package:easy_localization/easy_localization.dart'; diff --git a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/header/field_type_list.dart b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/header/field_type_list.dart index 2965556f60..bfced8f421 100644 --- a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/header/field_type_list.dart +++ b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/header/field_type_list.dart @@ -6,7 +6,7 @@ import 'package:flowy_infra_ui/style_widget/button.dart'; import 'package:flowy_infra_ui/style_widget/scrolling/styled_list.dart'; import 'package:flowy_infra_ui/style_widget/text.dart'; import 'package:flowy_infra_ui/widget/spacing.dart'; -import 'package:flowy_sdk/protobuf/flowy-grid-data-model/meta.pb.dart'; +import 'package:flowy_sdk/protobuf/flowy-grid-data-model/grid.pb.dart' show FieldType; import 'package:flutter/material.dart'; import 'field_type_extension.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/dispatch/dart_event/flowy-grid/dart_event.dart b/frontend/app_flowy/packages/flowy_sdk/lib/dispatch/dart_event/flowy-grid/dart_event.dart index 8544bc6edd..93a0abfee2 100644 --- a/frontend/app_flowy/packages/flowy_sdk/lib/dispatch/dart_event/flowy-grid/dart_event.dart +++ b/frontend/app_flowy/packages/flowy_sdk/lib/dispatch/dart_event/flowy-grid/dart_event.dart @@ -291,7 +291,7 @@ class GridEventGetCell { } class GridEventUpdateCell { - CellMetaChangeset request; + CellChangeset request; GridEventUpdateCell(this.request); Future> send() { diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-grid-data-model/grid.pb.dart b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-grid-data-model/grid.pb.dart index e0fdcc33a5..2c3a848729 100644 --- a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-grid-data-model/grid.pb.dart +++ b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-grid-data-model/grid.pb.dart @@ -9,7 +9,9 @@ import 'dart:core' as $core; import 'package:protobuf/protobuf.dart' as $pb; -import 'meta.pbenum.dart' as $0; +import 'grid.pbenum.dart'; + +export 'grid.pbenum.dart'; class Grid extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Grid', createEmptyInstance: create) @@ -79,7 +81,7 @@ class Field extends $pb.GeneratedMessage { ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'id') ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name') ..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'desc') - ..e<$0.FieldType>(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'fieldType', $pb.PbFieldType.OE, defaultOrMaker: $0.FieldType.RichText, valueOf: $0.FieldType.valueOf, enumValues: $0.FieldType.values) + ..e(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'fieldType', $pb.PbFieldType.OE, defaultOrMaker: FieldType.RichText, valueOf: FieldType.valueOf, enumValues: FieldType.values) ..aOB(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'frozen') ..aOB(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'visibility') ..a<$core.int>(7, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'width', $pb.PbFieldType.O3) @@ -91,7 +93,7 @@ class Field extends $pb.GeneratedMessage { $core.String? id, $core.String? name, $core.String? desc, - $0.FieldType? fieldType, + FieldType? fieldType, $core.bool? frozen, $core.bool? visibility, $core.int? width, @@ -169,9 +171,9 @@ class Field extends $pb.GeneratedMessage { void clearDesc() => clearField(3); @$pb.TagNumber(4) - $0.FieldType get fieldType => $_getN(3); + FieldType get fieldType => $_getN(3); @$pb.TagNumber(4) - set fieldType($0.FieldType v) { setField(4, v); } + set fieldType(FieldType v) { setField(4, v); } @$pb.TagNumber(4) $core.bool hasFieldType() => $_has(3); @$pb.TagNumber(4) @@ -266,7 +268,7 @@ class GetEditFieldContextPayload extends $pb.GeneratedMessage { ..oo(0, [2]) ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'gridId') ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'fieldId') - ..e<$0.FieldType>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'fieldType', $pb.PbFieldType.OE, defaultOrMaker: $0.FieldType.RichText, valueOf: $0.FieldType.valueOf, enumValues: $0.FieldType.values) + ..e(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'fieldType', $pb.PbFieldType.OE, defaultOrMaker: FieldType.RichText, valueOf: FieldType.valueOf, enumValues: FieldType.values) ..hasRequiredFields = false ; @@ -274,7 +276,7 @@ class GetEditFieldContextPayload extends $pb.GeneratedMessage { factory GetEditFieldContextPayload({ $core.String? gridId, $core.String? fieldId, - $0.FieldType? fieldType, + FieldType? fieldType, }) { final _result = create(); if (gridId != null) { @@ -331,9 +333,9 @@ class GetEditFieldContextPayload extends $pb.GeneratedMessage { void clearFieldId() => clearField(2); @$pb.TagNumber(3) - $0.FieldType get fieldType => $_getN(2); + FieldType get fieldType => $_getN(2); @$pb.TagNumber(3) - set fieldType($0.FieldType v) { setField(3, v); } + set fieldType(FieldType v) { setField(3, v); } @$pb.TagNumber(3) $core.bool hasFieldType() => $_has(2); @$pb.TagNumber(3) @@ -344,7 +346,7 @@ class EditFieldPayload extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'EditFieldPayload', createEmptyInstance: create) ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'gridId') ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'fieldId') - ..e<$0.FieldType>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'fieldType', $pb.PbFieldType.OE, defaultOrMaker: $0.FieldType.RichText, valueOf: $0.FieldType.valueOf, enumValues: $0.FieldType.values) + ..e(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'fieldType', $pb.PbFieldType.OE, defaultOrMaker: FieldType.RichText, valueOf: FieldType.valueOf, enumValues: FieldType.values) ..hasRequiredFields = false ; @@ -352,7 +354,7 @@ class EditFieldPayload extends $pb.GeneratedMessage { factory EditFieldPayload({ $core.String? gridId, $core.String? fieldId, - $0.FieldType? fieldType, + FieldType? fieldType, }) { final _result = create(); if (gridId != null) { @@ -406,9 +408,9 @@ class EditFieldPayload extends $pb.GeneratedMessage { void clearFieldId() => clearField(2); @$pb.TagNumber(3) - $0.FieldType get fieldType => $_getN(2); + FieldType get fieldType => $_getN(2); @$pb.TagNumber(3) - set fieldType($0.FieldType v) { setField(3, v); } + set fieldType(FieldType v) { setField(3, v); } @$pb.TagNumber(3) $core.bool hasFieldType() => $_has(2); @$pb.TagNumber(3) @@ -1698,3 +1700,355 @@ class QueryGridBlocksPayload extends $pb.GeneratedMessage { $core.List get blockOrders => $_getList(1); } +enum FieldChangesetPayload_OneOfName { + name, + notSet +} + +enum FieldChangesetPayload_OneOfDesc { + desc, + notSet +} + +enum FieldChangesetPayload_OneOfFieldType { + fieldType, + notSet +} + +enum FieldChangesetPayload_OneOfFrozen { + frozen, + notSet +} + +enum FieldChangesetPayload_OneOfVisibility { + visibility, + notSet +} + +enum FieldChangesetPayload_OneOfWidth { + width, + notSet +} + +enum FieldChangesetPayload_OneOfTypeOptionData { + typeOptionData, + notSet +} + +class FieldChangesetPayload extends $pb.GeneratedMessage { + static const $core.Map<$core.int, FieldChangesetPayload_OneOfName> _FieldChangesetPayload_OneOfNameByTag = { + 3 : FieldChangesetPayload_OneOfName.name, + 0 : FieldChangesetPayload_OneOfName.notSet + }; + static const $core.Map<$core.int, FieldChangesetPayload_OneOfDesc> _FieldChangesetPayload_OneOfDescByTag = { + 4 : FieldChangesetPayload_OneOfDesc.desc, + 0 : FieldChangesetPayload_OneOfDesc.notSet + }; + static const $core.Map<$core.int, FieldChangesetPayload_OneOfFieldType> _FieldChangesetPayload_OneOfFieldTypeByTag = { + 5 : FieldChangesetPayload_OneOfFieldType.fieldType, + 0 : FieldChangesetPayload_OneOfFieldType.notSet + }; + static const $core.Map<$core.int, FieldChangesetPayload_OneOfFrozen> _FieldChangesetPayload_OneOfFrozenByTag = { + 6 : FieldChangesetPayload_OneOfFrozen.frozen, + 0 : FieldChangesetPayload_OneOfFrozen.notSet + }; + static const $core.Map<$core.int, FieldChangesetPayload_OneOfVisibility> _FieldChangesetPayload_OneOfVisibilityByTag = { + 7 : FieldChangesetPayload_OneOfVisibility.visibility, + 0 : FieldChangesetPayload_OneOfVisibility.notSet + }; + static const $core.Map<$core.int, FieldChangesetPayload_OneOfWidth> _FieldChangesetPayload_OneOfWidthByTag = { + 8 : FieldChangesetPayload_OneOfWidth.width, + 0 : FieldChangesetPayload_OneOfWidth.notSet + }; + static const $core.Map<$core.int, FieldChangesetPayload_OneOfTypeOptionData> _FieldChangesetPayload_OneOfTypeOptionDataByTag = { + 9 : FieldChangesetPayload_OneOfTypeOptionData.typeOptionData, + 0 : FieldChangesetPayload_OneOfTypeOptionData.notSet + }; + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'FieldChangesetPayload', createEmptyInstance: create) + ..oo(0, [3]) + ..oo(1, [4]) + ..oo(2, [5]) + ..oo(3, [6]) + ..oo(4, [7]) + ..oo(5, [8]) + ..oo(6, [9]) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'fieldId') + ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'gridId') + ..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name') + ..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'desc') + ..e(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'fieldType', $pb.PbFieldType.OE, defaultOrMaker: FieldType.RichText, valueOf: FieldType.valueOf, enumValues: FieldType.values) + ..aOB(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'frozen') + ..aOB(7, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'visibility') + ..a<$core.int>(8, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'width', $pb.PbFieldType.O3) + ..a<$core.List<$core.int>>(9, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'typeOptionData', $pb.PbFieldType.OY) + ..hasRequiredFields = false + ; + + FieldChangesetPayload._() : super(); + factory FieldChangesetPayload({ + $core.String? fieldId, + $core.String? gridId, + $core.String? name, + $core.String? desc, + FieldType? fieldType, + $core.bool? frozen, + $core.bool? visibility, + $core.int? width, + $core.List<$core.int>? typeOptionData, + }) { + final _result = create(); + if (fieldId != null) { + _result.fieldId = fieldId; + } + if (gridId != null) { + _result.gridId = gridId; + } + if (name != null) { + _result.name = name; + } + if (desc != null) { + _result.desc = desc; + } + if (fieldType != null) { + _result.fieldType = fieldType; + } + if (frozen != null) { + _result.frozen = frozen; + } + if (visibility != null) { + _result.visibility = visibility; + } + if (width != null) { + _result.width = width; + } + if (typeOptionData != null) { + _result.typeOptionData = typeOptionData; + } + return _result; + } + factory FieldChangesetPayload.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory FieldChangesetPayload.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + FieldChangesetPayload clone() => FieldChangesetPayload()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + FieldChangesetPayload copyWith(void Function(FieldChangesetPayload) updates) => super.copyWith((message) => updates(message as FieldChangesetPayload)) as FieldChangesetPayload; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static FieldChangesetPayload create() => FieldChangesetPayload._(); + FieldChangesetPayload createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static FieldChangesetPayload getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static FieldChangesetPayload? _defaultInstance; + + FieldChangesetPayload_OneOfName whichOneOfName() => _FieldChangesetPayload_OneOfNameByTag[$_whichOneof(0)]!; + void clearOneOfName() => clearField($_whichOneof(0)); + + FieldChangesetPayload_OneOfDesc whichOneOfDesc() => _FieldChangesetPayload_OneOfDescByTag[$_whichOneof(1)]!; + void clearOneOfDesc() => clearField($_whichOneof(1)); + + FieldChangesetPayload_OneOfFieldType whichOneOfFieldType() => _FieldChangesetPayload_OneOfFieldTypeByTag[$_whichOneof(2)]!; + void clearOneOfFieldType() => clearField($_whichOneof(2)); + + FieldChangesetPayload_OneOfFrozen whichOneOfFrozen() => _FieldChangesetPayload_OneOfFrozenByTag[$_whichOneof(3)]!; + void clearOneOfFrozen() => clearField($_whichOneof(3)); + + FieldChangesetPayload_OneOfVisibility whichOneOfVisibility() => _FieldChangesetPayload_OneOfVisibilityByTag[$_whichOneof(4)]!; + void clearOneOfVisibility() => clearField($_whichOneof(4)); + + FieldChangesetPayload_OneOfWidth whichOneOfWidth() => _FieldChangesetPayload_OneOfWidthByTag[$_whichOneof(5)]!; + void clearOneOfWidth() => clearField($_whichOneof(5)); + + FieldChangesetPayload_OneOfTypeOptionData whichOneOfTypeOptionData() => _FieldChangesetPayload_OneOfTypeOptionDataByTag[$_whichOneof(6)]!; + void clearOneOfTypeOptionData() => clearField($_whichOneof(6)); + + @$pb.TagNumber(1) + $core.String get fieldId => $_getSZ(0); + @$pb.TagNumber(1) + set fieldId($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasFieldId() => $_has(0); + @$pb.TagNumber(1) + void clearFieldId() => clearField(1); + + @$pb.TagNumber(2) + $core.String get gridId => $_getSZ(1); + @$pb.TagNumber(2) + set gridId($core.String v) { $_setString(1, v); } + @$pb.TagNumber(2) + $core.bool hasGridId() => $_has(1); + @$pb.TagNumber(2) + void clearGridId() => clearField(2); + + @$pb.TagNumber(3) + $core.String get name => $_getSZ(2); + @$pb.TagNumber(3) + set name($core.String v) { $_setString(2, v); } + @$pb.TagNumber(3) + $core.bool hasName() => $_has(2); + @$pb.TagNumber(3) + void clearName() => clearField(3); + + @$pb.TagNumber(4) + $core.String get desc => $_getSZ(3); + @$pb.TagNumber(4) + set desc($core.String v) { $_setString(3, v); } + @$pb.TagNumber(4) + $core.bool hasDesc() => $_has(3); + @$pb.TagNumber(4) + void clearDesc() => clearField(4); + + @$pb.TagNumber(5) + FieldType get fieldType => $_getN(4); + @$pb.TagNumber(5) + set fieldType(FieldType v) { setField(5, v); } + @$pb.TagNumber(5) + $core.bool hasFieldType() => $_has(4); + @$pb.TagNumber(5) + void clearFieldType() => clearField(5); + + @$pb.TagNumber(6) + $core.bool get frozen => $_getBF(5); + @$pb.TagNumber(6) + set frozen($core.bool v) { $_setBool(5, v); } + @$pb.TagNumber(6) + $core.bool hasFrozen() => $_has(5); + @$pb.TagNumber(6) + void clearFrozen() => clearField(6); + + @$pb.TagNumber(7) + $core.bool get visibility => $_getBF(6); + @$pb.TagNumber(7) + set visibility($core.bool v) { $_setBool(6, v); } + @$pb.TagNumber(7) + $core.bool hasVisibility() => $_has(6); + @$pb.TagNumber(7) + void clearVisibility() => clearField(7); + + @$pb.TagNumber(8) + $core.int get width => $_getIZ(7); + @$pb.TagNumber(8) + set width($core.int v) { $_setSignedInt32(7, v); } + @$pb.TagNumber(8) + $core.bool hasWidth() => $_has(7); + @$pb.TagNumber(8) + void clearWidth() => clearField(8); + + @$pb.TagNumber(9) + $core.List<$core.int> get typeOptionData => $_getN(8); + @$pb.TagNumber(9) + set typeOptionData($core.List<$core.int> v) { $_setBytes(8, v); } + @$pb.TagNumber(9) + $core.bool hasTypeOptionData() => $_has(8); + @$pb.TagNumber(9) + void clearTypeOptionData() => clearField(9); +} + +enum CellChangeset_OneOfData { + data, + notSet +} + +class CellChangeset extends $pb.GeneratedMessage { + static const $core.Map<$core.int, CellChangeset_OneOfData> _CellChangeset_OneOfDataByTag = { + 4 : CellChangeset_OneOfData.data, + 0 : CellChangeset_OneOfData.notSet + }; + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CellChangeset', createEmptyInstance: create) + ..oo(0, [4]) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'gridId') + ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'rowId') + ..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'fieldId') + ..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'data') + ..hasRequiredFields = false + ; + + CellChangeset._() : super(); + factory CellChangeset({ + $core.String? gridId, + $core.String? rowId, + $core.String? fieldId, + $core.String? data, + }) { + final _result = create(); + if (gridId != null) { + _result.gridId = gridId; + } + if (rowId != null) { + _result.rowId = rowId; + } + if (fieldId != null) { + _result.fieldId = fieldId; + } + if (data != null) { + _result.data = data; + } + return _result; + } + factory CellChangeset.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory CellChangeset.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + CellChangeset clone() => CellChangeset()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + CellChangeset copyWith(void Function(CellChangeset) updates) => super.copyWith((message) => updates(message as CellChangeset)) as CellChangeset; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static CellChangeset create() => CellChangeset._(); + CellChangeset createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static CellChangeset getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static CellChangeset? _defaultInstance; + + CellChangeset_OneOfData whichOneOfData() => _CellChangeset_OneOfDataByTag[$_whichOneof(0)]!; + void clearOneOfData() => clearField($_whichOneof(0)); + + @$pb.TagNumber(1) + $core.String get gridId => $_getSZ(0); + @$pb.TagNumber(1) + set gridId($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasGridId() => $_has(0); + @$pb.TagNumber(1) + void clearGridId() => clearField(1); + + @$pb.TagNumber(2) + $core.String get rowId => $_getSZ(1); + @$pb.TagNumber(2) + set rowId($core.String v) { $_setString(1, v); } + @$pb.TagNumber(2) + $core.bool hasRowId() => $_has(1); + @$pb.TagNumber(2) + void clearRowId() => clearField(2); + + @$pb.TagNumber(3) + $core.String get fieldId => $_getSZ(2); + @$pb.TagNumber(3) + set fieldId($core.String v) { $_setString(2, v); } + @$pb.TagNumber(3) + $core.bool hasFieldId() => $_has(2); + @$pb.TagNumber(3) + void clearFieldId() => clearField(3); + + @$pb.TagNumber(4) + $core.String get data => $_getSZ(3); + @$pb.TagNumber(4) + set data($core.String v) { $_setString(3, v); } + @$pb.TagNumber(4) + $core.bool hasData() => $_has(3); + @$pb.TagNumber(4) + void clearData() => clearField(4); +} + diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-grid-data-model/grid.pbenum.dart b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-grid-data-model/grid.pbenum.dart index 0ea2223329..661b26532c 100644 --- a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-grid-data-model/grid.pbenum.dart +++ b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-grid-data-model/grid.pbenum.dart @@ -5,3 +5,30 @@ // @dart = 2.12 // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields +// ignore_for_file: UNDEFINED_SHOWN_NAME +import 'dart:core' as $core; +import 'package:protobuf/protobuf.dart' as $pb; + +class FieldType extends $pb.ProtobufEnum { + static const FieldType RichText = FieldType._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'RichText'); + static const FieldType Number = FieldType._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'Number'); + static const FieldType DateTime = FieldType._(2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'DateTime'); + static const FieldType SingleSelect = FieldType._(3, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'SingleSelect'); + static const FieldType MultiSelect = FieldType._(4, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'MultiSelect'); + static const FieldType Checkbox = FieldType._(5, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'Checkbox'); + + static const $core.List values = [ + RichText, + Number, + DateTime, + SingleSelect, + MultiSelect, + Checkbox, + ]; + + static final $core.Map<$core.int, FieldType> _byValue = $pb.ProtobufEnum.initByValue(values); + static FieldType? valueOf($core.int value) => _byValue[value]; + + const FieldType._($core.int v, $core.String n) : super(v, n); +} + diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-grid-data-model/grid.pbjson.dart b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-grid-data-model/grid.pbjson.dart index 0a565b2b49..de56fa5748 100644 --- a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-grid-data-model/grid.pbjson.dart +++ b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-grid-data-model/grid.pbjson.dart @@ -8,6 +8,21 @@ import 'dart:core' as $core; import 'dart:convert' as $convert; import 'dart:typed_data' as $typed_data; +@$core.Deprecated('Use fieldTypeDescriptor instead') +const FieldType$json = const { + '1': 'FieldType', + '2': const [ + const {'1': 'RichText', '2': 0}, + const {'1': 'Number', '2': 1}, + const {'1': 'DateTime', '2': 2}, + const {'1': 'SingleSelect', '2': 3}, + const {'1': 'MultiSelect', '2': 4}, + const {'1': 'Checkbox', '2': 5}, + ], +}; + +/// Descriptor for `FieldType`. Decode as a `google.protobuf.EnumDescriptorProto`. +final $typed_data.Uint8List fieldTypeDescriptor = $convert.base64Decode('CglGaWVsZFR5cGUSDAoIUmljaFRleHQQABIKCgZOdW1iZXIQARIMCghEYXRlVGltZRACEhAKDFNpbmdsZVNlbGVjdBADEg8KC011bHRpU2VsZWN0EAQSDAoIQ2hlY2tib3gQBQ=='); @$core.Deprecated('Use gridDescriptor instead') const Grid$json = const { '1': 'Grid', @@ -328,3 +343,46 @@ const QueryGridBlocksPayload$json = const { /// Descriptor for `QueryGridBlocksPayload`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List queryGridBlocksPayloadDescriptor = $convert.base64Decode('ChZRdWVyeUdyaWRCbG9ja3NQYXlsb2FkEhcKB2dyaWRfaWQYASABKAlSBmdyaWRJZBIyCgxibG9ja19vcmRlcnMYAiADKAsyDy5HcmlkQmxvY2tPcmRlclILYmxvY2tPcmRlcnM='); +@$core.Deprecated('Use fieldChangesetPayloadDescriptor instead') +const FieldChangesetPayload$json = const { + '1': 'FieldChangesetPayload', + '2': const [ + const {'1': 'field_id', '3': 1, '4': 1, '5': 9, '10': 'fieldId'}, + const {'1': 'grid_id', '3': 2, '4': 1, '5': 9, '10': 'gridId'}, + const {'1': 'name', '3': 3, '4': 1, '5': 9, '9': 0, '10': 'name'}, + const {'1': 'desc', '3': 4, '4': 1, '5': 9, '9': 1, '10': 'desc'}, + const {'1': 'field_type', '3': 5, '4': 1, '5': 14, '6': '.FieldType', '9': 2, '10': 'fieldType'}, + const {'1': 'frozen', '3': 6, '4': 1, '5': 8, '9': 3, '10': 'frozen'}, + const {'1': 'visibility', '3': 7, '4': 1, '5': 8, '9': 4, '10': 'visibility'}, + const {'1': 'width', '3': 8, '4': 1, '5': 5, '9': 5, '10': 'width'}, + const {'1': 'type_option_data', '3': 9, '4': 1, '5': 12, '9': 6, '10': 'typeOptionData'}, + ], + '8': const [ + const {'1': 'one_of_name'}, + const {'1': 'one_of_desc'}, + const {'1': 'one_of_field_type'}, + const {'1': 'one_of_frozen'}, + const {'1': 'one_of_visibility'}, + const {'1': 'one_of_width'}, + const {'1': 'one_of_type_option_data'}, + ], +}; + +/// Descriptor for `FieldChangesetPayload`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List fieldChangesetPayloadDescriptor = $convert.base64Decode('ChVGaWVsZENoYW5nZXNldFBheWxvYWQSGQoIZmllbGRfaWQYASABKAlSB2ZpZWxkSWQSFwoHZ3JpZF9pZBgCIAEoCVIGZ3JpZElkEhQKBG5hbWUYAyABKAlIAFIEbmFtZRIUCgRkZXNjGAQgASgJSAFSBGRlc2MSKwoKZmllbGRfdHlwZRgFIAEoDjIKLkZpZWxkVHlwZUgCUglmaWVsZFR5cGUSGAoGZnJvemVuGAYgASgISANSBmZyb3plbhIgCgp2aXNpYmlsaXR5GAcgASgISARSCnZpc2liaWxpdHkSFgoFd2lkdGgYCCABKAVIBVIFd2lkdGgSKgoQdHlwZV9vcHRpb25fZGF0YRgJIAEoDEgGUg50eXBlT3B0aW9uRGF0YUINCgtvbmVfb2ZfbmFtZUINCgtvbmVfb2ZfZGVzY0ITChFvbmVfb2ZfZmllbGRfdHlwZUIPCg1vbmVfb2ZfZnJvemVuQhMKEW9uZV9vZl92aXNpYmlsaXR5Qg4KDG9uZV9vZl93aWR0aEIZChdvbmVfb2ZfdHlwZV9vcHRpb25fZGF0YQ=='); +@$core.Deprecated('Use cellChangesetDescriptor instead') +const CellChangeset$json = const { + '1': 'CellChangeset', + '2': const [ + const {'1': 'grid_id', '3': 1, '4': 1, '5': 9, '10': 'gridId'}, + const {'1': 'row_id', '3': 2, '4': 1, '5': 9, '10': 'rowId'}, + const {'1': 'field_id', '3': 3, '4': 1, '5': 9, '10': 'fieldId'}, + const {'1': 'data', '3': 4, '4': 1, '5': 9, '9': 0, '10': 'data'}, + ], + '8': const [ + const {'1': 'one_of_data'}, + ], +}; + +/// Descriptor for `CellChangeset`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List cellChangesetDescriptor = $convert.base64Decode('Cg1DZWxsQ2hhbmdlc2V0EhcKB2dyaWRfaWQYASABKAlSBmdyaWRJZBIVCgZyb3dfaWQYAiABKAlSBXJvd0lkEhkKCGZpZWxkX2lkGAMgASgJUgdmaWVsZElkEhQKBGRhdGEYBCABKAlIAFIEZGF0YUINCgtvbmVfb2ZfZGF0YQ=='); diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-grid-data-model/meta.pb.dart b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-grid-data-model/meta.pb.dart deleted file mode 100644 index 5ab811fa3f..0000000000 --- a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-grid-data-model/meta.pb.dart +++ /dev/null @@ -1,1086 +0,0 @@ -/// -// Generated code. Do not modify. -// source: meta.proto -// -// @dart = 2.12 -// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields - -import 'dart:core' as $core; - -import 'package:protobuf/protobuf.dart' as $pb; - -import 'meta.pbenum.dart'; - -export 'meta.pbenum.dart'; - -class GridMeta extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GridMeta', createEmptyInstance: create) - ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'gridId') - ..pc(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'fields', $pb.PbFieldType.PM, subBuilder: FieldMeta.create) - ..pc(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'blocks', $pb.PbFieldType.PM, subBuilder: GridBlockMeta.create) - ..hasRequiredFields = false - ; - - GridMeta._() : super(); - factory GridMeta({ - $core.String? gridId, - $core.Iterable? fields, - $core.Iterable? blocks, - }) { - final _result = create(); - if (gridId != null) { - _result.gridId = gridId; - } - if (fields != null) { - _result.fields.addAll(fields); - } - if (blocks != null) { - _result.blocks.addAll(blocks); - } - return _result; - } - factory GridMeta.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory GridMeta.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - GridMeta clone() => GridMeta()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - GridMeta copyWith(void Function(GridMeta) updates) => super.copyWith((message) => updates(message as GridMeta)) as GridMeta; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static GridMeta create() => GridMeta._(); - GridMeta createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static GridMeta getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static GridMeta? _defaultInstance; - - @$pb.TagNumber(1) - $core.String get gridId => $_getSZ(0); - @$pb.TagNumber(1) - set gridId($core.String v) { $_setString(0, v); } - @$pb.TagNumber(1) - $core.bool hasGridId() => $_has(0); - @$pb.TagNumber(1) - void clearGridId() => clearField(1); - - @$pb.TagNumber(2) - $core.List get fields => $_getList(1); - - @$pb.TagNumber(3) - $core.List get blocks => $_getList(2); -} - -class GridBlockMeta extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GridBlockMeta', createEmptyInstance: create) - ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'blockId') - ..a<$core.int>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'startRowIndex', $pb.PbFieldType.O3) - ..a<$core.int>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'rowCount', $pb.PbFieldType.O3) - ..hasRequiredFields = false - ; - - GridBlockMeta._() : super(); - factory GridBlockMeta({ - $core.String? blockId, - $core.int? startRowIndex, - $core.int? rowCount, - }) { - final _result = create(); - if (blockId != null) { - _result.blockId = blockId; - } - if (startRowIndex != null) { - _result.startRowIndex = startRowIndex; - } - if (rowCount != null) { - _result.rowCount = rowCount; - } - return _result; - } - factory GridBlockMeta.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory GridBlockMeta.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - GridBlockMeta clone() => GridBlockMeta()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - GridBlockMeta copyWith(void Function(GridBlockMeta) updates) => super.copyWith((message) => updates(message as GridBlockMeta)) as GridBlockMeta; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static GridBlockMeta create() => GridBlockMeta._(); - GridBlockMeta createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static GridBlockMeta getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static GridBlockMeta? _defaultInstance; - - @$pb.TagNumber(1) - $core.String get blockId => $_getSZ(0); - @$pb.TagNumber(1) - set blockId($core.String v) { $_setString(0, v); } - @$pb.TagNumber(1) - $core.bool hasBlockId() => $_has(0); - @$pb.TagNumber(1) - void clearBlockId() => clearField(1); - - @$pb.TagNumber(2) - $core.int get startRowIndex => $_getIZ(1); - @$pb.TagNumber(2) - set startRowIndex($core.int v) { $_setSignedInt32(1, v); } - @$pb.TagNumber(2) - $core.bool hasStartRowIndex() => $_has(1); - @$pb.TagNumber(2) - void clearStartRowIndex() => clearField(2); - - @$pb.TagNumber(3) - $core.int get rowCount => $_getIZ(2); - @$pb.TagNumber(3) - set rowCount($core.int v) { $_setSignedInt32(2, v); } - @$pb.TagNumber(3) - $core.bool hasRowCount() => $_has(2); - @$pb.TagNumber(3) - void clearRowCount() => clearField(3); -} - -class GridBlockMetaData extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GridBlockMetaData', createEmptyInstance: create) - ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'blockId') - ..pc(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'rows', $pb.PbFieldType.PM, subBuilder: RowMeta.create) - ..hasRequiredFields = false - ; - - GridBlockMetaData._() : super(); - factory GridBlockMetaData({ - $core.String? blockId, - $core.Iterable? rows, - }) { - final _result = create(); - if (blockId != null) { - _result.blockId = blockId; - } - if (rows != null) { - _result.rows.addAll(rows); - } - return _result; - } - factory GridBlockMetaData.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory GridBlockMetaData.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - GridBlockMetaData clone() => GridBlockMetaData()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - GridBlockMetaData copyWith(void Function(GridBlockMetaData) updates) => super.copyWith((message) => updates(message as GridBlockMetaData)) as GridBlockMetaData; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static GridBlockMetaData create() => GridBlockMetaData._(); - GridBlockMetaData createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static GridBlockMetaData getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static GridBlockMetaData? _defaultInstance; - - @$pb.TagNumber(1) - $core.String get blockId => $_getSZ(0); - @$pb.TagNumber(1) - set blockId($core.String v) { $_setString(0, v); } - @$pb.TagNumber(1) - $core.bool hasBlockId() => $_has(0); - @$pb.TagNumber(1) - void clearBlockId() => clearField(1); - - @$pb.TagNumber(2) - $core.List get rows => $_getList(1); -} - -class FieldMeta extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'FieldMeta', createEmptyInstance: create) - ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'id') - ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name') - ..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'desc') - ..e(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'fieldType', $pb.PbFieldType.OE, defaultOrMaker: FieldType.RichText, valueOf: FieldType.valueOf, enumValues: FieldType.values) - ..aOB(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'frozen') - ..aOB(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'visibility') - ..a<$core.int>(7, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'width', $pb.PbFieldType.O3) - ..m<$core.String, $core.String>(8, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'typeOptions', entryClassName: 'FieldMeta.TypeOptionsEntry', keyFieldType: $pb.PbFieldType.OS, valueFieldType: $pb.PbFieldType.OS) - ..hasRequiredFields = false - ; - - FieldMeta._() : super(); - factory FieldMeta({ - $core.String? id, - $core.String? name, - $core.String? desc, - FieldType? fieldType, - $core.bool? frozen, - $core.bool? visibility, - $core.int? width, - $core.Map<$core.String, $core.String>? typeOptions, - }) { - final _result = create(); - if (id != null) { - _result.id = id; - } - if (name != null) { - _result.name = name; - } - if (desc != null) { - _result.desc = desc; - } - if (fieldType != null) { - _result.fieldType = fieldType; - } - if (frozen != null) { - _result.frozen = frozen; - } - if (visibility != null) { - _result.visibility = visibility; - } - if (width != null) { - _result.width = width; - } - if (typeOptions != null) { - _result.typeOptions.addAll(typeOptions); - } - return _result; - } - factory FieldMeta.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory FieldMeta.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - FieldMeta clone() => FieldMeta()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - FieldMeta copyWith(void Function(FieldMeta) updates) => super.copyWith((message) => updates(message as FieldMeta)) as FieldMeta; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static FieldMeta create() => FieldMeta._(); - FieldMeta createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static FieldMeta getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static FieldMeta? _defaultInstance; - - @$pb.TagNumber(1) - $core.String get id => $_getSZ(0); - @$pb.TagNumber(1) - set id($core.String v) { $_setString(0, v); } - @$pb.TagNumber(1) - $core.bool hasId() => $_has(0); - @$pb.TagNumber(1) - void clearId() => clearField(1); - - @$pb.TagNumber(2) - $core.String get name => $_getSZ(1); - @$pb.TagNumber(2) - set name($core.String v) { $_setString(1, v); } - @$pb.TagNumber(2) - $core.bool hasName() => $_has(1); - @$pb.TagNumber(2) - void clearName() => clearField(2); - - @$pb.TagNumber(3) - $core.String get desc => $_getSZ(2); - @$pb.TagNumber(3) - set desc($core.String v) { $_setString(2, v); } - @$pb.TagNumber(3) - $core.bool hasDesc() => $_has(2); - @$pb.TagNumber(3) - void clearDesc() => clearField(3); - - @$pb.TagNumber(4) - FieldType get fieldType => $_getN(3); - @$pb.TagNumber(4) - set fieldType(FieldType v) { setField(4, v); } - @$pb.TagNumber(4) - $core.bool hasFieldType() => $_has(3); - @$pb.TagNumber(4) - void clearFieldType() => clearField(4); - - @$pb.TagNumber(5) - $core.bool get frozen => $_getBF(4); - @$pb.TagNumber(5) - set frozen($core.bool v) { $_setBool(4, v); } - @$pb.TagNumber(5) - $core.bool hasFrozen() => $_has(4); - @$pb.TagNumber(5) - void clearFrozen() => clearField(5); - - @$pb.TagNumber(6) - $core.bool get visibility => $_getBF(5); - @$pb.TagNumber(6) - set visibility($core.bool v) { $_setBool(5, v); } - @$pb.TagNumber(6) - $core.bool hasVisibility() => $_has(5); - @$pb.TagNumber(6) - void clearVisibility() => clearField(6); - - @$pb.TagNumber(7) - $core.int get width => $_getIZ(6); - @$pb.TagNumber(7) - set width($core.int v) { $_setSignedInt32(6, v); } - @$pb.TagNumber(7) - $core.bool hasWidth() => $_has(6); - @$pb.TagNumber(7) - void clearWidth() => clearField(7); - - @$pb.TagNumber(8) - $core.Map<$core.String, $core.String> get typeOptions => $_getMap(7); -} - -enum FieldChangesetPayload_OneOfName { - name, - notSet -} - -enum FieldChangesetPayload_OneOfDesc { - desc, - notSet -} - -enum FieldChangesetPayload_OneOfFieldType { - fieldType, - notSet -} - -enum FieldChangesetPayload_OneOfFrozen { - frozen, - notSet -} - -enum FieldChangesetPayload_OneOfVisibility { - visibility, - notSet -} - -enum FieldChangesetPayload_OneOfWidth { - width, - notSet -} - -enum FieldChangesetPayload_OneOfTypeOptionData { - typeOptionData, - notSet -} - -class FieldChangesetPayload extends $pb.GeneratedMessage { - static const $core.Map<$core.int, FieldChangesetPayload_OneOfName> _FieldChangesetPayload_OneOfNameByTag = { - 3 : FieldChangesetPayload_OneOfName.name, - 0 : FieldChangesetPayload_OneOfName.notSet - }; - static const $core.Map<$core.int, FieldChangesetPayload_OneOfDesc> _FieldChangesetPayload_OneOfDescByTag = { - 4 : FieldChangesetPayload_OneOfDesc.desc, - 0 : FieldChangesetPayload_OneOfDesc.notSet - }; - static const $core.Map<$core.int, FieldChangesetPayload_OneOfFieldType> _FieldChangesetPayload_OneOfFieldTypeByTag = { - 5 : FieldChangesetPayload_OneOfFieldType.fieldType, - 0 : FieldChangesetPayload_OneOfFieldType.notSet - }; - static const $core.Map<$core.int, FieldChangesetPayload_OneOfFrozen> _FieldChangesetPayload_OneOfFrozenByTag = { - 6 : FieldChangesetPayload_OneOfFrozen.frozen, - 0 : FieldChangesetPayload_OneOfFrozen.notSet - }; - static const $core.Map<$core.int, FieldChangesetPayload_OneOfVisibility> _FieldChangesetPayload_OneOfVisibilityByTag = { - 7 : FieldChangesetPayload_OneOfVisibility.visibility, - 0 : FieldChangesetPayload_OneOfVisibility.notSet - }; - static const $core.Map<$core.int, FieldChangesetPayload_OneOfWidth> _FieldChangesetPayload_OneOfWidthByTag = { - 8 : FieldChangesetPayload_OneOfWidth.width, - 0 : FieldChangesetPayload_OneOfWidth.notSet - }; - static const $core.Map<$core.int, FieldChangesetPayload_OneOfTypeOptionData> _FieldChangesetPayload_OneOfTypeOptionDataByTag = { - 9 : FieldChangesetPayload_OneOfTypeOptionData.typeOptionData, - 0 : FieldChangesetPayload_OneOfTypeOptionData.notSet - }; - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'FieldChangesetPayload', createEmptyInstance: create) - ..oo(0, [3]) - ..oo(1, [4]) - ..oo(2, [5]) - ..oo(3, [6]) - ..oo(4, [7]) - ..oo(5, [8]) - ..oo(6, [9]) - ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'fieldId') - ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'gridId') - ..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name') - ..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'desc') - ..e(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'fieldType', $pb.PbFieldType.OE, defaultOrMaker: FieldType.RichText, valueOf: FieldType.valueOf, enumValues: FieldType.values) - ..aOB(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'frozen') - ..aOB(7, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'visibility') - ..a<$core.int>(8, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'width', $pb.PbFieldType.O3) - ..a<$core.List<$core.int>>(9, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'typeOptionData', $pb.PbFieldType.OY) - ..hasRequiredFields = false - ; - - FieldChangesetPayload._() : super(); - factory FieldChangesetPayload({ - $core.String? fieldId, - $core.String? gridId, - $core.String? name, - $core.String? desc, - FieldType? fieldType, - $core.bool? frozen, - $core.bool? visibility, - $core.int? width, - $core.List<$core.int>? typeOptionData, - }) { - final _result = create(); - if (fieldId != null) { - _result.fieldId = fieldId; - } - if (gridId != null) { - _result.gridId = gridId; - } - if (name != null) { - _result.name = name; - } - if (desc != null) { - _result.desc = desc; - } - if (fieldType != null) { - _result.fieldType = fieldType; - } - if (frozen != null) { - _result.frozen = frozen; - } - if (visibility != null) { - _result.visibility = visibility; - } - if (width != null) { - _result.width = width; - } - if (typeOptionData != null) { - _result.typeOptionData = typeOptionData; - } - return _result; - } - factory FieldChangesetPayload.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory FieldChangesetPayload.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - FieldChangesetPayload clone() => FieldChangesetPayload()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - FieldChangesetPayload copyWith(void Function(FieldChangesetPayload) updates) => super.copyWith((message) => updates(message as FieldChangesetPayload)) as FieldChangesetPayload; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static FieldChangesetPayload create() => FieldChangesetPayload._(); - FieldChangesetPayload createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static FieldChangesetPayload getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static FieldChangesetPayload? _defaultInstance; - - FieldChangesetPayload_OneOfName whichOneOfName() => _FieldChangesetPayload_OneOfNameByTag[$_whichOneof(0)]!; - void clearOneOfName() => clearField($_whichOneof(0)); - - FieldChangesetPayload_OneOfDesc whichOneOfDesc() => _FieldChangesetPayload_OneOfDescByTag[$_whichOneof(1)]!; - void clearOneOfDesc() => clearField($_whichOneof(1)); - - FieldChangesetPayload_OneOfFieldType whichOneOfFieldType() => _FieldChangesetPayload_OneOfFieldTypeByTag[$_whichOneof(2)]!; - void clearOneOfFieldType() => clearField($_whichOneof(2)); - - FieldChangesetPayload_OneOfFrozen whichOneOfFrozen() => _FieldChangesetPayload_OneOfFrozenByTag[$_whichOneof(3)]!; - void clearOneOfFrozen() => clearField($_whichOneof(3)); - - FieldChangesetPayload_OneOfVisibility whichOneOfVisibility() => _FieldChangesetPayload_OneOfVisibilityByTag[$_whichOneof(4)]!; - void clearOneOfVisibility() => clearField($_whichOneof(4)); - - FieldChangesetPayload_OneOfWidth whichOneOfWidth() => _FieldChangesetPayload_OneOfWidthByTag[$_whichOneof(5)]!; - void clearOneOfWidth() => clearField($_whichOneof(5)); - - FieldChangesetPayload_OneOfTypeOptionData whichOneOfTypeOptionData() => _FieldChangesetPayload_OneOfTypeOptionDataByTag[$_whichOneof(6)]!; - void clearOneOfTypeOptionData() => clearField($_whichOneof(6)); - - @$pb.TagNumber(1) - $core.String get fieldId => $_getSZ(0); - @$pb.TagNumber(1) - set fieldId($core.String v) { $_setString(0, v); } - @$pb.TagNumber(1) - $core.bool hasFieldId() => $_has(0); - @$pb.TagNumber(1) - void clearFieldId() => clearField(1); - - @$pb.TagNumber(2) - $core.String get gridId => $_getSZ(1); - @$pb.TagNumber(2) - set gridId($core.String v) { $_setString(1, v); } - @$pb.TagNumber(2) - $core.bool hasGridId() => $_has(1); - @$pb.TagNumber(2) - void clearGridId() => clearField(2); - - @$pb.TagNumber(3) - $core.String get name => $_getSZ(2); - @$pb.TagNumber(3) - set name($core.String v) { $_setString(2, v); } - @$pb.TagNumber(3) - $core.bool hasName() => $_has(2); - @$pb.TagNumber(3) - void clearName() => clearField(3); - - @$pb.TagNumber(4) - $core.String get desc => $_getSZ(3); - @$pb.TagNumber(4) - set desc($core.String v) { $_setString(3, v); } - @$pb.TagNumber(4) - $core.bool hasDesc() => $_has(3); - @$pb.TagNumber(4) - void clearDesc() => clearField(4); - - @$pb.TagNumber(5) - FieldType get fieldType => $_getN(4); - @$pb.TagNumber(5) - set fieldType(FieldType v) { setField(5, v); } - @$pb.TagNumber(5) - $core.bool hasFieldType() => $_has(4); - @$pb.TagNumber(5) - void clearFieldType() => clearField(5); - - @$pb.TagNumber(6) - $core.bool get frozen => $_getBF(5); - @$pb.TagNumber(6) - set frozen($core.bool v) { $_setBool(5, v); } - @$pb.TagNumber(6) - $core.bool hasFrozen() => $_has(5); - @$pb.TagNumber(6) - void clearFrozen() => clearField(6); - - @$pb.TagNumber(7) - $core.bool get visibility => $_getBF(6); - @$pb.TagNumber(7) - set visibility($core.bool v) { $_setBool(6, v); } - @$pb.TagNumber(7) - $core.bool hasVisibility() => $_has(6); - @$pb.TagNumber(7) - void clearVisibility() => clearField(7); - - @$pb.TagNumber(8) - $core.int get width => $_getIZ(7); - @$pb.TagNumber(8) - set width($core.int v) { $_setSignedInt32(7, v); } - @$pb.TagNumber(8) - $core.bool hasWidth() => $_has(7); - @$pb.TagNumber(8) - void clearWidth() => clearField(8); - - @$pb.TagNumber(9) - $core.List<$core.int> get typeOptionData => $_getN(8); - @$pb.TagNumber(9) - set typeOptionData($core.List<$core.int> v) { $_setBytes(8, v); } - @$pb.TagNumber(9) - $core.bool hasTypeOptionData() => $_has(8); - @$pb.TagNumber(9) - void clearTypeOptionData() => clearField(9); -} - -class AnyData extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'AnyData', createEmptyInstance: create) - ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'typeId') - ..a<$core.List<$core.int>>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'value', $pb.PbFieldType.OY) - ..hasRequiredFields = false - ; - - AnyData._() : super(); - factory AnyData({ - $core.String? typeId, - $core.List<$core.int>? value, - }) { - final _result = create(); - if (typeId != null) { - _result.typeId = typeId; - } - if (value != null) { - _result.value = value; - } - return _result; - } - factory AnyData.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory AnyData.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - AnyData clone() => AnyData()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - AnyData copyWith(void Function(AnyData) updates) => super.copyWith((message) => updates(message as AnyData)) as AnyData; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static AnyData create() => AnyData._(); - AnyData createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static AnyData getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static AnyData? _defaultInstance; - - @$pb.TagNumber(1) - $core.String get typeId => $_getSZ(0); - @$pb.TagNumber(1) - set typeId($core.String v) { $_setString(0, v); } - @$pb.TagNumber(1) - $core.bool hasTypeId() => $_has(0); - @$pb.TagNumber(1) - void clearTypeId() => clearField(1); - - @$pb.TagNumber(2) - $core.List<$core.int> get value => $_getN(1); - @$pb.TagNumber(2) - set value($core.List<$core.int> v) { $_setBytes(1, v); } - @$pb.TagNumber(2) - $core.bool hasValue() => $_has(1); - @$pb.TagNumber(2) - void clearValue() => clearField(2); -} - -class RowMeta extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'RowMeta', createEmptyInstance: create) - ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'id') - ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'blockId') - ..m<$core.String, CellMeta>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'cells', entryClassName: 'RowMeta.CellsEntry', keyFieldType: $pb.PbFieldType.OS, valueFieldType: $pb.PbFieldType.OM, valueCreator: CellMeta.create) - ..a<$core.int>(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'height', $pb.PbFieldType.O3) - ..aOB(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'visibility') - ..hasRequiredFields = false - ; - - RowMeta._() : super(); - factory RowMeta({ - $core.String? id, - $core.String? blockId, - $core.Map<$core.String, CellMeta>? cells, - $core.int? height, - $core.bool? visibility, - }) { - final _result = create(); - if (id != null) { - _result.id = id; - } - if (blockId != null) { - _result.blockId = blockId; - } - if (cells != null) { - _result.cells.addAll(cells); - } - if (height != null) { - _result.height = height; - } - if (visibility != null) { - _result.visibility = visibility; - } - return _result; - } - factory RowMeta.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory RowMeta.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - RowMeta clone() => RowMeta()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - RowMeta copyWith(void Function(RowMeta) updates) => super.copyWith((message) => updates(message as RowMeta)) as RowMeta; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static RowMeta create() => RowMeta._(); - RowMeta createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static RowMeta getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static RowMeta? _defaultInstance; - - @$pb.TagNumber(1) - $core.String get id => $_getSZ(0); - @$pb.TagNumber(1) - set id($core.String v) { $_setString(0, v); } - @$pb.TagNumber(1) - $core.bool hasId() => $_has(0); - @$pb.TagNumber(1) - void clearId() => clearField(1); - - @$pb.TagNumber(2) - $core.String get blockId => $_getSZ(1); - @$pb.TagNumber(2) - set blockId($core.String v) { $_setString(1, v); } - @$pb.TagNumber(2) - $core.bool hasBlockId() => $_has(1); - @$pb.TagNumber(2) - void clearBlockId() => clearField(2); - - @$pb.TagNumber(3) - $core.Map<$core.String, CellMeta> get cells => $_getMap(2); - - @$pb.TagNumber(4) - $core.int get height => $_getIZ(3); - @$pb.TagNumber(4) - set height($core.int v) { $_setSignedInt32(3, v); } - @$pb.TagNumber(4) - $core.bool hasHeight() => $_has(3); - @$pb.TagNumber(4) - void clearHeight() => clearField(4); - - @$pb.TagNumber(5) - $core.bool get visibility => $_getBF(4); - @$pb.TagNumber(5) - set visibility($core.bool v) { $_setBool(4, v); } - @$pb.TagNumber(5) - $core.bool hasVisibility() => $_has(4); - @$pb.TagNumber(5) - void clearVisibility() => clearField(5); -} - -enum RowMetaChangeset_OneOfHeight { - height, - notSet -} - -enum RowMetaChangeset_OneOfVisibility { - visibility, - notSet -} - -class RowMetaChangeset extends $pb.GeneratedMessage { - static const $core.Map<$core.int, RowMetaChangeset_OneOfHeight> _RowMetaChangeset_OneOfHeightByTag = { - 2 : RowMetaChangeset_OneOfHeight.height, - 0 : RowMetaChangeset_OneOfHeight.notSet - }; - static const $core.Map<$core.int, RowMetaChangeset_OneOfVisibility> _RowMetaChangeset_OneOfVisibilityByTag = { - 3 : RowMetaChangeset_OneOfVisibility.visibility, - 0 : RowMetaChangeset_OneOfVisibility.notSet - }; - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'RowMetaChangeset', createEmptyInstance: create) - ..oo(0, [2]) - ..oo(1, [3]) - ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'rowId') - ..a<$core.int>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'height', $pb.PbFieldType.O3) - ..aOB(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'visibility') - ..m<$core.String, CellMeta>(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'cellByFieldId', entryClassName: 'RowMetaChangeset.CellByFieldIdEntry', keyFieldType: $pb.PbFieldType.OS, valueFieldType: $pb.PbFieldType.OM, valueCreator: CellMeta.create) - ..hasRequiredFields = false - ; - - RowMetaChangeset._() : super(); - factory RowMetaChangeset({ - $core.String? rowId, - $core.int? height, - $core.bool? visibility, - $core.Map<$core.String, CellMeta>? cellByFieldId, - }) { - final _result = create(); - if (rowId != null) { - _result.rowId = rowId; - } - if (height != null) { - _result.height = height; - } - if (visibility != null) { - _result.visibility = visibility; - } - if (cellByFieldId != null) { - _result.cellByFieldId.addAll(cellByFieldId); - } - return _result; - } - factory RowMetaChangeset.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory RowMetaChangeset.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - RowMetaChangeset clone() => RowMetaChangeset()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - RowMetaChangeset copyWith(void Function(RowMetaChangeset) updates) => super.copyWith((message) => updates(message as RowMetaChangeset)) as RowMetaChangeset; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static RowMetaChangeset create() => RowMetaChangeset._(); - RowMetaChangeset createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static RowMetaChangeset getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static RowMetaChangeset? _defaultInstance; - - RowMetaChangeset_OneOfHeight whichOneOfHeight() => _RowMetaChangeset_OneOfHeightByTag[$_whichOneof(0)]!; - void clearOneOfHeight() => clearField($_whichOneof(0)); - - RowMetaChangeset_OneOfVisibility whichOneOfVisibility() => _RowMetaChangeset_OneOfVisibilityByTag[$_whichOneof(1)]!; - void clearOneOfVisibility() => clearField($_whichOneof(1)); - - @$pb.TagNumber(1) - $core.String get rowId => $_getSZ(0); - @$pb.TagNumber(1) - set rowId($core.String v) { $_setString(0, v); } - @$pb.TagNumber(1) - $core.bool hasRowId() => $_has(0); - @$pb.TagNumber(1) - void clearRowId() => clearField(1); - - @$pb.TagNumber(2) - $core.int get height => $_getIZ(1); - @$pb.TagNumber(2) - set height($core.int v) { $_setSignedInt32(1, v); } - @$pb.TagNumber(2) - $core.bool hasHeight() => $_has(1); - @$pb.TagNumber(2) - void clearHeight() => clearField(2); - - @$pb.TagNumber(3) - $core.bool get visibility => $_getBF(2); - @$pb.TagNumber(3) - set visibility($core.bool v) { $_setBool(2, v); } - @$pb.TagNumber(3) - $core.bool hasVisibility() => $_has(2); - @$pb.TagNumber(3) - void clearVisibility() => clearField(3); - - @$pb.TagNumber(4) - $core.Map<$core.String, CellMeta> get cellByFieldId => $_getMap(3); -} - -class CellMeta extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CellMeta', createEmptyInstance: create) - ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'data') - ..hasRequiredFields = false - ; - - CellMeta._() : super(); - factory CellMeta({ - $core.String? data, - }) { - final _result = create(); - if (data != null) { - _result.data = data; - } - return _result; - } - factory CellMeta.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory CellMeta.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - CellMeta clone() => CellMeta()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - CellMeta copyWith(void Function(CellMeta) updates) => super.copyWith((message) => updates(message as CellMeta)) as CellMeta; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static CellMeta create() => CellMeta._(); - CellMeta createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static CellMeta getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static CellMeta? _defaultInstance; - - @$pb.TagNumber(1) - $core.String get data => $_getSZ(0); - @$pb.TagNumber(1) - set data($core.String v) { $_setString(0, v); } - @$pb.TagNumber(1) - $core.bool hasData() => $_has(0); - @$pb.TagNumber(1) - void clearData() => clearField(1); -} - -enum CellMetaChangeset_OneOfData { - data, - notSet -} - -class CellMetaChangeset extends $pb.GeneratedMessage { - static const $core.Map<$core.int, CellMetaChangeset_OneOfData> _CellMetaChangeset_OneOfDataByTag = { - 4 : CellMetaChangeset_OneOfData.data, - 0 : CellMetaChangeset_OneOfData.notSet - }; - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CellMetaChangeset', createEmptyInstance: create) - ..oo(0, [4]) - ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'gridId') - ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'rowId') - ..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'fieldId') - ..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'data') - ..hasRequiredFields = false - ; - - CellMetaChangeset._() : super(); - factory CellMetaChangeset({ - $core.String? gridId, - $core.String? rowId, - $core.String? fieldId, - $core.String? data, - }) { - final _result = create(); - if (gridId != null) { - _result.gridId = gridId; - } - if (rowId != null) { - _result.rowId = rowId; - } - if (fieldId != null) { - _result.fieldId = fieldId; - } - if (data != null) { - _result.data = data; - } - return _result; - } - factory CellMetaChangeset.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory CellMetaChangeset.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - CellMetaChangeset clone() => CellMetaChangeset()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - CellMetaChangeset copyWith(void Function(CellMetaChangeset) updates) => super.copyWith((message) => updates(message as CellMetaChangeset)) as CellMetaChangeset; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static CellMetaChangeset create() => CellMetaChangeset._(); - CellMetaChangeset createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static CellMetaChangeset getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static CellMetaChangeset? _defaultInstance; - - CellMetaChangeset_OneOfData whichOneOfData() => _CellMetaChangeset_OneOfDataByTag[$_whichOneof(0)]!; - void clearOneOfData() => clearField($_whichOneof(0)); - - @$pb.TagNumber(1) - $core.String get gridId => $_getSZ(0); - @$pb.TagNumber(1) - set gridId($core.String v) { $_setString(0, v); } - @$pb.TagNumber(1) - $core.bool hasGridId() => $_has(0); - @$pb.TagNumber(1) - void clearGridId() => clearField(1); - - @$pb.TagNumber(2) - $core.String get rowId => $_getSZ(1); - @$pb.TagNumber(2) - set rowId($core.String v) { $_setString(1, v); } - @$pb.TagNumber(2) - $core.bool hasRowId() => $_has(1); - @$pb.TagNumber(2) - void clearRowId() => clearField(2); - - @$pb.TagNumber(3) - $core.String get fieldId => $_getSZ(2); - @$pb.TagNumber(3) - set fieldId($core.String v) { $_setString(2, v); } - @$pb.TagNumber(3) - $core.bool hasFieldId() => $_has(2); - @$pb.TagNumber(3) - void clearFieldId() => clearField(3); - - @$pb.TagNumber(4) - $core.String get data => $_getSZ(3); - @$pb.TagNumber(4) - set data($core.String v) { $_setString(3, v); } - @$pb.TagNumber(4) - $core.bool hasData() => $_has(3); - @$pb.TagNumber(4) - void clearData() => clearField(4); -} - -class BuildGridContext extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'BuildGridContext', createEmptyInstance: create) - ..pc(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'fieldMetas', $pb.PbFieldType.PM, subBuilder: FieldMeta.create) - ..aOM(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'blockMeta', subBuilder: GridBlockMeta.create) - ..aOM(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'blockMetaData', subBuilder: GridBlockMetaData.create) - ..hasRequiredFields = false - ; - - BuildGridContext._() : super(); - factory BuildGridContext({ - $core.Iterable? fieldMetas, - GridBlockMeta? blockMeta, - GridBlockMetaData? blockMetaData, - }) { - final _result = create(); - if (fieldMetas != null) { - _result.fieldMetas.addAll(fieldMetas); - } - if (blockMeta != null) { - _result.blockMeta = blockMeta; - } - if (blockMetaData != null) { - _result.blockMetaData = blockMetaData; - } - return _result; - } - factory BuildGridContext.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory BuildGridContext.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - BuildGridContext clone() => BuildGridContext()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - BuildGridContext copyWith(void Function(BuildGridContext) updates) => super.copyWith((message) => updates(message as BuildGridContext)) as BuildGridContext; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static BuildGridContext create() => BuildGridContext._(); - BuildGridContext createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static BuildGridContext getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static BuildGridContext? _defaultInstance; - - @$pb.TagNumber(1) - $core.List get fieldMetas => $_getList(0); - - @$pb.TagNumber(2) - GridBlockMeta get blockMeta => $_getN(1); - @$pb.TagNumber(2) - set blockMeta(GridBlockMeta v) { setField(2, v); } - @$pb.TagNumber(2) - $core.bool hasBlockMeta() => $_has(1); - @$pb.TagNumber(2) - void clearBlockMeta() => clearField(2); - @$pb.TagNumber(2) - GridBlockMeta ensureBlockMeta() => $_ensure(1); - - @$pb.TagNumber(3) - GridBlockMetaData get blockMetaData => $_getN(2); - @$pb.TagNumber(3) - set blockMetaData(GridBlockMetaData v) { setField(3, v); } - @$pb.TagNumber(3) - $core.bool hasBlockMetaData() => $_has(2); - @$pb.TagNumber(3) - void clearBlockMetaData() => clearField(3); - @$pb.TagNumber(3) - GridBlockMetaData ensureBlockMetaData() => $_ensure(2); -} - diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-grid-data-model/meta.pbenum.dart b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-grid-data-model/meta.pbenum.dart deleted file mode 100644 index 2bb3da475b..0000000000 --- a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-grid-data-model/meta.pbenum.dart +++ /dev/null @@ -1,34 +0,0 @@ -/// -// Generated code. Do not modify. -// source: meta.proto -// -// @dart = 2.12 -// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields - -// ignore_for_file: UNDEFINED_SHOWN_NAME -import 'dart:core' as $core; -import 'package:protobuf/protobuf.dart' as $pb; - -class FieldType extends $pb.ProtobufEnum { - static const FieldType RichText = FieldType._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'RichText'); - static const FieldType Number = FieldType._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'Number'); - static const FieldType DateTime = FieldType._(2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'DateTime'); - static const FieldType SingleSelect = FieldType._(3, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'SingleSelect'); - static const FieldType MultiSelect = FieldType._(4, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'MultiSelect'); - static const FieldType Checkbox = FieldType._(5, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'Checkbox'); - - static const $core.List values = [ - RichText, - Number, - DateTime, - SingleSelect, - MultiSelect, - Checkbox, - ]; - - static final $core.Map<$core.int, FieldType> _byValue = $pb.ProtobufEnum.initByValue(values); - static FieldType? valueOf($core.int value) => _byValue[value]; - - const FieldType._($core.int v, $core.String n) : super(v, n); -} - diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-grid-data-model/meta.pbjson.dart b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-grid-data-model/meta.pbjson.dart deleted file mode 100644 index 8e73d2ce1c..0000000000 --- a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-grid-data-model/meta.pbjson.dart +++ /dev/null @@ -1,217 +0,0 @@ -/// -// Generated code. Do not modify. -// source: meta.proto -// -// @dart = 2.12 -// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package - -import 'dart:core' as $core; -import 'dart:convert' as $convert; -import 'dart:typed_data' as $typed_data; -@$core.Deprecated('Use fieldTypeDescriptor instead') -const FieldType$json = const { - '1': 'FieldType', - '2': const [ - const {'1': 'RichText', '2': 0}, - const {'1': 'Number', '2': 1}, - const {'1': 'DateTime', '2': 2}, - const {'1': 'SingleSelect', '2': 3}, - const {'1': 'MultiSelect', '2': 4}, - const {'1': 'Checkbox', '2': 5}, - ], -}; - -/// Descriptor for `FieldType`. Decode as a `google.protobuf.EnumDescriptorProto`. -final $typed_data.Uint8List fieldTypeDescriptor = $convert.base64Decode('CglGaWVsZFR5cGUSDAoIUmljaFRleHQQABIKCgZOdW1iZXIQARIMCghEYXRlVGltZRACEhAKDFNpbmdsZVNlbGVjdBADEg8KC011bHRpU2VsZWN0EAQSDAoIQ2hlY2tib3gQBQ=='); -@$core.Deprecated('Use gridMetaDescriptor instead') -const GridMeta$json = const { - '1': 'GridMeta', - '2': const [ - const {'1': 'grid_id', '3': 1, '4': 1, '5': 9, '10': 'gridId'}, - const {'1': 'fields', '3': 2, '4': 3, '5': 11, '6': '.FieldMeta', '10': 'fields'}, - const {'1': 'blocks', '3': 3, '4': 3, '5': 11, '6': '.GridBlockMeta', '10': 'blocks'}, - ], -}; - -/// Descriptor for `GridMeta`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List gridMetaDescriptor = $convert.base64Decode('CghHcmlkTWV0YRIXCgdncmlkX2lkGAEgASgJUgZncmlkSWQSIgoGZmllbGRzGAIgAygLMgouRmllbGRNZXRhUgZmaWVsZHMSJgoGYmxvY2tzGAMgAygLMg4uR3JpZEJsb2NrTWV0YVIGYmxvY2tz'); -@$core.Deprecated('Use gridBlockMetaDescriptor instead') -const GridBlockMeta$json = const { - '1': 'GridBlockMeta', - '2': const [ - const {'1': 'block_id', '3': 1, '4': 1, '5': 9, '10': 'blockId'}, - const {'1': 'start_row_index', '3': 2, '4': 1, '5': 5, '10': 'startRowIndex'}, - const {'1': 'row_count', '3': 3, '4': 1, '5': 5, '10': 'rowCount'}, - ], -}; - -/// Descriptor for `GridBlockMeta`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List gridBlockMetaDescriptor = $convert.base64Decode('Cg1HcmlkQmxvY2tNZXRhEhkKCGJsb2NrX2lkGAEgASgJUgdibG9ja0lkEiYKD3N0YXJ0X3Jvd19pbmRleBgCIAEoBVINc3RhcnRSb3dJbmRleBIbCglyb3dfY291bnQYAyABKAVSCHJvd0NvdW50'); -@$core.Deprecated('Use gridBlockMetaDataDescriptor instead') -const GridBlockMetaData$json = const { - '1': 'GridBlockMetaData', - '2': const [ - const {'1': 'block_id', '3': 1, '4': 1, '5': 9, '10': 'blockId'}, - const {'1': 'rows', '3': 2, '4': 3, '5': 11, '6': '.RowMeta', '10': 'rows'}, - ], -}; - -/// Descriptor for `GridBlockMetaData`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List gridBlockMetaDataDescriptor = $convert.base64Decode('ChFHcmlkQmxvY2tNZXRhRGF0YRIZCghibG9ja19pZBgBIAEoCVIHYmxvY2tJZBIcCgRyb3dzGAIgAygLMgguUm93TWV0YVIEcm93cw=='); -@$core.Deprecated('Use fieldMetaDescriptor instead') -const FieldMeta$json = const { - '1': 'FieldMeta', - '2': const [ - const {'1': 'id', '3': 1, '4': 1, '5': 9, '10': 'id'}, - const {'1': 'name', '3': 2, '4': 1, '5': 9, '10': 'name'}, - const {'1': 'desc', '3': 3, '4': 1, '5': 9, '10': 'desc'}, - const {'1': 'field_type', '3': 4, '4': 1, '5': 14, '6': '.FieldType', '10': 'fieldType'}, - const {'1': 'frozen', '3': 5, '4': 1, '5': 8, '10': 'frozen'}, - const {'1': 'visibility', '3': 6, '4': 1, '5': 8, '10': 'visibility'}, - const {'1': 'width', '3': 7, '4': 1, '5': 5, '10': 'width'}, - const {'1': 'type_options', '3': 8, '4': 3, '5': 11, '6': '.FieldMeta.TypeOptionsEntry', '10': 'typeOptions'}, - ], - '3': const [FieldMeta_TypeOptionsEntry$json], -}; - -@$core.Deprecated('Use fieldMetaDescriptor instead') -const FieldMeta_TypeOptionsEntry$json = const { - '1': 'TypeOptionsEntry', - '2': const [ - const {'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'}, - const {'1': 'value', '3': 2, '4': 1, '5': 9, '10': 'value'}, - ], - '7': const {'7': true}, -}; - -/// Descriptor for `FieldMeta`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List fieldMetaDescriptor = $convert.base64Decode('CglGaWVsZE1ldGESDgoCaWQYASABKAlSAmlkEhIKBG5hbWUYAiABKAlSBG5hbWUSEgoEZGVzYxgDIAEoCVIEZGVzYxIpCgpmaWVsZF90eXBlGAQgASgOMgouRmllbGRUeXBlUglmaWVsZFR5cGUSFgoGZnJvemVuGAUgASgIUgZmcm96ZW4SHgoKdmlzaWJpbGl0eRgGIAEoCFIKdmlzaWJpbGl0eRIUCgV3aWR0aBgHIAEoBVIFd2lkdGgSPgoMdHlwZV9vcHRpb25zGAggAygLMhsuRmllbGRNZXRhLlR5cGVPcHRpb25zRW50cnlSC3R5cGVPcHRpb25zGj4KEFR5cGVPcHRpb25zRW50cnkSEAoDa2V5GAEgASgJUgNrZXkSFAoFdmFsdWUYAiABKAlSBXZhbHVlOgI4AQ=='); -@$core.Deprecated('Use fieldChangesetPayloadDescriptor instead') -const FieldChangesetPayload$json = const { - '1': 'FieldChangesetPayload', - '2': const [ - const {'1': 'field_id', '3': 1, '4': 1, '5': 9, '10': 'fieldId'}, - const {'1': 'grid_id', '3': 2, '4': 1, '5': 9, '10': 'gridId'}, - const {'1': 'name', '3': 3, '4': 1, '5': 9, '9': 0, '10': 'name'}, - const {'1': 'desc', '3': 4, '4': 1, '5': 9, '9': 1, '10': 'desc'}, - const {'1': 'field_type', '3': 5, '4': 1, '5': 14, '6': '.FieldType', '9': 2, '10': 'fieldType'}, - const {'1': 'frozen', '3': 6, '4': 1, '5': 8, '9': 3, '10': 'frozen'}, - const {'1': 'visibility', '3': 7, '4': 1, '5': 8, '9': 4, '10': 'visibility'}, - const {'1': 'width', '3': 8, '4': 1, '5': 5, '9': 5, '10': 'width'}, - const {'1': 'type_option_data', '3': 9, '4': 1, '5': 12, '9': 6, '10': 'typeOptionData'}, - ], - '8': const [ - const {'1': 'one_of_name'}, - const {'1': 'one_of_desc'}, - const {'1': 'one_of_field_type'}, - const {'1': 'one_of_frozen'}, - const {'1': 'one_of_visibility'}, - const {'1': 'one_of_width'}, - const {'1': 'one_of_type_option_data'}, - ], -}; - -/// Descriptor for `FieldChangesetPayload`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List fieldChangesetPayloadDescriptor = $convert.base64Decode('ChVGaWVsZENoYW5nZXNldFBheWxvYWQSGQoIZmllbGRfaWQYASABKAlSB2ZpZWxkSWQSFwoHZ3JpZF9pZBgCIAEoCVIGZ3JpZElkEhQKBG5hbWUYAyABKAlIAFIEbmFtZRIUCgRkZXNjGAQgASgJSAFSBGRlc2MSKwoKZmllbGRfdHlwZRgFIAEoDjIKLkZpZWxkVHlwZUgCUglmaWVsZFR5cGUSGAoGZnJvemVuGAYgASgISANSBmZyb3plbhIgCgp2aXNpYmlsaXR5GAcgASgISARSCnZpc2liaWxpdHkSFgoFd2lkdGgYCCABKAVIBVIFd2lkdGgSKgoQdHlwZV9vcHRpb25fZGF0YRgJIAEoDEgGUg50eXBlT3B0aW9uRGF0YUINCgtvbmVfb2ZfbmFtZUINCgtvbmVfb2ZfZGVzY0ITChFvbmVfb2ZfZmllbGRfdHlwZUIPCg1vbmVfb2ZfZnJvemVuQhMKEW9uZV9vZl92aXNpYmlsaXR5Qg4KDG9uZV9vZl93aWR0aEIZChdvbmVfb2ZfdHlwZV9vcHRpb25fZGF0YQ=='); -@$core.Deprecated('Use anyDataDescriptor instead') -const AnyData$json = const { - '1': 'AnyData', - '2': const [ - const {'1': 'type_id', '3': 1, '4': 1, '5': 9, '10': 'typeId'}, - const {'1': 'value', '3': 2, '4': 1, '5': 12, '10': 'value'}, - ], -}; - -/// Descriptor for `AnyData`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List anyDataDescriptor = $convert.base64Decode('CgdBbnlEYXRhEhcKB3R5cGVfaWQYASABKAlSBnR5cGVJZBIUCgV2YWx1ZRgCIAEoDFIFdmFsdWU='); -@$core.Deprecated('Use rowMetaDescriptor instead') -const RowMeta$json = const { - '1': 'RowMeta', - '2': const [ - const {'1': 'id', '3': 1, '4': 1, '5': 9, '10': 'id'}, - const {'1': 'block_id', '3': 2, '4': 1, '5': 9, '10': 'blockId'}, - const {'1': 'cells', '3': 3, '4': 3, '5': 11, '6': '.RowMeta.CellsEntry', '10': 'cells'}, - const {'1': 'height', '3': 4, '4': 1, '5': 5, '10': 'height'}, - const {'1': 'visibility', '3': 5, '4': 1, '5': 8, '10': 'visibility'}, - ], - '3': const [RowMeta_CellsEntry$json], -}; - -@$core.Deprecated('Use rowMetaDescriptor instead') -const RowMeta_CellsEntry$json = const { - '1': 'CellsEntry', - '2': const [ - const {'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'}, - const {'1': 'value', '3': 2, '4': 1, '5': 11, '6': '.CellMeta', '10': 'value'}, - ], - '7': const {'7': true}, -}; - -/// Descriptor for `RowMeta`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List rowMetaDescriptor = $convert.base64Decode('CgdSb3dNZXRhEg4KAmlkGAEgASgJUgJpZBIZCghibG9ja19pZBgCIAEoCVIHYmxvY2tJZBIpCgVjZWxscxgDIAMoCzITLlJvd01ldGEuQ2VsbHNFbnRyeVIFY2VsbHMSFgoGaGVpZ2h0GAQgASgFUgZoZWlnaHQSHgoKdmlzaWJpbGl0eRgFIAEoCFIKdmlzaWJpbGl0eRpDCgpDZWxsc0VudHJ5EhAKA2tleRgBIAEoCVIDa2V5Eh8KBXZhbHVlGAIgASgLMgkuQ2VsbE1ldGFSBXZhbHVlOgI4AQ=='); -@$core.Deprecated('Use rowMetaChangesetDescriptor instead') -const RowMetaChangeset$json = const { - '1': 'RowMetaChangeset', - '2': const [ - const {'1': 'row_id', '3': 1, '4': 1, '5': 9, '10': 'rowId'}, - const {'1': 'height', '3': 2, '4': 1, '5': 5, '9': 0, '10': 'height'}, - const {'1': 'visibility', '3': 3, '4': 1, '5': 8, '9': 1, '10': 'visibility'}, - const {'1': 'cell_by_field_id', '3': 4, '4': 3, '5': 11, '6': '.RowMetaChangeset.CellByFieldIdEntry', '10': 'cellByFieldId'}, - ], - '3': const [RowMetaChangeset_CellByFieldIdEntry$json], - '8': const [ - const {'1': 'one_of_height'}, - const {'1': 'one_of_visibility'}, - ], -}; - -@$core.Deprecated('Use rowMetaChangesetDescriptor instead') -const RowMetaChangeset_CellByFieldIdEntry$json = const { - '1': 'CellByFieldIdEntry', - '2': const [ - const {'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'}, - const {'1': 'value', '3': 2, '4': 1, '5': 11, '6': '.CellMeta', '10': 'value'}, - ], - '7': const {'7': true}, -}; - -/// Descriptor for `RowMetaChangeset`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List rowMetaChangesetDescriptor = $convert.base64Decode('ChBSb3dNZXRhQ2hhbmdlc2V0EhUKBnJvd19pZBgBIAEoCVIFcm93SWQSGAoGaGVpZ2h0GAIgASgFSABSBmhlaWdodBIgCgp2aXNpYmlsaXR5GAMgASgISAFSCnZpc2liaWxpdHkSTQoQY2VsbF9ieV9maWVsZF9pZBgEIAMoCzIkLlJvd01ldGFDaGFuZ2VzZXQuQ2VsbEJ5RmllbGRJZEVudHJ5Ug1jZWxsQnlGaWVsZElkGksKEkNlbGxCeUZpZWxkSWRFbnRyeRIQCgNrZXkYASABKAlSA2tleRIfCgV2YWx1ZRgCIAEoCzIJLkNlbGxNZXRhUgV2YWx1ZToCOAFCDwoNb25lX29mX2hlaWdodEITChFvbmVfb2ZfdmlzaWJpbGl0eQ=='); -@$core.Deprecated('Use cellMetaDescriptor instead') -const CellMeta$json = const { - '1': 'CellMeta', - '2': const [ - const {'1': 'data', '3': 1, '4': 1, '5': 9, '10': 'data'}, - ], -}; - -/// Descriptor for `CellMeta`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List cellMetaDescriptor = $convert.base64Decode('CghDZWxsTWV0YRISCgRkYXRhGAEgASgJUgRkYXRh'); -@$core.Deprecated('Use cellMetaChangesetDescriptor instead') -const CellMetaChangeset$json = const { - '1': 'CellMetaChangeset', - '2': const [ - const {'1': 'grid_id', '3': 1, '4': 1, '5': 9, '10': 'gridId'}, - const {'1': 'row_id', '3': 2, '4': 1, '5': 9, '10': 'rowId'}, - const {'1': 'field_id', '3': 3, '4': 1, '5': 9, '10': 'fieldId'}, - const {'1': 'data', '3': 4, '4': 1, '5': 9, '9': 0, '10': 'data'}, - ], - '8': const [ - const {'1': 'one_of_data'}, - ], -}; - -/// Descriptor for `CellMetaChangeset`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List cellMetaChangesetDescriptor = $convert.base64Decode('ChFDZWxsTWV0YUNoYW5nZXNldBIXCgdncmlkX2lkGAEgASgJUgZncmlkSWQSFQoGcm93X2lkGAIgASgJUgVyb3dJZBIZCghmaWVsZF9pZBgDIAEoCVIHZmllbGRJZBIUCgRkYXRhGAQgASgJSABSBGRhdGFCDQoLb25lX29mX2RhdGE='); -@$core.Deprecated('Use buildGridContextDescriptor instead') -const BuildGridContext$json = const { - '1': 'BuildGridContext', - '2': const [ - const {'1': 'field_metas', '3': 1, '4': 3, '5': 11, '6': '.FieldMeta', '10': 'fieldMetas'}, - const {'1': 'block_meta', '3': 2, '4': 1, '5': 11, '6': '.GridBlockMeta', '10': 'blockMeta'}, - const {'1': 'block_meta_data', '3': 3, '4': 1, '5': 11, '6': '.GridBlockMetaData', '10': 'blockMetaData'}, - ], -}; - -/// Descriptor for `BuildGridContext`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List buildGridContextDescriptor = $convert.base64Decode('ChBCdWlsZEdyaWRDb250ZXh0EisKC2ZpZWxkX21ldGFzGAEgAygLMgouRmllbGRNZXRhUgpmaWVsZE1ldGFzEi0KCmJsb2NrX21ldGEYAiABKAsyDi5HcmlkQmxvY2tNZXRhUglibG9ja01ldGESOgoPYmxvY2tfbWV0YV9kYXRhGAMgASgLMhIuR3JpZEJsb2NrTWV0YURhdGFSDWJsb2NrTWV0YURhdGE='); diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-grid-data-model/meta.pbserver.dart b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-grid-data-model/meta.pbserver.dart deleted file mode 100644 index fdd12ef0bf..0000000000 --- a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-grid-data-model/meta.pbserver.dart +++ /dev/null @@ -1,9 +0,0 @@ -/// -// Generated code. Do not modify. -// source: meta.proto -// -// @dart = 2.12 -// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package - -export 'meta.pb.dart'; - diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-grid-data-model/protobuf.dart b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-grid-data-model/protobuf.dart index 2c253e0494..3f0100c8d6 100644 --- a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-grid-data-model/protobuf.dart +++ b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-grid-data-model/protobuf.dart @@ -1,3 +1,2 @@ // Auto-generated, do not edit export './grid.pb.dart'; -export './meta.pb.dart'; diff --git a/frontend/rust-lib/Cargo.lock b/frontend/rust-lib/Cargo.lock index a21105a163..a2dc7f826f 100755 --- a/frontend/rust-lib/Cargo.lock +++ b/frontend/rust-lib/Cargo.lock @@ -946,6 +946,7 @@ dependencies = [ "flowy-revision", "flowy-sync", "flowy-test", + "indexmap", "lazy_static", "lib-dispatch", "lib-infra", @@ -971,6 +972,7 @@ dependencies = [ "bytes", "flowy-derive", "flowy-error-code", + "indexmap", "lib-infra", "protobuf", "serde", @@ -1611,12 +1613,13 @@ checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" [[package]] name = "indexmap" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282a6247722caba404c065016bbfa522806e51714c34f5dfc3e4a3a46fcb4223" +checksum = "0f647032dfaa1f8b6dc29bd3edb7bbef4861b8b8007ebb118d6db284fd59f6ee" dependencies = [ "autocfg", "hashbrown", + "serde", ] [[package]] diff --git a/frontend/rust-lib/flowy-grid/Cargo.toml b/frontend/rust-lib/flowy-grid/Cargo.toml index de0320f062..ce72fecb3f 100644 --- a/frontend/rust-lib/flowy-grid/Cargo.toml +++ b/frontend/rust-lib/flowy-grid/Cargo.toml @@ -34,6 +34,7 @@ rayon = "1.5" serde = { version = "1.0", features = ["derive"] } serde_json = {version = "1.0"} serde_repr = "0.1" +indexmap = {version = "1.8.1", features = ["serde"]} [dev-dependencies] flowy-test = { path = "../flowy-test" } diff --git a/frontend/rust-lib/flowy-grid/src/event_handler.rs b/frontend/rust-lib/flowy-grid/src/event_handler.rs index acc1eeb5c6..abe9dd59a7 100644 --- a/frontend/rust-lib/flowy-grid/src/event_handler.rs +++ b/frontend/rust-lib/flowy-grid/src/event_handler.rs @@ -227,10 +227,10 @@ pub(crate) async fn get_cell_handler( #[tracing::instrument(level = "debug", skip_all, err)] pub(crate) async fn update_cell_handler( - data: Data, + data: Data, manager: AppData>, ) -> Result<(), FlowyError> { - let changeset: CellMetaChangeset = data.into_inner(); + let changeset: CellChangeset = data.into_inner(); let editor = manager.get_grid_editor(&changeset.grid_id)?; let _ = editor.update_cell(changeset).await?; Ok(()) @@ -271,7 +271,7 @@ pub(crate) async fn select_option_changeset_handler( field_meta.insert_type_option_entry(&*type_option); let _ = editor.replace_field(field_meta).await?; - let changeset = CellMetaChangeset { + let changeset = CellChangeset { grid_id: changeset.cell_identifier.grid_id, row_id: changeset.cell_identifier.row_id, field_id: changeset.cell_identifier.field_id, @@ -310,7 +310,7 @@ pub(crate) async fn select_option_cell_changeset_handler( ) -> Result<(), FlowyError> { let params: SelectOptionCellChangesetParams = data.into_inner().try_into()?; let editor = manager.get_grid_editor(¶ms.grid_id)?; - let changeset: CellMetaChangeset = params.into(); + let changeset: CellChangeset = params.into(); let _ = editor.update_cell(changeset).await?; Ok(()) } diff --git a/frontend/rust-lib/flowy-grid/src/event_map.rs b/frontend/rust-lib/flowy-grid/src/event_map.rs index 7246cc7f4f..e2e138aee2 100644 --- a/frontend/rust-lib/flowy-grid/src/event_map.rs +++ b/frontend/rust-lib/flowy-grid/src/event_map.rs @@ -92,7 +92,7 @@ pub enum GridEvent { #[event(input = "CellIdentifierPayload", output = "Cell")] GetCell = 70, - #[event(input = "CellMetaChangeset")] + #[event(input = "CellChangeset")] UpdateCell = 71, #[event(input = "SelectOptionCellChangesetPayload")] diff --git a/frontend/rust-lib/flowy-grid/src/services/block_meta_manager.rs b/frontend/rust-lib/flowy-grid/src/services/block_meta_manager.rs index 0c4d1a2efd..b1817c85a6 100644 --- a/frontend/rust-lib/flowy-grid/src/services/block_meta_manager.rs +++ b/frontend/rust-lib/flowy-grid/src/services/block_meta_manager.rs @@ -8,7 +8,7 @@ use std::borrow::Cow; use dashmap::DashMap; use flowy_error::FlowyResult; use flowy_grid_data_model::entities::{ - CellMeta, CellMetaChangeset, CellNotificationData, FieldMeta, GridBlockMeta, GridBlockMetaChangeset, + CellChangeset, CellMeta, CellNotificationData, FieldMeta, GridBlockMeta, GridBlockMetaChangeset, GridBlockOrderChangeset, IndexRowOrder, RowMeta, RowMetaChangeset, RowOrder, }; use flowy_revision::disk::SQLiteGridBlockMetaRevisionPersistence; @@ -154,7 +154,7 @@ impl GridBlockMetaEditorManager { Ok(changesets) } - pub async fn update_cell(&self, changeset: CellMetaChangeset) -> FlowyResult<()> { + pub async fn update_cell(&self, changeset: CellChangeset) -> FlowyResult<()> { let row_id = changeset.row_id.clone(); let editor = self.get_editor_from_row_id(&row_id).await?; let row_changeset: RowMetaChangeset = changeset.clone().into(); diff --git a/frontend/rust-lib/flowy-grid/src/services/field/field_builder.rs b/frontend/rust-lib/flowy-grid/src/services/field/field_builder.rs index d18e6aa07f..d20e29282e 100644 --- a/frontend/rust-lib/flowy-grid/src/services/field/field_builder.rs +++ b/frontend/rust-lib/flowy-grid/src/services/field/field_builder.rs @@ -1,7 +1,7 @@ use crate::services::field::type_options::*; use bytes::Bytes; use flowy_grid_data_model::entities::{Field, FieldMeta, FieldType, TypeOptionDataEntry}; -use std::collections::HashMap; +use indexmap::IndexMap; pub struct FieldBuilder { field_meta: FieldMeta, @@ -34,7 +34,7 @@ impl FieldBuilder { frozen: field.frozen, visibility: field.visibility, width: field.width, - type_options: HashMap::default(), + type_options: IndexMap::default(), }; Self { field_meta, diff --git a/frontend/rust-lib/flowy-grid/src/services/field/type_options/selection_type_option.rs b/frontend/rust-lib/flowy-grid/src/services/field/type_options/selection_type_option.rs index 791ec15718..6a8ad47e4c 100644 --- a/frontend/rust-lib/flowy-grid/src/services/field/type_options/selection_type_option.rs +++ b/frontend/rust-lib/flowy-grid/src/services/field/type_options/selection_type_option.rs @@ -7,7 +7,7 @@ use bytes::Bytes; use flowy_derive::{ProtoBuf, ProtoBuf_Enum}; use flowy_error::{ErrorCode, FlowyError}; use flowy_grid_data_model::entities::{ - CellMeta, CellMetaChangeset, FieldMeta, FieldType, TypeOptionDataDeserializer, TypeOptionDataEntry, + CellChangeset, CellMeta, FieldMeta, FieldType, TypeOptionDataDeserializer, TypeOptionDataEntry, }; use flowy_grid_data_model::parser::NotEmptyUuid; use serde::{Deserialize, Serialize}; @@ -356,14 +356,14 @@ impl SelectOptionCellChangeset { } } -impl std::convert::From for CellMetaChangeset { +impl std::convert::From for CellChangeset { fn from(params: SelectOptionCellChangesetParams) -> Self { let changeset = SelectOptionCellChangeset { insert_option_id: params.insert_option_id, delete_option_id: params.delete_option_id, }; let s = serde_json::to_string(&changeset).unwrap(); - CellMetaChangeset { + CellChangeset { grid_id: params.grid_id, row_id: params.row_id, field_id: params.field_id, diff --git a/frontend/rust-lib/flowy-grid/src/services/field/type_options/text_type_option.rs b/frontend/rust-lib/flowy-grid/src/services/field/type_options/text_type_option.rs index 5984b2552a..27bbd2c2da 100644 --- a/frontend/rust-lib/flowy-grid/src/services/field/type_options/text_type_option.rs +++ b/frontend/rust-lib/flowy-grid/src/services/field/type_options/text_type_option.rs @@ -40,7 +40,7 @@ impl CellDataOperation for RichTextTypeOption { || type_option_cell_data.is_multi_select() || type_option_cell_data.is_number() { - decode_cell_data(data, &field_meta, &type_option_cell_data.field_type).unwrap_or_else(|| "".to_owned()) + decode_cell_data(data, field_meta, &type_option_cell_data.field_type).unwrap_or_else(|| "".to_owned()) } else { type_option_cell_data.data } diff --git a/frontend/rust-lib/flowy-grid/src/services/grid_editor.rs b/frontend/rust-lib/flowy-grid/src/services/grid_editor.rs index b94efcef99..50282e6b8a 100644 --- a/frontend/rust-lib/flowy-grid/src/services/grid_editor.rs +++ b/frontend/rust-lib/flowy-grid/src/services/grid_editor.rs @@ -293,13 +293,15 @@ impl ClientGridEditor { } } - pub async fn update_cell(&self, mut changeset: CellMetaChangeset) -> FlowyResult<()> { + #[tracing::instrument(level = "trace", skip_all, err)] + pub async fn update_cell(&self, mut changeset: CellChangeset) -> FlowyResult<()> { if changeset.data.as_ref().is_none() { return Ok(()); } let cell_data_changeset = changeset.data.unwrap(); let cell_meta = self.get_cell_meta(&changeset.row_id, &changeset.field_id).await?; + tracing::trace!("{}: {:?}", &changeset.field_id, cell_meta); match self.pad.read().await.get_field(&changeset.field_id) { None => { let msg = format!("Field not found with id: {}", &changeset.field_id); @@ -431,7 +433,7 @@ impl ClientGridEditor { if let Some(field_meta) = field_metas.pop() { send_dart_notification(field_id, GridNotification::DidUpdateField) - .payload(field_meta) + .payload(Field::from(field_meta)) .send(); } diff --git a/frontend/rust-lib/flowy-grid/src/services/row/row_builder.rs b/frontend/rust-lib/flowy-grid/src/services/row/row_builder.rs index 2e6970d2c9..23282cdfb1 100644 --- a/frontend/rust-lib/flowy-grid/src/services/row/row_builder.rs +++ b/frontend/rust-lib/flowy-grid/src/services/row/row_builder.rs @@ -3,6 +3,7 @@ use crate::services::row::apply_cell_data_changeset; use crate::services::field::SelectOptionCellChangeset; use flowy_error::{FlowyError, FlowyResult}; use flowy_grid_data_model::entities::{CellMeta, FieldMeta, RowMeta, DEFAULT_ROW_HEIGHT}; +use indexmap::IndexMap; use std::collections::HashMap; pub struct CreateRowMetaBuilder<'a> { @@ -90,7 +91,7 @@ pub fn make_row_meta_from_context(block_id: &str, payload: CreateRowMetaPayload) pub struct CreateRowMetaPayload { pub row_id: String, - pub cell_by_field_id: HashMap, + pub cell_by_field_id: IndexMap, pub height: i32, pub visibility: bool, } diff --git a/frontend/rust-lib/flowy-grid/src/services/row/row_loader.rs b/frontend/rust-lib/flowy-grid/src/services/row/row_loader.rs index e9c75d4f16..770ba758e9 100644 --- a/frontend/rust-lib/flowy-grid/src/services/row/row_loader.rs +++ b/frontend/rust-lib/flowy-grid/src/services/row/row_loader.rs @@ -3,10 +3,7 @@ use flowy_error::FlowyResult; use flowy_grid_data_model::entities::{ Cell, CellMeta, FieldMeta, GridBlock, GridBlockOrder, RepeatedGridBlock, Row, RowMeta, RowOrder, }; -use rayon::iter::{IntoParallelIterator, ParallelIterator}; - use std::collections::HashMap; - use std::sync::Arc; pub struct GridBlockSnapshot { @@ -60,7 +57,7 @@ pub(crate) fn make_rows_from_row_metas(fields: &[FieldMeta], row_metas: &[Arc>(); diff --git a/frontend/rust-lib/flowy-grid/tests/grid/grid_test.rs b/frontend/rust-lib/flowy-grid/tests/grid/grid_test.rs index a9d7dacec8..aee5a4faa0 100644 --- a/frontend/rust-lib/flowy-grid/tests/grid/grid_test.rs +++ b/frontend/rust-lib/flowy-grid/tests/grid/grid_test.rs @@ -6,7 +6,7 @@ use flowy_grid::services::field::{ }; use flowy_grid::services::row::{decode_cell_data, CreateRowMetaBuilder}; use flowy_grid_data_model::entities::{ - CellMetaChangeset, FieldChangesetParams, FieldType, GridBlockMeta, GridBlockMetaChangeset, RowMetaChangeset, + CellChangeset, FieldChangesetParams, FieldType, GridBlockMeta, GridBlockMetaChangeset, RowMetaChangeset, TypeOptionDataEntry, }; @@ -324,7 +324,7 @@ async fn grid_cell_update() { }; scripts.push(UpdateCell { - changeset: CellMetaChangeset { + changeset: CellChangeset { grid_id: block_id.to_string(), row_id: row_meta.id.clone(), field_id: field_meta.id.clone(), @@ -345,7 +345,7 @@ async fn grid_cell_update() { }; scripts.push(UpdateCell { - changeset: CellMetaChangeset { + changeset: CellChangeset { grid_id: block_id.to_string(), row_id: row_meta.id.clone(), field_id: field_meta.id.clone(), diff --git a/frontend/rust-lib/flowy-grid/tests/grid/script.rs b/frontend/rust-lib/flowy-grid/tests/grid/script.rs index 927c505b55..9d2dae5666 100644 --- a/frontend/rust-lib/flowy-grid/tests/grid/script.rs +++ b/frontend/rust-lib/flowy-grid/tests/grid/script.rs @@ -3,8 +3,8 @@ use flowy_grid::services::field::*; use flowy_grid::services::grid_editor::{ClientGridEditor, GridPadBuilder}; use flowy_grid::services::row::CreateRowMetaPayload; use flowy_grid_data_model::entities::{ - BuildGridContext, CellMetaChangeset, CreateFieldParams, Field, FieldChangesetParams, FieldMeta, FieldOrder, - FieldType, GridBlockMeta, GridBlockMetaChangeset, RowMeta, RowMetaChangeset, RowOrder, TypeOptionDataEntry, + BuildGridContext, CellChangeset, CreateFieldParams, Field, FieldChangesetParams, FieldMeta, FieldOrder, FieldType, + GridBlockMeta, GridBlockMetaChangeset, RowMeta, RowMetaChangeset, RowOrder, TypeOptionDataEntry, }; use flowy_revision::REVISION_WRITE_INTERVAL_IN_MILLIS; use flowy_sync::client_grid::GridBuilder; @@ -61,7 +61,7 @@ pub enum EditorScript { row_ids: Vec, }, UpdateCell { - changeset: CellMetaChangeset, + changeset: CellChangeset, is_err: bool, }, AssertRowCount(usize), @@ -86,7 +86,7 @@ impl GridEditorTest { let sdk = FlowySDKTest::default(); let _ = sdk.init_user().await; let build_context = make_template_1_grid(); - let view_data: Bytes = build_context.try_into().unwrap(); + let view_data: Bytes = build_context.into(); let test = ViewTest::new_grid_view(&sdk, view_data.to_vec()).await; let editor = sdk.grid_manager.open_grid(&test.view.id).await.unwrap(); let field_metas = editor.get_field_metas::(None).await.unwrap(); diff --git a/frontend/rust-lib/flowy-sdk/src/deps_resolve/folder_deps.rs b/frontend/rust-lib/flowy-sdk/src/deps_resolve/folder_deps.rs index 24af171a92..41835804af 100644 --- a/frontend/rust-lib/flowy-sdk/src/deps_resolve/folder_deps.rs +++ b/frontend/rust-lib/flowy-sdk/src/deps_resolve/folder_deps.rs @@ -14,7 +14,7 @@ use flowy_folder::{ }; use flowy_grid::manager::{make_grid_view_data, GridManager}; use flowy_grid::util::make_default_grid; -use flowy_grid_data_model::entities::BuildGridContext; + use flowy_net::ClientServerConfiguration; use flowy_net::{ http_server::folder::FolderHttpCloudService, local_server::LocalServer, ws::connection::FlowyWebSocketConnect, @@ -25,6 +25,8 @@ use futures_core::future::BoxFuture; use lib_infra::future::{BoxResultFuture, FutureResult}; use lib_ws::{WSChannel, WSMessageReceiver, WebSocketRawMessage}; use std::collections::HashMap; + +use flowy_grid_data_model::entities::BuildGridContext; use std::convert::TryFrom; use std::{convert::TryInto, sync::Arc}; diff --git a/shared-lib/Cargo.lock b/shared-lib/Cargo.lock index 52cb6d081f..08002ff7ca 100644 --- a/shared-lib/Cargo.lock +++ b/shared-lib/Cargo.lock @@ -458,6 +458,7 @@ dependencies = [ "bytes", "flowy-derive", "flowy-error-code", + "indexmap", "lib-infra", "protobuf", "serde", @@ -701,6 +702,12 @@ dependencies = [ "walkdir", ] +[[package]] +name = "hashbrown" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" + [[package]] name = "heck" version = "0.3.3" @@ -777,6 +784,17 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "indexmap" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f647032dfaa1f8b6dc29bd3edb7bbef4861b8b8007ebb118d6db284fd59f6ee" +dependencies = [ + "autocfg", + "hashbrown", + "serde", +] + [[package]] name = "instant" version = "0.1.12" diff --git a/shared-lib/flowy-grid-data-model/Cargo.toml b/shared-lib/flowy-grid-data-model/Cargo.toml index e5a78e41ca..c17ec9ed90 100644 --- a/shared-lib/flowy-grid-data-model/Cargo.toml +++ b/shared-lib/flowy-grid-data-model/Cargo.toml @@ -16,7 +16,7 @@ serde_json = {version = "1.0"} serde_repr = "0.1" uuid = { version = "0.8", features = ["serde", "v4"] } flowy-error-code = { path = "../flowy-error-code"} - +indexmap = {version = "1.8.1", features = ["serde"]} [build-dependencies] lib-infra = { path = "../lib-infra", features = ["protobuf_file_gen"] } diff --git a/shared-lib/flowy-grid-data-model/Flowy.toml b/shared-lib/flowy-grid-data-model/Flowy.toml index 5e88aadda5..dcac35f40a 100644 --- a/shared-lib/flowy-grid-data-model/Flowy.toml +++ b/shared-lib/flowy-grid-data-model/Flowy.toml @@ -1,3 +1,3 @@ -proto_crates = ["src/entities",] +proto_crates = ["src/entities/grid.rs",] event_files = [] \ No newline at end of file diff --git a/shared-lib/flowy-grid-data-model/src/entities/grid.rs b/shared-lib/flowy-grid-data-model/src/entities/grid.rs index d517b7f230..6734062412 100644 --- a/shared-lib/flowy-grid-data-model/src/entities/grid.rs +++ b/shared-lib/flowy-grid-data-model/src/entities/grid.rs @@ -1,9 +1,12 @@ -use crate::entities::{FieldMeta, FieldType, RowMeta}; +use crate::entities::{CellMeta, FieldMeta, RowMeta, RowMetaChangeset}; use crate::parser::NotEmptyUuid; -use flowy_derive::ProtoBuf; +use flowy_derive::{ProtoBuf, ProtoBuf_Enum}; use flowy_error_code::ErrorCode; + +use serde_repr::*; use std::collections::HashMap; use std::sync::Arc; +use strum_macros::{Display, EnumCount as EnumCountMacro, EnumIter, EnumString}; #[derive(Debug, Clone, Default, ProtoBuf)] pub struct Grid { @@ -574,3 +577,169 @@ impl TryInto for QueryGridBlocksPayload { }) } } + +#[derive(Debug, Clone, Default, ProtoBuf)] +pub struct FieldChangesetPayload { + #[pb(index = 1)] + pub field_id: String, + + #[pb(index = 2)] + pub grid_id: String, + + #[pb(index = 3, one_of)] + pub name: Option, + + #[pb(index = 4, one_of)] + pub desc: Option, + + #[pb(index = 5, one_of)] + pub field_type: Option, + + #[pb(index = 6, one_of)] + pub frozen: Option, + + #[pb(index = 7, one_of)] + pub visibility: Option, + + #[pb(index = 8, one_of)] + pub width: Option, + + #[pb(index = 9, one_of)] + pub type_option_data: Option>, +} + +#[derive(Debug, Clone, Default)] +pub struct FieldChangesetParams { + pub field_id: String, + + pub grid_id: String, + + pub name: Option, + + pub desc: Option, + + pub field_type: Option, + + pub frozen: Option, + + pub visibility: Option, + + pub width: Option, + + pub type_option_data: Option>, +} + +impl TryInto for FieldChangesetPayload { + type Error = ErrorCode; + + fn try_into(self) -> Result { + let grid_id = NotEmptyUuid::parse(self.grid_id).map_err(|_| ErrorCode::GridIdIsEmpty)?; + let field_id = NotEmptyUuid::parse(self.field_id).map_err(|_| ErrorCode::FieldIdIsEmpty)?; + + if let Some(type_option_data) = self.type_option_data.as_ref() { + if type_option_data.is_empty() { + return Err(ErrorCode::TypeOptionDataIsEmpty); + } + } + + Ok(FieldChangesetParams { + field_id: field_id.0, + grid_id: grid_id.0, + name: self.name, + desc: self.desc, + field_type: self.field_type, + frozen: self.frozen, + visibility: self.visibility, + width: self.width, + type_option_data: self.type_option_data, + }) + } +} + +#[derive( + Debug, + Clone, + PartialEq, + Eq, + ProtoBuf_Enum, + EnumCountMacro, + EnumString, + EnumIter, + Display, + Serialize_repr, + Deserialize_repr, +)] +#[repr(u8)] +pub enum FieldType { + RichText = 0, + Number = 1, + DateTime = 2, + SingleSelect = 3, + MultiSelect = 4, + Checkbox = 5, +} + +impl std::default::Default for FieldType { + fn default() -> Self { + FieldType::RichText + } +} + +impl AsRef for FieldType { + fn as_ref(&self) -> &FieldType { + self + } +} + +impl From<&FieldType> for FieldType { + fn from(field_type: &FieldType) -> Self { + field_type.clone() + } +} + +impl FieldType { + pub fn type_id(&self) -> String { + let ty = self.clone(); + format!("{}", ty as u8) + } + + pub fn default_cell_width(&self) -> i32 { + match self { + FieldType::DateTime => 180, + _ => 150, + } + } +} + +#[derive(Debug, Clone, Default, ProtoBuf)] +pub struct CellChangeset { + #[pb(index = 1)] + pub grid_id: String, + + #[pb(index = 2)] + pub row_id: String, + + #[pb(index = 3)] + pub field_id: String, + + #[pb(index = 4, one_of)] + pub data: Option, +} + +impl std::convert::From for RowMetaChangeset { + fn from(changeset: CellChangeset) -> Self { + let mut cell_by_field_id = HashMap::with_capacity(1); + let field_id = changeset.field_id; + let cell_meta = CellMeta { + data: changeset.data.unwrap_or_else(|| "".to_owned()), + }; + cell_by_field_id.insert(field_id, cell_meta); + + RowMetaChangeset { + row_id: changeset.row_id, + height: None, + visibility: None, + cell_by_field_id, + } + } +} diff --git a/shared-lib/flowy-grid-data-model/src/entities/meta.rs b/shared-lib/flowy-grid-data-model/src/entities/meta.rs index 09fa11c003..31c0e9416c 100644 --- a/shared-lib/flowy-grid-data-model/src/entities/meta.rs +++ b/shared-lib/flowy-grid-data-model/src/entities/meta.rs @@ -1,35 +1,24 @@ -use crate::parser::NotEmptyUuid; +use crate::entities::FieldType; + use bytes::Bytes; -use flowy_derive::{ProtoBuf, ProtoBuf_Enum}; -use flowy_error_code::ErrorCode; + +use indexmap::IndexMap; use serde::{Deserialize, Serialize}; -use serde_repr::*; use std::collections::HashMap; -use strum_macros::{Display, EnumCount as EnumCountMacro, EnumIter, EnumString}; pub const DEFAULT_ROW_HEIGHT: i32 = 42; -#[derive(Debug, Clone, Default, Serialize, Deserialize, ProtoBuf)] +#[derive(Debug, Clone, Default, Serialize, Deserialize)] pub struct GridMeta { - #[pb(index = 1)] pub grid_id: String, - - #[pb(index = 2)] pub fields: Vec, - - #[pb(index = 3)] pub blocks: Vec, } -#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize, ProtoBuf)] +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] pub struct GridBlockMeta { - #[pb(index = 1)] pub block_id: String, - - #[pb(index = 2)] pub start_row_index: i32, - - #[pb(index = 3)] pub row_count: i32, } @@ -68,43 +57,34 @@ impl GridBlockMetaChangeset { } } -#[derive(Debug, Clone, Default, Serialize, Deserialize, ProtoBuf)] +#[derive(Debug, Clone, Default, Serialize, Deserialize)] pub struct GridBlockMetaData { - #[pb(index = 1)] pub block_id: String, - - #[pb(index = 2)] pub rows: Vec, } -#[derive(Debug, Clone, Default, Serialize, Deserialize, ProtoBuf, Eq, PartialEq)] +#[derive(Debug, Clone, Default, Serialize, Deserialize, Eq, PartialEq)] pub struct FieldMeta { - #[pb(index = 1)] pub id: String, - #[pb(index = 2)] pub name: String, - #[pb(index = 3)] pub desc: String, - #[pb(index = 4)] pub field_type: FieldType, - #[pb(index = 5)] pub frozen: bool, - #[pb(index = 6)] pub visibility: bool, - #[pb(index = 7)] pub width: i32, - #[pb(index = 8)] + // #[pb(index = 8)] /// type_options contains key/value pairs /// key: id of the FieldType /// value: type option data string - pub type_options: HashMap, + #[serde(with = "indexmap::serde_seq")] + pub type_options: IndexMap, } impl FieldMeta { @@ -156,180 +136,16 @@ pub trait TypeOptionDataDeserializer { fn from_protobuf_bytes(bytes: Bytes) -> Self; } -#[derive(Debug, Clone, Default, ProtoBuf)] -pub struct FieldChangesetPayload { - #[pb(index = 1)] - pub field_id: String, - - #[pb(index = 2)] - pub grid_id: String, - - #[pb(index = 3, one_of)] - pub name: Option, - - #[pb(index = 4, one_of)] - pub desc: Option, - - #[pb(index = 5, one_of)] - pub field_type: Option, - - #[pb(index = 6, one_of)] - pub frozen: Option, - - #[pb(index = 7, one_of)] - pub visibility: Option, - - #[pb(index = 8, one_of)] - pub width: Option, - - #[pb(index = 9, one_of)] - pub type_option_data: Option>, -} - -#[derive(Debug, Clone, Default)] -pub struct FieldChangesetParams { - pub field_id: String, - pub grid_id: String, - pub name: Option, - pub desc: Option, - pub field_type: Option, - pub frozen: Option, - pub visibility: Option, - pub width: Option, - pub type_option_data: Option>, -} - -impl TryInto for FieldChangesetPayload { - type Error = ErrorCode; - - fn try_into(self) -> Result { - let grid_id = NotEmptyUuid::parse(self.grid_id).map_err(|_| ErrorCode::GridIdIsEmpty)?; - let field_id = NotEmptyUuid::parse(self.field_id).map_err(|_| ErrorCode::FieldIdIsEmpty)?; - - if let Some(type_option_data) = self.type_option_data.as_ref() { - if type_option_data.is_empty() { - return Err(ErrorCode::TypeOptionDataIsEmpty); - } - } - - Ok(FieldChangesetParams { - field_id: field_id.0, - grid_id: grid_id.0, - name: self.name, - desc: self.desc, - field_type: self.field_type, - frozen: self.frozen, - visibility: self.visibility, - width: self.width, - type_option_data: self.type_option_data, - }) - } -} - -#[derive( - Debug, - Clone, - PartialEq, - Eq, - ProtoBuf_Enum, - EnumCountMacro, - EnumString, - EnumIter, - Display, - Serialize_repr, - Deserialize_repr, -)] -#[repr(u8)] -pub enum FieldType { - RichText = 0, - Number = 1, - DateTime = 2, - SingleSelect = 3, - MultiSelect = 4, - Checkbox = 5, -} - -impl std::default::Default for FieldType { - fn default() -> Self { - FieldType::RichText - } -} - -impl AsRef for FieldType { - fn as_ref(&self) -> &FieldType { - self - } -} - -impl From<&FieldType> for FieldType { - fn from(field_type: &FieldType) -> Self { - field_type.clone() - } -} - -impl FieldType { - pub fn type_id(&self) -> String { - let ty = self.clone(); - format!("{}", ty as u8) - } - - pub fn default_cell_width(&self) -> i32 { - match self { - FieldType::DateTime => 180, - _ => 150, - } - } -} - -#[derive(Debug, Clone, Serialize, Deserialize, Default, ProtoBuf)] -pub struct AnyData { - #[pb(index = 1)] - pub type_id: String, - - #[pb(index = 2)] - pub value: Vec, -} - -impl AnyData { - pub fn from_str>(field_type: F, s: &str) -> AnyData { - Self::from_bytes(field_type, s.as_bytes().to_vec()) - } - - pub fn from_bytes, F: Into>(field_type: F, bytes: T) -> AnyData { - AnyData { - type_id: field_type.into().type_id(), - value: bytes.as_ref().to_vec(), - } - } -} - -impl ToString for AnyData { - fn to_string(&self) -> String { - match String::from_utf8(self.value.clone()) { - Ok(s) => s, - Err(_) => "".to_owned(), - } - } -} - -#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize, ProtoBuf)] +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] pub struct RowMeta { - #[pb(index = 1)] pub id: String, - - #[pb(index = 2)] pub block_id: String, - - #[pb(index = 3)] /// cells contains key/value pairs. /// key: field id, /// value: CellMeta - pub cells: HashMap, - - #[pb(index = 4)] + #[serde(with = "indexmap::serde_seq")] + pub cells: IndexMap, pub height: i32, - - #[pb(index = 5)] pub visibility: bool, } @@ -345,24 +161,16 @@ impl RowMeta { } } -#[derive(Debug, Clone, Default, ProtoBuf)] +#[derive(Debug, Clone, Default)] pub struct RowMetaChangeset { - #[pb(index = 1)] pub row_id: String, - - #[pb(index = 2, one_of)] pub height: Option, - - #[pb(index = 3, one_of)] pub visibility: Option, - - #[pb(index = 4)] pub cell_by_field_id: HashMap, } -#[derive(Debug, Clone, PartialEq, Eq, Default, Serialize, Deserialize, ProtoBuf)] +#[derive(Debug, Clone, PartialEq, Eq, Default, Serialize, Deserialize)] pub struct CellMeta { - #[pb(index = 1)] pub data: String, } @@ -372,49 +180,27 @@ impl CellMeta { } } -#[derive(Debug, Clone, Default, ProtoBuf)] -pub struct CellMetaChangeset { - #[pb(index = 1)] - pub grid_id: String, - - #[pb(index = 2)] - pub row_id: String, - - #[pb(index = 3)] - pub field_id: String, - - #[pb(index = 4, one_of)] - pub data: Option, +#[derive(Clone, Deserialize, Serialize)] +pub struct BuildGridContext { + pub field_metas: Vec, + pub block_meta: GridBlockMeta, + pub block_meta_data: GridBlockMetaData, } -impl std::convert::From for RowMetaChangeset { - fn from(changeset: CellMetaChangeset) -> Self { - let mut cell_by_field_id = HashMap::with_capacity(1); - let field_id = changeset.field_id; - let cell_meta = CellMeta { - data: changeset.data.unwrap_or_else(|| "".to_owned()), - }; - cell_by_field_id.insert(field_id, cell_meta); - - RowMetaChangeset { - row_id: changeset.row_id, - height: None, - visibility: None, - cell_by_field_id, - } +impl std::convert::From for Bytes { + fn from(ctx: BuildGridContext) -> Self { + let bytes = serde_json::to_vec(&ctx).unwrap_or_else(|_| vec![]); + Bytes::from(bytes) } } -#[derive(Clone, ProtoBuf)] -pub struct BuildGridContext { - #[pb(index = 1)] - pub field_metas: Vec, +impl std::convert::TryFrom for BuildGridContext { + type Error = serde_json::Error; - #[pb(index = 2)] - pub block_meta: GridBlockMeta, - - #[pb(index = 3)] - pub block_meta_data: GridBlockMetaData, + fn try_from(bytes: Bytes) -> Result { + let ctx: BuildGridContext = serde_json::from_slice(&bytes)?; + Ok(ctx) + } } impl std::default::Default for BuildGridContext { diff --git a/shared-lib/flowy-grid-data-model/src/protobuf/model/grid.rs b/shared-lib/flowy-grid-data-model/src/protobuf/model/grid.rs index 3d86c28702..5d40483fdd 100644 --- a/shared-lib/flowy-grid-data-model/src/protobuf/model/grid.rs +++ b/shared-lib/flowy-grid-data-model/src/protobuf/model/grid.rs @@ -286,7 +286,7 @@ pub struct Field { pub id: ::std::string::String, pub name: ::std::string::String, pub desc: ::std::string::String, - pub field_type: super::meta::FieldType, + pub field_type: FieldType, pub frozen: bool, pub visibility: bool, pub width: i32, @@ -387,15 +387,15 @@ impl Field { // .FieldType field_type = 4; - pub fn get_field_type(&self) -> super::meta::FieldType { + pub fn get_field_type(&self) -> FieldType { self.field_type } pub fn clear_field_type(&mut self) { - self.field_type = super::meta::FieldType::RichText; + self.field_type = FieldType::RichText; } // Param is passed by value, moved - pub fn set_field_type(&mut self, v: super::meta::FieldType) { + pub fn set_field_type(&mut self, v: FieldType) { self.field_type = v; } @@ -508,7 +508,7 @@ impl ::protobuf::Message for Field { if !self.desc.is_empty() { my_size += ::protobuf::rt::string_size(3, &self.desc); } - if self.field_type != super::meta::FieldType::RichText { + if self.field_type != FieldType::RichText { my_size += ::protobuf::rt::enum_size(4, self.field_type); } if self.frozen != false { @@ -535,7 +535,7 @@ impl ::protobuf::Message for Field { if !self.desc.is_empty() { os.write_string(3, &self.desc)?; } - if self.field_type != super::meta::FieldType::RichText { + if self.field_type != FieldType::RichText { os.write_enum(4, ::protobuf::ProtobufEnum::value(&self.field_type))?; } if self.frozen != false { @@ -600,7 +600,7 @@ impl ::protobuf::Message for Field { |m: &Field| { &m.desc }, |m: &mut Field| { &mut m.desc }, )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "field_type", |m: &Field| { &m.field_type }, |m: &mut Field| { &mut m.field_type }, @@ -639,7 +639,7 @@ impl ::protobuf::Clear for Field { self.id.clear(); self.name.clear(); self.desc.clear(); - self.field_type = super::meta::FieldType::RichText; + self.field_type = FieldType::RichText; self.frozen = false; self.visibility = false; self.width = 0; @@ -822,7 +822,7 @@ impl ::protobuf::reflect::ProtobufValue for FieldOrder { pub struct GetEditFieldContextPayload { // message fields pub grid_id: ::std::string::String, - pub field_type: super::meta::FieldType, + pub field_type: FieldType, // message oneof groups pub one_of_field_id: ::std::option::Option, // special fields @@ -924,15 +924,15 @@ impl GetEditFieldContextPayload { // .FieldType field_type = 3; - pub fn get_field_type(&self) -> super::meta::FieldType { + pub fn get_field_type(&self) -> FieldType { self.field_type } pub fn clear_field_type(&mut self) { - self.field_type = super::meta::FieldType::RichText; + self.field_type = FieldType::RichText; } // Param is passed by value, moved - pub fn set_field_type(&mut self, v: super::meta::FieldType) { + pub fn set_field_type(&mut self, v: FieldType) { self.field_type = v; } } @@ -973,7 +973,7 @@ impl ::protobuf::Message for GetEditFieldContextPayload { if !self.grid_id.is_empty() { my_size += ::protobuf::rt::string_size(1, &self.grid_id); } - if self.field_type != super::meta::FieldType::RichText { + if self.field_type != FieldType::RichText { my_size += ::protobuf::rt::enum_size(3, self.field_type); } if let ::std::option::Option::Some(ref v) = self.one_of_field_id { @@ -992,7 +992,7 @@ impl ::protobuf::Message for GetEditFieldContextPayload { if !self.grid_id.is_empty() { os.write_string(1, &self.grid_id)?; } - if self.field_type != super::meta::FieldType::RichText { + if self.field_type != FieldType::RichText { os.write_enum(3, ::protobuf::ProtobufEnum::value(&self.field_type))?; } if let ::std::option::Option::Some(ref v) = self.one_of_field_id { @@ -1050,7 +1050,7 @@ impl ::protobuf::Message for GetEditFieldContextPayload { GetEditFieldContextPayload::has_field_id, GetEditFieldContextPayload::get_field_id, )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "field_type", |m: &GetEditFieldContextPayload| { &m.field_type }, |m: &mut GetEditFieldContextPayload| { &mut m.field_type }, @@ -1073,7 +1073,7 @@ impl ::protobuf::Clear for GetEditFieldContextPayload { fn clear(&mut self) { self.grid_id.clear(); self.one_of_field_id = ::std::option::Option::None; - self.field_type = super::meta::FieldType::RichText; + self.field_type = FieldType::RichText; self.unknown_fields.clear(); } } @@ -1095,7 +1095,7 @@ pub struct EditFieldPayload { // message fields pub grid_id: ::std::string::String, pub field_id: ::std::string::String, - pub field_type: super::meta::FieldType, + pub field_type: FieldType, // special fields pub unknown_fields: ::protobuf::UnknownFields, pub cached_size: ::protobuf::CachedSize, @@ -1167,15 +1167,15 @@ impl EditFieldPayload { // .FieldType field_type = 3; - pub fn get_field_type(&self) -> super::meta::FieldType { + pub fn get_field_type(&self) -> FieldType { self.field_type } pub fn clear_field_type(&mut self) { - self.field_type = super::meta::FieldType::RichText; + self.field_type = FieldType::RichText; } // Param is passed by value, moved - pub fn set_field_type(&mut self, v: super::meta::FieldType) { + pub fn set_field_type(&mut self, v: FieldType) { self.field_type = v; } } @@ -1216,7 +1216,7 @@ impl ::protobuf::Message for EditFieldPayload { if !self.field_id.is_empty() { my_size += ::protobuf::rt::string_size(2, &self.field_id); } - if self.field_type != super::meta::FieldType::RichText { + if self.field_type != FieldType::RichText { my_size += ::protobuf::rt::enum_size(3, self.field_type); } my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); @@ -1231,7 +1231,7 @@ impl ::protobuf::Message for EditFieldPayload { if !self.field_id.is_empty() { os.write_string(2, &self.field_id)?; } - if self.field_type != super::meta::FieldType::RichText { + if self.field_type != FieldType::RichText { os.write_enum(3, ::protobuf::ProtobufEnum::value(&self.field_type))?; } os.write_unknown_fields(self.get_unknown_fields())?; @@ -1282,7 +1282,7 @@ impl ::protobuf::Message for EditFieldPayload { |m: &EditFieldPayload| { &m.field_id }, |m: &mut EditFieldPayload| { &mut m.field_id }, )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "field_type", |m: &EditFieldPayload| { &m.field_type }, |m: &mut EditFieldPayload| { &mut m.field_type }, @@ -1305,7 +1305,7 @@ impl ::protobuf::Clear for EditFieldPayload { fn clear(&mut self) { self.grid_id.clear(); self.field_id.clear(); - self.field_type = super::meta::FieldType::RichText; + self.field_type = FieldType::RichText; self.unknown_fields.clear(); } } @@ -5839,69 +5839,1146 @@ impl ::protobuf::reflect::ProtobufValue for QueryGridBlocksPayload { } } +#[derive(PartialEq,Clone,Default)] +pub struct FieldChangesetPayload { + // message fields + pub field_id: ::std::string::String, + pub grid_id: ::std::string::String, + // message oneof groups + pub one_of_name: ::std::option::Option, + pub one_of_desc: ::std::option::Option, + pub one_of_field_type: ::std::option::Option, + pub one_of_frozen: ::std::option::Option, + pub one_of_visibility: ::std::option::Option, + pub one_of_width: ::std::option::Option, + pub one_of_type_option_data: ::std::option::Option, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a FieldChangesetPayload { + fn default() -> &'a FieldChangesetPayload { + ::default_instance() + } +} + +#[derive(Clone,PartialEq,Debug)] +pub enum FieldChangesetPayload_oneof_one_of_name { + name(::std::string::String), +} + +#[derive(Clone,PartialEq,Debug)] +pub enum FieldChangesetPayload_oneof_one_of_desc { + desc(::std::string::String), +} + +#[derive(Clone,PartialEq,Debug)] +pub enum FieldChangesetPayload_oneof_one_of_field_type { + field_type(FieldType), +} + +#[derive(Clone,PartialEq,Debug)] +pub enum FieldChangesetPayload_oneof_one_of_frozen { + frozen(bool), +} + +#[derive(Clone,PartialEq,Debug)] +pub enum FieldChangesetPayload_oneof_one_of_visibility { + visibility(bool), +} + +#[derive(Clone,PartialEq,Debug)] +pub enum FieldChangesetPayload_oneof_one_of_width { + width(i32), +} + +#[derive(Clone,PartialEq,Debug)] +pub enum FieldChangesetPayload_oneof_one_of_type_option_data { + type_option_data(::std::vec::Vec), +} + +impl FieldChangesetPayload { + pub fn new() -> FieldChangesetPayload { + ::std::default::Default::default() + } + + // string field_id = 1; + + + pub fn get_field_id(&self) -> &str { + &self.field_id + } + pub fn clear_field_id(&mut self) { + self.field_id.clear(); + } + + // Param is passed by value, moved + pub fn set_field_id(&mut self, v: ::std::string::String) { + self.field_id = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_field_id(&mut self) -> &mut ::std::string::String { + &mut self.field_id + } + + // Take field + pub fn take_field_id(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.field_id, ::std::string::String::new()) + } + + // string grid_id = 2; + + + pub fn get_grid_id(&self) -> &str { + &self.grid_id + } + pub fn clear_grid_id(&mut self) { + self.grid_id.clear(); + } + + // Param is passed by value, moved + pub fn set_grid_id(&mut self, v: ::std::string::String) { + self.grid_id = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_grid_id(&mut self) -> &mut ::std::string::String { + &mut self.grid_id + } + + // Take field + pub fn take_grid_id(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.grid_id, ::std::string::String::new()) + } + + // string name = 3; + + + pub fn get_name(&self) -> &str { + match self.one_of_name { + ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_name::name(ref v)) => v, + _ => "", + } + } + pub fn clear_name(&mut self) { + self.one_of_name = ::std::option::Option::None; + } + + pub fn has_name(&self) -> bool { + match self.one_of_name { + ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_name::name(..)) => true, + _ => false, + } + } + + // Param is passed by value, moved + pub fn set_name(&mut self, v: ::std::string::String) { + self.one_of_name = ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_name::name(v)) + } + + // Mutable pointer to the field. + pub fn mut_name(&mut self) -> &mut ::std::string::String { + if let ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_name::name(_)) = self.one_of_name { + } else { + self.one_of_name = ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_name::name(::std::string::String::new())); + } + match self.one_of_name { + ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_name::name(ref mut v)) => v, + _ => panic!(), + } + } + + // Take field + pub fn take_name(&mut self) -> ::std::string::String { + if self.has_name() { + match self.one_of_name.take() { + ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_name::name(v)) => v, + _ => panic!(), + } + } else { + ::std::string::String::new() + } + } + + // string desc = 4; + + + pub fn get_desc(&self) -> &str { + match self.one_of_desc { + ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_desc::desc(ref v)) => v, + _ => "", + } + } + pub fn clear_desc(&mut self) { + self.one_of_desc = ::std::option::Option::None; + } + + pub fn has_desc(&self) -> bool { + match self.one_of_desc { + ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_desc::desc(..)) => true, + _ => false, + } + } + + // Param is passed by value, moved + pub fn set_desc(&mut self, v: ::std::string::String) { + self.one_of_desc = ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_desc::desc(v)) + } + + // Mutable pointer to the field. + pub fn mut_desc(&mut self) -> &mut ::std::string::String { + if let ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_desc::desc(_)) = self.one_of_desc { + } else { + self.one_of_desc = ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_desc::desc(::std::string::String::new())); + } + match self.one_of_desc { + ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_desc::desc(ref mut v)) => v, + _ => panic!(), + } + } + + // Take field + pub fn take_desc(&mut self) -> ::std::string::String { + if self.has_desc() { + match self.one_of_desc.take() { + ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_desc::desc(v)) => v, + _ => panic!(), + } + } else { + ::std::string::String::new() + } + } + + // .FieldType field_type = 5; + + + pub fn get_field_type(&self) -> FieldType { + match self.one_of_field_type { + ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_field_type::field_type(v)) => v, + _ => FieldType::RichText, + } + } + pub fn clear_field_type(&mut self) { + self.one_of_field_type = ::std::option::Option::None; + } + + pub fn has_field_type(&self) -> bool { + match self.one_of_field_type { + ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_field_type::field_type(..)) => true, + _ => false, + } + } + + // Param is passed by value, moved + pub fn set_field_type(&mut self, v: FieldType) { + self.one_of_field_type = ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_field_type::field_type(v)) + } + + // bool frozen = 6; + + + pub fn get_frozen(&self) -> bool { + match self.one_of_frozen { + ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_frozen::frozen(v)) => v, + _ => false, + } + } + pub fn clear_frozen(&mut self) { + self.one_of_frozen = ::std::option::Option::None; + } + + pub fn has_frozen(&self) -> bool { + match self.one_of_frozen { + ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_frozen::frozen(..)) => true, + _ => false, + } + } + + // Param is passed by value, moved + pub fn set_frozen(&mut self, v: bool) { + self.one_of_frozen = ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_frozen::frozen(v)) + } + + // bool visibility = 7; + + + pub fn get_visibility(&self) -> bool { + match self.one_of_visibility { + ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_visibility::visibility(v)) => v, + _ => false, + } + } + pub fn clear_visibility(&mut self) { + self.one_of_visibility = ::std::option::Option::None; + } + + pub fn has_visibility(&self) -> bool { + match self.one_of_visibility { + ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_visibility::visibility(..)) => true, + _ => false, + } + } + + // Param is passed by value, moved + pub fn set_visibility(&mut self, v: bool) { + self.one_of_visibility = ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_visibility::visibility(v)) + } + + // int32 width = 8; + + + pub fn get_width(&self) -> i32 { + match self.one_of_width { + ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_width::width(v)) => v, + _ => 0, + } + } + pub fn clear_width(&mut self) { + self.one_of_width = ::std::option::Option::None; + } + + pub fn has_width(&self) -> bool { + match self.one_of_width { + ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_width::width(..)) => true, + _ => false, + } + } + + // Param is passed by value, moved + pub fn set_width(&mut self, v: i32) { + self.one_of_width = ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_width::width(v)) + } + + // bytes type_option_data = 9; + + + pub fn get_type_option_data(&self) -> &[u8] { + match self.one_of_type_option_data { + ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_type_option_data::type_option_data(ref v)) => v, + _ => &[], + } + } + pub fn clear_type_option_data(&mut self) { + self.one_of_type_option_data = ::std::option::Option::None; + } + + pub fn has_type_option_data(&self) -> bool { + match self.one_of_type_option_data { + ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_type_option_data::type_option_data(..)) => true, + _ => false, + } + } + + // Param is passed by value, moved + pub fn set_type_option_data(&mut self, v: ::std::vec::Vec) { + self.one_of_type_option_data = ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_type_option_data::type_option_data(v)) + } + + // Mutable pointer to the field. + pub fn mut_type_option_data(&mut self) -> &mut ::std::vec::Vec { + if let ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_type_option_data::type_option_data(_)) = self.one_of_type_option_data { + } else { + self.one_of_type_option_data = ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_type_option_data::type_option_data(::std::vec::Vec::new())); + } + match self.one_of_type_option_data { + ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_type_option_data::type_option_data(ref mut v)) => v, + _ => panic!(), + } + } + + // Take field + pub fn take_type_option_data(&mut self) -> ::std::vec::Vec { + if self.has_type_option_data() { + match self.one_of_type_option_data.take() { + ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_type_option_data::type_option_data(v)) => v, + _ => panic!(), + } + } else { + ::std::vec::Vec::new() + } + } +} + +impl ::protobuf::Message for FieldChangesetPayload { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.field_id)?; + }, + 2 => { + ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.grid_id)?; + }, + 3 => { + if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + self.one_of_name = ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_name::name(is.read_string()?)); + }, + 4 => { + if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + self.one_of_desc = ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_desc::desc(is.read_string()?)); + }, + 5 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + self.one_of_field_type = ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_field_type::field_type(is.read_enum()?)); + }, + 6 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + self.one_of_frozen = ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_frozen::frozen(is.read_bool()?)); + }, + 7 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + self.one_of_visibility = ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_visibility::visibility(is.read_bool()?)); + }, + 8 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + self.one_of_width = ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_width::width(is.read_int32()?)); + }, + 9 => { + if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + self.one_of_type_option_data = ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_type_option_data::type_option_data(is.read_bytes()?)); + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if !self.field_id.is_empty() { + my_size += ::protobuf::rt::string_size(1, &self.field_id); + } + if !self.grid_id.is_empty() { + my_size += ::protobuf::rt::string_size(2, &self.grid_id); + } + if let ::std::option::Option::Some(ref v) = self.one_of_name { + match v { + &FieldChangesetPayload_oneof_one_of_name::name(ref v) => { + my_size += ::protobuf::rt::string_size(3, &v); + }, + }; + } + if let ::std::option::Option::Some(ref v) = self.one_of_desc { + match v { + &FieldChangesetPayload_oneof_one_of_desc::desc(ref v) => { + my_size += ::protobuf::rt::string_size(4, &v); + }, + }; + } + if let ::std::option::Option::Some(ref v) = self.one_of_field_type { + match v { + &FieldChangesetPayload_oneof_one_of_field_type::field_type(v) => { + my_size += ::protobuf::rt::enum_size(5, v); + }, + }; + } + if let ::std::option::Option::Some(ref v) = self.one_of_frozen { + match v { + &FieldChangesetPayload_oneof_one_of_frozen::frozen(v) => { + my_size += 2; + }, + }; + } + if let ::std::option::Option::Some(ref v) = self.one_of_visibility { + match v { + &FieldChangesetPayload_oneof_one_of_visibility::visibility(v) => { + my_size += 2; + }, + }; + } + if let ::std::option::Option::Some(ref v) = self.one_of_width { + match v { + &FieldChangesetPayload_oneof_one_of_width::width(v) => { + my_size += ::protobuf::rt::value_size(8, v, ::protobuf::wire_format::WireTypeVarint); + }, + }; + } + if let ::std::option::Option::Some(ref v) = self.one_of_type_option_data { + match v { + &FieldChangesetPayload_oneof_one_of_type_option_data::type_option_data(ref v) => { + my_size += ::protobuf::rt::bytes_size(9, &v); + }, + }; + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { + if !self.field_id.is_empty() { + os.write_string(1, &self.field_id)?; + } + if !self.grid_id.is_empty() { + os.write_string(2, &self.grid_id)?; + } + if let ::std::option::Option::Some(ref v) = self.one_of_name { + match v { + &FieldChangesetPayload_oneof_one_of_name::name(ref v) => { + os.write_string(3, v)?; + }, + }; + } + if let ::std::option::Option::Some(ref v) = self.one_of_desc { + match v { + &FieldChangesetPayload_oneof_one_of_desc::desc(ref v) => { + os.write_string(4, v)?; + }, + }; + } + if let ::std::option::Option::Some(ref v) = self.one_of_field_type { + match v { + &FieldChangesetPayload_oneof_one_of_field_type::field_type(v) => { + os.write_enum(5, ::protobuf::ProtobufEnum::value(&v))?; + }, + }; + } + if let ::std::option::Option::Some(ref v) = self.one_of_frozen { + match v { + &FieldChangesetPayload_oneof_one_of_frozen::frozen(v) => { + os.write_bool(6, v)?; + }, + }; + } + if let ::std::option::Option::Some(ref v) = self.one_of_visibility { + match v { + &FieldChangesetPayload_oneof_one_of_visibility::visibility(v) => { + os.write_bool(7, v)?; + }, + }; + } + if let ::std::option::Option::Some(ref v) = self.one_of_width { + match v { + &FieldChangesetPayload_oneof_one_of_width::width(v) => { + os.write_int32(8, v)?; + }, + }; + } + if let ::std::option::Option::Some(ref v) = self.one_of_type_option_data { + match v { + &FieldChangesetPayload_oneof_one_of_type_option_data::type_option_data(ref v) => { + os.write_bytes(9, v)?; + }, + }; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> FieldChangesetPayload { + FieldChangesetPayload::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "field_id", + |m: &FieldChangesetPayload| { &m.field_id }, + |m: &mut FieldChangesetPayload| { &mut m.field_id }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "grid_id", + |m: &FieldChangesetPayload| { &m.grid_id }, + |m: &mut FieldChangesetPayload| { &mut m.grid_id }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>( + "name", + FieldChangesetPayload::has_name, + FieldChangesetPayload::get_name, + )); + fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>( + "desc", + FieldChangesetPayload::has_desc, + FieldChangesetPayload::get_desc, + )); + fields.push(::protobuf::reflect::accessor::make_singular_enum_accessor::<_, FieldType>( + "field_type", + FieldChangesetPayload::has_field_type, + FieldChangesetPayload::get_field_type, + )); + fields.push(::protobuf::reflect::accessor::make_singular_bool_accessor::<_>( + "frozen", + FieldChangesetPayload::has_frozen, + FieldChangesetPayload::get_frozen, + )); + fields.push(::protobuf::reflect::accessor::make_singular_bool_accessor::<_>( + "visibility", + FieldChangesetPayload::has_visibility, + FieldChangesetPayload::get_visibility, + )); + fields.push(::protobuf::reflect::accessor::make_singular_i32_accessor::<_>( + "width", + FieldChangesetPayload::has_width, + FieldChangesetPayload::get_width, + )); + fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor::<_>( + "type_option_data", + FieldChangesetPayload::has_type_option_data, + FieldChangesetPayload::get_type_option_data, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "FieldChangesetPayload", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static FieldChangesetPayload { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(FieldChangesetPayload::new) + } +} + +impl ::protobuf::Clear for FieldChangesetPayload { + fn clear(&mut self) { + self.field_id.clear(); + self.grid_id.clear(); + self.one_of_name = ::std::option::Option::None; + self.one_of_desc = ::std::option::Option::None; + self.one_of_field_type = ::std::option::Option::None; + self.one_of_frozen = ::std::option::Option::None; + self.one_of_visibility = ::std::option::Option::None; + self.one_of_width = ::std::option::Option::None; + self.one_of_type_option_data = ::std::option::Option::None; + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for FieldChangesetPayload { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for FieldChangesetPayload { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct CellChangeset { + // message fields + pub grid_id: ::std::string::String, + pub row_id: ::std::string::String, + pub field_id: ::std::string::String, + // message oneof groups + pub one_of_data: ::std::option::Option, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a CellChangeset { + fn default() -> &'a CellChangeset { + ::default_instance() + } +} + +#[derive(Clone,PartialEq,Debug)] +pub enum CellChangeset_oneof_one_of_data { + data(::std::string::String), +} + +impl CellChangeset { + pub fn new() -> CellChangeset { + ::std::default::Default::default() + } + + // string grid_id = 1; + + + pub fn get_grid_id(&self) -> &str { + &self.grid_id + } + pub fn clear_grid_id(&mut self) { + self.grid_id.clear(); + } + + // Param is passed by value, moved + pub fn set_grid_id(&mut self, v: ::std::string::String) { + self.grid_id = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_grid_id(&mut self) -> &mut ::std::string::String { + &mut self.grid_id + } + + // Take field + pub fn take_grid_id(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.grid_id, ::std::string::String::new()) + } + + // string row_id = 2; + + + pub fn get_row_id(&self) -> &str { + &self.row_id + } + pub fn clear_row_id(&mut self) { + self.row_id.clear(); + } + + // Param is passed by value, moved + pub fn set_row_id(&mut self, v: ::std::string::String) { + self.row_id = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_row_id(&mut self) -> &mut ::std::string::String { + &mut self.row_id + } + + // Take field + pub fn take_row_id(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.row_id, ::std::string::String::new()) + } + + // string field_id = 3; + + + pub fn get_field_id(&self) -> &str { + &self.field_id + } + pub fn clear_field_id(&mut self) { + self.field_id.clear(); + } + + // Param is passed by value, moved + pub fn set_field_id(&mut self, v: ::std::string::String) { + self.field_id = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_field_id(&mut self) -> &mut ::std::string::String { + &mut self.field_id + } + + // Take field + pub fn take_field_id(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.field_id, ::std::string::String::new()) + } + + // string data = 4; + + + pub fn get_data(&self) -> &str { + match self.one_of_data { + ::std::option::Option::Some(CellChangeset_oneof_one_of_data::data(ref v)) => v, + _ => "", + } + } + pub fn clear_data(&mut self) { + self.one_of_data = ::std::option::Option::None; + } + + pub fn has_data(&self) -> bool { + match self.one_of_data { + ::std::option::Option::Some(CellChangeset_oneof_one_of_data::data(..)) => true, + _ => false, + } + } + + // Param is passed by value, moved + pub fn set_data(&mut self, v: ::std::string::String) { + self.one_of_data = ::std::option::Option::Some(CellChangeset_oneof_one_of_data::data(v)) + } + + // Mutable pointer to the field. + pub fn mut_data(&mut self) -> &mut ::std::string::String { + if let ::std::option::Option::Some(CellChangeset_oneof_one_of_data::data(_)) = self.one_of_data { + } else { + self.one_of_data = ::std::option::Option::Some(CellChangeset_oneof_one_of_data::data(::std::string::String::new())); + } + match self.one_of_data { + ::std::option::Option::Some(CellChangeset_oneof_one_of_data::data(ref mut v)) => v, + _ => panic!(), + } + } + + // Take field + pub fn take_data(&mut self) -> ::std::string::String { + if self.has_data() { + match self.one_of_data.take() { + ::std::option::Option::Some(CellChangeset_oneof_one_of_data::data(v)) => v, + _ => panic!(), + } + } else { + ::std::string::String::new() + } + } +} + +impl ::protobuf::Message for CellChangeset { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.grid_id)?; + }, + 2 => { + ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.row_id)?; + }, + 3 => { + ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.field_id)?; + }, + 4 => { + if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + self.one_of_data = ::std::option::Option::Some(CellChangeset_oneof_one_of_data::data(is.read_string()?)); + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if !self.grid_id.is_empty() { + my_size += ::protobuf::rt::string_size(1, &self.grid_id); + } + if !self.row_id.is_empty() { + my_size += ::protobuf::rt::string_size(2, &self.row_id); + } + if !self.field_id.is_empty() { + my_size += ::protobuf::rt::string_size(3, &self.field_id); + } + if let ::std::option::Option::Some(ref v) = self.one_of_data { + match v { + &CellChangeset_oneof_one_of_data::data(ref v) => { + my_size += ::protobuf::rt::string_size(4, &v); + }, + }; + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { + if !self.grid_id.is_empty() { + os.write_string(1, &self.grid_id)?; + } + if !self.row_id.is_empty() { + os.write_string(2, &self.row_id)?; + } + if !self.field_id.is_empty() { + os.write_string(3, &self.field_id)?; + } + if let ::std::option::Option::Some(ref v) = self.one_of_data { + match v { + &CellChangeset_oneof_one_of_data::data(ref v) => { + os.write_string(4, v)?; + }, + }; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> CellChangeset { + CellChangeset::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "grid_id", + |m: &CellChangeset| { &m.grid_id }, + |m: &mut CellChangeset| { &mut m.grid_id }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "row_id", + |m: &CellChangeset| { &m.row_id }, + |m: &mut CellChangeset| { &mut m.row_id }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "field_id", + |m: &CellChangeset| { &m.field_id }, + |m: &mut CellChangeset| { &mut m.field_id }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>( + "data", + CellChangeset::has_data, + CellChangeset::get_data, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "CellChangeset", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static CellChangeset { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(CellChangeset::new) + } +} + +impl ::protobuf::Clear for CellChangeset { + fn clear(&mut self) { + self.grid_id.clear(); + self.row_id.clear(); + self.field_id.clear(); + self.one_of_data = ::std::option::Option::None; + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for CellChangeset { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CellChangeset { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(Clone,PartialEq,Eq,Debug,Hash)] +pub enum FieldType { + RichText = 0, + Number = 1, + DateTime = 2, + SingleSelect = 3, + MultiSelect = 4, + Checkbox = 5, +} + +impl ::protobuf::ProtobufEnum for FieldType { + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(FieldType::RichText), + 1 => ::std::option::Option::Some(FieldType::Number), + 2 => ::std::option::Option::Some(FieldType::DateTime), + 3 => ::std::option::Option::Some(FieldType::SingleSelect), + 4 => ::std::option::Option::Some(FieldType::MultiSelect), + 5 => ::std::option::Option::Some(FieldType::Checkbox), + _ => ::std::option::Option::None + } + } + + fn values() -> &'static [Self] { + static values: &'static [FieldType] = &[ + FieldType::RichText, + FieldType::Number, + FieldType::DateTime, + FieldType::SingleSelect, + FieldType::MultiSelect, + FieldType::Checkbox, + ]; + values + } + + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + ::protobuf::reflect::EnumDescriptor::new_pb_name::("FieldType", file_descriptor_proto()) + }) + } +} + +impl ::std::marker::Copy for FieldType { +} + +impl ::std::default::Default for FieldType { + fn default() -> Self { + FieldType::RichText + } +} + +impl ::protobuf::reflect::ProtobufValue for FieldType { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self)) + } +} + static file_descriptor_proto_data: &'static [u8] = b"\ - \n\ngrid.proto\x1a\nmeta.proto\"z\n\x04Grid\x12\x0e\n\x02id\x18\x01\x20\ - \x01(\tR\x02id\x12.\n\x0cfield_orders\x18\x02\x20\x03(\x0b2\x0b.FieldOrd\ - erR\x0bfieldOrders\x122\n\x0cblock_orders\x18\x03\x20\x03(\x0b2\x0f.Grid\ - BlockOrderR\x0bblockOrders\"\xb8\x01\n\x05Field\x12\x0e\n\x02id\x18\x01\ - \x20\x01(\tR\x02id\x12\x12\n\x04name\x18\x02\x20\x01(\tR\x04name\x12\x12\ - \n\x04desc\x18\x03\x20\x01(\tR\x04desc\x12)\n\nfield_type\x18\x04\x20\ - \x01(\x0e2\n.FieldTypeR\tfieldType\x12\x16\n\x06frozen\x18\x05\x20\x01(\ - \x08R\x06frozen\x12\x1e\n\nvisibility\x18\x06\x20\x01(\x08R\nvisibility\ - \x12\x14\n\x05width\x18\x07\x20\x01(\x05R\x05width\"'\n\nFieldOrder\x12\ - \x19\n\x08field_id\x18\x01\x20\x01(\tR\x07fieldId\"\x90\x01\n\x1aGetEdit\ - FieldContextPayload\x12\x17\n\x07grid_id\x18\x01\x20\x01(\tR\x06gridId\ - \x12\x1b\n\x08field_id\x18\x02\x20\x01(\tH\0R\x07fieldId\x12)\n\nfield_t\ - ype\x18\x03\x20\x01(\x0e2\n.FieldTypeR\tfieldTypeB\x11\n\x0fone_of_field\ - _id\"q\n\x10EditFieldPayload\x12\x17\n\x07grid_id\x18\x01\x20\x01(\tR\ - \x06gridId\x12\x19\n\x08field_id\x18\x02\x20\x01(\tR\x07fieldId\x12)\n\n\ - field_type\x18\x03\x20\x01(\x0e2\n.FieldTypeR\tfieldType\"|\n\x10EditFie\ - ldContext\x12\x17\n\x07grid_id\x18\x01\x20\x01(\tR\x06gridId\x12%\n\ngri\ - d_field\x18\x02\x20\x01(\x0b2\x06.FieldR\tgridField\x12(\n\x10type_optio\ - n_data\x18\x03\x20\x01(\x0cR\x0etypeOptionData\"-\n\rRepeatedField\x12\ - \x1c\n\x05items\x18\x01\x20\x03(\x0b2\x06.FieldR\x05items\"7\n\x12Repeat\ - edFieldOrder\x12!\n\x05items\x18\x01\x20\x03(\x0b2\x0b.FieldOrderR\x05it\ - ems\"T\n\x08RowOrder\x12\x15\n\x06row_id\x18\x01\x20\x01(\tR\x05rowId\ - \x12\x19\n\x08block_id\x18\x02\x20\x01(\tR\x07blockId\x12\x16\n\x06heigh\ - t\x18\x03\x20\x01(\x05R\x06height\"\xb8\x01\n\x03Row\x12\x0e\n\x02id\x18\ - \x01\x20\x01(\tR\x02id\x12@\n\x10cell_by_field_id\x18\x02\x20\x03(\x0b2\ - \x17.Row.CellByFieldIdEntryR\rcellByFieldId\x12\x16\n\x06height\x18\x03\ - \x20\x01(\x05R\x06height\x1aG\n\x12CellByFieldIdEntry\x12\x10\n\x03key\ - \x18\x01\x20\x01(\tR\x03key\x12\x1b\n\x05value\x18\x02\x20\x01(\x0b2\x05\ - .CellR\x05value:\x028\x01\")\n\x0bRepeatedRow\x12\x1a\n\x05items\x18\x01\ - \x20\x03(\x0b2\x04.RowR\x05items\"5\n\x11RepeatedGridBlock\x12\x20\n\x05\ - items\x18\x01\x20\x03(\x0b2\n.GridBlockR\x05items\"U\n\x0eGridBlockOrder\ - \x12\x19\n\x08block_id\x18\x01\x20\x01(\tR\x07blockId\x12(\n\nrow_orders\ - \x18\x02\x20\x03(\x0b2\t.RowOrderR\trowOrders\"\xc5\x01\n\x17GridBlockOr\ - derChangeset\x12\x19\n\x08block_id\x18\x01\x20\x01(\tR\x07blockId\x123\n\ - \rinserted_rows\x18\x02\x20\x03(\x0b2\x0e.IndexRowOrderR\x0cinsertedRows\ - \x12,\n\x0cdeleted_rows\x18\x03\x20\x03(\x0b2\t.RowOrderR\x0bdeletedRows\ - \x12,\n\x0cupdated_rows\x18\x04\x20\x03(\x0b2\t.RowOrderR\x0bupdatedRows\ - \"_\n\rIndexRowOrder\x12&\n\trow_order\x18\x01\x20\x01(\x0b2\t.RowOrderR\ - \x08rowOrder\x12\x16\n\x05index\x18\x02\x20\x01(\x05H\0R\x05indexB\x0e\n\ - \x0cone_of_index\"E\n\tGridBlock\x12\x0e\n\x02id\x18\x01\x20\x01(\tR\x02\ - id\x12(\n\nrow_orders\x18\x02\x20\x03(\x0b2\t.RowOrderR\trowOrders\";\n\ - \x04Cell\x12\x19\n\x08field_id\x18\x01\x20\x01(\tR\x07fieldId\x12\x18\n\ - \x07content\x18\x02\x20\x01(\tR\x07content\"\x8f\x01\n\x14CellNotificati\ - onData\x12\x17\n\x07grid_id\x18\x01\x20\x01(\tR\x06gridId\x12\x19\n\x08f\ - ield_id\x18\x02\x20\x01(\tR\x07fieldId\x12\x15\n\x06row_id\x18\x03\x20\ - \x01(\tR\x05rowId\x12\x1a\n\x07content\x18\x04\x20\x01(\tH\0R\x07content\ - B\x10\n\x0eone_of_content\"+\n\x0cRepeatedCell\x12\x1b\n\x05items\x18\ - \x01\x20\x03(\x0b2\x05.CellR\x05items\"'\n\x11CreateGridPayload\x12\x12\ - \n\x04name\x18\x01\x20\x01(\tR\x04name\"\x1e\n\x06GridId\x12\x14\n\x05va\ - lue\x18\x01\x20\x01(\tR\x05value\"#\n\x0bGridBlockId\x12\x14\n\x05value\ - \x18\x01\x20\x01(\tR\x05value\"f\n\x10CreateRowPayload\x12\x17\n\x07grid\ - _id\x18\x01\x20\x01(\tR\x06gridId\x12\"\n\x0cstart_row_id\x18\x02\x20\ - \x01(\tH\0R\nstartRowIdB\x15\n\x13one_of_start_row_id\"\xb6\x01\n\x12Cre\ - ateFieldPayload\x12\x17\n\x07grid_id\x18\x01\x20\x01(\tR\x06gridId\x12\ - \x1c\n\x05field\x18\x02\x20\x01(\x0b2\x06.FieldR\x05field\x12(\n\x10type\ - _option_data\x18\x03\x20\x01(\x0cR\x0etypeOptionData\x12&\n\x0estart_fie\ - ld_id\x18\x04\x20\x01(\tH\0R\x0cstartFieldIdB\x17\n\x15one_of_start_fiel\ - d_id\"d\n\x11QueryFieldPayload\x12\x17\n\x07grid_id\x18\x01\x20\x01(\tR\ - \x06gridId\x126\n\x0cfield_orders\x18\x02\x20\x01(\x0b2\x13.RepeatedFiel\ - dOrderR\x0bfieldOrders\"e\n\x16QueryGridBlocksPayload\x12\x17\n\x07grid_\ - id\x18\x01\x20\x01(\tR\x06gridId\x122\n\x0cblock_orders\x18\x02\x20\x03(\ - \x0b2\x0f.GridBlockOrderR\x0bblockOrdersb\x06proto3\ + \n\ngrid.proto\"z\n\x04Grid\x12\x0e\n\x02id\x18\x01\x20\x01(\tR\x02id\ + \x12.\n\x0cfield_orders\x18\x02\x20\x03(\x0b2\x0b.FieldOrderR\x0bfieldOr\ + ders\x122\n\x0cblock_orders\x18\x03\x20\x03(\x0b2\x0f.GridBlockOrderR\ + \x0bblockOrders\"\xb8\x01\n\x05Field\x12\x0e\n\x02id\x18\x01\x20\x01(\tR\ + \x02id\x12\x12\n\x04name\x18\x02\x20\x01(\tR\x04name\x12\x12\n\x04desc\ + \x18\x03\x20\x01(\tR\x04desc\x12)\n\nfield_type\x18\x04\x20\x01(\x0e2\n.\ + FieldTypeR\tfieldType\x12\x16\n\x06frozen\x18\x05\x20\x01(\x08R\x06froze\ + n\x12\x1e\n\nvisibility\x18\x06\x20\x01(\x08R\nvisibility\x12\x14\n\x05w\ + idth\x18\x07\x20\x01(\x05R\x05width\"'\n\nFieldOrder\x12\x19\n\x08field_\ + id\x18\x01\x20\x01(\tR\x07fieldId\"\x90\x01\n\x1aGetEditFieldContextPayl\ + oad\x12\x17\n\x07grid_id\x18\x01\x20\x01(\tR\x06gridId\x12\x1b\n\x08fiel\ + d_id\x18\x02\x20\x01(\tH\0R\x07fieldId\x12)\n\nfield_type\x18\x03\x20\ + \x01(\x0e2\n.FieldTypeR\tfieldTypeB\x11\n\x0fone_of_field_id\"q\n\x10Edi\ + tFieldPayload\x12\x17\n\x07grid_id\x18\x01\x20\x01(\tR\x06gridId\x12\x19\ + \n\x08field_id\x18\x02\x20\x01(\tR\x07fieldId\x12)\n\nfield_type\x18\x03\ + \x20\x01(\x0e2\n.FieldTypeR\tfieldType\"|\n\x10EditFieldContext\x12\x17\ + \n\x07grid_id\x18\x01\x20\x01(\tR\x06gridId\x12%\n\ngrid_field\x18\x02\ + \x20\x01(\x0b2\x06.FieldR\tgridField\x12(\n\x10type_option_data\x18\x03\ + \x20\x01(\x0cR\x0etypeOptionData\"-\n\rRepeatedField\x12\x1c\n\x05items\ + \x18\x01\x20\x03(\x0b2\x06.FieldR\x05items\"7\n\x12RepeatedFieldOrder\ + \x12!\n\x05items\x18\x01\x20\x03(\x0b2\x0b.FieldOrderR\x05items\"T\n\x08\ + RowOrder\x12\x15\n\x06row_id\x18\x01\x20\x01(\tR\x05rowId\x12\x19\n\x08b\ + lock_id\x18\x02\x20\x01(\tR\x07blockId\x12\x16\n\x06height\x18\x03\x20\ + \x01(\x05R\x06height\"\xb8\x01\n\x03Row\x12\x0e\n\x02id\x18\x01\x20\x01(\ + \tR\x02id\x12@\n\x10cell_by_field_id\x18\x02\x20\x03(\x0b2\x17.Row.CellB\ + yFieldIdEntryR\rcellByFieldId\x12\x16\n\x06height\x18\x03\x20\x01(\x05R\ + \x06height\x1aG\n\x12CellByFieldIdEntry\x12\x10\n\x03key\x18\x01\x20\x01\ + (\tR\x03key\x12\x1b\n\x05value\x18\x02\x20\x01(\x0b2\x05.CellR\x05value:\ + \x028\x01\")\n\x0bRepeatedRow\x12\x1a\n\x05items\x18\x01\x20\x03(\x0b2\ + \x04.RowR\x05items\"5\n\x11RepeatedGridBlock\x12\x20\n\x05items\x18\x01\ + \x20\x03(\x0b2\n.GridBlockR\x05items\"U\n\x0eGridBlockOrder\x12\x19\n\ + \x08block_id\x18\x01\x20\x01(\tR\x07blockId\x12(\n\nrow_orders\x18\x02\ + \x20\x03(\x0b2\t.RowOrderR\trowOrders\"\xc5\x01\n\x17GridBlockOrderChang\ + eset\x12\x19\n\x08block_id\x18\x01\x20\x01(\tR\x07blockId\x123\n\rinsert\ + ed_rows\x18\x02\x20\x03(\x0b2\x0e.IndexRowOrderR\x0cinsertedRows\x12,\n\ + \x0cdeleted_rows\x18\x03\x20\x03(\x0b2\t.RowOrderR\x0bdeletedRows\x12,\n\ + \x0cupdated_rows\x18\x04\x20\x03(\x0b2\t.RowOrderR\x0bupdatedRows\"_\n\r\ + IndexRowOrder\x12&\n\trow_order\x18\x01\x20\x01(\x0b2\t.RowOrderR\x08row\ + Order\x12\x16\n\x05index\x18\x02\x20\x01(\x05H\0R\x05indexB\x0e\n\x0cone\ + _of_index\"E\n\tGridBlock\x12\x0e\n\x02id\x18\x01\x20\x01(\tR\x02id\x12(\ + \n\nrow_orders\x18\x02\x20\x03(\x0b2\t.RowOrderR\trowOrders\";\n\x04Cell\ + \x12\x19\n\x08field_id\x18\x01\x20\x01(\tR\x07fieldId\x12\x18\n\x07conte\ + nt\x18\x02\x20\x01(\tR\x07content\"\x8f\x01\n\x14CellNotificationData\ + \x12\x17\n\x07grid_id\x18\x01\x20\x01(\tR\x06gridId\x12\x19\n\x08field_i\ + d\x18\x02\x20\x01(\tR\x07fieldId\x12\x15\n\x06row_id\x18\x03\x20\x01(\tR\ + \x05rowId\x12\x1a\n\x07content\x18\x04\x20\x01(\tH\0R\x07contentB\x10\n\ + \x0eone_of_content\"+\n\x0cRepeatedCell\x12\x1b\n\x05items\x18\x01\x20\ + \x03(\x0b2\x05.CellR\x05items\"'\n\x11CreateGridPayload\x12\x12\n\x04nam\ + e\x18\x01\x20\x01(\tR\x04name\"\x1e\n\x06GridId\x12\x14\n\x05value\x18\ + \x01\x20\x01(\tR\x05value\"#\n\x0bGridBlockId\x12\x14\n\x05value\x18\x01\ + \x20\x01(\tR\x05value\"f\n\x10CreateRowPayload\x12\x17\n\x07grid_id\x18\ + \x01\x20\x01(\tR\x06gridId\x12\"\n\x0cstart_row_id\x18\x02\x20\x01(\tH\0\ + R\nstartRowIdB\x15\n\x13one_of_start_row_id\"\xb6\x01\n\x12CreateFieldPa\ + yload\x12\x17\n\x07grid_id\x18\x01\x20\x01(\tR\x06gridId\x12\x1c\n\x05fi\ + eld\x18\x02\x20\x01(\x0b2\x06.FieldR\x05field\x12(\n\x10type_option_data\ + \x18\x03\x20\x01(\x0cR\x0etypeOptionData\x12&\n\x0estart_field_id\x18\ + \x04\x20\x01(\tH\0R\x0cstartFieldIdB\x17\n\x15one_of_start_field_id\"d\n\ + \x11QueryFieldPayload\x12\x17\n\x07grid_id\x18\x01\x20\x01(\tR\x06gridId\ + \x126\n\x0cfield_orders\x18\x02\x20\x01(\x0b2\x13.RepeatedFieldOrderR\ + \x0bfieldOrders\"e\n\x16QueryGridBlocksPayload\x12\x17\n\x07grid_id\x18\ + \x01\x20\x01(\tR\x06gridId\x122\n\x0cblock_orders\x18\x02\x20\x03(\x0b2\ + \x0f.GridBlockOrderR\x0bblockOrders\"\xa8\x03\n\x15FieldChangesetPayload\ + \x12\x19\n\x08field_id\x18\x01\x20\x01(\tR\x07fieldId\x12\x17\n\x07grid_\ + id\x18\x02\x20\x01(\tR\x06gridId\x12\x14\n\x04name\x18\x03\x20\x01(\tH\0\ + R\x04name\x12\x14\n\x04desc\x18\x04\x20\x01(\tH\x01R\x04desc\x12+\n\nfie\ + ld_type\x18\x05\x20\x01(\x0e2\n.FieldTypeH\x02R\tfieldType\x12\x18\n\x06\ + frozen\x18\x06\x20\x01(\x08H\x03R\x06frozen\x12\x20\n\nvisibility\x18\ + \x07\x20\x01(\x08H\x04R\nvisibility\x12\x16\n\x05width\x18\x08\x20\x01(\ + \x05H\x05R\x05width\x12*\n\x10type_option_data\x18\t\x20\x01(\x0cH\x06R\ + \x0etypeOptionDataB\r\n\x0bone_of_nameB\r\n\x0bone_of_descB\x13\n\x11one\ + _of_field_typeB\x0f\n\rone_of_frozenB\x13\n\x11one_of_visibilityB\x0e\n\ + \x0cone_of_widthB\x19\n\x17one_of_type_option_data\"\x7f\n\rCellChangese\ + t\x12\x17\n\x07grid_id\x18\x01\x20\x01(\tR\x06gridId\x12\x15\n\x06row_id\ + \x18\x02\x20\x01(\tR\x05rowId\x12\x19\n\x08field_id\x18\x03\x20\x01(\tR\ + \x07fieldId\x12\x14\n\x04data\x18\x04\x20\x01(\tH\0R\x04dataB\r\n\x0bone\ + _of_data*d\n\tFieldType\x12\x0c\n\x08RichText\x10\0\x12\n\n\x06Number\ + \x10\x01\x12\x0c\n\x08DateTime\x10\x02\x12\x10\n\x0cSingleSelect\x10\x03\ + \x12\x0f\n\x0bMultiSelect\x10\x04\x12\x0c\n\x08Checkbox\x10\x05b\x06prot\ + o3\ "; static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT; diff --git a/shared-lib/flowy-grid-data-model/src/protobuf/model/meta.rs b/shared-lib/flowy-grid-data-model/src/protobuf/model/meta.rs deleted file mode 100644 index 3468eb594d..0000000000 --- a/shared-lib/flowy-grid-data-model/src/protobuf/model/meta.rs +++ /dev/null @@ -1,3520 +0,0 @@ -// This file is generated by rust-protobuf 2.25.2. Do not edit -// @generated - -// https://github.com/rust-lang/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy::all)] - -#![allow(unused_attributes)] -#![cfg_attr(rustfmt, rustfmt::skip)] - -#![allow(box_pointers)] -#![allow(dead_code)] -#![allow(missing_docs)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(non_upper_case_globals)] -#![allow(trivial_casts)] -#![allow(unused_imports)] -#![allow(unused_results)] -//! Generated file from `meta.proto` - -/// Generated files are compatible only with the same version -/// of protobuf runtime. -// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_25_2; - -#[derive(PartialEq,Clone,Default)] -pub struct GridMeta { - // message fields - pub grid_id: ::std::string::String, - pub fields: ::protobuf::RepeatedField, - pub blocks: ::protobuf::RepeatedField, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a GridMeta { - fn default() -> &'a GridMeta { - ::default_instance() - } -} - -impl GridMeta { - pub fn new() -> GridMeta { - ::std::default::Default::default() - } - - // string grid_id = 1; - - - pub fn get_grid_id(&self) -> &str { - &self.grid_id - } - pub fn clear_grid_id(&mut self) { - self.grid_id.clear(); - } - - // Param is passed by value, moved - pub fn set_grid_id(&mut self, v: ::std::string::String) { - self.grid_id = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_grid_id(&mut self) -> &mut ::std::string::String { - &mut self.grid_id - } - - // Take field - pub fn take_grid_id(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.grid_id, ::std::string::String::new()) - } - - // repeated .FieldMeta fields = 2; - - - pub fn get_fields(&self) -> &[FieldMeta] { - &self.fields - } - pub fn clear_fields(&mut self) { - self.fields.clear(); - } - - // Param is passed by value, moved - pub fn set_fields(&mut self, v: ::protobuf::RepeatedField) { - self.fields = v; - } - - // Mutable pointer to the field. - pub fn mut_fields(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.fields - } - - // Take field - pub fn take_fields(&mut self) -> ::protobuf::RepeatedField { - ::std::mem::replace(&mut self.fields, ::protobuf::RepeatedField::new()) - } - - // repeated .GridBlockMeta blocks = 3; - - - pub fn get_blocks(&self) -> &[GridBlockMeta] { - &self.blocks - } - pub fn clear_blocks(&mut self) { - self.blocks.clear(); - } - - // Param is passed by value, moved - pub fn set_blocks(&mut self, v: ::protobuf::RepeatedField) { - self.blocks = v; - } - - // Mutable pointer to the field. - pub fn mut_blocks(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.blocks - } - - // Take field - pub fn take_blocks(&mut self) -> ::protobuf::RepeatedField { - ::std::mem::replace(&mut self.blocks, ::protobuf::RepeatedField::new()) - } -} - -impl ::protobuf::Message for GridMeta { - fn is_initialized(&self) -> bool { - for v in &self.fields { - if !v.is_initialized() { - return false; - } - }; - for v in &self.blocks { - if !v.is_initialized() { - return false; - } - }; - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.grid_id)?; - }, - 2 => { - ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.fields)?; - }, - 3 => { - ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.blocks)?; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.grid_id.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.grid_id); - } - for value in &self.fields { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - }; - for value in &self.blocks { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - }; - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - if !self.grid_id.is_empty() { - os.write_string(1, &self.grid_id)?; - } - for v in &self.fields { - os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - }; - for v in &self.blocks { - os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - }; - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> GridMeta { - GridMeta::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "grid_id", - |m: &GridMeta| { &m.grid_id }, - |m: &mut GridMeta| { &mut m.grid_id }, - )); - fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "fields", - |m: &GridMeta| { &m.fields }, - |m: &mut GridMeta| { &mut m.fields }, - )); - fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "blocks", - |m: &GridMeta| { &m.blocks }, - |m: &mut GridMeta| { &mut m.blocks }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "GridMeta", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static GridMeta { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(GridMeta::new) - } -} - -impl ::protobuf::Clear for GridMeta { - fn clear(&mut self) { - self.grid_id.clear(); - self.fields.clear(); - self.blocks.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for GridMeta { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for GridMeta { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct GridBlockMeta { - // message fields - pub block_id: ::std::string::String, - pub start_row_index: i32, - pub row_count: i32, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a GridBlockMeta { - fn default() -> &'a GridBlockMeta { - ::default_instance() - } -} - -impl GridBlockMeta { - pub fn new() -> GridBlockMeta { - ::std::default::Default::default() - } - - // string block_id = 1; - - - pub fn get_block_id(&self) -> &str { - &self.block_id - } - pub fn clear_block_id(&mut self) { - self.block_id.clear(); - } - - // Param is passed by value, moved - pub fn set_block_id(&mut self, v: ::std::string::String) { - self.block_id = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_block_id(&mut self) -> &mut ::std::string::String { - &mut self.block_id - } - - // Take field - pub fn take_block_id(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.block_id, ::std::string::String::new()) - } - - // int32 start_row_index = 2; - - - pub fn get_start_row_index(&self) -> i32 { - self.start_row_index - } - pub fn clear_start_row_index(&mut self) { - self.start_row_index = 0; - } - - // Param is passed by value, moved - pub fn set_start_row_index(&mut self, v: i32) { - self.start_row_index = v; - } - - // int32 row_count = 3; - - - pub fn get_row_count(&self) -> i32 { - self.row_count - } - pub fn clear_row_count(&mut self) { - self.row_count = 0; - } - - // Param is passed by value, moved - pub fn set_row_count(&mut self, v: i32) { - self.row_count = v; - } -} - -impl ::protobuf::Message for GridBlockMeta { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.block_id)?; - }, - 2 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_int32()?; - self.start_row_index = tmp; - }, - 3 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_int32()?; - self.row_count = tmp; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.block_id.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.block_id); - } - if self.start_row_index != 0 { - my_size += ::protobuf::rt::value_size(2, self.start_row_index, ::protobuf::wire_format::WireTypeVarint); - } - if self.row_count != 0 { - my_size += ::protobuf::rt::value_size(3, self.row_count, ::protobuf::wire_format::WireTypeVarint); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - if !self.block_id.is_empty() { - os.write_string(1, &self.block_id)?; - } - if self.start_row_index != 0 { - os.write_int32(2, self.start_row_index)?; - } - if self.row_count != 0 { - os.write_int32(3, self.row_count)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> GridBlockMeta { - GridBlockMeta::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "block_id", - |m: &GridBlockMeta| { &m.block_id }, - |m: &mut GridBlockMeta| { &mut m.block_id }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( - "start_row_index", - |m: &GridBlockMeta| { &m.start_row_index }, - |m: &mut GridBlockMeta| { &mut m.start_row_index }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( - "row_count", - |m: &GridBlockMeta| { &m.row_count }, - |m: &mut GridBlockMeta| { &mut m.row_count }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "GridBlockMeta", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static GridBlockMeta { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(GridBlockMeta::new) - } -} - -impl ::protobuf::Clear for GridBlockMeta { - fn clear(&mut self) { - self.block_id.clear(); - self.start_row_index = 0; - self.row_count = 0; - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for GridBlockMeta { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for GridBlockMeta { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct GridBlockMetaData { - // message fields - pub block_id: ::std::string::String, - pub rows: ::protobuf::RepeatedField, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a GridBlockMetaData { - fn default() -> &'a GridBlockMetaData { - ::default_instance() - } -} - -impl GridBlockMetaData { - pub fn new() -> GridBlockMetaData { - ::std::default::Default::default() - } - - // string block_id = 1; - - - pub fn get_block_id(&self) -> &str { - &self.block_id - } - pub fn clear_block_id(&mut self) { - self.block_id.clear(); - } - - // Param is passed by value, moved - pub fn set_block_id(&mut self, v: ::std::string::String) { - self.block_id = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_block_id(&mut self) -> &mut ::std::string::String { - &mut self.block_id - } - - // Take field - pub fn take_block_id(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.block_id, ::std::string::String::new()) - } - - // repeated .RowMeta rows = 2; - - - pub fn get_rows(&self) -> &[RowMeta] { - &self.rows - } - pub fn clear_rows(&mut self) { - self.rows.clear(); - } - - // Param is passed by value, moved - pub fn set_rows(&mut self, v: ::protobuf::RepeatedField) { - self.rows = v; - } - - // Mutable pointer to the field. - pub fn mut_rows(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.rows - } - - // Take field - pub fn take_rows(&mut self) -> ::protobuf::RepeatedField { - ::std::mem::replace(&mut self.rows, ::protobuf::RepeatedField::new()) - } -} - -impl ::protobuf::Message for GridBlockMetaData { - fn is_initialized(&self) -> bool { - for v in &self.rows { - if !v.is_initialized() { - return false; - } - }; - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.block_id)?; - }, - 2 => { - ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.rows)?; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.block_id.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.block_id); - } - for value in &self.rows { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - }; - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - if !self.block_id.is_empty() { - os.write_string(1, &self.block_id)?; - } - for v in &self.rows { - os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - }; - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> GridBlockMetaData { - GridBlockMetaData::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "block_id", - |m: &GridBlockMetaData| { &m.block_id }, - |m: &mut GridBlockMetaData| { &mut m.block_id }, - )); - fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "rows", - |m: &GridBlockMetaData| { &m.rows }, - |m: &mut GridBlockMetaData| { &mut m.rows }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "GridBlockMetaData", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static GridBlockMetaData { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(GridBlockMetaData::new) - } -} - -impl ::protobuf::Clear for GridBlockMetaData { - fn clear(&mut self) { - self.block_id.clear(); - self.rows.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for GridBlockMetaData { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for GridBlockMetaData { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct FieldMeta { - // message fields - pub id: ::std::string::String, - pub name: ::std::string::String, - pub desc: ::std::string::String, - pub field_type: FieldType, - pub frozen: bool, - pub visibility: bool, - pub width: i32, - pub type_options: ::std::collections::HashMap<::std::string::String, ::std::string::String>, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a FieldMeta { - fn default() -> &'a FieldMeta { - ::default_instance() - } -} - -impl FieldMeta { - pub fn new() -> FieldMeta { - ::std::default::Default::default() - } - - // string id = 1; - - - pub fn get_id(&self) -> &str { - &self.id - } - pub fn clear_id(&mut self) { - self.id.clear(); - } - - // Param is passed by value, moved - pub fn set_id(&mut self, v: ::std::string::String) { - self.id = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_id(&mut self) -> &mut ::std::string::String { - &mut self.id - } - - // Take field - pub fn take_id(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.id, ::std::string::String::new()) - } - - // string name = 2; - - - pub fn get_name(&self) -> &str { - &self.name - } - pub fn clear_name(&mut self) { - self.name.clear(); - } - - // Param is passed by value, moved - pub fn set_name(&mut self, v: ::std::string::String) { - self.name = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_name(&mut self) -> &mut ::std::string::String { - &mut self.name - } - - // Take field - pub fn take_name(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.name, ::std::string::String::new()) - } - - // string desc = 3; - - - pub fn get_desc(&self) -> &str { - &self.desc - } - pub fn clear_desc(&mut self) { - self.desc.clear(); - } - - // Param is passed by value, moved - pub fn set_desc(&mut self, v: ::std::string::String) { - self.desc = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_desc(&mut self) -> &mut ::std::string::String { - &mut self.desc - } - - // Take field - pub fn take_desc(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.desc, ::std::string::String::new()) - } - - // .FieldType field_type = 4; - - - pub fn get_field_type(&self) -> FieldType { - self.field_type - } - pub fn clear_field_type(&mut self) { - self.field_type = FieldType::RichText; - } - - // Param is passed by value, moved - pub fn set_field_type(&mut self, v: FieldType) { - self.field_type = v; - } - - // bool frozen = 5; - - - pub fn get_frozen(&self) -> bool { - self.frozen - } - pub fn clear_frozen(&mut self) { - self.frozen = false; - } - - // Param is passed by value, moved - pub fn set_frozen(&mut self, v: bool) { - self.frozen = v; - } - - // bool visibility = 6; - - - pub fn get_visibility(&self) -> bool { - self.visibility - } - pub fn clear_visibility(&mut self) { - self.visibility = false; - } - - // Param is passed by value, moved - pub fn set_visibility(&mut self, v: bool) { - self.visibility = v; - } - - // int32 width = 7; - - - pub fn get_width(&self) -> i32 { - self.width - } - pub fn clear_width(&mut self) { - self.width = 0; - } - - // Param is passed by value, moved - pub fn set_width(&mut self, v: i32) { - self.width = v; - } - - // repeated .FieldMeta.TypeOptionsEntry type_options = 8; - - - pub fn get_type_options(&self) -> &::std::collections::HashMap<::std::string::String, ::std::string::String> { - &self.type_options - } - pub fn clear_type_options(&mut self) { - self.type_options.clear(); - } - - // Param is passed by value, moved - pub fn set_type_options(&mut self, v: ::std::collections::HashMap<::std::string::String, ::std::string::String>) { - self.type_options = v; - } - - // Mutable pointer to the field. - pub fn mut_type_options(&mut self) -> &mut ::std::collections::HashMap<::std::string::String, ::std::string::String> { - &mut self.type_options - } - - // Take field - pub fn take_type_options(&mut self) -> ::std::collections::HashMap<::std::string::String, ::std::string::String> { - ::std::mem::replace(&mut self.type_options, ::std::collections::HashMap::new()) - } -} - -impl ::protobuf::Message for FieldMeta { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.id)?; - }, - 2 => { - ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.name)?; - }, - 3 => { - ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.desc)?; - }, - 4 => { - ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.field_type, 4, &mut self.unknown_fields)? - }, - 5 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_bool()?; - self.frozen = tmp; - }, - 6 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_bool()?; - self.visibility = tmp; - }, - 7 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_int32()?; - self.width = tmp; - }, - 8 => { - ::protobuf::rt::read_map_into::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeString>(wire_type, is, &mut self.type_options)?; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.id.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.id); - } - if !self.name.is_empty() { - my_size += ::protobuf::rt::string_size(2, &self.name); - } - if !self.desc.is_empty() { - my_size += ::protobuf::rt::string_size(3, &self.desc); - } - if self.field_type != FieldType::RichText { - my_size += ::protobuf::rt::enum_size(4, self.field_type); - } - if self.frozen != false { - my_size += 2; - } - if self.visibility != false { - my_size += 2; - } - if self.width != 0 { - my_size += ::protobuf::rt::value_size(7, self.width, ::protobuf::wire_format::WireTypeVarint); - } - my_size += ::protobuf::rt::compute_map_size::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeString>(8, &self.type_options); - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - if !self.id.is_empty() { - os.write_string(1, &self.id)?; - } - if !self.name.is_empty() { - os.write_string(2, &self.name)?; - } - if !self.desc.is_empty() { - os.write_string(3, &self.desc)?; - } - if self.field_type != FieldType::RichText { - os.write_enum(4, ::protobuf::ProtobufEnum::value(&self.field_type))?; - } - if self.frozen != false { - os.write_bool(5, self.frozen)?; - } - if self.visibility != false { - os.write_bool(6, self.visibility)?; - } - if self.width != 0 { - os.write_int32(7, self.width)?; - } - ::protobuf::rt::write_map_with_cached_sizes::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeString>(8, &self.type_options, os)?; - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> FieldMeta { - FieldMeta::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "id", - |m: &FieldMeta| { &m.id }, - |m: &mut FieldMeta| { &mut m.id }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "name", - |m: &FieldMeta| { &m.name }, - |m: &mut FieldMeta| { &mut m.name }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "desc", - |m: &FieldMeta| { &m.desc }, - |m: &mut FieldMeta| { &mut m.desc }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( - "field_type", - |m: &FieldMeta| { &m.field_type }, - |m: &mut FieldMeta| { &mut m.field_type }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( - "frozen", - |m: &FieldMeta| { &m.frozen }, - |m: &mut FieldMeta| { &mut m.frozen }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( - "visibility", - |m: &FieldMeta| { &m.visibility }, - |m: &mut FieldMeta| { &mut m.visibility }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( - "width", - |m: &FieldMeta| { &m.width }, - |m: &mut FieldMeta| { &mut m.width }, - )); - fields.push(::protobuf::reflect::accessor::make_map_accessor::<_, ::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeString>( - "type_options", - |m: &FieldMeta| { &m.type_options }, - |m: &mut FieldMeta| { &mut m.type_options }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "FieldMeta", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static FieldMeta { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(FieldMeta::new) - } -} - -impl ::protobuf::Clear for FieldMeta { - fn clear(&mut self) { - self.id.clear(); - self.name.clear(); - self.desc.clear(); - self.field_type = FieldType::RichText; - self.frozen = false; - self.visibility = false; - self.width = 0; - self.type_options.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for FieldMeta { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for FieldMeta { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct FieldChangesetPayload { - // message fields - pub field_id: ::std::string::String, - pub grid_id: ::std::string::String, - // message oneof groups - pub one_of_name: ::std::option::Option, - pub one_of_desc: ::std::option::Option, - pub one_of_field_type: ::std::option::Option, - pub one_of_frozen: ::std::option::Option, - pub one_of_visibility: ::std::option::Option, - pub one_of_width: ::std::option::Option, - pub one_of_type_option_data: ::std::option::Option, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a FieldChangesetPayload { - fn default() -> &'a FieldChangesetPayload { - ::default_instance() - } -} - -#[derive(Clone,PartialEq,Debug)] -pub enum FieldChangesetPayload_oneof_one_of_name { - name(::std::string::String), -} - -#[derive(Clone,PartialEq,Debug)] -pub enum FieldChangesetPayload_oneof_one_of_desc { - desc(::std::string::String), -} - -#[derive(Clone,PartialEq,Debug)] -pub enum FieldChangesetPayload_oneof_one_of_field_type { - field_type(FieldType), -} - -#[derive(Clone,PartialEq,Debug)] -pub enum FieldChangesetPayload_oneof_one_of_frozen { - frozen(bool), -} - -#[derive(Clone,PartialEq,Debug)] -pub enum FieldChangesetPayload_oneof_one_of_visibility { - visibility(bool), -} - -#[derive(Clone,PartialEq,Debug)] -pub enum FieldChangesetPayload_oneof_one_of_width { - width(i32), -} - -#[derive(Clone,PartialEq,Debug)] -pub enum FieldChangesetPayload_oneof_one_of_type_option_data { - type_option_data(::std::vec::Vec), -} - -impl FieldChangesetPayload { - pub fn new() -> FieldChangesetPayload { - ::std::default::Default::default() - } - - // string field_id = 1; - - - pub fn get_field_id(&self) -> &str { - &self.field_id - } - pub fn clear_field_id(&mut self) { - self.field_id.clear(); - } - - // Param is passed by value, moved - pub fn set_field_id(&mut self, v: ::std::string::String) { - self.field_id = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_field_id(&mut self) -> &mut ::std::string::String { - &mut self.field_id - } - - // Take field - pub fn take_field_id(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.field_id, ::std::string::String::new()) - } - - // string grid_id = 2; - - - pub fn get_grid_id(&self) -> &str { - &self.grid_id - } - pub fn clear_grid_id(&mut self) { - self.grid_id.clear(); - } - - // Param is passed by value, moved - pub fn set_grid_id(&mut self, v: ::std::string::String) { - self.grid_id = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_grid_id(&mut self) -> &mut ::std::string::String { - &mut self.grid_id - } - - // Take field - pub fn take_grid_id(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.grid_id, ::std::string::String::new()) - } - - // string name = 3; - - - pub fn get_name(&self) -> &str { - match self.one_of_name { - ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_name::name(ref v)) => v, - _ => "", - } - } - pub fn clear_name(&mut self) { - self.one_of_name = ::std::option::Option::None; - } - - pub fn has_name(&self) -> bool { - match self.one_of_name { - ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_name::name(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_name(&mut self, v: ::std::string::String) { - self.one_of_name = ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_name::name(v)) - } - - // Mutable pointer to the field. - pub fn mut_name(&mut self) -> &mut ::std::string::String { - if let ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_name::name(_)) = self.one_of_name { - } else { - self.one_of_name = ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_name::name(::std::string::String::new())); - } - match self.one_of_name { - ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_name::name(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_name(&mut self) -> ::std::string::String { - if self.has_name() { - match self.one_of_name.take() { - ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_name::name(v)) => v, - _ => panic!(), - } - } else { - ::std::string::String::new() - } - } - - // string desc = 4; - - - pub fn get_desc(&self) -> &str { - match self.one_of_desc { - ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_desc::desc(ref v)) => v, - _ => "", - } - } - pub fn clear_desc(&mut self) { - self.one_of_desc = ::std::option::Option::None; - } - - pub fn has_desc(&self) -> bool { - match self.one_of_desc { - ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_desc::desc(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_desc(&mut self, v: ::std::string::String) { - self.one_of_desc = ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_desc::desc(v)) - } - - // Mutable pointer to the field. - pub fn mut_desc(&mut self) -> &mut ::std::string::String { - if let ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_desc::desc(_)) = self.one_of_desc { - } else { - self.one_of_desc = ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_desc::desc(::std::string::String::new())); - } - match self.one_of_desc { - ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_desc::desc(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_desc(&mut self) -> ::std::string::String { - if self.has_desc() { - match self.one_of_desc.take() { - ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_desc::desc(v)) => v, - _ => panic!(), - } - } else { - ::std::string::String::new() - } - } - - // .FieldType field_type = 5; - - - pub fn get_field_type(&self) -> FieldType { - match self.one_of_field_type { - ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_field_type::field_type(v)) => v, - _ => FieldType::RichText, - } - } - pub fn clear_field_type(&mut self) { - self.one_of_field_type = ::std::option::Option::None; - } - - pub fn has_field_type(&self) -> bool { - match self.one_of_field_type { - ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_field_type::field_type(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_field_type(&mut self, v: FieldType) { - self.one_of_field_type = ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_field_type::field_type(v)) - } - - // bool frozen = 6; - - - pub fn get_frozen(&self) -> bool { - match self.one_of_frozen { - ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_frozen::frozen(v)) => v, - _ => false, - } - } - pub fn clear_frozen(&mut self) { - self.one_of_frozen = ::std::option::Option::None; - } - - pub fn has_frozen(&self) -> bool { - match self.one_of_frozen { - ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_frozen::frozen(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_frozen(&mut self, v: bool) { - self.one_of_frozen = ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_frozen::frozen(v)) - } - - // bool visibility = 7; - - - pub fn get_visibility(&self) -> bool { - match self.one_of_visibility { - ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_visibility::visibility(v)) => v, - _ => false, - } - } - pub fn clear_visibility(&mut self) { - self.one_of_visibility = ::std::option::Option::None; - } - - pub fn has_visibility(&self) -> bool { - match self.one_of_visibility { - ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_visibility::visibility(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_visibility(&mut self, v: bool) { - self.one_of_visibility = ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_visibility::visibility(v)) - } - - // int32 width = 8; - - - pub fn get_width(&self) -> i32 { - match self.one_of_width { - ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_width::width(v)) => v, - _ => 0, - } - } - pub fn clear_width(&mut self) { - self.one_of_width = ::std::option::Option::None; - } - - pub fn has_width(&self) -> bool { - match self.one_of_width { - ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_width::width(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_width(&mut self, v: i32) { - self.one_of_width = ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_width::width(v)) - } - - // bytes type_option_data = 9; - - - pub fn get_type_option_data(&self) -> &[u8] { - match self.one_of_type_option_data { - ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_type_option_data::type_option_data(ref v)) => v, - _ => &[], - } - } - pub fn clear_type_option_data(&mut self) { - self.one_of_type_option_data = ::std::option::Option::None; - } - - pub fn has_type_option_data(&self) -> bool { - match self.one_of_type_option_data { - ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_type_option_data::type_option_data(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_type_option_data(&mut self, v: ::std::vec::Vec) { - self.one_of_type_option_data = ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_type_option_data::type_option_data(v)) - } - - // Mutable pointer to the field. - pub fn mut_type_option_data(&mut self) -> &mut ::std::vec::Vec { - if let ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_type_option_data::type_option_data(_)) = self.one_of_type_option_data { - } else { - self.one_of_type_option_data = ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_type_option_data::type_option_data(::std::vec::Vec::new())); - } - match self.one_of_type_option_data { - ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_type_option_data::type_option_data(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_type_option_data(&mut self) -> ::std::vec::Vec { - if self.has_type_option_data() { - match self.one_of_type_option_data.take() { - ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_type_option_data::type_option_data(v)) => v, - _ => panic!(), - } - } else { - ::std::vec::Vec::new() - } - } -} - -impl ::protobuf::Message for FieldChangesetPayload { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.field_id)?; - }, - 2 => { - ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.grid_id)?; - }, - 3 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - self.one_of_name = ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_name::name(is.read_string()?)); - }, - 4 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - self.one_of_desc = ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_desc::desc(is.read_string()?)); - }, - 5 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - self.one_of_field_type = ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_field_type::field_type(is.read_enum()?)); - }, - 6 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - self.one_of_frozen = ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_frozen::frozen(is.read_bool()?)); - }, - 7 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - self.one_of_visibility = ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_visibility::visibility(is.read_bool()?)); - }, - 8 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - self.one_of_width = ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_width::width(is.read_int32()?)); - }, - 9 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - self.one_of_type_option_data = ::std::option::Option::Some(FieldChangesetPayload_oneof_one_of_type_option_data::type_option_data(is.read_bytes()?)); - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.field_id.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.field_id); - } - if !self.grid_id.is_empty() { - my_size += ::protobuf::rt::string_size(2, &self.grid_id); - } - if let ::std::option::Option::Some(ref v) = self.one_of_name { - match v { - &FieldChangesetPayload_oneof_one_of_name::name(ref v) => { - my_size += ::protobuf::rt::string_size(3, &v); - }, - }; - } - if let ::std::option::Option::Some(ref v) = self.one_of_desc { - match v { - &FieldChangesetPayload_oneof_one_of_desc::desc(ref v) => { - my_size += ::protobuf::rt::string_size(4, &v); - }, - }; - } - if let ::std::option::Option::Some(ref v) = self.one_of_field_type { - match v { - &FieldChangesetPayload_oneof_one_of_field_type::field_type(v) => { - my_size += ::protobuf::rt::enum_size(5, v); - }, - }; - } - if let ::std::option::Option::Some(ref v) = self.one_of_frozen { - match v { - &FieldChangesetPayload_oneof_one_of_frozen::frozen(v) => { - my_size += 2; - }, - }; - } - if let ::std::option::Option::Some(ref v) = self.one_of_visibility { - match v { - &FieldChangesetPayload_oneof_one_of_visibility::visibility(v) => { - my_size += 2; - }, - }; - } - if let ::std::option::Option::Some(ref v) = self.one_of_width { - match v { - &FieldChangesetPayload_oneof_one_of_width::width(v) => { - my_size += ::protobuf::rt::value_size(8, v, ::protobuf::wire_format::WireTypeVarint); - }, - }; - } - if let ::std::option::Option::Some(ref v) = self.one_of_type_option_data { - match v { - &FieldChangesetPayload_oneof_one_of_type_option_data::type_option_data(ref v) => { - my_size += ::protobuf::rt::bytes_size(9, &v); - }, - }; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - if !self.field_id.is_empty() { - os.write_string(1, &self.field_id)?; - } - if !self.grid_id.is_empty() { - os.write_string(2, &self.grid_id)?; - } - if let ::std::option::Option::Some(ref v) = self.one_of_name { - match v { - &FieldChangesetPayload_oneof_one_of_name::name(ref v) => { - os.write_string(3, v)?; - }, - }; - } - if let ::std::option::Option::Some(ref v) = self.one_of_desc { - match v { - &FieldChangesetPayload_oneof_one_of_desc::desc(ref v) => { - os.write_string(4, v)?; - }, - }; - } - if let ::std::option::Option::Some(ref v) = self.one_of_field_type { - match v { - &FieldChangesetPayload_oneof_one_of_field_type::field_type(v) => { - os.write_enum(5, ::protobuf::ProtobufEnum::value(&v))?; - }, - }; - } - if let ::std::option::Option::Some(ref v) = self.one_of_frozen { - match v { - &FieldChangesetPayload_oneof_one_of_frozen::frozen(v) => { - os.write_bool(6, v)?; - }, - }; - } - if let ::std::option::Option::Some(ref v) = self.one_of_visibility { - match v { - &FieldChangesetPayload_oneof_one_of_visibility::visibility(v) => { - os.write_bool(7, v)?; - }, - }; - } - if let ::std::option::Option::Some(ref v) = self.one_of_width { - match v { - &FieldChangesetPayload_oneof_one_of_width::width(v) => { - os.write_int32(8, v)?; - }, - }; - } - if let ::std::option::Option::Some(ref v) = self.one_of_type_option_data { - match v { - &FieldChangesetPayload_oneof_one_of_type_option_data::type_option_data(ref v) => { - os.write_bytes(9, v)?; - }, - }; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> FieldChangesetPayload { - FieldChangesetPayload::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "field_id", - |m: &FieldChangesetPayload| { &m.field_id }, - |m: &mut FieldChangesetPayload| { &mut m.field_id }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "grid_id", - |m: &FieldChangesetPayload| { &m.grid_id }, - |m: &mut FieldChangesetPayload| { &mut m.grid_id }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>( - "name", - FieldChangesetPayload::has_name, - FieldChangesetPayload::get_name, - )); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>( - "desc", - FieldChangesetPayload::has_desc, - FieldChangesetPayload::get_desc, - )); - fields.push(::protobuf::reflect::accessor::make_singular_enum_accessor::<_, FieldType>( - "field_type", - FieldChangesetPayload::has_field_type, - FieldChangesetPayload::get_field_type, - )); - fields.push(::protobuf::reflect::accessor::make_singular_bool_accessor::<_>( - "frozen", - FieldChangesetPayload::has_frozen, - FieldChangesetPayload::get_frozen, - )); - fields.push(::protobuf::reflect::accessor::make_singular_bool_accessor::<_>( - "visibility", - FieldChangesetPayload::has_visibility, - FieldChangesetPayload::get_visibility, - )); - fields.push(::protobuf::reflect::accessor::make_singular_i32_accessor::<_>( - "width", - FieldChangesetPayload::has_width, - FieldChangesetPayload::get_width, - )); - fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor::<_>( - "type_option_data", - FieldChangesetPayload::has_type_option_data, - FieldChangesetPayload::get_type_option_data, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "FieldChangesetPayload", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static FieldChangesetPayload { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(FieldChangesetPayload::new) - } -} - -impl ::protobuf::Clear for FieldChangesetPayload { - fn clear(&mut self) { - self.field_id.clear(); - self.grid_id.clear(); - self.one_of_name = ::std::option::Option::None; - self.one_of_desc = ::std::option::Option::None; - self.one_of_field_type = ::std::option::Option::None; - self.one_of_frozen = ::std::option::Option::None; - self.one_of_visibility = ::std::option::Option::None; - self.one_of_width = ::std::option::Option::None; - self.one_of_type_option_data = ::std::option::Option::None; - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for FieldChangesetPayload { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for FieldChangesetPayload { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct AnyData { - // message fields - pub type_id: ::std::string::String, - pub value: ::std::vec::Vec, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a AnyData { - fn default() -> &'a AnyData { - ::default_instance() - } -} - -impl AnyData { - pub fn new() -> AnyData { - ::std::default::Default::default() - } - - // string type_id = 1; - - - pub fn get_type_id(&self) -> &str { - &self.type_id - } - pub fn clear_type_id(&mut self) { - self.type_id.clear(); - } - - // Param is passed by value, moved - pub fn set_type_id(&mut self, v: ::std::string::String) { - self.type_id = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_type_id(&mut self) -> &mut ::std::string::String { - &mut self.type_id - } - - // Take field - pub fn take_type_id(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.type_id, ::std::string::String::new()) - } - - // bytes value = 2; - - - pub fn get_value(&self) -> &[u8] { - &self.value - } - pub fn clear_value(&mut self) { - self.value.clear(); - } - - // Param is passed by value, moved - pub fn set_value(&mut self, v: ::std::vec::Vec) { - self.value = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_value(&mut self) -> &mut ::std::vec::Vec { - &mut self.value - } - - // Take field - pub fn take_value(&mut self) -> ::std::vec::Vec { - ::std::mem::replace(&mut self.value, ::std::vec::Vec::new()) - } -} - -impl ::protobuf::Message for AnyData { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.type_id)?; - }, - 2 => { - ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.value)?; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.type_id.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.type_id); - } - if !self.value.is_empty() { - my_size += ::protobuf::rt::bytes_size(2, &self.value); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - if !self.type_id.is_empty() { - os.write_string(1, &self.type_id)?; - } - if !self.value.is_empty() { - os.write_bytes(2, &self.value)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> AnyData { - AnyData::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "type_id", - |m: &AnyData| { &m.type_id }, - |m: &mut AnyData| { &mut m.type_id }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( - "value", - |m: &AnyData| { &m.value }, - |m: &mut AnyData| { &mut m.value }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "AnyData", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static AnyData { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(AnyData::new) - } -} - -impl ::protobuf::Clear for AnyData { - fn clear(&mut self) { - self.type_id.clear(); - self.value.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for AnyData { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for AnyData { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct RowMeta { - // message fields - pub id: ::std::string::String, - pub block_id: ::std::string::String, - pub cells: ::std::collections::HashMap<::std::string::String, CellMeta>, - pub height: i32, - pub visibility: bool, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a RowMeta { - fn default() -> &'a RowMeta { - ::default_instance() - } -} - -impl RowMeta { - pub fn new() -> RowMeta { - ::std::default::Default::default() - } - - // string id = 1; - - - pub fn get_id(&self) -> &str { - &self.id - } - pub fn clear_id(&mut self) { - self.id.clear(); - } - - // Param is passed by value, moved - pub fn set_id(&mut self, v: ::std::string::String) { - self.id = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_id(&mut self) -> &mut ::std::string::String { - &mut self.id - } - - // Take field - pub fn take_id(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.id, ::std::string::String::new()) - } - - // string block_id = 2; - - - pub fn get_block_id(&self) -> &str { - &self.block_id - } - pub fn clear_block_id(&mut self) { - self.block_id.clear(); - } - - // Param is passed by value, moved - pub fn set_block_id(&mut self, v: ::std::string::String) { - self.block_id = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_block_id(&mut self) -> &mut ::std::string::String { - &mut self.block_id - } - - // Take field - pub fn take_block_id(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.block_id, ::std::string::String::new()) - } - - // repeated .RowMeta.CellsEntry cells = 3; - - - pub fn get_cells(&self) -> &::std::collections::HashMap<::std::string::String, CellMeta> { - &self.cells - } - pub fn clear_cells(&mut self) { - self.cells.clear(); - } - - // Param is passed by value, moved - pub fn set_cells(&mut self, v: ::std::collections::HashMap<::std::string::String, CellMeta>) { - self.cells = v; - } - - // Mutable pointer to the field. - pub fn mut_cells(&mut self) -> &mut ::std::collections::HashMap<::std::string::String, CellMeta> { - &mut self.cells - } - - // Take field - pub fn take_cells(&mut self) -> ::std::collections::HashMap<::std::string::String, CellMeta> { - ::std::mem::replace(&mut self.cells, ::std::collections::HashMap::new()) - } - - // int32 height = 4; - - - pub fn get_height(&self) -> i32 { - self.height - } - pub fn clear_height(&mut self) { - self.height = 0; - } - - // Param is passed by value, moved - pub fn set_height(&mut self, v: i32) { - self.height = v; - } - - // bool visibility = 5; - - - pub fn get_visibility(&self) -> bool { - self.visibility - } - pub fn clear_visibility(&mut self) { - self.visibility = false; - } - - // Param is passed by value, moved - pub fn set_visibility(&mut self, v: bool) { - self.visibility = v; - } -} - -impl ::protobuf::Message for RowMeta { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.id)?; - }, - 2 => { - ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.block_id)?; - }, - 3 => { - ::protobuf::rt::read_map_into::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeMessage>(wire_type, is, &mut self.cells)?; - }, - 4 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_int32()?; - self.height = tmp; - }, - 5 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_bool()?; - self.visibility = tmp; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.id.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.id); - } - if !self.block_id.is_empty() { - my_size += ::protobuf::rt::string_size(2, &self.block_id); - } - my_size += ::protobuf::rt::compute_map_size::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeMessage>(3, &self.cells); - if self.height != 0 { - my_size += ::protobuf::rt::value_size(4, self.height, ::protobuf::wire_format::WireTypeVarint); - } - if self.visibility != false { - my_size += 2; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - if !self.id.is_empty() { - os.write_string(1, &self.id)?; - } - if !self.block_id.is_empty() { - os.write_string(2, &self.block_id)?; - } - ::protobuf::rt::write_map_with_cached_sizes::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeMessage>(3, &self.cells, os)?; - if self.height != 0 { - os.write_int32(4, self.height)?; - } - if self.visibility != false { - os.write_bool(5, self.visibility)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> RowMeta { - RowMeta::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "id", - |m: &RowMeta| { &m.id }, - |m: &mut RowMeta| { &mut m.id }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "block_id", - |m: &RowMeta| { &m.block_id }, - |m: &mut RowMeta| { &mut m.block_id }, - )); - fields.push(::protobuf::reflect::accessor::make_map_accessor::<_, ::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeMessage>( - "cells", - |m: &RowMeta| { &m.cells }, - |m: &mut RowMeta| { &mut m.cells }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( - "height", - |m: &RowMeta| { &m.height }, - |m: &mut RowMeta| { &mut m.height }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( - "visibility", - |m: &RowMeta| { &m.visibility }, - |m: &mut RowMeta| { &mut m.visibility }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "RowMeta", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static RowMeta { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(RowMeta::new) - } -} - -impl ::protobuf::Clear for RowMeta { - fn clear(&mut self) { - self.id.clear(); - self.block_id.clear(); - self.cells.clear(); - self.height = 0; - self.visibility = false; - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for RowMeta { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for RowMeta { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct RowMetaChangeset { - // message fields - pub row_id: ::std::string::String, - pub cell_by_field_id: ::std::collections::HashMap<::std::string::String, CellMeta>, - // message oneof groups - pub one_of_height: ::std::option::Option, - pub one_of_visibility: ::std::option::Option, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a RowMetaChangeset { - fn default() -> &'a RowMetaChangeset { - ::default_instance() - } -} - -#[derive(Clone,PartialEq,Debug)] -pub enum RowMetaChangeset_oneof_one_of_height { - height(i32), -} - -#[derive(Clone,PartialEq,Debug)] -pub enum RowMetaChangeset_oneof_one_of_visibility { - visibility(bool), -} - -impl RowMetaChangeset { - pub fn new() -> RowMetaChangeset { - ::std::default::Default::default() - } - - // string row_id = 1; - - - pub fn get_row_id(&self) -> &str { - &self.row_id - } - pub fn clear_row_id(&mut self) { - self.row_id.clear(); - } - - // Param is passed by value, moved - pub fn set_row_id(&mut self, v: ::std::string::String) { - self.row_id = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_row_id(&mut self) -> &mut ::std::string::String { - &mut self.row_id - } - - // Take field - pub fn take_row_id(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.row_id, ::std::string::String::new()) - } - - // int32 height = 2; - - - pub fn get_height(&self) -> i32 { - match self.one_of_height { - ::std::option::Option::Some(RowMetaChangeset_oneof_one_of_height::height(v)) => v, - _ => 0, - } - } - pub fn clear_height(&mut self) { - self.one_of_height = ::std::option::Option::None; - } - - pub fn has_height(&self) -> bool { - match self.one_of_height { - ::std::option::Option::Some(RowMetaChangeset_oneof_one_of_height::height(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_height(&mut self, v: i32) { - self.one_of_height = ::std::option::Option::Some(RowMetaChangeset_oneof_one_of_height::height(v)) - } - - // bool visibility = 3; - - - pub fn get_visibility(&self) -> bool { - match self.one_of_visibility { - ::std::option::Option::Some(RowMetaChangeset_oneof_one_of_visibility::visibility(v)) => v, - _ => false, - } - } - pub fn clear_visibility(&mut self) { - self.one_of_visibility = ::std::option::Option::None; - } - - pub fn has_visibility(&self) -> bool { - match self.one_of_visibility { - ::std::option::Option::Some(RowMetaChangeset_oneof_one_of_visibility::visibility(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_visibility(&mut self, v: bool) { - self.one_of_visibility = ::std::option::Option::Some(RowMetaChangeset_oneof_one_of_visibility::visibility(v)) - } - - // repeated .RowMetaChangeset.CellByFieldIdEntry cell_by_field_id = 4; - - - pub fn get_cell_by_field_id(&self) -> &::std::collections::HashMap<::std::string::String, CellMeta> { - &self.cell_by_field_id - } - pub fn clear_cell_by_field_id(&mut self) { - self.cell_by_field_id.clear(); - } - - // Param is passed by value, moved - pub fn set_cell_by_field_id(&mut self, v: ::std::collections::HashMap<::std::string::String, CellMeta>) { - self.cell_by_field_id = v; - } - - // Mutable pointer to the field. - pub fn mut_cell_by_field_id(&mut self) -> &mut ::std::collections::HashMap<::std::string::String, CellMeta> { - &mut self.cell_by_field_id - } - - // Take field - pub fn take_cell_by_field_id(&mut self) -> ::std::collections::HashMap<::std::string::String, CellMeta> { - ::std::mem::replace(&mut self.cell_by_field_id, ::std::collections::HashMap::new()) - } -} - -impl ::protobuf::Message for RowMetaChangeset { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.row_id)?; - }, - 2 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - self.one_of_height = ::std::option::Option::Some(RowMetaChangeset_oneof_one_of_height::height(is.read_int32()?)); - }, - 3 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - self.one_of_visibility = ::std::option::Option::Some(RowMetaChangeset_oneof_one_of_visibility::visibility(is.read_bool()?)); - }, - 4 => { - ::protobuf::rt::read_map_into::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeMessage>(wire_type, is, &mut self.cell_by_field_id)?; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.row_id.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.row_id); - } - my_size += ::protobuf::rt::compute_map_size::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeMessage>(4, &self.cell_by_field_id); - if let ::std::option::Option::Some(ref v) = self.one_of_height { - match v { - &RowMetaChangeset_oneof_one_of_height::height(v) => { - my_size += ::protobuf::rt::value_size(2, v, ::protobuf::wire_format::WireTypeVarint); - }, - }; - } - if let ::std::option::Option::Some(ref v) = self.one_of_visibility { - match v { - &RowMetaChangeset_oneof_one_of_visibility::visibility(v) => { - my_size += 2; - }, - }; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - if !self.row_id.is_empty() { - os.write_string(1, &self.row_id)?; - } - ::protobuf::rt::write_map_with_cached_sizes::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeMessage>(4, &self.cell_by_field_id, os)?; - if let ::std::option::Option::Some(ref v) = self.one_of_height { - match v { - &RowMetaChangeset_oneof_one_of_height::height(v) => { - os.write_int32(2, v)?; - }, - }; - } - if let ::std::option::Option::Some(ref v) = self.one_of_visibility { - match v { - &RowMetaChangeset_oneof_one_of_visibility::visibility(v) => { - os.write_bool(3, v)?; - }, - }; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> RowMetaChangeset { - RowMetaChangeset::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "row_id", - |m: &RowMetaChangeset| { &m.row_id }, - |m: &mut RowMetaChangeset| { &mut m.row_id }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_i32_accessor::<_>( - "height", - RowMetaChangeset::has_height, - RowMetaChangeset::get_height, - )); - fields.push(::protobuf::reflect::accessor::make_singular_bool_accessor::<_>( - "visibility", - RowMetaChangeset::has_visibility, - RowMetaChangeset::get_visibility, - )); - fields.push(::protobuf::reflect::accessor::make_map_accessor::<_, ::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeMessage>( - "cell_by_field_id", - |m: &RowMetaChangeset| { &m.cell_by_field_id }, - |m: &mut RowMetaChangeset| { &mut m.cell_by_field_id }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "RowMetaChangeset", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static RowMetaChangeset { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(RowMetaChangeset::new) - } -} - -impl ::protobuf::Clear for RowMetaChangeset { - fn clear(&mut self) { - self.row_id.clear(); - self.one_of_height = ::std::option::Option::None; - self.one_of_visibility = ::std::option::Option::None; - self.cell_by_field_id.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for RowMetaChangeset { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for RowMetaChangeset { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct CellMeta { - // message fields - pub data: ::std::string::String, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a CellMeta { - fn default() -> &'a CellMeta { - ::default_instance() - } -} - -impl CellMeta { - pub fn new() -> CellMeta { - ::std::default::Default::default() - } - - // string data = 1; - - - pub fn get_data(&self) -> &str { - &self.data - } - pub fn clear_data(&mut self) { - self.data.clear(); - } - - // Param is passed by value, moved - pub fn set_data(&mut self, v: ::std::string::String) { - self.data = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_data(&mut self) -> &mut ::std::string::String { - &mut self.data - } - - // Take field - pub fn take_data(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.data, ::std::string::String::new()) - } -} - -impl ::protobuf::Message for CellMeta { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.data)?; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.data.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.data); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - if !self.data.is_empty() { - os.write_string(1, &self.data)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> CellMeta { - CellMeta::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "data", - |m: &CellMeta| { &m.data }, - |m: &mut CellMeta| { &mut m.data }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "CellMeta", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static CellMeta { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(CellMeta::new) - } -} - -impl ::protobuf::Clear for CellMeta { - fn clear(&mut self) { - self.data.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for CellMeta { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for CellMeta { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct CellMetaChangeset { - // message fields - pub grid_id: ::std::string::String, - pub row_id: ::std::string::String, - pub field_id: ::std::string::String, - // message oneof groups - pub one_of_data: ::std::option::Option, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a CellMetaChangeset { - fn default() -> &'a CellMetaChangeset { - ::default_instance() - } -} - -#[derive(Clone,PartialEq,Debug)] -pub enum CellMetaChangeset_oneof_one_of_data { - data(::std::string::String), -} - -impl CellMetaChangeset { - pub fn new() -> CellMetaChangeset { - ::std::default::Default::default() - } - - // string grid_id = 1; - - - pub fn get_grid_id(&self) -> &str { - &self.grid_id - } - pub fn clear_grid_id(&mut self) { - self.grid_id.clear(); - } - - // Param is passed by value, moved - pub fn set_grid_id(&mut self, v: ::std::string::String) { - self.grid_id = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_grid_id(&mut self) -> &mut ::std::string::String { - &mut self.grid_id - } - - // Take field - pub fn take_grid_id(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.grid_id, ::std::string::String::new()) - } - - // string row_id = 2; - - - pub fn get_row_id(&self) -> &str { - &self.row_id - } - pub fn clear_row_id(&mut self) { - self.row_id.clear(); - } - - // Param is passed by value, moved - pub fn set_row_id(&mut self, v: ::std::string::String) { - self.row_id = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_row_id(&mut self) -> &mut ::std::string::String { - &mut self.row_id - } - - // Take field - pub fn take_row_id(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.row_id, ::std::string::String::new()) - } - - // string field_id = 3; - - - pub fn get_field_id(&self) -> &str { - &self.field_id - } - pub fn clear_field_id(&mut self) { - self.field_id.clear(); - } - - // Param is passed by value, moved - pub fn set_field_id(&mut self, v: ::std::string::String) { - self.field_id = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_field_id(&mut self) -> &mut ::std::string::String { - &mut self.field_id - } - - // Take field - pub fn take_field_id(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.field_id, ::std::string::String::new()) - } - - // string data = 4; - - - pub fn get_data(&self) -> &str { - match self.one_of_data { - ::std::option::Option::Some(CellMetaChangeset_oneof_one_of_data::data(ref v)) => v, - _ => "", - } - } - pub fn clear_data(&mut self) { - self.one_of_data = ::std::option::Option::None; - } - - pub fn has_data(&self) -> bool { - match self.one_of_data { - ::std::option::Option::Some(CellMetaChangeset_oneof_one_of_data::data(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_data(&mut self, v: ::std::string::String) { - self.one_of_data = ::std::option::Option::Some(CellMetaChangeset_oneof_one_of_data::data(v)) - } - - // Mutable pointer to the field. - pub fn mut_data(&mut self) -> &mut ::std::string::String { - if let ::std::option::Option::Some(CellMetaChangeset_oneof_one_of_data::data(_)) = self.one_of_data { - } else { - self.one_of_data = ::std::option::Option::Some(CellMetaChangeset_oneof_one_of_data::data(::std::string::String::new())); - } - match self.one_of_data { - ::std::option::Option::Some(CellMetaChangeset_oneof_one_of_data::data(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_data(&mut self) -> ::std::string::String { - if self.has_data() { - match self.one_of_data.take() { - ::std::option::Option::Some(CellMetaChangeset_oneof_one_of_data::data(v)) => v, - _ => panic!(), - } - } else { - ::std::string::String::new() - } - } -} - -impl ::protobuf::Message for CellMetaChangeset { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.grid_id)?; - }, - 2 => { - ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.row_id)?; - }, - 3 => { - ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.field_id)?; - }, - 4 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - self.one_of_data = ::std::option::Option::Some(CellMetaChangeset_oneof_one_of_data::data(is.read_string()?)); - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.grid_id.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.grid_id); - } - if !self.row_id.is_empty() { - my_size += ::protobuf::rt::string_size(2, &self.row_id); - } - if !self.field_id.is_empty() { - my_size += ::protobuf::rt::string_size(3, &self.field_id); - } - if let ::std::option::Option::Some(ref v) = self.one_of_data { - match v { - &CellMetaChangeset_oneof_one_of_data::data(ref v) => { - my_size += ::protobuf::rt::string_size(4, &v); - }, - }; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - if !self.grid_id.is_empty() { - os.write_string(1, &self.grid_id)?; - } - if !self.row_id.is_empty() { - os.write_string(2, &self.row_id)?; - } - if !self.field_id.is_empty() { - os.write_string(3, &self.field_id)?; - } - if let ::std::option::Option::Some(ref v) = self.one_of_data { - match v { - &CellMetaChangeset_oneof_one_of_data::data(ref v) => { - os.write_string(4, v)?; - }, - }; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> CellMetaChangeset { - CellMetaChangeset::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "grid_id", - |m: &CellMetaChangeset| { &m.grid_id }, - |m: &mut CellMetaChangeset| { &mut m.grid_id }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "row_id", - |m: &CellMetaChangeset| { &m.row_id }, - |m: &mut CellMetaChangeset| { &mut m.row_id }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "field_id", - |m: &CellMetaChangeset| { &m.field_id }, - |m: &mut CellMetaChangeset| { &mut m.field_id }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>( - "data", - CellMetaChangeset::has_data, - CellMetaChangeset::get_data, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "CellMetaChangeset", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static CellMetaChangeset { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(CellMetaChangeset::new) - } -} - -impl ::protobuf::Clear for CellMetaChangeset { - fn clear(&mut self) { - self.grid_id.clear(); - self.row_id.clear(); - self.field_id.clear(); - self.one_of_data = ::std::option::Option::None; - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for CellMetaChangeset { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for CellMetaChangeset { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct BuildGridContext { - // message fields - pub field_metas: ::protobuf::RepeatedField, - pub block_meta: ::protobuf::SingularPtrField, - pub block_meta_data: ::protobuf::SingularPtrField, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a BuildGridContext { - fn default() -> &'a BuildGridContext { - ::default_instance() - } -} - -impl BuildGridContext { - pub fn new() -> BuildGridContext { - ::std::default::Default::default() - } - - // repeated .FieldMeta field_metas = 1; - - - pub fn get_field_metas(&self) -> &[FieldMeta] { - &self.field_metas - } - pub fn clear_field_metas(&mut self) { - self.field_metas.clear(); - } - - // Param is passed by value, moved - pub fn set_field_metas(&mut self, v: ::protobuf::RepeatedField) { - self.field_metas = v; - } - - // Mutable pointer to the field. - pub fn mut_field_metas(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.field_metas - } - - // Take field - pub fn take_field_metas(&mut self) -> ::protobuf::RepeatedField { - ::std::mem::replace(&mut self.field_metas, ::protobuf::RepeatedField::new()) - } - - // .GridBlockMeta block_meta = 2; - - - pub fn get_block_meta(&self) -> &GridBlockMeta { - self.block_meta.as_ref().unwrap_or_else(|| ::default_instance()) - } - pub fn clear_block_meta(&mut self) { - self.block_meta.clear(); - } - - pub fn has_block_meta(&self) -> bool { - self.block_meta.is_some() - } - - // Param is passed by value, moved - pub fn set_block_meta(&mut self, v: GridBlockMeta) { - self.block_meta = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_block_meta(&mut self) -> &mut GridBlockMeta { - if self.block_meta.is_none() { - self.block_meta.set_default(); - } - self.block_meta.as_mut().unwrap() - } - - // Take field - pub fn take_block_meta(&mut self) -> GridBlockMeta { - self.block_meta.take().unwrap_or_else(|| GridBlockMeta::new()) - } - - // .GridBlockMetaData block_meta_data = 3; - - - pub fn get_block_meta_data(&self) -> &GridBlockMetaData { - self.block_meta_data.as_ref().unwrap_or_else(|| ::default_instance()) - } - pub fn clear_block_meta_data(&mut self) { - self.block_meta_data.clear(); - } - - pub fn has_block_meta_data(&self) -> bool { - self.block_meta_data.is_some() - } - - // Param is passed by value, moved - pub fn set_block_meta_data(&mut self, v: GridBlockMetaData) { - self.block_meta_data = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_block_meta_data(&mut self) -> &mut GridBlockMetaData { - if self.block_meta_data.is_none() { - self.block_meta_data.set_default(); - } - self.block_meta_data.as_mut().unwrap() - } - - // Take field - pub fn take_block_meta_data(&mut self) -> GridBlockMetaData { - self.block_meta_data.take().unwrap_or_else(|| GridBlockMetaData::new()) - } -} - -impl ::protobuf::Message for BuildGridContext { - fn is_initialized(&self) -> bool { - for v in &self.field_metas { - if !v.is_initialized() { - return false; - } - }; - for v in &self.block_meta { - if !v.is_initialized() { - return false; - } - }; - for v in &self.block_meta_data { - if !v.is_initialized() { - return false; - } - }; - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.field_metas)?; - }, - 2 => { - ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.block_meta)?; - }, - 3 => { - ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.block_meta_data)?; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - for value in &self.field_metas { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - }; - if let Some(ref v) = self.block_meta.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - if let Some(ref v) = self.block_meta_data.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - for v in &self.field_metas { - os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - }; - if let Some(ref v) = self.block_meta.as_ref() { - os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - if let Some(ref v) = self.block_meta_data.as_ref() { - os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> BuildGridContext { - BuildGridContext::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "field_metas", - |m: &BuildGridContext| { &m.field_metas }, - |m: &mut BuildGridContext| { &mut m.field_metas }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "block_meta", - |m: &BuildGridContext| { &m.block_meta }, - |m: &mut BuildGridContext| { &mut m.block_meta }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "block_meta_data", - |m: &BuildGridContext| { &m.block_meta_data }, - |m: &mut BuildGridContext| { &mut m.block_meta_data }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "BuildGridContext", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static BuildGridContext { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(BuildGridContext::new) - } -} - -impl ::protobuf::Clear for BuildGridContext { - fn clear(&mut self) { - self.field_metas.clear(); - self.block_meta.clear(); - self.block_meta_data.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for BuildGridContext { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for BuildGridContext { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(Clone,PartialEq,Eq,Debug,Hash)] -pub enum FieldType { - RichText = 0, - Number = 1, - DateTime = 2, - SingleSelect = 3, - MultiSelect = 4, - Checkbox = 5, -} - -impl ::protobuf::ProtobufEnum for FieldType { - fn value(&self) -> i32 { - *self as i32 - } - - fn from_i32(value: i32) -> ::std::option::Option { - match value { - 0 => ::std::option::Option::Some(FieldType::RichText), - 1 => ::std::option::Option::Some(FieldType::Number), - 2 => ::std::option::Option::Some(FieldType::DateTime), - 3 => ::std::option::Option::Some(FieldType::SingleSelect), - 4 => ::std::option::Option::Some(FieldType::MultiSelect), - 5 => ::std::option::Option::Some(FieldType::Checkbox), - _ => ::std::option::Option::None - } - } - - fn values() -> &'static [Self] { - static values: &'static [FieldType] = &[ - FieldType::RichText, - FieldType::Number, - FieldType::DateTime, - FieldType::SingleSelect, - FieldType::MultiSelect, - FieldType::Checkbox, - ]; - values - } - - fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - ::protobuf::reflect::EnumDescriptor::new_pb_name::("FieldType", file_descriptor_proto()) - }) - } -} - -impl ::std::marker::Copy for FieldType { -} - -impl ::std::default::Default for FieldType { - fn default() -> Self { - FieldType::RichText - } -} - -impl ::protobuf::reflect::ProtobufValue for FieldType { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self)) - } -} - -static file_descriptor_proto_data: &'static [u8] = b"\ - \n\nmeta.proto\"o\n\x08GridMeta\x12\x17\n\x07grid_id\x18\x01\x20\x01(\tR\ - \x06gridId\x12\"\n\x06fields\x18\x02\x20\x03(\x0b2\n.FieldMetaR\x06field\ - s\x12&\n\x06blocks\x18\x03\x20\x03(\x0b2\x0e.GridBlockMetaR\x06blocks\"o\ - \n\rGridBlockMeta\x12\x19\n\x08block_id\x18\x01\x20\x01(\tR\x07blockId\ - \x12&\n\x0fstart_row_index\x18\x02\x20\x01(\x05R\rstartRowIndex\x12\x1b\ - \n\trow_count\x18\x03\x20\x01(\x05R\x08rowCount\"L\n\x11GridBlockMetaDat\ - a\x12\x19\n\x08block_id\x18\x01\x20\x01(\tR\x07blockId\x12\x1c\n\x04rows\ - \x18\x02\x20\x03(\x0b2\x08.RowMetaR\x04rows\"\xbc\x02\n\tFieldMeta\x12\ - \x0e\n\x02id\x18\x01\x20\x01(\tR\x02id\x12\x12\n\x04name\x18\x02\x20\x01\ - (\tR\x04name\x12\x12\n\x04desc\x18\x03\x20\x01(\tR\x04desc\x12)\n\nfield\ - _type\x18\x04\x20\x01(\x0e2\n.FieldTypeR\tfieldType\x12\x16\n\x06frozen\ - \x18\x05\x20\x01(\x08R\x06frozen\x12\x1e\n\nvisibility\x18\x06\x20\x01(\ - \x08R\nvisibility\x12\x14\n\x05width\x18\x07\x20\x01(\x05R\x05width\x12>\ - \n\x0ctype_options\x18\x08\x20\x03(\x0b2\x1b.FieldMeta.TypeOptionsEntryR\ - \x0btypeOptions\x1a>\n\x10TypeOptionsEntry\x12\x10\n\x03key\x18\x01\x20\ - \x01(\tR\x03key\x12\x14\n\x05value\x18\x02\x20\x01(\tR\x05value:\x028\ - \x01\"\xa8\x03\n\x15FieldChangesetPayload\x12\x19\n\x08field_id\x18\x01\ - \x20\x01(\tR\x07fieldId\x12\x17\n\x07grid_id\x18\x02\x20\x01(\tR\x06grid\ - Id\x12\x14\n\x04name\x18\x03\x20\x01(\tH\0R\x04name\x12\x14\n\x04desc\ - \x18\x04\x20\x01(\tH\x01R\x04desc\x12+\n\nfield_type\x18\x05\x20\x01(\ - \x0e2\n.FieldTypeH\x02R\tfieldType\x12\x18\n\x06frozen\x18\x06\x20\x01(\ - \x08H\x03R\x06frozen\x12\x20\n\nvisibility\x18\x07\x20\x01(\x08H\x04R\nv\ - isibility\x12\x16\n\x05width\x18\x08\x20\x01(\x05H\x05R\x05width\x12*\n\ - \x10type_option_data\x18\t\x20\x01(\x0cH\x06R\x0etypeOptionDataB\r\n\x0b\ - one_of_nameB\r\n\x0bone_of_descB\x13\n\x11one_of_field_typeB\x0f\n\rone_\ - of_frozenB\x13\n\x11one_of_visibilityB\x0e\n\x0cone_of_widthB\x19\n\x17o\ - ne_of_type_option_data\"8\n\x07AnyData\x12\x17\n\x07type_id\x18\x01\x20\ - \x01(\tR\x06typeId\x12\x14\n\x05value\x18\x02\x20\x01(\x0cR\x05value\"\ - \xdc\x01\n\x07RowMeta\x12\x0e\n\x02id\x18\x01\x20\x01(\tR\x02id\x12\x19\ - \n\x08block_id\x18\x02\x20\x01(\tR\x07blockId\x12)\n\x05cells\x18\x03\ - \x20\x03(\x0b2\x13.RowMeta.CellsEntryR\x05cells\x12\x16\n\x06height\x18\ - \x04\x20\x01(\x05R\x06height\x12\x1e\n\nvisibility\x18\x05\x20\x01(\x08R\ - \nvisibility\x1aC\n\nCellsEntry\x12\x10\n\x03key\x18\x01\x20\x01(\tR\x03\ - key\x12\x1f\n\x05value\x18\x02\x20\x01(\x0b2\t.CellMetaR\x05value:\x028\ - \x01\"\xa7\x02\n\x10RowMetaChangeset\x12\x15\n\x06row_id\x18\x01\x20\x01\ - (\tR\x05rowId\x12\x18\n\x06height\x18\x02\x20\x01(\x05H\0R\x06height\x12\ - \x20\n\nvisibility\x18\x03\x20\x01(\x08H\x01R\nvisibility\x12M\n\x10cell\ - _by_field_id\x18\x04\x20\x03(\x0b2$.RowMetaChangeset.CellByFieldIdEntryR\ - \rcellByFieldId\x1aK\n\x12CellByFieldIdEntry\x12\x10\n\x03key\x18\x01\ - \x20\x01(\tR\x03key\x12\x1f\n\x05value\x18\x02\x20\x01(\x0b2\t.CellMetaR\ - \x05value:\x028\x01B\x0f\n\rone_of_heightB\x13\n\x11one_of_visibility\"\ - \x1e\n\x08CellMeta\x12\x12\n\x04data\x18\x01\x20\x01(\tR\x04data\"\x83\ - \x01\n\x11CellMetaChangeset\x12\x17\n\x07grid_id\x18\x01\x20\x01(\tR\x06\ - gridId\x12\x15\n\x06row_id\x18\x02\x20\x01(\tR\x05rowId\x12\x19\n\x08fie\ - ld_id\x18\x03\x20\x01(\tR\x07fieldId\x12\x14\n\x04data\x18\x04\x20\x01(\ - \tH\0R\x04dataB\r\n\x0bone_of_data\"\xaa\x01\n\x10BuildGridContext\x12+\ - \n\x0bfield_metas\x18\x01\x20\x03(\x0b2\n.FieldMetaR\nfieldMetas\x12-\n\ - \nblock_meta\x18\x02\x20\x01(\x0b2\x0e.GridBlockMetaR\tblockMeta\x12:\n\ - \x0fblock_meta_data\x18\x03\x20\x01(\x0b2\x12.GridBlockMetaDataR\rblockM\ - etaData*d\n\tFieldType\x12\x0c\n\x08RichText\x10\0\x12\n\n\x06Number\x10\ - \x01\x12\x0c\n\x08DateTime\x10\x02\x12\x10\n\x0cSingleSelect\x10\x03\x12\ - \x0f\n\x0bMultiSelect\x10\x04\x12\x0c\n\x08Checkbox\x10\x05b\x06proto3\ -"; - -static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT; - -fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { - ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() -} - -pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { - file_descriptor_proto_lazy.get(|| { - parse_descriptor_proto() - }) -} diff --git a/shared-lib/flowy-grid-data-model/src/protobuf/model/mod.rs b/shared-lib/flowy-grid-data-model/src/protobuf/model/mod.rs index d011b76000..7b56c6cee8 100644 --- a/shared-lib/flowy-grid-data-model/src/protobuf/model/mod.rs +++ b/shared-lib/flowy-grid-data-model/src/protobuf/model/mod.rs @@ -3,6 +3,3 @@ mod grid; pub use grid::*; - -mod meta; -pub use meta::*; diff --git a/shared-lib/flowy-grid-data-model/src/protobuf/proto/grid.proto b/shared-lib/flowy-grid-data-model/src/protobuf/proto/grid.proto index cad2a6a108..a616ea8fd9 100644 --- a/shared-lib/flowy-grid-data-model/src/protobuf/proto/grid.proto +++ b/shared-lib/flowy-grid-data-model/src/protobuf/proto/grid.proto @@ -1,5 +1,4 @@ syntax = "proto3"; -import "meta.proto"; message Grid { string id = 1; @@ -113,3 +112,28 @@ message QueryGridBlocksPayload { string grid_id = 1; repeated GridBlockOrder block_orders = 2; } +message FieldChangesetPayload { + string field_id = 1; + string grid_id = 2; + oneof one_of_name { string name = 3; }; + oneof one_of_desc { string desc = 4; }; + oneof one_of_field_type { FieldType field_type = 5; }; + oneof one_of_frozen { bool frozen = 6; }; + oneof one_of_visibility { bool visibility = 7; }; + oneof one_of_width { int32 width = 8; }; + oneof one_of_type_option_data { bytes type_option_data = 9; }; +} +message CellChangeset { + string grid_id = 1; + string row_id = 2; + string field_id = 3; + oneof one_of_data { string data = 4; }; +} +enum FieldType { + RichText = 0; + Number = 1; + DateTime = 2; + SingleSelect = 3; + MultiSelect = 4; + Checkbox = 5; +} diff --git a/shared-lib/flowy-grid-data-model/src/protobuf/proto/meta.proto b/shared-lib/flowy-grid-data-model/src/protobuf/proto/meta.proto deleted file mode 100644 index dcc8d5f91c..0000000000 --- a/shared-lib/flowy-grid-data-model/src/protobuf/proto/meta.proto +++ /dev/null @@ -1,76 +0,0 @@ -syntax = "proto3"; - -message GridMeta { - string grid_id = 1; - repeated FieldMeta fields = 2; - repeated GridBlockMeta blocks = 3; -} -message GridBlockMeta { - string block_id = 1; - int32 start_row_index = 2; - int32 row_count = 3; -} -message GridBlockMetaData { - string block_id = 1; - repeated RowMeta rows = 2; -} -message FieldMeta { - string id = 1; - string name = 2; - string desc = 3; - FieldType field_type = 4; - bool frozen = 5; - bool visibility = 6; - int32 width = 7; - map type_options = 8; -} -message FieldChangesetPayload { - string field_id = 1; - string grid_id = 2; - oneof one_of_name { string name = 3; }; - oneof one_of_desc { string desc = 4; }; - oneof one_of_field_type { FieldType field_type = 5; }; - oneof one_of_frozen { bool frozen = 6; }; - oneof one_of_visibility { bool visibility = 7; }; - oneof one_of_width { int32 width = 8; }; - oneof one_of_type_option_data { bytes type_option_data = 9; }; -} -message AnyData { - string type_id = 1; - bytes value = 2; -} -message RowMeta { - string id = 1; - string block_id = 2; - map cells = 3; - int32 height = 4; - bool visibility = 5; -} -message RowMetaChangeset { - string row_id = 1; - oneof one_of_height { int32 height = 2; }; - oneof one_of_visibility { bool visibility = 3; }; - map cell_by_field_id = 4; -} -message CellMeta { - string data = 1; -} -message CellMetaChangeset { - string grid_id = 1; - string row_id = 2; - string field_id = 3; - oneof one_of_data { string data = 4; }; -} -message BuildGridContext { - repeated FieldMeta field_metas = 1; - GridBlockMeta block_meta = 2; - GridBlockMetaData block_meta_data = 3; -} -enum FieldType { - RichText = 0; - Number = 1; - DateTime = 2; - SingleSelect = 3; - MultiSelect = 4; - Checkbox = 5; -} diff --git a/shared-lib/flowy-sync/src/client_grid/grid_block_meta_pad.rs b/shared-lib/flowy-sync/src/client_grid/grid_block_meta_pad.rs index 7a06551525..84d3fb2381 100644 --- a/shared-lib/flowy-sync/src/client_grid/grid_block_meta_pad.rs +++ b/shared-lib/flowy-sync/src/client_grid/grid_block_meta_pad.rs @@ -166,7 +166,7 @@ impl GridBlockMetaPad { tracing::debug!("[GridBlockMeta] Composing delta {}", delta.to_delta_str()); tracing::debug!( "[GridBlockMeta] current delta: {}", - self.delta.to_str().unwrap_or("".to_string()) + self.delta.to_str().unwrap_or_else(|_| "".to_string()) ); self.delta = self.delta.compose(&delta)?; Ok(Some(GridBlockMetaChange { delta, md5: self.md5() })) @@ -255,7 +255,8 @@ mod tests { visibility: false, }; - let change = pad.add_row_meta(row, None).unwrap().unwrap(); + let change = pad.add_row_meta(row.clone(), None).unwrap().unwrap(); + assert_eq!(pad.rows.first().unwrap().as_ref(), &row); assert_eq!( change.delta.to_delta_str(), r#"[{"retain":24},{"insert":"{\"id\":\"1\",\"block_id\":\"1\",\"cells\":{},\"height\":0,\"visibility\":false}"},{"retain":2}]"# @@ -384,7 +385,7 @@ mod tests { assert_eq!( pad.to_json().unwrap(), - r#"{"block_id":"1","rows":[{"id":"1","block_id":"1","cells":{},"height":100,"visibility":true}]}"# + r#"{"block_id":"1","rows":[{"id":"1","block_id":"1","cells":[],"height":100,"visibility":true}]}"# ); }