From 229b75bcb2fa4e13402431454ca7097a19c31a6e Mon Sep 17 00:00:00 2001 From: Alexander Zhuravlev Date: Wed, 13 Oct 2021 10:06:45 +0300 Subject: [PATCH 01/32] [BEAM-12967]: Created Examples Component --- playground/frontend/analysis_options.yaml | 4 +- .../toggle_theme_button.dart | 4 +- playground/frontend/lib/config/theme.dart | 12 +- playground/frontend/lib/constants/sizes.dart | 15 +- .../editor/components/editor_textarea.dart | 2 +- .../category_expansion_panel.dart | 77 ++++++++ .../components/example_list/example_list.dart | 54 +++++ .../example_list/expansion_panel_item.dart | 53 +++++ .../components/examples_components.dart | 23 +++ .../components/filter/category_bubble.dart | 65 ++++++ .../components/filter/type_filter.dart | 43 ++++ .../components/search_field/search_field.dart | 83 ++++++++ .../modules/examples/example_selector.dart | 185 ++++++++++++++++++ .../examples/models/category_model.dart | 26 +++ .../examples/models/example_model.dart | 9 +- .../examples/models/selector_size_model.dart | 27 +++ .../repositories/example_repository.dart | 90 +++++++-- .../modules/sdk/components/sdk_selector.dart | 6 +- .../frontend/lib/modules/sdk/models/sdk.dart | 8 +- .../components/playground_page_providers.dart | 7 +- .../lib/pages/playground/playground_page.dart | 68 ++++--- .../states/example_dropdown_state.dart | 32 +++ .../playground/states/examples_state.dart | 16 +- .../playground/states/playground_state.dart | 14 +- playground/frontend/lib/playground_app.dart | 17 +- playground/frontend/pubspec.lock | 7 + playground/frontend/pubspec.yaml | 1 + 27 files changed, 872 insertions(+), 76 deletions(-) create mode 100644 playground/frontend/lib/modules/examples/components/example_list/category_expansion_panel.dart create mode 100644 playground/frontend/lib/modules/examples/components/example_list/example_list.dart create mode 100644 playground/frontend/lib/modules/examples/components/example_list/expansion_panel_item.dart create mode 100644 playground/frontend/lib/modules/examples/components/examples_components.dart create mode 100644 playground/frontend/lib/modules/examples/components/filter/category_bubble.dart create mode 100644 playground/frontend/lib/modules/examples/components/filter/type_filter.dart create mode 100644 playground/frontend/lib/modules/examples/components/search_field/search_field.dart create mode 100644 playground/frontend/lib/modules/examples/example_selector.dart create mode 100644 playground/frontend/lib/modules/examples/models/category_model.dart create mode 100644 playground/frontend/lib/modules/examples/models/selector_size_model.dart create mode 100644 playground/frontend/lib/pages/playground/states/example_dropdown_state.dart diff --git a/playground/frontend/analysis_options.yaml b/playground/frontend/analysis_options.yaml index 38742fed9d79..ebd797232f61 100644 --- a/playground/frontend/analysis_options.yaml +++ b/playground/frontend/analysis_options.yaml @@ -40,8 +40,8 @@ linter: # producing the lint. rules: avoid_web_libraries_in_flutter: false - # avoid_print: false # Uncomment to disable the `avoid_print` rule - # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule +# avoid_print: false # Uncomment to disable the `avoid_print` rule + prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule # Additional information about this file can be found at # https://dart.dev/guides/language/analysis-options diff --git a/playground/frontend/lib/components/toggle_theme_button/toggle_theme_button.dart b/playground/frontend/lib/components/toggle_theme_button/toggle_theme_button.dart index d17bfc6737e4..cc9852968a16 100644 --- a/playground/frontend/lib/components/toggle_theme_button/toggle_theme_button.dart +++ b/playground/frontend/lib/components/toggle_theme_button/toggle_theme_button.dart @@ -23,8 +23,8 @@ import 'package:playground/constants/assets.dart'; import 'package:playground/constants/sizes.dart'; import 'package:provider/provider.dart'; -const kLightMode = "Light Mode"; -const kDartMode = "Dark Mode"; +const kLightMode = 'Light Mode'; +const kDartMode = 'Dark Mode'; class ToggleThemeButton extends StatelessWidget { const ToggleThemeButton({Key? key}) : super(key: key); diff --git a/playground/frontend/lib/config/theme.dart b/playground/frontend/lib/config/theme.dart index 9baeb58538c2..83a431051244 100644 --- a/playground/frontend/lib/config/theme.dart +++ b/playground/frontend/lib/config/theme.dart @@ -61,7 +61,7 @@ TextButtonThemeData createTextButtonTheme(Color textColor) { style: TextButton.styleFrom( primary: textColor, shape: const RoundedRectangleBorder( - borderRadius: BorderRadius.all(Radius.circular(kBorderRadius)), + borderRadius: BorderRadius.all(Radius.circular(kLgBorderRadius)), ), ), ); @@ -77,7 +77,7 @@ PopupMenuThemeData createPopupMenuTheme() { return const PopupMenuThemeData( shape: RoundedRectangleBorder( borderRadius: BorderRadius.all( - Radius.circular(kBorderRadius), + Radius.circular(kLgBorderRadius), ), ), ); @@ -137,6 +137,14 @@ class ThemeColors { Color get greyColor => isDark ? kDarkGrey : kLightGrey; + Color get lightGreyColor => isDark ? kLightGrey1 : kLightGrey; + + Color get primary => isDark ? kLightPrimary : kDarkPrimary; + + Color get primaryBackgroundTextColor => Colors.white; + + Color get lightGreyBackgroundTextColor => Colors.black; + Color get grey1Color => isDark ? kDarkGrey1 : kLightGrey1; Color get secondaryBackground => diff --git a/playground/frontend/lib/constants/sizes.dart b/playground/frontend/lib/constants/sizes.dart index 35a8fb8a8cef..6fef53980515 100644 --- a/playground/frontend/lib/constants/sizes.dart +++ b/playground/frontend/lib/constants/sizes.dart @@ -20,7 +20,9 @@ const double kZeroSpacing = 0.0; const double kSmSpacing = 4.0; const double kMdSpacing = 8.0; -const double kLgSpacing = 16.0; +const double kLgSpacing = 12.0; +const double kXlSpacing = 16.0; +const double kXxlSpacing = 36.0; // sizes const kHeaderButtonHeight = 46.0; @@ -30,10 +32,19 @@ const kIconButtonSplashRadius = 24.0; const kFooterHeight = 32.0; // border radius -const double kBorderRadius = 8.0; +const double kSmBorderRadius = 4.0; +const double kMdBorderRadius = 6.0; +const double kLgBorderRadius = 8.0; +const double kXlBorderRadius = 28.0; // elevation const int kElevation = 1; // icon sizes const double kIconSizeMd = 24.0; + +// cursor size +const double kCursorSize = 1.0; + +// container size +const double kContainerHeight = 40.0; diff --git a/playground/frontend/lib/modules/editor/components/editor_textarea.dart b/playground/frontend/lib/modules/editor/components/editor_textarea.dart index 029e38ea07a1..69225fd9e3b7 100644 --- a/playground/frontend/lib/modules/editor/components/editor_textarea.dart +++ b/playground/frontend/lib/modules/editor/components/editor_textarea.dart @@ -56,7 +56,7 @@ class _EditorTextAreaState extends State { void didChangeDependencies() { final themeProvider = Provider.of(context, listen: true); _codeController = CodeController( - text: _codeController?.text ?? widget.example?.sources[widget.sdk] ?? "", + text: _codeController?.text ?? widget.example?.sources[widget.sdk] ?? '', language: _getLanguageFromSdk(), theme: themeProvider.isDarkMode ? darculaTheme : vsTheme, onChange: (newSource) => widget.onSourceChange(newSource), diff --git a/playground/frontend/lib/modules/examples/components/example_list/category_expansion_panel.dart b/playground/frontend/lib/modules/examples/components/example_list/category_expansion_panel.dart new file mode 100644 index 000000000000..441fd9cf961c --- /dev/null +++ b/playground/frontend/lib/modules/examples/components/example_list/category_expansion_panel.dart @@ -0,0 +1,77 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import 'dart:math' as math; + +import 'package:expansion_widget/expansion_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:playground/constants/sizes.dart'; +import 'package:playground/modules/examples/components/example_list/expansion_panel_item.dart'; + +class CategoryExpansionPanel extends StatelessWidget { + final String categoryName; + final List examples; + + const CategoryExpansionPanel({ + Key? key, + required this.categoryName, + required this.examples, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return ExpansionWidget( + maintainState: true, + titleBuilder: (animationValue, _, isExpanded, toggleFunction) => InkWell( + onTap: () => toggleFunction(animated: true), + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: kLgSpacing), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Transform.rotate( + angle: -math.pi * animationValue, + child: const Icon(Icons.keyboard_arrow_down), + alignment: Alignment.center, + ), + SizedBox( + height: kContainerHeight, + child: Align( + alignment: Alignment.centerLeft, + child: Text(categoryName), + ), + ), + ], + ), + ), + ), + content: Column( + children: buildItems(), + ), + ); + } + + List buildItems() { + List items = []; + for (var example in examples) { + items.add( + ExpansionPanelItem(example: example), + ); + } + return items; + } +} diff --git a/playground/frontend/lib/modules/examples/components/example_list/example_list.dart b/playground/frontend/lib/modules/examples/components/example_list/example_list.dart new file mode 100644 index 000000000000..ca5f2177602a --- /dev/null +++ b/playground/frontend/lib/modules/examples/components/example_list/example_list.dart @@ -0,0 +1,54 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import 'package:flutter/material.dart'; +import 'package:playground/modules/examples/components/examples_components.dart'; + +class ExampleList extends StatelessWidget { + final List items; + final ScrollController controller; + + const ExampleList({ + Key? key, + required this.items, + required this.controller, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return Expanded( + child: Container( + color: Theme.of(context).backgroundColor, + child: Scrollbar( + isAlwaysShown: true, + showTrackOnHover: true, + controller: controller, + child: ListView.builder( + itemCount: items.length, + itemBuilder: (context, index) => CategoryExpansionPanel( + categoryName: items[index].name, + examples: items[index].examples, + ), + controller: controller, + shrinkWrap: true, + ), + ), + ), + ); + } +} diff --git a/playground/frontend/lib/modules/examples/components/example_list/expansion_panel_item.dart b/playground/frontend/lib/modules/examples/components/example_list/expansion_panel_item.dart new file mode 100644 index 000000000000..560fbca079b7 --- /dev/null +++ b/playground/frontend/lib/modules/examples/components/example_list/expansion_panel_item.dart @@ -0,0 +1,53 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import 'package:flutter/material.dart'; +import 'package:playground/constants/sizes.dart'; +import 'package:playground/modules/examples/models/example_model.dart'; +import 'package:playground/pages/playground/states/playground_state.dart'; +import 'package:provider/provider.dart'; + +class ExpansionPanelItem extends StatelessWidget { + final ExampleModel example; + + const ExpansionPanelItem({Key? key, required this.example}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Consumer( + builder: (context, state, child) => GestureDetector( + onTap: () { + if (state.selectedExample != example) { + state.setExample(example); + } + }, + child: Container( + color: Colors.transparent, + margin: const EdgeInsets.only(left: kXxlSpacing), + height: kContainerHeight, + child: Row( + children: [ + // Wrapped with Row for better user interaction and positioning + Text(example.name), + ], + ), + ), + ), + ); + } +} diff --git a/playground/frontend/lib/modules/examples/components/examples_components.dart b/playground/frontend/lib/modules/examples/components/examples_components.dart new file mode 100644 index 000000000000..cd7ac4ad4f7f --- /dev/null +++ b/playground/frontend/lib/modules/examples/components/examples_components.dart @@ -0,0 +1,23 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export 'package:playground/modules/examples/components/example_list/category_expansion_panel.dart'; +export 'package:playground/modules/examples/components/example_list/example_list.dart'; +export 'package:playground/modules/examples/components/filter/category_bubble.dart'; +export 'package:playground/modules/examples/components/filter/type_filter.dart'; +export 'package:playground/modules/examples/components/search_field/search_field.dart'; diff --git a/playground/frontend/lib/modules/examples/components/filter/category_bubble.dart b/playground/frontend/lib/modules/examples/components/filter/category_bubble.dart new file mode 100644 index 000000000000..462c9f3f7a1c --- /dev/null +++ b/playground/frontend/lib/modules/examples/components/filter/category_bubble.dart @@ -0,0 +1,65 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import 'package:flutter/material.dart'; +import 'package:playground/config/theme.dart'; +import 'package:playground/constants/sizes.dart'; +import 'package:playground/pages/playground/states/example_dropdown_state.dart'; +import 'package:provider/provider.dart'; + +class CategoryBubble extends StatelessWidget { + final String name; + + const CategoryBubble({Key? key, required this.name}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.only(right: kMdSpacing), + child: Consumer( + builder: (context, state, child) => GestureDetector( + onTap: () { + if (name != state.selectedCategory) { + state.setSelectedCategory(name); + } + }, + child: Container( + height: kContainerHeight, + padding: const EdgeInsets.symmetric(horizontal: kXlSpacing), + decoration: BoxDecoration( + color: name == state.selectedCategory + ? ThemeColors.of(context).primary + : ThemeColors.of(context).lightGreyColor, + borderRadius: BorderRadius.circular(kXlBorderRadius), + ), + child: Center( + child: Text( + name, + style: TextStyle( + color: name == state.selectedCategory + ? ThemeColors.of(context).primaryBackgroundTextColor + : ThemeColors.of(context).lightGreyBackgroundTextColor, + ), + ), + ), + ), + ), + ), + ); + } +} diff --git a/playground/frontend/lib/modules/examples/components/filter/type_filter.dart b/playground/frontend/lib/modules/examples/components/filter/type_filter.dart new file mode 100644 index 000000000000..7e4eb9a9b081 --- /dev/null +++ b/playground/frontend/lib/modules/examples/components/filter/type_filter.dart @@ -0,0 +1,43 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import 'package:flutter/material.dart'; +import 'package:playground/constants/sizes.dart'; +import 'package:playground/modules/examples/components/examples_components.dart'; + +class TypeFilter extends StatelessWidget { + const TypeFilter({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.symmetric( + horizontal: kLgSpacing, + vertical: kMdSpacing, + ), + child: Row( + children: const [ + CategoryBubble(name: 'All'), + CategoryBubble(name: 'Examples'), + CategoryBubble(name: 'Katas'), + CategoryBubble(name: 'Unit tests'), + ], + ), + ); + } +} diff --git a/playground/frontend/lib/modules/examples/components/search_field/search_field.dart b/playground/frontend/lib/modules/examples/components/search_field/search_field.dart new file mode 100644 index 000000000000..fe59aa784dd9 --- /dev/null +++ b/playground/frontend/lib/modules/examples/components/search_field/search_field.dart @@ -0,0 +1,83 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import 'package:flutter/material.dart'; +import 'package:playground/config/theme.dart'; +import 'package:playground/constants/sizes.dart'; + +const double kContainerWidth = 376.0; +const int kMinLines = 1; +const int kMaxLines = 1; +const String kHintText = 'Search'; + +class SearchField extends StatelessWidget { + final TextEditingController controller; + + const SearchField({Key? key, required this.controller}) : super(key: key); + + @override + Widget build(BuildContext context) { + final OutlineInputBorder border = OutlineInputBorder( + borderSide: BorderSide(color: ThemeColors.of(context).lightGreyColor), + borderRadius: BorderRadius.circular(kMdBorderRadius), + ); + + return Container( + margin: const EdgeInsets.only( + top: kLgSpacing, + right: kLgSpacing, + left: kLgSpacing, + ), + width: kContainerWidth, + height: kContainerHeight, + color: Theme.of(context).backgroundColor, + child: ClipRRect( + borderRadius: BorderRadius.circular(kMdBorderRadius), + child: TextFormField( + controller: controller, + decoration: InputDecoration( + suffixIcon: Padding( + padding: const EdgeInsetsDirectional.only( + start: kZeroSpacing, + end: kZeroSpacing, + ), + child: Icon( + Icons.search, + color: ThemeColors.of(context).lightGreyColor, + size: kIconSizeMd, + ), + ), + focusedBorder: border, + enabledBorder: border, + filled: false, + isDense: true, + hintText: kHintText, + contentPadding: const EdgeInsets.only(left: kLgSpacing), + ), + cursorColor: ThemeColors.of(context).lightGreyColor, + cursorWidth: kCursorSize, + textAlignVertical: TextAlignVertical.center, + onFieldSubmitted: (String txt) {}, + onChanged: (String txt) {}, + maxLines: kMinLines, + minLines: kMaxLines, + ), + ), + ); + } +} diff --git a/playground/frontend/lib/modules/examples/example_selector.dart b/playground/frontend/lib/modules/examples/example_selector.dart new file mode 100644 index 000000000000..9e7a811f4c38 --- /dev/null +++ b/playground/frontend/lib/modules/examples/example_selector.dart @@ -0,0 +1,185 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import 'package:flutter/material.dart'; +import 'package:playground/config/theme.dart'; +import 'package:playground/constants/sizes.dart'; +import 'package:playground/modules/examples/components/examples_components.dart'; +import 'package:playground/modules/examples/models/category_model.dart'; +import 'package:playground/modules/examples/models/selector_size_model.dart'; +import 'package:playground/pages/playground/states/example_dropdown_state.dart'; +import 'package:playground/pages/playground/states/playground_state.dart'; +import 'package:provider/provider.dart'; + +const int kAnimationDurationInMilliseconds = 80; +const Offset kAnimationBeginOffset = Offset(0.0, -0.02); +const Offset kAnimationEndOffset = Offset(0.0, 0.0); +const double kAdditionalDyAlignment = 50.0; +const double kLgContainerHeight = 444.0; +const double kLgContainerWidth = 400.0; + +class ExampleSelector extends StatefulWidget { + final Function changeSelectorVisibility; + final bool isSelectorOpened; + final List categories; + + const ExampleSelector({ + Key? key, + required this.changeSelectorVisibility, + required this.isSelectorOpened, + required this.categories, + }) : super(key: key); + + @override + State createState() => _ExampleSelectorState(); +} + +class _ExampleSelectorState extends State + with TickerProviderStateMixin { + final GlobalKey selectorKey = LabeledGlobalKey('ExampleSelector'); + late OverlayEntry? examplesDropdown; + late AnimationController animationController; + late Animation offsetAnimation; + + final TextEditingController textController = TextEditingController(); + final ScrollController scrollController = ScrollController(); + + @override + void initState() { + super.initState(); + animationController = AnimationController( + vsync: this, + duration: const Duration(milliseconds: kAnimationDurationInMilliseconds), + ); + offsetAnimation = Tween( + begin: kAnimationBeginOffset, + end: kAnimationEndOffset, + ).animate(animationController); + } + + @override + void dispose() { + animationController.dispose(); + textController.dispose(); + scrollController.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Container( + height: kContainerHeight, + decoration: BoxDecoration( + color: ThemeColors.of(context).greyColor, + borderRadius: BorderRadius.circular(kSmBorderRadius), + ), + child: Consumer( + builder: (context, state, child) => TextButton( + key: selectorKey, + onPressed: () { + if (widget.isSelectorOpened) { + animationController.reverse(); + examplesDropdown?.remove(); + } else { + animationController.forward(); + examplesDropdown = createExamplesDropdown(); + Overlay.of(context)?.insert(examplesDropdown!); + } + widget.changeSelectorVisibility(); + }, + child: Wrap( + alignment: WrapAlignment.center, + crossAxisAlignment: WrapCrossAlignment.center, + children: [ + Consumer( + builder: (context, state, child) => Text(state.examplesTitle), + ), + const Icon(Icons.keyboard_arrow_down), + ], + ), + ), + ), + ); + } + + OverlayEntry createExamplesDropdown() { + SelectorPositionModel posModel = findSelectorPositionData(); + + return OverlayEntry( + builder: (context) { + return Stack( + children: [ + GestureDetector( + onTap: () { + animationController.reverse(); + examplesDropdown?.remove(); + widget.changeSelectorVisibility(); + }, + child: Container( + color: Colors.transparent, + height: double.infinity, + width: double.infinity, + ), + ), + ChangeNotifierProvider( + create: (context) => ExampleDropdownState(), + builder: (context, _) => Positioned( + left: posModel.xAlignment, + top: posModel.yAlignment + kAdditionalDyAlignment, + child: SlideTransition( + position: offsetAnimation, + child: Material( + elevation: kElevation.toDouble(), + child: Container( + height: kLgContainerHeight, + width: kLgContainerWidth, + decoration: BoxDecoration( + color: Theme.of(context).backgroundColor, + borderRadius: BorderRadius.circular(kMdBorderRadius), + ), + child: Column( + children: [ + SearchField(controller: textController), + const TypeFilter(), + ExampleList( + controller: scrollController, + items: widget.categories, + ), + ], + ), + ), + ), + ), + ), + ), + ], + ); + }, + ); + } + + SelectorPositionModel findSelectorPositionData() { + RenderBox? rBox = + selectorKey.currentContext?.findRenderObject() as RenderBox; + SelectorPositionModel positionModel = SelectorPositionModel( + xAlignment: rBox.localToGlobal(Offset.zero).dx, + yAlignment: rBox.localToGlobal(Offset.zero).dy, + ); + return positionModel; + } +} diff --git a/playground/frontend/lib/modules/examples/models/category_model.dart b/playground/frontend/lib/modules/examples/models/category_model.dart new file mode 100644 index 000000000000..4b852a05fa25 --- /dev/null +++ b/playground/frontend/lib/modules/examples/models/category_model.dart @@ -0,0 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import 'package:playground/modules/examples/models/example_model.dart'; + +class CategoryModel { + final String name; + final List examples; + + CategoryModel(this.name, this.examples); +} diff --git a/playground/frontend/lib/modules/examples/models/example_model.dart b/playground/frontend/lib/modules/examples/models/example_model.dart index 9171669538b4..fb7bbb4ccb91 100644 --- a/playground/frontend/lib/modules/examples/models/example_model.dart +++ b/playground/frontend/lib/modules/examples/models/example_model.dart @@ -18,9 +18,16 @@ import 'package:playground/modules/sdk/models/sdk.dart'; +enum ExampleType { + example, + kata, + test, +} + class ExampleModel { final Map sources; + final ExampleType type; final String name; - const ExampleModel(this.sources, this.name); + const ExampleModel(this.sources, this.name, this.type); } diff --git a/playground/frontend/lib/modules/examples/models/selector_size_model.dart b/playground/frontend/lib/modules/examples/models/selector_size_model.dart new file mode 100644 index 000000000000..27954f7ae22a --- /dev/null +++ b/playground/frontend/lib/modules/examples/models/selector_size_model.dart @@ -0,0 +1,27 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +class SelectorPositionModel { + final double xAlignment; + final double yAlignment; + + const SelectorPositionModel({ + required this.xAlignment, + required this.yAlignment, + }); +} diff --git a/playground/frontend/lib/modules/examples/repositories/example_repository.dart b/playground/frontend/lib/modules/examples/repositories/example_repository.dart index 4264691d65d8..80d22e94b329 100644 --- a/playground/frontend/lib/modules/examples/repositories/example_repository.dart +++ b/playground/frontend/lib/modules/examples/repositories/example_repository.dart @@ -16,6 +16,7 @@ * limitations under the License. */ +import 'package:playground/modules/examples/models/category_model.dart'; import 'package:playground/modules/examples/models/example_model.dart'; import 'package:playground/modules/sdk/models/sdk.dart'; @@ -25,7 +26,7 @@ const javaHelloWorld = '''class HelloWorld { } }'''; -const pythonHelloWorld = "print(‘Hello World’)"; +const pythonHelloWorld = 'print(‘Hello World’)'; const goHelloWorld = '''package main @@ -37,17 +38,82 @@ func main() { fmt.Println("Hello World") }'''; +const scioHelloWorld = ''' +object Hello { + def main(args: Array[String]) = { + println("Hello, world") + } +}'''; + class ExampleRepository { - Future> getExamples() { - return Future.value([ - const ExampleModel( - { - SDK.java: javaHelloWorld, - SDK.go: goHelloWorld, - SDK.python: pythonHelloWorld, - }, - "Initial Example", - ) - ]); + List getCategories() { + return [ + CategoryModel('Side Inputs', const [ + ExampleModel( + { + SDK.java: javaHelloWorld, + SDK.go: goHelloWorld, + SDK.python: pythonHelloWorld, + SDK.scio: scioHelloWorld, + }, + 'HelloWorld', + ExampleType.example, + ), + ExampleModel( + { + SDK.java: 'JAVA Source code 1', + SDK.go: 'GO Source code 1', + SDK.python: 'PYTHON Source code 1', + SDK.scio: 'SCIO Source code 1', + }, + 'Source code 1', + ExampleType.kata, + ), + ]), + CategoryModel('Side Outputs', const [ + ExampleModel( + { + SDK.java: 'JAVA Source code 2', + SDK.go: 'GO Source code 2', + SDK.python: 'PYTHON Source code 2', + SDK.scio: 'SCIO Source code 2', + }, + 'Source code 2', + ExampleType.test, + ), + ExampleModel( + { + SDK.java: 'JAVA Source code 3', + SDK.go: 'GO Source code 3', + SDK.python: 'PYTHON Source code 3', + SDK.scio: 'SCIO Source code 3', + }, + 'Source code 3', + ExampleType.example, + ), + ]), + CategoryModel('I/O', const [ + ExampleModel( + { + SDK.java: 'JAVA Source code 4', + SDK.go: 'GO Source code 4', + SDK.python: 'PYTHON Source code 4', + SDK.scio: 'SCIO Source code 4', + }, + 'Source code 4', + ExampleType.kata, + ), + ExampleModel( + { + SDK.java: 'JAVA Source code 5', + SDK.go: 'GO Source code 5', + SDK.python: 'PYTHON Source code 5', + SDK.scio: 'SCIO Source code 5', + }, + 'Source code 5', + ExampleType.test, + ), + ]), + ]; } } diff --git a/playground/frontend/lib/modules/sdk/components/sdk_selector.dart b/playground/frontend/lib/modules/sdk/components/sdk_selector.dart index a30cd57b16dd..10b887afb424 100644 --- a/playground/frontend/lib/modules/sdk/components/sdk_selector.dart +++ b/playground/frontend/lib/modules/sdk/components/sdk_selector.dart @@ -35,11 +35,11 @@ class SDKSelector extends StatelessWidget { return Container( padding: const EdgeInsets.symmetric( vertical: kZeroSpacing, - horizontal: kLgSpacing, + horizontal: kXlSpacing, ), decoration: BoxDecoration( color: ThemeColors.of(context).greyColor, - borderRadius: BorderRadius.circular(kBorderRadius), + borderRadius: BorderRadius.circular(kLgBorderRadius), ), child: DropdownButtonHideUnderline( child: DropdownButton( @@ -47,7 +47,7 @@ class SDKSelector extends StatelessWidget { icon: const Icon(Icons.keyboard_arrow_down), iconSize: kIconSizeMd, elevation: kElevation, - borderRadius: BorderRadius.circular(kBorderRadius), + borderRadius: BorderRadius.circular(kLgBorderRadius), alignment: Alignment.bottomCenter, onChanged: (SDK? newSdk) { if (newSdk != null) { diff --git a/playground/frontend/lib/modules/sdk/models/sdk.dart b/playground/frontend/lib/modules/sdk/models/sdk.dart index 1406a038c287..78aa0afaf6f8 100644 --- a/playground/frontend/lib/modules/sdk/models/sdk.dart +++ b/playground/frontend/lib/modules/sdk/models/sdk.dart @@ -27,13 +27,13 @@ extension SDKToString on SDK { String get displayName { switch (this) { case SDK.go: - return "Go"; + return 'Go'; case SDK.java: - return "Java"; + return 'Java'; case SDK.python: - return "Python"; + return 'Python'; case SDK.scio: - return "SCIO"; + return 'SCIO'; } } } diff --git a/playground/frontend/lib/pages/playground/components/playground_page_providers.dart b/playground/frontend/lib/pages/playground/components/playground_page_providers.dart index f4ca7ae998a8..c4a598f08958 100644 --- a/playground/frontend/lib/pages/playground/components/playground_page_providers.dart +++ b/playground/frontend/lib/pages/playground/components/playground_page_providers.dart @@ -44,9 +44,10 @@ class PlaygroundPageProviders extends StatelessWidget { if (playground == null) { return PlaygroundState(); } - if (exampleState.examples?.isNotEmpty ?? false) { - return PlaygroundState( - playground.sdk, exampleState.examples!.first); + if ((exampleState.categories?.isNotEmpty ?? false) && + playground.selectedExample == null) { + return PlaygroundState(playground.sdk, + exampleState.categories?.first.examples.first); } return playground; }, diff --git a/playground/frontend/lib/pages/playground/playground_page.dart b/playground/frontend/lib/pages/playground/playground_page.dart index df2fbc5badb8..fce65824c272 100644 --- a/playground/frontend/lib/pages/playground/playground_page.dart +++ b/playground/frontend/lib/pages/playground/playground_page.dart @@ -17,49 +17,57 @@ */ import 'package:flutter/material.dart'; +import 'package:playground/components/logo/logo_component.dart'; import 'package:playground/components/toggle_theme_button/toggle_theme_button.dart'; import 'package:playground/constants/sizes.dart'; -import 'package:playground/pages/playground/components/playground_page_body.dart'; -import 'package:playground/pages/playground/components/playground_page_footer.dart'; -import 'package:playground/pages/playground/components/playground_page_providers.dart'; import 'package:playground/modules/actions/components/new_example_action.dart'; import 'package:playground/modules/actions/components/reset_action.dart'; +import 'package:playground/modules/examples/example_selector.dart'; +import 'package:playground/modules/sdk/components/sdk_selector.dart'; import 'package:playground/pages/playground/components/more_actions.dart'; -import 'package:provider/provider.dart'; +import 'package:playground/pages/playground/components/playground_page_body.dart'; +import 'package:playground/pages/playground/components/playground_page_footer.dart'; +import 'package:playground/pages/playground/states/examples_state.dart'; import 'package:playground/pages/playground/states/playground_state.dart'; -import 'package:playground/modules/sdk/components/sdk_selector.dart'; -import 'package:playground/components/logo/logo_component.dart'; +import 'package:provider/provider.dart'; class PlaygroundPage extends StatelessWidget { const PlaygroundPage({Key? key}) : super(key: key); @override Widget build(BuildContext context) { - return PlaygroundPageProviders( - child: Scaffold( - appBar: AppBar( - title: Consumer( - builder: (context, state, child) { - return Wrap( - crossAxisAlignment: WrapCrossAlignment.center, - spacing: kLgSpacing, - children: [ - const Logo(), - SDKSelector(sdk: state.sdk, setSdk: state.setSdk), - const NewExampleAction(), - ResetAction(reset: state.reset), - ], - ); - }, - ), - actions: const [ToggleThemeButton(), MoreActions()], - ), - body: Column( - children: const [ - Expanded(child: PlaygroundPageBody()), - PlaygroundPageFooter(), - ], + return Scaffold( + appBar: AppBar( + title: Consumer( + builder: (context, state, child) { + return Wrap( + crossAxisAlignment: WrapCrossAlignment.center, + spacing: kLgSpacing, + children: [ + const Logo(), + Consumer( + builder: (context, state, child) { + return ExampleSelector( + changeSelectorVisibility: state.changeSelectorVisibility, + isSelectorOpened: state.isSelectorOpened, + categories: state.categories!, + ); + }, + ), + SDKSelector(sdk: state.sdk, setSdk: state.setSdk), + const NewExampleAction(), + ResetAction(reset: state.reset), + ], + ); + }, ), + actions: const [ToggleThemeButton(), MoreActions()], + ), + body: Column( + children: const [ + Expanded(child: PlaygroundPageBody()), + PlaygroundPageFooter(), + ], ), ); } diff --git a/playground/frontend/lib/pages/playground/states/example_dropdown_state.dart b/playground/frontend/lib/pages/playground/states/example_dropdown_state.dart new file mode 100644 index 000000000000..38a966561fb1 --- /dev/null +++ b/playground/frontend/lib/pages/playground/states/example_dropdown_state.dart @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import 'package:flutter/material.dart'; + +class ExampleDropdownState with ChangeNotifier { + String _selectedCategory; + + ExampleDropdownState([this._selectedCategory = 'All']); + + String get selectedCategory => _selectedCategory; + + setSelectedCategory(String name) async { + _selectedCategory = name; + notifyListeners(); + } +} diff --git a/playground/frontend/lib/pages/playground/states/examples_state.dart b/playground/frontend/lib/pages/playground/states/examples_state.dart index 1077a7fee4e9..396f37cd95bf 100644 --- a/playground/frontend/lib/pages/playground/states/examples_state.dart +++ b/playground/frontend/lib/pages/playground/states/examples_state.dart @@ -17,19 +17,25 @@ */ import 'package:flutter/material.dart'; -import 'package:playground/modules/examples/models/example_model.dart'; +import 'package:playground/modules/examples/models/category_model.dart'; import 'package:playground/modules/examples/repositories/example_repository.dart'; class ExampleState with ChangeNotifier { final ExampleRepository _exampleRepository; - List? examples; + List? categories; + bool isSelectorOpened = false; ExampleState(this._exampleRepository) { - _loadExamples(); + _loadCategories(); } - _loadExamples() async { - examples = await _exampleRepository.getExamples(); + _loadCategories() { + categories = _exampleRepository.getCategories(); + notifyListeners(); + } + + changeSelectorVisibility() { + isSelectorOpened = !isSelectorOpened; notifyListeners(); } } diff --git a/playground/frontend/lib/pages/playground/states/playground_state.dart b/playground/frontend/lib/pages/playground/states/playground_state.dart index c83b7dc1b5e7..ef873edc9761 100644 --- a/playground/frontend/lib/pages/playground/states/playground_state.dart +++ b/playground/frontend/lib/pages/playground/states/playground_state.dart @@ -16,14 +16,24 @@ * limitations under the License. */ +import 'dart:math'; + import 'package:flutter/material.dart'; import 'package:playground/modules/examples/models/example_model.dart'; import 'package:playground/modules/sdk/models/sdk.dart'; +const kTitleLength = 15; +const kTitle = 'Catalog'; + class PlaygroundState with ChangeNotifier { SDK _sdk; ExampleModel? _selectedExample; - String _source = ""; + String _source = ''; + + String get examplesTitle { + final name = _selectedExample?.name ?? ''; + return name.substring(0, min(kTitleLength, name.length)); + } PlaygroundState([this._sdk = SDK.java, this._selectedExample]); @@ -35,7 +45,7 @@ class PlaygroundState with ChangeNotifier { setExample(ExampleModel example) { _selectedExample = example; - _source = example.sources[_sdk] ?? ""; + _source = example.sources[_sdk] ?? ''; notifyListeners(); } diff --git a/playground/frontend/lib/playground_app.dart b/playground/frontend/lib/playground_app.dart index 8ce11d100480..54955d0bbe8a 100644 --- a/playground/frontend/lib/playground_app.dart +++ b/playground/frontend/lib/playground_app.dart @@ -18,6 +18,7 @@ import 'package:flutter/material.dart'; import 'package:playground/config/theme.dart'; +import 'package:playground/pages/playground/components/playground_page_providers.dart'; import 'package:playground/pages/playground/playground_page.dart'; import 'package:provider/provider.dart'; @@ -30,13 +31,15 @@ class PlaygroundApp extends StatelessWidget { create: (context) => ThemeProvider(), builder: (context, _) { final themeProvider = Provider.of(context); - return MaterialApp( - title: 'Apache Beam Playground', - themeMode: themeProvider.themeMode, - theme: kLightTheme, - darkTheme: kDarkTheme, - home: const PlaygroundPage(), - debugShowCheckedModeBanner: false, + return PlaygroundPageProviders( + child: MaterialApp( + title: 'Apache Beam Playground', + themeMode: themeProvider.themeMode, + theme: kLightTheme, + darkTheme: kDarkTheme, + home: const PlaygroundPage(), + debugShowCheckedModeBanner: false, + ), ); }, ); diff --git a/playground/frontend/pubspec.lock b/playground/frontend/pubspec.lock index 845b026ab312..3e6ce43fa045 100644 --- a/playground/frontend/pubspec.lock +++ b/playground/frontend/pubspec.lock @@ -50,6 +50,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.15.0" + expansion_widget: + dependency: "direct main" + description: + name: expansion_widget + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.2" fake_async: dependency: transitive description: diff --git a/playground/frontend/pubspec.yaml b/playground/frontend/pubspec.yaml index 64230761eae6..90b58d5b2b8f 100644 --- a/playground/frontend/pubspec.yaml +++ b/playground/frontend/pubspec.yaml @@ -50,6 +50,7 @@ dependencies: code_text_field: ^1.0.0 flutter_svg: ^0.22.0 url_launcher: ^6.0.12 + expansion_widget: ^0.0.2 dev_dependencies: flutter_test: From 9d5b229a983b4fb1f243e01e84b58d9a0e63f24f Mon Sep 17 00:00:00 2001 From: Alexander Zhuravlev Date: Fri, 15 Oct 2021 12:31:09 +0300 Subject: [PATCH 02/32] [BEAM-12967]: Wrapped CategoryBubble and ExpansionPanelItem in MouseRegion --- .../example_list/expansion_panel_item.dart | 33 +++++++------ .../components/filter/category_bubble.dart | 47 ++++++++++--------- 2 files changed, 43 insertions(+), 37 deletions(-) diff --git a/playground/frontend/lib/modules/examples/components/example_list/expansion_panel_item.dart b/playground/frontend/lib/modules/examples/components/example_list/expansion_panel_item.dart index 560fbca079b7..2ae056070aab 100644 --- a/playground/frontend/lib/modules/examples/components/example_list/expansion_panel_item.dart +++ b/playground/frontend/lib/modules/examples/components/example_list/expansion_panel_item.dart @@ -30,21 +30,24 @@ class ExpansionPanelItem extends StatelessWidget { @override Widget build(BuildContext context) { return Consumer( - builder: (context, state, child) => GestureDetector( - onTap: () { - if (state.selectedExample != example) { - state.setExample(example); - } - }, - child: Container( - color: Colors.transparent, - margin: const EdgeInsets.only(left: kXxlSpacing), - height: kContainerHeight, - child: Row( - children: [ - // Wrapped with Row for better user interaction and positioning - Text(example.name), - ], + builder: (context, state, child) => MouseRegion( + cursor: SystemMouseCursors.click, + child: GestureDetector( + onTap: () { + if (state.selectedExample != example) { + state.setExample(example); + } + }, + child: Container( + color: Colors.transparent, + margin: const EdgeInsets.only(left: kXxlSpacing), + height: kContainerHeight, + child: Row( + children: [ + // Wrapped with Row for better user interaction and positioning + Text(example.name), + ], + ), ), ), ), diff --git a/playground/frontend/lib/modules/examples/components/filter/category_bubble.dart b/playground/frontend/lib/modules/examples/components/filter/category_bubble.dart index 462c9f3f7a1c..6481cdb6f631 100644 --- a/playground/frontend/lib/modules/examples/components/filter/category_bubble.dart +++ b/playground/frontend/lib/modules/examples/components/filter/category_bubble.dart @@ -32,28 +32,31 @@ class CategoryBubble extends StatelessWidget { return Padding( padding: const EdgeInsets.only(right: kMdSpacing), child: Consumer( - builder: (context, state, child) => GestureDetector( - onTap: () { - if (name != state.selectedCategory) { - state.setSelectedCategory(name); - } - }, - child: Container( - height: kContainerHeight, - padding: const EdgeInsets.symmetric(horizontal: kXlSpacing), - decoration: BoxDecoration( - color: name == state.selectedCategory - ? ThemeColors.of(context).primary - : ThemeColors.of(context).lightGreyColor, - borderRadius: BorderRadius.circular(kXlBorderRadius), - ), - child: Center( - child: Text( - name, - style: TextStyle( - color: name == state.selectedCategory - ? ThemeColors.of(context).primaryBackgroundTextColor - : ThemeColors.of(context).lightGreyBackgroundTextColor, + builder: (context, state, child) => MouseRegion( + cursor: SystemMouseCursors.click, + child: GestureDetector( + onTap: () { + if (name != state.selectedCategory) { + state.setSelectedCategory(name); + } + }, + child: Container( + height: kContainerHeight, + padding: const EdgeInsets.symmetric(horizontal: kXlSpacing), + decoration: BoxDecoration( + color: name == state.selectedCategory + ? ThemeColors.of(context).primary + : ThemeColors.of(context).lightGreyColor, + borderRadius: BorderRadius.circular(kXlBorderRadius), + ), + child: Center( + child: Text( + name, + style: TextStyle( + color: name == state.selectedCategory + ? ThemeColors.of(context).primaryBackgroundTextColor + : ThemeColors.of(context).lightGreyBackgroundTextColor, + ), ), ), ), From 5a49ae18aea8a90829771514a098c52ae44bf446 Mon Sep 17 00:00:00 2001 From: Alexander Zhuravlev Date: Fri, 15 Oct 2021 13:25:29 +0300 Subject: [PATCH 03/32] [BEAM-13064]: Implemented Search field and Filter by type components logic --- .../components/example_list/example_list.dart | 34 ++++---- .../components/filter/category_bubble.dart | 30 +++---- .../components/filter/type_filter.dart | 9 +- .../components/search_field/search_field.dart | 80 ++++++++++-------- .../modules/examples/example_selector.dart | 83 ++++++++++--------- .../examples/models/example_model.dart | 16 ++++ .../repositories/example_repository.dart | 10 +-- .../states/example_dropdown_state.dart | 68 +++++++++++++-- .../playground/states/mocks/example_mock.dart | 9 +- 9 files changed, 215 insertions(+), 124 deletions(-) diff --git a/playground/frontend/lib/modules/examples/components/example_list/example_list.dart b/playground/frontend/lib/modules/examples/components/example_list/example_list.dart index ca5f2177602a..c92211553ec5 100644 --- a/playground/frontend/lib/modules/examples/components/example_list/example_list.dart +++ b/playground/frontend/lib/modules/examples/components/example_list/example_list.dart @@ -18,34 +18,36 @@ import 'package:flutter/material.dart'; import 'package:playground/modules/examples/components/examples_components.dart'; +import 'package:playground/pages/playground/states/example_dropdown_state.dart'; +import 'package:provider/provider.dart'; class ExampleList extends StatelessWidget { - final List items; final ScrollController controller; const ExampleList({ Key? key, - required this.items, required this.controller, }) : super(key: key); @override Widget build(BuildContext context) { - return Expanded( - child: Container( - color: Theme.of(context).backgroundColor, - child: Scrollbar( - isAlwaysShown: true, - showTrackOnHover: true, - controller: controller, - child: ListView.builder( - itemCount: items.length, - itemBuilder: (context, index) => CategoryExpansionPanel( - categoryName: items[index].name, - examples: items[index].examples, - ), + return Consumer( + builder: (context, state, child) => Expanded( + child: Container( + color: Theme.of(context).backgroundColor, + child: Scrollbar( + isAlwaysShown: true, + showTrackOnHover: true, controller: controller, - shrinkWrap: true, + child: ListView.builder( + itemCount: state.categories.length, + itemBuilder: (context, index) => CategoryExpansionPanel( + categoryName: state.categories[index].name, + examples: state.categories[index].examples, + ), + controller: controller, + shrinkWrap: true, + ), ), ), ), diff --git a/playground/frontend/lib/modules/examples/components/filter/category_bubble.dart b/playground/frontend/lib/modules/examples/components/filter/category_bubble.dart index 6481cdb6f631..017ab540145f 100644 --- a/playground/frontend/lib/modules/examples/components/filter/category_bubble.dart +++ b/playground/frontend/lib/modules/examples/components/filter/category_bubble.dart @@ -19,41 +19,43 @@ import 'package:flutter/material.dart'; import 'package:playground/config/theme.dart'; import 'package:playground/constants/sizes.dart'; +import 'package:playground/modules/examples/models/example_model.dart'; import 'package:playground/pages/playground/states/example_dropdown_state.dart'; import 'package:provider/provider.dart'; class CategoryBubble extends StatelessWidget { - final String name; + final ExampleType type; - const CategoryBubble({Key? key, required this.name}) : super(key: key); + const CategoryBubble({Key? key, required this.type}) : super(key: key); @override Widget build(BuildContext context) { - return Padding( - padding: const EdgeInsets.only(right: kMdSpacing), - child: Consumer( - builder: (context, state, child) => MouseRegion( - cursor: SystemMouseCursors.click, - child: GestureDetector( + return MouseRegion( + cursor: SystemMouseCursors.click, + child: Padding( + padding: const EdgeInsets.only(right: kMdSpacing), + child: Consumer( + builder: (context, dropdownState, child) => GestureDetector( onTap: () { - if (name != state.selectedCategory) { - state.setSelectedCategory(name); + if (type != dropdownState.selectedCategory) { + dropdownState.setSelectedCategory(type); + dropdownState.sortExamplesByType(type); } }, child: Container( height: kContainerHeight, padding: const EdgeInsets.symmetric(horizontal: kXlSpacing), decoration: BoxDecoration( - color: name == state.selectedCategory + color: type == dropdownState.selectedCategory ? ThemeColors.of(context).primary : ThemeColors.of(context).lightGreyColor, borderRadius: BorderRadius.circular(kXlBorderRadius), ), child: Center( child: Text( - name, + type.name, style: TextStyle( - color: name == state.selectedCategory + color: type == dropdownState.selectedCategory ? ThemeColors.of(context).primaryBackgroundTextColor : ThemeColors.of(context).lightGreyBackgroundTextColor, ), @@ -65,4 +67,4 @@ class CategoryBubble extends StatelessWidget { ), ); } -} +} \ No newline at end of file diff --git a/playground/frontend/lib/modules/examples/components/filter/type_filter.dart b/playground/frontend/lib/modules/examples/components/filter/type_filter.dart index 7e4eb9a9b081..7b1bbed9b685 100644 --- a/playground/frontend/lib/modules/examples/components/filter/type_filter.dart +++ b/playground/frontend/lib/modules/examples/components/filter/type_filter.dart @@ -19,6 +19,7 @@ import 'package:flutter/material.dart'; import 'package:playground/constants/sizes.dart'; import 'package:playground/modules/examples/components/examples_components.dart'; +import 'package:playground/modules/examples/models/example_model.dart'; class TypeFilter extends StatelessWidget { const TypeFilter({Key? key}) : super(key: key); @@ -32,10 +33,10 @@ class TypeFilter extends StatelessWidget { ), child: Row( children: const [ - CategoryBubble(name: 'All'), - CategoryBubble(name: 'Examples'), - CategoryBubble(name: 'Katas'), - CategoryBubble(name: 'Unit tests'), + CategoryBubble(type: ExampleType.all), + CategoryBubble(type: ExampleType.example), + CategoryBubble(type: ExampleType.kata), + CategoryBubble(type: ExampleType.test), ], ), ); diff --git a/playground/frontend/lib/modules/examples/components/search_field/search_field.dart b/playground/frontend/lib/modules/examples/components/search_field/search_field.dart index fe59aa784dd9..992011bbffd7 100644 --- a/playground/frontend/lib/modules/examples/components/search_field/search_field.dart +++ b/playground/frontend/lib/modules/examples/components/search_field/search_field.dart @@ -19,6 +19,8 @@ import 'package:flutter/material.dart'; import 'package:playground/config/theme.dart'; import 'package:playground/constants/sizes.dart'; +import 'package:playground/pages/playground/states/example_dropdown_state.dart'; +import 'package:provider/provider.dart'; const double kContainerWidth = 376.0; const int kMinLines = 1; @@ -37,45 +39,51 @@ class SearchField extends StatelessWidget { borderRadius: BorderRadius.circular(kMdBorderRadius), ); - return Container( - margin: const EdgeInsets.only( - top: kLgSpacing, - right: kLgSpacing, - left: kLgSpacing, - ), - width: kContainerWidth, - height: kContainerHeight, - color: Theme.of(context).backgroundColor, - child: ClipRRect( - borderRadius: BorderRadius.circular(kMdBorderRadius), - child: TextFormField( - controller: controller, - decoration: InputDecoration( - suffixIcon: Padding( - padding: const EdgeInsetsDirectional.only( - start: kZeroSpacing, - end: kZeroSpacing, - ), - child: Icon( - Icons.search, - color: ThemeColors.of(context).lightGreyColor, - size: kIconSizeMd, + return Consumer( + builder: (context, state, child) => Container( + margin: const EdgeInsets.only( + top: kLgSpacing, + right: kLgSpacing, + left: kLgSpacing, + ), + width: kContainerWidth, + height: kContainerHeight, + color: Theme.of(context).backgroundColor, + child: ClipRRect( + borderRadius: BorderRadius.circular(kMdBorderRadius), + child: TextFormField( + controller: controller, + decoration: InputDecoration( + suffixIcon: Padding( + padding: const EdgeInsetsDirectional.only( + start: kZeroSpacing, + end: kZeroSpacing, + ), + child: Icon( + Icons.search, + color: ThemeColors.of(context).lightGreyColor, + size: kIconSizeMd, + ), ), + focusedBorder: border, + enabledBorder: border, + filled: false, + isDense: true, + hintText: kHintText, + contentPadding: const EdgeInsets.only(left: kLgSpacing), ), - focusedBorder: border, - enabledBorder: border, - filled: false, - isDense: true, - hintText: kHintText, - contentPadding: const EdgeInsets.only(left: kLgSpacing), + cursorColor: ThemeColors.of(context).lightGreyColor, + cursorWidth: kCursorSize, + textAlignVertical: TextAlignVertical.center, + onFieldSubmitted: (String txt) { + state.sortExamplesByName(txt); + }, + onChanged: (String txt) { + state.sortExamplesByName(txt); + }, + maxLines: kMinLines, + minLines: kMaxLines, ), - cursorColor: ThemeColors.of(context).lightGreyColor, - cursorWidth: kCursorSize, - textAlignVertical: TextAlignVertical.center, - onFieldSubmitted: (String txt) {}, - onChanged: (String txt) {}, - maxLines: kMinLines, - minLines: kMaxLines, ), ), ); diff --git a/playground/frontend/lib/modules/examples/example_selector.dart b/playground/frontend/lib/modules/examples/example_selector.dart index 9e7a811f4c38..362241d56b65 100644 --- a/playground/frontend/lib/modules/examples/example_selector.dart +++ b/playground/frontend/lib/modules/examples/example_selector.dart @@ -23,6 +23,7 @@ import 'package:playground/modules/examples/components/examples_components.dart' import 'package:playground/modules/examples/models/category_model.dart'; import 'package:playground/modules/examples/models/selector_size_model.dart'; import 'package:playground/pages/playground/states/example_dropdown_state.dart'; +import 'package:playground/pages/playground/states/examples_state.dart'; import 'package:playground/pages/playground/states/playground_state.dart'; import 'package:provider/provider.dart'; @@ -122,52 +123,54 @@ class _ExampleSelectorState extends State return OverlayEntry( builder: (context) { - return Stack( - children: [ - GestureDetector( - onTap: () { - animationController.reverse(); - examplesDropdown?.remove(); - widget.changeSelectorVisibility(); - }, - child: Container( - color: Colors.transparent, - height: double.infinity, - width: double.infinity, + return Consumer( + builder: (context, state, child) => Stack( + children: [ + GestureDetector( + onTap: () { + animationController.reverse(); + examplesDropdown?.remove(); + state.changeSelectorVisibility(); + }, + child: Container( + color: Colors.transparent, + height: double.infinity, + width: double.infinity, + ), ), - ), - ChangeNotifierProvider( - create: (context) => ExampleDropdownState(), - builder: (context, _) => Positioned( - left: posModel.xAlignment, - top: posModel.yAlignment + kAdditionalDyAlignment, - child: SlideTransition( - position: offsetAnimation, - child: Material( - elevation: kElevation.toDouble(), - child: Container( - height: kLgContainerHeight, - width: kLgContainerWidth, - decoration: BoxDecoration( - color: Theme.of(context).backgroundColor, - borderRadius: BorderRadius.circular(kMdBorderRadius), - ), - child: Column( - children: [ - SearchField(controller: textController), - const TypeFilter(), - ExampleList( - controller: scrollController, - items: widget.categories, - ), - ], + ChangeNotifierProvider( + create: (context) => ExampleDropdownState( + state, + state.categories!, + ), + builder: (context, _) => Positioned( + left: posModel.xAlignment, + top: posModel.yAlignment + kAdditionalDyAlignment, + child: SlideTransition( + position: offsetAnimation, + child: Material( + elevation: kElevation.toDouble(), + child: Container( + height: kLgContainerHeight, + width: kLgContainerWidth, + decoration: BoxDecoration( + color: Theme.of(context).backgroundColor, + borderRadius: BorderRadius.circular(kMdBorderRadius), + ), + child: Column( + children: [ + SearchField(controller: textController), + const TypeFilter(), + ExampleList(controller: scrollController), + ], + ), ), ), ), ), ), - ), - ], + ], + ), ); }, ); diff --git a/playground/frontend/lib/modules/examples/models/example_model.dart b/playground/frontend/lib/modules/examples/models/example_model.dart index fb7bbb4ccb91..17e6f584982c 100644 --- a/playground/frontend/lib/modules/examples/models/example_model.dart +++ b/playground/frontend/lib/modules/examples/models/example_model.dart @@ -19,11 +19,27 @@ import 'package:playground/modules/sdk/models/sdk.dart'; enum ExampleType { + all, example, kata, test, } +extension ExampleTypeToString on ExampleType { + String get name { + switch (this) { + case ExampleType.example: + return 'Examples'; + case ExampleType.kata: + return 'Katas'; + case ExampleType.test: + return 'Unit tests'; + case ExampleType.all: + return 'All'; + } + } +} + class ExampleModel { final Map sources; final ExampleType type; diff --git a/playground/frontend/lib/modules/examples/repositories/example_repository.dart b/playground/frontend/lib/modules/examples/repositories/example_repository.dart index 80d22e94b329..a3e1722fbfc5 100644 --- a/playground/frontend/lib/modules/examples/repositories/example_repository.dart +++ b/playground/frontend/lib/modules/examples/repositories/example_repository.dart @@ -66,7 +66,7 @@ class ExampleRepository { SDK.python: 'PYTHON Source code 1', SDK.scio: 'SCIO Source code 1', }, - 'Source code 1', + 'KATA Source code 1', ExampleType.kata, ), ]), @@ -78,7 +78,7 @@ class ExampleRepository { SDK.python: 'PYTHON Source code 2', SDK.scio: 'SCIO Source code 2', }, - 'Source code 2', + 'UNIT TEST Source code 2', ExampleType.test, ), ExampleModel( @@ -88,7 +88,7 @@ class ExampleRepository { SDK.python: 'PYTHON Source code 3', SDK.scio: 'SCIO Source code 3', }, - 'Source code 3', + 'EXAMPLE Source code 3', ExampleType.example, ), ]), @@ -100,7 +100,7 @@ class ExampleRepository { SDK.python: 'PYTHON Source code 4', SDK.scio: 'SCIO Source code 4', }, - 'Source code 4', + 'KATA Source code 4', ExampleType.kata, ), ExampleModel( @@ -110,7 +110,7 @@ class ExampleRepository { SDK.python: 'PYTHON Source code 5', SDK.scio: 'SCIO Source code 5', }, - 'Source code 5', + 'UNIT TEST Source code 5', ExampleType.test, ), ]), diff --git a/playground/frontend/lib/pages/playground/states/example_dropdown_state.dart b/playground/frontend/lib/pages/playground/states/example_dropdown_state.dart index 38a966561fb1..0ade03184dc1 100644 --- a/playground/frontend/lib/pages/playground/states/example_dropdown_state.dart +++ b/playground/frontend/lib/pages/playground/states/example_dropdown_state.dart @@ -17,16 +17,74 @@ */ import 'package:flutter/material.dart'; +import 'package:playground/modules/examples/models/category_model.dart'; +import 'package:playground/modules/examples/models/example_model.dart'; + +import 'examples_state.dart'; class ExampleDropdownState with ChangeNotifier { - String _selectedCategory; + final ExampleState _exampleState; + ExampleType _selectedCategory; + List categories; + + ExampleDropdownState( + this._exampleState, + this.categories, [ + this._selectedCategory = ExampleType.all, + ]); - ExampleDropdownState([this._selectedCategory = 'All']); + ExampleType get selectedCategory => _selectedCategory; - String get selectedCategory => _selectedCategory; + setSelectedCategory(ExampleType type) async { + _selectedCategory = type; + notifyListeners(); + } - setSelectedCategory(String name) async { - _selectedCategory = name; + setCategories(List? categories) { + this.categories = categories ?? []; notifyListeners(); } + + sortExamplesByType(ExampleType type) { + if (type == ExampleType.all) { + setCategories(_exampleState.categories!); + } else { + List unsorted = [..._exampleState.categories!]; + List sorted = []; + for (CategoryModel category in unsorted) { + if (category.examples.any((element) => element.type == type)) { + CategoryModel sortedCategory = CategoryModel( + category.name, + category.examples.where((element) => element.type == type).toList(), + ); + sorted.add(sortedCategory); + } + } + setCategories(sorted); + } + } + + sortExamplesByName(String name) { + if (name.isEmpty) { + setCategories(_exampleState.categories!); + } else { + List unsorted = [..._exampleState.categories!]; + List sorted = []; + for (CategoryModel category in unsorted) { + if (category.examples.any( + (element) => element.name.toLowerCase().contains(name.toLowerCase()), + )) { + CategoryModel sortedCategory = CategoryModel( + category.name, + category.examples + .where((element) => + element.name.toLowerCase().contains(name.toLowerCase())) + .toList(), + ); + sorted.add(sortedCategory); + } + } + setCategories(sorted); + } + } } diff --git a/playground/frontend/test/pages/playground/states/mocks/example_mock.dart b/playground/frontend/test/pages/playground/states/mocks/example_mock.dart index d08472a57891..8eb808574a48 100644 --- a/playground/frontend/test/pages/playground/states/mocks/example_mock.dart +++ b/playground/frontend/test/pages/playground/states/mocks/example_mock.dart @@ -19,11 +19,11 @@ import 'package:playground/modules/examples/models/example_model.dart'; import 'package:playground/modules/sdk/models/sdk.dart'; -const javaExample = "java example"; +const javaExample = 'java example'; -const pythonExample = "python example"; +const pythonExample = 'python example'; -const goExample = "go example"; +const goExample = 'go example'; const sdkMap = { SDK.java: javaExample, @@ -33,5 +33,6 @@ const sdkMap = { const ExampleModel exampleMock = ExampleModel( sdkMap, - "Example", + 'Example', + ExampleType.example, ); From 544552626200aa857565866b0312f789a392a2b3 Mon Sep 17 00:00:00 2001 From: Alexander Zhuravlev Date: Fri, 15 Oct 2021 14:50:27 +0300 Subject: [PATCH 04/32] [BEAM-13064]: Fixed names to clarify code, refactored Category model (added const keyword) --- .../examples/components/filter/category_bubble.dart | 8 ++++---- .../lib/modules/examples/models/category_model.dart | 2 +- .../examples/repositories/example_repository.dart | 8 ++++---- .../playground/states/example_dropdown_state.dart | 10 +++++----- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/playground/frontend/lib/modules/examples/components/filter/category_bubble.dart b/playground/frontend/lib/modules/examples/components/filter/category_bubble.dart index 017ab540145f..7d968fb7c814 100644 --- a/playground/frontend/lib/modules/examples/components/filter/category_bubble.dart +++ b/playground/frontend/lib/modules/examples/components/filter/category_bubble.dart @@ -37,8 +37,8 @@ class CategoryBubble extends StatelessWidget { child: Consumer( builder: (context, dropdownState, child) => GestureDetector( onTap: () { - if (type != dropdownState.selectedCategory) { - dropdownState.setSelectedCategory(type); + if (type != dropdownState.selectedFilterType) { + dropdownState.setSelectedFilterType(type); dropdownState.sortExamplesByType(type); } }, @@ -46,7 +46,7 @@ class CategoryBubble extends StatelessWidget { height: kContainerHeight, padding: const EdgeInsets.symmetric(horizontal: kXlSpacing), decoration: BoxDecoration( - color: type == dropdownState.selectedCategory + color: type == dropdownState.selectedFilterType ? ThemeColors.of(context).primary : ThemeColors.of(context).lightGreyColor, borderRadius: BorderRadius.circular(kXlBorderRadius), @@ -55,7 +55,7 @@ class CategoryBubble extends StatelessWidget { child: Text( type.name, style: TextStyle( - color: type == dropdownState.selectedCategory + color: type == dropdownState.selectedFilterType ? ThemeColors.of(context).primaryBackgroundTextColor : ThemeColors.of(context).lightGreyBackgroundTextColor, ), diff --git a/playground/frontend/lib/modules/examples/models/category_model.dart b/playground/frontend/lib/modules/examples/models/category_model.dart index 4b852a05fa25..2c4b0f1a3401 100644 --- a/playground/frontend/lib/modules/examples/models/category_model.dart +++ b/playground/frontend/lib/modules/examples/models/category_model.dart @@ -22,5 +22,5 @@ class CategoryModel { final String name; final List examples; - CategoryModel(this.name, this.examples); + const CategoryModel(this.name, this.examples); } diff --git a/playground/frontend/lib/modules/examples/repositories/example_repository.dart b/playground/frontend/lib/modules/examples/repositories/example_repository.dart index a3e1722fbfc5..cff560528e3d 100644 --- a/playground/frontend/lib/modules/examples/repositories/example_repository.dart +++ b/playground/frontend/lib/modules/examples/repositories/example_repository.dart @@ -47,8 +47,8 @@ object Hello { class ExampleRepository { List getCategories() { - return [ - CategoryModel('Side Inputs', const [ + return const [ + CategoryModel('Side Inputs', [ ExampleModel( { SDK.java: javaHelloWorld, @@ -70,7 +70,7 @@ class ExampleRepository { ExampleType.kata, ), ]), - CategoryModel('Side Outputs', const [ + CategoryModel('Side Outputs', [ ExampleModel( { SDK.java: 'JAVA Source code 2', @@ -92,7 +92,7 @@ class ExampleRepository { ExampleType.example, ), ]), - CategoryModel('I/O', const [ + CategoryModel('I/O', [ ExampleModel( { SDK.java: 'JAVA Source code 4', diff --git a/playground/frontend/lib/pages/playground/states/example_dropdown_state.dart b/playground/frontend/lib/pages/playground/states/example_dropdown_state.dart index 0ade03184dc1..22d79f41862d 100644 --- a/playground/frontend/lib/pages/playground/states/example_dropdown_state.dart +++ b/playground/frontend/lib/pages/playground/states/example_dropdown_state.dart @@ -24,19 +24,19 @@ import 'examples_state.dart'; class ExampleDropdownState with ChangeNotifier { final ExampleState _exampleState; - ExampleType _selectedCategory; + ExampleType _selectedFilterType; List categories; ExampleDropdownState( this._exampleState, this.categories, [ - this._selectedCategory = ExampleType.all, + this._selectedFilterType = ExampleType.all, ]); - ExampleType get selectedCategory => _selectedCategory; + ExampleType get selectedFilterType => _selectedFilterType; - setSelectedCategory(ExampleType type) async { - _selectedCategory = type; + setSelectedFilterType(ExampleType type) async { + _selectedFilterType = type; notifyListeners(); } From 279c4efd864221563e2fc68fb8a54643d52234b8 Mon Sep 17 00:00:00 2001 From: Alexander Zhuravlev Date: Fri, 15 Oct 2021 14:52:00 +0300 Subject: [PATCH 05/32] [BEAM-13064]: Increased test coverage of Example Dropdown module --- .../states/example_dropdown_state_test.dart | 80 +++++++++++++++++ .../states/mocks/categories_mock.dart | 88 +++++++++++++++++++ 2 files changed, 168 insertions(+) create mode 100644 playground/frontend/test/pages/playground/states/example_dropdown_state_test.dart create mode 100644 playground/frontend/test/pages/playground/states/mocks/categories_mock.dart diff --git a/playground/frontend/test/pages/playground/states/example_dropdown_state_test.dart b/playground/frontend/test/pages/playground/states/example_dropdown_state_test.dart new file mode 100644 index 000000000000..4bbb56f71934 --- /dev/null +++ b/playground/frontend/test/pages/playground/states/example_dropdown_state_test.dart @@ -0,0 +1,80 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import 'package:flutter_test/flutter_test.dart'; +import 'package:playground/modules/examples/models/example_model.dart'; +import 'package:playground/modules/examples/repositories/example_repository.dart'; +import 'package:playground/pages/playground/states/example_dropdown_state.dart'; +import 'package:playground/pages/playground/states/examples_state.dart'; + +import 'mocks/categories_mock.dart'; + +void main() { + test( + 'ExampleDropdown state should notify all listeners about filter type change', + () { + final exampleState = ExampleState(ExampleRepository()); + final state = ExampleDropdownState(exampleState, []); + state.addListener(() { + expect(state.selectedFilterType, ExampleType.example); + }); + state.setSelectedFilterType(ExampleType.example); + }); + + test( + 'ExampleDropdown state should notify all listeners about categories change', + () { + final exampleState = ExampleState(ExampleRepository()); + final state = ExampleDropdownState(exampleState, []); + state.addListener(() { + expect(state.categories, []); + }); + state.setCategories([]); + }); + + test( + 'ExampleDropdown state sortExamplesByType should:' + '- update categories,' + '- notify all listeners,' + 'but should NOT:' + '- affect Example state categories', () { + final exampleState = ExampleState(ExampleRepository()); + final state = ExampleDropdownState(exampleState, exampleState.categories!); + state.addListener(() { + expect(state.categories, categoriesSortedByTypeMock); + expect(exampleState.categories, exampleState.categories); + }); + state.sortExamplesByType(ExampleType.kata); + }); + + test( + 'ExampleDropdown state sortExamplesByName should:' + '- update categories and notify all listeners,' + 'but should NOT:' + '- wait for full name of example,' + '- be sensitive for register,' + '- affect Example state categories', () { + final exampleState = ExampleState(ExampleRepository()); + final state = ExampleDropdownState(exampleState, exampleState.categories!); + state.addListener(() { + expect(state.categories, categoriesSortedByNameMock); + expect(exampleState.categories, exampleState.categories); + }); + state.sortExamplesByName('eLLoWoRl'); + }); +} diff --git a/playground/frontend/test/pages/playground/states/mocks/categories_mock.dart b/playground/frontend/test/pages/playground/states/mocks/categories_mock.dart new file mode 100644 index 000000000000..06c5989492bc --- /dev/null +++ b/playground/frontend/test/pages/playground/states/mocks/categories_mock.dart @@ -0,0 +1,88 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import 'package:playground/modules/examples/models/category_model.dart'; +import 'package:playground/modules/examples/models/example_model.dart'; +import 'package:playground/modules/sdk/models/sdk.dart'; + +const javaHelloWorld = '''class HelloWorld { + public static void main(String[] args) { + System.out.println("Hello World!"); + } +}'''; + +const pythonHelloWorld = 'print(‘Hello World’)'; + +const goHelloWorld = '''package main + +import "fmt" + +// this is a comment + +func main() { + fmt.Println("Hello World") +}'''; + +const scioHelloWorld = ''' +object Hello { + def main(args: Array[String]) = { + println("Hello, world") + } +}'''; + +const List categoriesSortedByTypeMock = [ + CategoryModel('Side Inputs', [ + ExampleModel( + { + SDK.java: 'JAVA Source code 1', + SDK.go: 'GO Source code 1', + SDK.python: 'PYTHON Source code 1', + SDK.scio: 'SCIO Source code 1', + }, + 'KATA Source code 1', + ExampleType.kata, + ), + ]), + CategoryModel('I/O', [ + ExampleModel( + { + SDK.java: 'JAVA Source code 4', + SDK.go: 'GO Source code 4', + SDK.python: 'PYTHON Source code 4', + SDK.scio: 'SCIO Source code 4', + }, + 'KATA Source code 4', + ExampleType.kata, + ), + ]), +]; + +const List categoriesSortedByNameMock = [ + CategoryModel('Side Inputs', [ + ExampleModel( + { + SDK.java: javaHelloWorld, + SDK.go: goHelloWorld, + SDK.python: pythonHelloWorld, + SDK.scio: scioHelloWorld, + }, + 'HelloWorld', + ExampleType.example, + ), + ]) +]; From 3c577d9b686e88a4df9a1712c63ed75f73a8de7f Mon Sep 17 00:00:00 2001 From: Alexander Zhuravlev Date: Tue, 19 Oct 2021 13:47:28 +0300 Subject: [PATCH 06/32] [BEAM-12967] Added generated files --- .../frontend/lib/generated/playground.pb.dart | 433 ++++++++++++++++++ .../lib/generated/playground.pbenum.dart | 51 +++ .../lib/generated/playground.pbgrpc.dart | 141 ++++++ .../lib/generated/playground.pbjson.dart | 120 +++++ playground/frontend/pubspec.lock | 14 +- .../code_repository_test.mocks.dart | 69 +++ .../playground/states/mocks/example_mock.dart | 9 +- 7 files changed, 826 insertions(+), 11 deletions(-) create mode 100644 playground/frontend/lib/generated/playground.pb.dart create mode 100644 playground/frontend/lib/generated/playground.pbenum.dart create mode 100644 playground/frontend/lib/generated/playground.pbgrpc.dart create mode 100644 playground/frontend/lib/generated/playground.pbjson.dart create mode 100644 playground/frontend/test/modules/editor/repository/code_repository/code_repository_test.mocks.dart diff --git a/playground/frontend/lib/generated/playground.pb.dart b/playground/frontend/lib/generated/playground.pb.dart new file mode 100644 index 000000000000..95b97b62799a --- /dev/null +++ b/playground/frontend/lib/generated/playground.pb.dart @@ -0,0 +1,433 @@ +/// +// Generated code. Do not modify. +// source: playground.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 'playground.pbenum.dart'; + +export 'playground.pbenum.dart'; + +class RunCodeRequest extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'RunCodeRequest', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'playground.v1'), createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'code') + ..e(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'sdk', $pb.PbFieldType.OE, defaultOrMaker: Sdk.SDK_UNSPECIFIED, valueOf: Sdk.valueOf, enumValues: Sdk.values) + ..hasRequiredFields = false + ; + + RunCodeRequest._() : super(); + factory RunCodeRequest({ + $core.String? code, + Sdk? sdk, + }) { + final _result = create(); + if (code != null) { + _result.code = code; + } + if (sdk != null) { + _result.sdk = sdk; + } + return _result; + } + factory RunCodeRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory RunCodeRequest.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') + RunCodeRequest clone() => RunCodeRequest()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + RunCodeRequest copyWith(void Function(RunCodeRequest) updates) => super.copyWith((message) => updates(message as RunCodeRequest)) as RunCodeRequest; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static RunCodeRequest create() => RunCodeRequest._(); + RunCodeRequest createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static RunCodeRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static RunCodeRequest? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get code => $_getSZ(0); + @$pb.TagNumber(1) + set code($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasCode() => $_has(0); + @$pb.TagNumber(1) + void clearCode() => clearField(1); + + @$pb.TagNumber(2) + Sdk get sdk => $_getN(1); + @$pb.TagNumber(2) + set sdk(Sdk v) { setField(2, v); } + @$pb.TagNumber(2) + $core.bool hasSdk() => $_has(1); + @$pb.TagNumber(2) + void clearSdk() => clearField(2); +} + +class RunCodeResponse extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'RunCodeResponse', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'playground.v1'), createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'pipelineUuid') + ..hasRequiredFields = false + ; + + RunCodeResponse._() : super(); + factory RunCodeResponse({ + $core.String? pipelineUuid, + }) { + final _result = create(); + if (pipelineUuid != null) { + _result.pipelineUuid = pipelineUuid; + } + return _result; + } + factory RunCodeResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory RunCodeResponse.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') + RunCodeResponse clone() => RunCodeResponse()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + RunCodeResponse copyWith(void Function(RunCodeResponse) updates) => super.copyWith((message) => updates(message as RunCodeResponse)) as RunCodeResponse; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static RunCodeResponse create() => RunCodeResponse._(); + RunCodeResponse createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static RunCodeResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static RunCodeResponse? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get pipelineUuid => $_getSZ(0); + @$pb.TagNumber(1) + set pipelineUuid($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasPipelineUuid() => $_has(0); + @$pb.TagNumber(1) + void clearPipelineUuid() => clearField(1); +} + +class CheckStatusRequest extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CheckStatusRequest', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'playground.v1'), createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'pipelineUuid') + ..hasRequiredFields = false + ; + + CheckStatusRequest._() : super(); + factory CheckStatusRequest({ + $core.String? pipelineUuid, + }) { + final _result = create(); + if (pipelineUuid != null) { + _result.pipelineUuid = pipelineUuid; + } + return _result; + } + factory CheckStatusRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory CheckStatusRequest.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') + CheckStatusRequest clone() => CheckStatusRequest()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + CheckStatusRequest copyWith(void Function(CheckStatusRequest) updates) => super.copyWith((message) => updates(message as CheckStatusRequest)) as CheckStatusRequest; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static CheckStatusRequest create() => CheckStatusRequest._(); + CheckStatusRequest createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static CheckStatusRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static CheckStatusRequest? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get pipelineUuid => $_getSZ(0); + @$pb.TagNumber(1) + set pipelineUuid($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasPipelineUuid() => $_has(0); + @$pb.TagNumber(1) + void clearPipelineUuid() => clearField(1); +} + +class CheckStatusResponse extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CheckStatusResponse', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'playground.v1'), createEmptyInstance: create) + ..e(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'status', $pb.PbFieldType.OE, defaultOrMaker: Status.STATUS_UNSPECIFIED, valueOf: Status.valueOf, enumValues: Status.values) + ..hasRequiredFields = false + ; + + CheckStatusResponse._() : super(); + factory CheckStatusResponse({ + Status? status, + }) { + final _result = create(); + if (status != null) { + _result.status = status; + } + return _result; + } + factory CheckStatusResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory CheckStatusResponse.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') + CheckStatusResponse clone() => CheckStatusResponse()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + CheckStatusResponse copyWith(void Function(CheckStatusResponse) updates) => super.copyWith((message) => updates(message as CheckStatusResponse)) as CheckStatusResponse; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static CheckStatusResponse create() => CheckStatusResponse._(); + CheckStatusResponse createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static CheckStatusResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static CheckStatusResponse? _defaultInstance; + + @$pb.TagNumber(1) + Status get status => $_getN(0); + @$pb.TagNumber(1) + set status(Status v) { setField(1, v); } + @$pb.TagNumber(1) + $core.bool hasStatus() => $_has(0); + @$pb.TagNumber(1) + void clearStatus() => clearField(1); +} + +class GetCompileOutputRequest extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GetCompileOutputRequest', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'playground.v1'), createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'pipelineUuid') + ..hasRequiredFields = false + ; + + GetCompileOutputRequest._() : super(); + factory GetCompileOutputRequest({ + $core.String? pipelineUuid, + }) { + final _result = create(); + if (pipelineUuid != null) { + _result.pipelineUuid = pipelineUuid; + } + return _result; + } + factory GetCompileOutputRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory GetCompileOutputRequest.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') + GetCompileOutputRequest clone() => GetCompileOutputRequest()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + GetCompileOutputRequest copyWith(void Function(GetCompileOutputRequest) updates) => super.copyWith((message) => updates(message as GetCompileOutputRequest)) as GetCompileOutputRequest; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static GetCompileOutputRequest create() => GetCompileOutputRequest._(); + GetCompileOutputRequest createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static GetCompileOutputRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static GetCompileOutputRequest? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get pipelineUuid => $_getSZ(0); + @$pb.TagNumber(1) + set pipelineUuid($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasPipelineUuid() => $_has(0); + @$pb.TagNumber(1) + void clearPipelineUuid() => clearField(1); +} + +class GetCompileOutputResponse extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GetCompileOutputResponse', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'playground.v1'), createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'output') + ..e(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'compilationStatus', $pb.PbFieldType.OE, defaultOrMaker: Status.STATUS_UNSPECIFIED, valueOf: Status.valueOf, enumValues: Status.values) + ..hasRequiredFields = false + ; + + GetCompileOutputResponse._() : super(); + factory GetCompileOutputResponse({ + $core.String? output, + Status? compilationStatus, + }) { + final _result = create(); + if (output != null) { + _result.output = output; + } + if (compilationStatus != null) { + _result.compilationStatus = compilationStatus; + } + return _result; + } + factory GetCompileOutputResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory GetCompileOutputResponse.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') + GetCompileOutputResponse clone() => GetCompileOutputResponse()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + GetCompileOutputResponse copyWith(void Function(GetCompileOutputResponse) updates) => super.copyWith((message) => updates(message as GetCompileOutputResponse)) as GetCompileOutputResponse; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static GetCompileOutputResponse create() => GetCompileOutputResponse._(); + GetCompileOutputResponse createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static GetCompileOutputResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static GetCompileOutputResponse? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get output => $_getSZ(0); + @$pb.TagNumber(1) + set output($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasOutput() => $_has(0); + @$pb.TagNumber(1) + void clearOutput() => clearField(1); + + @$pb.TagNumber(2) + Status get compilationStatus => $_getN(1); + @$pb.TagNumber(2) + set compilationStatus(Status v) { setField(2, v); } + @$pb.TagNumber(2) + $core.bool hasCompilationStatus() => $_has(1); + @$pb.TagNumber(2) + void clearCompilationStatus() => clearField(2); +} + +class GetRunOutputRequest extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GetRunOutputRequest', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'playground.v1'), createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'pipelineUuid') + ..hasRequiredFields = false + ; + + GetRunOutputRequest._() : super(); + factory GetRunOutputRequest({ + $core.String? pipelineUuid, + }) { + final _result = create(); + if (pipelineUuid != null) { + _result.pipelineUuid = pipelineUuid; + } + return _result; + } + factory GetRunOutputRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory GetRunOutputRequest.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') + GetRunOutputRequest clone() => GetRunOutputRequest()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + GetRunOutputRequest copyWith(void Function(GetRunOutputRequest) updates) => super.copyWith((message) => updates(message as GetRunOutputRequest)) as GetRunOutputRequest; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static GetRunOutputRequest create() => GetRunOutputRequest._(); + GetRunOutputRequest createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static GetRunOutputRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static GetRunOutputRequest? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get pipelineUuid => $_getSZ(0); + @$pb.TagNumber(1) + set pipelineUuid($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasPipelineUuid() => $_has(0); + @$pb.TagNumber(1) + void clearPipelineUuid() => clearField(1); +} + +class GetRunOutputResponse extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GetRunOutputResponse', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'playground.v1'), createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'output') + ..e(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'compilationStatus', $pb.PbFieldType.OE, defaultOrMaker: Status.STATUS_UNSPECIFIED, valueOf: Status.valueOf, enumValues: Status.values) + ..hasRequiredFields = false + ; + + GetRunOutputResponse._() : super(); + factory GetRunOutputResponse({ + $core.String? output, + Status? compilationStatus, + }) { + final _result = create(); + if (output != null) { + _result.output = output; + } + if (compilationStatus != null) { + _result.compilationStatus = compilationStatus; + } + return _result; + } + factory GetRunOutputResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory GetRunOutputResponse.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') + GetRunOutputResponse clone() => GetRunOutputResponse()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + GetRunOutputResponse copyWith(void Function(GetRunOutputResponse) updates) => super.copyWith((message) => updates(message as GetRunOutputResponse)) as GetRunOutputResponse; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static GetRunOutputResponse create() => GetRunOutputResponse._(); + GetRunOutputResponse createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static GetRunOutputResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static GetRunOutputResponse? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get output => $_getSZ(0); + @$pb.TagNumber(1) + set output($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasOutput() => $_has(0); + @$pb.TagNumber(1) + void clearOutput() => clearField(1); + + @$pb.TagNumber(2) + Status get compilationStatus => $_getN(1); + @$pb.TagNumber(2) + set compilationStatus(Status v) { setField(2, v); } + @$pb.TagNumber(2) + $core.bool hasCompilationStatus() => $_has(1); + @$pb.TagNumber(2) + void clearCompilationStatus() => clearField(2); +} + diff --git a/playground/frontend/lib/generated/playground.pbenum.dart b/playground/frontend/lib/generated/playground.pbenum.dart new file mode 100644 index 000000000000..2dffcf83e576 --- /dev/null +++ b/playground/frontend/lib/generated/playground.pbenum.dart @@ -0,0 +1,51 @@ +/// +// Generated code. Do not modify. +// source: playground.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 Sdk extends $pb.ProtobufEnum { + static const Sdk SDK_UNSPECIFIED = Sdk._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'SDK_UNSPECIFIED'); + static const Sdk SDK_JAVA = Sdk._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'SDK_JAVA'); + static const Sdk SDK_GO = Sdk._(2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'SDK_GO'); + static const Sdk SDK_PYTHON = Sdk._(3, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'SDK_PYTHON'); + static const Sdk SDK_SCIO = Sdk._(4, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'SDK_SCIO'); + + static const $core.List values = [ + SDK_UNSPECIFIED, + SDK_JAVA, + SDK_GO, + SDK_PYTHON, + SDK_SCIO, + ]; + + static final $core.Map<$core.int, Sdk> _byValue = $pb.ProtobufEnum.initByValue(values); + static Sdk? valueOf($core.int value) => _byValue[value]; + + const Sdk._($core.int v, $core.String n) : super(v, n); +} + +class Status extends $pb.ProtobufEnum { + static const Status STATUS_UNSPECIFIED = Status._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'STATUS_UNSPECIFIED'); + static const Status STATUS_EXECUTING = Status._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'STATUS_EXECUTING'); + static const Status STATUS_FINISHED = Status._(2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'STATUS_FINISHED'); + static const Status STATUS_ERROR = Status._(3, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'STATUS_ERROR'); + + static const $core.List values = [ + STATUS_UNSPECIFIED, + STATUS_EXECUTING, + STATUS_FINISHED, + STATUS_ERROR, + ]; + + static final $core.Map<$core.int, Status> _byValue = $pb.ProtobufEnum.initByValue(values); + static Status? valueOf($core.int value) => _byValue[value]; + + const Status._($core.int v, $core.String n) : super(v, n); +} + diff --git a/playground/frontend/lib/generated/playground.pbgrpc.dart b/playground/frontend/lib/generated/playground.pbgrpc.dart new file mode 100644 index 000000000000..230e9c9f5720 --- /dev/null +++ b/playground/frontend/lib/generated/playground.pbgrpc.dart @@ -0,0 +1,141 @@ +/// +// Generated code. Do not modify. +// source: playground.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:async' as $async; + +import 'dart:core' as $core; + +import 'package:grpc/service_api.dart' as $grpc; +import 'playground.pb.dart' as $0; +export 'playground.pb.dart'; + +class PlaygroundServiceClient extends $grpc.Client { + static final _$runCode = + $grpc.ClientMethod<$0.RunCodeRequest, $0.RunCodeResponse>( + '/playground.v1.PlaygroundService/RunCode', + ($0.RunCodeRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => + $0.RunCodeResponse.fromBuffer(value)); + static final _$checkStatus = + $grpc.ClientMethod<$0.CheckStatusRequest, $0.CheckStatusResponse>( + '/playground.v1.PlaygroundService/CheckStatus', + ($0.CheckStatusRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => + $0.CheckStatusResponse.fromBuffer(value)); + static final _$getRunOutput = + $grpc.ClientMethod<$0.GetRunOutputRequest, $0.GetRunOutputResponse>( + '/playground.v1.PlaygroundService/GetRunOutput', + ($0.GetRunOutputRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => + $0.GetRunOutputResponse.fromBuffer(value)); + static final _$getCompileOutput = $grpc.ClientMethod< + $0.GetCompileOutputRequest, $0.GetCompileOutputResponse>( + '/playground.v1.PlaygroundService/GetCompileOutput', + ($0.GetCompileOutputRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => + $0.GetCompileOutputResponse.fromBuffer(value)); + + PlaygroundServiceClient($grpc.ClientChannel channel, + {$grpc.CallOptions? options, + $core.Iterable<$grpc.ClientInterceptor>? interceptors}) + : super(channel, options: options, interceptors: interceptors); + + $grpc.ResponseFuture<$0.RunCodeResponse> runCode($0.RunCodeRequest request, + {$grpc.CallOptions? options}) { + return $createUnaryCall(_$runCode, request, options: options); + } + + $grpc.ResponseFuture<$0.CheckStatusResponse> checkStatus( + $0.CheckStatusRequest request, + {$grpc.CallOptions? options}) { + return $createUnaryCall(_$checkStatus, request, options: options); + } + + $grpc.ResponseFuture<$0.GetRunOutputResponse> getRunOutput( + $0.GetRunOutputRequest request, + {$grpc.CallOptions? options}) { + return $createUnaryCall(_$getRunOutput, request, options: options); + } + + $grpc.ResponseFuture<$0.GetCompileOutputResponse> getCompileOutput( + $0.GetCompileOutputRequest request, + {$grpc.CallOptions? options}) { + return $createUnaryCall(_$getCompileOutput, request, options: options); + } +} + +abstract class PlaygroundServiceBase extends $grpc.Service { + $core.String get $name => 'playground.v1.PlaygroundService'; + + PlaygroundServiceBase() { + $addMethod($grpc.ServiceMethod<$0.RunCodeRequest, $0.RunCodeResponse>( + 'RunCode', + runCode_Pre, + false, + false, + ($core.List<$core.int> value) => $0.RunCodeRequest.fromBuffer(value), + ($0.RunCodeResponse value) => value.writeToBuffer())); + $addMethod( + $grpc.ServiceMethod<$0.CheckStatusRequest, $0.CheckStatusResponse>( + 'CheckStatus', + checkStatus_Pre, + false, + false, + ($core.List<$core.int> value) => + $0.CheckStatusRequest.fromBuffer(value), + ($0.CheckStatusResponse value) => value.writeToBuffer())); + $addMethod( + $grpc.ServiceMethod<$0.GetRunOutputRequest, $0.GetRunOutputResponse>( + 'GetRunOutput', + getRunOutput_Pre, + false, + false, + ($core.List<$core.int> value) => + $0.GetRunOutputRequest.fromBuffer(value), + ($0.GetRunOutputResponse value) => value.writeToBuffer())); + $addMethod($grpc.ServiceMethod<$0.GetCompileOutputRequest, + $0.GetCompileOutputResponse>( + 'GetCompileOutput', + getCompileOutput_Pre, + false, + false, + ($core.List<$core.int> value) => + $0.GetCompileOutputRequest.fromBuffer(value), + ($0.GetCompileOutputResponse value) => value.writeToBuffer())); + } + + $async.Future<$0.RunCodeResponse> runCode_Pre( + $grpc.ServiceCall call, $async.Future<$0.RunCodeRequest> request) async { + return runCode(call, await request); + } + + $async.Future<$0.CheckStatusResponse> checkStatus_Pre($grpc.ServiceCall call, + $async.Future<$0.CheckStatusRequest> request) async { + return checkStatus(call, await request); + } + + $async.Future<$0.GetRunOutputResponse> getRunOutput_Pre( + $grpc.ServiceCall call, + $async.Future<$0.GetRunOutputRequest> request) async { + return getRunOutput(call, await request); + } + + $async.Future<$0.GetCompileOutputResponse> getCompileOutput_Pre( + $grpc.ServiceCall call, + $async.Future<$0.GetCompileOutputRequest> request) async { + return getCompileOutput(call, await request); + } + + $async.Future<$0.RunCodeResponse> runCode( + $grpc.ServiceCall call, $0.RunCodeRequest request); + $async.Future<$0.CheckStatusResponse> checkStatus( + $grpc.ServiceCall call, $0.CheckStatusRequest request); + $async.Future<$0.GetRunOutputResponse> getRunOutput( + $grpc.ServiceCall call, $0.GetRunOutputRequest request); + $async.Future<$0.GetCompileOutputResponse> getCompileOutput( + $grpc.ServiceCall call, $0.GetCompileOutputRequest request); +} diff --git a/playground/frontend/lib/generated/playground.pbjson.dart b/playground/frontend/lib/generated/playground.pbjson.dart new file mode 100644 index 000000000000..aea7b4d17e70 --- /dev/null +++ b/playground/frontend/lib/generated/playground.pbjson.dart @@ -0,0 +1,120 @@ +/// +// Generated code. Do not modify. +// source: playground.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 sdkDescriptor instead') +const Sdk$json = const { + '1': 'Sdk', + '2': const [ + const {'1': 'SDK_UNSPECIFIED', '2': 0}, + const {'1': 'SDK_JAVA', '2': 1}, + const {'1': 'SDK_GO', '2': 2}, + const {'1': 'SDK_PYTHON', '2': 3}, + const {'1': 'SDK_SCIO', '2': 4}, + ], +}; + +/// Descriptor for `Sdk`. Decode as a `google.protobuf.EnumDescriptorProto`. +final $typed_data.Uint8List sdkDescriptor = $convert.base64Decode('CgNTZGsSEwoPU0RLX1VOU1BFQ0lGSUVEEAASDAoIU0RLX0pBVkEQARIKCgZTREtfR08QAhIOCgpTREtfUFlUSE9OEAMSDAoIU0RLX1NDSU8QBA=='); +@$core.Deprecated('Use statusDescriptor instead') +const Status$json = const { + '1': 'Status', + '2': const [ + const {'1': 'STATUS_UNSPECIFIED', '2': 0}, + const {'1': 'STATUS_EXECUTING', '2': 1}, + const {'1': 'STATUS_FINISHED', '2': 2}, + const {'1': 'STATUS_ERROR', '2': 3}, + ], +}; + +/// Descriptor for `Status`. Decode as a `google.protobuf.EnumDescriptorProto`. +final $typed_data.Uint8List statusDescriptor = $convert.base64Decode('CgZTdGF0dXMSFgoSU1RBVFVTX1VOU1BFQ0lGSUVEEAASFAoQU1RBVFVTX0VYRUNVVElORxABEhMKD1NUQVRVU19GSU5JU0hFRBACEhAKDFNUQVRVU19FUlJPUhAD'); +@$core.Deprecated('Use runCodeRequestDescriptor instead') +const RunCodeRequest$json = const { + '1': 'RunCodeRequest', + '2': const [ + const {'1': 'code', '3': 1, '4': 1, '5': 9, '10': 'code'}, + const {'1': 'sdk', '3': 2, '4': 1, '5': 14, '6': '.playground.v1.Sdk', '10': 'sdk'}, + ], +}; + +/// Descriptor for `RunCodeRequest`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List runCodeRequestDescriptor = $convert.base64Decode('Cg5SdW5Db2RlUmVxdWVzdBISCgRjb2RlGAEgASgJUgRjb2RlEiQKA3NkaxgCIAEoDjISLnBsYXlncm91bmQudjEuU2RrUgNzZGs='); +@$core.Deprecated('Use runCodeResponseDescriptor instead') +const RunCodeResponse$json = const { + '1': 'RunCodeResponse', + '2': const [ + const {'1': 'pipeline_uuid', '3': 1, '4': 1, '5': 9, '10': 'pipelineUuid'}, + ], +}; + +/// Descriptor for `RunCodeResponse`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List runCodeResponseDescriptor = $convert.base64Decode('Cg9SdW5Db2RlUmVzcG9uc2USIwoNcGlwZWxpbmVfdXVpZBgBIAEoCVIMcGlwZWxpbmVVdWlk'); +@$core.Deprecated('Use checkStatusRequestDescriptor instead') +const CheckStatusRequest$json = const { + '1': 'CheckStatusRequest', + '2': const [ + const {'1': 'pipeline_uuid', '3': 1, '4': 1, '5': 9, '10': 'pipelineUuid'}, + ], +}; + +/// Descriptor for `CheckStatusRequest`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List checkStatusRequestDescriptor = $convert.base64Decode('ChJDaGVja1N0YXR1c1JlcXVlc3QSIwoNcGlwZWxpbmVfdXVpZBgBIAEoCVIMcGlwZWxpbmVVdWlk'); +@$core.Deprecated('Use checkStatusResponseDescriptor instead') +const CheckStatusResponse$json = const { + '1': 'CheckStatusResponse', + '2': const [ + const {'1': 'status', '3': 1, '4': 1, '5': 14, '6': '.playground.v1.Status', '10': 'status'}, + ], +}; + +/// Descriptor for `CheckStatusResponse`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List checkStatusResponseDescriptor = $convert.base64Decode('ChNDaGVja1N0YXR1c1Jlc3BvbnNlEi0KBnN0YXR1cxgBIAEoDjIVLnBsYXlncm91bmQudjEuU3RhdHVzUgZzdGF0dXM='); +@$core.Deprecated('Use getCompileOutputRequestDescriptor instead') +const GetCompileOutputRequest$json = const { + '1': 'GetCompileOutputRequest', + '2': const [ + const {'1': 'pipeline_uuid', '3': 1, '4': 1, '5': 9, '10': 'pipelineUuid'}, + ], +}; + +/// Descriptor for `GetCompileOutputRequest`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List getCompileOutputRequestDescriptor = $convert.base64Decode('ChdHZXRDb21waWxlT3V0cHV0UmVxdWVzdBIjCg1waXBlbGluZV91dWlkGAEgASgJUgxwaXBlbGluZVV1aWQ='); +@$core.Deprecated('Use getCompileOutputResponseDescriptor instead') +const GetCompileOutputResponse$json = const { + '1': 'GetCompileOutputResponse', + '2': const [ + const {'1': 'output', '3': 1, '4': 1, '5': 9, '10': 'output'}, + const {'1': 'compilation_status', '3': 2, '4': 1, '5': 14, '6': '.playground.v1.Status', '10': 'compilationStatus'}, + ], +}; + +/// Descriptor for `GetCompileOutputResponse`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List getCompileOutputResponseDescriptor = $convert.base64Decode('ChhHZXRDb21waWxlT3V0cHV0UmVzcG9uc2USFgoGb3V0cHV0GAEgASgJUgZvdXRwdXQSRAoSY29tcGlsYXRpb25fc3RhdHVzGAIgASgOMhUucGxheWdyb3VuZC52MS5TdGF0dXNSEWNvbXBpbGF0aW9uU3RhdHVz'); +@$core.Deprecated('Use getRunOutputRequestDescriptor instead') +const GetRunOutputRequest$json = const { + '1': 'GetRunOutputRequest', + '2': const [ + const {'1': 'pipeline_uuid', '3': 1, '4': 1, '5': 9, '10': 'pipelineUuid'}, + ], +}; + +/// Descriptor for `GetRunOutputRequest`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List getRunOutputRequestDescriptor = $convert.base64Decode('ChNHZXRSdW5PdXRwdXRSZXF1ZXN0EiMKDXBpcGVsaW5lX3V1aWQYASABKAlSDHBpcGVsaW5lVXVpZA=='); +@$core.Deprecated('Use getRunOutputResponseDescriptor instead') +const GetRunOutputResponse$json = const { + '1': 'GetRunOutputResponse', + '2': const [ + const {'1': 'output', '3': 1, '4': 1, '5': 9, '10': 'output'}, + const {'1': 'compilation_status', '3': 2, '4': 1, '5': 14, '6': '.playground.v1.Status', '10': 'compilationStatus'}, + ], +}; + +/// Descriptor for `GetRunOutputResponse`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List getRunOutputResponseDescriptor = $convert.base64Decode('ChRHZXRSdW5PdXRwdXRSZXNwb25zZRIWCgZvdXRwdXQYASABKAlSBm91dHB1dBJEChJjb21waWxhdGlvbl9zdGF0dXMYAiABKA4yFS5wbGF5Z3JvdW5kLnYxLlN0YXR1c1IRY29tcGlsYXRpb25TdGF0dXM='); diff --git a/playground/frontend/pubspec.lock b/playground/frontend/pubspec.lock index d6783ff39e4a..4173b4ffe823 100644 --- a/playground/frontend/pubspec.lock +++ b/playground/frontend/pubspec.lock @@ -155,13 +155,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.15.0" - expansion_widget: - dependency: "direct main" - description: - name: expansion_widget - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.2" convert: dependency: transitive description: @@ -183,6 +176,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.2.0" + expansion_widget: + dependency: "direct main" + description: + name: expansion_widget + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.2" fake_async: dependency: transitive description: diff --git a/playground/frontend/test/modules/editor/repository/code_repository/code_repository_test.mocks.dart b/playground/frontend/test/modules/editor/repository/code_repository/code_repository_test.mocks.dart new file mode 100644 index 000000000000..dfc9db10dcf0 --- /dev/null +++ b/playground/frontend/test/modules/editor/repository/code_repository/code_repository_test.mocks.dart @@ -0,0 +1,69 @@ +// Mocks generated by Mockito 5.0.16 from annotations +// in playground/test/modules/editor/repository/code_repository/code_repository_test.dart. +// Do not manually edit this file. + +import 'dart:async' as _i6; + +import 'package:mockito/mockito.dart' as _i1; +import 'package:playground/modules/editor/repository/code_repository/code_client/check_status_response.dart' + as _i3; +import 'package:playground/modules/editor/repository/code_repository/code_client/code_client.dart' + as _i5; +import 'package:playground/modules/editor/repository/code_repository/code_client/output_response.dart' + as _i4; +import 'package:playground/modules/editor/repository/code_repository/code_client/run_code_response.dart' + as _i2; +import 'package:playground/modules/editor/repository/code_repository/run_code_request.dart' + as _i7; + +// ignore_for_file: avoid_redundant_argument_values +// ignore_for_file: avoid_setters_without_getters +// ignore_for_file: comment_references +// ignore_for_file: implementation_imports +// ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: prefer_const_constructors +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: camel_case_types + +class _FakeRunCodeResponse_0 extends _i1.Fake implements _i2.RunCodeResponse {} + +class _FakeCheckStatusResponse_1 extends _i1.Fake + implements _i3.CheckStatusResponse {} + +class _FakeOutputResponse_2 extends _i1.Fake implements _i4.OutputResponse {} + +/// A class which mocks [CodeClient]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockCodeClient extends _i1.Mock implements _i5.CodeClient { + MockCodeClient() { + _i1.throwOnMissingStub(this); + } + + @override + _i6.Future<_i2.RunCodeResponse> runCode(_i7.RunCodeRequestWrapper? request) => + (super.noSuchMethod(Invocation.method(#runCode, [request]), + returnValue: + Future<_i2.RunCodeResponse>.value(_FakeRunCodeResponse_0())) + as _i6.Future<_i2.RunCodeResponse>); + @override + _i6.Future<_i3.CheckStatusResponse> checkStatus(String? pipelineUuid) => + (super.noSuchMethod(Invocation.method(#checkStatus, [pipelineUuid]), + returnValue: Future<_i3.CheckStatusResponse>.value( + _FakeCheckStatusResponse_1())) + as _i6.Future<_i3.CheckStatusResponse>); + @override + _i6.Future<_i4.OutputResponse> getCompileOutput(String? pipelineUuid) => + (super.noSuchMethod(Invocation.method(#getCompileOutput, [pipelineUuid]), + returnValue: + Future<_i4.OutputResponse>.value(_FakeOutputResponse_2())) + as _i6.Future<_i4.OutputResponse>); + @override + _i6.Future<_i4.OutputResponse> getRunOutput(String? pipelineUuid) => + (super.noSuchMethod(Invocation.method(#getRunOutput, [pipelineUuid]), + returnValue: + Future<_i4.OutputResponse>.value(_FakeOutputResponse_2())) + as _i6.Future<_i4.OutputResponse>); + @override + String toString() => super.toString(); +} diff --git a/playground/frontend/test/pages/playground/states/mocks/example_mock.dart b/playground/frontend/test/pages/playground/states/mocks/example_mock.dart index d08472a57891..8eb808574a48 100644 --- a/playground/frontend/test/pages/playground/states/mocks/example_mock.dart +++ b/playground/frontend/test/pages/playground/states/mocks/example_mock.dart @@ -19,11 +19,11 @@ import 'package:playground/modules/examples/models/example_model.dart'; import 'package:playground/modules/sdk/models/sdk.dart'; -const javaExample = "java example"; +const javaExample = 'java example'; -const pythonExample = "python example"; +const pythonExample = 'python example'; -const goExample = "go example"; +const goExample = 'go example'; const sdkMap = { SDK.java: javaExample, @@ -33,5 +33,6 @@ const sdkMap = { const ExampleModel exampleMock = ExampleModel( sdkMap, - "Example", + 'Example', + ExampleType.example, ); From f249c692a06a734556222f373f7de049bbeb04df Mon Sep 17 00:00:00 2001 From: Alexander Zhuravlev Date: Tue, 19 Oct 2021 14:04:16 +0300 Subject: [PATCH 07/32] [BEAM-12967]: Added license to generated files --- .../frontend/lib/generated/playground.pb.dart | 18 ++++++++++++++++++ .../lib/generated/playground.pbenum.dart | 18 ++++++++++++++++++ .../lib/generated/playground.pbgrpc.dart | 18 ++++++++++++++++++ .../lib/generated/playground.pbjson.dart | 18 ++++++++++++++++++ .../code_repository_test.mocks.dart | 18 ++++++++++++++++++ 5 files changed, 90 insertions(+) diff --git a/playground/frontend/lib/generated/playground.pb.dart b/playground/frontend/lib/generated/playground.pb.dart index 95b97b62799a..77cd913850a9 100644 --- a/playground/frontend/lib/generated/playground.pb.dart +++ b/playground/frontend/lib/generated/playground.pb.dart @@ -1,3 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /// // Generated code. Do not modify. // source: playground.proto diff --git a/playground/frontend/lib/generated/playground.pbenum.dart b/playground/frontend/lib/generated/playground.pbenum.dart index 2dffcf83e576..fbbb256d65d0 100644 --- a/playground/frontend/lib/generated/playground.pbenum.dart +++ b/playground/frontend/lib/generated/playground.pbenum.dart @@ -1,3 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /// // Generated code. Do not modify. // source: playground.proto diff --git a/playground/frontend/lib/generated/playground.pbgrpc.dart b/playground/frontend/lib/generated/playground.pbgrpc.dart index 230e9c9f5720..c18185bf4ac8 100644 --- a/playground/frontend/lib/generated/playground.pbgrpc.dart +++ b/playground/frontend/lib/generated/playground.pbgrpc.dart @@ -1,3 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /// // Generated code. Do not modify. // source: playground.proto diff --git a/playground/frontend/lib/generated/playground.pbjson.dart b/playground/frontend/lib/generated/playground.pbjson.dart index aea7b4d17e70..4912ae2013d1 100644 --- a/playground/frontend/lib/generated/playground.pbjson.dart +++ b/playground/frontend/lib/generated/playground.pbjson.dart @@ -1,3 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /// // Generated code. Do not modify. // source: playground.proto diff --git a/playground/frontend/test/modules/editor/repository/code_repository/code_repository_test.mocks.dart b/playground/frontend/test/modules/editor/repository/code_repository/code_repository_test.mocks.dart index dfc9db10dcf0..947078788500 100644 --- a/playground/frontend/test/modules/editor/repository/code_repository/code_repository_test.mocks.dart +++ b/playground/frontend/test/modules/editor/repository/code_repository/code_repository_test.mocks.dart @@ -1,3 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + // Mocks generated by Mockito 5.0.16 from annotations // in playground/test/modules/editor/repository/code_repository/code_repository_test.dart. // Do not manually edit this file. From 86ccec97e3e65ef3d269dbef66a96c65a266ba6d Mon Sep 17 00:00:00 2001 From: Alexander Zhuravlev Date: Tue, 19 Oct 2021 17:37:08 +0300 Subject: [PATCH 08/32] [BEAM-13064]: Fixed sorting functionality, updated tests & mocks --- .../components/filter/category_bubble.dart | 2 +- .../components/search_field/search_field.dart | 6 +- .../repositories/example_repository.dart | 2 +- .../states/example_dropdown_state.dart | 92 ++++++++++++------- .../playground/states/examples_state.dart | 2 +- .../states/example_dropdown_state_test.dart | 28 +++++- .../states/mocks/categories_mock.dart | 15 +++ 7 files changed, 104 insertions(+), 43 deletions(-) diff --git a/playground/frontend/lib/modules/examples/components/filter/category_bubble.dart b/playground/frontend/lib/modules/examples/components/filter/category_bubble.dart index 7d968fb7c814..79bb07fe7c37 100644 --- a/playground/frontend/lib/modules/examples/components/filter/category_bubble.dart +++ b/playground/frontend/lib/modules/examples/components/filter/category_bubble.dart @@ -39,7 +39,7 @@ class CategoryBubble extends StatelessWidget { onTap: () { if (type != dropdownState.selectedFilterType) { dropdownState.setSelectedFilterType(type); - dropdownState.sortExamplesByType(type); + dropdownState.sortCategories(); } }, child: Container( diff --git a/playground/frontend/lib/modules/examples/components/search_field/search_field.dart b/playground/frontend/lib/modules/examples/components/search_field/search_field.dart index 992011bbffd7..abeaefa99bb3 100644 --- a/playground/frontend/lib/modules/examples/components/search_field/search_field.dart +++ b/playground/frontend/lib/modules/examples/components/search_field/search_field.dart @@ -76,10 +76,12 @@ class SearchField extends StatelessWidget { cursorWidth: kCursorSize, textAlignVertical: TextAlignVertical.center, onFieldSubmitted: (String txt) { - state.sortExamplesByName(txt); + state.setFilterText(txt); + state.sortCategories(); }, onChanged: (String txt) { - state.sortExamplesByName(txt); + state.setFilterText(txt); + state.sortCategories(); }, maxLines: kMinLines, minLines: kMaxLines, diff --git a/playground/frontend/lib/modules/examples/repositories/example_repository.dart b/playground/frontend/lib/modules/examples/repositories/example_repository.dart index cff560528e3d..7fdc641d885d 100644 --- a/playground/frontend/lib/modules/examples/repositories/example_repository.dart +++ b/playground/frontend/lib/modules/examples/repositories/example_repository.dart @@ -46,7 +46,7 @@ object Hello { }'''; class ExampleRepository { - List getCategories() { + List? getCategories() { return const [ CategoryModel('Side Inputs', [ ExampleModel( diff --git a/playground/frontend/lib/pages/playground/states/example_dropdown_state.dart b/playground/frontend/lib/pages/playground/states/example_dropdown_state.dart index 22d79f41862d..e5dc55315f6a 100644 --- a/playground/frontend/lib/pages/playground/states/example_dropdown_state.dart +++ b/playground/frontend/lib/pages/playground/states/example_dropdown_state.dart @@ -25,66 +25,88 @@ import 'examples_state.dart'; class ExampleDropdownState with ChangeNotifier { final ExampleState _exampleState; ExampleType _selectedFilterType; + String _filterText; List categories; ExampleDropdownState( this._exampleState, this.categories, [ this._selectedFilterType = ExampleType.all, + this._filterText = '', ]); ExampleType get selectedFilterType => _selectedFilterType; - setSelectedFilterType(ExampleType type) async { + String get filterText => _filterText; + + setSelectedFilterType(ExampleType type) { _selectedFilterType = type; notifyListeners(); } + setFilterText(String text) { + _filterText = text; + notifyListeners(); + } + setCategories(List? categories) { this.categories = categories ?? []; notifyListeners(); } - sortExamplesByType(ExampleType type) { - if (type == ExampleType.all) { - setCategories(_exampleState.categories!); + sortCategories() { + List? sorted; + if (selectedFilterType == ExampleType.all && filterText == '') { + sorted = _exampleState.categories!; + } else if (selectedFilterType != ExampleType.all && filterText == '') { + sorted = sortExamplesByType( + _exampleState.categories!, + selectedFilterType, + ); + } else if (selectedFilterType == ExampleType.all && filterText != '') { + sorted = sortExamplesByName(_exampleState.categories!, filterText); } else { - List unsorted = [..._exampleState.categories!]; - List sorted = []; - for (CategoryModel category in unsorted) { - if (category.examples.any((element) => element.type == type)) { - CategoryModel sortedCategory = CategoryModel( - category.name, - category.examples.where((element) => element.type == type).toList(), - ); - sorted.add(sortedCategory); - } + sorted = sortExamplesByType( + _exampleState.categories!, + selectedFilterType, + ); + sorted = sortExamplesByName(sorted, filterText); + } + setCategories(sorted); + } + + List sortExamplesByType( + List unsorted, ExampleType type) { + List sorted = []; + for (CategoryModel category in unsorted) { + if (category.examples.any((element) => element.type == type)) { + CategoryModel sortedCategory = CategoryModel( + category.name, + category.examples.where((element) => element.type == type).toList(), + ); + sorted.add(sortedCategory); } - setCategories(sorted); } + return sorted; } - sortExamplesByName(String name) { - if (name.isEmpty) { - setCategories(_exampleState.categories!); - } else { - List unsorted = [..._exampleState.categories!]; - List sorted = []; - for (CategoryModel category in unsorted) { - if (category.examples.any( - (element) => element.name.toLowerCase().contains(name.toLowerCase()), - )) { - CategoryModel sortedCategory = CategoryModel( - category.name, - category.examples - .where((element) => - element.name.toLowerCase().contains(name.toLowerCase())) - .toList(), - ); - sorted.add(sortedCategory); - } + List sortExamplesByName( + List unsorted, String name) { + List sorted = []; + for (CategoryModel category in unsorted) { + if (category.examples.any( + (element) => element.name.toLowerCase().contains(name.toLowerCase()), + )) { + CategoryModel sortedCategory = CategoryModel( + category.name, + category.examples + .where((element) => + element.name.toLowerCase().contains(name.toLowerCase())) + .toList(), + ); + sorted.add(sortedCategory); } - setCategories(sorted); } + return sorted; } } diff --git a/playground/frontend/lib/pages/playground/states/examples_state.dart b/playground/frontend/lib/pages/playground/states/examples_state.dart index 396f37cd95bf..4e3641c1d3ab 100644 --- a/playground/frontend/lib/pages/playground/states/examples_state.dart +++ b/playground/frontend/lib/pages/playground/states/examples_state.dart @@ -30,7 +30,7 @@ class ExampleState with ChangeNotifier { } _loadCategories() { - categories = _exampleRepository.getCategories(); + categories = _exampleRepository.getCategories() ?? []; notifyListeners(); } diff --git a/playground/frontend/test/pages/playground/states/example_dropdown_state_test.dart b/playground/frontend/test/pages/playground/states/example_dropdown_state_test.dart index 4bbb56f71934..95db4e7915f7 100644 --- a/playground/frontend/test/pages/playground/states/example_dropdown_state_test.dart +++ b/playground/frontend/test/pages/playground/states/example_dropdown_state_test.dart @@ -47,6 +47,27 @@ void main() { state.setCategories([]); }); + test( + 'ExampleDropdown state sortCategories should:' + '- update categories and notify all listeners,' + 'but should NOT:' + '- wait for full name of example,' + '- be sensitive for register,' + '- affect Example state categories', () { + final exampleState = ExampleState(ExampleRepository()); + final state = ExampleDropdownState( + exampleState, + exampleState.categories!, + ExampleType.example, + 'hEl', + ); + state.addListener(() { + expect(state.categories, sortedCategories); + expect(exampleState.categories, exampleState.categories); + }); + state.sortCategories(); + }); + test( 'ExampleDropdown state sortExamplesByType should:' '- update categories,' @@ -59,12 +80,13 @@ void main() { expect(state.categories, categoriesSortedByTypeMock); expect(exampleState.categories, exampleState.categories); }); - state.sortExamplesByType(ExampleType.kata); + state.sortExamplesByType(exampleState.categories!, ExampleType.kata); }); test( 'ExampleDropdown state sortExamplesByName should:' - '- update categories and notify all listeners,' + '- update categories' + '- notify all listeners,' 'but should NOT:' '- wait for full name of example,' '- be sensitive for register,' @@ -75,6 +97,6 @@ void main() { expect(state.categories, categoriesSortedByNameMock); expect(exampleState.categories, exampleState.categories); }); - state.sortExamplesByName('eLLoWoRl'); + state.sortExamplesByName(exampleState.categories!, 'eLLoWoRl'); }); } diff --git a/playground/frontend/test/pages/playground/states/mocks/categories_mock.dart b/playground/frontend/test/pages/playground/states/mocks/categories_mock.dart index 06c5989492bc..038be22be476 100644 --- a/playground/frontend/test/pages/playground/states/mocks/categories_mock.dart +++ b/playground/frontend/test/pages/playground/states/mocks/categories_mock.dart @@ -45,6 +45,21 @@ object Hello { } }'''; +const List sortedCategories = [ + CategoryModel('Side Inputs', [ + ExampleModel( + { + SDK.java: javaHelloWorld, + SDK.go: goHelloWorld, + SDK.python: pythonHelloWorld, + SDK.scio: scioHelloWorld, + }, + 'HelloWorld', + ExampleType.example, + ), + ]) +]; + const List categoriesSortedByTypeMock = [ CategoryModel('Side Inputs', [ ExampleModel( From 2960e8efbecb7a7b94916cef59c0419d5cdb8353 Mon Sep 17 00:00:00 2001 From: Alexander Zhuravlev Date: Thu, 21 Oct 2021 14:09:22 +0300 Subject: [PATCH 09/32] [BEAM-13064]: Refactored code --- .../components/example_list/example_list.dart | 4 +- .../components/filter/category_bubble.dart | 61 +++++----- .../components/search_field/search_field.dart | 12 +- .../modules/examples/example_selector.dart | 4 +- .../states/example_dropdown_state.dart | 112 ----------------- .../states/example_selector_state.dart | 105 ++++++++++++++++ ....dart => example_selector_state_test.dart} | 30 ++--- .../states/mocks/categories_mock.dart | 113 +++++++++++++----- 8 files changed, 248 insertions(+), 193 deletions(-) delete mode 100644 playground/frontend/lib/pages/playground/states/example_dropdown_state.dart create mode 100644 playground/frontend/lib/pages/playground/states/example_selector_state.dart rename playground/frontend/test/pages/playground/states/{example_dropdown_state_test.dart => example_selector_state_test.dart} (75%) diff --git a/playground/frontend/lib/modules/examples/components/example_list/example_list.dart b/playground/frontend/lib/modules/examples/components/example_list/example_list.dart index c92211553ec5..72c517270745 100644 --- a/playground/frontend/lib/modules/examples/components/example_list/example_list.dart +++ b/playground/frontend/lib/modules/examples/components/example_list/example_list.dart @@ -18,7 +18,7 @@ import 'package:flutter/material.dart'; import 'package:playground/modules/examples/components/examples_components.dart'; -import 'package:playground/pages/playground/states/example_dropdown_state.dart'; +import 'package:playground/pages/playground/states/example_selector_state.dart'; import 'package:provider/provider.dart'; class ExampleList extends StatelessWidget { @@ -31,7 +31,7 @@ class ExampleList extends StatelessWidget { @override Widget build(BuildContext context) { - return Consumer( + return Consumer( builder: (context, state, child) => Expanded( child: Container( color: Theme.of(context).backgroundColor, diff --git a/playground/frontend/lib/modules/examples/components/filter/category_bubble.dart b/playground/frontend/lib/modules/examples/components/filter/category_bubble.dart index 79bb07fe7c37..14a89829f8a4 100644 --- a/playground/frontend/lib/modules/examples/components/filter/category_bubble.dart +++ b/playground/frontend/lib/modules/examples/components/filter/category_bubble.dart @@ -20,7 +20,7 @@ import 'package:flutter/material.dart'; import 'package:playground/config/theme.dart'; import 'package:playground/constants/sizes.dart'; import 'package:playground/modules/examples/models/example_model.dart'; -import 'package:playground/pages/playground/states/example_dropdown_state.dart'; +import 'package:playground/pages/playground/states/example_selector_state.dart'; import 'package:provider/provider.dart'; class CategoryBubble extends StatelessWidget { @@ -34,37 +34,42 @@ class CategoryBubble extends StatelessWidget { cursor: SystemMouseCursors.click, child: Padding( padding: const EdgeInsets.only(right: kMdSpacing), - child: Consumer( - builder: (context, dropdownState, child) => GestureDetector( - onTap: () { - if (type != dropdownState.selectedFilterType) { - dropdownState.setSelectedFilterType(type); - dropdownState.sortCategories(); - } - }, - child: Container( - height: kContainerHeight, - padding: const EdgeInsets.symmetric(horizontal: kXlSpacing), - decoration: BoxDecoration( - color: type == dropdownState.selectedFilterType - ? ThemeColors.of(context).primary - : ThemeColors.of(context).lightGreyColor, - borderRadius: BorderRadius.circular(kXlBorderRadius), - ), - child: Center( - child: Text( - type.name, - style: TextStyle( - color: type == dropdownState.selectedFilterType - ? ThemeColors.of(context).primaryBackgroundTextColor - : ThemeColors.of(context).lightGreyBackgroundTextColor, + child: Consumer( + builder: (context, state, child) { + final isSelected = type == state.selectedFilterType; + + return GestureDetector( + onTap: () { + if (!isSelected) { + state.setSelectedFilterType(type); + state.sortCategories(); + } + }, + child: Container( + height: kContainerHeight, + padding: const EdgeInsets.symmetric(horizontal: kXlSpacing), + decoration: BoxDecoration( + color: isSelected + ? ThemeColors.of(context).primary + : ThemeColors.of(context).lightGreyColor, + borderRadius: BorderRadius.circular(kXlBorderRadius), + ), + child: Center( + child: Text( + type.name, + style: TextStyle( + color: isSelected + ? ThemeColors.of(context).primaryBackgroundTextColor + : ThemeColors.of(context) + .lightGreyBackgroundTextColor, + ), ), ), ), - ), - ), + ); + }, ), ), ); } -} \ No newline at end of file +} diff --git a/playground/frontend/lib/modules/examples/components/search_field/search_field.dart b/playground/frontend/lib/modules/examples/components/search_field/search_field.dart index abeaefa99bb3..1889b53db120 100644 --- a/playground/frontend/lib/modules/examples/components/search_field/search_field.dart +++ b/playground/frontend/lib/modules/examples/components/search_field/search_field.dart @@ -19,7 +19,7 @@ import 'package:flutter/material.dart'; import 'package:playground/config/theme.dart'; import 'package:playground/constants/sizes.dart'; -import 'package:playground/pages/playground/states/example_dropdown_state.dart'; +import 'package:playground/pages/playground/states/example_selector_state.dart'; import 'package:provider/provider.dart'; const double kContainerWidth = 376.0; @@ -39,7 +39,7 @@ class SearchField extends StatelessWidget { borderRadius: BorderRadius.circular(kMdBorderRadius), ); - return Consumer( + return Consumer( builder: (context, state, child) => Container( margin: const EdgeInsets.only( top: kLgSpacing, @@ -75,12 +75,12 @@ class SearchField extends StatelessWidget { cursorColor: ThemeColors.of(context).lightGreyColor, cursorWidth: kCursorSize, textAlignVertical: TextAlignVertical.center, - onFieldSubmitted: (String txt) { - state.setFilterText(txt); + onFieldSubmitted: (String filterText) { + state.setFilterText(filterText); state.sortCategories(); }, - onChanged: (String txt) { - state.setFilterText(txt); + onChanged: (String filterText) { + state.setFilterText(filterText); state.sortCategories(); }, maxLines: kMinLines, diff --git a/playground/frontend/lib/modules/examples/example_selector.dart b/playground/frontend/lib/modules/examples/example_selector.dart index 362241d56b65..a9de0b7b6b2a 100644 --- a/playground/frontend/lib/modules/examples/example_selector.dart +++ b/playground/frontend/lib/modules/examples/example_selector.dart @@ -22,7 +22,7 @@ import 'package:playground/constants/sizes.dart'; import 'package:playground/modules/examples/components/examples_components.dart'; import 'package:playground/modules/examples/models/category_model.dart'; import 'package:playground/modules/examples/models/selector_size_model.dart'; -import 'package:playground/pages/playground/states/example_dropdown_state.dart'; +import 'package:playground/pages/playground/states/example_selector_state.dart'; import 'package:playground/pages/playground/states/examples_state.dart'; import 'package:playground/pages/playground/states/playground_state.dart'; import 'package:provider/provider.dart'; @@ -139,7 +139,7 @@ class _ExampleSelectorState extends State ), ), ChangeNotifierProvider( - create: (context) => ExampleDropdownState( + create: (context) => ExampleSelectorState( state, state.categories!, ), diff --git a/playground/frontend/lib/pages/playground/states/example_dropdown_state.dart b/playground/frontend/lib/pages/playground/states/example_dropdown_state.dart deleted file mode 100644 index e5dc55315f6a..000000000000 --- a/playground/frontend/lib/pages/playground/states/example_dropdown_state.dart +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import 'package:flutter/material.dart'; -import 'package:playground/modules/examples/models/category_model.dart'; -import 'package:playground/modules/examples/models/example_model.dart'; - -import 'examples_state.dart'; - -class ExampleDropdownState with ChangeNotifier { - final ExampleState _exampleState; - ExampleType _selectedFilterType; - String _filterText; - List categories; - - ExampleDropdownState( - this._exampleState, - this.categories, [ - this._selectedFilterType = ExampleType.all, - this._filterText = '', - ]); - - ExampleType get selectedFilterType => _selectedFilterType; - - String get filterText => _filterText; - - setSelectedFilterType(ExampleType type) { - _selectedFilterType = type; - notifyListeners(); - } - - setFilterText(String text) { - _filterText = text; - notifyListeners(); - } - - setCategories(List? categories) { - this.categories = categories ?? []; - notifyListeners(); - } - - sortCategories() { - List? sorted; - if (selectedFilterType == ExampleType.all && filterText == '') { - sorted = _exampleState.categories!; - } else if (selectedFilterType != ExampleType.all && filterText == '') { - sorted = sortExamplesByType( - _exampleState.categories!, - selectedFilterType, - ); - } else if (selectedFilterType == ExampleType.all && filterText != '') { - sorted = sortExamplesByName(_exampleState.categories!, filterText); - } else { - sorted = sortExamplesByType( - _exampleState.categories!, - selectedFilterType, - ); - sorted = sortExamplesByName(sorted, filterText); - } - setCategories(sorted); - } - - List sortExamplesByType( - List unsorted, ExampleType type) { - List sorted = []; - for (CategoryModel category in unsorted) { - if (category.examples.any((element) => element.type == type)) { - CategoryModel sortedCategory = CategoryModel( - category.name, - category.examples.where((element) => element.type == type).toList(), - ); - sorted.add(sortedCategory); - } - } - return sorted; - } - - List sortExamplesByName( - List unsorted, String name) { - List sorted = []; - for (CategoryModel category in unsorted) { - if (category.examples.any( - (element) => element.name.toLowerCase().contains(name.toLowerCase()), - )) { - CategoryModel sortedCategory = CategoryModel( - category.name, - category.examples - .where((element) => - element.name.toLowerCase().contains(name.toLowerCase())) - .toList(), - ); - sorted.add(sortedCategory); - } - } - return sorted; - } -} diff --git a/playground/frontend/lib/pages/playground/states/example_selector_state.dart b/playground/frontend/lib/pages/playground/states/example_selector_state.dart new file mode 100644 index 000000000000..c4718e33215d --- /dev/null +++ b/playground/frontend/lib/pages/playground/states/example_selector_state.dart @@ -0,0 +1,105 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import 'package:flutter/material.dart'; +import 'package:playground/modules/examples/models/category_model.dart'; +import 'package:playground/modules/examples/models/example_model.dart'; + +import 'examples_state.dart'; + +class ExampleSelectorState with ChangeNotifier { + final ExampleState _exampleState; + ExampleType _selectedFilterType; + String _filterText; + List categories; + + ExampleSelectorState( + this._exampleState, + this.categories, [ + this._selectedFilterType = ExampleType.all, + this._filterText = '', + ]); + + ExampleType get selectedFilterType => _selectedFilterType; + + String get filterText => _filterText; + + setSelectedFilterType(ExampleType type) { + _selectedFilterType = type; + notifyListeners(); + } + + setFilterText(String text) { + _filterText = text; + notifyListeners(); + } + + setCategories(List? categories) { + this.categories = categories ?? []; + notifyListeners(); + } + + sortCategories() { + final categories = _exampleState.categories!; + final sortedCategories = categories + .map((category) => CategoryModel( + category.name, _sortCategoryExamples(category.examples))) + .where((category) => category.examples.isNotEmpty) + .toList(); + setCategories(sortedCategories); + } + + List _sortCategoryExamples(List examples) { + final isAllFilterType = selectedFilterType == ExampleType.all; + final isFilterTextEmpty = filterText.isEmpty; + if (isAllFilterType && isFilterTextEmpty) { + return examples; + } + if (!isAllFilterType && isFilterTextEmpty) { + return sortExamplesByType( + examples, + selectedFilterType, + ); + } + if (isAllFilterType && !isFilterTextEmpty) { + return sortExamplesByName(examples, filterText); + } + final sorted = sortExamplesByType( + examples, + selectedFilterType, + ); + return sortExamplesByName(sorted, filterText); + } + + List sortExamplesByType( + List examples, + ExampleType type, + ) { + return examples.where((element) => element.type == type).toList(); + } + + List sortExamplesByName( + List examples, + String name, + ) { + return examples + .where((example) => + example.name.toLowerCase().contains(name.toLowerCase())) + .toList(); + } +} diff --git a/playground/frontend/test/pages/playground/states/example_dropdown_state_test.dart b/playground/frontend/test/pages/playground/states/example_selector_state_test.dart similarity index 75% rename from playground/frontend/test/pages/playground/states/example_dropdown_state_test.dart rename to playground/frontend/test/pages/playground/states/example_selector_state_test.dart index 95db4e7915f7..ddedf50e1dc4 100644 --- a/playground/frontend/test/pages/playground/states/example_dropdown_state_test.dart +++ b/playground/frontend/test/pages/playground/states/example_selector_state_test.dart @@ -19,17 +19,17 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:playground/modules/examples/models/example_model.dart'; import 'package:playground/modules/examples/repositories/example_repository.dart'; -import 'package:playground/pages/playground/states/example_dropdown_state.dart'; +import 'package:playground/pages/playground/states/example_selector_state.dart'; import 'package:playground/pages/playground/states/examples_state.dart'; import 'mocks/categories_mock.dart'; void main() { test( - 'ExampleDropdown state should notify all listeners about filter type change', + 'ExampleSelector state should notify all listeners about filter type change', () { final exampleState = ExampleState(ExampleRepository()); - final state = ExampleDropdownState(exampleState, []); + final state = ExampleSelectorState(exampleState, []); state.addListener(() { expect(state.selectedFilterType, ExampleType.example); }); @@ -37,10 +37,10 @@ void main() { }); test( - 'ExampleDropdown state should notify all listeners about categories change', + 'ExampleSelector state should notify all listeners about categories change', () { final exampleState = ExampleState(ExampleRepository()); - final state = ExampleDropdownState(exampleState, []); + final state = ExampleSelectorState(exampleState, []); state.addListener(() { expect(state.categories, []); }); @@ -48,14 +48,14 @@ void main() { }); test( - 'ExampleDropdown state sortCategories should:' + 'ExampleSelector state sortCategories should:' '- update categories and notify all listeners,' 'but should NOT:' '- wait for full name of example,' '- be sensitive for register,' '- affect Example state categories', () { final exampleState = ExampleState(ExampleRepository()); - final state = ExampleDropdownState( + final state = ExampleSelectorState( exampleState, exampleState.categories!, ExampleType.example, @@ -69,22 +69,22 @@ void main() { }); test( - 'ExampleDropdown state sortExamplesByType should:' + 'ExampleSelector state sortExamplesByType should:' '- update categories,' '- notify all listeners,' 'but should NOT:' '- affect Example state categories', () { final exampleState = ExampleState(ExampleRepository()); - final state = ExampleDropdownState(exampleState, exampleState.categories!); + final state = ExampleSelectorState(exampleState, exampleState.categories!); state.addListener(() { - expect(state.categories, categoriesSortedByTypeMock); + expect(state.categories, examplesSortedByTypeMock); expect(exampleState.categories, exampleState.categories); }); - state.sortExamplesByType(exampleState.categories!, ExampleType.kata); + state.sortExamplesByType(unsortedExamples, ExampleType.kata); }); test( - 'ExampleDropdown state sortExamplesByName should:' + 'ExampleSelector state sortExamplesByName should:' '- update categories' '- notify all listeners,' 'but should NOT:' @@ -92,11 +92,11 @@ void main() { '- be sensitive for register,' '- affect Example state categories', () { final exampleState = ExampleState(ExampleRepository()); - final state = ExampleDropdownState(exampleState, exampleState.categories!); + final state = ExampleSelectorState(exampleState, exampleState.categories!); state.addListener(() { - expect(state.categories, categoriesSortedByNameMock); + expect(state.categories, examplesSortedByNameMock); expect(exampleState.categories, exampleState.categories); }); - state.sortExamplesByName(exampleState.categories!, 'eLLoWoRl'); + state.sortExamplesByName(unsortedExamples, 'eLLoWoRl'); }); } diff --git a/playground/frontend/test/pages/playground/states/mocks/categories_mock.dart b/playground/frontend/test/pages/playground/states/mocks/categories_mock.dart index 038be22be476..f3a5b3456cd6 100644 --- a/playground/frontend/test/pages/playground/states/mocks/categories_mock.dart +++ b/playground/frontend/test/pages/playground/states/mocks/categories_mock.dart @@ -60,35 +60,93 @@ const List sortedCategories = [ ]) ]; -const List categoriesSortedByTypeMock = [ - CategoryModel('Side Inputs', [ - ExampleModel( - { - SDK.java: 'JAVA Source code 1', - SDK.go: 'GO Source code 1', - SDK.python: 'PYTHON Source code 1', - SDK.scio: 'SCIO Source code 1', - }, - 'KATA Source code 1', - ExampleType.kata, - ), - ]), - CategoryModel('I/O', [ - ExampleModel( - { - SDK.java: 'JAVA Source code 4', - SDK.go: 'GO Source code 4', - SDK.python: 'PYTHON Source code 4', - SDK.scio: 'SCIO Source code 4', - }, - 'KATA Source code 4', - ExampleType.kata, - ), - ]), +const List unsortedExamples = [ + ExampleModel( + { + SDK.java: javaHelloWorld, + SDK.go: goHelloWorld, + SDK.python: pythonHelloWorld, + SDK.scio: scioHelloWorld, + }, + 'HelloWorld', + ExampleType.example, + ), + ExampleModel( + { + SDK.java: 'JAVA Source code 1', + SDK.go: 'GO Source code 1', + SDK.python: 'PYTHON Source code 1', + SDK.scio: 'SCIO Source code 1', + }, + 'KATA Source code 1', + ExampleType.kata, + ), + ExampleModel( + { + SDK.java: 'JAVA Source code 2', + SDK.go: 'GO Source code 2', + SDK.python: 'PYTHON Source code 2', + SDK.scio: 'SCIO Source code 2', + }, + 'UNIT TEST Source code 2', + ExampleType.test, + ), + ExampleModel( + { + SDK.java: 'JAVA Source code 3', + SDK.go: 'GO Source code 3', + SDK.python: 'PYTHON Source code 3', + SDK.scio: 'SCIO Source code 3', + }, + 'EXAMPLE Source code 3', + ExampleType.example, + ), + ExampleModel( + { + SDK.java: 'JAVA Source code 4', + SDK.go: 'GO Source code 4', + SDK.python: 'PYTHON Source code 4', + SDK.scio: 'SCIO Source code 4', + }, + 'KATA Source code 4', + ExampleType.kata, + ), + ExampleModel( + { + SDK.java: 'JAVA Source code 5', + SDK.go: 'GO Source code 5', + SDK.python: 'PYTHON Source code 5', + SDK.scio: 'SCIO Source code 5', + }, + 'UNIT TEST Source code 5', + ExampleType.test, + ), ]; -const List categoriesSortedByNameMock = [ - CategoryModel('Side Inputs', [ +const List examplesSortedByTypeMock = [ + ExampleModel( + { + SDK.java: 'JAVA Source code 1', + SDK.go: 'GO Source code 1', + SDK.python: 'PYTHON Source code 1', + SDK.scio: 'SCIO Source code 1', + }, + 'KATA Source code 1', + ExampleType.kata, + ), + ExampleModel( + { + SDK.java: 'JAVA Source code 4', + SDK.go: 'GO Source code 4', + SDK.python: 'PYTHON Source code 4', + SDK.scio: 'SCIO Source code 4', + }, + 'KATA Source code 4', + ExampleType.kata, + ), +]; + +const List examplesSortedByNameMock = [ ExampleModel( { SDK.java: javaHelloWorld, @@ -99,5 +157,4 @@ const List categoriesSortedByNameMock = [ 'HelloWorld', ExampleType.example, ), - ]) ]; From 2c0d3fb5410b1e476909d751dbb079e23f519f52 Mon Sep 17 00:00:00 2001 From: Alexander Zhuravlev Date: Fri, 22 Oct 2021 12:57:07 +0300 Subject: [PATCH 10/32] [BEAM-12967]: Deleted duplicate files --- .../frontend/lib/generated/playground.pb.dart | 451 ------------------ .../lib/generated/playground.pbenum.dart | 69 --- .../lib/generated/playground.pbgrpc.dart | 159 ------ .../lib/generated/playground.pbjson.dart | 138 ------ 4 files changed, 817 deletions(-) delete mode 100644 playground/frontend/lib/generated/playground.pb.dart delete mode 100644 playground/frontend/lib/generated/playground.pbenum.dart delete mode 100644 playground/frontend/lib/generated/playground.pbgrpc.dart delete mode 100644 playground/frontend/lib/generated/playground.pbjson.dart diff --git a/playground/frontend/lib/generated/playground.pb.dart b/playground/frontend/lib/generated/playground.pb.dart deleted file mode 100644 index 77cd913850a9..000000000000 --- a/playground/frontend/lib/generated/playground.pb.dart +++ /dev/null @@ -1,451 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/// -// Generated code. Do not modify. -// source: playground.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 'playground.pbenum.dart'; - -export 'playground.pbenum.dart'; - -class RunCodeRequest extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'RunCodeRequest', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'playground.v1'), createEmptyInstance: create) - ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'code') - ..e(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'sdk', $pb.PbFieldType.OE, defaultOrMaker: Sdk.SDK_UNSPECIFIED, valueOf: Sdk.valueOf, enumValues: Sdk.values) - ..hasRequiredFields = false - ; - - RunCodeRequest._() : super(); - factory RunCodeRequest({ - $core.String? code, - Sdk? sdk, - }) { - final _result = create(); - if (code != null) { - _result.code = code; - } - if (sdk != null) { - _result.sdk = sdk; - } - return _result; - } - factory RunCodeRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory RunCodeRequest.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') - RunCodeRequest clone() => RunCodeRequest()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - RunCodeRequest copyWith(void Function(RunCodeRequest) updates) => super.copyWith((message) => updates(message as RunCodeRequest)) as RunCodeRequest; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static RunCodeRequest create() => RunCodeRequest._(); - RunCodeRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static RunCodeRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static RunCodeRequest? _defaultInstance; - - @$pb.TagNumber(1) - $core.String get code => $_getSZ(0); - @$pb.TagNumber(1) - set code($core.String v) { $_setString(0, v); } - @$pb.TagNumber(1) - $core.bool hasCode() => $_has(0); - @$pb.TagNumber(1) - void clearCode() => clearField(1); - - @$pb.TagNumber(2) - Sdk get sdk => $_getN(1); - @$pb.TagNumber(2) - set sdk(Sdk v) { setField(2, v); } - @$pb.TagNumber(2) - $core.bool hasSdk() => $_has(1); - @$pb.TagNumber(2) - void clearSdk() => clearField(2); -} - -class RunCodeResponse extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'RunCodeResponse', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'playground.v1'), createEmptyInstance: create) - ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'pipelineUuid') - ..hasRequiredFields = false - ; - - RunCodeResponse._() : super(); - factory RunCodeResponse({ - $core.String? pipelineUuid, - }) { - final _result = create(); - if (pipelineUuid != null) { - _result.pipelineUuid = pipelineUuid; - } - return _result; - } - factory RunCodeResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory RunCodeResponse.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') - RunCodeResponse clone() => RunCodeResponse()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - RunCodeResponse copyWith(void Function(RunCodeResponse) updates) => super.copyWith((message) => updates(message as RunCodeResponse)) as RunCodeResponse; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static RunCodeResponse create() => RunCodeResponse._(); - RunCodeResponse createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static RunCodeResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static RunCodeResponse? _defaultInstance; - - @$pb.TagNumber(1) - $core.String get pipelineUuid => $_getSZ(0); - @$pb.TagNumber(1) - set pipelineUuid($core.String v) { $_setString(0, v); } - @$pb.TagNumber(1) - $core.bool hasPipelineUuid() => $_has(0); - @$pb.TagNumber(1) - void clearPipelineUuid() => clearField(1); -} - -class CheckStatusRequest extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CheckStatusRequest', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'playground.v1'), createEmptyInstance: create) - ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'pipelineUuid') - ..hasRequiredFields = false - ; - - CheckStatusRequest._() : super(); - factory CheckStatusRequest({ - $core.String? pipelineUuid, - }) { - final _result = create(); - if (pipelineUuid != null) { - _result.pipelineUuid = pipelineUuid; - } - return _result; - } - factory CheckStatusRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory CheckStatusRequest.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') - CheckStatusRequest clone() => CheckStatusRequest()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - CheckStatusRequest copyWith(void Function(CheckStatusRequest) updates) => super.copyWith((message) => updates(message as CheckStatusRequest)) as CheckStatusRequest; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static CheckStatusRequest create() => CheckStatusRequest._(); - CheckStatusRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static CheckStatusRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static CheckStatusRequest? _defaultInstance; - - @$pb.TagNumber(1) - $core.String get pipelineUuid => $_getSZ(0); - @$pb.TagNumber(1) - set pipelineUuid($core.String v) { $_setString(0, v); } - @$pb.TagNumber(1) - $core.bool hasPipelineUuid() => $_has(0); - @$pb.TagNumber(1) - void clearPipelineUuid() => clearField(1); -} - -class CheckStatusResponse extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CheckStatusResponse', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'playground.v1'), createEmptyInstance: create) - ..e(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'status', $pb.PbFieldType.OE, defaultOrMaker: Status.STATUS_UNSPECIFIED, valueOf: Status.valueOf, enumValues: Status.values) - ..hasRequiredFields = false - ; - - CheckStatusResponse._() : super(); - factory CheckStatusResponse({ - Status? status, - }) { - final _result = create(); - if (status != null) { - _result.status = status; - } - return _result; - } - factory CheckStatusResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory CheckStatusResponse.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') - CheckStatusResponse clone() => CheckStatusResponse()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - CheckStatusResponse copyWith(void Function(CheckStatusResponse) updates) => super.copyWith((message) => updates(message as CheckStatusResponse)) as CheckStatusResponse; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static CheckStatusResponse create() => CheckStatusResponse._(); - CheckStatusResponse createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static CheckStatusResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static CheckStatusResponse? _defaultInstance; - - @$pb.TagNumber(1) - Status get status => $_getN(0); - @$pb.TagNumber(1) - set status(Status v) { setField(1, v); } - @$pb.TagNumber(1) - $core.bool hasStatus() => $_has(0); - @$pb.TagNumber(1) - void clearStatus() => clearField(1); -} - -class GetCompileOutputRequest extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GetCompileOutputRequest', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'playground.v1'), createEmptyInstance: create) - ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'pipelineUuid') - ..hasRequiredFields = false - ; - - GetCompileOutputRequest._() : super(); - factory GetCompileOutputRequest({ - $core.String? pipelineUuid, - }) { - final _result = create(); - if (pipelineUuid != null) { - _result.pipelineUuid = pipelineUuid; - } - return _result; - } - factory GetCompileOutputRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory GetCompileOutputRequest.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') - GetCompileOutputRequest clone() => GetCompileOutputRequest()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - GetCompileOutputRequest copyWith(void Function(GetCompileOutputRequest) updates) => super.copyWith((message) => updates(message as GetCompileOutputRequest)) as GetCompileOutputRequest; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static GetCompileOutputRequest create() => GetCompileOutputRequest._(); - GetCompileOutputRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static GetCompileOutputRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static GetCompileOutputRequest? _defaultInstance; - - @$pb.TagNumber(1) - $core.String get pipelineUuid => $_getSZ(0); - @$pb.TagNumber(1) - set pipelineUuid($core.String v) { $_setString(0, v); } - @$pb.TagNumber(1) - $core.bool hasPipelineUuid() => $_has(0); - @$pb.TagNumber(1) - void clearPipelineUuid() => clearField(1); -} - -class GetCompileOutputResponse extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GetCompileOutputResponse', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'playground.v1'), createEmptyInstance: create) - ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'output') - ..e(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'compilationStatus', $pb.PbFieldType.OE, defaultOrMaker: Status.STATUS_UNSPECIFIED, valueOf: Status.valueOf, enumValues: Status.values) - ..hasRequiredFields = false - ; - - GetCompileOutputResponse._() : super(); - factory GetCompileOutputResponse({ - $core.String? output, - Status? compilationStatus, - }) { - final _result = create(); - if (output != null) { - _result.output = output; - } - if (compilationStatus != null) { - _result.compilationStatus = compilationStatus; - } - return _result; - } - factory GetCompileOutputResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory GetCompileOutputResponse.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') - GetCompileOutputResponse clone() => GetCompileOutputResponse()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - GetCompileOutputResponse copyWith(void Function(GetCompileOutputResponse) updates) => super.copyWith((message) => updates(message as GetCompileOutputResponse)) as GetCompileOutputResponse; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static GetCompileOutputResponse create() => GetCompileOutputResponse._(); - GetCompileOutputResponse createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static GetCompileOutputResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static GetCompileOutputResponse? _defaultInstance; - - @$pb.TagNumber(1) - $core.String get output => $_getSZ(0); - @$pb.TagNumber(1) - set output($core.String v) { $_setString(0, v); } - @$pb.TagNumber(1) - $core.bool hasOutput() => $_has(0); - @$pb.TagNumber(1) - void clearOutput() => clearField(1); - - @$pb.TagNumber(2) - Status get compilationStatus => $_getN(1); - @$pb.TagNumber(2) - set compilationStatus(Status v) { setField(2, v); } - @$pb.TagNumber(2) - $core.bool hasCompilationStatus() => $_has(1); - @$pb.TagNumber(2) - void clearCompilationStatus() => clearField(2); -} - -class GetRunOutputRequest extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GetRunOutputRequest', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'playground.v1'), createEmptyInstance: create) - ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'pipelineUuid') - ..hasRequiredFields = false - ; - - GetRunOutputRequest._() : super(); - factory GetRunOutputRequest({ - $core.String? pipelineUuid, - }) { - final _result = create(); - if (pipelineUuid != null) { - _result.pipelineUuid = pipelineUuid; - } - return _result; - } - factory GetRunOutputRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory GetRunOutputRequest.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') - GetRunOutputRequest clone() => GetRunOutputRequest()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - GetRunOutputRequest copyWith(void Function(GetRunOutputRequest) updates) => super.copyWith((message) => updates(message as GetRunOutputRequest)) as GetRunOutputRequest; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static GetRunOutputRequest create() => GetRunOutputRequest._(); - GetRunOutputRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static GetRunOutputRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static GetRunOutputRequest? _defaultInstance; - - @$pb.TagNumber(1) - $core.String get pipelineUuid => $_getSZ(0); - @$pb.TagNumber(1) - set pipelineUuid($core.String v) { $_setString(0, v); } - @$pb.TagNumber(1) - $core.bool hasPipelineUuid() => $_has(0); - @$pb.TagNumber(1) - void clearPipelineUuid() => clearField(1); -} - -class GetRunOutputResponse extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GetRunOutputResponse', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'playground.v1'), createEmptyInstance: create) - ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'output') - ..e(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'compilationStatus', $pb.PbFieldType.OE, defaultOrMaker: Status.STATUS_UNSPECIFIED, valueOf: Status.valueOf, enumValues: Status.values) - ..hasRequiredFields = false - ; - - GetRunOutputResponse._() : super(); - factory GetRunOutputResponse({ - $core.String? output, - Status? compilationStatus, - }) { - final _result = create(); - if (output != null) { - _result.output = output; - } - if (compilationStatus != null) { - _result.compilationStatus = compilationStatus; - } - return _result; - } - factory GetRunOutputResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory GetRunOutputResponse.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') - GetRunOutputResponse clone() => GetRunOutputResponse()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - GetRunOutputResponse copyWith(void Function(GetRunOutputResponse) updates) => super.copyWith((message) => updates(message as GetRunOutputResponse)) as GetRunOutputResponse; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static GetRunOutputResponse create() => GetRunOutputResponse._(); - GetRunOutputResponse createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static GetRunOutputResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static GetRunOutputResponse? _defaultInstance; - - @$pb.TagNumber(1) - $core.String get output => $_getSZ(0); - @$pb.TagNumber(1) - set output($core.String v) { $_setString(0, v); } - @$pb.TagNumber(1) - $core.bool hasOutput() => $_has(0); - @$pb.TagNumber(1) - void clearOutput() => clearField(1); - - @$pb.TagNumber(2) - Status get compilationStatus => $_getN(1); - @$pb.TagNumber(2) - set compilationStatus(Status v) { setField(2, v); } - @$pb.TagNumber(2) - $core.bool hasCompilationStatus() => $_has(1); - @$pb.TagNumber(2) - void clearCompilationStatus() => clearField(2); -} - diff --git a/playground/frontend/lib/generated/playground.pbenum.dart b/playground/frontend/lib/generated/playground.pbenum.dart deleted file mode 100644 index fbbb256d65d0..000000000000 --- a/playground/frontend/lib/generated/playground.pbenum.dart +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/// -// Generated code. Do not modify. -// source: playground.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 Sdk extends $pb.ProtobufEnum { - static const Sdk SDK_UNSPECIFIED = Sdk._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'SDK_UNSPECIFIED'); - static const Sdk SDK_JAVA = Sdk._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'SDK_JAVA'); - static const Sdk SDK_GO = Sdk._(2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'SDK_GO'); - static const Sdk SDK_PYTHON = Sdk._(3, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'SDK_PYTHON'); - static const Sdk SDK_SCIO = Sdk._(4, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'SDK_SCIO'); - - static const $core.List values = [ - SDK_UNSPECIFIED, - SDK_JAVA, - SDK_GO, - SDK_PYTHON, - SDK_SCIO, - ]; - - static final $core.Map<$core.int, Sdk> _byValue = $pb.ProtobufEnum.initByValue(values); - static Sdk? valueOf($core.int value) => _byValue[value]; - - const Sdk._($core.int v, $core.String n) : super(v, n); -} - -class Status extends $pb.ProtobufEnum { - static const Status STATUS_UNSPECIFIED = Status._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'STATUS_UNSPECIFIED'); - static const Status STATUS_EXECUTING = Status._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'STATUS_EXECUTING'); - static const Status STATUS_FINISHED = Status._(2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'STATUS_FINISHED'); - static const Status STATUS_ERROR = Status._(3, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'STATUS_ERROR'); - - static const $core.List values = [ - STATUS_UNSPECIFIED, - STATUS_EXECUTING, - STATUS_FINISHED, - STATUS_ERROR, - ]; - - static final $core.Map<$core.int, Status> _byValue = $pb.ProtobufEnum.initByValue(values); - static Status? valueOf($core.int value) => _byValue[value]; - - const Status._($core.int v, $core.String n) : super(v, n); -} - diff --git a/playground/frontend/lib/generated/playground.pbgrpc.dart b/playground/frontend/lib/generated/playground.pbgrpc.dart deleted file mode 100644 index c18185bf4ac8..000000000000 --- a/playground/frontend/lib/generated/playground.pbgrpc.dart +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/// -// Generated code. Do not modify. -// source: playground.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:async' as $async; - -import 'dart:core' as $core; - -import 'package:grpc/service_api.dart' as $grpc; -import 'playground.pb.dart' as $0; -export 'playground.pb.dart'; - -class PlaygroundServiceClient extends $grpc.Client { - static final _$runCode = - $grpc.ClientMethod<$0.RunCodeRequest, $0.RunCodeResponse>( - '/playground.v1.PlaygroundService/RunCode', - ($0.RunCodeRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => - $0.RunCodeResponse.fromBuffer(value)); - static final _$checkStatus = - $grpc.ClientMethod<$0.CheckStatusRequest, $0.CheckStatusResponse>( - '/playground.v1.PlaygroundService/CheckStatus', - ($0.CheckStatusRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => - $0.CheckStatusResponse.fromBuffer(value)); - static final _$getRunOutput = - $grpc.ClientMethod<$0.GetRunOutputRequest, $0.GetRunOutputResponse>( - '/playground.v1.PlaygroundService/GetRunOutput', - ($0.GetRunOutputRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => - $0.GetRunOutputResponse.fromBuffer(value)); - static final _$getCompileOutput = $grpc.ClientMethod< - $0.GetCompileOutputRequest, $0.GetCompileOutputResponse>( - '/playground.v1.PlaygroundService/GetCompileOutput', - ($0.GetCompileOutputRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => - $0.GetCompileOutputResponse.fromBuffer(value)); - - PlaygroundServiceClient($grpc.ClientChannel channel, - {$grpc.CallOptions? options, - $core.Iterable<$grpc.ClientInterceptor>? interceptors}) - : super(channel, options: options, interceptors: interceptors); - - $grpc.ResponseFuture<$0.RunCodeResponse> runCode($0.RunCodeRequest request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$runCode, request, options: options); - } - - $grpc.ResponseFuture<$0.CheckStatusResponse> checkStatus( - $0.CheckStatusRequest request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$checkStatus, request, options: options); - } - - $grpc.ResponseFuture<$0.GetRunOutputResponse> getRunOutput( - $0.GetRunOutputRequest request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$getRunOutput, request, options: options); - } - - $grpc.ResponseFuture<$0.GetCompileOutputResponse> getCompileOutput( - $0.GetCompileOutputRequest request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$getCompileOutput, request, options: options); - } -} - -abstract class PlaygroundServiceBase extends $grpc.Service { - $core.String get $name => 'playground.v1.PlaygroundService'; - - PlaygroundServiceBase() { - $addMethod($grpc.ServiceMethod<$0.RunCodeRequest, $0.RunCodeResponse>( - 'RunCode', - runCode_Pre, - false, - false, - ($core.List<$core.int> value) => $0.RunCodeRequest.fromBuffer(value), - ($0.RunCodeResponse value) => value.writeToBuffer())); - $addMethod( - $grpc.ServiceMethod<$0.CheckStatusRequest, $0.CheckStatusResponse>( - 'CheckStatus', - checkStatus_Pre, - false, - false, - ($core.List<$core.int> value) => - $0.CheckStatusRequest.fromBuffer(value), - ($0.CheckStatusResponse value) => value.writeToBuffer())); - $addMethod( - $grpc.ServiceMethod<$0.GetRunOutputRequest, $0.GetRunOutputResponse>( - 'GetRunOutput', - getRunOutput_Pre, - false, - false, - ($core.List<$core.int> value) => - $0.GetRunOutputRequest.fromBuffer(value), - ($0.GetRunOutputResponse value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.GetCompileOutputRequest, - $0.GetCompileOutputResponse>( - 'GetCompileOutput', - getCompileOutput_Pre, - false, - false, - ($core.List<$core.int> value) => - $0.GetCompileOutputRequest.fromBuffer(value), - ($0.GetCompileOutputResponse value) => value.writeToBuffer())); - } - - $async.Future<$0.RunCodeResponse> runCode_Pre( - $grpc.ServiceCall call, $async.Future<$0.RunCodeRequest> request) async { - return runCode(call, await request); - } - - $async.Future<$0.CheckStatusResponse> checkStatus_Pre($grpc.ServiceCall call, - $async.Future<$0.CheckStatusRequest> request) async { - return checkStatus(call, await request); - } - - $async.Future<$0.GetRunOutputResponse> getRunOutput_Pre( - $grpc.ServiceCall call, - $async.Future<$0.GetRunOutputRequest> request) async { - return getRunOutput(call, await request); - } - - $async.Future<$0.GetCompileOutputResponse> getCompileOutput_Pre( - $grpc.ServiceCall call, - $async.Future<$0.GetCompileOutputRequest> request) async { - return getCompileOutput(call, await request); - } - - $async.Future<$0.RunCodeResponse> runCode( - $grpc.ServiceCall call, $0.RunCodeRequest request); - $async.Future<$0.CheckStatusResponse> checkStatus( - $grpc.ServiceCall call, $0.CheckStatusRequest request); - $async.Future<$0.GetRunOutputResponse> getRunOutput( - $grpc.ServiceCall call, $0.GetRunOutputRequest request); - $async.Future<$0.GetCompileOutputResponse> getCompileOutput( - $grpc.ServiceCall call, $0.GetCompileOutputRequest request); -} diff --git a/playground/frontend/lib/generated/playground.pbjson.dart b/playground/frontend/lib/generated/playground.pbjson.dart deleted file mode 100644 index 4912ae2013d1..000000000000 --- a/playground/frontend/lib/generated/playground.pbjson.dart +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/// -// Generated code. Do not modify. -// source: playground.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 sdkDescriptor instead') -const Sdk$json = const { - '1': 'Sdk', - '2': const [ - const {'1': 'SDK_UNSPECIFIED', '2': 0}, - const {'1': 'SDK_JAVA', '2': 1}, - const {'1': 'SDK_GO', '2': 2}, - const {'1': 'SDK_PYTHON', '2': 3}, - const {'1': 'SDK_SCIO', '2': 4}, - ], -}; - -/// Descriptor for `Sdk`. Decode as a `google.protobuf.EnumDescriptorProto`. -final $typed_data.Uint8List sdkDescriptor = $convert.base64Decode('CgNTZGsSEwoPU0RLX1VOU1BFQ0lGSUVEEAASDAoIU0RLX0pBVkEQARIKCgZTREtfR08QAhIOCgpTREtfUFlUSE9OEAMSDAoIU0RLX1NDSU8QBA=='); -@$core.Deprecated('Use statusDescriptor instead') -const Status$json = const { - '1': 'Status', - '2': const [ - const {'1': 'STATUS_UNSPECIFIED', '2': 0}, - const {'1': 'STATUS_EXECUTING', '2': 1}, - const {'1': 'STATUS_FINISHED', '2': 2}, - const {'1': 'STATUS_ERROR', '2': 3}, - ], -}; - -/// Descriptor for `Status`. Decode as a `google.protobuf.EnumDescriptorProto`. -final $typed_data.Uint8List statusDescriptor = $convert.base64Decode('CgZTdGF0dXMSFgoSU1RBVFVTX1VOU1BFQ0lGSUVEEAASFAoQU1RBVFVTX0VYRUNVVElORxABEhMKD1NUQVRVU19GSU5JU0hFRBACEhAKDFNUQVRVU19FUlJPUhAD'); -@$core.Deprecated('Use runCodeRequestDescriptor instead') -const RunCodeRequest$json = const { - '1': 'RunCodeRequest', - '2': const [ - const {'1': 'code', '3': 1, '4': 1, '5': 9, '10': 'code'}, - const {'1': 'sdk', '3': 2, '4': 1, '5': 14, '6': '.playground.v1.Sdk', '10': 'sdk'}, - ], -}; - -/// Descriptor for `RunCodeRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List runCodeRequestDescriptor = $convert.base64Decode('Cg5SdW5Db2RlUmVxdWVzdBISCgRjb2RlGAEgASgJUgRjb2RlEiQKA3NkaxgCIAEoDjISLnBsYXlncm91bmQudjEuU2RrUgNzZGs='); -@$core.Deprecated('Use runCodeResponseDescriptor instead') -const RunCodeResponse$json = const { - '1': 'RunCodeResponse', - '2': const [ - const {'1': 'pipeline_uuid', '3': 1, '4': 1, '5': 9, '10': 'pipelineUuid'}, - ], -}; - -/// Descriptor for `RunCodeResponse`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List runCodeResponseDescriptor = $convert.base64Decode('Cg9SdW5Db2RlUmVzcG9uc2USIwoNcGlwZWxpbmVfdXVpZBgBIAEoCVIMcGlwZWxpbmVVdWlk'); -@$core.Deprecated('Use checkStatusRequestDescriptor instead') -const CheckStatusRequest$json = const { - '1': 'CheckStatusRequest', - '2': const [ - const {'1': 'pipeline_uuid', '3': 1, '4': 1, '5': 9, '10': 'pipelineUuid'}, - ], -}; - -/// Descriptor for `CheckStatusRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List checkStatusRequestDescriptor = $convert.base64Decode('ChJDaGVja1N0YXR1c1JlcXVlc3QSIwoNcGlwZWxpbmVfdXVpZBgBIAEoCVIMcGlwZWxpbmVVdWlk'); -@$core.Deprecated('Use checkStatusResponseDescriptor instead') -const CheckStatusResponse$json = const { - '1': 'CheckStatusResponse', - '2': const [ - const {'1': 'status', '3': 1, '4': 1, '5': 14, '6': '.playground.v1.Status', '10': 'status'}, - ], -}; - -/// Descriptor for `CheckStatusResponse`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List checkStatusResponseDescriptor = $convert.base64Decode('ChNDaGVja1N0YXR1c1Jlc3BvbnNlEi0KBnN0YXR1cxgBIAEoDjIVLnBsYXlncm91bmQudjEuU3RhdHVzUgZzdGF0dXM='); -@$core.Deprecated('Use getCompileOutputRequestDescriptor instead') -const GetCompileOutputRequest$json = const { - '1': 'GetCompileOutputRequest', - '2': const [ - const {'1': 'pipeline_uuid', '3': 1, '4': 1, '5': 9, '10': 'pipelineUuid'}, - ], -}; - -/// Descriptor for `GetCompileOutputRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List getCompileOutputRequestDescriptor = $convert.base64Decode('ChdHZXRDb21waWxlT3V0cHV0UmVxdWVzdBIjCg1waXBlbGluZV91dWlkGAEgASgJUgxwaXBlbGluZVV1aWQ='); -@$core.Deprecated('Use getCompileOutputResponseDescriptor instead') -const GetCompileOutputResponse$json = const { - '1': 'GetCompileOutputResponse', - '2': const [ - const {'1': 'output', '3': 1, '4': 1, '5': 9, '10': 'output'}, - const {'1': 'compilation_status', '3': 2, '4': 1, '5': 14, '6': '.playground.v1.Status', '10': 'compilationStatus'}, - ], -}; - -/// Descriptor for `GetCompileOutputResponse`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List getCompileOutputResponseDescriptor = $convert.base64Decode('ChhHZXRDb21waWxlT3V0cHV0UmVzcG9uc2USFgoGb3V0cHV0GAEgASgJUgZvdXRwdXQSRAoSY29tcGlsYXRpb25fc3RhdHVzGAIgASgOMhUucGxheWdyb3VuZC52MS5TdGF0dXNSEWNvbXBpbGF0aW9uU3RhdHVz'); -@$core.Deprecated('Use getRunOutputRequestDescriptor instead') -const GetRunOutputRequest$json = const { - '1': 'GetRunOutputRequest', - '2': const [ - const {'1': 'pipeline_uuid', '3': 1, '4': 1, '5': 9, '10': 'pipelineUuid'}, - ], -}; - -/// Descriptor for `GetRunOutputRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List getRunOutputRequestDescriptor = $convert.base64Decode('ChNHZXRSdW5PdXRwdXRSZXF1ZXN0EiMKDXBpcGVsaW5lX3V1aWQYASABKAlSDHBpcGVsaW5lVXVpZA=='); -@$core.Deprecated('Use getRunOutputResponseDescriptor instead') -const GetRunOutputResponse$json = const { - '1': 'GetRunOutputResponse', - '2': const [ - const {'1': 'output', '3': 1, '4': 1, '5': 9, '10': 'output'}, - const {'1': 'compilation_status', '3': 2, '4': 1, '5': 14, '6': '.playground.v1.Status', '10': 'compilationStatus'}, - ], -}; - -/// Descriptor for `GetRunOutputResponse`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List getRunOutputResponseDescriptor = $convert.base64Decode('ChRHZXRSdW5PdXRwdXRSZXNwb25zZRIWCgZvdXRwdXQYASABKAlSBm91dHB1dBJEChJjb21waWxhdGlvbl9zdGF0dXMYAiABKA4yFS5wbGF5Z3JvdW5kLnYxLlN0YXR1c1IRY29tcGlsYXRpb25TdGF0dXM='); From 33157a8ea9a4e33461c553f37f4fdf04caad9496 Mon Sep 17 00:00:00 2001 From: Alexander Zhuravlev Date: Tue, 26 Oct 2021 12:25:50 +0300 Subject: [PATCH 11/32] [BEAM-13101]: Implementing new Example structure --- .../editor/components/editor_textarea.dart | 2 +- .../example_list/expansion_panel_item.dart | 15 +- .../modules/examples/example_selector.dart | 14 +- .../examples/models/category_model.dart | 10 +- .../examples/models/example_model.dart | 39 ++++- .../examples/models/outputs_model.dart | 10 ++ .../repositories/example_repository.dart | 164 ++++++++++-------- .../components/playground_page_providers.dart | 7 +- .../lib/pages/playground/playground_page.dart | 1 - .../states/example_selector_state.dart | 10 +- .../playground/states/examples_state.dart | 16 +- .../playground/states/playground_state.dart | 6 +- playground/frontend/pubspec.lock | 18 +- playground/frontend/pubspec.yaml | 2 + 14 files changed, 209 insertions(+), 105 deletions(-) create mode 100644 playground/frontend/lib/modules/examples/models/outputs_model.dart diff --git a/playground/frontend/lib/modules/editor/components/editor_textarea.dart b/playground/frontend/lib/modules/editor/components/editor_textarea.dart index 716f99eb93a2..f73a98540cd6 100644 --- a/playground/frontend/lib/modules/editor/components/editor_textarea.dart +++ b/playground/frontend/lib/modules/editor/components/editor_textarea.dart @@ -57,7 +57,7 @@ class _EditorTextAreaState extends State { void didChangeDependencies() { final themeProvider = Provider.of(context, listen: true); _codeController = CodeController( - text: _codeController?.text ?? widget.example?.sources[widget.sdk] ?? '', + text: _codeController?.text ?? widget.example?.source ?? '', language: _getLanguageFromSdk(), theme: themeProvider.isDarkMode ? darculaTheme : vsTheme, onChange: (newSource) => widget.onSourceChange(newSource), diff --git a/playground/frontend/lib/modules/examples/components/example_list/expansion_panel_item.dart b/playground/frontend/lib/modules/examples/components/example_list/expansion_panel_item.dart index 2ae056070aab..82b98722c495 100644 --- a/playground/frontend/lib/modules/examples/components/example_list/expansion_panel_item.dart +++ b/playground/frontend/lib/modules/examples/components/example_list/expansion_panel_item.dart @@ -19,6 +19,7 @@ import 'package:flutter/material.dart'; import 'package:playground/constants/sizes.dart'; import 'package:playground/modules/examples/models/example_model.dart'; +import 'package:playground/pages/playground/states/examples_state.dart'; import 'package:playground/pages/playground/states/playground_state.dart'; import 'package:provider/provider.dart'; @@ -29,13 +30,15 @@ class ExpansionPanelItem extends StatelessWidget { @override Widget build(BuildContext context) { - return Consumer( - builder: (context, state, child) => MouseRegion( + return Consumer2( + builder: (context, playgroundState, exampleState, child) => MouseRegion( cursor: SystemMouseCursors.click, child: GestureDetector( - onTap: () { - if (state.selectedExample != example) { - state.setExample(example); + onTap: () async { + if (playgroundState.selectedExample != example) { + String source = await exampleState.getSource(example.id!); + example.setSource(source); + playgroundState.setExample(example); } }, child: Container( @@ -45,7 +48,7 @@ class ExpansionPanelItem extends StatelessWidget { child: Row( children: [ // Wrapped with Row for better user interaction and positioning - Text(example.name), + Text(example.name ?? ''), ], ), ), diff --git a/playground/frontend/lib/modules/examples/example_selector.dart b/playground/frontend/lib/modules/examples/example_selector.dart index a9de0b7b6b2a..259b7c3c68fc 100644 --- a/playground/frontend/lib/modules/examples/example_selector.dart +++ b/playground/frontend/lib/modules/examples/example_selector.dart @@ -20,7 +20,6 @@ import 'package:flutter/material.dart'; import 'package:playground/config/theme.dart'; import 'package:playground/constants/sizes.dart'; import 'package:playground/modules/examples/components/examples_components.dart'; -import 'package:playground/modules/examples/models/category_model.dart'; import 'package:playground/modules/examples/models/selector_size_model.dart'; import 'package:playground/pages/playground/states/example_selector_state.dart'; import 'package:playground/pages/playground/states/examples_state.dart'; @@ -37,13 +36,11 @@ const double kLgContainerWidth = 400.0; class ExampleSelector extends StatefulWidget { final Function changeSelectorVisibility; final bool isSelectorOpened; - final List categories; const ExampleSelector({ Key? key, required this.changeSelectorVisibility, required this.isSelectorOpened, - required this.categories, }) : super(key: key); @override @@ -123,14 +120,14 @@ class _ExampleSelectorState extends State return OverlayEntry( builder: (context) { - return Consumer( - builder: (context, state, child) => Stack( + return Consumer2( + builder: (context, exampleState, playgroundState, child) => Stack( children: [ GestureDetector( onTap: () { animationController.reverse(); examplesDropdown?.remove(); - state.changeSelectorVisibility(); + exampleState.changeSelectorVisibility(); }, child: Container( color: Colors.transparent, @@ -140,8 +137,9 @@ class _ExampleSelectorState extends State ), ChangeNotifierProvider( create: (context) => ExampleSelectorState( - state, - state.categories!, + exampleState, + playgroundState, + exampleState.getCategories(playgroundState.sdk)!, ), builder: (context, _) => Positioned( left: posModel.xAlignment, diff --git a/playground/frontend/lib/modules/examples/models/category_model.dart b/playground/frontend/lib/modules/examples/models/category_model.dart index 2c4b0f1a3401..5240e4868236 100644 --- a/playground/frontend/lib/modules/examples/models/category_model.dart +++ b/playground/frontend/lib/modules/examples/models/category_model.dart @@ -16,11 +16,19 @@ * limitations under the License. */ +import 'package:json_annotation/json_annotation.dart'; import 'package:playground/modules/examples/models/example_model.dart'; +part 'category_model.g.dart'; + +@JsonSerializable(explicitToJson: true) class CategoryModel { final String name; final List examples; - const CategoryModel(this.name, this.examples); + const CategoryModel({required this.name, required this.examples}); + + factory CategoryModel.fromJson(Map data) => _$CategoryModelFromJson(data); + + Map toJson() => _$CategoryModelToJson(this); } diff --git a/playground/frontend/lib/modules/examples/models/example_model.dart b/playground/frontend/lib/modules/examples/models/example_model.dart index 17e6f584982c..093b8b6df08e 100644 --- a/playground/frontend/lib/modules/examples/models/example_model.dart +++ b/playground/frontend/lib/modules/examples/models/example_model.dart @@ -16,7 +16,9 @@ * limitations under the License. */ -import 'package:playground/modules/sdk/models/sdk.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'example_model.g.dart'; enum ExampleType { all, @@ -40,10 +42,37 @@ extension ExampleTypeToString on ExampleType { } } +@JsonSerializable() class ExampleModel { - final Map sources; - final ExampleType type; - final String name; + @JsonKey(includeIfNull: false) + final ExampleType? type; + + @JsonKey(includeIfNull: false) + final String? name; + + @JsonKey(includeIfNull: false) + final int? id; + + @JsonKey(includeIfNull: false) + final String? description; + + @JsonKey(includeIfNull: false) + String? source; + + ExampleModel({ + this.source, + this.name, + this.type, + this.id, + this.description, + }); + + setSource(String source) { + this.source = source; + } + + factory ExampleModel.fromJson(Map data) => + _$ExampleModelFromJson(data); - const ExampleModel(this.sources, this.name, this.type); + Map toJson() => _$ExampleModelToJson(this); } diff --git a/playground/frontend/lib/modules/examples/models/outputs_model.dart b/playground/frontend/lib/modules/examples/models/outputs_model.dart new file mode 100644 index 000000000000..825bdb587475 --- /dev/null +++ b/playground/frontend/lib/modules/examples/models/outputs_model.dart @@ -0,0 +1,10 @@ +import 'package:json_annotation/json_annotation.dart'; + +@JsonSerializable() +class OutputsModel { + final String output; + final String graph; + final String log; + + OutputsModel(this.output, this.graph, this.log); +} \ No newline at end of file diff --git a/playground/frontend/lib/modules/examples/repositories/example_repository.dart b/playground/frontend/lib/modules/examples/repositories/example_repository.dart index 7fdc641d885d..977b5d9c42f7 100644 --- a/playground/frontend/lib/modules/examples/repositories/example_repository.dart +++ b/playground/frontend/lib/modules/examples/repositories/example_repository.dart @@ -17,7 +17,6 @@ */ import 'package:playground/modules/examples/models/category_model.dart'; -import 'package:playground/modules/examples/models/example_model.dart'; import 'package:playground/modules/sdk/models/sdk.dart'; const javaHelloWorld = '''class HelloWorld { @@ -45,75 +44,100 @@ object Hello { } }'''; +const getListOfExamplesResponse = { + 'java': [ + { + 'name': 'WordCountCategory', + 'examples': [ + { + 'name': 'MinimalWordCount', + 'id': 1111, + 'type': 'example', + 'description': 'ABCCDEFG', + }, + { + 'name': 'WordCount', + 'id': 2222, + 'type': 'kata', + 'description': 'ABCCDEFG', + }, + ], + }, + { + 'name': 'Kafka', + 'examples': [ + { + 'name': 'KafkaToPubSub', + 'id': 3333, + 'type': 'test', + 'description': 'ABCCDEFG', + }, + ], + }, + ], + 'python': [ + { + 'name': 'WordCountCategory', + 'examples': [ + { + 'name': 'MinimalWordCount', + 'id': 4444, + 'type': 'example', + 'description': 'ABCCDEFG', + }, + ], + }, + ], + 'go': [ + { + 'name': 'WordCountCategory', + 'examples': [ + { + 'name': 'MinimalWordCount', + 'id': 5555, + 'type': 'example', + 'description': 'ABCCDEFG', + }, + ], + }, + ], +}; + class ExampleRepository { - List? getCategories() { - return const [ - CategoryModel('Side Inputs', [ - ExampleModel( - { - SDK.java: javaHelloWorld, - SDK.go: goHelloWorld, - SDK.python: pythonHelloWorld, - SDK.scio: scioHelloWorld, - }, - 'HelloWorld', - ExampleType.example, - ), - ExampleModel( - { - SDK.java: 'JAVA Source code 1', - SDK.go: 'GO Source code 1', - SDK.python: 'PYTHON Source code 1', - SDK.scio: 'SCIO Source code 1', - }, - 'KATA Source code 1', - ExampleType.kata, - ), - ]), - CategoryModel('Side Outputs', [ - ExampleModel( - { - SDK.java: 'JAVA Source code 2', - SDK.go: 'GO Source code 2', - SDK.python: 'PYTHON Source code 2', - SDK.scio: 'SCIO Source code 2', - }, - 'UNIT TEST Source code 2', - ExampleType.test, - ), - ExampleModel( - { - SDK.java: 'JAVA Source code 3', - SDK.go: 'GO Source code 3', - SDK.python: 'PYTHON Source code 3', - SDK.scio: 'SCIO Source code 3', - }, - 'EXAMPLE Source code 3', - ExampleType.example, - ), - ]), - CategoryModel('I/O', [ - ExampleModel( - { - SDK.java: 'JAVA Source code 4', - SDK.go: 'GO Source code 4', - SDK.python: 'PYTHON Source code 4', - SDK.scio: 'SCIO Source code 4', - }, - 'KATA Source code 4', - ExampleType.kata, - ), - ExampleModel( - { - SDK.java: 'JAVA Source code 5', - SDK.go: 'GO Source code 5', - SDK.python: 'PYTHON Source code 5', - SDK.scio: 'SCIO Source code 5', - }, - 'UNIT TEST Source code 5', - ExampleType.test, - ), - ]), - ]; + Future>> getListOfExamples() async { + await Future.delayed(const Duration(seconds: 1)); + int responseStatusCode = 200; + Map> responseBody = getListOfExamplesResponse; + switch (responseStatusCode) { + case 200: + return parseGetListOfExamplesResponse(responseBody); + default: + return {}; + } + } + + Future getExampleSource(int id) async { + await Future.delayed(const Duration(milliseconds: 200)); + int responseStatusCode = 200; + switch (responseStatusCode) { + case 200: + return id.toString(); + default: + return ''; + } + } + + Map> parseGetListOfExamplesResponse(Map data) { + Map> output = {}; + for (SDK sdk in SDK.values) { + final sdkName = sdk.displayName.toLowerCase(); + if (data.containsKey(sdkName)) { + output[sdk] = data[sdkName] + .map((category) => CategoryModel.fromJson(category)) + .cast() + .toList(); + } + } + return output; } } diff --git a/playground/frontend/lib/pages/playground/components/playground_page_providers.dart b/playground/frontend/lib/pages/playground/components/playground_page_providers.dart index a367e1012aaf..1f26ce2fbb7e 100644 --- a/playground/frontend/lib/pages/playground/components/playground_page_providers.dart +++ b/playground/frontend/lib/pages/playground/components/playground_page_providers.dart @@ -48,12 +48,15 @@ class PlaygroundPageProviders extends StatelessWidget { if (playground == null) { return PlaygroundState(codeRepository: kCodeRepository); } - if ((exampleState.categories?.isNotEmpty ?? false) && + + final categories = exampleState.categoriesBySdkMap?[playground.sdk]; + if ((categories?.isNotEmpty ?? false) && playground.selectedExample == null) { + return PlaygroundState( codeRepository: kCodeRepository, sdk: playground.sdk, - selectedExample: exampleState.categories?.first.examples.first, + selectedExample: categories?.first.examples.first, ); } return playground; diff --git a/playground/frontend/lib/pages/playground/playground_page.dart b/playground/frontend/lib/pages/playground/playground_page.dart index fce65824c272..4dc8e34fce47 100644 --- a/playground/frontend/lib/pages/playground/playground_page.dart +++ b/playground/frontend/lib/pages/playground/playground_page.dart @@ -50,7 +50,6 @@ class PlaygroundPage extends StatelessWidget { return ExampleSelector( changeSelectorVisibility: state.changeSelectorVisibility, isSelectorOpened: state.isSelectorOpened, - categories: state.categories!, ); }, ), diff --git a/playground/frontend/lib/pages/playground/states/example_selector_state.dart b/playground/frontend/lib/pages/playground/states/example_selector_state.dart index c4718e33215d..a51673afdb20 100644 --- a/playground/frontend/lib/pages/playground/states/example_selector_state.dart +++ b/playground/frontend/lib/pages/playground/states/example_selector_state.dart @@ -19,17 +19,20 @@ import 'package:flutter/material.dart'; import 'package:playground/modules/examples/models/category_model.dart'; import 'package:playground/modules/examples/models/example_model.dart'; +import 'package:playground/pages/playground/states/playground_state.dart'; import 'examples_state.dart'; class ExampleSelectorState with ChangeNotifier { final ExampleState _exampleState; + final PlaygroundState _playgroundState; ExampleType _selectedFilterType; String _filterText; List categories; ExampleSelectorState( this._exampleState, + this._playgroundState, this.categories, [ this._selectedFilterType = ExampleType.all, this._filterText = '', @@ -55,10 +58,11 @@ class ExampleSelectorState with ChangeNotifier { } sortCategories() { - final categories = _exampleState.categories!; + final categories = _exampleState.getCategories(_playgroundState.sdk)!; final sortedCategories = categories .map((category) => CategoryModel( - category.name, _sortCategoryExamples(category.examples))) + name: category.name, + examples: _sortCategoryExamples(category.examples))) .where((category) => category.examples.isNotEmpty) .toList(); setCategories(sortedCategories); @@ -99,7 +103,7 @@ class ExampleSelectorState with ChangeNotifier { ) { return examples .where((example) => - example.name.toLowerCase().contains(name.toLowerCase())) + example.name!.toLowerCase().contains(name.toLowerCase())) .toList(); } } diff --git a/playground/frontend/lib/pages/playground/states/examples_state.dart b/playground/frontend/lib/pages/playground/states/examples_state.dart index 4e3641c1d3ab..0a5bb265477d 100644 --- a/playground/frontend/lib/pages/playground/states/examples_state.dart +++ b/playground/frontend/lib/pages/playground/states/examples_state.dart @@ -19,18 +19,28 @@ import 'package:flutter/material.dart'; import 'package:playground/modules/examples/models/category_model.dart'; import 'package:playground/modules/examples/repositories/example_repository.dart'; +import 'package:playground/modules/sdk/models/sdk.dart'; class ExampleState with ChangeNotifier { final ExampleRepository _exampleRepository; - List? categories; + Map>? categoriesBySdkMap; bool isSelectorOpened = false; ExampleState(this._exampleRepository) { _loadCategories(); } - _loadCategories() { - categories = _exampleRepository.getCategories() ?? []; + List? getCategories(SDK sdk) { + return categoriesBySdkMap?[sdk] ?? []; + } + + Future getSource(int id) async { + String source = await _exampleRepository.getExampleSource(id); + return source; + } + + _loadCategories() async { + categoriesBySdkMap = await _exampleRepository.getListOfExamples(); notifyListeners(); } diff --git a/playground/frontend/lib/pages/playground/states/playground_state.dart b/playground/frontend/lib/pages/playground/states/playground_state.dart index 4a0bbab7bf48..f03a9e9a432d 100644 --- a/playground/frontend/lib/pages/playground/states/playground_state.dart +++ b/playground/frontend/lib/pages/playground/states/playground_state.dart @@ -47,7 +47,7 @@ class PlaygroundState with ChangeNotifier { }) { _selectedExample = selectedExample; _sdk = sdk; - _source = _selectedExample?.sources[_sdk] ?? ""; + _source = _selectedExample?.source ?? ''; _codeRepository = codeRepository; } @@ -63,7 +63,7 @@ class PlaygroundState with ChangeNotifier { setExample(ExampleModel example) { _selectedExample = example; - _source = example.sources[_sdk] ?? ''; + _source = example.source ?? ''; notifyListeners(); } @@ -78,7 +78,7 @@ class PlaygroundState with ChangeNotifier { reset() { _sdk = SDK.java; - _source = _selectedExample?.sources[_sdk] ?? ""; + _source = _selectedExample?.source ?? ''; notifyListeners(); } diff --git a/playground/frontend/pubspec.lock b/playground/frontend/pubspec.lock index 4173b4ffe823..3707c48b525b 100644 --- a/playground/frontend/pubspec.lock +++ b/playground/frontend/pubspec.lock @@ -325,12 +325,19 @@ packages: source: hosted version: "0.6.3" json_annotation: - dependency: transitive + dependency: "direct main" description: name: json_annotation url: "https://pub.dartlang.org" source: hosted - version: "4.2.0" + version: "4.3.0" + json_serializable: + dependency: "direct dev" + description: + name: json_serializable + url: "https://pub.dartlang.org" + source: hosted + version: "6.0.1" linked_scroll_controller: dependency: transitive description: @@ -490,6 +497,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.1.1" + source_helper: + dependency: transitive + description: + name: source_helper + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0" source_span: dependency: transitive description: diff --git a/playground/frontend/pubspec.yaml b/playground/frontend/pubspec.yaml index 16d0210ecdc1..8a11e6a12b60 100644 --- a/playground/frontend/pubspec.yaml +++ b/playground/frontend/pubspec.yaml @@ -52,12 +52,14 @@ dependencies: url_launcher: ^6.0.12 expansion_widget: ^0.0.2 grpc: ^3.0.0 + json_annotation: ^4.3.0 dev_dependencies: flutter_test: sdk: flutter mockito: ^5.0.16 build_runner: ^2.1.4 + json_serializable: ^6.0.1 # The "flutter_lints" package below contains a set of recommended lints to # encourage good coding practices. The lint set provided by the package is From 52ad7ac057a5b05fa47aa3c5efa7260aa51daa4e Mon Sep 17 00:00:00 2001 From: Alexander Zhuravlev Date: Tue, 26 Oct 2021 20:06:44 +0300 Subject: [PATCH 12/32] [BEAM-13101] Added getPrecompiledOutputs method --- .../examples/models/category_model.dart | 3 +- .../examples/models/category_model.g.dart | 21 ++++++++++ .../examples/models/example_model.g.dart | 39 +++++++++++++++++++ .../examples/models/outputs_model.dart | 9 ++++- .../repositories/example_repository.dart | 27 ++++++++++++- .../playground/states/examples_state.dart | 6 +++ 6 files changed, 101 insertions(+), 4 deletions(-) create mode 100644 playground/frontend/lib/modules/examples/models/category_model.g.dart create mode 100644 playground/frontend/lib/modules/examples/models/example_model.g.dart diff --git a/playground/frontend/lib/modules/examples/models/category_model.dart b/playground/frontend/lib/modules/examples/models/category_model.dart index 5240e4868236..219c284abf8a 100644 --- a/playground/frontend/lib/modules/examples/models/category_model.dart +++ b/playground/frontend/lib/modules/examples/models/category_model.dart @@ -28,7 +28,8 @@ class CategoryModel { const CategoryModel({required this.name, required this.examples}); - factory CategoryModel.fromJson(Map data) => _$CategoryModelFromJson(data); + factory CategoryModel.fromJson(Map data) => + _$CategoryModelFromJson(data); Map toJson() => _$CategoryModelToJson(this); } diff --git a/playground/frontend/lib/modules/examples/models/category_model.g.dart b/playground/frontend/lib/modules/examples/models/category_model.g.dart new file mode 100644 index 000000000000..af4bbc3bee95 --- /dev/null +++ b/playground/frontend/lib/modules/examples/models/category_model.g.dart @@ -0,0 +1,21 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'category_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +CategoryModel _$CategoryModelFromJson(Map json) => + CategoryModel( + name: json['name'] as String, + examples: (json['examples'] as List) + .map((e) => ExampleModel.fromJson(e as Map)) + .toList(), + ); + +Map _$CategoryModelToJson(CategoryModel instance) => + { + 'name': instance.name, + 'examples': instance.examples.map((e) => e.toJson()).toList(), + }; diff --git a/playground/frontend/lib/modules/examples/models/example_model.g.dart b/playground/frontend/lib/modules/examples/models/example_model.g.dart new file mode 100644 index 000000000000..ecef22e84833 --- /dev/null +++ b/playground/frontend/lib/modules/examples/models/example_model.g.dart @@ -0,0 +1,39 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'example_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ExampleModel _$ExampleModelFromJson(Map json) => ExampleModel( + source: json['source'] as String?, + name: json['name'] as String?, + type: $enumDecodeNullable(_$ExampleTypeEnumMap, json['type']), + id: json['id'] as int?, + description: json['description'] as String?, + ); + +Map _$ExampleModelToJson(ExampleModel instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('type', _$ExampleTypeEnumMap[instance.type]); + writeNotNull('name', instance.name); + writeNotNull('id', instance.id); + writeNotNull('description', instance.description); + writeNotNull('source', instance.source); + return val; +} + +const _$ExampleTypeEnumMap = { + ExampleType.all: 'all', + ExampleType.example: 'example', + ExampleType.kata: 'kata', + ExampleType.test: 'test', +}; diff --git a/playground/frontend/lib/modules/examples/models/outputs_model.dart b/playground/frontend/lib/modules/examples/models/outputs_model.dart index 825bdb587475..78050e4cbb79 100644 --- a/playground/frontend/lib/modules/examples/models/outputs_model.dart +++ b/playground/frontend/lib/modules/examples/models/outputs_model.dart @@ -1,5 +1,7 @@ import 'package:json_annotation/json_annotation.dart'; +part 'outputs_model.g.dart'; + @JsonSerializable() class OutputsModel { final String output; @@ -7,4 +9,9 @@ class OutputsModel { final String log; OutputsModel(this.output, this.graph, this.log); -} \ No newline at end of file + + factory OutputsModel.fromJson(Map data) => + _$OutputsModelFromJson(data); + + Map toJson() => _$OutputsModelToJson(this); +} diff --git a/playground/frontend/lib/modules/examples/repositories/example_repository.dart b/playground/frontend/lib/modules/examples/repositories/example_repository.dart index 977b5d9c42f7..a978bc11a814 100644 --- a/playground/frontend/lib/modules/examples/repositories/example_repository.dart +++ b/playground/frontend/lib/modules/examples/repositories/example_repository.dart @@ -17,6 +17,7 @@ */ import 'package:playground/modules/examples/models/category_model.dart'; +import 'package:playground/modules/examples/models/outputs_model.dart'; import 'package:playground/modules/sdk/models/sdk.dart'; const javaHelloWorld = '''class HelloWorld { @@ -103,6 +104,12 @@ const getListOfExamplesResponse = { ], }; +const getPrecompiledOutputsResponse = { + 'output': 'precompiled output', + 'graph': 'precompiled graph', + 'log': 'precompiled log', +}; + class ExampleRepository { Future>> getListOfExamples() async { await Future.delayed(const Duration(seconds: 1)); @@ -110,7 +117,7 @@ class ExampleRepository { Map> responseBody = getListOfExamplesResponse; switch (responseStatusCode) { case 200: - return parseGetListOfExamplesResponse(responseBody); + return parseListOfExamplesResponse(responseBody); default: return {}; } @@ -127,7 +134,19 @@ class ExampleRepository { } } - Map> parseGetListOfExamplesResponse(Map data) { + Future getPrecompiledOutputs(int id) async { + await Future.delayed(const Duration(milliseconds: 200)); + int responseStatusCode = 200; + Map responseBody = getPrecompiledOutputsResponse; + switch (responseStatusCode) { + case 200: + return parsePrecompiledOutputs(responseBody); + default: + return OutputsModel('', '', ''); + } + } + + Map> parseListOfExamplesResponse(Map data) { Map> output = {}; for (SDK sdk in SDK.values) { final sdkName = sdk.displayName.toLowerCase(); @@ -140,4 +159,8 @@ class ExampleRepository { } return output; } + + OutputsModel parsePrecompiledOutputs(Map data) { + return OutputsModel.fromJson(data); + } } diff --git a/playground/frontend/lib/pages/playground/states/examples_state.dart b/playground/frontend/lib/pages/playground/states/examples_state.dart index 0a5bb265477d..b1f54bc0df3d 100644 --- a/playground/frontend/lib/pages/playground/states/examples_state.dart +++ b/playground/frontend/lib/pages/playground/states/examples_state.dart @@ -18,6 +18,7 @@ import 'package:flutter/material.dart'; import 'package:playground/modules/examples/models/category_model.dart'; +import 'package:playground/modules/examples/models/outputs_model.dart'; import 'package:playground/modules/examples/repositories/example_repository.dart'; import 'package:playground/modules/sdk/models/sdk.dart'; @@ -34,6 +35,11 @@ class ExampleState with ChangeNotifier { return categoriesBySdkMap?[sdk] ?? []; } + Future getPrecompiledOutputs(int id) async { + OutputsModel outputs = await _exampleRepository.getPrecompiledOutputs(id); + return outputs; + } + Future getSource(int id) async { String source = await _exampleRepository.getExampleSource(id); return source; From 2b1a45447590a444f1f88ec223b7f7fcc597571e Mon Sep 17 00:00:00 2001 From: Alexander Zhuravlev Date: Wed, 27 Oct 2021 14:38:10 +0300 Subject: [PATCH 13/32] [BEAM-13101]: Added default examples request, changed RunCode function to use precompiled Outputs --- .../example_list/expansion_panel_item.dart | 5 ++ .../examples/models/example_model.dart | 9 ++++ .../examples/models/example_model.g.dart | 4 ++ .../repositories/example_repository.dart | 49 +++++++++++++++-- .../modules/sdk/components/sdk_selector.dart | 54 +++++++++++-------- .../components/playground_page_providers.dart | 10 ++-- .../lib/pages/playground/playground_page.dart | 15 +++--- .../playground/states/examples_state.dart | 8 +++ .../playground/states/playground_state.dart | 29 ++++++---- 9 files changed, 136 insertions(+), 47 deletions(-) diff --git a/playground/frontend/lib/modules/examples/components/example_list/expansion_panel_item.dart b/playground/frontend/lib/modules/examples/components/example_list/expansion_panel_item.dart index 82b98722c495..4e6a2ff04c3f 100644 --- a/playground/frontend/lib/modules/examples/components/example_list/expansion_panel_item.dart +++ b/playground/frontend/lib/modules/examples/components/example_list/expansion_panel_item.dart @@ -19,6 +19,7 @@ import 'package:flutter/material.dart'; import 'package:playground/constants/sizes.dart'; import 'package:playground/modules/examples/models/example_model.dart'; +import 'package:playground/modules/examples/models/outputs_model.dart'; import 'package:playground/pages/playground/states/examples_state.dart'; import 'package:playground/pages/playground/states/playground_state.dart'; import 'package:provider/provider.dart'; @@ -39,6 +40,10 @@ class ExpansionPanelItem extends StatelessWidget { String source = await exampleState.getSource(example.id!); example.setSource(source); playgroundState.setExample(example); + Future outputs = exampleState + .getPrecompiledOutputs(example.id!) + .then((value) => example.setOutputs(value)); + print(outputs); } }, child: Container( diff --git a/playground/frontend/lib/modules/examples/models/example_model.dart b/playground/frontend/lib/modules/examples/models/example_model.dart index 093b8b6df08e..865c3ffce93e 100644 --- a/playground/frontend/lib/modules/examples/models/example_model.dart +++ b/playground/frontend/lib/modules/examples/models/example_model.dart @@ -17,6 +17,7 @@ */ import 'package:json_annotation/json_annotation.dart'; +import 'package:playground/modules/examples/models/outputs_model.dart'; part 'example_model.g.dart'; @@ -59,18 +60,26 @@ class ExampleModel { @JsonKey(includeIfNull: false) String? source; + @JsonKey(includeIfNull: false) + OutputsModel? outputs; + ExampleModel({ this.source, this.name, this.type, this.id, this.description, + this.outputs, }); setSource(String source) { this.source = source; } + setOutputs(OutputsModel outputs) { + this.outputs = outputs; + } + factory ExampleModel.fromJson(Map data) => _$ExampleModelFromJson(data); diff --git a/playground/frontend/lib/modules/examples/models/example_model.g.dart b/playground/frontend/lib/modules/examples/models/example_model.g.dart index ecef22e84833..923ba4b14402 100644 --- a/playground/frontend/lib/modules/examples/models/example_model.g.dart +++ b/playground/frontend/lib/modules/examples/models/example_model.g.dart @@ -12,6 +12,9 @@ ExampleModel _$ExampleModelFromJson(Map json) => ExampleModel( type: $enumDecodeNullable(_$ExampleTypeEnumMap, json['type']), id: json['id'] as int?, description: json['description'] as String?, + outputs: json['outputs'] == null + ? null + : OutputsModel.fromJson(json['outputs'] as Map), ); Map _$ExampleModelToJson(ExampleModel instance) { @@ -28,6 +31,7 @@ Map _$ExampleModelToJson(ExampleModel instance) { writeNotNull('id', instance.id); writeNotNull('description', instance.description); writeNotNull('source', instance.source); + writeNotNull('outputs', instance.outputs); return val; } diff --git a/playground/frontend/lib/modules/examples/repositories/example_repository.dart b/playground/frontend/lib/modules/examples/repositories/example_repository.dart index a978bc11a814..2b974177cbd2 100644 --- a/playground/frontend/lib/modules/examples/repositories/example_repository.dart +++ b/playground/frontend/lib/modules/examples/repositories/example_repository.dart @@ -17,6 +17,7 @@ */ import 'package:playground/modules/examples/models/category_model.dart'; +import 'package:playground/modules/examples/models/example_model.dart'; import 'package:playground/modules/examples/models/outputs_model.dart'; import 'package:playground/modules/sdk/models/sdk.dart'; @@ -110,10 +111,42 @@ const getPrecompiledOutputsResponse = { 'log': 'precompiled log', }; +final getDefaultExamplesResponse = { + SDK.java: ExampleModel( + source: javaHelloWorld, + name: 'Default Java', + type: ExampleType.example, + id: 1, + description: 'ABCDEFG', + ), + SDK.python: ExampleModel( + source: pythonHelloWorld, + name: 'Default Python', + type: ExampleType.example, + id: 2, + description: 'ABCDEFG', + ), + SDK.go: ExampleModel( + source: goHelloWorld, + name: 'Default Go', + type: ExampleType.example, + id: 3, + description: 'ABCDEFG', + ), + SDK.scio: ExampleModel( + source: scioHelloWorld, + name: 'Default SCIO', + type: ExampleType.example, + id: 4, + description: 'ABCDEFG', + ), +}; + +const responseStatusCode = 200; + class ExampleRepository { Future>> getListOfExamples() async { await Future.delayed(const Duration(seconds: 1)); - int responseStatusCode = 200; Map> responseBody = getListOfExamplesResponse; switch (responseStatusCode) { case 200: @@ -123,9 +156,18 @@ class ExampleRepository { } } + Future> getDefaultExamples() async { + await Future.delayed(const Duration(seconds: 1)); + switch (responseStatusCode) { + case 200: + return getDefaultExamplesResponse; + default: + return {}; + } + } + Future getExampleSource(int id) async { await Future.delayed(const Duration(milliseconds: 200)); - int responseStatusCode = 200; switch (responseStatusCode) { case 200: return id.toString(); @@ -135,8 +177,7 @@ class ExampleRepository { } Future getPrecompiledOutputs(int id) async { - await Future.delayed(const Duration(milliseconds: 200)); - int responseStatusCode = 200; + await Future.delayed(const Duration(seconds: 5)); Map responseBody = getPrecompiledOutputsResponse; switch (responseStatusCode) { case 200: diff --git a/playground/frontend/lib/modules/sdk/components/sdk_selector.dart b/playground/frontend/lib/modules/sdk/components/sdk_selector.dart index 10b887afb424..674672368582 100644 --- a/playground/frontend/lib/modules/sdk/components/sdk_selector.dart +++ b/playground/frontend/lib/modules/sdk/components/sdk_selector.dart @@ -19,16 +19,25 @@ import 'package:flutter/material.dart'; import 'package:playground/config/theme.dart'; import 'package:playground/constants/sizes.dart'; +import 'package:playground/modules/examples/models/example_model.dart'; import 'package:playground/modules/sdk/models/sdk.dart'; +import 'package:playground/pages/playground/states/examples_state.dart'; +import 'package:provider/provider.dart'; typedef SetSdk = void Function(SDK sdk); +typedef SetExample = void Function(ExampleModel example); class SDKSelector extends StatelessWidget { final SDK sdk; final SetSdk setSdk; + final SetExample setExample; - const SDKSelector({Key? key, required this.sdk, required this.setSdk}) - : super(key: key); + const SDKSelector({ + Key? key, + required this.sdk, + required this.setSdk, + required this.setExample, + }) : super(key: key); @override Widget build(BuildContext context) { @@ -41,25 +50,28 @@ class SDKSelector extends StatelessWidget { color: ThemeColors.of(context).greyColor, borderRadius: BorderRadius.circular(kLgBorderRadius), ), - child: DropdownButtonHideUnderline( - child: DropdownButton( - value: sdk, - icon: const Icon(Icons.keyboard_arrow_down), - iconSize: kIconSizeMd, - elevation: kElevation, - borderRadius: BorderRadius.circular(kLgBorderRadius), - alignment: Alignment.bottomCenter, - onChanged: (SDK? newSdk) { - if (newSdk != null) { - setSdk(newSdk); - } - }, - items: SDK.values.map>((SDK value) { - return DropdownMenuItem( - value: value, - child: Text(value.displayName), - ); - }).toList(), + child: Consumer( + builder: (context, state, child) => DropdownButtonHideUnderline( + child: DropdownButton( + value: sdk, + icon: const Icon(Icons.keyboard_arrow_down), + iconSize: kIconSizeMd, + elevation: kElevation, + borderRadius: BorderRadius.circular(kLgBorderRadius), + alignment: Alignment.bottomCenter, + onChanged: (SDK? newSdk) { + if (newSdk != null) { + setSdk(newSdk); + setExample(state.defaultExamples![newSdk]!); + } + }, + items: SDK.values.map>((SDK value) { + return DropdownMenuItem( + value: value, + child: Text(value.displayName), + ); + }).toList(), + ), ), ), ); diff --git a/playground/frontend/lib/pages/playground/components/playground_page_providers.dart b/playground/frontend/lib/pages/playground/components/playground_page_providers.dart index 1f26ce2fbb7e..2342f90f8a16 100644 --- a/playground/frontend/lib/pages/playground/components/playground_page_providers.dart +++ b/playground/frontend/lib/pages/playground/components/playground_page_providers.dart @@ -19,11 +19,11 @@ import 'package:flutter/material.dart'; import 'package:playground/modules/editor/repository/code_repository/code_client/grpc_code_client.dart'; import 'package:playground/modules/editor/repository/code_repository/code_repository.dart'; -import 'package:playground/modules/output/models/output_placement_state.dart'; -import 'package:provider/provider.dart'; import 'package:playground/modules/examples/repositories/example_repository.dart'; +import 'package:playground/modules/output/models/output_placement_state.dart'; import 'package:playground/pages/playground/states/examples_state.dart'; import 'package:playground/pages/playground/states/playground_state.dart'; +import 'package:provider/provider.dart'; final CodeRepository kCodeRepository = CodeRepository(GrpcCodeClient()); @@ -49,14 +49,12 @@ class PlaygroundPageProviders extends StatelessWidget { return PlaygroundState(codeRepository: kCodeRepository); } - final categories = exampleState.categoriesBySdkMap?[playground.sdk]; - if ((categories?.isNotEmpty ?? false) && + if (exampleState.defaultExamples != null && playground.selectedExample == null) { - return PlaygroundState( codeRepository: kCodeRepository, sdk: playground.sdk, - selectedExample: categories?.first.examples.first, + selectedExample: exampleState.defaultExamples![playground.sdk], ); } return playground; diff --git a/playground/frontend/lib/pages/playground/playground_page.dart b/playground/frontend/lib/pages/playground/playground_page.dart index ded7916f349c..f5250deab363 100644 --- a/playground/frontend/lib/pages/playground/playground_page.dart +++ b/playground/frontend/lib/pages/playground/playground_page.dart @@ -20,14 +20,12 @@ import 'package:flutter/material.dart'; import 'package:playground/components/logo/logo_component.dart'; import 'package:playground/components/toggle_theme_button/toggle_theme_button.dart'; import 'package:playground/constants/sizes.dart'; -import 'package:playground/modules/shortcuts/components/shortcuts_manager.dart'; -import 'package:playground/modules/shortcuts/constants/global_shortcuts.dart'; -import 'package:playground/pages/playground/components/playground_page_body.dart'; -import 'package:playground/pages/playground/components/playground_page_footer.dart'; import 'package:playground/modules/actions/components/new_example_action.dart'; import 'package:playground/modules/actions/components/reset_action.dart'; import 'package:playground/modules/examples/example_selector.dart'; import 'package:playground/modules/sdk/components/sdk_selector.dart'; +import 'package:playground/modules/shortcuts/components/shortcuts_manager.dart'; +import 'package:playground/modules/shortcuts/constants/global_shortcuts.dart'; import 'package:playground/pages/playground/components/more_actions.dart'; import 'package:playground/pages/playground/components/playground_page_body.dart'; import 'package:playground/pages/playground/components/playground_page_footer.dart'; @@ -54,12 +52,17 @@ class PlaygroundPage extends StatelessWidget { Consumer( builder: (context, state, child) { return ExampleSelector( - changeSelectorVisibility: state.changeSelectorVisibility, + changeSelectorVisibility: + state.changeSelectorVisibility, isSelectorOpened: state.isSelectorOpened, ); }, ), - SDKSelector(sdk: state.sdk, setSdk: state.setSdk), + SDKSelector( + sdk: state.sdk, + setSdk: state.setSdk, + setExample: state.setExample, + ), const NewExampleAction(), ResetAction(reset: state.reset), ], diff --git a/playground/frontend/lib/pages/playground/states/examples_state.dart b/playground/frontend/lib/pages/playground/states/examples_state.dart index b1f54bc0df3d..a8c0b8e903f5 100644 --- a/playground/frontend/lib/pages/playground/states/examples_state.dart +++ b/playground/frontend/lib/pages/playground/states/examples_state.dart @@ -18,6 +18,7 @@ import 'package:flutter/material.dart'; import 'package:playground/modules/examples/models/category_model.dart'; +import 'package:playground/modules/examples/models/example_model.dart'; import 'package:playground/modules/examples/models/outputs_model.dart'; import 'package:playground/modules/examples/repositories/example_repository.dart'; import 'package:playground/modules/sdk/models/sdk.dart'; @@ -25,10 +26,12 @@ import 'package:playground/modules/sdk/models/sdk.dart'; class ExampleState with ChangeNotifier { final ExampleRepository _exampleRepository; Map>? categoriesBySdkMap; + Map? defaultExamples; bool isSelectorOpened = false; ExampleState(this._exampleRepository) { _loadCategories(); + _loadDefaultExamples(); } List? getCategories(SDK sdk) { @@ -50,6 +53,11 @@ class ExampleState with ChangeNotifier { notifyListeners(); } + _loadDefaultExamples() async { + defaultExamples = await _exampleRepository.getDefaultExamples(); + notifyListeners(); + } + changeSelectorVisibility() { isSelectorOpened = !isSelectorOpened; notifyListeners(); diff --git a/playground/frontend/lib/pages/playground/states/playground_state.dart b/playground/frontend/lib/pages/playground/states/playground_state.dart index 5e0a924e2bee..b751fa918577 100644 --- a/playground/frontend/lib/pages/playground/states/playground_state.dart +++ b/playground/frontend/lib/pages/playground/states/playground_state.dart @@ -35,11 +35,6 @@ class PlaygroundState with ChangeNotifier { String _source = ''; RunCodeResult? _result; - String get examplesTitle { - final name = _selectedExample?.name ?? ''; - return name.substring(0, min(kTitleLength, name.length)); - } - PlaygroundState({ SDK sdk = SDK.java, ExampleModel? selectedExample, @@ -51,6 +46,11 @@ class PlaygroundState with ChangeNotifier { _codeRepository = codeRepository; } + String get examplesTitle { + final name = _selectedExample?.name ?? kTitle; + return name.substring(0, min(kTitleLength, name.length)); + } + ExampleModel? get selectedExample => _selectedExample; SDK get sdk => _sdk; @@ -96,11 +96,20 @@ class PlaygroundState with ChangeNotifier { } void runCode() { - _codeRepository - ?.runCode(RunCodeRequestWrapper(code: source, sdk: sdk)) - .listen((event) { - _result = event; + if (_selectedExample?.source == source && + _selectedExample?.outputs != null) { + _result = RunCodeResult( + status: RunCodeStatus.finished, + output: _selectedExample!.outputs?.output ?? 'anti-precompiled output', + ); notifyListeners(); - }); + } else { + _codeRepository + ?.runCode(RunCodeRequestWrapper(code: source, sdk: sdk)) + .listen((event) { + _result = event; + notifyListeners(); + }); + } } } From 54a6ea31aa7e20dc60116c53cfbd5a1bd0201152 Mon Sep 17 00:00:00 2001 From: Alexander Zhuravlev Date: Wed, 27 Oct 2021 15:11:16 +0300 Subject: [PATCH 14/32] [BEAM-13101]: Fixed use of precompiledOutputs --- .../components/example_list/expansion_panel_item.dart | 8 +++----- .../modules/examples/repositories/example_repository.dart | 2 +- .../playground/components/playground_page_providers.dart | 7 +++++++ 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/playground/frontend/lib/modules/examples/components/example_list/expansion_panel_item.dart b/playground/frontend/lib/modules/examples/components/example_list/expansion_panel_item.dart index 4e6a2ff04c3f..1fe5da59c5c5 100644 --- a/playground/frontend/lib/modules/examples/components/example_list/expansion_panel_item.dart +++ b/playground/frontend/lib/modules/examples/components/example_list/expansion_panel_item.dart @@ -19,7 +19,6 @@ import 'package:flutter/material.dart'; import 'package:playground/constants/sizes.dart'; import 'package:playground/modules/examples/models/example_model.dart'; -import 'package:playground/modules/examples/models/outputs_model.dart'; import 'package:playground/pages/playground/states/examples_state.dart'; import 'package:playground/pages/playground/states/playground_state.dart'; import 'package:provider/provider.dart'; @@ -40,10 +39,9 @@ class ExpansionPanelItem extends StatelessWidget { String source = await exampleState.getSource(example.id!); example.setSource(source); playgroundState.setExample(example); - Future outputs = exampleState - .getPrecompiledOutputs(example.id!) - .then((value) => example.setOutputs(value)); - print(outputs); + exampleState.getPrecompiledOutputs(example.id!).then((value) { + example.setOutputs(value); + }); } }, child: Container( diff --git a/playground/frontend/lib/modules/examples/repositories/example_repository.dart b/playground/frontend/lib/modules/examples/repositories/example_repository.dart index 2b974177cbd2..a83ee11c9f31 100644 --- a/playground/frontend/lib/modules/examples/repositories/example_repository.dart +++ b/playground/frontend/lib/modules/examples/repositories/example_repository.dart @@ -177,7 +177,7 @@ class ExampleRepository { } Future getPrecompiledOutputs(int id) async { - await Future.delayed(const Duration(seconds: 5)); + await Future.delayed(const Duration(seconds: 1)); Map responseBody = getPrecompiledOutputsResponse; switch (responseStatusCode) { case 200: diff --git a/playground/frontend/lib/pages/playground/components/playground_page_providers.dart b/playground/frontend/lib/pages/playground/components/playground_page_providers.dart index 2342f90f8a16..9e6431743a8e 100644 --- a/playground/frontend/lib/pages/playground/components/playground_page_providers.dart +++ b/playground/frontend/lib/pages/playground/components/playground_page_providers.dart @@ -51,6 +51,13 @@ class PlaygroundPageProviders extends StatelessWidget { if (exampleState.defaultExamples != null && playground.selectedExample == null) { + final defaultExample = + exampleState.defaultExamples![playground.sdk]; + exampleState + .getPrecompiledOutputs(defaultExample!.id!) + .then((value) { + defaultExample.setOutputs(value); + }); return PlaygroundState( codeRepository: kCodeRepository, sdk: playground.sdk, From a25cfbad14df3a907b9b2ff134da48908ca4ec9f Mon Sep 17 00:00:00 2001 From: Alexander Zhuravlev Date: Wed, 27 Oct 2021 15:54:38 +0300 Subject: [PATCH 15/32] [BEAM-13101]: Auto-formatted files, fixed unit tests --- playground/frontend/lib/constants/assets.dart | 16 +- .../components/new_example_action.dart | 4 +- .../actions/components/reset_action.dart | 2 +- .../modules/editor/components/run_button.dart | 2 +- .../category_expansion_panel.dart | 1 + .../output/components/output_area.dart | 6 +- .../components/editor_textarea_wrapper.dart | 6 +- .../playground/components/more_actions.dart | 21 ++- .../components/playground_page_footer.dart | 6 +- .../code_repository/code_repository_test.dart | 10 +- .../states/example_selector_state_test.dart | 36 +++-- .../states/mocks/categories_mock.dart | 143 ++---------------- .../playground/states/mocks/example_mock.dart | 25 ++- .../states/playground_state_test.dart | 12 +- 14 files changed, 84 insertions(+), 206 deletions(-) diff --git a/playground/frontend/lib/constants/assets.dart b/playground/frontend/lib/constants/assets.dart index d72211de2378..87364525d4e8 100644 --- a/playground/frontend/lib/constants/assets.dart +++ b/playground/frontend/lib/constants/assets.dart @@ -16,11 +16,11 @@ * limitations under the License. */ -const kThemeIconAsset = "theme.svg"; -const kResetIconAsset = "reset.svg"; -const kOutputBottomIconAsset = "output_bottom.svg"; -const kOutputRightIconAsset = "output_right.svg"; -const kOutputLeftIconAsset = "output_left.svg"; -const kShortcutsIconAsset = "shortcuts.svg"; -const kGithubIconAsset = "github.svg"; -const kBeamIconAsset = "beam.png"; +const kThemeIconAsset = 'theme.svg'; +const kResetIconAsset = 'reset.svg'; +const kOutputBottomIconAsset = 'output_bottom.svg'; +const kOutputRightIconAsset = 'output_right.svg'; +const kOutputLeftIconAsset = 'output_left.svg'; +const kShortcutsIconAsset = 'shortcuts.svg'; +const kGithubIconAsset = 'github.svg'; +const kBeamIconAsset = 'beam.png'; diff --git a/playground/frontend/lib/modules/actions/components/new_example_action.dart b/playground/frontend/lib/modules/actions/components/new_example_action.dart index 9ead009f1997..c031f1199b53 100644 --- a/playground/frontend/lib/modules/actions/components/new_example_action.dart +++ b/playground/frontend/lib/modules/actions/components/new_example_action.dart @@ -21,7 +21,7 @@ import 'package:flutter/material.dart'; import 'package:playground/config/theme.dart'; import 'package:playground/modules/actions/components/header_icon_button.dart'; -const kNewExampleButtonText = "New Example"; +const kNewExampleButtonText = 'New Example'; class NewExampleAction extends StatelessWidget { const NewExampleAction({Key? key}) : super(key: key); @@ -34,7 +34,7 @@ class NewExampleAction extends StatelessWidget { color: ThemeColors.of(context).grey1Color, ), label: kNewExampleButtonText, - onPressed: () => launch("/"), + onPressed: () => launch('/'), ); } } diff --git a/playground/frontend/lib/modules/actions/components/reset_action.dart b/playground/frontend/lib/modules/actions/components/reset_action.dart index aa29ce011884..52491dac1f17 100644 --- a/playground/frontend/lib/modules/actions/components/reset_action.dart +++ b/playground/frontend/lib/modules/actions/components/reset_action.dart @@ -22,7 +22,7 @@ import 'package:playground/config/theme.dart'; import 'package:playground/constants/assets.dart'; import 'package:playground/modules/actions/components/header_icon_button.dart'; -const kResetButtonText = "Reset"; +const kResetButtonText = 'Reset'; class ResetAction extends StatelessWidget { final VoidCallback reset; diff --git a/playground/frontend/lib/modules/editor/components/run_button.dart b/playground/frontend/lib/modules/editor/components/run_button.dart index 2d271fc8d7cc..37557a7c91f0 100644 --- a/playground/frontend/lib/modules/editor/components/run_button.dart +++ b/playground/frontend/lib/modules/editor/components/run_button.dart @@ -19,7 +19,7 @@ import 'package:flutter/material.dart'; import 'package:playground/constants/sizes.dart'; -const kRunText = "Run"; +const kRunText = 'Run'; class RunButton extends StatelessWidget { final bool isRunning; diff --git a/playground/frontend/lib/modules/examples/components/example_list/category_expansion_panel.dart b/playground/frontend/lib/modules/examples/components/example_list/category_expansion_panel.dart index 441fd9cf961c..f5e51a553a21 100644 --- a/playground/frontend/lib/modules/examples/components/example_list/category_expansion_panel.dart +++ b/playground/frontend/lib/modules/examples/components/example_list/category_expansion_panel.dart @@ -15,6 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import 'dart:math' as math; import 'package:expansion_widget/expansion_widget.dart'; diff --git a/playground/frontend/lib/modules/output/components/output_area.dart b/playground/frontend/lib/modules/output/components/output_area.dart index 621d7ba6beb7..18b932e7841d 100644 --- a/playground/frontend/lib/modules/output/components/output_area.dart +++ b/playground/frontend/lib/modules/output/components/output_area.dart @@ -21,8 +21,8 @@ import 'package:playground/constants/sizes.dart'; import 'package:playground/pages/playground/states/playground_state.dart'; import 'package:provider/provider.dart'; -const kLogText = "Log"; -const kGraphText = "Graph"; +const kLogText = 'Log'; +const kGraphText = 'Graph'; class OutputArea extends StatelessWidget { const OutputArea({Key? key}) : super(key: key); @@ -37,7 +37,7 @@ class OutputArea extends StatelessWidget { children: [ Padding( padding: const EdgeInsets.all(kLgSpacing), - child: Text(state.result?.output ?? ""), + child: Text(state.result?.output ?? ''), ), const Center(child: Text(kLogText)), const Center(child: Text(kGraphText)), diff --git a/playground/frontend/lib/pages/playground/components/editor_textarea_wrapper.dart b/playground/frontend/lib/pages/playground/components/editor_textarea_wrapper.dart index 4906f2a662a0..b3448ffb2a45 100644 --- a/playground/frontend/lib/pages/playground/components/editor_textarea_wrapper.dart +++ b/playground/frontend/lib/pages/playground/components/editor_textarea_wrapper.dart @@ -18,12 +18,12 @@ import 'package:flutter/material.dart'; import 'package:playground/constants/sizes.dart'; +import 'package:playground/modules/editor/components/editor_textarea.dart'; import 'package:playground/modules/editor/components/run_button.dart'; import 'package:playground/modules/examples/models/example_model.dart'; import 'package:playground/modules/sdk/models/sdk.dart'; -import 'package:provider/provider.dart'; -import 'package:playground/modules/editor/components/editor_textarea.dart'; import 'package:playground/pages/playground/states/playground_state.dart'; +import 'package:provider/provider.dart'; class CodeTextAreaWrapper extends StatelessWidget { const CodeTextAreaWrapper({Key? key}) : super(key: key); @@ -63,7 +63,7 @@ class CodeTextAreaWrapper extends StatelessWidget { _handleError(BuildContext context, PlaygroundState state) { ScaffoldMessenger.of(context).showSnackBar( - SnackBar(content: Text(state.result?.errorMessage ?? "")), + SnackBar(content: Text(state.result?.errorMessage ?? '')), ); state.resetError(); } diff --git a/playground/frontend/lib/pages/playground/components/more_actions.dart b/playground/frontend/lib/pages/playground/components/more_actions.dart index 23ee0bfebd36..5d5703afaa5b 100644 --- a/playground/frontend/lib/pages/playground/components/more_actions.dart +++ b/playground/frontend/lib/pages/playground/components/more_actions.dart @@ -18,7 +18,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; - import 'package:playground/config/theme.dart'; import 'package:playground/constants/assets.dart'; import 'package:playground/modules/shortcuts/components/shortcuts_modal.dart'; @@ -33,23 +32,23 @@ enum HeaderAction { aboutBeam, } -const kShortcutsText = "Shortcuts"; +const kShortcutsText = 'Shortcuts'; -const kBeamPlaygroundGithubText = "Beam Playground on GitHub"; +const kBeamPlaygroundGithubText = 'Beam Playground on GitHub'; const kBeamPlaygroundGithubLink = - "https://github.com/apache/beam/tree/master/playground/frontend"; + 'https://github.com/apache/beam/tree/master/playground/frontend'; -const kApacheBeamGithubText = "Apache Beam on GitHub"; +const kApacheBeamGithubText = 'Apache Beam on GitHub'; const kApacheBeamGithubLink = - "https://github.com/apache/beam/tree/master/playground/frontend"; + 'https://github.com/apache/beam/tree/master/playground/frontend'; -const kScioGithubText = "SCIO on GitHub"; -const kScioGithubLink = "https://github.com/spotify/scio"; +const kScioGithubText = 'SCIO on GitHub'; +const kScioGithubLink = 'https://github.com/spotify/scio'; -const kBeamWebsiteText = "To Apache Beam website"; -const kBeamWebsiteLink = "https://beam.apache.org/"; +const kBeamWebsiteText = 'To Apache Beam website'; +const kBeamWebsiteLink = 'https://beam.apache.org/'; -const kAboutBeamText = "About Apache Beam"; +const kAboutBeamText = 'About Apache Beam'; class MoreActions extends StatefulWidget { const MoreActions({Key? key}) : super(key: key); diff --git a/playground/frontend/lib/pages/playground/components/playground_page_footer.dart b/playground/frontend/lib/pages/playground/components/playground_page_footer.dart index c40121d19e79..761d56505104 100644 --- a/playground/frontend/lib/pages/playground/components/playground_page_footer.dart +++ b/playground/frontend/lib/pages/playground/components/playground_page_footer.dart @@ -21,9 +21,9 @@ import 'package:playground/config/theme.dart'; import 'package:playground/constants/font_weight.dart'; import 'package:playground/constants/sizes.dart'; -const kSendFeedbackText = "Send Feedback"; -const kPrivacyPolicyText = "Privacy Policy"; -const kCopyright = "© The Apache Software Foundation"; +const kSendFeedbackText = 'Send Feedback'; +const kPrivacyPolicyText = 'Privacy Policy'; +const kCopyright = '© The Apache Software Foundation'; class PlaygroundPageFooter extends StatelessWidget { const PlaygroundPageFooter({Key? key}) : super(key: key); diff --git a/playground/frontend/test/modules/editor/repository/code_repository/code_repository_test.dart b/playground/frontend/test/modules/editor/repository/code_repository/code_repository_test.dart index 314e6cddb215..c8c42d795aea 100644 --- a/playground/frontend/test/modules/editor/repository/code_repository/code_repository_test.dart +++ b/playground/frontend/test/modules/editor/repository/code_repository/code_repository_test.dart @@ -18,6 +18,7 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/annotations.dart'; +import 'package:mockito/mockito.dart'; import 'package:playground/modules/editor/repository/code_repository/code_client/check_status_response.dart'; import 'package:playground/modules/editor/repository/code_repository/code_client/code_client.dart'; import 'package:playground/modules/editor/repository/code_repository/code_client/output_response.dart'; @@ -26,7 +27,6 @@ import 'package:playground/modules/editor/repository/code_repository/code_reposi import 'package:playground/modules/editor/repository/code_repository/run_code_request.dart'; import 'package:playground/modules/editor/repository/code_repository/run_code_result.dart'; import 'package:playground/modules/sdk/models/sdk.dart'; -import 'package:mockito/mockito.dart'; import 'code_repository_test.mocks.dart'; @@ -35,16 +35,16 @@ final kRequestMock = RunCodeRequestWrapper( sdk: SDK.java, ); -const kPipelineUuid = "1234"; -const kRunOutput = "RunOutput"; -const kCompileOutput = "CompileOutput"; +const kPipelineUuid = '1234'; +const kRunOutput = 'RunOutput'; +const kCompileOutput = 'CompileOutput'; final kRunCodeResponse = RunCodeResponse(kPipelineUuid); final kFinishedStatusResponse = CheckStatusResponse(RunCodeStatus.finished); final kErrorStatusResponse = CheckStatusResponse(RunCodeStatus.error); final kRunOutputResponse = OutputResponse(kRunOutput); final kCompileOutputResponse = OutputResponse(kCompileOutput); -final kEmptyCompileOutputResponse = OutputResponse(""); +final kEmptyCompileOutputResponse = OutputResponse(''); @GenerateMocks([CodeClient]) void main() { diff --git a/playground/frontend/test/pages/playground/states/example_selector_state_test.dart b/playground/frontend/test/pages/playground/states/example_selector_state_test.dart index ddedf50e1dc4..1b00ab6c153a 100644 --- a/playground/frontend/test/pages/playground/states/example_selector_state_test.dart +++ b/playground/frontend/test/pages/playground/states/example_selector_state_test.dart @@ -21,15 +21,18 @@ import 'package:playground/modules/examples/models/example_model.dart'; import 'package:playground/modules/examples/repositories/example_repository.dart'; import 'package:playground/pages/playground/states/example_selector_state.dart'; import 'package:playground/pages/playground/states/examples_state.dart'; +import 'package:playground/pages/playground/states/playground_state.dart'; import 'mocks/categories_mock.dart'; +final playgroundState = PlaygroundState(); + void main() { test( 'ExampleSelector state should notify all listeners about filter type change', () { final exampleState = ExampleState(ExampleRepository()); - final state = ExampleSelectorState(exampleState, []); + final state = ExampleSelectorState(exampleState, playgroundState, []); state.addListener(() { expect(state.selectedFilterType, ExampleType.example); }); @@ -40,7 +43,7 @@ void main() { 'ExampleSelector state should notify all listeners about categories change', () { final exampleState = ExampleState(ExampleRepository()); - final state = ExampleSelectorState(exampleState, []); + final state = ExampleSelectorState(exampleState, playgroundState, []); state.addListener(() { expect(state.categories, []); }); @@ -51,19 +54,16 @@ void main() { 'ExampleSelector state sortCategories should:' '- update categories and notify all listeners,' 'but should NOT:' - '- wait for full name of example,' - '- be sensitive for register,' '- affect Example state categories', () { final exampleState = ExampleState(ExampleRepository()); final state = ExampleSelectorState( exampleState, - exampleState.categories!, - ExampleType.example, - 'hEl', + playgroundState, + [], ); state.addListener(() { - expect(state.categories, sortedCategories); - expect(exampleState.categories, exampleState.categories); + expect(state.categories, []); + expect(exampleState.categoriesBySdkMap, exampleState.categoriesBySdkMap); }); state.sortCategories(); }); @@ -75,10 +75,14 @@ void main() { 'but should NOT:' '- affect Example state categories', () { final exampleState = ExampleState(ExampleRepository()); - final state = ExampleSelectorState(exampleState, exampleState.categories!); + final state = ExampleSelectorState( + exampleState, + playgroundState, + categoriesMock, + ); state.addListener(() { expect(state.categories, examplesSortedByTypeMock); - expect(exampleState.categories, exampleState.categories); + expect(exampleState.categoriesBySdkMap, exampleState.categoriesBySdkMap); }); state.sortExamplesByType(unsortedExamples, ExampleType.kata); }); @@ -92,11 +96,15 @@ void main() { '- be sensitive for register,' '- affect Example state categories', () { final exampleState = ExampleState(ExampleRepository()); - final state = ExampleSelectorState(exampleState, exampleState.categories!); + final state = ExampleSelectorState( + exampleState, + playgroundState, + categoriesMock, + ); state.addListener(() { expect(state.categories, examplesSortedByNameMock); - expect(exampleState.categories, exampleState.categories); + expect(exampleState.categoriesBySdkMap, exampleState.categoriesBySdkMap); }); - state.sortExamplesByName(unsortedExamples, 'eLLoWoRl'); + state.sortExamplesByName(unsortedExamples, 'X1'); }); } diff --git a/playground/frontend/test/pages/playground/states/mocks/categories_mock.dart b/playground/frontend/test/pages/playground/states/mocks/categories_mock.dart index f3a5b3456cd6..ee86cabf5037 100644 --- a/playground/frontend/test/pages/playground/states/mocks/categories_mock.dart +++ b/playground/frontend/test/pages/playground/states/mocks/categories_mock.dart @@ -18,143 +18,20 @@ import 'package:playground/modules/examples/models/category_model.dart'; import 'package:playground/modules/examples/models/example_model.dart'; -import 'package:playground/modules/sdk/models/sdk.dart'; -const javaHelloWorld = '''class HelloWorld { - public static void main(String[] args) { - System.out.println("Hello World!"); - } -}'''; +import 'example_mock.dart'; -const pythonHelloWorld = 'print(‘Hello World’)'; - -const goHelloWorld = '''package main - -import "fmt" - -// this is a comment - -func main() { - fmt.Println("Hello World") -}'''; - -const scioHelloWorld = ''' -object Hello { - def main(args: Array[String]) = { - println("Hello, world") - } -}'''; - -const List sortedCategories = [ - CategoryModel('Side Inputs', [ - ExampleModel( - { - SDK.java: javaHelloWorld, - SDK.go: goHelloWorld, - SDK.python: pythonHelloWorld, - SDK.scio: scioHelloWorld, - }, - 'HelloWorld', - ExampleType.example, - ), - ]) +final categoriesMock = [ + CategoryModel(name: 'Sorted', examples: [exampleMock1]), + CategoryModel(name: 'Unsorted', examples: [exampleMock2]), ]; -const List unsortedExamples = [ - ExampleModel( - { - SDK.java: javaHelloWorld, - SDK.go: goHelloWorld, - SDK.python: pythonHelloWorld, - SDK.scio: scioHelloWorld, - }, - 'HelloWorld', - ExampleType.example, - ), - ExampleModel( - { - SDK.java: 'JAVA Source code 1', - SDK.go: 'GO Source code 1', - SDK.python: 'PYTHON Source code 1', - SDK.scio: 'SCIO Source code 1', - }, - 'KATA Source code 1', - ExampleType.kata, - ), - ExampleModel( - { - SDK.java: 'JAVA Source code 2', - SDK.go: 'GO Source code 2', - SDK.python: 'PYTHON Source code 2', - SDK.scio: 'SCIO Source code 2', - }, - 'UNIT TEST Source code 2', - ExampleType.test, - ), - ExampleModel( - { - SDK.java: 'JAVA Source code 3', - SDK.go: 'GO Source code 3', - SDK.python: 'PYTHON Source code 3', - SDK.scio: 'SCIO Source code 3', - }, - 'EXAMPLE Source code 3', - ExampleType.example, - ), - ExampleModel( - { - SDK.java: 'JAVA Source code 4', - SDK.go: 'GO Source code 4', - SDK.python: 'PYTHON Source code 4', - SDK.scio: 'SCIO Source code 4', - }, - 'KATA Source code 4', - ExampleType.kata, - ), - ExampleModel( - { - SDK.java: 'JAVA Source code 5', - SDK.go: 'GO Source code 5', - SDK.python: 'PYTHON Source code 5', - SDK.scio: 'SCIO Source code 5', - }, - 'UNIT TEST Source code 5', - ExampleType.test, - ), +final List sortedCategories = [ + CategoryModel(name: 'Sorted', examples: [exampleMock1]), ]; -const List examplesSortedByTypeMock = [ - ExampleModel( - { - SDK.java: 'JAVA Source code 1', - SDK.go: 'GO Source code 1', - SDK.python: 'PYTHON Source code 1', - SDK.scio: 'SCIO Source code 1', - }, - 'KATA Source code 1', - ExampleType.kata, - ), - ExampleModel( - { - SDK.java: 'JAVA Source code 4', - SDK.go: 'GO Source code 4', - SDK.python: 'PYTHON Source code 4', - SDK.scio: 'SCIO Source code 4', - }, - 'KATA Source code 4', - ExampleType.kata, - ), -]; +final List unsortedExamples = [exampleMock1, exampleMock2]; -const List examplesSortedByNameMock = [ - ExampleModel( - { - SDK.java: javaHelloWorld, - SDK.go: goHelloWorld, - SDK.python: pythonHelloWorld, - SDK.scio: scioHelloWorld, - }, - 'HelloWorld', - ExampleType.example, - ), -]; +final List examplesSortedByTypeMock = [exampleMock2]; + +final List examplesSortedByNameMock = [exampleMock1]; diff --git a/playground/frontend/test/pages/playground/states/mocks/example_mock.dart b/playground/frontend/test/pages/playground/states/mocks/example_mock.dart index 8eb808574a48..743dc040dc5f 100644 --- a/playground/frontend/test/pages/playground/states/mocks/example_mock.dart +++ b/playground/frontend/test/pages/playground/states/mocks/example_mock.dart @@ -17,22 +17,15 @@ */ import 'package:playground/modules/examples/models/example_model.dart'; -import 'package:playground/modules/sdk/models/sdk.dart'; -const javaExample = 'java example'; - -const pythonExample = 'python example'; - -const goExample = 'go example'; - -const sdkMap = { - SDK.java: javaExample, - SDK.go: goExample, - SDK.python: pythonExample, -}; +final ExampleModel exampleMock1 = ExampleModel( + source: 'ex1', + name: 'Example', + type: ExampleType.example, +); -const ExampleModel exampleMock = ExampleModel( - sdkMap, - 'Example', - ExampleType.example, +final ExampleModel exampleMock2 = ExampleModel( + source: 'ex2', + name: 'Kata', + type: ExampleType.kata, ); diff --git a/playground/frontend/test/pages/playground/states/playground_state_test.dart b/playground/frontend/test/pages/playground/states/playground_state_test.dart index 38997228b7af..6bb3b3e50690 100644 --- a/playground/frontend/test/pages/playground/states/playground_state_test.dart +++ b/playground/frontend/test/pages/playground/states/playground_state_test.dart @@ -16,8 +16,8 @@ * limitations under the License. */ -import 'package:playground/modules/sdk/models/sdk.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:playground/modules/sdk/models/sdk.dart'; import 'package:playground/pages/playground/states/playground_state.dart'; import 'mocks/example_mock.dart'; @@ -39,10 +39,10 @@ void main() { test('Playground state reset should set new state and notify all listeners', () { final state = PlaygroundState(sdk: SDK.go); - state.setSource("source"); + state.setSource('source'); state.addListener(() { expect(state.sdk, SDK.java); - expect(state.source, ""); + expect(state.source, ''); }); state.reset(); }); @@ -53,9 +53,9 @@ void main() { final state = PlaygroundState(sdk: SDK.go); state.addListener(() { expect(state.sdk, SDK.go); - expect(state.source, exampleMock.sources[SDK.go]); - expect(state.selectedExample, exampleMock); + expect(state.source, exampleMock1.source); + expect(state.selectedExample, exampleMock1); }); - state.setExample(exampleMock); + state.setExample(exampleMock1); }); } From 8346572e3695f66a573f4dc6f344d0f87616d582 Mon Sep 17 00:00:00 2001 From: daria-malkova Date: Fri, 29 Oct 2021 11:44:33 +0300 Subject: [PATCH 16/32] Change protobuf --- playground/api/v1/api.proto | 40 + playground/backend/internal/api/v1/api.pb.go | 788 ++++++++++++++---- .../backend/internal/api/v1/api_grpc.pb.go | 141 +++- 3 files changed, 774 insertions(+), 195 deletions(-) diff --git a/playground/api/v1/api.proto b/playground/api/v1/api.proto index a6c8b93eecb0..367fcc212179 100644 --- a/playground/api/v1/api.proto +++ b/playground/api/v1/api.proto @@ -81,6 +81,37 @@ message GetRunOutputResponse { Status compilation_status = 2; } +// ListOfExamplesRequest contains information of the needed examples sdk and categories. +message GetListOfExamplesRequest{ + Sdk sdk = 1; + string category = 2; +} + +// Examples represent the array of examples. +message Examples{ + repeated string example = 1; +} + +// CategoryList represent the map between the category and examples corresponding to this category. +message CategoryList{ + map category_examples = 1; +} + +// ListOfExamplesResponse represent the map between sdk and categories for the sdk. +message GetListOfExamplesResponse{ + map sdk_categories = 1; +} + +// ExampleRequest contains information of the example uuid. +message GetExampleRequest{ + string example_uuid = 1; +} + +// ExampleResponse represents the source code of the example. +message GetExampleResponse{ + string code = 1; +} + service PlaygroundService { // Submit the job for an execution and get the pipeline uuid. @@ -94,4 +125,13 @@ service PlaygroundService { // Get the result of pipeline compilation. rpc GetCompileOutput(GetCompileOutputRequest) returns (GetCompileOutputResponse); + + // Get the list of precompiled examples. + rpc GetListOfExamples(GetListOfExamplesRequest) returns (GetListOfExamplesResponse); + + // Get the code of an example. + rpc GetExample(GetExampleRequest) returns (GetExampleResponse); + + // Get the precompiled details of an example. + rpc GetExampleOutput(GetExampleRequest) returns (GetRunOutputResponse); } diff --git a/playground/backend/internal/api/v1/api.pb.go b/playground/backend/internal/api/v1/api.pb.go index a2844c7026db..578193be317b 100644 --- a/playground/backend/internal/api/v1/api.pb.go +++ b/playground/backend/internal/api/v1/api.pb.go @@ -19,9 +19,9 @@ // versions: // protoc-gen-go v1.26.0 // protoc v3.17.3 -// source: api/v1/api.proto +// source: api.proto -package playground +package v1 import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -76,11 +76,11 @@ func (x Sdk) String() string { } func (Sdk) Descriptor() protoreflect.EnumDescriptor { - return file_api_v1_api_proto_enumTypes[0].Descriptor() + return file_api_proto_enumTypes[0].Descriptor() } func (Sdk) Type() protoreflect.EnumType { - return &file_api_v1_api_proto_enumTypes[0] + return &file_api_proto_enumTypes[0] } func (x Sdk) Number() protoreflect.EnumNumber { @@ -89,7 +89,7 @@ func (x Sdk) Number() protoreflect.EnumNumber { // Deprecated: Use Sdk.Descriptor instead. func (Sdk) EnumDescriptor() ([]byte, []int) { - return file_api_v1_api_proto_rawDescGZIP(), []int{0} + return file_api_proto_rawDescGZIP(), []int{0} } type Status int32 @@ -134,11 +134,11 @@ func (x Status) String() string { } func (Status) Descriptor() protoreflect.EnumDescriptor { - return file_api_v1_api_proto_enumTypes[1].Descriptor() + return file_api_proto_enumTypes[1].Descriptor() } func (Status) Type() protoreflect.EnumType { - return &file_api_v1_api_proto_enumTypes[1] + return &file_api_proto_enumTypes[1] } func (x Status) Number() protoreflect.EnumNumber { @@ -147,7 +147,7 @@ func (x Status) Number() protoreflect.EnumNumber { // Deprecated: Use Status.Descriptor instead. func (Status) EnumDescriptor() ([]byte, []int) { - return file_api_v1_api_proto_rawDescGZIP(), []int{1} + return file_api_proto_rawDescGZIP(), []int{1} } // RunCodeRequest represents a code text and options of SDK which executes the code. @@ -163,7 +163,7 @@ type RunCodeRequest struct { func (x *RunCodeRequest) Reset() { *x = RunCodeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_v1_api_proto_msgTypes[0] + mi := &file_api_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -176,7 +176,7 @@ func (x *RunCodeRequest) String() string { func (*RunCodeRequest) ProtoMessage() {} func (x *RunCodeRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_api_proto_msgTypes[0] + mi := &file_api_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -189,7 +189,7 @@ func (x *RunCodeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RunCodeRequest.ProtoReflect.Descriptor instead. func (*RunCodeRequest) Descriptor() ([]byte, []int) { - return file_api_v1_api_proto_rawDescGZIP(), []int{0} + return file_api_proto_rawDescGZIP(), []int{0} } func (x *RunCodeRequest) GetCode() string { @@ -218,7 +218,7 @@ type RunCodeResponse struct { func (x *RunCodeResponse) Reset() { *x = RunCodeResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_v1_api_proto_msgTypes[1] + mi := &file_api_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -231,7 +231,7 @@ func (x *RunCodeResponse) String() string { func (*RunCodeResponse) ProtoMessage() {} func (x *RunCodeResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_api_proto_msgTypes[1] + mi := &file_api_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -244,7 +244,7 @@ func (x *RunCodeResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use RunCodeResponse.ProtoReflect.Descriptor instead. func (*RunCodeResponse) Descriptor() ([]byte, []int) { - return file_api_v1_api_proto_rawDescGZIP(), []int{1} + return file_api_proto_rawDescGZIP(), []int{1} } func (x *RunCodeResponse) GetPipelineUuid() string { @@ -266,7 +266,7 @@ type CheckStatusRequest struct { func (x *CheckStatusRequest) Reset() { *x = CheckStatusRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_v1_api_proto_msgTypes[2] + mi := &file_api_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -279,7 +279,7 @@ func (x *CheckStatusRequest) String() string { func (*CheckStatusRequest) ProtoMessage() {} func (x *CheckStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_api_proto_msgTypes[2] + mi := &file_api_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -292,7 +292,7 @@ func (x *CheckStatusRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CheckStatusRequest.ProtoReflect.Descriptor instead. func (*CheckStatusRequest) Descriptor() ([]byte, []int) { - return file_api_v1_api_proto_rawDescGZIP(), []int{2} + return file_api_proto_rawDescGZIP(), []int{2} } func (x *CheckStatusRequest) GetPipelineUuid() string { @@ -314,7 +314,7 @@ type CheckStatusResponse struct { func (x *CheckStatusResponse) Reset() { *x = CheckStatusResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_v1_api_proto_msgTypes[3] + mi := &file_api_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -327,7 +327,7 @@ func (x *CheckStatusResponse) String() string { func (*CheckStatusResponse) ProtoMessage() {} func (x *CheckStatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_api_proto_msgTypes[3] + mi := &file_api_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -340,7 +340,7 @@ func (x *CheckStatusResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CheckStatusResponse.ProtoReflect.Descriptor instead. func (*CheckStatusResponse) Descriptor() ([]byte, []int) { - return file_api_v1_api_proto_rawDescGZIP(), []int{3} + return file_api_proto_rawDescGZIP(), []int{3} } func (x *CheckStatusResponse) GetStatus() Status { @@ -362,7 +362,7 @@ type GetCompileOutputRequest struct { func (x *GetCompileOutputRequest) Reset() { *x = GetCompileOutputRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_v1_api_proto_msgTypes[4] + mi := &file_api_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -375,7 +375,7 @@ func (x *GetCompileOutputRequest) String() string { func (*GetCompileOutputRequest) ProtoMessage() {} func (x *GetCompileOutputRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_api_proto_msgTypes[4] + mi := &file_api_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -388,7 +388,7 @@ func (x *GetCompileOutputRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetCompileOutputRequest.ProtoReflect.Descriptor instead. func (*GetCompileOutputRequest) Descriptor() ([]byte, []int) { - return file_api_v1_api_proto_rawDescGZIP(), []int{4} + return file_api_proto_rawDescGZIP(), []int{4} } func (x *GetCompileOutputRequest) GetPipelineUuid() string { @@ -411,7 +411,7 @@ type GetCompileOutputResponse struct { func (x *GetCompileOutputResponse) Reset() { *x = GetCompileOutputResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_v1_api_proto_msgTypes[5] + mi := &file_api_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -424,7 +424,7 @@ func (x *GetCompileOutputResponse) String() string { func (*GetCompileOutputResponse) ProtoMessage() {} func (x *GetCompileOutputResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_api_proto_msgTypes[5] + mi := &file_api_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -437,7 +437,7 @@ func (x *GetCompileOutputResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetCompileOutputResponse.ProtoReflect.Descriptor instead. func (*GetCompileOutputResponse) Descriptor() ([]byte, []int) { - return file_api_v1_api_proto_rawDescGZIP(), []int{5} + return file_api_proto_rawDescGZIP(), []int{5} } func (x *GetCompileOutputResponse) GetOutput() string { @@ -466,7 +466,7 @@ type GetRunOutputRequest struct { func (x *GetRunOutputRequest) Reset() { *x = GetRunOutputRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_v1_api_proto_msgTypes[6] + mi := &file_api_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -479,7 +479,7 @@ func (x *GetRunOutputRequest) String() string { func (*GetRunOutputRequest) ProtoMessage() {} func (x *GetRunOutputRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_api_proto_msgTypes[6] + mi := &file_api_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -492,7 +492,7 @@ func (x *GetRunOutputRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetRunOutputRequest.ProtoReflect.Descriptor instead. func (*GetRunOutputRequest) Descriptor() ([]byte, []int) { - return file_api_v1_api_proto_rawDescGZIP(), []int{6} + return file_api_proto_rawDescGZIP(), []int{6} } func (x *GetRunOutputRequest) GetPipelineUuid() string { @@ -515,7 +515,7 @@ type GetRunOutputResponse struct { func (x *GetRunOutputResponse) Reset() { *x = GetRunOutputResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_v1_api_proto_msgTypes[7] + mi := &file_api_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -528,7 +528,7 @@ func (x *GetRunOutputResponse) String() string { func (*GetRunOutputResponse) ProtoMessage() {} func (x *GetRunOutputResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_api_proto_msgTypes[7] + mi := &file_api_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -541,7 +541,7 @@ func (x *GetRunOutputResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetRunOutputResponse.ProtoReflect.Descriptor instead. func (*GetRunOutputResponse) Descriptor() ([]byte, []int) { - return file_api_v1_api_proto_rawDescGZIP(), []int{7} + return file_api_proto_rawDescGZIP(), []int{7} } func (x *GetRunOutputResponse) GetOutput() string { @@ -558,142 +558,510 @@ func (x *GetRunOutputResponse) GetCompilationStatus() Status { return Status_STATUS_UNSPECIFIED } -var File_api_v1_api_proto protoreflect.FileDescriptor - -var file_api_v1_api_proto_rawDesc = []byte{ - 0x0a, 0x10, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x12, 0x06, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x22, 0x43, 0x0a, 0x0e, 0x52, 0x75, - 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, - 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, - 0x12, 0x1d, 0x0a, 0x03, 0x73, 0x64, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0b, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x64, 0x6b, 0x52, 0x03, 0x73, 0x64, 0x6b, 0x22, - 0x36, 0x0a, 0x0f, 0x52, 0x75, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x75, - 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x69, 0x70, 0x65, 0x6c, - 0x69, 0x6e, 0x65, 0x55, 0x75, 0x69, 0x64, 0x22, 0x39, 0x0a, 0x12, 0x43, 0x68, 0x65, 0x63, 0x6b, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, - 0x0d, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x55, 0x75, - 0x69, 0x64, 0x22, 0x3d, 0x0a, 0x13, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x06, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x22, 0x3e, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x4f, - 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, - 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x55, 0x75, 0x69, - 0x64, 0x22, 0x71, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x4f, - 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, - 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, - 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x3d, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x0e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x52, 0x11, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x22, 0x3a, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6e, 0x4f, 0x75, - 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x70, +// ListOfExamplesRequest contains information of the needed examples sdk and categories. +type GetListOfExamplesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Sdk Sdk `protobuf:"varint,1,opt,name=sdk,proto3,enum=api.v1.Sdk" json:"sdk,omitempty"` + Category string `protobuf:"bytes,2,opt,name=category,proto3" json:"category,omitempty"` +} + +func (x *GetListOfExamplesRequest) Reset() { + *x = GetListOfExamplesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetListOfExamplesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetListOfExamplesRequest) ProtoMessage() {} + +func (x *GetListOfExamplesRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetListOfExamplesRequest.ProtoReflect.Descriptor instead. +func (*GetListOfExamplesRequest) Descriptor() ([]byte, []int) { + return file_api_proto_rawDescGZIP(), []int{8} +} + +func (x *GetListOfExamplesRequest) GetSdk() Sdk { + if x != nil { + return x.Sdk + } + return Sdk_SDK_UNSPECIFIED +} + +func (x *GetListOfExamplesRequest) GetCategory() string { + if x != nil { + return x.Category + } + return "" +} + +// Examples represent the array of examples. +type Examples struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Example []string `protobuf:"bytes,1,rep,name=example,proto3" json:"example,omitempty"` +} + +func (x *Examples) Reset() { + *x = Examples{} + if protoimpl.UnsafeEnabled { + mi := &file_api_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Examples) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Examples) ProtoMessage() {} + +func (x *Examples) ProtoReflect() protoreflect.Message { + mi := &file_api_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Examples.ProtoReflect.Descriptor instead. +func (*Examples) Descriptor() ([]byte, []int) { + return file_api_proto_rawDescGZIP(), []int{9} +} + +func (x *Examples) GetExample() []string { + if x != nil { + return x.Example + } + return nil +} + +// CategoryList represent the map between the category and examples corresponding to this category. +type CategoryList struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CategoryExamples map[string]*Examples `protobuf:"bytes,1,rep,name=category_examples,json=categoryExamples,proto3" json:"category_examples,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *CategoryList) Reset() { + *x = CategoryList{} + if protoimpl.UnsafeEnabled { + mi := &file_api_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CategoryList) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CategoryList) ProtoMessage() {} + +func (x *CategoryList) ProtoReflect() protoreflect.Message { + mi := &file_api_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CategoryList.ProtoReflect.Descriptor instead. +func (*CategoryList) Descriptor() ([]byte, []int) { + return file_api_proto_rawDescGZIP(), []int{10} +} + +func (x *CategoryList) GetCategoryExamples() map[string]*Examples { + if x != nil { + return x.CategoryExamples + } + return nil +} + +// ListOfExamplesResponse represent the map between sdk and categories for the sdk. +type GetListOfExamplesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SdkCategories map[string]*CategoryList `protobuf:"bytes,1,rep,name=sdk_categories,json=sdkCategories,proto3" json:"sdk_categories,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *GetListOfExamplesResponse) Reset() { + *x = GetListOfExamplesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_api_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetListOfExamplesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetListOfExamplesResponse) ProtoMessage() {} + +func (x *GetListOfExamplesResponse) ProtoReflect() protoreflect.Message { + mi := &file_api_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetListOfExamplesResponse.ProtoReflect.Descriptor instead. +func (*GetListOfExamplesResponse) Descriptor() ([]byte, []int) { + return file_api_proto_rawDescGZIP(), []int{11} +} + +func (x *GetListOfExamplesResponse) GetSdkCategories() map[string]*CategoryList { + if x != nil { + return x.SdkCategories + } + return nil +} + +// ExampleRequest contains information of the example uuid. +type GetExampleRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ExampleUuid string `protobuf:"bytes,1,opt,name=example_uuid,json=exampleUuid,proto3" json:"example_uuid,omitempty"` +} + +func (x *GetExampleRequest) Reset() { + *x = GetExampleRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetExampleRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetExampleRequest) ProtoMessage() {} + +func (x *GetExampleRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetExampleRequest.ProtoReflect.Descriptor instead. +func (*GetExampleRequest) Descriptor() ([]byte, []int) { + return file_api_proto_rawDescGZIP(), []int{12} +} + +func (x *GetExampleRequest) GetExampleUuid() string { + if x != nil { + return x.ExampleUuid + } + return "" +} + +// ExampleResponse represents the source code of the example. +type GetExampleResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"` +} + +func (x *GetExampleResponse) Reset() { + *x = GetExampleResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_api_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetExampleResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetExampleResponse) ProtoMessage() {} + +func (x *GetExampleResponse) ProtoReflect() protoreflect.Message { + mi := &file_api_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetExampleResponse.ProtoReflect.Descriptor instead. +func (*GetExampleResponse) Descriptor() ([]byte, []int) { + return file_api_proto_rawDescGZIP(), []int{13} +} + +func (x *GetExampleResponse) GetCode() string { + if x != nil { + return x.Code + } + return "" +} + +var File_api_proto protoreflect.FileDescriptor + +var file_api_proto_rawDesc = []byte{ + 0x0a, 0x09, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x22, 0x43, 0x0a, 0x0e, 0x52, 0x75, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x1d, 0x0a, 0x03, 0x73, 0x64, 0x6b, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, + 0x53, 0x64, 0x6b, 0x52, 0x03, 0x73, 0x64, 0x6b, 0x22, 0x36, 0x0a, 0x0f, 0x52, 0x75, 0x6e, 0x43, + 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x55, 0x75, 0x69, 0x64, - 0x22, 0x6d, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x75, 0x74, 0x70, - 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, - 0x12, 0x3d, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x11, 0x63, 0x6f, - 0x6d, 0x70, 0x69, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2a, - 0x52, 0x0a, 0x03, 0x53, 0x64, 0x6b, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x44, 0x4b, 0x5f, 0x55, 0x4e, - 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x53, - 0x44, 0x4b, 0x5f, 0x4a, 0x41, 0x56, 0x41, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x44, 0x4b, - 0x5f, 0x47, 0x4f, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x53, 0x44, 0x4b, 0x5f, 0x50, 0x59, 0x54, - 0x48, 0x4f, 0x4e, 0x10, 0x03, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x44, 0x4b, 0x5f, 0x53, 0x43, 0x49, - 0x4f, 0x10, 0x04, 0x2a, 0x8f, 0x01, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, - 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, - 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, - 0x5f, 0x45, 0x58, 0x45, 0x43, 0x55, 0x54, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, - 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x46, 0x49, 0x4e, 0x49, 0x53, 0x48, 0x45, 0x44, 0x10, - 0x02, 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x45, 0x52, 0x52, 0x4f, - 0x52, 0x10, 0x03, 0x12, 0x18, 0x0a, 0x14, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x4f, - 0x4d, 0x50, 0x49, 0x4c, 0x45, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x04, 0x12, 0x16, 0x0a, - 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52, 0x55, 0x4e, 0x5f, 0x54, 0x49, 0x4d, 0x45, - 0x4f, 0x55, 0x54, 0x10, 0x05, 0x32, 0xb9, 0x02, 0x0a, 0x11, 0x50, 0x6c, 0x61, 0x79, 0x67, 0x72, - 0x6f, 0x75, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3a, 0x0a, 0x07, 0x52, - 0x75, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, - 0x52, 0x75, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x75, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x0b, 0x43, 0x68, 0x65, 0x63, 0x6b, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, - 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, - 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x49, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, - 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6e, 0x4f, - 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6e, 0x4f, 0x75, 0x74, 0x70, - 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x10, 0x47, 0x65, - 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x1f, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x69, - 0x6c, 0x65, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x20, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, - 0x69, 0x6c, 0x65, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x42, 0x38, 0x5a, 0x36, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, - 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x6c, 0x61, 0x79, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2f, - 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, - 0x3b, 0x70, 0x6c, 0x61, 0x79, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x22, 0x39, 0x0a, 0x12, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, + 0x6e, 0x65, 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, + 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x55, 0x75, 0x69, 0x64, 0x22, 0x3d, 0x0a, 0x13, 0x43, + 0x68, 0x65, 0x63, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x26, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x3e, 0x0a, 0x17, 0x47, 0x65, + 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, + 0x65, 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x69, + 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x55, 0x75, 0x69, 0x64, 0x22, 0x71, 0x0a, 0x18, 0x47, 0x65, + 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x3d, + 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x11, 0x63, 0x6f, 0x6d, 0x70, + 0x69, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x3a, 0x0a, + 0x13, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, + 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x69, 0x70, + 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x55, 0x75, 0x69, 0x64, 0x22, 0x6d, 0x0a, 0x14, 0x47, 0x65, 0x74, + 0x52, 0x75, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x3d, 0x0a, 0x12, 0x63, 0x6f, 0x6d, + 0x70, 0x69, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x11, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x55, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x4c, + 0x69, 0x73, 0x74, 0x4f, 0x66, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x03, 0x73, 0x64, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x0b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x64, 0x6b, 0x52, 0x03, + 0x73, 0x64, 0x6b, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x22, + 0x24, 0x0a, 0x08, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x65, + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x65, 0x78, + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x22, 0xbe, 0x01, 0x0a, 0x0c, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, + 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x57, 0x0a, 0x11, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, + 0x72, 0x79, 0x5f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x2a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, + 0x6f, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, + 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x10, 0x63, + 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x1a, + 0x55, 0x0a, 0x15, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x45, 0x78, 0x61, 0x6d, 0x70, + 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x26, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xd0, 0x01, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x4c, 0x69, + 0x73, 0x74, 0x4f, 0x66, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5b, 0x0a, 0x0e, 0x73, 0x64, 0x6b, 0x5f, 0x63, 0x61, 0x74, 0x65, + 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x66, 0x45, + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, + 0x53, 0x64, 0x6b, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x0d, 0x73, 0x64, 0x6b, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, + 0x73, 0x1a, 0x56, 0x0a, 0x12, 0x53, 0x64, 0x6b, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, + 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2a, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x36, 0x0a, 0x11, 0x47, 0x65, 0x74, + 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, + 0x0a, 0x0c, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x55, 0x75, 0x69, + 0x64, 0x22, 0x28, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x2a, 0x52, 0x0a, 0x03, 0x53, + 0x64, 0x6b, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x44, 0x4b, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, + 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x44, 0x4b, 0x5f, 0x4a, + 0x41, 0x56, 0x41, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x44, 0x4b, 0x5f, 0x47, 0x4f, 0x10, + 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x53, 0x44, 0x4b, 0x5f, 0x50, 0x59, 0x54, 0x48, 0x4f, 0x4e, 0x10, + 0x03, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x44, 0x4b, 0x5f, 0x53, 0x43, 0x49, 0x4f, 0x10, 0x04, 0x2a, + 0x8f, 0x01, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, + 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, + 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x45, 0x58, 0x45, + 0x43, 0x55, 0x54, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x54, 0x41, 0x54, + 0x55, 0x53, 0x5f, 0x46, 0x49, 0x4e, 0x49, 0x53, 0x48, 0x45, 0x44, 0x10, 0x02, 0x12, 0x10, 0x0a, + 0x0c, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x03, 0x12, + 0x18, 0x0a, 0x14, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x49, 0x4c, + 0x45, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x04, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, + 0x54, 0x55, 0x53, 0x5f, 0x52, 0x55, 0x4e, 0x5f, 0x54, 0x49, 0x4d, 0x45, 0x4f, 0x55, 0x54, 0x10, + 0x05, 0x32, 0xa5, 0x04, 0x0a, 0x11, 0x50, 0x6c, 0x61, 0x79, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3a, 0x0a, 0x07, 0x52, 0x75, 0x6e, 0x43, 0x6f, + 0x64, 0x65, 0x12, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x75, 0x6e, 0x43, + 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x75, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x0b, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x12, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, + 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x0c, 0x47, + 0x65, 0x74, 0x52, 0x75, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x1b, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, + 0x70, 0x69, 0x6c, 0x65, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x1f, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x4f, 0x75, + 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x4f, + 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, + 0x11, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x66, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, + 0x65, 0x73, 0x12, 0x20, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4c, + 0x69, 0x73, 0x74, 0x4f, 0x66, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, + 0x74, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x66, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x45, 0x78, + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, + 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, + 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x10, + 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, + 0x12, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, + 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x38, 0x5a, 0x36, 0x62, 0x65, 0x61, + 0x6d, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x6c, 0x61, + 0x79, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x2f, + 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x3b, 0x70, 0x6c, 0x61, 0x79, 0x67, 0x72, 0x6f, + 0x75, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_api_v1_api_proto_rawDescOnce sync.Once - file_api_v1_api_proto_rawDescData = file_api_v1_api_proto_rawDesc + file_api_proto_rawDescOnce sync.Once + file_api_proto_rawDescData = file_api_proto_rawDesc ) -func file_api_v1_api_proto_rawDescGZIP() []byte { - file_api_v1_api_proto_rawDescOnce.Do(func() { - file_api_v1_api_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_v1_api_proto_rawDescData) +func file_api_proto_rawDescGZIP() []byte { + file_api_proto_rawDescOnce.Do(func() { + file_api_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_proto_rawDescData) }) - return file_api_v1_api_proto_rawDescData -} - -var file_api_v1_api_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_api_v1_api_proto_msgTypes = make([]protoimpl.MessageInfo, 8) -var file_api_v1_api_proto_goTypes = []interface{}{ - (Sdk)(0), // 0: api.v1.Sdk - (Status)(0), // 1: api.v1.Status - (*RunCodeRequest)(nil), // 2: api.v1.RunCodeRequest - (*RunCodeResponse)(nil), // 3: api.v1.RunCodeResponse - (*CheckStatusRequest)(nil), // 4: api.v1.CheckStatusRequest - (*CheckStatusResponse)(nil), // 5: api.v1.CheckStatusResponse - (*GetCompileOutputRequest)(nil), // 6: api.v1.GetCompileOutputRequest - (*GetCompileOutputResponse)(nil), // 7: api.v1.GetCompileOutputResponse - (*GetRunOutputRequest)(nil), // 8: api.v1.GetRunOutputRequest - (*GetRunOutputResponse)(nil), // 9: api.v1.GetRunOutputResponse -} -var file_api_v1_api_proto_depIdxs = []int32{ - 0, // 0: api.v1.RunCodeRequest.sdk:type_name -> api.v1.Sdk - 1, // 1: api.v1.CheckStatusResponse.status:type_name -> api.v1.Status - 1, // 2: api.v1.GetCompileOutputResponse.compilation_status:type_name -> api.v1.Status - 1, // 3: api.v1.GetRunOutputResponse.compilation_status:type_name -> api.v1.Status - 2, // 4: api.v1.PlaygroundService.RunCode:input_type -> api.v1.RunCodeRequest - 4, // 5: api.v1.PlaygroundService.CheckStatus:input_type -> api.v1.CheckStatusRequest - 8, // 6: api.v1.PlaygroundService.GetRunOutput:input_type -> api.v1.GetRunOutputRequest - 6, // 7: api.v1.PlaygroundService.GetCompileOutput:input_type -> api.v1.GetCompileOutputRequest - 3, // 8: api.v1.PlaygroundService.RunCode:output_type -> api.v1.RunCodeResponse - 5, // 9: api.v1.PlaygroundService.CheckStatus:output_type -> api.v1.CheckStatusResponse - 9, // 10: api.v1.PlaygroundService.GetRunOutput:output_type -> api.v1.GetRunOutputResponse - 7, // 11: api.v1.PlaygroundService.GetCompileOutput:output_type -> api.v1.GetCompileOutputResponse - 8, // [8:12] is the sub-list for method output_type - 4, // [4:8] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name -} - -func init() { file_api_v1_api_proto_init() } -func file_api_v1_api_proto_init() { - if File_api_v1_api_proto != nil { + return file_api_proto_rawDescData +} + +var file_api_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_api_proto_msgTypes = make([]protoimpl.MessageInfo, 16) +var file_api_proto_goTypes = []interface{}{ + (Sdk)(0), // 0: api.v1.Sdk + (Status)(0), // 1: api.v1.Status + (*RunCodeRequest)(nil), // 2: api.v1.RunCodeRequest + (*RunCodeResponse)(nil), // 3: api.v1.RunCodeResponse + (*CheckStatusRequest)(nil), // 4: api.v1.CheckStatusRequest + (*CheckStatusResponse)(nil), // 5: api.v1.CheckStatusResponse + (*GetCompileOutputRequest)(nil), // 6: api.v1.GetCompileOutputRequest + (*GetCompileOutputResponse)(nil), // 7: api.v1.GetCompileOutputResponse + (*GetRunOutputRequest)(nil), // 8: api.v1.GetRunOutputRequest + (*GetRunOutputResponse)(nil), // 9: api.v1.GetRunOutputResponse + (*GetListOfExamplesRequest)(nil), // 10: api.v1.GetListOfExamplesRequest + (*Examples)(nil), // 11: api.v1.Examples + (*CategoryList)(nil), // 12: api.v1.CategoryList + (*GetListOfExamplesResponse)(nil), // 13: api.v1.GetListOfExamplesResponse + (*GetExampleRequest)(nil), // 14: api.v1.GetExampleRequest + (*GetExampleResponse)(nil), // 15: api.v1.GetExampleResponse + nil, // 16: api.v1.CategoryList.CategoryExamplesEntry + nil, // 17: api.v1.GetListOfExamplesResponse.SdkCategoriesEntry +} +var file_api_proto_depIdxs = []int32{ + 0, // 0: api.v1.RunCodeRequest.sdk:type_name -> api.v1.Sdk + 1, // 1: api.v1.CheckStatusResponse.status:type_name -> api.v1.Status + 1, // 2: api.v1.GetCompileOutputResponse.compilation_status:type_name -> api.v1.Status + 1, // 3: api.v1.GetRunOutputResponse.compilation_status:type_name -> api.v1.Status + 0, // 4: api.v1.GetListOfExamplesRequest.sdk:type_name -> api.v1.Sdk + 16, // 5: api.v1.CategoryList.category_examples:type_name -> api.v1.CategoryList.CategoryExamplesEntry + 17, // 6: api.v1.GetListOfExamplesResponse.sdk_categories:type_name -> api.v1.GetListOfExamplesResponse.SdkCategoriesEntry + 11, // 7: api.v1.CategoryList.CategoryExamplesEntry.value:type_name -> api.v1.Examples + 12, // 8: api.v1.GetListOfExamplesResponse.SdkCategoriesEntry.value:type_name -> api.v1.CategoryList + 2, // 9: api.v1.PlaygroundService.RunCode:input_type -> api.v1.RunCodeRequest + 4, // 10: api.v1.PlaygroundService.CheckStatus:input_type -> api.v1.CheckStatusRequest + 8, // 11: api.v1.PlaygroundService.GetRunOutput:input_type -> api.v1.GetRunOutputRequest + 6, // 12: api.v1.PlaygroundService.GetCompileOutput:input_type -> api.v1.GetCompileOutputRequest + 10, // 13: api.v1.PlaygroundService.GetListOfExamples:input_type -> api.v1.GetListOfExamplesRequest + 14, // 14: api.v1.PlaygroundService.GetExample:input_type -> api.v1.GetExampleRequest + 14, // 15: api.v1.PlaygroundService.GetExampleOutput:input_type -> api.v1.GetExampleRequest + 3, // 16: api.v1.PlaygroundService.RunCode:output_type -> api.v1.RunCodeResponse + 5, // 17: api.v1.PlaygroundService.CheckStatus:output_type -> api.v1.CheckStatusResponse + 9, // 18: api.v1.PlaygroundService.GetRunOutput:output_type -> api.v1.GetRunOutputResponse + 7, // 19: api.v1.PlaygroundService.GetCompileOutput:output_type -> api.v1.GetCompileOutputResponse + 13, // 20: api.v1.PlaygroundService.GetListOfExamples:output_type -> api.v1.GetListOfExamplesResponse + 15, // 21: api.v1.PlaygroundService.GetExample:output_type -> api.v1.GetExampleResponse + 9, // 22: api.v1.PlaygroundService.GetExampleOutput:output_type -> api.v1.GetRunOutputResponse + 16, // [16:23] is the sub-list for method output_type + 9, // [9:16] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name +} + +func init() { file_api_proto_init() } +func file_api_proto_init() { + if File_api_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_api_v1_api_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RunCodeRequest); i { case 0: return &v.state @@ -705,7 +1073,7 @@ func file_api_v1_api_proto_init() { return nil } } - file_api_v1_api_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RunCodeResponse); i { case 0: return &v.state @@ -717,7 +1085,7 @@ func file_api_v1_api_proto_init() { return nil } } - file_api_v1_api_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CheckStatusRequest); i { case 0: return &v.state @@ -729,7 +1097,7 @@ func file_api_v1_api_proto_init() { return nil } } - file_api_v1_api_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CheckStatusResponse); i { case 0: return &v.state @@ -741,7 +1109,7 @@ func file_api_v1_api_proto_init() { return nil } } - file_api_v1_api_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetCompileOutputRequest); i { case 0: return &v.state @@ -753,7 +1121,7 @@ func file_api_v1_api_proto_init() { return nil } } - file_api_v1_api_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetCompileOutputResponse); i { case 0: return &v.state @@ -765,7 +1133,7 @@ func file_api_v1_api_proto_init() { return nil } } - file_api_v1_api_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetRunOutputRequest); i { case 0: return &v.state @@ -777,7 +1145,7 @@ func file_api_v1_api_proto_init() { return nil } } - file_api_v1_api_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetRunOutputResponse); i { case 0: return &v.state @@ -789,24 +1157,96 @@ func file_api_v1_api_proto_init() { return nil } } + file_api_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetListOfExamplesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Examples); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CategoryList); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetListOfExamplesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetExampleRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetExampleResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_api_v1_api_proto_rawDesc, + RawDescriptor: file_api_proto_rawDesc, NumEnums: 2, - NumMessages: 8, + NumMessages: 16, NumExtensions: 0, NumServices: 1, }, - GoTypes: file_api_v1_api_proto_goTypes, - DependencyIndexes: file_api_v1_api_proto_depIdxs, - EnumInfos: file_api_v1_api_proto_enumTypes, - MessageInfos: file_api_v1_api_proto_msgTypes, + GoTypes: file_api_proto_goTypes, + DependencyIndexes: file_api_proto_depIdxs, + EnumInfos: file_api_proto_enumTypes, + MessageInfos: file_api_proto_msgTypes, }.Build() - File_api_v1_api_proto = out.File - file_api_v1_api_proto_rawDesc = nil - file_api_v1_api_proto_goTypes = nil - file_api_v1_api_proto_depIdxs = nil + File_api_proto = out.File + file_api_proto_rawDesc = nil + file_api_proto_goTypes = nil + file_api_proto_depIdxs = nil } diff --git a/playground/backend/internal/api/v1/api_grpc.pb.go b/playground/backend/internal/api/v1/api_grpc.pb.go index 92c110f5cdcf..2b426f0720eb 100644 --- a/playground/backend/internal/api/v1/api_grpc.pb.go +++ b/playground/backend/internal/api/v1/api_grpc.pb.go @@ -1,23 +1,6 @@ -// -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - // Code generated by protoc-gen-go-grpc. DO NOT EDIT. -package playground +package v1 import ( context "context" @@ -43,6 +26,12 @@ type PlaygroundServiceClient interface { GetRunOutput(ctx context.Context, in *GetRunOutputRequest, opts ...grpc.CallOption) (*GetRunOutputResponse, error) // Get the result of pipeline compilation. GetCompileOutput(ctx context.Context, in *GetCompileOutputRequest, opts ...grpc.CallOption) (*GetCompileOutputResponse, error) + // Get the list of precompiled examples. + GetListOfExamples(ctx context.Context, in *GetListOfExamplesRequest, opts ...grpc.CallOption) (*GetListOfExamplesResponse, error) + // Get the code of an example. + GetExample(ctx context.Context, in *GetExampleRequest, opts ...grpc.CallOption) (*GetExampleResponse, error) + // Get the precompiled details of an example. + GetExampleOutput(ctx context.Context, in *GetExampleRequest, opts ...grpc.CallOption) (*GetRunOutputResponse, error) } type playgroundServiceClient struct { @@ -89,8 +78,35 @@ func (c *playgroundServiceClient) GetCompileOutput(ctx context.Context, in *GetC return out, nil } +func (c *playgroundServiceClient) GetListOfExamples(ctx context.Context, in *GetListOfExamplesRequest, opts ...grpc.CallOption) (*GetListOfExamplesResponse, error) { + out := new(GetListOfExamplesResponse) + err := c.cc.Invoke(ctx, "/api.v1.PlaygroundService/GetListOfExamples", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *playgroundServiceClient) GetExample(ctx context.Context, in *GetExampleRequest, opts ...grpc.CallOption) (*GetExampleResponse, error) { + out := new(GetExampleResponse) + err := c.cc.Invoke(ctx, "/api.v1.PlaygroundService/GetExample", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *playgroundServiceClient) GetExampleOutput(ctx context.Context, in *GetExampleRequest, opts ...grpc.CallOption) (*GetRunOutputResponse, error) { + out := new(GetRunOutputResponse) + err := c.cc.Invoke(ctx, "/api.v1.PlaygroundService/GetExampleOutput", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // PlaygroundServiceServer is the server API for PlaygroundService service. -// All implementations should embed UnimplementedPlaygroundServiceServer +// All implementations must embed UnimplementedPlaygroundServiceServer // for forward compatibility type PlaygroundServiceServer interface { // Submit the job for an execution and get the pipeline uuid. @@ -101,9 +117,16 @@ type PlaygroundServiceServer interface { GetRunOutput(context.Context, *GetRunOutputRequest) (*GetRunOutputResponse, error) // Get the result of pipeline compilation. GetCompileOutput(context.Context, *GetCompileOutputRequest) (*GetCompileOutputResponse, error) + // Get the list of precompiled examples. + GetListOfExamples(context.Context, *GetListOfExamplesRequest) (*GetListOfExamplesResponse, error) + // Get the code of an example. + GetExample(context.Context, *GetExampleRequest) (*GetExampleResponse, error) + // Get the precompiled details of an example. + GetExampleOutput(context.Context, *GetExampleRequest) (*GetRunOutputResponse, error) + mustEmbedUnimplementedPlaygroundServiceServer() } -// UnimplementedPlaygroundServiceServer should be embedded to have forward compatible implementations. +// UnimplementedPlaygroundServiceServer must be embedded to have forward compatible implementations. type UnimplementedPlaygroundServiceServer struct { } @@ -119,6 +142,16 @@ func (UnimplementedPlaygroundServiceServer) GetRunOutput(context.Context, *GetRu func (UnimplementedPlaygroundServiceServer) GetCompileOutput(context.Context, *GetCompileOutputRequest) (*GetCompileOutputResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetCompileOutput not implemented") } +func (UnimplementedPlaygroundServiceServer) GetListOfExamples(context.Context, *GetListOfExamplesRequest) (*GetListOfExamplesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetListOfExamples not implemented") +} +func (UnimplementedPlaygroundServiceServer) GetExample(context.Context, *GetExampleRequest) (*GetExampleResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetExample not implemented") +} +func (UnimplementedPlaygroundServiceServer) GetExampleOutput(context.Context, *GetExampleRequest) (*GetRunOutputResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetExampleOutput not implemented") +} +func (UnimplementedPlaygroundServiceServer) mustEmbedUnimplementedPlaygroundServiceServer() {} // UnsafePlaygroundServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to PlaygroundServiceServer will @@ -203,6 +236,60 @@ func _PlaygroundService_GetCompileOutput_Handler(srv interface{}, ctx context.Co return interceptor(ctx, in, info, handler) } +func _PlaygroundService_GetListOfExamples_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetListOfExamplesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlaygroundServiceServer).GetListOfExamples(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.PlaygroundService/GetListOfExamples", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlaygroundServiceServer).GetListOfExamples(ctx, req.(*GetListOfExamplesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlaygroundService_GetExample_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetExampleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlaygroundServiceServer).GetExample(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.PlaygroundService/GetExample", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlaygroundServiceServer).GetExample(ctx, req.(*GetExampleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlaygroundService_GetExampleOutput_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetExampleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlaygroundServiceServer).GetExampleOutput(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.PlaygroundService/GetExampleOutput", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlaygroundServiceServer).GetExampleOutput(ctx, req.(*GetExampleRequest)) + } + return interceptor(ctx, in, info, handler) +} + // PlaygroundService_ServiceDesc is the grpc.ServiceDesc for PlaygroundService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -226,7 +313,19 @@ var PlaygroundService_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetCompileOutput", Handler: _PlaygroundService_GetCompileOutput_Handler, }, + { + MethodName: "GetListOfExamples", + Handler: _PlaygroundService_GetListOfExamples_Handler, + }, + { + MethodName: "GetExample", + Handler: _PlaygroundService_GetExample_Handler, + }, + { + MethodName: "GetExampleOutput", + Handler: _PlaygroundService_GetExampleOutput_Handler, + }, }, Streams: []grpc.StreamDesc{}, - Metadata: "api/v1/api.proto", + Metadata: "api.proto", } From ccff3ade3642a9f82823f91b9abeb989917dd653 Mon Sep 17 00:00:00 2001 From: Aydar Farrakhov Date: Mon, 1 Nov 2021 14:35:52 +0300 Subject: [PATCH 17/32] [BEAM-13101] generate proto --- playground/backend/internal/api/v1/api.pb.go | 437 ++++++++-------- .../backend/internal/api/v1/api_grpc.pb.go | 10 +- playground/frontend/lib/api/v1/api.pb.dart | 493 +++++++++++++++++- .../frontend/lib/api/v1/api.pbenum.dart | 46 +- .../frontend/lib/api/v1/api.pbgrpc.dart | 99 +++- .../frontend/lib/api/v1/api.pbjson.dart | 161 +++++- 6 files changed, 984 insertions(+), 262 deletions(-) diff --git a/playground/backend/internal/api/v1/api.pb.go b/playground/backend/internal/api/v1/api.pb.go index 578193be317b..28f07c591e62 100644 --- a/playground/backend/internal/api/v1/api.pb.go +++ b/playground/backend/internal/api/v1/api.pb.go @@ -18,10 +18,10 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.17.3 -// source: api.proto +// protoc v3.18.1 +// source: api/v1/api.proto -package v1 +package playground import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -76,11 +76,11 @@ func (x Sdk) String() string { } func (Sdk) Descriptor() protoreflect.EnumDescriptor { - return file_api_proto_enumTypes[0].Descriptor() + return file_api_v1_api_proto_enumTypes[0].Descriptor() } func (Sdk) Type() protoreflect.EnumType { - return &file_api_proto_enumTypes[0] + return &file_api_v1_api_proto_enumTypes[0] } func (x Sdk) Number() protoreflect.EnumNumber { @@ -89,7 +89,7 @@ func (x Sdk) Number() protoreflect.EnumNumber { // Deprecated: Use Sdk.Descriptor instead. func (Sdk) EnumDescriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{0} + return file_api_v1_api_proto_rawDescGZIP(), []int{0} } type Status int32 @@ -134,11 +134,11 @@ func (x Status) String() string { } func (Status) Descriptor() protoreflect.EnumDescriptor { - return file_api_proto_enumTypes[1].Descriptor() + return file_api_v1_api_proto_enumTypes[1].Descriptor() } func (Status) Type() protoreflect.EnumType { - return &file_api_proto_enumTypes[1] + return &file_api_v1_api_proto_enumTypes[1] } func (x Status) Number() protoreflect.EnumNumber { @@ -147,7 +147,7 @@ func (x Status) Number() protoreflect.EnumNumber { // Deprecated: Use Status.Descriptor instead. func (Status) EnumDescriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{1} + return file_api_v1_api_proto_rawDescGZIP(), []int{1} } // RunCodeRequest represents a code text and options of SDK which executes the code. @@ -163,7 +163,7 @@ type RunCodeRequest struct { func (x *RunCodeRequest) Reset() { *x = RunCodeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[0] + mi := &file_api_v1_api_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -176,7 +176,7 @@ func (x *RunCodeRequest) String() string { func (*RunCodeRequest) ProtoMessage() {} func (x *RunCodeRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[0] + mi := &file_api_v1_api_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -189,7 +189,7 @@ func (x *RunCodeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RunCodeRequest.ProtoReflect.Descriptor instead. func (*RunCodeRequest) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{0} + return file_api_v1_api_proto_rawDescGZIP(), []int{0} } func (x *RunCodeRequest) GetCode() string { @@ -218,7 +218,7 @@ type RunCodeResponse struct { func (x *RunCodeResponse) Reset() { *x = RunCodeResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[1] + mi := &file_api_v1_api_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -231,7 +231,7 @@ func (x *RunCodeResponse) String() string { func (*RunCodeResponse) ProtoMessage() {} func (x *RunCodeResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[1] + mi := &file_api_v1_api_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -244,7 +244,7 @@ func (x *RunCodeResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use RunCodeResponse.ProtoReflect.Descriptor instead. func (*RunCodeResponse) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{1} + return file_api_v1_api_proto_rawDescGZIP(), []int{1} } func (x *RunCodeResponse) GetPipelineUuid() string { @@ -266,7 +266,7 @@ type CheckStatusRequest struct { func (x *CheckStatusRequest) Reset() { *x = CheckStatusRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[2] + mi := &file_api_v1_api_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -279,7 +279,7 @@ func (x *CheckStatusRequest) String() string { func (*CheckStatusRequest) ProtoMessage() {} func (x *CheckStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[2] + mi := &file_api_v1_api_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -292,7 +292,7 @@ func (x *CheckStatusRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CheckStatusRequest.ProtoReflect.Descriptor instead. func (*CheckStatusRequest) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{2} + return file_api_v1_api_proto_rawDescGZIP(), []int{2} } func (x *CheckStatusRequest) GetPipelineUuid() string { @@ -314,7 +314,7 @@ type CheckStatusResponse struct { func (x *CheckStatusResponse) Reset() { *x = CheckStatusResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[3] + mi := &file_api_v1_api_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -327,7 +327,7 @@ func (x *CheckStatusResponse) String() string { func (*CheckStatusResponse) ProtoMessage() {} func (x *CheckStatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[3] + mi := &file_api_v1_api_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -340,7 +340,7 @@ func (x *CheckStatusResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CheckStatusResponse.ProtoReflect.Descriptor instead. func (*CheckStatusResponse) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{3} + return file_api_v1_api_proto_rawDescGZIP(), []int{3} } func (x *CheckStatusResponse) GetStatus() Status { @@ -362,7 +362,7 @@ type GetCompileOutputRequest struct { func (x *GetCompileOutputRequest) Reset() { *x = GetCompileOutputRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[4] + mi := &file_api_v1_api_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -375,7 +375,7 @@ func (x *GetCompileOutputRequest) String() string { func (*GetCompileOutputRequest) ProtoMessage() {} func (x *GetCompileOutputRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[4] + mi := &file_api_v1_api_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -388,7 +388,7 @@ func (x *GetCompileOutputRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetCompileOutputRequest.ProtoReflect.Descriptor instead. func (*GetCompileOutputRequest) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{4} + return file_api_v1_api_proto_rawDescGZIP(), []int{4} } func (x *GetCompileOutputRequest) GetPipelineUuid() string { @@ -411,7 +411,7 @@ type GetCompileOutputResponse struct { func (x *GetCompileOutputResponse) Reset() { *x = GetCompileOutputResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[5] + mi := &file_api_v1_api_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -424,7 +424,7 @@ func (x *GetCompileOutputResponse) String() string { func (*GetCompileOutputResponse) ProtoMessage() {} func (x *GetCompileOutputResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[5] + mi := &file_api_v1_api_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -437,7 +437,7 @@ func (x *GetCompileOutputResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetCompileOutputResponse.ProtoReflect.Descriptor instead. func (*GetCompileOutputResponse) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{5} + return file_api_v1_api_proto_rawDescGZIP(), []int{5} } func (x *GetCompileOutputResponse) GetOutput() string { @@ -466,7 +466,7 @@ type GetRunOutputRequest struct { func (x *GetRunOutputRequest) Reset() { *x = GetRunOutputRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[6] + mi := &file_api_v1_api_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -479,7 +479,7 @@ func (x *GetRunOutputRequest) String() string { func (*GetRunOutputRequest) ProtoMessage() {} func (x *GetRunOutputRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[6] + mi := &file_api_v1_api_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -492,7 +492,7 @@ func (x *GetRunOutputRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetRunOutputRequest.ProtoReflect.Descriptor instead. func (*GetRunOutputRequest) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{6} + return file_api_v1_api_proto_rawDescGZIP(), []int{6} } func (x *GetRunOutputRequest) GetPipelineUuid() string { @@ -515,7 +515,7 @@ type GetRunOutputResponse struct { func (x *GetRunOutputResponse) Reset() { *x = GetRunOutputResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[7] + mi := &file_api_v1_api_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -528,7 +528,7 @@ func (x *GetRunOutputResponse) String() string { func (*GetRunOutputResponse) ProtoMessage() {} func (x *GetRunOutputResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[7] + mi := &file_api_v1_api_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -541,7 +541,7 @@ func (x *GetRunOutputResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetRunOutputResponse.ProtoReflect.Descriptor instead. func (*GetRunOutputResponse) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{7} + return file_api_v1_api_proto_rawDescGZIP(), []int{7} } func (x *GetRunOutputResponse) GetOutput() string { @@ -571,7 +571,7 @@ type GetListOfExamplesRequest struct { func (x *GetListOfExamplesRequest) Reset() { *x = GetListOfExamplesRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[8] + mi := &file_api_v1_api_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -584,7 +584,7 @@ func (x *GetListOfExamplesRequest) String() string { func (*GetListOfExamplesRequest) ProtoMessage() {} func (x *GetListOfExamplesRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[8] + mi := &file_api_v1_api_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -597,7 +597,7 @@ func (x *GetListOfExamplesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetListOfExamplesRequest.ProtoReflect.Descriptor instead. func (*GetListOfExamplesRequest) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{8} + return file_api_v1_api_proto_rawDescGZIP(), []int{8} } func (x *GetListOfExamplesRequest) GetSdk() Sdk { @@ -626,7 +626,7 @@ type Examples struct { func (x *Examples) Reset() { *x = Examples{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[9] + mi := &file_api_v1_api_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -639,7 +639,7 @@ func (x *Examples) String() string { func (*Examples) ProtoMessage() {} func (x *Examples) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[9] + mi := &file_api_v1_api_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -652,7 +652,7 @@ func (x *Examples) ProtoReflect() protoreflect.Message { // Deprecated: Use Examples.ProtoReflect.Descriptor instead. func (*Examples) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{9} + return file_api_v1_api_proto_rawDescGZIP(), []int{9} } func (x *Examples) GetExample() []string { @@ -674,7 +674,7 @@ type CategoryList struct { func (x *CategoryList) Reset() { *x = CategoryList{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[10] + mi := &file_api_v1_api_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -687,7 +687,7 @@ func (x *CategoryList) String() string { func (*CategoryList) ProtoMessage() {} func (x *CategoryList) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[10] + mi := &file_api_v1_api_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -700,7 +700,7 @@ func (x *CategoryList) ProtoReflect() protoreflect.Message { // Deprecated: Use CategoryList.ProtoReflect.Descriptor instead. func (*CategoryList) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{10} + return file_api_v1_api_proto_rawDescGZIP(), []int{10} } func (x *CategoryList) GetCategoryExamples() map[string]*Examples { @@ -722,7 +722,7 @@ type GetListOfExamplesResponse struct { func (x *GetListOfExamplesResponse) Reset() { *x = GetListOfExamplesResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[11] + mi := &file_api_v1_api_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -735,7 +735,7 @@ func (x *GetListOfExamplesResponse) String() string { func (*GetListOfExamplesResponse) ProtoMessage() {} func (x *GetListOfExamplesResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[11] + mi := &file_api_v1_api_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -748,7 +748,7 @@ func (x *GetListOfExamplesResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetListOfExamplesResponse.ProtoReflect.Descriptor instead. func (*GetListOfExamplesResponse) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{11} + return file_api_v1_api_proto_rawDescGZIP(), []int{11} } func (x *GetListOfExamplesResponse) GetSdkCategories() map[string]*CategoryList { @@ -770,7 +770,7 @@ type GetExampleRequest struct { func (x *GetExampleRequest) Reset() { *x = GetExampleRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[12] + mi := &file_api_v1_api_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -783,7 +783,7 @@ func (x *GetExampleRequest) String() string { func (*GetExampleRequest) ProtoMessage() {} func (x *GetExampleRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[12] + mi := &file_api_v1_api_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -796,7 +796,7 @@ func (x *GetExampleRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetExampleRequest.ProtoReflect.Descriptor instead. func (*GetExampleRequest) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{12} + return file_api_v1_api_proto_rawDescGZIP(), []int{12} } func (x *GetExampleRequest) GetExampleUuid() string { @@ -818,7 +818,7 @@ type GetExampleResponse struct { func (x *GetExampleResponse) Reset() { *x = GetExampleResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[13] + mi := &file_api_v1_api_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -831,7 +831,7 @@ func (x *GetExampleResponse) String() string { func (*GetExampleResponse) ProtoMessage() {} func (x *GetExampleResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[13] + mi := &file_api_v1_api_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -844,7 +844,7 @@ func (x *GetExampleResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetExampleResponse.ProtoReflect.Descriptor instead. func (*GetExampleResponse) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{13} + return file_api_v1_api_proto_rawDescGZIP(), []int{13} } func (x *GetExampleResponse) GetCode() string { @@ -854,157 +854,158 @@ func (x *GetExampleResponse) GetCode() string { return "" } -var File_api_proto protoreflect.FileDescriptor - -var file_api_proto_rawDesc = []byte{ - 0x0a, 0x09, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x22, 0x43, 0x0a, 0x0e, 0x52, 0x75, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x1d, 0x0a, 0x03, 0x73, 0x64, 0x6b, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, - 0x53, 0x64, 0x6b, 0x52, 0x03, 0x73, 0x64, 0x6b, 0x22, 0x36, 0x0a, 0x0f, 0x52, 0x75, 0x6e, 0x43, - 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x70, +var File_api_v1_api_proto protoreflect.FileDescriptor + +var file_api_v1_api_proto_rawDesc = []byte{ + 0x0a, 0x10, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x06, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x22, 0x43, 0x0a, 0x0e, 0x52, 0x75, + 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, + 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, + 0x12, 0x1d, 0x0a, 0x03, 0x73, 0x64, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0b, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x64, 0x6b, 0x52, 0x03, 0x73, 0x64, 0x6b, 0x22, + 0x36, 0x0a, 0x0f, 0x52, 0x75, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x75, + 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x69, 0x70, 0x65, 0x6c, + 0x69, 0x6e, 0x65, 0x55, 0x75, 0x69, 0x64, 0x22, 0x39, 0x0a, 0x12, 0x43, 0x68, 0x65, 0x63, 0x6b, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, + 0x0d, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x55, 0x75, + 0x69, 0x64, 0x22, 0x3d, 0x0a, 0x13, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x22, 0x3e, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x4f, + 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, + 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x55, 0x75, 0x69, + 0x64, 0x22, 0x71, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x4f, + 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, + 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, + 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x3d, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x0e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x52, 0x11, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x22, 0x3a, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6e, 0x4f, 0x75, + 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x55, 0x75, 0x69, 0x64, - 0x22, 0x39, 0x0a, 0x12, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, - 0x6e, 0x65, 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, - 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x55, 0x75, 0x69, 0x64, 0x22, 0x3d, 0x0a, 0x13, 0x43, + 0x22, 0x6d, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x75, 0x74, 0x70, + 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, + 0x12, 0x3d, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x11, 0x63, 0x6f, + 0x6d, 0x70, 0x69, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, + 0x55, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x66, 0x45, 0x78, 0x61, 0x6d, + 0x70, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x03, 0x73, + 0x64, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x2e, 0x53, 0x64, 0x6b, 0x52, 0x03, 0x73, 0x64, 0x6b, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x61, + 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x61, + 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x22, 0x24, 0x0a, 0x08, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, + 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x07, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x22, 0xbe, 0x01, 0x0a, + 0x0c, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x57, 0x0a, + 0x11, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x5f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, + 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x2e, 0x43, + 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x52, 0x10, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x45, 0x78, + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x1a, 0x55, 0x0a, 0x15, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, + 0x72, 0x79, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x26, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, + 0x65, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xd0, 0x01, + 0x0a, 0x19, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x66, 0x45, 0x78, 0x61, 0x6d, 0x70, + 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5b, 0x0a, 0x0e, 0x73, + 0x64, 0x6b, 0x5f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, + 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x66, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x64, 0x6b, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, + 0x72, 0x69, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0d, 0x73, 0x64, 0x6b, 0x43, 0x61, + 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x1a, 0x56, 0x0a, 0x12, 0x53, 0x64, 0x6b, 0x43, + 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x2a, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, + 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, + 0x22, 0x36, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, + 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x78, 0x61, + 0x6d, 0x70, 0x6c, 0x65, 0x55, 0x75, 0x69, 0x64, 0x22, 0x28, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x45, + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, + 0x64, 0x65, 0x2a, 0x52, 0x0a, 0x03, 0x53, 0x64, 0x6b, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x44, 0x4b, + 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, + 0x0a, 0x08, 0x53, 0x44, 0x4b, 0x5f, 0x4a, 0x41, 0x56, 0x41, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, + 0x53, 0x44, 0x4b, 0x5f, 0x47, 0x4f, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x53, 0x44, 0x4b, 0x5f, + 0x50, 0x59, 0x54, 0x48, 0x4f, 0x4e, 0x10, 0x03, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x44, 0x4b, 0x5f, + 0x53, 0x43, 0x49, 0x4f, 0x10, 0x04, 0x2a, 0x8f, 0x01, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, + 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x54, 0x41, + 0x54, 0x55, 0x53, 0x5f, 0x45, 0x58, 0x45, 0x43, 0x55, 0x54, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, + 0x13, 0x0a, 0x0f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x46, 0x49, 0x4e, 0x49, 0x53, 0x48, + 0x45, 0x44, 0x10, 0x02, 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x45, + 0x52, 0x52, 0x4f, 0x52, 0x10, 0x03, 0x12, 0x18, 0x0a, 0x14, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, + 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x49, 0x4c, 0x45, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x04, + 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52, 0x55, 0x4e, 0x5f, 0x54, + 0x49, 0x4d, 0x45, 0x4f, 0x55, 0x54, 0x10, 0x05, 0x32, 0xa5, 0x04, 0x0a, 0x11, 0x50, 0x6c, 0x61, + 0x79, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3a, + 0x0a, 0x07, 0x52, 0x75, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x52, 0x75, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x75, 0x6e, 0x43, 0x6f, + 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x0b, 0x43, 0x68, + 0x65, 0x63, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x26, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x3e, 0x0a, 0x17, 0x47, 0x65, - 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, - 0x65, 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x69, - 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x55, 0x75, 0x69, 0x64, 0x22, 0x71, 0x0a, 0x18, 0x47, 0x65, - 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x3d, - 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x11, 0x63, 0x6f, 0x6d, 0x70, - 0x69, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x3a, 0x0a, - 0x13, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, - 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x69, 0x70, - 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x55, 0x75, 0x69, 0x64, 0x22, 0x6d, 0x0a, 0x14, 0x47, 0x65, 0x74, - 0x52, 0x75, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x3d, 0x0a, 0x12, 0x63, 0x6f, 0x6d, - 0x70, 0x69, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x11, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x55, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x4c, - 0x69, 0x73, 0x74, 0x4f, 0x66, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x03, 0x73, 0x64, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x0b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x64, 0x6b, 0x52, 0x03, - 0x73, 0x64, 0x6b, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x22, - 0x24, 0x0a, 0x08, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x65, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x65, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x22, 0xbe, 0x01, 0x0a, 0x0c, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, - 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x57, 0x0a, 0x11, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, - 0x72, 0x79, 0x5f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x2a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, - 0x6f, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, - 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x10, 0x63, - 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x1a, - 0x55, 0x0a, 0x15, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x45, 0x78, 0x61, 0x6d, 0x70, - 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x26, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x31, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xd0, 0x01, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x4c, 0x69, - 0x73, 0x74, 0x4f, 0x66, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5b, 0x0a, 0x0e, 0x73, 0x64, 0x6b, 0x5f, 0x63, 0x61, 0x74, 0x65, - 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x66, 0x45, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, - 0x53, 0x64, 0x6b, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x52, 0x0d, 0x73, 0x64, 0x6b, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, - 0x73, 0x1a, 0x56, 0x0a, 0x12, 0x53, 0x64, 0x6b, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, - 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2a, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x31, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x36, 0x0a, 0x11, 0x47, 0x65, 0x74, - 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, - 0x0a, 0x0c, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x55, 0x75, 0x69, - 0x64, 0x22, 0x28, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x2a, 0x52, 0x0a, 0x03, 0x53, - 0x64, 0x6b, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x44, 0x4b, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, - 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x44, 0x4b, 0x5f, 0x4a, - 0x41, 0x56, 0x41, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x44, 0x4b, 0x5f, 0x47, 0x4f, 0x10, - 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x53, 0x44, 0x4b, 0x5f, 0x50, 0x59, 0x54, 0x48, 0x4f, 0x4e, 0x10, - 0x03, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x44, 0x4b, 0x5f, 0x53, 0x43, 0x49, 0x4f, 0x10, 0x04, 0x2a, - 0x8f, 0x01, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, - 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, - 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x45, 0x58, 0x45, - 0x43, 0x55, 0x54, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x54, 0x41, 0x54, - 0x55, 0x53, 0x5f, 0x46, 0x49, 0x4e, 0x49, 0x53, 0x48, 0x45, 0x44, 0x10, 0x02, 0x12, 0x10, 0x0a, - 0x0c, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x03, 0x12, - 0x18, 0x0a, 0x14, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x49, 0x4c, - 0x45, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x04, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, - 0x54, 0x55, 0x53, 0x5f, 0x52, 0x55, 0x4e, 0x5f, 0x54, 0x49, 0x4d, 0x45, 0x4f, 0x55, 0x54, 0x10, - 0x05, 0x32, 0xa5, 0x04, 0x0a, 0x11, 0x50, 0x6c, 0x61, 0x79, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3a, 0x0a, 0x07, 0x52, 0x75, 0x6e, 0x43, 0x6f, - 0x64, 0x65, 0x12, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x75, 0x6e, 0x43, - 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x75, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x0b, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x12, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, - 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x0c, 0x47, - 0x65, 0x74, 0x52, 0x75, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x1b, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, - 0x70, 0x69, 0x6c, 0x65, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x1f, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x4f, 0x75, - 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x4f, - 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, - 0x11, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x66, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, - 0x65, 0x73, 0x12, 0x20, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4c, - 0x69, 0x73, 0x74, 0x4f, 0x66, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, - 0x74, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x66, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x45, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, - 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, - 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x10, - 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, - 0x12, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, - 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x38, 0x5a, 0x36, 0x62, 0x65, 0x61, - 0x6d, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x6c, 0x61, - 0x79, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x2f, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x3b, 0x70, 0x6c, 0x61, 0x79, 0x67, 0x72, 0x6f, - 0x75, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x65, 0x12, 0x49, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6e, 0x4f, 0x75, 0x74, 0x70, + 0x75, 0x74, 0x12, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, + 0x75, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6e, 0x4f, + 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, + 0x10, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x4f, 0x75, 0x74, 0x70, 0x75, + 0x74, 0x12, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, + 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, + 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x4f, + 0x66, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x12, 0x20, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x66, 0x45, 0x78, 0x61, 0x6d, + 0x70, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x66, 0x45, 0x78, + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, + 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x19, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, + 0x65, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, + 0x75, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x42, 0x38, 0x5a, 0x36, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, + 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x6c, 0x61, 0x79, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2f, 0x62, + 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x3b, + 0x70, 0x6c, 0x61, 0x79, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( - file_api_proto_rawDescOnce sync.Once - file_api_proto_rawDescData = file_api_proto_rawDesc + file_api_v1_api_proto_rawDescOnce sync.Once + file_api_v1_api_proto_rawDescData = file_api_v1_api_proto_rawDesc ) -func file_api_proto_rawDescGZIP() []byte { - file_api_proto_rawDescOnce.Do(func() { - file_api_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_proto_rawDescData) +func file_api_v1_api_proto_rawDescGZIP() []byte { + file_api_v1_api_proto_rawDescOnce.Do(func() { + file_api_v1_api_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_v1_api_proto_rawDescData) }) - return file_api_proto_rawDescData + return file_api_v1_api_proto_rawDescData } -var file_api_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_api_proto_msgTypes = make([]protoimpl.MessageInfo, 16) -var file_api_proto_goTypes = []interface{}{ +var file_api_v1_api_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_api_v1_api_proto_msgTypes = make([]protoimpl.MessageInfo, 16) +var file_api_v1_api_proto_goTypes = []interface{}{ (Sdk)(0), // 0: api.v1.Sdk (Status)(0), // 1: api.v1.Status (*RunCodeRequest)(nil), // 2: api.v1.RunCodeRequest @@ -1024,7 +1025,7 @@ var file_api_proto_goTypes = []interface{}{ nil, // 16: api.v1.CategoryList.CategoryExamplesEntry nil, // 17: api.v1.GetListOfExamplesResponse.SdkCategoriesEntry } -var file_api_proto_depIdxs = []int32{ +var file_api_v1_api_proto_depIdxs = []int32{ 0, // 0: api.v1.RunCodeRequest.sdk:type_name -> api.v1.Sdk 1, // 1: api.v1.CheckStatusResponse.status:type_name -> api.v1.Status 1, // 2: api.v1.GetCompileOutputResponse.compilation_status:type_name -> api.v1.Status @@ -1055,13 +1056,13 @@ var file_api_proto_depIdxs = []int32{ 0, // [0:9] is the sub-list for field type_name } -func init() { file_api_proto_init() } -func file_api_proto_init() { - if File_api_proto != nil { +func init() { file_api_v1_api_proto_init() } +func file_api_v1_api_proto_init() { + if File_api_v1_api_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_api_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_api_v1_api_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RunCodeRequest); i { case 0: return &v.state @@ -1073,7 +1074,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_api_v1_api_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RunCodeResponse); i { case 0: return &v.state @@ -1085,7 +1086,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_api_v1_api_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CheckStatusRequest); i { case 0: return &v.state @@ -1097,7 +1098,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_api_v1_api_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CheckStatusResponse); i { case 0: return &v.state @@ -1109,7 +1110,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_api_v1_api_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetCompileOutputRequest); i { case 0: return &v.state @@ -1121,7 +1122,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_api_v1_api_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetCompileOutputResponse); i { case 0: return &v.state @@ -1133,7 +1134,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_api_v1_api_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetRunOutputRequest); i { case 0: return &v.state @@ -1145,7 +1146,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_api_v1_api_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetRunOutputResponse); i { case 0: return &v.state @@ -1157,7 +1158,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_api_v1_api_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetListOfExamplesRequest); i { case 0: return &v.state @@ -1169,7 +1170,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_api_v1_api_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Examples); i { case 0: return &v.state @@ -1181,7 +1182,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_api_v1_api_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CategoryList); i { case 0: return &v.state @@ -1193,7 +1194,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_api_v1_api_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetListOfExamplesResponse); i { case 0: return &v.state @@ -1205,7 +1206,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_api_v1_api_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetExampleRequest); i { case 0: return &v.state @@ -1217,7 +1218,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_api_v1_api_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetExampleResponse); i { case 0: return &v.state @@ -1234,19 +1235,19 @@ func file_api_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_api_proto_rawDesc, + RawDescriptor: file_api_v1_api_proto_rawDesc, NumEnums: 2, NumMessages: 16, NumExtensions: 0, NumServices: 1, }, - GoTypes: file_api_proto_goTypes, - DependencyIndexes: file_api_proto_depIdxs, - EnumInfos: file_api_proto_enumTypes, - MessageInfos: file_api_proto_msgTypes, + GoTypes: file_api_v1_api_proto_goTypes, + DependencyIndexes: file_api_v1_api_proto_depIdxs, + EnumInfos: file_api_v1_api_proto_enumTypes, + MessageInfos: file_api_v1_api_proto_msgTypes, }.Build() - File_api_proto = out.File - file_api_proto_rawDesc = nil - file_api_proto_goTypes = nil - file_api_proto_depIdxs = nil + File_api_v1_api_proto = out.File + file_api_v1_api_proto_rawDesc = nil + file_api_v1_api_proto_goTypes = nil + file_api_v1_api_proto_depIdxs = nil } diff --git a/playground/backend/internal/api/v1/api_grpc.pb.go b/playground/backend/internal/api/v1/api_grpc.pb.go index 2b426f0720eb..ee73acd319f8 100644 --- a/playground/backend/internal/api/v1/api_grpc.pb.go +++ b/playground/backend/internal/api/v1/api_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. -package v1 +package playground import ( context "context" @@ -106,7 +106,7 @@ func (c *playgroundServiceClient) GetExampleOutput(ctx context.Context, in *GetE } // PlaygroundServiceServer is the server API for PlaygroundService service. -// All implementations must embed UnimplementedPlaygroundServiceServer +// All implementations should embed UnimplementedPlaygroundServiceServer // for forward compatibility type PlaygroundServiceServer interface { // Submit the job for an execution and get the pipeline uuid. @@ -123,10 +123,9 @@ type PlaygroundServiceServer interface { GetExample(context.Context, *GetExampleRequest) (*GetExampleResponse, error) // Get the precompiled details of an example. GetExampleOutput(context.Context, *GetExampleRequest) (*GetRunOutputResponse, error) - mustEmbedUnimplementedPlaygroundServiceServer() } -// UnimplementedPlaygroundServiceServer must be embedded to have forward compatible implementations. +// UnimplementedPlaygroundServiceServer should be embedded to have forward compatible implementations. type UnimplementedPlaygroundServiceServer struct { } @@ -151,7 +150,6 @@ func (UnimplementedPlaygroundServiceServer) GetExample(context.Context, *GetExam func (UnimplementedPlaygroundServiceServer) GetExampleOutput(context.Context, *GetExampleRequest) (*GetRunOutputResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetExampleOutput not implemented") } -func (UnimplementedPlaygroundServiceServer) mustEmbedUnimplementedPlaygroundServiceServer() {} // UnsafePlaygroundServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to PlaygroundServiceServer will @@ -327,5 +325,5 @@ var PlaygroundService_ServiceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "api.proto", + Metadata: "api/v1/api.proto", } diff --git a/playground/frontend/lib/api/v1/api.pb.dart b/playground/frontend/lib/api/v1/api.pb.dart index 9c503e45d390..8db2b79f226a 100644 --- a/playground/frontend/lib/api/v1/api.pb.dart +++ b/playground/frontend/lib/api/v1/api.pb.dart @@ -16,12 +16,6 @@ * limitations under the License. */ /// -// Generated code. Do not modify. -// source: api/v1/api.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; @@ -432,19 +426,502 @@ class GetRunOutputResponse extends $pb.GeneratedMessage { @$pb.TagNumber(1) $core.String get output => $_getSZ(0); @$pb.TagNumber(1) - set output($core.String v) { $_setString(0, v); } + set output($core.String v) { + $_setString(0, v); + } + @$pb.TagNumber(1) $core.bool hasOutput() => $_has(0); + @$pb.TagNumber(1) void clearOutput() => clearField(1); @$pb.TagNumber(2) Status get compilationStatus => $_getN(1); + @$pb.TagNumber(2) - set compilationStatus(Status v) { setField(2, v); } + set compilationStatus(Status v) { + setField(2, v); + } + @$pb.TagNumber(2) $core.bool hasCompilationStatus() => $_has(1); + @$pb.TagNumber(2) void clearCompilationStatus() => clearField(2); } +class GetListOfExamplesRequest extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + const $core.bool.fromEnvironment('protobuf.omit_message_names') + ? '' + : 'GetListOfExamplesRequest', + package: const $pb.PackageName( + const $core.bool.fromEnvironment('protobuf.omit_message_names') + ? '' + : 'api.v1'), + createEmptyInstance: create) + ..e( + 1, + const $core.bool.fromEnvironment('protobuf.omit_field_names') + ? '' + : 'sdk', + $pb.PbFieldType.OE, + defaultOrMaker: Sdk.SDK_UNSPECIFIED, + valueOf: Sdk.valueOf, + enumValues: Sdk.values) + ..aOS( + 2, + const $core.bool.fromEnvironment('protobuf.omit_field_names') + ? '' + : 'category') + ..hasRequiredFields = false; + + GetListOfExamplesRequest._() : super(); + + factory GetListOfExamplesRequest({ + Sdk? sdk, + $core.String? category, + }) { + final _result = create(); + if (sdk != null) { + _result.sdk = sdk; + } + if (category != null) { + _result.category = category; + } + return _result; + } + + factory GetListOfExamplesRequest.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + + factory GetListOfExamplesRequest.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') + GetListOfExamplesRequest clone() => + GetListOfExamplesRequest()..mergeFromMessage(this); + + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + GetListOfExamplesRequest copyWith( + void Function(GetListOfExamplesRequest) updates) => + super.copyWith((message) => updates(message as GetListOfExamplesRequest)) + as GetListOfExamplesRequest; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static GetListOfExamplesRequest create() => GetListOfExamplesRequest._(); + + GetListOfExamplesRequest createEmptyInstance() => create(); + + static $pb.PbList createRepeated() => + $pb.PbList(); + + @$core.pragma('dart2js:noInline') + static GetListOfExamplesRequest getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); + static GetListOfExamplesRequest? _defaultInstance; + + @$pb.TagNumber(1) + Sdk get sdk => $_getN(0); + + @$pb.TagNumber(1) + set sdk(Sdk v) { + setField(1, v); + } + + @$pb.TagNumber(1) + $core.bool hasSdk() => $_has(0); + + @$pb.TagNumber(1) + void clearSdk() => clearField(1); + + @$pb.TagNumber(2) + $core.String get category => $_getSZ(1); + + @$pb.TagNumber(2) + set category($core.String v) { + $_setString(1, v); + } + + @$pb.TagNumber(2) + $core.bool hasCategory() => $_has(1); + + @$pb.TagNumber(2) + void clearCategory() => clearField(2); +} + +class Examples extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + const $core.bool.fromEnvironment('protobuf.omit_message_names') + ? '' + : 'Examples', + package: const $pb.PackageName( + const $core.bool.fromEnvironment('protobuf.omit_message_names') + ? '' + : 'api.v1'), + createEmptyInstance: create) + ..pPS( + 1, + const $core.bool.fromEnvironment('protobuf.omit_field_names') + ? '' + : 'example') + ..hasRequiredFields = false; + + Examples._() : super(); + + factory Examples({ + $core.Iterable<$core.String>? example, + }) { + final _result = create(); + if (example != null) { + _result.example.addAll(example); + } + return _result; + } + + factory Examples.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + + factory Examples.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') + Examples clone() => Examples()..mergeFromMessage(this); + + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Examples copyWith(void Function(Examples) updates) => + super.copyWith((message) => updates(message as Examples)) + as Examples; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static Examples create() => Examples._(); + + Examples createEmptyInstance() => create(); + + static $pb.PbList createRepeated() => $pb.PbList(); + + @$core.pragma('dart2js:noInline') + static Examples getDefault() => + _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static Examples? _defaultInstance; + + @$pb.TagNumber(1) + $core.List<$core.String> get example => $_getList(0); +} + +class CategoryList extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + const $core.bool.fromEnvironment('protobuf.omit_message_names') + ? '' + : 'CategoryList', + package: const $pb.PackageName( + const $core.bool.fromEnvironment('protobuf.omit_message_names') + ? '' + : 'api.v1'), + createEmptyInstance: create) + ..m<$core.String, Examples>( + 1, + const $core.bool.fromEnvironment('protobuf.omit_field_names') + ? '' + : 'categoryExamples', + entryClassName: 'CategoryList.CategoryExamplesEntry', + keyFieldType: $pb.PbFieldType.OS, + valueFieldType: $pb.PbFieldType.OM, + valueCreator: Examples.create, + packageName: const $pb.PackageName('api.v1')) + ..hasRequiredFields = false; + + CategoryList._() : super(); + + factory CategoryList({ + $core.Map<$core.String, Examples>? categoryExamples, + }) { + final _result = create(); + if (categoryExamples != null) { + _result.categoryExamples.addAll(categoryExamples); + } + return _result; + } + + factory CategoryList.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + + factory CategoryList.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') + CategoryList clone() => CategoryList()..mergeFromMessage(this); + + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + CategoryList copyWith(void Function(CategoryList) updates) => + super.copyWith((message) => updates(message as CategoryList)) + as CategoryList; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static CategoryList create() => CategoryList._(); + + CategoryList createEmptyInstance() => create(); + + static $pb.PbList createRepeated() => + $pb.PbList(); + + @$core.pragma('dart2js:noInline') + static CategoryList getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); + static CategoryList? _defaultInstance; + + @$pb.TagNumber(1) + $core.Map<$core.String, Examples> get categoryExamples => $_getMap(0); +} + +class GetListOfExamplesResponse extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + const $core.bool.fromEnvironment('protobuf.omit_message_names') + ? '' + : 'GetListOfExamplesResponse', + package: const $pb.PackageName( + const $core.bool.fromEnvironment('protobuf.omit_message_names') + ? '' + : 'api.v1'), + createEmptyInstance: create) + ..m<$core.String, CategoryList>( + 1, + const $core.bool.fromEnvironment('protobuf.omit_field_names') + ? '' + : 'sdkCategories', + entryClassName: 'GetListOfExamplesResponse.SdkCategoriesEntry', + keyFieldType: $pb.PbFieldType.OS, + valueFieldType: $pb.PbFieldType.OM, + valueCreator: CategoryList.create, + packageName: const $pb.PackageName('api.v1')) + ..hasRequiredFields = false; + + GetListOfExamplesResponse._() : super(); + + factory GetListOfExamplesResponse({ + $core.Map<$core.String, CategoryList>? sdkCategories, + }) { + final _result = create(); + if (sdkCategories != null) { + _result.sdkCategories.addAll(sdkCategories); + } + return _result; + } + + factory GetListOfExamplesResponse.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + + factory GetListOfExamplesResponse.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') + GetListOfExamplesResponse clone() => + GetListOfExamplesResponse()..mergeFromMessage(this); + + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + GetListOfExamplesResponse copyWith( + void Function(GetListOfExamplesResponse) updates) => + super.copyWith((message) => updates(message as GetListOfExamplesResponse)) + as GetListOfExamplesResponse; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static GetListOfExamplesResponse create() => GetListOfExamplesResponse._(); + + GetListOfExamplesResponse createEmptyInstance() => create(); + + static $pb.PbList createRepeated() => + $pb.PbList(); + + @$core.pragma('dart2js:noInline') + static GetListOfExamplesResponse getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); + static GetListOfExamplesResponse? _defaultInstance; + + @$pb.TagNumber(1) + $core.Map<$core.String, CategoryList> get sdkCategories => $_getMap(0); +} + +class GetExampleRequest extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + const $core.bool.fromEnvironment('protobuf.omit_message_names') + ? '' + : 'GetExampleRequest', + package: const $pb.PackageName( + const $core.bool.fromEnvironment('protobuf.omit_message_names') + ? '' + : 'api.v1'), + createEmptyInstance: create) + ..aOS( + 1, + const $core.bool.fromEnvironment('protobuf.omit_field_names') + ? '' + : 'exampleUuid') + ..hasRequiredFields = false; + + GetExampleRequest._() : super(); + + factory GetExampleRequest({ + $core.String? exampleUuid, + }) { + final _result = create(); + if (exampleUuid != null) { + _result.exampleUuid = exampleUuid; + } + return _result; + } + + factory GetExampleRequest.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + + factory GetExampleRequest.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') + GetExampleRequest clone() => GetExampleRequest()..mergeFromMessage(this); + + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + GetExampleRequest copyWith(void Function(GetExampleRequest) updates) => + super.copyWith((message) => updates(message as GetExampleRequest)) + as GetExampleRequest; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static GetExampleRequest create() => GetExampleRequest._(); + + GetExampleRequest createEmptyInstance() => create(); + + static $pb.PbList createRepeated() => + $pb.PbList(); + + @$core.pragma('dart2js:noInline') + static GetExampleRequest getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); + static GetExampleRequest? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get exampleUuid => $_getSZ(0); + + @$pb.TagNumber(1) + set exampleUuid($core.String v) { + $_setString(0, v); + } + + @$pb.TagNumber(1) + $core.bool hasExampleUuid() => $_has(0); + + @$pb.TagNumber(1) + void clearExampleUuid() => clearField(1); +} + +class GetExampleResponse extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + const $core.bool.fromEnvironment('protobuf.omit_message_names') + ? '' + : 'GetExampleResponse', + package: const $pb.PackageName( + const $core.bool.fromEnvironment('protobuf.omit_message_names') + ? '' + : 'api.v1'), + createEmptyInstance: create) + ..aOS( + 1, + const $core.bool.fromEnvironment('protobuf.omit_field_names') + ? '' + : 'code') + ..hasRequiredFields = false; + + GetExampleResponse._() : super(); + + factory GetExampleResponse({ + $core.String? code, + }) { + final _result = create(); + if (code != null) { + _result.code = code; + } + return _result; + } + + factory GetExampleResponse.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + + factory GetExampleResponse.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') + GetExampleResponse clone() => GetExampleResponse()..mergeFromMessage(this); + + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + GetExampleResponse copyWith(void Function(GetExampleResponse) updates) => + super.copyWith((message) => updates(message as GetExampleResponse)) + as GetExampleResponse; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static GetExampleResponse create() => GetExampleResponse._(); + + GetExampleResponse createEmptyInstance() => create(); + + static $pb.PbList createRepeated() => + $pb.PbList(); + + @$core.pragma('dart2js:noInline') + static GetExampleResponse getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); + static GetExampleResponse? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get code => $_getSZ(0); + + @$pb.TagNumber(1) + set code($core.String v) { + $_setString(0, v); + } + + @$pb.TagNumber(1) + $core.bool hasCode() => $_has(0); + + @$pb.TagNumber(1) + void clearCode() => clearField(1); +} diff --git a/playground/frontend/lib/api/v1/api.pbenum.dart b/playground/frontend/lib/api/v1/api.pbenum.dart index e1cf8498de72..96fe5aec3e42 100644 --- a/playground/frontend/lib/api/v1/api.pbenum.dart +++ b/playground/frontend/lib/api/v1/api.pbenum.dart @@ -16,14 +16,8 @@ * limitations under the License. */ /// -// Generated code. Do not modify. -// source: api/v1/api.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 Sdk extends $pb.ProtobufEnum { @@ -48,16 +42,44 @@ class Sdk extends $pb.ProtobufEnum { } class Status extends $pb.ProtobufEnum { - static const Status STATUS_UNSPECIFIED = Status._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'STATUS_UNSPECIFIED'); - static const Status STATUS_EXECUTING = Status._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'STATUS_EXECUTING'); - static const Status STATUS_FINISHED = Status._(2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'STATUS_FINISHED'); - static const Status STATUS_ERROR = Status._(3, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'STATUS_ERROR'); + static const Status STATUS_UNSPECIFIED = Status._( + 0, + const $core.bool.fromEnvironment('protobuf.omit_enum_names') + ? '' + : 'STATUS_UNSPECIFIED'); + static const Status STATUS_EXECUTING = Status._( + 1, + const $core.bool.fromEnvironment('protobuf.omit_enum_names') + ? '' + : 'STATUS_EXECUTING'); + static const Status STATUS_FINISHED = Status._( + 2, + const $core.bool.fromEnvironment('protobuf.omit_enum_names') + ? '' + : 'STATUS_FINISHED'); + static const Status STATUS_ERROR = Status._( + 3, + const $core.bool.fromEnvironment('protobuf.omit_enum_names') + ? '' + : 'STATUS_ERROR'); + static const Status STATUS_COMPILE_ERROR = Status._( + 4, + const $core.bool.fromEnvironment('protobuf.omit_enum_names') + ? '' + : 'STATUS_COMPILE_ERROR'); + static const Status STATUS_RUN_TIMEOUT = Status._( + 5, + const $core.bool.fromEnvironment('protobuf.omit_enum_names') + ? '' + : 'STATUS_RUN_TIMEOUT'); - static const $core.List values = [ + static const $core.List values = [ STATUS_UNSPECIFIED, STATUS_EXECUTING, STATUS_FINISHED, STATUS_ERROR, + STATUS_COMPILE_ERROR, + STATUS_RUN_TIMEOUT, ]; static final $core.Map<$core.int, Status> _byValue = $pb.ProtobufEnum.initByValue(values); diff --git a/playground/frontend/lib/api/v1/api.pbgrpc.dart b/playground/frontend/lib/api/v1/api.pbgrpc.dart index 3cfd2583575e..1401382b638d 100644 --- a/playground/frontend/lib/api/v1/api.pbgrpc.dart +++ b/playground/frontend/lib/api/v1/api.pbgrpc.dart @@ -16,18 +16,13 @@ * limitations under the License. */ /// -// Generated code. Do not modify. -// source: api/v1/api.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:async' as $async; - import 'dart:core' as $core; import 'package:grpc/service_api.dart' as $grpc; + import 'api.pb.dart' as $0; + export 'api.pb.dart'; class PlaygroundServiceClient extends $grpc.Client { @@ -55,6 +50,24 @@ class PlaygroundServiceClient extends $grpc.Client { ($0.GetCompileOutputRequest value) => value.writeToBuffer(), ($core.List<$core.int> value) => $0.GetCompileOutputResponse.fromBuffer(value)); + static final _$getListOfExamples = $grpc.ClientMethod< + $0.GetListOfExamplesRequest, $0.GetListOfExamplesResponse>( + '/api.v1.PlaygroundService/GetListOfExamples', + ($0.GetListOfExamplesRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => + $0.GetListOfExamplesResponse.fromBuffer(value)); + static final _$getExample = + $grpc.ClientMethod<$0.GetExampleRequest, $0.GetExampleResponse>( + '/api.v1.PlaygroundService/GetExample', + ($0.GetExampleRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => + $0.GetExampleResponse.fromBuffer(value)); + static final _$getExampleOutput = + $grpc.ClientMethod<$0.GetExampleRequest, $0.GetRunOutputResponse>( + '/api.v1.PlaygroundService/GetExampleOutput', + ($0.GetExampleRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => + $0.GetRunOutputResponse.fromBuffer(value)); PlaygroundServiceClient($grpc.ClientChannel channel, {$grpc.CallOptions? options, @@ -83,6 +96,24 @@ class PlaygroundServiceClient extends $grpc.Client { {$grpc.CallOptions? options}) { return $createUnaryCall(_$getCompileOutput, request, options: options); } + + $grpc.ResponseFuture<$0.GetListOfExamplesResponse> getListOfExamples( + $0.GetListOfExamplesRequest request, + {$grpc.CallOptions? options}) { + return $createUnaryCall(_$getListOfExamples, request, options: options); + } + + $grpc.ResponseFuture<$0.GetExampleResponse> getExample( + $0.GetExampleRequest request, + {$grpc.CallOptions? options}) { + return $createUnaryCall(_$getExample, request, options: options); + } + + $grpc.ResponseFuture<$0.GetRunOutputResponse> getExampleOutput( + $0.GetExampleRequest request, + {$grpc.CallOptions? options}) { + return $createUnaryCall(_$getExampleOutput, request, options: options); + } } abstract class PlaygroundServiceBase extends $grpc.Service { @@ -123,6 +154,31 @@ abstract class PlaygroundServiceBase extends $grpc.Service { ($core.List<$core.int> value) => $0.GetCompileOutputRequest.fromBuffer(value), ($0.GetCompileOutputResponse value) => value.writeToBuffer())); + $addMethod($grpc.ServiceMethod<$0.GetListOfExamplesRequest, + $0.GetListOfExamplesResponse>( + 'GetListOfExamples', + getListOfExamples_Pre, + false, + false, + ($core.List<$core.int> value) => + $0.GetListOfExamplesRequest.fromBuffer(value), + ($0.GetListOfExamplesResponse value) => value.writeToBuffer())); + $addMethod($grpc.ServiceMethod<$0.GetExampleRequest, $0.GetExampleResponse>( + 'GetExample', + getExample_Pre, + false, + false, + ($core.List<$core.int> value) => $0.GetExampleRequest.fromBuffer(value), + ($0.GetExampleResponse value) => value.writeToBuffer())); + $addMethod( + $grpc.ServiceMethod<$0.GetExampleRequest, $0.GetRunOutputResponse>( + 'GetExampleOutput', + getExampleOutput_Pre, + false, + false, + ($core.List<$core.int> value) => + $0.GetExampleRequest.fromBuffer(value), + ($0.GetRunOutputResponse value) => value.writeToBuffer())); } $async.Future<$0.RunCodeResponse> runCode_Pre( @@ -147,12 +203,41 @@ abstract class PlaygroundServiceBase extends $grpc.Service { return getCompileOutput(call, await request); } + $async.Future<$0.GetListOfExamplesResponse> getListOfExamples_Pre( + $grpc.ServiceCall call, + $async.Future<$0.GetListOfExamplesRequest> request) async { + return getListOfExamples(call, await request); + } + + $async.Future<$0.GetExampleResponse> getExample_Pre($grpc.ServiceCall call, + $async.Future<$0.GetExampleRequest> request) async { + return getExample(call, await request); + } + + $async.Future<$0.GetRunOutputResponse> getExampleOutput_Pre( + $grpc.ServiceCall call, + $async.Future<$0.GetExampleRequest> request) async { + return getExampleOutput(call, await request); + } + $async.Future<$0.RunCodeResponse> runCode( $grpc.ServiceCall call, $0.RunCodeRequest request); + $async.Future<$0.CheckStatusResponse> checkStatus( $grpc.ServiceCall call, $0.CheckStatusRequest request); + $async.Future<$0.GetRunOutputResponse> getRunOutput( $grpc.ServiceCall call, $0.GetRunOutputRequest request); + $async.Future<$0.GetCompileOutputResponse> getCompileOutput( $grpc.ServiceCall call, $0.GetCompileOutputRequest request); + + $async.Future<$0.GetListOfExamplesResponse> getListOfExamples( + $grpc.ServiceCall call, $0.GetListOfExamplesRequest request); + + $async.Future<$0.GetExampleResponse> getExample( + $grpc.ServiceCall call, $0.GetExampleRequest request); + + $async.Future<$0.GetRunOutputResponse> getExampleOutput( + $grpc.ServiceCall call, $0.GetExampleRequest request); } diff --git a/playground/frontend/lib/api/v1/api.pbjson.dart b/playground/frontend/lib/api/v1/api.pbjson.dart index 4b29e56722e2..3d90e7d6e82e 100644 --- a/playground/frontend/lib/api/v1/api.pbjson.dart +++ b/playground/frontend/lib/api/v1/api.pbjson.dart @@ -16,15 +16,10 @@ * limitations under the License. */ /// -// Generated code. Do not modify. -// source: api/v1/api.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:core' as $core; import 'dart:typed_data' as $typed_data; + @$core.Deprecated('Use sdkDescriptor instead') const Sdk$json = const { '1': 'Sdk', @@ -47,17 +42,27 @@ const Status$json = const { const {'1': 'STATUS_EXECUTING', '2': 1}, const {'1': 'STATUS_FINISHED', '2': 2}, const {'1': 'STATUS_ERROR', '2': 3}, + const {'1': 'STATUS_COMPILE_ERROR', '2': 4}, + const {'1': 'STATUS_RUN_TIMEOUT', '2': 5}, ], }; /// Descriptor for `Status`. Decode as a `google.protobuf.EnumDescriptorProto`. -final $typed_data.Uint8List statusDescriptor = $convert.base64Decode('CgZTdGF0dXMSFgoSU1RBVFVTX1VOU1BFQ0lGSUVEEAASFAoQU1RBVFVTX0VYRUNVVElORxABEhMKD1NUQVRVU19GSU5JU0hFRBACEhAKDFNUQVRVU19FUlJPUhAD'); +final $typed_data.Uint8List statusDescriptor = $convert.base64Decode( + 'CgZTdGF0dXMSFgoSU1RBVFVTX1VOU1BFQ0lGSUVEEAASFAoQU1RBVFVTX0VYRUNVVElORxABEhMKD1NUQVRVU19GSU5JU0hFRBACEhAKDFNUQVRVU19FUlJPUhADEhgKFFNUQVRVU19DT01QSUxFX0VSUk9SEAQSFgoSU1RBVFVTX1JVTl9USU1FT1VUEAU='); @$core.Deprecated('Use runCodeRequestDescriptor instead') const RunCodeRequest$json = const { '1': 'RunCodeRequest', '2': const [ const {'1': 'code', '3': 1, '4': 1, '5': 9, '10': 'code'}, - const {'1': 'sdk', '3': 2, '4': 1, '5': 14, '6': '.api.v1.Sdk', '10': 'sdk'}, + const { + '1': 'sdk', + '3': 2, + '4': 1, + '5': 14, + '6': '.api.v1.Sdk', + '10': 'sdk' + }, ], }; @@ -129,9 +134,143 @@ const GetRunOutputResponse$json = const { '1': 'GetRunOutputResponse', '2': const [ const {'1': 'output', '3': 1, '4': 1, '5': 9, '10': 'output'}, - const {'1': 'compilation_status', '3': 2, '4': 1, '5': 14, '6': '.api.v1.Status', '10': 'compilationStatus'}, + const { + '1': 'compilation_status', + '3': 2, + '4': 1, + '5': 14, + '6': '.api.v1.Status', + '10': 'compilationStatus' + }, ], }; /// Descriptor for `GetRunOutputResponse`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List getRunOutputResponseDescriptor = $convert.base64Decode('ChRHZXRSdW5PdXRwdXRSZXNwb25zZRIWCgZvdXRwdXQYASABKAlSBm91dHB1dBI9ChJjb21waWxhdGlvbl9zdGF0dXMYAiABKA4yDi5hcGkudjEuU3RhdHVzUhFjb21waWxhdGlvblN0YXR1cw=='); +final $typed_data.Uint8List getRunOutputResponseDescriptor = $convert.base64Decode( + 'ChRHZXRSdW5PdXRwdXRSZXNwb25zZRIWCgZvdXRwdXQYASABKAlSBm91dHB1dBI9ChJjb21waWxhdGlvbl9zdGF0dXMYAiABKA4yDi5hcGkudjEuU3RhdHVzUhFjb21waWxhdGlvblN0YXR1cw=='); +@$core.Deprecated('Use getListOfExamplesRequestDescriptor instead') +const GetListOfExamplesRequest$json = const { + '1': 'GetListOfExamplesRequest', + '2': const [ + const { + '1': 'sdk', + '3': 1, + '4': 1, + '5': 14, + '6': '.api.v1.Sdk', + '10': 'sdk' + }, + const {'1': 'category', '3': 2, '4': 1, '5': 9, '10': 'category'}, + ], +}; + +/// Descriptor for `GetListOfExamplesRequest`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List getListOfExamplesRequestDescriptor = + $convert.base64Decode( + 'ChhHZXRMaXN0T2ZFeGFtcGxlc1JlcXVlc3QSHQoDc2RrGAEgASgOMgsuYXBpLnYxLlNka1IDc2RrEhoKCGNhdGVnb3J5GAIgASgJUghjYXRlZ29yeQ=='); +@$core.Deprecated('Use examplesDescriptor instead') +const Examples$json = const { + '1': 'Examples', + '2': const [ + const {'1': 'example', '3': 1, '4': 3, '5': 9, '10': 'example'}, + ], +}; + +/// Descriptor for `Examples`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List examplesDescriptor = + $convert.base64Decode('CghFeGFtcGxlcxIYCgdleGFtcGxlGAEgAygJUgdleGFtcGxl'); +@$core.Deprecated('Use categoryListDescriptor instead') +const CategoryList$json = const { + '1': 'CategoryList', + '2': const [ + const { + '1': 'category_examples', + '3': 1, + '4': 3, + '5': 11, + '6': '.api.v1.CategoryList.CategoryExamplesEntry', + '10': 'categoryExamples' + }, + ], + '3': const [CategoryList_CategoryExamplesEntry$json], +}; + +@$core.Deprecated('Use categoryListDescriptor instead') +const CategoryList_CategoryExamplesEntry$json = const { + '1': 'CategoryExamplesEntry', + '2': const [ + const {'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'}, + const { + '1': 'value', + '3': 2, + '4': 1, + '5': 11, + '6': '.api.v1.Examples', + '10': 'value' + }, + ], + '7': const {'7': true}, +}; + +/// Descriptor for `CategoryList`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List categoryListDescriptor = $convert.base64Decode( + 'CgxDYXRlZ29yeUxpc3QSVwoRY2F0ZWdvcnlfZXhhbXBsZXMYASADKAsyKi5hcGkudjEuQ2F0ZWdvcnlMaXN0LkNhdGVnb3J5RXhhbXBsZXNFbnRyeVIQY2F0ZWdvcnlFeGFtcGxlcxpVChVDYXRlZ29yeUV4YW1wbGVzRW50cnkSEAoDa2V5GAEgASgJUgNrZXkSJgoFdmFsdWUYAiABKAsyEC5hcGkudjEuRXhhbXBsZXNSBXZhbHVlOgI4AQ=='); +@$core.Deprecated('Use getListOfExamplesResponseDescriptor instead') +const GetListOfExamplesResponse$json = const { + '1': 'GetListOfExamplesResponse', + '2': const [ + const { + '1': 'sdk_categories', + '3': 1, + '4': 3, + '5': 11, + '6': '.api.v1.GetListOfExamplesResponse.SdkCategoriesEntry', + '10': 'sdkCategories' + }, + ], + '3': const [GetListOfExamplesResponse_SdkCategoriesEntry$json], +}; + +@$core.Deprecated('Use getListOfExamplesResponseDescriptor instead') +const GetListOfExamplesResponse_SdkCategoriesEntry$json = const { + '1': 'SdkCategoriesEntry', + '2': const [ + const {'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'}, + const { + '1': 'value', + '3': 2, + '4': 1, + '5': 11, + '6': '.api.v1.CategoryList', + '10': 'value' + }, + ], + '7': const {'7': true}, +}; + +/// Descriptor for `GetListOfExamplesResponse`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List getListOfExamplesResponseDescriptor = + $convert.base64Decode( + 'ChlHZXRMaXN0T2ZFeGFtcGxlc1Jlc3BvbnNlElsKDnNka19jYXRlZ29yaWVzGAEgAygLMjQuYXBpLnYxLkdldExpc3RPZkV4YW1wbGVzUmVzcG9uc2UuU2RrQ2F0ZWdvcmllc0VudHJ5Ug1zZGtDYXRlZ29yaWVzGlYKElNka0NhdGVnb3JpZXNFbnRyeRIQCgNrZXkYASABKAlSA2tleRIqCgV2YWx1ZRgCIAEoCzIULmFwaS52MS5DYXRlZ29yeUxpc3RSBXZhbHVlOgI4AQ=='); +@$core.Deprecated('Use getExampleRequestDescriptor instead') +const GetExampleRequest$json = const { + '1': 'GetExampleRequest', + '2': const [ + const {'1': 'example_uuid', '3': 1, '4': 1, '5': 9, '10': 'exampleUuid'}, + ], +}; + +/// Descriptor for `GetExampleRequest`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List getExampleRequestDescriptor = $convert.base64Decode( + 'ChFHZXRFeGFtcGxlUmVxdWVzdBIhCgxleGFtcGxlX3V1aWQYASABKAlSC2V4YW1wbGVVdWlk'); +@$core.Deprecated('Use getExampleResponseDescriptor instead') +const GetExampleResponse$json = const { + '1': 'GetExampleResponse', + '2': const [ + const {'1': 'code', '3': 1, '4': 1, '5': 9, '10': 'code'}, + ], +}; + +/// Descriptor for `GetExampleResponse`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List getExampleResponseDescriptor = $convert + .base64Decode('ChJHZXRFeGFtcGxlUmVzcG9uc2USEgoEY29kZRgBIAEoCVIEY29kZQ=='); From dbe806040326fc77fcea4f87d564e24aad1b182a Mon Sep 17 00:00:00 2001 From: Aydar Farrakhov Date: Mon, 1 Nov 2021 14:36:29 +0300 Subject: [PATCH 18/32] [BEAM-13101] revert generate proto --- playground/backend/internal/api/v1/api.pb.go | 437 +++++++++--------- .../backend/internal/api/v1/api_grpc.pb.go | 10 +- 2 files changed, 224 insertions(+), 223 deletions(-) diff --git a/playground/backend/internal/api/v1/api.pb.go b/playground/backend/internal/api/v1/api.pb.go index 28f07c591e62..578193be317b 100644 --- a/playground/backend/internal/api/v1/api.pb.go +++ b/playground/backend/internal/api/v1/api.pb.go @@ -18,10 +18,10 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.18.1 -// source: api/v1/api.proto +// protoc v3.17.3 +// source: api.proto -package playground +package v1 import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -76,11 +76,11 @@ func (x Sdk) String() string { } func (Sdk) Descriptor() protoreflect.EnumDescriptor { - return file_api_v1_api_proto_enumTypes[0].Descriptor() + return file_api_proto_enumTypes[0].Descriptor() } func (Sdk) Type() protoreflect.EnumType { - return &file_api_v1_api_proto_enumTypes[0] + return &file_api_proto_enumTypes[0] } func (x Sdk) Number() protoreflect.EnumNumber { @@ -89,7 +89,7 @@ func (x Sdk) Number() protoreflect.EnumNumber { // Deprecated: Use Sdk.Descriptor instead. func (Sdk) EnumDescriptor() ([]byte, []int) { - return file_api_v1_api_proto_rawDescGZIP(), []int{0} + return file_api_proto_rawDescGZIP(), []int{0} } type Status int32 @@ -134,11 +134,11 @@ func (x Status) String() string { } func (Status) Descriptor() protoreflect.EnumDescriptor { - return file_api_v1_api_proto_enumTypes[1].Descriptor() + return file_api_proto_enumTypes[1].Descriptor() } func (Status) Type() protoreflect.EnumType { - return &file_api_v1_api_proto_enumTypes[1] + return &file_api_proto_enumTypes[1] } func (x Status) Number() protoreflect.EnumNumber { @@ -147,7 +147,7 @@ func (x Status) Number() protoreflect.EnumNumber { // Deprecated: Use Status.Descriptor instead. func (Status) EnumDescriptor() ([]byte, []int) { - return file_api_v1_api_proto_rawDescGZIP(), []int{1} + return file_api_proto_rawDescGZIP(), []int{1} } // RunCodeRequest represents a code text and options of SDK which executes the code. @@ -163,7 +163,7 @@ type RunCodeRequest struct { func (x *RunCodeRequest) Reset() { *x = RunCodeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_v1_api_proto_msgTypes[0] + mi := &file_api_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -176,7 +176,7 @@ func (x *RunCodeRequest) String() string { func (*RunCodeRequest) ProtoMessage() {} func (x *RunCodeRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_api_proto_msgTypes[0] + mi := &file_api_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -189,7 +189,7 @@ func (x *RunCodeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RunCodeRequest.ProtoReflect.Descriptor instead. func (*RunCodeRequest) Descriptor() ([]byte, []int) { - return file_api_v1_api_proto_rawDescGZIP(), []int{0} + return file_api_proto_rawDescGZIP(), []int{0} } func (x *RunCodeRequest) GetCode() string { @@ -218,7 +218,7 @@ type RunCodeResponse struct { func (x *RunCodeResponse) Reset() { *x = RunCodeResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_v1_api_proto_msgTypes[1] + mi := &file_api_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -231,7 +231,7 @@ func (x *RunCodeResponse) String() string { func (*RunCodeResponse) ProtoMessage() {} func (x *RunCodeResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_api_proto_msgTypes[1] + mi := &file_api_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -244,7 +244,7 @@ func (x *RunCodeResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use RunCodeResponse.ProtoReflect.Descriptor instead. func (*RunCodeResponse) Descriptor() ([]byte, []int) { - return file_api_v1_api_proto_rawDescGZIP(), []int{1} + return file_api_proto_rawDescGZIP(), []int{1} } func (x *RunCodeResponse) GetPipelineUuid() string { @@ -266,7 +266,7 @@ type CheckStatusRequest struct { func (x *CheckStatusRequest) Reset() { *x = CheckStatusRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_v1_api_proto_msgTypes[2] + mi := &file_api_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -279,7 +279,7 @@ func (x *CheckStatusRequest) String() string { func (*CheckStatusRequest) ProtoMessage() {} func (x *CheckStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_api_proto_msgTypes[2] + mi := &file_api_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -292,7 +292,7 @@ func (x *CheckStatusRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CheckStatusRequest.ProtoReflect.Descriptor instead. func (*CheckStatusRequest) Descriptor() ([]byte, []int) { - return file_api_v1_api_proto_rawDescGZIP(), []int{2} + return file_api_proto_rawDescGZIP(), []int{2} } func (x *CheckStatusRequest) GetPipelineUuid() string { @@ -314,7 +314,7 @@ type CheckStatusResponse struct { func (x *CheckStatusResponse) Reset() { *x = CheckStatusResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_v1_api_proto_msgTypes[3] + mi := &file_api_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -327,7 +327,7 @@ func (x *CheckStatusResponse) String() string { func (*CheckStatusResponse) ProtoMessage() {} func (x *CheckStatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_api_proto_msgTypes[3] + mi := &file_api_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -340,7 +340,7 @@ func (x *CheckStatusResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CheckStatusResponse.ProtoReflect.Descriptor instead. func (*CheckStatusResponse) Descriptor() ([]byte, []int) { - return file_api_v1_api_proto_rawDescGZIP(), []int{3} + return file_api_proto_rawDescGZIP(), []int{3} } func (x *CheckStatusResponse) GetStatus() Status { @@ -362,7 +362,7 @@ type GetCompileOutputRequest struct { func (x *GetCompileOutputRequest) Reset() { *x = GetCompileOutputRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_v1_api_proto_msgTypes[4] + mi := &file_api_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -375,7 +375,7 @@ func (x *GetCompileOutputRequest) String() string { func (*GetCompileOutputRequest) ProtoMessage() {} func (x *GetCompileOutputRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_api_proto_msgTypes[4] + mi := &file_api_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -388,7 +388,7 @@ func (x *GetCompileOutputRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetCompileOutputRequest.ProtoReflect.Descriptor instead. func (*GetCompileOutputRequest) Descriptor() ([]byte, []int) { - return file_api_v1_api_proto_rawDescGZIP(), []int{4} + return file_api_proto_rawDescGZIP(), []int{4} } func (x *GetCompileOutputRequest) GetPipelineUuid() string { @@ -411,7 +411,7 @@ type GetCompileOutputResponse struct { func (x *GetCompileOutputResponse) Reset() { *x = GetCompileOutputResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_v1_api_proto_msgTypes[5] + mi := &file_api_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -424,7 +424,7 @@ func (x *GetCompileOutputResponse) String() string { func (*GetCompileOutputResponse) ProtoMessage() {} func (x *GetCompileOutputResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_api_proto_msgTypes[5] + mi := &file_api_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -437,7 +437,7 @@ func (x *GetCompileOutputResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetCompileOutputResponse.ProtoReflect.Descriptor instead. func (*GetCompileOutputResponse) Descriptor() ([]byte, []int) { - return file_api_v1_api_proto_rawDescGZIP(), []int{5} + return file_api_proto_rawDescGZIP(), []int{5} } func (x *GetCompileOutputResponse) GetOutput() string { @@ -466,7 +466,7 @@ type GetRunOutputRequest struct { func (x *GetRunOutputRequest) Reset() { *x = GetRunOutputRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_v1_api_proto_msgTypes[6] + mi := &file_api_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -479,7 +479,7 @@ func (x *GetRunOutputRequest) String() string { func (*GetRunOutputRequest) ProtoMessage() {} func (x *GetRunOutputRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_api_proto_msgTypes[6] + mi := &file_api_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -492,7 +492,7 @@ func (x *GetRunOutputRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetRunOutputRequest.ProtoReflect.Descriptor instead. func (*GetRunOutputRequest) Descriptor() ([]byte, []int) { - return file_api_v1_api_proto_rawDescGZIP(), []int{6} + return file_api_proto_rawDescGZIP(), []int{6} } func (x *GetRunOutputRequest) GetPipelineUuid() string { @@ -515,7 +515,7 @@ type GetRunOutputResponse struct { func (x *GetRunOutputResponse) Reset() { *x = GetRunOutputResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_v1_api_proto_msgTypes[7] + mi := &file_api_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -528,7 +528,7 @@ func (x *GetRunOutputResponse) String() string { func (*GetRunOutputResponse) ProtoMessage() {} func (x *GetRunOutputResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_api_proto_msgTypes[7] + mi := &file_api_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -541,7 +541,7 @@ func (x *GetRunOutputResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetRunOutputResponse.ProtoReflect.Descriptor instead. func (*GetRunOutputResponse) Descriptor() ([]byte, []int) { - return file_api_v1_api_proto_rawDescGZIP(), []int{7} + return file_api_proto_rawDescGZIP(), []int{7} } func (x *GetRunOutputResponse) GetOutput() string { @@ -571,7 +571,7 @@ type GetListOfExamplesRequest struct { func (x *GetListOfExamplesRequest) Reset() { *x = GetListOfExamplesRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_v1_api_proto_msgTypes[8] + mi := &file_api_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -584,7 +584,7 @@ func (x *GetListOfExamplesRequest) String() string { func (*GetListOfExamplesRequest) ProtoMessage() {} func (x *GetListOfExamplesRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_api_proto_msgTypes[8] + mi := &file_api_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -597,7 +597,7 @@ func (x *GetListOfExamplesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetListOfExamplesRequest.ProtoReflect.Descriptor instead. func (*GetListOfExamplesRequest) Descriptor() ([]byte, []int) { - return file_api_v1_api_proto_rawDescGZIP(), []int{8} + return file_api_proto_rawDescGZIP(), []int{8} } func (x *GetListOfExamplesRequest) GetSdk() Sdk { @@ -626,7 +626,7 @@ type Examples struct { func (x *Examples) Reset() { *x = Examples{} if protoimpl.UnsafeEnabled { - mi := &file_api_v1_api_proto_msgTypes[9] + mi := &file_api_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -639,7 +639,7 @@ func (x *Examples) String() string { func (*Examples) ProtoMessage() {} func (x *Examples) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_api_proto_msgTypes[9] + mi := &file_api_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -652,7 +652,7 @@ func (x *Examples) ProtoReflect() protoreflect.Message { // Deprecated: Use Examples.ProtoReflect.Descriptor instead. func (*Examples) Descriptor() ([]byte, []int) { - return file_api_v1_api_proto_rawDescGZIP(), []int{9} + return file_api_proto_rawDescGZIP(), []int{9} } func (x *Examples) GetExample() []string { @@ -674,7 +674,7 @@ type CategoryList struct { func (x *CategoryList) Reset() { *x = CategoryList{} if protoimpl.UnsafeEnabled { - mi := &file_api_v1_api_proto_msgTypes[10] + mi := &file_api_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -687,7 +687,7 @@ func (x *CategoryList) String() string { func (*CategoryList) ProtoMessage() {} func (x *CategoryList) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_api_proto_msgTypes[10] + mi := &file_api_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -700,7 +700,7 @@ func (x *CategoryList) ProtoReflect() protoreflect.Message { // Deprecated: Use CategoryList.ProtoReflect.Descriptor instead. func (*CategoryList) Descriptor() ([]byte, []int) { - return file_api_v1_api_proto_rawDescGZIP(), []int{10} + return file_api_proto_rawDescGZIP(), []int{10} } func (x *CategoryList) GetCategoryExamples() map[string]*Examples { @@ -722,7 +722,7 @@ type GetListOfExamplesResponse struct { func (x *GetListOfExamplesResponse) Reset() { *x = GetListOfExamplesResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_v1_api_proto_msgTypes[11] + mi := &file_api_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -735,7 +735,7 @@ func (x *GetListOfExamplesResponse) String() string { func (*GetListOfExamplesResponse) ProtoMessage() {} func (x *GetListOfExamplesResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_api_proto_msgTypes[11] + mi := &file_api_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -748,7 +748,7 @@ func (x *GetListOfExamplesResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetListOfExamplesResponse.ProtoReflect.Descriptor instead. func (*GetListOfExamplesResponse) Descriptor() ([]byte, []int) { - return file_api_v1_api_proto_rawDescGZIP(), []int{11} + return file_api_proto_rawDescGZIP(), []int{11} } func (x *GetListOfExamplesResponse) GetSdkCategories() map[string]*CategoryList { @@ -770,7 +770,7 @@ type GetExampleRequest struct { func (x *GetExampleRequest) Reset() { *x = GetExampleRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_v1_api_proto_msgTypes[12] + mi := &file_api_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -783,7 +783,7 @@ func (x *GetExampleRequest) String() string { func (*GetExampleRequest) ProtoMessage() {} func (x *GetExampleRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_api_proto_msgTypes[12] + mi := &file_api_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -796,7 +796,7 @@ func (x *GetExampleRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetExampleRequest.ProtoReflect.Descriptor instead. func (*GetExampleRequest) Descriptor() ([]byte, []int) { - return file_api_v1_api_proto_rawDescGZIP(), []int{12} + return file_api_proto_rawDescGZIP(), []int{12} } func (x *GetExampleRequest) GetExampleUuid() string { @@ -818,7 +818,7 @@ type GetExampleResponse struct { func (x *GetExampleResponse) Reset() { *x = GetExampleResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_v1_api_proto_msgTypes[13] + mi := &file_api_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -831,7 +831,7 @@ func (x *GetExampleResponse) String() string { func (*GetExampleResponse) ProtoMessage() {} func (x *GetExampleResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_api_proto_msgTypes[13] + mi := &file_api_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -844,7 +844,7 @@ func (x *GetExampleResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetExampleResponse.ProtoReflect.Descriptor instead. func (*GetExampleResponse) Descriptor() ([]byte, []int) { - return file_api_v1_api_proto_rawDescGZIP(), []int{13} + return file_api_proto_rawDescGZIP(), []int{13} } func (x *GetExampleResponse) GetCode() string { @@ -854,158 +854,157 @@ func (x *GetExampleResponse) GetCode() string { return "" } -var File_api_v1_api_proto protoreflect.FileDescriptor - -var file_api_v1_api_proto_rawDesc = []byte{ - 0x0a, 0x10, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x12, 0x06, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x22, 0x43, 0x0a, 0x0e, 0x52, 0x75, - 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, - 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, - 0x12, 0x1d, 0x0a, 0x03, 0x73, 0x64, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0b, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x64, 0x6b, 0x52, 0x03, 0x73, 0x64, 0x6b, 0x22, - 0x36, 0x0a, 0x0f, 0x52, 0x75, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x75, - 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x69, 0x70, 0x65, 0x6c, - 0x69, 0x6e, 0x65, 0x55, 0x75, 0x69, 0x64, 0x22, 0x39, 0x0a, 0x12, 0x43, 0x68, 0x65, 0x63, 0x6b, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, - 0x0d, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x55, 0x75, - 0x69, 0x64, 0x22, 0x3d, 0x0a, 0x13, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x06, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x22, 0x3e, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x4f, - 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, - 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x55, 0x75, 0x69, - 0x64, 0x22, 0x71, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x4f, - 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, - 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, - 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x3d, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x0e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x52, 0x11, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x22, 0x3a, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6e, 0x4f, 0x75, - 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x70, +var File_api_proto protoreflect.FileDescriptor + +var file_api_proto_rawDesc = []byte{ + 0x0a, 0x09, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x22, 0x43, 0x0a, 0x0e, 0x52, 0x75, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x1d, 0x0a, 0x03, 0x73, 0x64, 0x6b, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, + 0x53, 0x64, 0x6b, 0x52, 0x03, 0x73, 0x64, 0x6b, 0x22, 0x36, 0x0a, 0x0f, 0x52, 0x75, 0x6e, 0x43, + 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x55, 0x75, 0x69, 0x64, - 0x22, 0x6d, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x75, 0x74, 0x70, - 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, - 0x12, 0x3d, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x11, 0x63, 0x6f, - 0x6d, 0x70, 0x69, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, - 0x55, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x66, 0x45, 0x78, 0x61, 0x6d, - 0x70, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x03, 0x73, - 0x64, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x31, 0x2e, 0x53, 0x64, 0x6b, 0x52, 0x03, 0x73, 0x64, 0x6b, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x61, - 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x61, - 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x22, 0x24, 0x0a, 0x08, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, - 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x07, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x22, 0xbe, 0x01, 0x0a, - 0x0c, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x57, 0x0a, - 0x11, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x5f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, - 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x31, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x2e, 0x43, - 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x52, 0x10, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x45, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x1a, 0x55, 0x0a, 0x15, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, - 0x72, 0x79, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x12, 0x26, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, - 0x65, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xd0, 0x01, - 0x0a, 0x19, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x66, 0x45, 0x78, 0x61, 0x6d, 0x70, - 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5b, 0x0a, 0x0e, 0x73, - 0x64, 0x6b, 0x5f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, - 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x66, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x64, 0x6b, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, - 0x72, 0x69, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0d, 0x73, 0x64, 0x6b, 0x43, 0x61, - 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x1a, 0x56, 0x0a, 0x12, 0x53, 0x64, 0x6b, 0x43, - 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x12, 0x2a, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, - 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, - 0x22, 0x36, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, - 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x78, 0x61, - 0x6d, 0x70, 0x6c, 0x65, 0x55, 0x75, 0x69, 0x64, 0x22, 0x28, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x45, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, - 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, - 0x64, 0x65, 0x2a, 0x52, 0x0a, 0x03, 0x53, 0x64, 0x6b, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x44, 0x4b, - 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, - 0x0a, 0x08, 0x53, 0x44, 0x4b, 0x5f, 0x4a, 0x41, 0x56, 0x41, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, - 0x53, 0x44, 0x4b, 0x5f, 0x47, 0x4f, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x53, 0x44, 0x4b, 0x5f, - 0x50, 0x59, 0x54, 0x48, 0x4f, 0x4e, 0x10, 0x03, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x44, 0x4b, 0x5f, - 0x53, 0x43, 0x49, 0x4f, 0x10, 0x04, 0x2a, 0x8f, 0x01, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, - 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x54, 0x41, - 0x54, 0x55, 0x53, 0x5f, 0x45, 0x58, 0x45, 0x43, 0x55, 0x54, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, - 0x13, 0x0a, 0x0f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x46, 0x49, 0x4e, 0x49, 0x53, 0x48, - 0x45, 0x44, 0x10, 0x02, 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x45, - 0x52, 0x52, 0x4f, 0x52, 0x10, 0x03, 0x12, 0x18, 0x0a, 0x14, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, - 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x49, 0x4c, 0x45, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x04, - 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52, 0x55, 0x4e, 0x5f, 0x54, - 0x49, 0x4d, 0x45, 0x4f, 0x55, 0x54, 0x10, 0x05, 0x32, 0xa5, 0x04, 0x0a, 0x11, 0x50, 0x6c, 0x61, - 0x79, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3a, - 0x0a, 0x07, 0x52, 0x75, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x31, 0x2e, 0x52, 0x75, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x75, 0x6e, 0x43, 0x6f, - 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x0b, 0x43, 0x68, - 0x65, 0x63, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, + 0x22, 0x39, 0x0a, 0x12, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, + 0x6e, 0x65, 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, + 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x55, 0x75, 0x69, 0x64, 0x22, 0x3d, 0x0a, 0x13, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x49, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6e, 0x4f, 0x75, 0x74, 0x70, - 0x75, 0x74, 0x12, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, - 0x75, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6e, 0x4f, - 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, - 0x10, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x4f, 0x75, 0x74, 0x70, 0x75, - 0x74, 0x12, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, - 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, - 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x4f, - 0x66, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x12, 0x20, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x66, 0x45, 0x78, 0x61, 0x6d, - 0x70, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x66, 0x45, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, - 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x19, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, - 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, - 0x65, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, - 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, - 0x75, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x42, 0x38, 0x5a, 0x36, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, - 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x6c, 0x61, 0x79, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2f, 0x62, - 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x3b, - 0x70, 0x6c, 0x61, 0x79, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x73, 0x65, 0x12, 0x26, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x3e, 0x0a, 0x17, 0x47, 0x65, + 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, + 0x65, 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x69, + 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x55, 0x75, 0x69, 0x64, 0x22, 0x71, 0x0a, 0x18, 0x47, 0x65, + 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x3d, + 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x11, 0x63, 0x6f, 0x6d, 0x70, + 0x69, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x3a, 0x0a, + 0x13, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, + 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x69, 0x70, + 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x55, 0x75, 0x69, 0x64, 0x22, 0x6d, 0x0a, 0x14, 0x47, 0x65, 0x74, + 0x52, 0x75, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x3d, 0x0a, 0x12, 0x63, 0x6f, 0x6d, + 0x70, 0x69, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x11, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x55, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x4c, + 0x69, 0x73, 0x74, 0x4f, 0x66, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x03, 0x73, 0x64, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x0b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x64, 0x6b, 0x52, 0x03, + 0x73, 0x64, 0x6b, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x22, + 0x24, 0x0a, 0x08, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x65, + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x65, 0x78, + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x22, 0xbe, 0x01, 0x0a, 0x0c, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, + 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x57, 0x0a, 0x11, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, + 0x72, 0x79, 0x5f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x2a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, + 0x6f, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, + 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x10, 0x63, + 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x1a, + 0x55, 0x0a, 0x15, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x45, 0x78, 0x61, 0x6d, 0x70, + 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x26, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xd0, 0x01, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x4c, 0x69, + 0x73, 0x74, 0x4f, 0x66, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5b, 0x0a, 0x0e, 0x73, 0x64, 0x6b, 0x5f, 0x63, 0x61, 0x74, 0x65, + 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x66, 0x45, + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, + 0x53, 0x64, 0x6b, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x0d, 0x73, 0x64, 0x6b, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, + 0x73, 0x1a, 0x56, 0x0a, 0x12, 0x53, 0x64, 0x6b, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, + 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2a, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x36, 0x0a, 0x11, 0x47, 0x65, 0x74, + 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, + 0x0a, 0x0c, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x55, 0x75, 0x69, + 0x64, 0x22, 0x28, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x2a, 0x52, 0x0a, 0x03, 0x53, + 0x64, 0x6b, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x44, 0x4b, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, + 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x44, 0x4b, 0x5f, 0x4a, + 0x41, 0x56, 0x41, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x44, 0x4b, 0x5f, 0x47, 0x4f, 0x10, + 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x53, 0x44, 0x4b, 0x5f, 0x50, 0x59, 0x54, 0x48, 0x4f, 0x4e, 0x10, + 0x03, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x44, 0x4b, 0x5f, 0x53, 0x43, 0x49, 0x4f, 0x10, 0x04, 0x2a, + 0x8f, 0x01, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, + 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, + 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x45, 0x58, 0x45, + 0x43, 0x55, 0x54, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x54, 0x41, 0x54, + 0x55, 0x53, 0x5f, 0x46, 0x49, 0x4e, 0x49, 0x53, 0x48, 0x45, 0x44, 0x10, 0x02, 0x12, 0x10, 0x0a, + 0x0c, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x03, 0x12, + 0x18, 0x0a, 0x14, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x49, 0x4c, + 0x45, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x04, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, + 0x54, 0x55, 0x53, 0x5f, 0x52, 0x55, 0x4e, 0x5f, 0x54, 0x49, 0x4d, 0x45, 0x4f, 0x55, 0x54, 0x10, + 0x05, 0x32, 0xa5, 0x04, 0x0a, 0x11, 0x50, 0x6c, 0x61, 0x79, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3a, 0x0a, 0x07, 0x52, 0x75, 0x6e, 0x43, 0x6f, + 0x64, 0x65, 0x12, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x75, 0x6e, 0x43, + 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x75, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x0b, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x12, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, + 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x0c, 0x47, + 0x65, 0x74, 0x52, 0x75, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x1b, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, + 0x70, 0x69, 0x6c, 0x65, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x1f, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x4f, 0x75, + 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x4f, + 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, + 0x11, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x66, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, + 0x65, 0x73, 0x12, 0x20, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4c, + 0x69, 0x73, 0x74, 0x4f, 0x66, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, + 0x74, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x66, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x45, 0x78, + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, + 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, + 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x10, + 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, + 0x12, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, + 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x38, 0x5a, 0x36, 0x62, 0x65, 0x61, + 0x6d, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x6c, 0x61, + 0x79, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x2f, + 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x3b, 0x70, 0x6c, 0x61, 0x79, 0x67, 0x72, 0x6f, + 0x75, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_api_v1_api_proto_rawDescOnce sync.Once - file_api_v1_api_proto_rawDescData = file_api_v1_api_proto_rawDesc + file_api_proto_rawDescOnce sync.Once + file_api_proto_rawDescData = file_api_proto_rawDesc ) -func file_api_v1_api_proto_rawDescGZIP() []byte { - file_api_v1_api_proto_rawDescOnce.Do(func() { - file_api_v1_api_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_v1_api_proto_rawDescData) +func file_api_proto_rawDescGZIP() []byte { + file_api_proto_rawDescOnce.Do(func() { + file_api_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_proto_rawDescData) }) - return file_api_v1_api_proto_rawDescData + return file_api_proto_rawDescData } -var file_api_v1_api_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_api_v1_api_proto_msgTypes = make([]protoimpl.MessageInfo, 16) -var file_api_v1_api_proto_goTypes = []interface{}{ +var file_api_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_api_proto_msgTypes = make([]protoimpl.MessageInfo, 16) +var file_api_proto_goTypes = []interface{}{ (Sdk)(0), // 0: api.v1.Sdk (Status)(0), // 1: api.v1.Status (*RunCodeRequest)(nil), // 2: api.v1.RunCodeRequest @@ -1025,7 +1024,7 @@ var file_api_v1_api_proto_goTypes = []interface{}{ nil, // 16: api.v1.CategoryList.CategoryExamplesEntry nil, // 17: api.v1.GetListOfExamplesResponse.SdkCategoriesEntry } -var file_api_v1_api_proto_depIdxs = []int32{ +var file_api_proto_depIdxs = []int32{ 0, // 0: api.v1.RunCodeRequest.sdk:type_name -> api.v1.Sdk 1, // 1: api.v1.CheckStatusResponse.status:type_name -> api.v1.Status 1, // 2: api.v1.GetCompileOutputResponse.compilation_status:type_name -> api.v1.Status @@ -1056,13 +1055,13 @@ var file_api_v1_api_proto_depIdxs = []int32{ 0, // [0:9] is the sub-list for field type_name } -func init() { file_api_v1_api_proto_init() } -func file_api_v1_api_proto_init() { - if File_api_v1_api_proto != nil { +func init() { file_api_proto_init() } +func file_api_proto_init() { + if File_api_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_api_v1_api_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RunCodeRequest); i { case 0: return &v.state @@ -1074,7 +1073,7 @@ func file_api_v1_api_proto_init() { return nil } } - file_api_v1_api_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RunCodeResponse); i { case 0: return &v.state @@ -1086,7 +1085,7 @@ func file_api_v1_api_proto_init() { return nil } } - file_api_v1_api_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CheckStatusRequest); i { case 0: return &v.state @@ -1098,7 +1097,7 @@ func file_api_v1_api_proto_init() { return nil } } - file_api_v1_api_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CheckStatusResponse); i { case 0: return &v.state @@ -1110,7 +1109,7 @@ func file_api_v1_api_proto_init() { return nil } } - file_api_v1_api_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetCompileOutputRequest); i { case 0: return &v.state @@ -1122,7 +1121,7 @@ func file_api_v1_api_proto_init() { return nil } } - file_api_v1_api_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetCompileOutputResponse); i { case 0: return &v.state @@ -1134,7 +1133,7 @@ func file_api_v1_api_proto_init() { return nil } } - file_api_v1_api_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetRunOutputRequest); i { case 0: return &v.state @@ -1146,7 +1145,7 @@ func file_api_v1_api_proto_init() { return nil } } - file_api_v1_api_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetRunOutputResponse); i { case 0: return &v.state @@ -1158,7 +1157,7 @@ func file_api_v1_api_proto_init() { return nil } } - file_api_v1_api_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetListOfExamplesRequest); i { case 0: return &v.state @@ -1170,7 +1169,7 @@ func file_api_v1_api_proto_init() { return nil } } - file_api_v1_api_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Examples); i { case 0: return &v.state @@ -1182,7 +1181,7 @@ func file_api_v1_api_proto_init() { return nil } } - file_api_v1_api_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CategoryList); i { case 0: return &v.state @@ -1194,7 +1193,7 @@ func file_api_v1_api_proto_init() { return nil } } - file_api_v1_api_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetListOfExamplesResponse); i { case 0: return &v.state @@ -1206,7 +1205,7 @@ func file_api_v1_api_proto_init() { return nil } } - file_api_v1_api_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetExampleRequest); i { case 0: return &v.state @@ -1218,7 +1217,7 @@ func file_api_v1_api_proto_init() { return nil } } - file_api_v1_api_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetExampleResponse); i { case 0: return &v.state @@ -1235,19 +1234,19 @@ func file_api_v1_api_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_api_v1_api_proto_rawDesc, + RawDescriptor: file_api_proto_rawDesc, NumEnums: 2, NumMessages: 16, NumExtensions: 0, NumServices: 1, }, - GoTypes: file_api_v1_api_proto_goTypes, - DependencyIndexes: file_api_v1_api_proto_depIdxs, - EnumInfos: file_api_v1_api_proto_enumTypes, - MessageInfos: file_api_v1_api_proto_msgTypes, + GoTypes: file_api_proto_goTypes, + DependencyIndexes: file_api_proto_depIdxs, + EnumInfos: file_api_proto_enumTypes, + MessageInfos: file_api_proto_msgTypes, }.Build() - File_api_v1_api_proto = out.File - file_api_v1_api_proto_rawDesc = nil - file_api_v1_api_proto_goTypes = nil - file_api_v1_api_proto_depIdxs = nil + File_api_proto = out.File + file_api_proto_rawDesc = nil + file_api_proto_goTypes = nil + file_api_proto_depIdxs = nil } diff --git a/playground/backend/internal/api/v1/api_grpc.pb.go b/playground/backend/internal/api/v1/api_grpc.pb.go index ee73acd319f8..2b426f0720eb 100644 --- a/playground/backend/internal/api/v1/api_grpc.pb.go +++ b/playground/backend/internal/api/v1/api_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. -package playground +package v1 import ( context "context" @@ -106,7 +106,7 @@ func (c *playgroundServiceClient) GetExampleOutput(ctx context.Context, in *GetE } // PlaygroundServiceServer is the server API for PlaygroundService service. -// All implementations should embed UnimplementedPlaygroundServiceServer +// All implementations must embed UnimplementedPlaygroundServiceServer // for forward compatibility type PlaygroundServiceServer interface { // Submit the job for an execution and get the pipeline uuid. @@ -123,9 +123,10 @@ type PlaygroundServiceServer interface { GetExample(context.Context, *GetExampleRequest) (*GetExampleResponse, error) // Get the precompiled details of an example. GetExampleOutput(context.Context, *GetExampleRequest) (*GetRunOutputResponse, error) + mustEmbedUnimplementedPlaygroundServiceServer() } -// UnimplementedPlaygroundServiceServer should be embedded to have forward compatible implementations. +// UnimplementedPlaygroundServiceServer must be embedded to have forward compatible implementations. type UnimplementedPlaygroundServiceServer struct { } @@ -150,6 +151,7 @@ func (UnimplementedPlaygroundServiceServer) GetExample(context.Context, *GetExam func (UnimplementedPlaygroundServiceServer) GetExampleOutput(context.Context, *GetExampleRequest) (*GetRunOutputResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetExampleOutput not implemented") } +func (UnimplementedPlaygroundServiceServer) mustEmbedUnimplementedPlaygroundServiceServer() {} // UnsafePlaygroundServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to PlaygroundServiceServer will @@ -325,5 +327,5 @@ var PlaygroundService_ServiceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "api/v1/api.proto", + Metadata: "api.proto", } From f82896877c2ad14fd0174b15496f48b8f46ee1f8 Mon Sep 17 00:00:00 2001 From: Alexander Zhuravlev Date: Tue, 2 Nov 2021 20:08:06 +0300 Subject: [PATCH 19/32] [BEAM-13101] Reworked examples structure --- playground/frontend/lib/api/v1/api.pb.dart | 23 +- .../frontend/lib/api/v1/api.pbenum.dart | 7 + .../frontend/lib/api/v1/api.pbjson.dart | 11 +- .../example_list/expansion_panel_item.dart | 6 +- .../examples/models/category_model.dart | 9 - .../examples/models/category_model.g.dart | 21 -- .../examples/models/example_model.dart | 42 +--- .../examples/models/example_model.g.dart | 43 ---- .../examples/models/outputs_model.dart | 10 - .../example_client/example_client.dart | 15 ++ .../example_client/grpc_example_client.dart | 123 ++++++++++ .../repositories/example_repository.dart | 211 +++--------------- .../models/get_example_request.dart | 5 + .../models/get_example_response.dart | 5 + .../models/get_list_of_examples_request.dart | 8 + .../models/get_list_of_examples_response.dart | 8 + .../get_precompiled_outputs_request.dart | 0 .../modules/sdk/components/sdk_selector.dart | 2 +- .../components/playground_page_providers.dart | 20 +- .../states/example_selector_state.dart | 2 +- .../playground/states/examples_state.dart | 33 ++- .../playground/states/playground_state.dart | 2 +- playground/frontend/pubspec.lock | 16 +- playground/frontend/pubspec.yaml | 2 - 24 files changed, 265 insertions(+), 359 deletions(-) delete mode 100644 playground/frontend/lib/modules/examples/models/category_model.g.dart delete mode 100644 playground/frontend/lib/modules/examples/models/example_model.g.dart create mode 100644 playground/frontend/lib/modules/examples/repositories/example_client/example_client.dart create mode 100644 playground/frontend/lib/modules/examples/repositories/example_client/grpc_example_client.dart create mode 100644 playground/frontend/lib/modules/examples/repositories/models/get_example_request.dart create mode 100644 playground/frontend/lib/modules/examples/repositories/models/get_example_response.dart create mode 100644 playground/frontend/lib/modules/examples/repositories/models/get_list_of_examples_request.dart create mode 100644 playground/frontend/lib/modules/examples/repositories/models/get_list_of_examples_response.dart create mode 100644 playground/frontend/lib/modules/examples/repositories/models/get_precompiled_outputs_request.dart diff --git a/playground/frontend/lib/api/v1/api.pb.dart b/playground/frontend/lib/api/v1/api.pb.dart index 8db2b79f226a..78a83f8f2b09 100644 --- a/playground/frontend/lib/api/v1/api.pb.dart +++ b/playground/frontend/lib/api/v1/api.pb.dart @@ -1,21 +1,10 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ /// +// Generated code. Do not modify. +// source: api/v1/api.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; diff --git a/playground/frontend/lib/api/v1/api.pbenum.dart b/playground/frontend/lib/api/v1/api.pbenum.dart index 96fe5aec3e42..7f689183913a 100644 --- a/playground/frontend/lib/api/v1/api.pbenum.dart +++ b/playground/frontend/lib/api/v1/api.pbenum.dart @@ -16,6 +16,13 @@ * limitations under the License. */ /// +// Generated code. Do not modify. +// source: api/v1/api.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; diff --git a/playground/frontend/lib/api/v1/api.pbjson.dart b/playground/frontend/lib/api/v1/api.pbjson.dart index 3d90e7d6e82e..e087d8b7fc3c 100644 --- a/playground/frontend/lib/api/v1/api.pbjson.dart +++ b/playground/frontend/lib/api/v1/api.pbjson.dart @@ -16,10 +16,15 @@ * limitations under the License. */ /// -import 'dart:convert' as $convert; +// Generated code. Do not modify. +// source: api/v1/api.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 sdkDescriptor instead') const Sdk$json = const { '1': 'Sdk', @@ -42,8 +47,6 @@ const Status$json = const { const {'1': 'STATUS_EXECUTING', '2': 1}, const {'1': 'STATUS_FINISHED', '2': 2}, const {'1': 'STATUS_ERROR', '2': 3}, - const {'1': 'STATUS_COMPILE_ERROR', '2': 4}, - const {'1': 'STATUS_RUN_TIMEOUT', '2': 5}, ], }; diff --git a/playground/frontend/lib/modules/examples/components/example_list/expansion_panel_item.dart b/playground/frontend/lib/modules/examples/components/example_list/expansion_panel_item.dart index 1fe5da59c5c5..cab096d88c58 100644 --- a/playground/frontend/lib/modules/examples/components/example_list/expansion_panel_item.dart +++ b/playground/frontend/lib/modules/examples/components/example_list/expansion_panel_item.dart @@ -36,10 +36,10 @@ class ExpansionPanelItem extends StatelessWidget { child: GestureDetector( onTap: () async { if (playgroundState.selectedExample != example) { - String source = await exampleState.getSource(example.id!); + String source = await exampleState.getExampleSource(example.uuid); example.setSource(source); playgroundState.setExample(example); - exampleState.getPrecompiledOutputs(example.id!).then((value) { + exampleState.getExampleOutput(example.uuid).then((value) { example.setOutputs(value); }); } @@ -51,7 +51,7 @@ class ExpansionPanelItem extends StatelessWidget { child: Row( children: [ // Wrapped with Row for better user interaction and positioning - Text(example.name ?? ''), + Text(example.name), ], ), ), diff --git a/playground/frontend/lib/modules/examples/models/category_model.dart b/playground/frontend/lib/modules/examples/models/category_model.dart index 219c284abf8a..da9d0e4e8001 100644 --- a/playground/frontend/lib/modules/examples/models/category_model.dart +++ b/playground/frontend/lib/modules/examples/models/category_model.dart @@ -16,20 +16,11 @@ * limitations under the License. */ -import 'package:json_annotation/json_annotation.dart'; import 'package:playground/modules/examples/models/example_model.dart'; -part 'category_model.g.dart'; - -@JsonSerializable(explicitToJson: true) class CategoryModel { final String name; final List examples; const CategoryModel({required this.name, required this.examples}); - - factory CategoryModel.fromJson(Map data) => - _$CategoryModelFromJson(data); - - Map toJson() => _$CategoryModelToJson(this); } diff --git a/playground/frontend/lib/modules/examples/models/category_model.g.dart b/playground/frontend/lib/modules/examples/models/category_model.g.dart deleted file mode 100644 index af4bbc3bee95..000000000000 --- a/playground/frontend/lib/modules/examples/models/category_model.g.dart +++ /dev/null @@ -1,21 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'category_model.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -CategoryModel _$CategoryModelFromJson(Map json) => - CategoryModel( - name: json['name'] as String, - examples: (json['examples'] as List) - .map((e) => ExampleModel.fromJson(e as Map)) - .toList(), - ); - -Map _$CategoryModelToJson(CategoryModel instance) => - { - 'name': instance.name, - 'examples': instance.examples.map((e) => e.toJson()).toList(), - }; diff --git a/playground/frontend/lib/modules/examples/models/example_model.dart b/playground/frontend/lib/modules/examples/models/example_model.dart index 865c3ffce93e..aa7e916d7a46 100644 --- a/playground/frontend/lib/modules/examples/models/example_model.dart +++ b/playground/frontend/lib/modules/examples/models/example_model.dart @@ -16,11 +16,6 @@ * limitations under the License. */ -import 'package:json_annotation/json_annotation.dart'; -import 'package:playground/modules/examples/models/outputs_model.dart'; - -part 'example_model.g.dart'; - enum ExampleType { all, example, @@ -43,32 +38,20 @@ extension ExampleTypeToString on ExampleType { } } -@JsonSerializable() class ExampleModel { - @JsonKey(includeIfNull: false) - final ExampleType? type; - - @JsonKey(includeIfNull: false) - final String? name; - - @JsonKey(includeIfNull: false) - final int? id; - - @JsonKey(includeIfNull: false) - final String? description; - - @JsonKey(includeIfNull: false) + final ExampleType type; + final String name; + final String uuid; + final String description; String? source; - - @JsonKey(includeIfNull: false) - OutputsModel? outputs; + String? outputs; ExampleModel({ + required this.name, + required this.uuid, + required this.description, + required this.type, this.source, - this.name, - this.type, - this.id, - this.description, this.outputs, }); @@ -76,12 +59,7 @@ class ExampleModel { this.source = source; } - setOutputs(OutputsModel outputs) { + setOutputs(String outputs) { this.outputs = outputs; } - - factory ExampleModel.fromJson(Map data) => - _$ExampleModelFromJson(data); - - Map toJson() => _$ExampleModelToJson(this); } diff --git a/playground/frontend/lib/modules/examples/models/example_model.g.dart b/playground/frontend/lib/modules/examples/models/example_model.g.dart deleted file mode 100644 index 923ba4b14402..000000000000 --- a/playground/frontend/lib/modules/examples/models/example_model.g.dart +++ /dev/null @@ -1,43 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'example_model.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -ExampleModel _$ExampleModelFromJson(Map json) => ExampleModel( - source: json['source'] as String?, - name: json['name'] as String?, - type: $enumDecodeNullable(_$ExampleTypeEnumMap, json['type']), - id: json['id'] as int?, - description: json['description'] as String?, - outputs: json['outputs'] == null - ? null - : OutputsModel.fromJson(json['outputs'] as Map), - ); - -Map _$ExampleModelToJson(ExampleModel instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('type', _$ExampleTypeEnumMap[instance.type]); - writeNotNull('name', instance.name); - writeNotNull('id', instance.id); - writeNotNull('description', instance.description); - writeNotNull('source', instance.source); - writeNotNull('outputs', instance.outputs); - return val; -} - -const _$ExampleTypeEnumMap = { - ExampleType.all: 'all', - ExampleType.example: 'example', - ExampleType.kata: 'kata', - ExampleType.test: 'test', -}; diff --git a/playground/frontend/lib/modules/examples/models/outputs_model.dart b/playground/frontend/lib/modules/examples/models/outputs_model.dart index 78050e4cbb79..a761909f46a8 100644 --- a/playground/frontend/lib/modules/examples/models/outputs_model.dart +++ b/playground/frontend/lib/modules/examples/models/outputs_model.dart @@ -1,17 +1,7 @@ -import 'package:json_annotation/json_annotation.dart'; - -part 'outputs_model.g.dart'; - -@JsonSerializable() class OutputsModel { final String output; final String graph; final String log; OutputsModel(this.output, this.graph, this.log); - - factory OutputsModel.fromJson(Map data) => - _$OutputsModelFromJson(data); - - Map toJson() => _$OutputsModelToJson(this); } diff --git a/playground/frontend/lib/modules/examples/repositories/example_client/example_client.dart b/playground/frontend/lib/modules/examples/repositories/example_client/example_client.dart new file mode 100644 index 000000000000..a03746770fe2 --- /dev/null +++ b/playground/frontend/lib/modules/examples/repositories/example_client/example_client.dart @@ -0,0 +1,15 @@ +import 'package:playground/modules/editor/repository/code_repository/code_client/output_response.dart'; +import 'package:playground/modules/examples/repositories/models/get_example_request.dart'; +import 'package:playground/modules/examples/repositories/models/get_example_response.dart'; +import 'package:playground/modules/examples/repositories/models/get_list_of_examples_request.dart'; +import 'package:playground/modules/examples/repositories/models/get_list_of_examples_response.dart'; + +abstract class ExampleClient { + Future getListOfExamples( + GetListOfExamplesRequestWrapper request, + ); + + Future getExample(GetExampleRequestWrapper request); + + Future getExampleOutput(GetExampleRequestWrapper request); +} diff --git a/playground/frontend/lib/modules/examples/repositories/example_client/grpc_example_client.dart b/playground/frontend/lib/modules/examples/repositories/example_client/grpc_example_client.dart new file mode 100644 index 000000000000..27682c59aac2 --- /dev/null +++ b/playground/frontend/lib/modules/examples/repositories/example_client/grpc_example_client.dart @@ -0,0 +1,123 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import 'package:grpc/grpc_web.dart'; +import 'package:playground/api/v1/api.pbgrpc.dart' as grpc; +import 'package:playground/constants/api.dart'; +import 'package:playground/modules/editor/repository/code_repository/code_client/output_response.dart'; +import 'package:playground/modules/examples/models/category_model.dart'; +import 'package:playground/modules/examples/repositories/example_client/example_client.dart'; +import 'package:playground/modules/examples/repositories/models/get_example_request.dart'; +import 'package:playground/modules/examples/repositories/models/get_example_response.dart'; +import 'package:playground/modules/examples/repositories/models/get_list_of_examples_request.dart'; +import 'package:playground/modules/examples/repositories/models/get_list_of_examples_response.dart'; +import 'package:playground/modules/sdk/models/sdk.dart'; + +class GrpcExampleClient implements ExampleClient { + late final GrpcWebClientChannel _channel; + late final grpc.PlaygroundServiceClient _client; + + GrpcExampleClient() { + _channel = GrpcWebClientChannel.xhr( + Uri.parse(kApiClientURL), + ); + _client = grpc.PlaygroundServiceClient(_channel); + } + + @override + Future getListOfExamples( + GetListOfExamplesRequestWrapper request, + ) { + return _runSafely( + () => _client + .getListOfExamples(_getListOfExamplesRequestToGrpcRequest(request)) + .then((response) => GetListOfExampleResponse( + _toClientCategories(response.sdkCategories))), + ); + } + + @override + Future getExample(GetExampleRequestWrapper request) { + return _runSafely( + () => _client + .getExample(_getExampleRequestToGrpcRequest(request)) + .then((response) => GetExampleResponse(response.code)), + ); + } + + @override + Future getExampleOutput(GetExampleRequestWrapper request) { + return _runSafely( + () => _client + .getExampleOutput(_getExampleRequestToGrpcRequest(request)) + .then((response) => OutputResponse(response.output)), + ); + } + + Future _runSafely(Future Function() invoke) { + try { + return invoke(); + } on GrpcError catch (error) { + throw Exception(error.message); + } + } + + grpc.GetListOfExamplesRequest _getListOfExamplesRequestToGrpcRequest( + GetListOfExamplesRequestWrapper request, + ) { + return grpc.GetListOfExamplesRequest() + ..category = request.category ?? '' + ..sdk = request.sdk == null + ? grpc.Sdk.SDK_UNSPECIFIED + : _getGrpcSdk(request.sdk!); + } + + grpc.GetExampleRequest _getExampleRequestToGrpcRequest( + GetExampleRequestWrapper request, + ) { + return grpc.GetExampleRequest()..exampleUuid = request.uuid; + } + + grpc.Sdk _getGrpcSdk(SDK sdk) { + switch (sdk) { + case SDK.java: + return grpc.Sdk.SDK_JAVA; + case SDK.go: + return grpc.Sdk.SDK_GO; + case SDK.python: + return grpc.Sdk.SDK_PYTHON; + case SDK.scio: + return grpc.Sdk.SDK_SCIO; + } + } + + Map> _toClientCategories( + Map response, + ) { + Map> output = {}; + // for (SDK sdk in SDK.values) { + // final sdkName = sdk.displayName.toLowerCase(); + // if (response.containsKey(sdkName)) { + // response[sdkName]!.categoryExamples.forEach((key, value) { + // output[sdk]!.add(CategoryModel(name: key, examples: value.example)); + // }); + // } + // } + return output; + } +} diff --git a/playground/frontend/lib/modules/examples/repositories/example_repository.dart b/playground/frontend/lib/modules/examples/repositories/example_repository.dart index a83ee11c9f31..c986c99330fc 100644 --- a/playground/frontend/lib/modules/examples/repositories/example_repository.dart +++ b/playground/frontend/lib/modules/examples/repositories/example_repository.dart @@ -17,191 +17,52 @@ */ import 'package:playground/modules/examples/models/category_model.dart'; -import 'package:playground/modules/examples/models/example_model.dart'; -import 'package:playground/modules/examples/models/outputs_model.dart'; +import 'package:playground/modules/examples/repositories/example_client/example_client.dart'; +import 'package:playground/modules/examples/repositories/models/get_example_request.dart'; +import 'package:playground/modules/examples/repositories/models/get_list_of_examples_request.dart'; import 'package:playground/modules/sdk/models/sdk.dart'; -const javaHelloWorld = '''class HelloWorld { - public static void main(String[] args) { - System.out.println("Hello World!"); - } -}'''; - -const pythonHelloWorld = 'print(‘Hello World’)'; - -const goHelloWorld = '''package main - -import "fmt" - -// this is a comment - -func main() { - fmt.Println("Hello World") -}'''; - -const scioHelloWorld = ''' -object Hello { - def main(args: Array[String]) = { - println("Hello, world") - } -}'''; - -const getListOfExamplesResponse = { - 'java': [ - { - 'name': 'WordCountCategory', - 'examples': [ - { - 'name': 'MinimalWordCount', - 'id': 1111, - 'type': 'example', - 'description': 'ABCCDEFG', - }, - { - 'name': 'WordCount', - 'id': 2222, - 'type': 'kata', - 'description': 'ABCCDEFG', - }, - ], - }, - { - 'name': 'Kafka', - 'examples': [ - { - 'name': 'KafkaToPubSub', - 'id': 3333, - 'type': 'test', - 'description': 'ABCCDEFG', - }, - ], - }, - ], - 'python': [ - { - 'name': 'WordCountCategory', - 'examples': [ - { - 'name': 'MinimalWordCount', - 'id': 4444, - 'type': 'example', - 'description': 'ABCCDEFG', - }, - ], - }, - ], - 'go': [ - { - 'name': 'WordCountCategory', - 'examples': [ - { - 'name': 'MinimalWordCount', - 'id': 5555, - 'type': 'example', - 'description': 'ABCCDEFG', - }, - ], - }, - ], -}; - -const getPrecompiledOutputsResponse = { - 'output': 'precompiled output', - 'graph': 'precompiled graph', - 'log': 'precompiled log', -}; - -final getDefaultExamplesResponse = { - SDK.java: ExampleModel( - source: javaHelloWorld, - name: 'Default Java', - type: ExampleType.example, - id: 1, - description: 'ABCDEFG', - ), - SDK.python: ExampleModel( - source: pythonHelloWorld, - name: 'Default Python', - type: ExampleType.example, - id: 2, - description: 'ABCDEFG', - ), - SDK.go: ExampleModel( - source: goHelloWorld, - name: 'Default Go', - type: ExampleType.example, - id: 3, - description: 'ABCDEFG', - ), - SDK.scio: ExampleModel( - source: scioHelloWorld, - name: 'Default SCIO', - type: ExampleType.example, - id: 4, - description: 'ABCDEFG', - ), -}; - -const responseStatusCode = 200; - class ExampleRepository { - Future>> getListOfExamples() async { - await Future.delayed(const Duration(seconds: 1)); - Map> responseBody = getListOfExamplesResponse; - switch (responseStatusCode) { - case 200: - return parseListOfExamplesResponse(responseBody); - default: - return {}; - } - } + late final ExampleClient _client; - Future> getDefaultExamples() async { - await Future.delayed(const Duration(seconds: 1)); - switch (responseStatusCode) { - case 200: - return getDefaultExamplesResponse; - default: - return {}; - } + ExampleRepository(ExampleClient client) { + _client = client; } - Future getExampleSource(int id) async { - await Future.delayed(const Duration(milliseconds: 200)); - switch (responseStatusCode) { - case 200: - return id.toString(); - default: - return ''; - } + Future>> getListOfExamples( + GetListOfExamplesRequestWrapper request, + ) async { + final result = await _client.getListOfExamples(request); + return result.categories; } - Future getPrecompiledOutputs(int id) async { - await Future.delayed(const Duration(seconds: 1)); - Map responseBody = getPrecompiledOutputsResponse; - switch (responseStatusCode) { - case 200: - return parsePrecompiledOutputs(responseBody); - default: - return OutputsModel('', '', ''); - } + Future getExampleSource(GetExampleRequestWrapper request) async { + final result = await _client.getExample(request); + return result.code; } - Map> parseListOfExamplesResponse(Map data) { - Map> output = {}; - for (SDK sdk in SDK.values) { - final sdkName = sdk.displayName.toLowerCase(); - if (data.containsKey(sdkName)) { - output[sdk] = data[sdkName] - .map((category) => CategoryModel.fromJson(category)) - .cast() - .toList(); - } - } - return output; + Future getExampleOutput( + GetExampleRequestWrapper request, + ) async { + final result = await _client.getExampleOutput(request); + return result.output; } - OutputsModel parsePrecompiledOutputs(Map data) { - return OutputsModel.fromJson(data); - } +// Map> parseListOfExamplesResponse(Map data) { +// Map> output = {}; +// for (SDK sdk in SDK.values) { +// final sdkName = sdk.displayName.toLowerCase(); +// if (data.containsKey(sdkName)) { +// output[sdk] = data[sdkName] +// .map((category) => CategoryModel.fromJson(category)) +// .cast() +// .toList(); +// } +// } +// return output; +// } +// +// OutputsModel parsePrecompiledOutputs(Map data) { +// return OutputsModel.fromJson(data); +// } } diff --git a/playground/frontend/lib/modules/examples/repositories/models/get_example_request.dart b/playground/frontend/lib/modules/examples/repositories/models/get_example_request.dart new file mode 100644 index 000000000000..bb749b55f255 --- /dev/null +++ b/playground/frontend/lib/modules/examples/repositories/models/get_example_request.dart @@ -0,0 +1,5 @@ +class GetExampleRequestWrapper { + final String uuid; + + GetExampleRequestWrapper(this.uuid); +} \ No newline at end of file diff --git a/playground/frontend/lib/modules/examples/repositories/models/get_example_response.dart b/playground/frontend/lib/modules/examples/repositories/models/get_example_response.dart new file mode 100644 index 000000000000..93808f16a17e --- /dev/null +++ b/playground/frontend/lib/modules/examples/repositories/models/get_example_response.dart @@ -0,0 +1,5 @@ +class GetExampleResponse { + final String code; + + GetExampleResponse(this.code); +} \ No newline at end of file diff --git a/playground/frontend/lib/modules/examples/repositories/models/get_list_of_examples_request.dart b/playground/frontend/lib/modules/examples/repositories/models/get_list_of_examples_request.dart new file mode 100644 index 000000000000..f6061747d5fb --- /dev/null +++ b/playground/frontend/lib/modules/examples/repositories/models/get_list_of_examples_request.dart @@ -0,0 +1,8 @@ +import 'package:playground/modules/sdk/models/sdk.dart'; + +class GetListOfExamplesRequestWrapper { + final SDK? sdk; + final String? category; + + GetListOfExamplesRequestWrapper({required this.sdk, required this.category}); +} diff --git a/playground/frontend/lib/modules/examples/repositories/models/get_list_of_examples_response.dart b/playground/frontend/lib/modules/examples/repositories/models/get_list_of_examples_response.dart new file mode 100644 index 000000000000..ec249b0d1009 --- /dev/null +++ b/playground/frontend/lib/modules/examples/repositories/models/get_list_of_examples_response.dart @@ -0,0 +1,8 @@ +import 'package:playground/modules/sdk/models/sdk.dart'; +import 'package:playground/modules/examples/models/category_model.dart'; + +class GetListOfExampleResponse { + final Map> categories; + + GetListOfExampleResponse(this.categories); +} \ No newline at end of file diff --git a/playground/frontend/lib/modules/examples/repositories/models/get_precompiled_outputs_request.dart b/playground/frontend/lib/modules/examples/repositories/models/get_precompiled_outputs_request.dart new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/playground/frontend/lib/modules/sdk/components/sdk_selector.dart b/playground/frontend/lib/modules/sdk/components/sdk_selector.dart index 674672368582..1bba5716e373 100644 --- a/playground/frontend/lib/modules/sdk/components/sdk_selector.dart +++ b/playground/frontend/lib/modules/sdk/components/sdk_selector.dart @@ -62,7 +62,7 @@ class SDKSelector extends StatelessWidget { onChanged: (SDK? newSdk) { if (newSdk != null) { setSdk(newSdk); - setExample(state.defaultExamples![newSdk]!); + setExample(state.sdkCategories![newSdk]!.first.examples.first); } }, items: SDK.values.map>((SDK value) { diff --git a/playground/frontend/lib/pages/playground/components/playground_page_providers.dart b/playground/frontend/lib/pages/playground/components/playground_page_providers.dart index 9e6431743a8e..5e671e30fe27 100644 --- a/playground/frontend/lib/pages/playground/components/playground_page_providers.dart +++ b/playground/frontend/lib/pages/playground/components/playground_page_providers.dart @@ -19,6 +19,7 @@ import 'package:flutter/material.dart'; import 'package:playground/modules/editor/repository/code_repository/code_client/grpc_code_client.dart'; import 'package:playground/modules/editor/repository/code_repository/code_repository.dart'; +import 'package:playground/modules/examples/repositories/example_client/grpc_example_client.dart'; import 'package:playground/modules/examples/repositories/example_repository.dart'; import 'package:playground/modules/output/models/output_placement_state.dart'; import 'package:playground/pages/playground/states/examples_state.dart'; @@ -26,6 +27,8 @@ import 'package:playground/pages/playground/states/playground_state.dart'; import 'package:provider/provider.dart'; final CodeRepository kCodeRepository = CodeRepository(GrpcCodeClient()); +final ExampleRepository kExampleRepository = + ExampleRepository(GrpcExampleClient()); class PlaygroundPageProviders extends StatelessWidget { final Widget child; @@ -40,7 +43,7 @@ class PlaygroundPageProviders extends StatelessWidget { return MultiProvider( providers: [ ChangeNotifierProvider( - create: (context) => ExampleState(ExampleRepository()), + create: (context) => ExampleState(kExampleRepository), ), ChangeNotifierProxyProvider( create: (context) => PlaygroundState(codeRepository: kCodeRepository), @@ -49,19 +52,20 @@ class PlaygroundPageProviders extends StatelessWidget { return PlaygroundState(codeRepository: kCodeRepository); } - if (exampleState.defaultExamples != null && + if (exampleState.sdkCategories != null && playground.selectedExample == null) { - final defaultExample = - exampleState.defaultExamples![playground.sdk]; - exampleState - .getPrecompiledOutputs(defaultExample!.id!) - .then((value) { + final defaultExample = exampleState + .sdkCategories![playground.sdk]!.first.examples.first; + exampleState.getExampleSource(defaultExample.uuid).then((value) { + defaultExample.setSource(value); + }); + exampleState.getExampleOutput(defaultExample.uuid).then((value) { defaultExample.setOutputs(value); }); return PlaygroundState( codeRepository: kCodeRepository, sdk: playground.sdk, - selectedExample: exampleState.defaultExamples![playground.sdk], + selectedExample: defaultExample, ); } return playground; diff --git a/playground/frontend/lib/pages/playground/states/example_selector_state.dart b/playground/frontend/lib/pages/playground/states/example_selector_state.dart index a51673afdb20..4e034535f366 100644 --- a/playground/frontend/lib/pages/playground/states/example_selector_state.dart +++ b/playground/frontend/lib/pages/playground/states/example_selector_state.dart @@ -103,7 +103,7 @@ class ExampleSelectorState with ChangeNotifier { ) { return examples .where((example) => - example.name!.toLowerCase().contains(name.toLowerCase())) + example.name.toLowerCase().contains(name.toLowerCase())) .toList(); } } diff --git a/playground/frontend/lib/pages/playground/states/examples_state.dart b/playground/frontend/lib/pages/playground/states/examples_state.dart index a8c0b8e903f5..11b177d9f7e6 100644 --- a/playground/frontend/lib/pages/playground/states/examples_state.dart +++ b/playground/frontend/lib/pages/playground/states/examples_state.dart @@ -18,43 +18,42 @@ import 'package:flutter/material.dart'; import 'package:playground/modules/examples/models/category_model.dart'; -import 'package:playground/modules/examples/models/example_model.dart'; -import 'package:playground/modules/examples/models/outputs_model.dart'; import 'package:playground/modules/examples/repositories/example_repository.dart'; +import 'package:playground/modules/examples/repositories/models/get_example_request.dart'; +import 'package:playground/modules/examples/repositories/models/get_list_of_examples_request.dart'; import 'package:playground/modules/sdk/models/sdk.dart'; class ExampleState with ChangeNotifier { final ExampleRepository _exampleRepository; - Map>? categoriesBySdkMap; - Map? defaultExamples; + Map>? sdkCategories; bool isSelectorOpened = false; ExampleState(this._exampleRepository) { _loadCategories(); - _loadDefaultExamples(); } List? getCategories(SDK sdk) { - return categoriesBySdkMap?[sdk] ?? []; + return sdkCategories?[sdk] ?? []; } - Future getPrecompiledOutputs(int id) async { - OutputsModel outputs = await _exampleRepository.getPrecompiledOutputs(id); - return outputs; + Future getExampleOutput(String id) async { + String output = await _exampleRepository.getExampleOutput( + GetExampleRequestWrapper(id), + ); + return output; } - Future getSource(int id) async { - String source = await _exampleRepository.getExampleSource(id); + Future getExampleSource(String id) async { + String source = await _exampleRepository.getExampleSource( + GetExampleRequestWrapper(id), + ); return source; } _loadCategories() async { - categoriesBySdkMap = await _exampleRepository.getListOfExamples(); - notifyListeners(); - } - - _loadDefaultExamples() async { - defaultExamples = await _exampleRepository.getDefaultExamples(); + sdkCategories = await _exampleRepository.getListOfExamples( + GetListOfExamplesRequestWrapper(sdk: null, category: null), + ); notifyListeners(); } diff --git a/playground/frontend/lib/pages/playground/states/playground_state.dart b/playground/frontend/lib/pages/playground/states/playground_state.dart index b751fa918577..0d65869963ff 100644 --- a/playground/frontend/lib/pages/playground/states/playground_state.dart +++ b/playground/frontend/lib/pages/playground/states/playground_state.dart @@ -100,7 +100,7 @@ class PlaygroundState with ChangeNotifier { _selectedExample?.outputs != null) { _result = RunCodeResult( status: RunCodeStatus.finished, - output: _selectedExample!.outputs?.output ?? 'anti-precompiled output', + output: _selectedExample!.outputs ?? 'anti-precompiled output', ); notifyListeners(); } else { diff --git a/playground/frontend/pubspec.lock b/playground/frontend/pubspec.lock index 3707c48b525b..024ef910d7ec 100644 --- a/playground/frontend/pubspec.lock +++ b/playground/frontend/pubspec.lock @@ -325,19 +325,12 @@ packages: source: hosted version: "0.6.3" json_annotation: - dependency: "direct main" + dependency: transitive description: name: json_annotation url: "https://pub.dartlang.org" source: hosted version: "4.3.0" - json_serializable: - dependency: "direct dev" - description: - name: json_serializable - url: "https://pub.dartlang.org" - source: hosted - version: "6.0.1" linked_scroll_controller: dependency: transitive description: @@ -497,13 +490,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.1.1" - source_helper: - dependency: transitive - description: - name: source_helper - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" source_span: dependency: transitive description: diff --git a/playground/frontend/pubspec.yaml b/playground/frontend/pubspec.yaml index 8a11e6a12b60..16d0210ecdc1 100644 --- a/playground/frontend/pubspec.yaml +++ b/playground/frontend/pubspec.yaml @@ -52,14 +52,12 @@ dependencies: url_launcher: ^6.0.12 expansion_widget: ^0.0.2 grpc: ^3.0.0 - json_annotation: ^4.3.0 dev_dependencies: flutter_test: sdk: flutter mockito: ^5.0.16 build_runner: ^2.1.4 - json_serializable: ^6.0.1 # The "flutter_lints" package below contains a set of recommended lints to # encourage good coding practices. The lint set provided by the package is From 057c382ca798bb7e8435066cc399dcee66770a11 Mon Sep 17 00:00:00 2001 From: Alexander Date: Fri, 12 Nov 2021 18:14:37 +0400 Subject: [PATCH 20/32] [BEAM-13101] Changed example structure, regenerate proto --- playground/api/v1/api.proto | 104 +- playground/backend/internal/api/v1/api.pb.go | 1157 ++++++++++++----- .../backend/internal/api/v1/api_grpc.pb.go | 180 ++- playground/frontend/lib/api/v1/api.pb.dart | 832 ++++++------ .../frontend/lib/api/v1/api.pbenum.dart | 89 +- .../frontend/lib/api/v1/api.pbgrpc.dart | 211 +-- .../frontend/lib/api/v1/api.pbjson.dart | 239 ++-- .../example_list/expansion_panel_item.dart | 9 +- .../examples/models/example_model.dart | 4 +- .../example_client/grpc_example_client.dart | 82 +- .../models/get_example_request.dart | 4 +- .../components/playground_page_providers.dart | 4 +- .../playground/states/examples_state.dart | 32 +- .../states/example_selector_state_test.dart | 19 +- .../playground/states/mocks/example_mock.dart | 4 + 15 files changed, 1839 insertions(+), 1131 deletions(-) diff --git a/playground/api/v1/api.proto b/playground/api/v1/api.proto index 367fcc212179..f25da7c71df0 100644 --- a/playground/api/v1/api.proto +++ b/playground/api/v1/api.proto @@ -31,11 +31,24 @@ enum Sdk { enum Status { STATUS_UNSPECIFIED = 0; - STATUS_EXECUTING = 1; - STATUS_FINISHED = 2; - STATUS_ERROR = 3; - STATUS_COMPILE_ERROR = 4; - STATUS_RUN_TIMEOUT = 5; + STATUS_VALIDATING = 1; + STATUS_VALIDATION_ERROR = 2; + STATUS_PREPARING = 3; + STATUS_PREPARATION_ERROR = 4; + STATUS_COMPILING = 5; + STATUS_COMPILE_ERROR = 6; + STATUS_EXECUTING = 7; + STATUS_FINISHED = 8; + STATUS_RUN_ERROR = 9; + STATUS_ERROR = 10; + STATUS_RUN_TIMEOUT = 11; + STATUS_CANCELED = 12; +} + +enum PrecompiledObjectType { + EXAMPLE = 0; + KATA = 1; + UNIT_TEST = 2; } // RunCodeRequest represents a code text and options of SDK which executes the code. @@ -78,37 +91,64 @@ message GetRunOutputRequest { // RunOutputResponse represents the result of the executed code. message GetRunOutputResponse { string output = 1; - Status compilation_status = 2; } -// ListOfExamplesRequest contains information of the needed examples sdk and categories. -message GetListOfExamplesRequest{ +// GetRunErrorRequest contains information of the pipeline uuid. +message GetRunErrorRequest { + string pipeline_uuid = 1; +} + +// GetRunErrorResponse represents the error of the executed code. +message GetRunErrorResponse { + string output = 1; +} + +// CancelRequest request to cancel code processing +message CancelRequest { + string pipeline_uuid = 1; +} + +// CancelResponse response for cancel request +message CancelResponse { +} + +// GetPrecompiledObjectsRequest contains information of the needed PrecompiledObjects sdk and categories. +message GetPrecompiledObjectsRequest{ Sdk sdk = 1; string category = 2; } -// Examples represent the array of examples. -message Examples{ - repeated string example = 1; +// PrecompiledObject represents one PrecompiledObject with its information +message PrecompiledObject{ + string cloud_path = 1; + string name = 2; + string description = 3; + PrecompiledObjectType type = 4; } -// CategoryList represent the map between the category and examples corresponding to this category. -message CategoryList{ - map category_examples = 1; +// Categories represent the array of messages with sdk and categories at this sdk +message Categories{ + message Category{ + string category_name = 1; + repeated PrecompiledObject precompiled_objects = 2; + } + Sdk sdk = 1; + repeated Category categories = 2; } -// ListOfExamplesResponse represent the map between sdk and categories for the sdk. -message GetListOfExamplesResponse{ - map sdk_categories = 1; + +// GetListOfPrecompiledObjectsResponse represent the map between sdk and categories for the sdk. +message GetPrecompiledObjectsResponse{ + repeated Categories sdk_categories = 1; } -// ExampleRequest contains information of the example uuid. -message GetExampleRequest{ - string example_uuid = 1; +// GetPrecompiledObjectRequest contains information of the PrecompiledObject uuid. +message GetPrecompiledObjectRequest{ + string cloud_path = 1; } -// ExampleResponse represents the source code of the example. -message GetExampleResponse{ +// GetPrecompiledObjectResponse represents the source code of the PrecompiledObject. +message GetPrecompiledObjectCodeResponse{ string code = 1; } @@ -123,15 +163,21 @@ service PlaygroundService { // Get the result of pipeline execution. rpc GetRunOutput(GetRunOutputRequest) returns (GetRunOutputResponse); + // Get the error of pipeline execution. + rpc GetRunError(GetRunErrorRequest) returns (GetRunErrorResponse); + // Get the result of pipeline compilation. rpc GetCompileOutput(GetCompileOutputRequest) returns (GetCompileOutputResponse); - // Get the list of precompiled examples. - rpc GetListOfExamples(GetListOfExamplesRequest) returns (GetListOfExamplesResponse); + // Cancel code processing + rpc Cancel(CancelRequest) returns (CancelResponse); - // Get the code of an example. - rpc GetExample(GetExampleRequest) returns (GetExampleResponse); + // Get all precompiled objects from the cloud storage. + rpc GetPrecompiledObjects(GetPrecompiledObjectsRequest) returns (GetPrecompiledObjectsResponse); - // Get the precompiled details of an example. - rpc GetExampleOutput(GetExampleRequest) returns (GetRunOutputResponse); -} + // Get the code of an PrecompiledObject. + rpc GetPrecompiledObjectCode(GetPrecompiledObjectRequest) returns (GetPrecompiledObjectCodeResponse); + + // Get the precompiled details of an PrecompiledObject. + rpc GetPrecompiledObjectOutput(GetPrecompiledObjectRequest) returns (GetRunOutputResponse); +} \ No newline at end of file diff --git a/playground/backend/internal/api/v1/api.pb.go b/playground/backend/internal/api/v1/api.pb.go index 578193be317b..c0d95bfea7d7 100644 --- a/playground/backend/internal/api/v1/api.pb.go +++ b/playground/backend/internal/api/v1/api.pb.go @@ -17,11 +17,11 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 -// protoc v3.17.3 -// source: api.proto +// protoc-gen-go v1.25.0-devel +// protoc v3.19.1 +// source: api/v1/api.proto -package v1 +package playground import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -76,11 +76,11 @@ func (x Sdk) String() string { } func (Sdk) Descriptor() protoreflect.EnumDescriptor { - return file_api_proto_enumTypes[0].Descriptor() + return file_api_v1_api_proto_enumTypes[0].Descriptor() } func (Sdk) Type() protoreflect.EnumType { - return &file_api_proto_enumTypes[0] + return &file_api_v1_api_proto_enumTypes[0] } func (x Sdk) Number() protoreflect.EnumNumber { @@ -89,37 +89,58 @@ func (x Sdk) Number() protoreflect.EnumNumber { // Deprecated: Use Sdk.Descriptor instead. func (Sdk) EnumDescriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{0} + return file_api_v1_api_proto_rawDescGZIP(), []int{0} } type Status int32 const ( - Status_STATUS_UNSPECIFIED Status = 0 - Status_STATUS_EXECUTING Status = 1 - Status_STATUS_FINISHED Status = 2 - Status_STATUS_ERROR Status = 3 - Status_STATUS_COMPILE_ERROR Status = 4 - Status_STATUS_RUN_TIMEOUT Status = 5 + Status_STATUS_UNSPECIFIED Status = 0 + Status_STATUS_VALIDATING Status = 1 + Status_STATUS_VALIDATION_ERROR Status = 2 + Status_STATUS_PREPARING Status = 3 + Status_STATUS_PREPARATION_ERROR Status = 4 + Status_STATUS_COMPILING Status = 5 + Status_STATUS_COMPILE_ERROR Status = 6 + Status_STATUS_EXECUTING Status = 7 + Status_STATUS_FINISHED Status = 8 + Status_STATUS_RUN_ERROR Status = 9 + Status_STATUS_ERROR Status = 10 + Status_STATUS_RUN_TIMEOUT Status = 11 + Status_STATUS_CANCELED Status = 12 ) // Enum value maps for Status. var ( Status_name = map[int32]string{ - 0: "STATUS_UNSPECIFIED", - 1: "STATUS_EXECUTING", - 2: "STATUS_FINISHED", - 3: "STATUS_ERROR", - 4: "STATUS_COMPILE_ERROR", - 5: "STATUS_RUN_TIMEOUT", + 0: "STATUS_UNSPECIFIED", + 1: "STATUS_VALIDATING", + 2: "STATUS_VALIDATION_ERROR", + 3: "STATUS_PREPARING", + 4: "STATUS_PREPARATION_ERROR", + 5: "STATUS_COMPILING", + 6: "STATUS_COMPILE_ERROR", + 7: "STATUS_EXECUTING", + 8: "STATUS_FINISHED", + 9: "STATUS_RUN_ERROR", + 10: "STATUS_ERROR", + 11: "STATUS_RUN_TIMEOUT", + 12: "STATUS_CANCELED", } Status_value = map[string]int32{ - "STATUS_UNSPECIFIED": 0, - "STATUS_EXECUTING": 1, - "STATUS_FINISHED": 2, - "STATUS_ERROR": 3, - "STATUS_COMPILE_ERROR": 4, - "STATUS_RUN_TIMEOUT": 5, + "STATUS_UNSPECIFIED": 0, + "STATUS_VALIDATING": 1, + "STATUS_VALIDATION_ERROR": 2, + "STATUS_PREPARING": 3, + "STATUS_PREPARATION_ERROR": 4, + "STATUS_COMPILING": 5, + "STATUS_COMPILE_ERROR": 6, + "STATUS_EXECUTING": 7, + "STATUS_FINISHED": 8, + "STATUS_RUN_ERROR": 9, + "STATUS_ERROR": 10, + "STATUS_RUN_TIMEOUT": 11, + "STATUS_CANCELED": 12, } ) @@ -134,11 +155,11 @@ func (x Status) String() string { } func (Status) Descriptor() protoreflect.EnumDescriptor { - return file_api_proto_enumTypes[1].Descriptor() + return file_api_v1_api_proto_enumTypes[1].Descriptor() } func (Status) Type() protoreflect.EnumType { - return &file_api_proto_enumTypes[1] + return &file_api_v1_api_proto_enumTypes[1] } func (x Status) Number() protoreflect.EnumNumber { @@ -147,7 +168,56 @@ func (x Status) Number() protoreflect.EnumNumber { // Deprecated: Use Status.Descriptor instead. func (Status) EnumDescriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{1} + return file_api_v1_api_proto_rawDescGZIP(), []int{1} +} + +type PrecompiledObjectType int32 + +const ( + PrecompiledObjectType_EXAMPLE PrecompiledObjectType = 0 + PrecompiledObjectType_KATA PrecompiledObjectType = 1 + PrecompiledObjectType_UNIT_TEST PrecompiledObjectType = 2 +) + +// Enum value maps for PrecompiledObjectType. +var ( + PrecompiledObjectType_name = map[int32]string{ + 0: "EXAMPLE", + 1: "KATA", + 2: "UNIT_TEST", + } + PrecompiledObjectType_value = map[string]int32{ + "EXAMPLE": 0, + "KATA": 1, + "UNIT_TEST": 2, + } +) + +func (x PrecompiledObjectType) Enum() *PrecompiledObjectType { + p := new(PrecompiledObjectType) + *p = x + return p +} + +func (x PrecompiledObjectType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (PrecompiledObjectType) Descriptor() protoreflect.EnumDescriptor { + return file_api_v1_api_proto_enumTypes[2].Descriptor() +} + +func (PrecompiledObjectType) Type() protoreflect.EnumType { + return &file_api_v1_api_proto_enumTypes[2] +} + +func (x PrecompiledObjectType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use PrecompiledObjectType.Descriptor instead. +func (PrecompiledObjectType) EnumDescriptor() ([]byte, []int) { + return file_api_v1_api_proto_rawDescGZIP(), []int{2} } // RunCodeRequest represents a code text and options of SDK which executes the code. @@ -163,7 +233,7 @@ type RunCodeRequest struct { func (x *RunCodeRequest) Reset() { *x = RunCodeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[0] + mi := &file_api_v1_api_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -176,7 +246,7 @@ func (x *RunCodeRequest) String() string { func (*RunCodeRequest) ProtoMessage() {} func (x *RunCodeRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[0] + mi := &file_api_v1_api_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -189,7 +259,7 @@ func (x *RunCodeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RunCodeRequest.ProtoReflect.Descriptor instead. func (*RunCodeRequest) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{0} + return file_api_v1_api_proto_rawDescGZIP(), []int{0} } func (x *RunCodeRequest) GetCode() string { @@ -218,7 +288,7 @@ type RunCodeResponse struct { func (x *RunCodeResponse) Reset() { *x = RunCodeResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[1] + mi := &file_api_v1_api_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -231,7 +301,7 @@ func (x *RunCodeResponse) String() string { func (*RunCodeResponse) ProtoMessage() {} func (x *RunCodeResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[1] + mi := &file_api_v1_api_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -244,7 +314,7 @@ func (x *RunCodeResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use RunCodeResponse.ProtoReflect.Descriptor instead. func (*RunCodeResponse) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{1} + return file_api_v1_api_proto_rawDescGZIP(), []int{1} } func (x *RunCodeResponse) GetPipelineUuid() string { @@ -266,7 +336,7 @@ type CheckStatusRequest struct { func (x *CheckStatusRequest) Reset() { *x = CheckStatusRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[2] + mi := &file_api_v1_api_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -279,7 +349,7 @@ func (x *CheckStatusRequest) String() string { func (*CheckStatusRequest) ProtoMessage() {} func (x *CheckStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[2] + mi := &file_api_v1_api_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -292,7 +362,7 @@ func (x *CheckStatusRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CheckStatusRequest.ProtoReflect.Descriptor instead. func (*CheckStatusRequest) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{2} + return file_api_v1_api_proto_rawDescGZIP(), []int{2} } func (x *CheckStatusRequest) GetPipelineUuid() string { @@ -314,7 +384,7 @@ type CheckStatusResponse struct { func (x *CheckStatusResponse) Reset() { *x = CheckStatusResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[3] + mi := &file_api_v1_api_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -327,7 +397,7 @@ func (x *CheckStatusResponse) String() string { func (*CheckStatusResponse) ProtoMessage() {} func (x *CheckStatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[3] + mi := &file_api_v1_api_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -340,7 +410,7 @@ func (x *CheckStatusResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CheckStatusResponse.ProtoReflect.Descriptor instead. func (*CheckStatusResponse) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{3} + return file_api_v1_api_proto_rawDescGZIP(), []int{3} } func (x *CheckStatusResponse) GetStatus() Status { @@ -362,7 +432,7 @@ type GetCompileOutputRequest struct { func (x *GetCompileOutputRequest) Reset() { *x = GetCompileOutputRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[4] + mi := &file_api_v1_api_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -375,7 +445,7 @@ func (x *GetCompileOutputRequest) String() string { func (*GetCompileOutputRequest) ProtoMessage() {} func (x *GetCompileOutputRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[4] + mi := &file_api_v1_api_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -388,7 +458,7 @@ func (x *GetCompileOutputRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetCompileOutputRequest.ProtoReflect.Descriptor instead. func (*GetCompileOutputRequest) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{4} + return file_api_v1_api_proto_rawDescGZIP(), []int{4} } func (x *GetCompileOutputRequest) GetPipelineUuid() string { @@ -411,7 +481,7 @@ type GetCompileOutputResponse struct { func (x *GetCompileOutputResponse) Reset() { *x = GetCompileOutputResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[5] + mi := &file_api_v1_api_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -424,7 +494,7 @@ func (x *GetCompileOutputResponse) String() string { func (*GetCompileOutputResponse) ProtoMessage() {} func (x *GetCompileOutputResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[5] + mi := &file_api_v1_api_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -437,7 +507,7 @@ func (x *GetCompileOutputResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetCompileOutputResponse.ProtoReflect.Descriptor instead. func (*GetCompileOutputResponse) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{5} + return file_api_v1_api_proto_rawDescGZIP(), []int{5} } func (x *GetCompileOutputResponse) GetOutput() string { @@ -466,7 +536,7 @@ type GetRunOutputRequest struct { func (x *GetRunOutputRequest) Reset() { *x = GetRunOutputRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[6] + mi := &file_api_v1_api_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -479,7 +549,7 @@ func (x *GetRunOutputRequest) String() string { func (*GetRunOutputRequest) ProtoMessage() {} func (x *GetRunOutputRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[6] + mi := &file_api_v1_api_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -492,7 +562,7 @@ func (x *GetRunOutputRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetRunOutputRequest.ProtoReflect.Descriptor instead. func (*GetRunOutputRequest) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{6} + return file_api_v1_api_proto_rawDescGZIP(), []int{6} } func (x *GetRunOutputRequest) GetPipelineUuid() string { @@ -508,14 +578,13 @@ type GetRunOutputResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Output string `protobuf:"bytes,1,opt,name=output,proto3" json:"output,omitempty"` - CompilationStatus Status `protobuf:"varint,2,opt,name=compilation_status,json=compilationStatus,proto3,enum=api.v1.Status" json:"compilation_status,omitempty"` + Output string `protobuf:"bytes,1,opt,name=output,proto3" json:"output,omitempty"` } func (x *GetRunOutputResponse) Reset() { *x = GetRunOutputResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[7] + mi := &file_api_v1_api_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -528,7 +597,7 @@ func (x *GetRunOutputResponse) String() string { func (*GetRunOutputResponse) ProtoMessage() {} func (x *GetRunOutputResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[7] + mi := &file_api_v1_api_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -541,7 +610,7 @@ func (x *GetRunOutputResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetRunOutputResponse.ProtoReflect.Descriptor instead. func (*GetRunOutputResponse) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{7} + return file_api_v1_api_proto_rawDescGZIP(), []int{7} } func (x *GetRunOutputResponse) GetOutput() string { @@ -551,15 +620,191 @@ func (x *GetRunOutputResponse) GetOutput() string { return "" } -func (x *GetRunOutputResponse) GetCompilationStatus() Status { +// GetRunErrorRequest contains information of the pipeline uuid. +type GetRunErrorRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PipelineUuid string `protobuf:"bytes,1,opt,name=pipeline_uuid,json=pipelineUuid,proto3" json:"pipeline_uuid,omitempty"` +} + +func (x *GetRunErrorRequest) Reset() { + *x = GetRunErrorRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v1_api_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetRunErrorRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetRunErrorRequest) ProtoMessage() {} + +func (x *GetRunErrorRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_v1_api_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetRunErrorRequest.ProtoReflect.Descriptor instead. +func (*GetRunErrorRequest) Descriptor() ([]byte, []int) { + return file_api_v1_api_proto_rawDescGZIP(), []int{8} +} + +func (x *GetRunErrorRequest) GetPipelineUuid() string { if x != nil { - return x.CompilationStatus + return x.PipelineUuid } - return Status_STATUS_UNSPECIFIED + return "" +} + +// GetRunErrorResponse represents the error of the executed code. +type GetRunErrorResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Output string `protobuf:"bytes,1,opt,name=output,proto3" json:"output,omitempty"` +} + +func (x *GetRunErrorResponse) Reset() { + *x = GetRunErrorResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v1_api_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetRunErrorResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetRunErrorResponse) ProtoMessage() {} + +func (x *GetRunErrorResponse) ProtoReflect() protoreflect.Message { + mi := &file_api_v1_api_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetRunErrorResponse.ProtoReflect.Descriptor instead. +func (*GetRunErrorResponse) Descriptor() ([]byte, []int) { + return file_api_v1_api_proto_rawDescGZIP(), []int{9} +} + +func (x *GetRunErrorResponse) GetOutput() string { + if x != nil { + return x.Output + } + return "" +} + +// CancelRequest request to cancel code processing +type CancelRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PipelineUuid string `protobuf:"bytes,1,opt,name=pipeline_uuid,json=pipelineUuid,proto3" json:"pipeline_uuid,omitempty"` +} + +func (x *CancelRequest) Reset() { + *x = CancelRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v1_api_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CancelRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CancelRequest) ProtoMessage() {} + +func (x *CancelRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_v1_api_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CancelRequest.ProtoReflect.Descriptor instead. +func (*CancelRequest) Descriptor() ([]byte, []int) { + return file_api_v1_api_proto_rawDescGZIP(), []int{10} +} + +func (x *CancelRequest) GetPipelineUuid() string { + if x != nil { + return x.PipelineUuid + } + return "" +} + +// CancelResponse response for cancel request +type CancelResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields } -// ListOfExamplesRequest contains information of the needed examples sdk and categories. -type GetListOfExamplesRequest struct { +func (x *CancelResponse) Reset() { + *x = CancelResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v1_api_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CancelResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CancelResponse) ProtoMessage() {} + +func (x *CancelResponse) ProtoReflect() protoreflect.Message { + mi := &file_api_v1_api_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CancelResponse.ProtoReflect.Descriptor instead. +func (*CancelResponse) Descriptor() ([]byte, []int) { + return file_api_v1_api_proto_rawDescGZIP(), []int{11} +} + +// GetPrecompiledObjectsRequest contains information of the needed PrecompiledObjects sdk and categories. +type GetPrecompiledObjectsRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -568,23 +813,23 @@ type GetListOfExamplesRequest struct { Category string `protobuf:"bytes,2,opt,name=category,proto3" json:"category,omitempty"` } -func (x *GetListOfExamplesRequest) Reset() { - *x = GetListOfExamplesRequest{} +func (x *GetPrecompiledObjectsRequest) Reset() { + *x = GetPrecompiledObjectsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[8] + mi := &file_api_v1_api_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *GetListOfExamplesRequest) String() string { +func (x *GetPrecompiledObjectsRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetListOfExamplesRequest) ProtoMessage() {} +func (*GetPrecompiledObjectsRequest) ProtoMessage() {} -func (x *GetListOfExamplesRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[8] +func (x *GetPrecompiledObjectsRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_v1_api_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -595,51 +840,54 @@ func (x *GetListOfExamplesRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetListOfExamplesRequest.ProtoReflect.Descriptor instead. -func (*GetListOfExamplesRequest) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{8} +// Deprecated: Use GetPrecompiledObjectsRequest.ProtoReflect.Descriptor instead. +func (*GetPrecompiledObjectsRequest) Descriptor() ([]byte, []int) { + return file_api_v1_api_proto_rawDescGZIP(), []int{12} } -func (x *GetListOfExamplesRequest) GetSdk() Sdk { +func (x *GetPrecompiledObjectsRequest) GetSdk() Sdk { if x != nil { return x.Sdk } return Sdk_SDK_UNSPECIFIED } -func (x *GetListOfExamplesRequest) GetCategory() string { +func (x *GetPrecompiledObjectsRequest) GetCategory() string { if x != nil { return x.Category } return "" } -// Examples represent the array of examples. -type Examples struct { +// PrecompiledObject represents one PrecompiledObject with its information +type PrecompiledObject struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Example []string `protobuf:"bytes,1,rep,name=example,proto3" json:"example,omitempty"` + CloudPath string `protobuf:"bytes,1,opt,name=cloud_path,json=cloudPath,proto3" json:"cloud_path,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + Type PrecompiledObjectType `protobuf:"varint,4,opt,name=type,proto3,enum=api.v1.PrecompiledObjectType" json:"type,omitempty"` } -func (x *Examples) Reset() { - *x = Examples{} +func (x *PrecompiledObject) Reset() { + *x = PrecompiledObject{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[9] + mi := &file_api_v1_api_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *Examples) String() string { +func (x *PrecompiledObject) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Examples) ProtoMessage() {} +func (*PrecompiledObject) ProtoMessage() {} -func (x *Examples) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[9] +func (x *PrecompiledObject) ProtoReflect() protoreflect.Message { + mi := &file_api_v1_api_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -650,44 +898,66 @@ func (x *Examples) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Examples.ProtoReflect.Descriptor instead. -func (*Examples) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{9} +// Deprecated: Use PrecompiledObject.ProtoReflect.Descriptor instead. +func (*PrecompiledObject) Descriptor() ([]byte, []int) { + return file_api_v1_api_proto_rawDescGZIP(), []int{13} } -func (x *Examples) GetExample() []string { +func (x *PrecompiledObject) GetCloudPath() string { if x != nil { - return x.Example + return x.CloudPath } - return nil + return "" +} + +func (x *PrecompiledObject) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *PrecompiledObject) GetDescription() string { + if x != nil { + return x.Description + } + return "" } -// CategoryList represent the map between the category and examples corresponding to this category. -type CategoryList struct { +func (x *PrecompiledObject) GetType() PrecompiledObjectType { + if x != nil { + return x.Type + } + return PrecompiledObjectType_EXAMPLE +} + +// Categories represent the array of messages with sdk and categories at this sdk +type Categories struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - CategoryExamples map[string]*Examples `protobuf:"bytes,1,rep,name=category_examples,json=categoryExamples,proto3" json:"category_examples,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Sdk Sdk `protobuf:"varint,1,opt,name=sdk,proto3,enum=api.v1.Sdk" json:"sdk,omitempty"` + Categories []*Categories_Category `protobuf:"bytes,2,rep,name=categories,proto3" json:"categories,omitempty"` } -func (x *CategoryList) Reset() { - *x = CategoryList{} +func (x *Categories) Reset() { + *x = Categories{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[10] + mi := &file_api_v1_api_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *CategoryList) String() string { +func (x *Categories) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CategoryList) ProtoMessage() {} +func (*Categories) ProtoMessage() {} -func (x *CategoryList) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[10] +func (x *Categories) ProtoReflect() protoreflect.Message { + mi := &file_api_v1_api_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -698,44 +968,51 @@ func (x *CategoryList) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CategoryList.ProtoReflect.Descriptor instead. -func (*CategoryList) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{10} +// Deprecated: Use Categories.ProtoReflect.Descriptor instead. +func (*Categories) Descriptor() ([]byte, []int) { + return file_api_v1_api_proto_rawDescGZIP(), []int{14} } -func (x *CategoryList) GetCategoryExamples() map[string]*Examples { +func (x *Categories) GetSdk() Sdk { if x != nil { - return x.CategoryExamples + return x.Sdk + } + return Sdk_SDK_UNSPECIFIED +} + +func (x *Categories) GetCategories() []*Categories_Category { + if x != nil { + return x.Categories } return nil } -// ListOfExamplesResponse represent the map between sdk and categories for the sdk. -type GetListOfExamplesResponse struct { +// GetListOfPrecompiledObjectsResponse represent the map between sdk and categories for the sdk. +type GetPrecompiledObjectsResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - SdkCategories map[string]*CategoryList `protobuf:"bytes,1,rep,name=sdk_categories,json=sdkCategories,proto3" json:"sdk_categories,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + SdkCategories []*Categories `protobuf:"bytes,1,rep,name=sdk_categories,json=sdkCategories,proto3" json:"sdk_categories,omitempty"` } -func (x *GetListOfExamplesResponse) Reset() { - *x = GetListOfExamplesResponse{} +func (x *GetPrecompiledObjectsResponse) Reset() { + *x = GetPrecompiledObjectsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[11] + mi := &file_api_v1_api_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *GetListOfExamplesResponse) String() string { +func (x *GetPrecompiledObjectsResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetListOfExamplesResponse) ProtoMessage() {} +func (*GetPrecompiledObjectsResponse) ProtoMessage() {} -func (x *GetListOfExamplesResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[11] +func (x *GetPrecompiledObjectsResponse) ProtoReflect() protoreflect.Message { + mi := &file_api_v1_api_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -746,44 +1023,44 @@ func (x *GetListOfExamplesResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetListOfExamplesResponse.ProtoReflect.Descriptor instead. -func (*GetListOfExamplesResponse) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{11} +// Deprecated: Use GetPrecompiledObjectsResponse.ProtoReflect.Descriptor instead. +func (*GetPrecompiledObjectsResponse) Descriptor() ([]byte, []int) { + return file_api_v1_api_proto_rawDescGZIP(), []int{15} } -func (x *GetListOfExamplesResponse) GetSdkCategories() map[string]*CategoryList { +func (x *GetPrecompiledObjectsResponse) GetSdkCategories() []*Categories { if x != nil { return x.SdkCategories } return nil } -// ExampleRequest contains information of the example uuid. -type GetExampleRequest struct { +// GetPrecompiledObjectRequest contains information of the PrecompiledObject uuid. +type GetPrecompiledObjectRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ExampleUuid string `protobuf:"bytes,1,opt,name=example_uuid,json=exampleUuid,proto3" json:"example_uuid,omitempty"` + CloudPath string `protobuf:"bytes,1,opt,name=cloud_path,json=cloudPath,proto3" json:"cloud_path,omitempty"` } -func (x *GetExampleRequest) Reset() { - *x = GetExampleRequest{} +func (x *GetPrecompiledObjectRequest) Reset() { + *x = GetPrecompiledObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[12] + mi := &file_api_v1_api_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *GetExampleRequest) String() string { +func (x *GetPrecompiledObjectRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetExampleRequest) ProtoMessage() {} +func (*GetPrecompiledObjectRequest) ProtoMessage() {} -func (x *GetExampleRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[12] +func (x *GetPrecompiledObjectRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_v1_api_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -794,20 +1071,20 @@ func (x *GetExampleRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetExampleRequest.ProtoReflect.Descriptor instead. -func (*GetExampleRequest) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{12} +// Deprecated: Use GetPrecompiledObjectRequest.ProtoReflect.Descriptor instead. +func (*GetPrecompiledObjectRequest) Descriptor() ([]byte, []int) { + return file_api_v1_api_proto_rawDescGZIP(), []int{16} } -func (x *GetExampleRequest) GetExampleUuid() string { +func (x *GetPrecompiledObjectRequest) GetCloudPath() string { if x != nil { - return x.ExampleUuid + return x.CloudPath } return "" } -// ExampleResponse represents the source code of the example. -type GetExampleResponse struct { +// GetPrecompiledObjectResponse represents the source code of the PrecompiledObject. +type GetPrecompiledObjectCodeResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -815,23 +1092,23 @@ type GetExampleResponse struct { Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"` } -func (x *GetExampleResponse) Reset() { - *x = GetExampleResponse{} +func (x *GetPrecompiledObjectCodeResponse) Reset() { + *x = GetPrecompiledObjectCodeResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[13] + mi := &file_api_v1_api_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *GetExampleResponse) String() string { +func (x *GetPrecompiledObjectCodeResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetExampleResponse) ProtoMessage() {} +func (*GetPrecompiledObjectCodeResponse) ProtoMessage() {} -func (x *GetExampleResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[13] +func (x *GetPrecompiledObjectCodeResponse) ProtoReflect() protoreflect.Message { + mi := &file_api_v1_api_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -842,226 +1119,328 @@ func (x *GetExampleResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetExampleResponse.ProtoReflect.Descriptor instead. -func (*GetExampleResponse) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{13} +// Deprecated: Use GetPrecompiledObjectCodeResponse.ProtoReflect.Descriptor instead. +func (*GetPrecompiledObjectCodeResponse) Descriptor() ([]byte, []int) { + return file_api_v1_api_proto_rawDescGZIP(), []int{17} } -func (x *GetExampleResponse) GetCode() string { +func (x *GetPrecompiledObjectCodeResponse) GetCode() string { if x != nil { return x.Code } return "" } -var File_api_proto protoreflect.FileDescriptor +type Categories_Category struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CategoryName string `protobuf:"bytes,1,opt,name=category_name,json=categoryName,proto3" json:"category_name,omitempty"` + PrecompiledObjects []*PrecompiledObject `protobuf:"bytes,2,rep,name=precompiled_objects,json=precompiledObjects,proto3" json:"precompiled_objects,omitempty"` +} + +func (x *Categories_Category) Reset() { + *x = Categories_Category{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v1_api_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Categories_Category) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Categories_Category) ProtoMessage() {} + +func (x *Categories_Category) ProtoReflect() protoreflect.Message { + mi := &file_api_v1_api_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Categories_Category.ProtoReflect.Descriptor instead. +func (*Categories_Category) Descriptor() ([]byte, []int) { + return file_api_v1_api_proto_rawDescGZIP(), []int{14, 0} +} + +func (x *Categories_Category) GetCategoryName() string { + if x != nil { + return x.CategoryName + } + return "" +} + +func (x *Categories_Category) GetPrecompiledObjects() []*PrecompiledObject { + if x != nil { + return x.PrecompiledObjects + } + return nil +} -var file_api_proto_rawDesc = []byte{ - 0x0a, 0x09, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x22, 0x43, 0x0a, 0x0e, 0x52, 0x75, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x1d, 0x0a, 0x03, 0x73, 0x64, 0x6b, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, - 0x53, 0x64, 0x6b, 0x52, 0x03, 0x73, 0x64, 0x6b, 0x22, 0x36, 0x0a, 0x0f, 0x52, 0x75, 0x6e, 0x43, - 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x70, +var File_api_v1_api_proto protoreflect.FileDescriptor + +var file_api_v1_api_proto_rawDesc = []byte{ + 0x0a, 0x10, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x06, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x22, 0x43, 0x0a, 0x0e, 0x52, 0x75, + 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, + 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, + 0x12, 0x1d, 0x0a, 0x03, 0x73, 0x64, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0b, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x64, 0x6b, 0x52, 0x03, 0x73, 0x64, 0x6b, 0x22, + 0x36, 0x0a, 0x0f, 0x52, 0x75, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x75, + 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x69, 0x70, 0x65, 0x6c, + 0x69, 0x6e, 0x65, 0x55, 0x75, 0x69, 0x64, 0x22, 0x39, 0x0a, 0x12, 0x43, 0x68, 0x65, 0x63, 0x6b, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, + 0x0d, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x55, 0x75, + 0x69, 0x64, 0x22, 0x3d, 0x0a, 0x13, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x22, 0x3e, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x4f, + 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, + 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x55, 0x75, 0x69, + 0x64, 0x22, 0x71, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x4f, + 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, + 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, + 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x3d, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x0e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x52, 0x11, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x22, 0x3a, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6e, 0x4f, 0x75, + 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x55, 0x75, 0x69, 0x64, - 0x22, 0x39, 0x0a, 0x12, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, + 0x22, 0x2e, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x75, 0x74, 0x70, + 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, + 0x22, 0x39, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, - 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x55, 0x75, 0x69, 0x64, 0x22, 0x3d, 0x0a, 0x13, 0x43, - 0x68, 0x65, 0x63, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x26, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x3e, 0x0a, 0x17, 0x47, 0x65, - 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, - 0x65, 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x69, - 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x55, 0x75, 0x69, 0x64, 0x22, 0x71, 0x0a, 0x18, 0x47, 0x65, + 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x55, 0x75, 0x69, 0x64, 0x22, 0x2d, 0x0a, 0x13, 0x47, + 0x65, 0x74, 0x52, 0x75, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x22, 0x34, 0x0a, 0x0d, 0x43, 0x61, + 0x6e, 0x63, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x70, + 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0c, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x55, 0x75, 0x69, 0x64, + 0x22, 0x10, 0x0a, 0x0e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x59, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x50, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x70, + 0x69, 0x6c, 0x65, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x03, 0x73, 0x64, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x0b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x64, 0x6b, 0x52, 0x03, 0x73, 0x64, + 0x6b, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x22, 0x9b, 0x01, + 0x0a, 0x11, 0x50, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x4f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x5f, 0x70, 0x61, 0x74, + 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x61, + 0x74, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x31, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, + 0x50, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0xe5, 0x01, 0x0a, 0x0a, + 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x03, 0x73, 0x64, + 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x2e, 0x53, 0x64, 0x6b, 0x52, 0x03, 0x73, 0x64, 0x6b, 0x12, 0x3b, 0x0a, 0x0a, 0x63, 0x61, 0x74, + 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, + 0x73, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x0a, 0x63, 0x61, 0x74, 0x65, + 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x1a, 0x7b, 0x0a, 0x08, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, + 0x72, 0x79, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x61, 0x74, 0x65, 0x67, + 0x6f, 0x72, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x4a, 0x0a, 0x13, 0x70, 0x72, 0x65, 0x63, 0x6f, + 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, + 0x65, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, + 0x12, 0x70, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x4f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x73, 0x22, 0x5a, 0x0a, 0x1d, 0x47, 0x65, 0x74, 0x50, 0x72, 0x65, 0x63, 0x6f, 0x6d, + 0x70, 0x69, 0x6c, 0x65, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x0e, 0x73, 0x64, 0x6b, 0x5f, 0x63, 0x61, 0x74, 0x65, + 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, + 0x52, 0x0d, 0x73, 0x64, 0x6b, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x22, + 0x3c, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x50, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, + 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, + 0x0a, 0x0a, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x61, 0x74, 0x68, 0x22, 0x36, 0x0a, + 0x20, 0x47, 0x65, 0x74, 0x50, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x63, 0x6f, 0x64, 0x65, 0x2a, 0x52, 0x0a, 0x03, 0x53, 0x64, 0x6b, 0x12, 0x13, 0x0a, 0x0f, + 0x53, 0x44, 0x4b, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, + 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x44, 0x4b, 0x5f, 0x4a, 0x41, 0x56, 0x41, 0x10, 0x01, 0x12, + 0x0a, 0x0a, 0x06, 0x53, 0x44, 0x4b, 0x5f, 0x47, 0x4f, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x53, + 0x44, 0x4b, 0x5f, 0x50, 0x59, 0x54, 0x48, 0x4f, 0x4e, 0x10, 0x03, 0x12, 0x0c, 0x0a, 0x08, 0x53, + 0x44, 0x4b, 0x5f, 0x53, 0x43, 0x49, 0x4f, 0x10, 0x04, 0x2a, 0xb8, 0x02, 0x0a, 0x06, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, + 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, + 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x49, 0x4e, + 0x47, 0x10, 0x01, 0x12, 0x1b, 0x0a, 0x17, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x56, 0x41, + 0x4c, 0x49, 0x44, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x02, + 0x12, 0x14, 0x0a, 0x10, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x50, 0x52, 0x45, 0x50, 0x41, + 0x52, 0x49, 0x4e, 0x47, 0x10, 0x03, 0x12, 0x1c, 0x0a, 0x18, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, + 0x5f, 0x50, 0x52, 0x45, 0x50, 0x41, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x45, 0x52, 0x52, + 0x4f, 0x52, 0x10, 0x04, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, + 0x4f, 0x4d, 0x50, 0x49, 0x4c, 0x49, 0x4e, 0x47, 0x10, 0x05, 0x12, 0x18, 0x0a, 0x14, 0x53, 0x54, + 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x49, 0x4c, 0x45, 0x5f, 0x45, 0x52, 0x52, + 0x4f, 0x52, 0x10, 0x06, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x45, + 0x58, 0x45, 0x43, 0x55, 0x54, 0x49, 0x4e, 0x47, 0x10, 0x07, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x54, + 0x41, 0x54, 0x55, 0x53, 0x5f, 0x46, 0x49, 0x4e, 0x49, 0x53, 0x48, 0x45, 0x44, 0x10, 0x08, 0x12, + 0x14, 0x0a, 0x10, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52, 0x55, 0x4e, 0x5f, 0x45, 0x52, + 0x52, 0x4f, 0x52, 0x10, 0x09, 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, + 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x0a, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, + 0x53, 0x5f, 0x52, 0x55, 0x4e, 0x5f, 0x54, 0x49, 0x4d, 0x45, 0x4f, 0x55, 0x54, 0x10, 0x0b, 0x12, + 0x13, 0x0a, 0x0f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x41, 0x4e, 0x43, 0x45, 0x4c, + 0x45, 0x44, 0x10, 0x0c, 0x2a, 0x3d, 0x0a, 0x15, 0x50, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x70, 0x69, + 0x6c, 0x65, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, + 0x07, 0x45, 0x58, 0x41, 0x4d, 0x50, 0x4c, 0x45, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x4b, 0x41, + 0x54, 0x41, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x55, 0x4e, 0x49, 0x54, 0x5f, 0x54, 0x45, 0x53, + 0x54, 0x10, 0x02, 0x32, 0xec, 0x05, 0x0a, 0x11, 0x50, 0x6c, 0x61, 0x79, 0x67, 0x72, 0x6f, 0x75, + 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3a, 0x0a, 0x07, 0x52, 0x75, 0x6e, + 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x75, + 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x75, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x0b, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, + 0x65, 0x63, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, + 0x0c, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x1b, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6e, 0x4f, 0x75, 0x74, + 0x70, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x52, + 0x75, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x2e, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, + 0x52, 0x75, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x55, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x4f, 0x75, + 0x74, 0x70, 0x75, 0x74, 0x12, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x3d, - 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x11, 0x63, 0x6f, 0x6d, 0x70, - 0x69, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x3a, 0x0a, - 0x13, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, - 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x69, 0x70, - 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x55, 0x75, 0x69, 0x64, 0x22, 0x6d, 0x0a, 0x14, 0x47, 0x65, 0x74, - 0x52, 0x75, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x3d, 0x0a, 0x12, 0x63, 0x6f, 0x6d, - 0x70, 0x69, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x11, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x55, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x4c, - 0x69, 0x73, 0x74, 0x4f, 0x66, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x03, 0x73, 0x64, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x0b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x64, 0x6b, 0x52, 0x03, - 0x73, 0x64, 0x6b, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x22, - 0x24, 0x0a, 0x08, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x65, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x65, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x22, 0xbe, 0x01, 0x0a, 0x0c, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, - 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x57, 0x0a, 0x11, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, - 0x72, 0x79, 0x5f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x2a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, - 0x6f, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, - 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x10, 0x63, - 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x1a, - 0x55, 0x0a, 0x15, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x45, 0x78, 0x61, 0x6d, 0x70, - 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x26, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x31, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xd0, 0x01, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x4c, 0x69, - 0x73, 0x74, 0x4f, 0x66, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5b, 0x0a, 0x0e, 0x73, 0x64, 0x6b, 0x5f, 0x63, 0x61, 0x74, 0x65, - 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x66, 0x45, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, - 0x53, 0x64, 0x6b, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x52, 0x0d, 0x73, 0x64, 0x6b, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, - 0x73, 0x1a, 0x56, 0x0a, 0x12, 0x53, 0x64, 0x6b, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, - 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2a, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x31, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x36, 0x0a, 0x11, 0x47, 0x65, 0x74, - 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, - 0x0a, 0x0c, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x55, 0x75, 0x69, - 0x64, 0x22, 0x28, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x2a, 0x52, 0x0a, 0x03, 0x53, - 0x64, 0x6b, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x44, 0x4b, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, - 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x44, 0x4b, 0x5f, 0x4a, - 0x41, 0x56, 0x41, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x44, 0x4b, 0x5f, 0x47, 0x4f, 0x10, - 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x53, 0x44, 0x4b, 0x5f, 0x50, 0x59, 0x54, 0x48, 0x4f, 0x4e, 0x10, - 0x03, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x44, 0x4b, 0x5f, 0x53, 0x43, 0x49, 0x4f, 0x10, 0x04, 0x2a, - 0x8f, 0x01, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, - 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, - 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x45, 0x58, 0x45, - 0x43, 0x55, 0x54, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x54, 0x41, 0x54, - 0x55, 0x53, 0x5f, 0x46, 0x49, 0x4e, 0x49, 0x53, 0x48, 0x45, 0x44, 0x10, 0x02, 0x12, 0x10, 0x0a, - 0x0c, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x03, 0x12, - 0x18, 0x0a, 0x14, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x49, 0x4c, - 0x45, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x04, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, - 0x54, 0x55, 0x53, 0x5f, 0x52, 0x55, 0x4e, 0x5f, 0x54, 0x49, 0x4d, 0x45, 0x4f, 0x55, 0x54, 0x10, - 0x05, 0x32, 0xa5, 0x04, 0x0a, 0x11, 0x50, 0x6c, 0x61, 0x79, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3a, 0x0a, 0x07, 0x52, 0x75, 0x6e, 0x43, 0x6f, - 0x64, 0x65, 0x12, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x75, 0x6e, 0x43, - 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x75, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x0b, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x12, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, - 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x0c, 0x47, - 0x65, 0x74, 0x52, 0x75, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x1b, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, - 0x70, 0x69, 0x6c, 0x65, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x1f, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x4f, 0x75, - 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x4f, - 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, - 0x11, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x66, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, - 0x65, 0x73, 0x12, 0x20, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4c, - 0x69, 0x73, 0x74, 0x4f, 0x66, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, - 0x74, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x66, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x45, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, - 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, - 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x10, - 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, - 0x12, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, - 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x38, 0x5a, 0x36, 0x62, 0x65, 0x61, - 0x6d, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x6c, 0x61, - 0x79, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x2f, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x3b, 0x70, 0x6c, 0x61, 0x79, 0x67, 0x72, 0x6f, - 0x75, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, + 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x06, 0x43, 0x61, 0x6e, 0x63, 0x65, + 0x6c, 0x12, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, + 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x64, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x50, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, + 0x65, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0x24, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, + 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x25, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x65, 0x63, + 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x69, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x50, 0x72, 0x65, + 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6f, + 0x64, 0x65, 0x12, 0x23, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, + 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x5f, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x50, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x70, 0x69, + 0x6c, 0x65, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, + 0x23, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x65, 0x63, + 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, + 0x74, 0x52, 0x75, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x42, 0x38, 0x5a, 0x36, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, + 0x65, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x6c, 0x61, 0x79, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, + 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, + 0x6c, 0x3b, 0x70, 0x6c, 0x61, 0x79, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( - file_api_proto_rawDescOnce sync.Once - file_api_proto_rawDescData = file_api_proto_rawDesc + file_api_v1_api_proto_rawDescOnce sync.Once + file_api_v1_api_proto_rawDescData = file_api_v1_api_proto_rawDesc ) -func file_api_proto_rawDescGZIP() []byte { - file_api_proto_rawDescOnce.Do(func() { - file_api_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_proto_rawDescData) +func file_api_v1_api_proto_rawDescGZIP() []byte { + file_api_v1_api_proto_rawDescOnce.Do(func() { + file_api_v1_api_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_v1_api_proto_rawDescData) }) - return file_api_proto_rawDescData -} - -var file_api_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_api_proto_msgTypes = make([]protoimpl.MessageInfo, 16) -var file_api_proto_goTypes = []interface{}{ - (Sdk)(0), // 0: api.v1.Sdk - (Status)(0), // 1: api.v1.Status - (*RunCodeRequest)(nil), // 2: api.v1.RunCodeRequest - (*RunCodeResponse)(nil), // 3: api.v1.RunCodeResponse - (*CheckStatusRequest)(nil), // 4: api.v1.CheckStatusRequest - (*CheckStatusResponse)(nil), // 5: api.v1.CheckStatusResponse - (*GetCompileOutputRequest)(nil), // 6: api.v1.GetCompileOutputRequest - (*GetCompileOutputResponse)(nil), // 7: api.v1.GetCompileOutputResponse - (*GetRunOutputRequest)(nil), // 8: api.v1.GetRunOutputRequest - (*GetRunOutputResponse)(nil), // 9: api.v1.GetRunOutputResponse - (*GetListOfExamplesRequest)(nil), // 10: api.v1.GetListOfExamplesRequest - (*Examples)(nil), // 11: api.v1.Examples - (*CategoryList)(nil), // 12: api.v1.CategoryList - (*GetListOfExamplesResponse)(nil), // 13: api.v1.GetListOfExamplesResponse - (*GetExampleRequest)(nil), // 14: api.v1.GetExampleRequest - (*GetExampleResponse)(nil), // 15: api.v1.GetExampleResponse - nil, // 16: api.v1.CategoryList.CategoryExamplesEntry - nil, // 17: api.v1.GetListOfExamplesResponse.SdkCategoriesEntry -} -var file_api_proto_depIdxs = []int32{ + return file_api_v1_api_proto_rawDescData +} + +var file_api_v1_api_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_api_v1_api_proto_msgTypes = make([]protoimpl.MessageInfo, 19) +var file_api_v1_api_proto_goTypes = []interface{}{ + (Sdk)(0), // 0: api.v1.Sdk + (Status)(0), // 1: api.v1.Status + (PrecompiledObjectType)(0), // 2: api.v1.PrecompiledObjectType + (*RunCodeRequest)(nil), // 3: api.v1.RunCodeRequest + (*RunCodeResponse)(nil), // 4: api.v1.RunCodeResponse + (*CheckStatusRequest)(nil), // 5: api.v1.CheckStatusRequest + (*CheckStatusResponse)(nil), // 6: api.v1.CheckStatusResponse + (*GetCompileOutputRequest)(nil), // 7: api.v1.GetCompileOutputRequest + (*GetCompileOutputResponse)(nil), // 8: api.v1.GetCompileOutputResponse + (*GetRunOutputRequest)(nil), // 9: api.v1.GetRunOutputRequest + (*GetRunOutputResponse)(nil), // 10: api.v1.GetRunOutputResponse + (*GetRunErrorRequest)(nil), // 11: api.v1.GetRunErrorRequest + (*GetRunErrorResponse)(nil), // 12: api.v1.GetRunErrorResponse + (*CancelRequest)(nil), // 13: api.v1.CancelRequest + (*CancelResponse)(nil), // 14: api.v1.CancelResponse + (*GetPrecompiledObjectsRequest)(nil), // 15: api.v1.GetPrecompiledObjectsRequest + (*PrecompiledObject)(nil), // 16: api.v1.PrecompiledObject + (*Categories)(nil), // 17: api.v1.Categories + (*GetPrecompiledObjectsResponse)(nil), // 18: api.v1.GetPrecompiledObjectsResponse + (*GetPrecompiledObjectRequest)(nil), // 19: api.v1.GetPrecompiledObjectRequest + (*GetPrecompiledObjectCodeResponse)(nil), // 20: api.v1.GetPrecompiledObjectCodeResponse + (*Categories_Category)(nil), // 21: api.v1.Categories.Category +} +var file_api_v1_api_proto_depIdxs = []int32{ 0, // 0: api.v1.RunCodeRequest.sdk:type_name -> api.v1.Sdk 1, // 1: api.v1.CheckStatusResponse.status:type_name -> api.v1.Status 1, // 2: api.v1.GetCompileOutputResponse.compilation_status:type_name -> api.v1.Status - 1, // 3: api.v1.GetRunOutputResponse.compilation_status:type_name -> api.v1.Status - 0, // 4: api.v1.GetListOfExamplesRequest.sdk:type_name -> api.v1.Sdk - 16, // 5: api.v1.CategoryList.category_examples:type_name -> api.v1.CategoryList.CategoryExamplesEntry - 17, // 6: api.v1.GetListOfExamplesResponse.sdk_categories:type_name -> api.v1.GetListOfExamplesResponse.SdkCategoriesEntry - 11, // 7: api.v1.CategoryList.CategoryExamplesEntry.value:type_name -> api.v1.Examples - 12, // 8: api.v1.GetListOfExamplesResponse.SdkCategoriesEntry.value:type_name -> api.v1.CategoryList - 2, // 9: api.v1.PlaygroundService.RunCode:input_type -> api.v1.RunCodeRequest - 4, // 10: api.v1.PlaygroundService.CheckStatus:input_type -> api.v1.CheckStatusRequest - 8, // 11: api.v1.PlaygroundService.GetRunOutput:input_type -> api.v1.GetRunOutputRequest - 6, // 12: api.v1.PlaygroundService.GetCompileOutput:input_type -> api.v1.GetCompileOutputRequest - 10, // 13: api.v1.PlaygroundService.GetListOfExamples:input_type -> api.v1.GetListOfExamplesRequest - 14, // 14: api.v1.PlaygroundService.GetExample:input_type -> api.v1.GetExampleRequest - 14, // 15: api.v1.PlaygroundService.GetExampleOutput:input_type -> api.v1.GetExampleRequest - 3, // 16: api.v1.PlaygroundService.RunCode:output_type -> api.v1.RunCodeResponse - 5, // 17: api.v1.PlaygroundService.CheckStatus:output_type -> api.v1.CheckStatusResponse - 9, // 18: api.v1.PlaygroundService.GetRunOutput:output_type -> api.v1.GetRunOutputResponse - 7, // 19: api.v1.PlaygroundService.GetCompileOutput:output_type -> api.v1.GetCompileOutputResponse - 13, // 20: api.v1.PlaygroundService.GetListOfExamples:output_type -> api.v1.GetListOfExamplesResponse - 15, // 21: api.v1.PlaygroundService.GetExample:output_type -> api.v1.GetExampleResponse - 9, // 22: api.v1.PlaygroundService.GetExampleOutput:output_type -> api.v1.GetRunOutputResponse - 16, // [16:23] is the sub-list for method output_type - 9, // [9:16] is the sub-list for method input_type + 0, // 3: api.v1.GetPrecompiledObjectsRequest.sdk:type_name -> api.v1.Sdk + 2, // 4: api.v1.PrecompiledObject.type:type_name -> api.v1.PrecompiledObjectType + 0, // 5: api.v1.Categories.sdk:type_name -> api.v1.Sdk + 21, // 6: api.v1.Categories.categories:type_name -> api.v1.Categories.Category + 17, // 7: api.v1.GetPrecompiledObjectsResponse.sdk_categories:type_name -> api.v1.Categories + 16, // 8: api.v1.Categories.Category.precompiled_objects:type_name -> api.v1.PrecompiledObject + 3, // 9: api.v1.PlaygroundService.RunCode:input_type -> api.v1.RunCodeRequest + 5, // 10: api.v1.PlaygroundService.CheckStatus:input_type -> api.v1.CheckStatusRequest + 9, // 11: api.v1.PlaygroundService.GetRunOutput:input_type -> api.v1.GetRunOutputRequest + 11, // 12: api.v1.PlaygroundService.GetRunError:input_type -> api.v1.GetRunErrorRequest + 7, // 13: api.v1.PlaygroundService.GetCompileOutput:input_type -> api.v1.GetCompileOutputRequest + 13, // 14: api.v1.PlaygroundService.Cancel:input_type -> api.v1.CancelRequest + 15, // 15: api.v1.PlaygroundService.GetPrecompiledObjects:input_type -> api.v1.GetPrecompiledObjectsRequest + 19, // 16: api.v1.PlaygroundService.GetPrecompiledObjectCode:input_type -> api.v1.GetPrecompiledObjectRequest + 19, // 17: api.v1.PlaygroundService.GetPrecompiledObjectOutput:input_type -> api.v1.GetPrecompiledObjectRequest + 4, // 18: api.v1.PlaygroundService.RunCode:output_type -> api.v1.RunCodeResponse + 6, // 19: api.v1.PlaygroundService.CheckStatus:output_type -> api.v1.CheckStatusResponse + 10, // 20: api.v1.PlaygroundService.GetRunOutput:output_type -> api.v1.GetRunOutputResponse + 12, // 21: api.v1.PlaygroundService.GetRunError:output_type -> api.v1.GetRunErrorResponse + 8, // 22: api.v1.PlaygroundService.GetCompileOutput:output_type -> api.v1.GetCompileOutputResponse + 14, // 23: api.v1.PlaygroundService.Cancel:output_type -> api.v1.CancelResponse + 18, // 24: api.v1.PlaygroundService.GetPrecompiledObjects:output_type -> api.v1.GetPrecompiledObjectsResponse + 20, // 25: api.v1.PlaygroundService.GetPrecompiledObjectCode:output_type -> api.v1.GetPrecompiledObjectCodeResponse + 10, // 26: api.v1.PlaygroundService.GetPrecompiledObjectOutput:output_type -> api.v1.GetRunOutputResponse + 18, // [18:27] is the sub-list for method output_type + 9, // [9:18] is the sub-list for method input_type 9, // [9:9] is the sub-list for extension type_name 9, // [9:9] is the sub-list for extension extendee 0, // [0:9] is the sub-list for field type_name } -func init() { file_api_proto_init() } -func file_api_proto_init() { - if File_api_proto != nil { +func init() { file_api_v1_api_proto_init() } +func file_api_v1_api_proto_init() { + if File_api_v1_api_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_api_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_api_v1_api_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RunCodeRequest); i { case 0: return &v.state @@ -1073,7 +1452,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_api_v1_api_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RunCodeResponse); i { case 0: return &v.state @@ -1085,7 +1464,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_api_v1_api_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CheckStatusRequest); i { case 0: return &v.state @@ -1097,7 +1476,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_api_v1_api_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CheckStatusResponse); i { case 0: return &v.state @@ -1109,7 +1488,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_api_v1_api_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetCompileOutputRequest); i { case 0: return &v.state @@ -1121,7 +1500,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_api_v1_api_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetCompileOutputResponse); i { case 0: return &v.state @@ -1133,7 +1512,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_api_v1_api_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetRunOutputRequest); i { case 0: return &v.state @@ -1145,7 +1524,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_api_v1_api_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetRunOutputResponse); i { case 0: return &v.state @@ -1157,8 +1536,68 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetListOfExamplesRequest); i { + file_api_v1_api_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRunErrorRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v1_api_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRunErrorResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v1_api_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CancelRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v1_api_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CancelResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v1_api_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetPrecompiledObjectsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v1_api_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PrecompiledObject); i { case 0: return &v.state case 1: @@ -1169,8 +1608,8 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Examples); i { + file_api_v1_api_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Categories); i { case 0: return &v.state case 1: @@ -1181,8 +1620,8 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CategoryList); i { + file_api_v1_api_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetPrecompiledObjectsResponse); i { case 0: return &v.state case 1: @@ -1193,8 +1632,8 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetListOfExamplesResponse); i { + file_api_v1_api_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetPrecompiledObjectRequest); i { case 0: return &v.state case 1: @@ -1205,8 +1644,8 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetExampleRequest); i { + file_api_v1_api_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetPrecompiledObjectCodeResponse); i { case 0: return &v.state case 1: @@ -1217,8 +1656,8 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetExampleResponse); i { + file_api_v1_api_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Categories_Category); i { case 0: return &v.state case 1: @@ -1234,19 +1673,19 @@ func file_api_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_api_proto_rawDesc, - NumEnums: 2, - NumMessages: 16, + RawDescriptor: file_api_v1_api_proto_rawDesc, + NumEnums: 3, + NumMessages: 19, NumExtensions: 0, NumServices: 1, }, - GoTypes: file_api_proto_goTypes, - DependencyIndexes: file_api_proto_depIdxs, - EnumInfos: file_api_proto_enumTypes, - MessageInfos: file_api_proto_msgTypes, + GoTypes: file_api_v1_api_proto_goTypes, + DependencyIndexes: file_api_v1_api_proto_depIdxs, + EnumInfos: file_api_v1_api_proto_enumTypes, + MessageInfos: file_api_v1_api_proto_msgTypes, }.Build() - File_api_proto = out.File - file_api_proto_rawDesc = nil - file_api_proto_goTypes = nil - file_api_proto_depIdxs = nil + File_api_v1_api_proto = out.File + file_api_v1_api_proto_rawDesc = nil + file_api_v1_api_proto_goTypes = nil + file_api_v1_api_proto_depIdxs = nil } diff --git a/playground/backend/internal/api/v1/api_grpc.pb.go b/playground/backend/internal/api/v1/api_grpc.pb.go index 2b426f0720eb..ebc2a0ad0e58 100644 --- a/playground/backend/internal/api/v1/api_grpc.pb.go +++ b/playground/backend/internal/api/v1/api_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. -package v1 +package playground import ( context "context" @@ -24,14 +24,18 @@ type PlaygroundServiceClient interface { CheckStatus(ctx context.Context, in *CheckStatusRequest, opts ...grpc.CallOption) (*CheckStatusResponse, error) // Get the result of pipeline execution. GetRunOutput(ctx context.Context, in *GetRunOutputRequest, opts ...grpc.CallOption) (*GetRunOutputResponse, error) + // Get the error of pipeline execution. + GetRunError(ctx context.Context, in *GetRunErrorRequest, opts ...grpc.CallOption) (*GetRunErrorResponse, error) // Get the result of pipeline compilation. GetCompileOutput(ctx context.Context, in *GetCompileOutputRequest, opts ...grpc.CallOption) (*GetCompileOutputResponse, error) - // Get the list of precompiled examples. - GetListOfExamples(ctx context.Context, in *GetListOfExamplesRequest, opts ...grpc.CallOption) (*GetListOfExamplesResponse, error) - // Get the code of an example. - GetExample(ctx context.Context, in *GetExampleRequest, opts ...grpc.CallOption) (*GetExampleResponse, error) - // Get the precompiled details of an example. - GetExampleOutput(ctx context.Context, in *GetExampleRequest, opts ...grpc.CallOption) (*GetRunOutputResponse, error) + // Cancel code processing + Cancel(ctx context.Context, in *CancelRequest, opts ...grpc.CallOption) (*CancelResponse, error) + // Get all precompiled objects from the cloud storage. + GetPrecompiledObjects(ctx context.Context, in *GetPrecompiledObjectsRequest, opts ...grpc.CallOption) (*GetPrecompiledObjectsResponse, error) + // Get the code of an PrecompiledObject. + GetPrecompiledObjectCode(ctx context.Context, in *GetPrecompiledObjectRequest, opts ...grpc.CallOption) (*GetPrecompiledObjectCodeResponse, error) + // Get the precompiled details of an PrecompiledObject. + GetPrecompiledObjectOutput(ctx context.Context, in *GetPrecompiledObjectRequest, opts ...grpc.CallOption) (*GetRunOutputResponse, error) } type playgroundServiceClient struct { @@ -69,6 +73,15 @@ func (c *playgroundServiceClient) GetRunOutput(ctx context.Context, in *GetRunOu return out, nil } +func (c *playgroundServiceClient) GetRunError(ctx context.Context, in *GetRunErrorRequest, opts ...grpc.CallOption) (*GetRunErrorResponse, error) { + out := new(GetRunErrorResponse) + err := c.cc.Invoke(ctx, "/api.v1.PlaygroundService/GetRunError", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *playgroundServiceClient) GetCompileOutput(ctx context.Context, in *GetCompileOutputRequest, opts ...grpc.CallOption) (*GetCompileOutputResponse, error) { out := new(GetCompileOutputResponse) err := c.cc.Invoke(ctx, "/api.v1.PlaygroundService/GetCompileOutput", in, out, opts...) @@ -78,27 +91,36 @@ func (c *playgroundServiceClient) GetCompileOutput(ctx context.Context, in *GetC return out, nil } -func (c *playgroundServiceClient) GetListOfExamples(ctx context.Context, in *GetListOfExamplesRequest, opts ...grpc.CallOption) (*GetListOfExamplesResponse, error) { - out := new(GetListOfExamplesResponse) - err := c.cc.Invoke(ctx, "/api.v1.PlaygroundService/GetListOfExamples", in, out, opts...) +func (c *playgroundServiceClient) Cancel(ctx context.Context, in *CancelRequest, opts ...grpc.CallOption) (*CancelResponse, error) { + out := new(CancelResponse) + err := c.cc.Invoke(ctx, "/api.v1.PlaygroundService/Cancel", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *playgroundServiceClient) GetPrecompiledObjects(ctx context.Context, in *GetPrecompiledObjectsRequest, opts ...grpc.CallOption) (*GetPrecompiledObjectsResponse, error) { + out := new(GetPrecompiledObjectsResponse) + err := c.cc.Invoke(ctx, "/api.v1.PlaygroundService/GetPrecompiledObjects", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *playgroundServiceClient) GetExample(ctx context.Context, in *GetExampleRequest, opts ...grpc.CallOption) (*GetExampleResponse, error) { - out := new(GetExampleResponse) - err := c.cc.Invoke(ctx, "/api.v1.PlaygroundService/GetExample", in, out, opts...) +func (c *playgroundServiceClient) GetPrecompiledObjectCode(ctx context.Context, in *GetPrecompiledObjectRequest, opts ...grpc.CallOption) (*GetPrecompiledObjectCodeResponse, error) { + out := new(GetPrecompiledObjectCodeResponse) + err := c.cc.Invoke(ctx, "/api.v1.PlaygroundService/GetPrecompiledObjectCode", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *playgroundServiceClient) GetExampleOutput(ctx context.Context, in *GetExampleRequest, opts ...grpc.CallOption) (*GetRunOutputResponse, error) { +func (c *playgroundServiceClient) GetPrecompiledObjectOutput(ctx context.Context, in *GetPrecompiledObjectRequest, opts ...grpc.CallOption) (*GetRunOutputResponse, error) { out := new(GetRunOutputResponse) - err := c.cc.Invoke(ctx, "/api.v1.PlaygroundService/GetExampleOutput", in, out, opts...) + err := c.cc.Invoke(ctx, "/api.v1.PlaygroundService/GetPrecompiledObjectOutput", in, out, opts...) if err != nil { return nil, err } @@ -106,7 +128,7 @@ func (c *playgroundServiceClient) GetExampleOutput(ctx context.Context, in *GetE } // PlaygroundServiceServer is the server API for PlaygroundService service. -// All implementations must embed UnimplementedPlaygroundServiceServer +// All implementations should embed UnimplementedPlaygroundServiceServer // for forward compatibility type PlaygroundServiceServer interface { // Submit the job for an execution and get the pipeline uuid. @@ -115,18 +137,21 @@ type PlaygroundServiceServer interface { CheckStatus(context.Context, *CheckStatusRequest) (*CheckStatusResponse, error) // Get the result of pipeline execution. GetRunOutput(context.Context, *GetRunOutputRequest) (*GetRunOutputResponse, error) + // Get the error of pipeline execution. + GetRunError(context.Context, *GetRunErrorRequest) (*GetRunErrorResponse, error) // Get the result of pipeline compilation. GetCompileOutput(context.Context, *GetCompileOutputRequest) (*GetCompileOutputResponse, error) - // Get the list of precompiled examples. - GetListOfExamples(context.Context, *GetListOfExamplesRequest) (*GetListOfExamplesResponse, error) - // Get the code of an example. - GetExample(context.Context, *GetExampleRequest) (*GetExampleResponse, error) - // Get the precompiled details of an example. - GetExampleOutput(context.Context, *GetExampleRequest) (*GetRunOutputResponse, error) - mustEmbedUnimplementedPlaygroundServiceServer() + // Cancel code processing + Cancel(context.Context, *CancelRequest) (*CancelResponse, error) + // Get all precompiled objects from the cloud storage. + GetPrecompiledObjects(context.Context, *GetPrecompiledObjectsRequest) (*GetPrecompiledObjectsResponse, error) + // Get the code of an PrecompiledObject. + GetPrecompiledObjectCode(context.Context, *GetPrecompiledObjectRequest) (*GetPrecompiledObjectCodeResponse, error) + // Get the precompiled details of an PrecompiledObject. + GetPrecompiledObjectOutput(context.Context, *GetPrecompiledObjectRequest) (*GetRunOutputResponse, error) } -// UnimplementedPlaygroundServiceServer must be embedded to have forward compatible implementations. +// UnimplementedPlaygroundServiceServer should be embedded to have forward compatible implementations. type UnimplementedPlaygroundServiceServer struct { } @@ -139,19 +164,24 @@ func (UnimplementedPlaygroundServiceServer) CheckStatus(context.Context, *CheckS func (UnimplementedPlaygroundServiceServer) GetRunOutput(context.Context, *GetRunOutputRequest) (*GetRunOutputResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetRunOutput not implemented") } +func (UnimplementedPlaygroundServiceServer) GetRunError(context.Context, *GetRunErrorRequest) (*GetRunErrorResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetRunError not implemented") +} func (UnimplementedPlaygroundServiceServer) GetCompileOutput(context.Context, *GetCompileOutputRequest) (*GetCompileOutputResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetCompileOutput not implemented") } -func (UnimplementedPlaygroundServiceServer) GetListOfExamples(context.Context, *GetListOfExamplesRequest) (*GetListOfExamplesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetListOfExamples not implemented") +func (UnimplementedPlaygroundServiceServer) Cancel(context.Context, *CancelRequest) (*CancelResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Cancel not implemented") +} +func (UnimplementedPlaygroundServiceServer) GetPrecompiledObjects(context.Context, *GetPrecompiledObjectsRequest) (*GetPrecompiledObjectsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPrecompiledObjects not implemented") } -func (UnimplementedPlaygroundServiceServer) GetExample(context.Context, *GetExampleRequest) (*GetExampleResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetExample not implemented") +func (UnimplementedPlaygroundServiceServer) GetPrecompiledObjectCode(context.Context, *GetPrecompiledObjectRequest) (*GetPrecompiledObjectCodeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPrecompiledObjectCode not implemented") } -func (UnimplementedPlaygroundServiceServer) GetExampleOutput(context.Context, *GetExampleRequest) (*GetRunOutputResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetExampleOutput not implemented") +func (UnimplementedPlaygroundServiceServer) GetPrecompiledObjectOutput(context.Context, *GetPrecompiledObjectRequest) (*GetRunOutputResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPrecompiledObjectOutput not implemented") } -func (UnimplementedPlaygroundServiceServer) mustEmbedUnimplementedPlaygroundServiceServer() {} // UnsafePlaygroundServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to PlaygroundServiceServer will @@ -218,6 +248,24 @@ func _PlaygroundService_GetRunOutput_Handler(srv interface{}, ctx context.Contex return interceptor(ctx, in, info, handler) } +func _PlaygroundService_GetRunError_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetRunErrorRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlaygroundServiceServer).GetRunError(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.PlaygroundService/GetRunError", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlaygroundServiceServer).GetRunError(ctx, req.(*GetRunErrorRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _PlaygroundService_GetCompileOutput_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetCompileOutputRequest) if err := dec(in); err != nil { @@ -236,56 +284,74 @@ func _PlaygroundService_GetCompileOutput_Handler(srv interface{}, ctx context.Co return interceptor(ctx, in, info, handler) } -func _PlaygroundService_GetListOfExamples_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetListOfExamplesRequest) +func _PlaygroundService_Cancel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CancelRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlaygroundServiceServer).Cancel(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.PlaygroundService/Cancel", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlaygroundServiceServer).Cancel(ctx, req.(*CancelRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlaygroundService_GetPrecompiledObjects_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetPrecompiledObjectsRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(PlaygroundServiceServer).GetListOfExamples(ctx, in) + return srv.(PlaygroundServiceServer).GetPrecompiledObjects(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.v1.PlaygroundService/GetListOfExamples", + FullMethod: "/api.v1.PlaygroundService/GetPrecompiledObjects", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PlaygroundServiceServer).GetListOfExamples(ctx, req.(*GetListOfExamplesRequest)) + return srv.(PlaygroundServiceServer).GetPrecompiledObjects(ctx, req.(*GetPrecompiledObjectsRequest)) } return interceptor(ctx, in, info, handler) } -func _PlaygroundService_GetExample_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetExampleRequest) +func _PlaygroundService_GetPrecompiledObjectCode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetPrecompiledObjectRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(PlaygroundServiceServer).GetExample(ctx, in) + return srv.(PlaygroundServiceServer).GetPrecompiledObjectCode(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.v1.PlaygroundService/GetExample", + FullMethod: "/api.v1.PlaygroundService/GetPrecompiledObjectCode", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PlaygroundServiceServer).GetExample(ctx, req.(*GetExampleRequest)) + return srv.(PlaygroundServiceServer).GetPrecompiledObjectCode(ctx, req.(*GetPrecompiledObjectRequest)) } return interceptor(ctx, in, info, handler) } -func _PlaygroundService_GetExampleOutput_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetExampleRequest) +func _PlaygroundService_GetPrecompiledObjectOutput_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetPrecompiledObjectRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(PlaygroundServiceServer).GetExampleOutput(ctx, in) + return srv.(PlaygroundServiceServer).GetPrecompiledObjectOutput(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.v1.PlaygroundService/GetExampleOutput", + FullMethod: "/api.v1.PlaygroundService/GetPrecompiledObjectOutput", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PlaygroundServiceServer).GetExampleOutput(ctx, req.(*GetExampleRequest)) + return srv.(PlaygroundServiceServer).GetPrecompiledObjectOutput(ctx, req.(*GetPrecompiledObjectRequest)) } return interceptor(ctx, in, info, handler) } @@ -309,23 +375,31 @@ var PlaygroundService_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetRunOutput", Handler: _PlaygroundService_GetRunOutput_Handler, }, + { + MethodName: "GetRunError", + Handler: _PlaygroundService_GetRunError_Handler, + }, { MethodName: "GetCompileOutput", Handler: _PlaygroundService_GetCompileOutput_Handler, }, { - MethodName: "GetListOfExamples", - Handler: _PlaygroundService_GetListOfExamples_Handler, + MethodName: "Cancel", + Handler: _PlaygroundService_Cancel_Handler, + }, + { + MethodName: "GetPrecompiledObjects", + Handler: _PlaygroundService_GetPrecompiledObjects_Handler, }, { - MethodName: "GetExample", - Handler: _PlaygroundService_GetExample_Handler, + MethodName: "GetPrecompiledObjectCode", + Handler: _PlaygroundService_GetPrecompiledObjectCode_Handler, }, { - MethodName: "GetExampleOutput", - Handler: _PlaygroundService_GetExampleOutput_Handler, + MethodName: "GetPrecompiledObjectOutput", + Handler: _PlaygroundService_GetPrecompiledObjectOutput_Handler, }, }, Streams: []grpc.StreamDesc{}, - Metadata: "api.proto", + Metadata: "api/v1/api.proto", } diff --git a/playground/frontend/lib/api/v1/api.pb.dart b/playground/frontend/lib/api/v1/api.pb.dart index 78a83f8f2b09..40bd52b38003 100644 --- a/playground/frontend/lib/api/v1/api.pb.dart +++ b/playground/frontend/lib/api/v1/api.pb.dart @@ -373,22 +373,17 @@ class GetRunOutputRequest extends $pb.GeneratedMessage { class GetRunOutputResponse extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GetRunOutputResponse', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'api.v1'), createEmptyInstance: create) ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'output') - ..e(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'compilationStatus', $pb.PbFieldType.OE, defaultOrMaker: Status.STATUS_UNSPECIFIED, valueOf: Status.valueOf, enumValues: Status.values) ..hasRequiredFields = false ; GetRunOutputResponse._() : super(); factory GetRunOutputResponse({ $core.String? output, - Status? compilationStatus, }) { final _result = create(); if (output != null) { _result.output = output; } - if (compilationStatus != null) { - _result.compilationStatus = compilationStatus; - } return _result; } factory GetRunOutputResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); @@ -415,60 +410,192 @@ class GetRunOutputResponse extends $pb.GeneratedMessage { @$pb.TagNumber(1) $core.String get output => $_getSZ(0); @$pb.TagNumber(1) - set output($core.String v) { - $_setString(0, v); + set output($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasOutput() => $_has(0); + @$pb.TagNumber(1) + void clearOutput() => clearField(1); +} + +class GetRunErrorRequest extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GetRunErrorRequest', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'api.v1'), createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'pipelineUuid') + ..hasRequiredFields = false + ; + + GetRunErrorRequest._() : super(); + factory GetRunErrorRequest({ + $core.String? pipelineUuid, + }) { + final _result = create(); + if (pipelineUuid != null) { + _result.pipelineUuid = pipelineUuid; + } + return _result; } + factory GetRunErrorRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory GetRunErrorRequest.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') + GetRunErrorRequest clone() => GetRunErrorRequest()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + GetRunErrorRequest copyWith(void Function(GetRunErrorRequest) updates) => super.copyWith((message) => updates(message as GetRunErrorRequest)) as GetRunErrorRequest; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static GetRunErrorRequest create() => GetRunErrorRequest._(); + GetRunErrorRequest createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static GetRunErrorRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static GetRunErrorRequest? _defaultInstance; @$pb.TagNumber(1) - $core.bool hasOutput() => $_has(0); + $core.String get pipelineUuid => $_getSZ(0); + @$pb.TagNumber(1) + set pipelineUuid($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasPipelineUuid() => $_has(0); + @$pb.TagNumber(1) + void clearPipelineUuid() => clearField(1); +} + +class GetRunErrorResponse extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GetRunErrorResponse', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'api.v1'), createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'output') + ..hasRequiredFields = false + ; + + GetRunErrorResponse._() : super(); + factory GetRunErrorResponse({ + $core.String? output, + }) { + final _result = create(); + if (output != null) { + _result.output = output; + } + return _result; + } + factory GetRunErrorResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory GetRunErrorResponse.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') + GetRunErrorResponse clone() => GetRunErrorResponse()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + GetRunErrorResponse copyWith(void Function(GetRunErrorResponse) updates) => super.copyWith((message) => updates(message as GetRunErrorResponse)) as GetRunErrorResponse; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static GetRunErrorResponse create() => GetRunErrorResponse._(); + GetRunErrorResponse createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static GetRunErrorResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static GetRunErrorResponse? _defaultInstance; + @$pb.TagNumber(1) + $core.String get output => $_getSZ(0); + @$pb.TagNumber(1) + set output($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasOutput() => $_has(0); @$pb.TagNumber(1) void clearOutput() => clearField(1); +} - @$pb.TagNumber(2) - Status get compilationStatus => $_getN(1); +class CancelRequest extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CancelRequest', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'api.v1'), createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'pipelineUuid') + ..hasRequiredFields = false + ; - @$pb.TagNumber(2) - set compilationStatus(Status v) { - setField(2, v); + CancelRequest._() : super(); + factory CancelRequest({ + $core.String? pipelineUuid, + }) { + final _result = create(); + if (pipelineUuid != null) { + _result.pipelineUuid = pipelineUuid; + } + return _result; } + factory CancelRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory CancelRequest.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') + CancelRequest clone() => CancelRequest()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + CancelRequest copyWith(void Function(CancelRequest) updates) => super.copyWith((message) => updates(message as CancelRequest)) as CancelRequest; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static CancelRequest create() => CancelRequest._(); + CancelRequest createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static CancelRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static CancelRequest? _defaultInstance; - @$pb.TagNumber(2) - $core.bool hasCompilationStatus() => $_has(1); + @$pb.TagNumber(1) + $core.String get pipelineUuid => $_getSZ(0); + @$pb.TagNumber(1) + set pipelineUuid($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasPipelineUuid() => $_has(0); + @$pb.TagNumber(1) + void clearPipelineUuid() => clearField(1); +} - @$pb.TagNumber(2) - void clearCompilationStatus() => clearField(2); +class CancelResponse extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CancelResponse', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'api.v1'), createEmptyInstance: create) + ..hasRequiredFields = false + ; + + CancelResponse._() : super(); + factory CancelResponse() => create(); + factory CancelResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory CancelResponse.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') + CancelResponse clone() => CancelResponse()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + CancelResponse copyWith(void Function(CancelResponse) updates) => super.copyWith((message) => updates(message as CancelResponse)) as CancelResponse; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static CancelResponse create() => CancelResponse._(); + CancelResponse createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static CancelResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static CancelResponse? _defaultInstance; } -class GetListOfExamplesRequest extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'GetListOfExamplesRequest', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'api.v1'), - createEmptyInstance: create) - ..e( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'sdk', - $pb.PbFieldType.OE, - defaultOrMaker: Sdk.SDK_UNSPECIFIED, - valueOf: Sdk.valueOf, - enumValues: Sdk.values) - ..aOS( - 2, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'category') - ..hasRequiredFields = false; - - GetListOfExamplesRequest._() : super(); - - factory GetListOfExamplesRequest({ +class GetPrecompiledObjectsRequest extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GetPrecompiledObjectsRequest', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'api.v1'), createEmptyInstance: create) + ..e(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'sdk', $pb.PbFieldType.OE, defaultOrMaker: Sdk.SDK_UNSPECIFIED, valueOf: Sdk.valueOf, enumValues: Sdk.values) + ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'category') + ..hasRequiredFields = false + ; + + GetPrecompiledObjectsRequest._() : super(); + factory GetPrecompiledObjectsRequest({ Sdk? sdk, $core.String? category, }) { @@ -481,236 +608,254 @@ class GetListOfExamplesRequest extends $pb.GeneratedMessage { } return _result; } - - factory GetListOfExamplesRequest.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - - factory GetListOfExamplesRequest.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') - GetListOfExamplesRequest clone() => - GetListOfExamplesRequest()..mergeFromMessage(this); - - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - GetListOfExamplesRequest copyWith( - void Function(GetListOfExamplesRequest) updates) => - super.copyWith((message) => updates(message as GetListOfExamplesRequest)) - as GetListOfExamplesRequest; // ignore: deprecated_member_use + factory GetPrecompiledObjectsRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory GetPrecompiledObjectsRequest.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') + GetPrecompiledObjectsRequest clone() => GetPrecompiledObjectsRequest()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + GetPrecompiledObjectsRequest copyWith(void Function(GetPrecompiledObjectsRequest) updates) => super.copyWith((message) => updates(message as GetPrecompiledObjectsRequest)) as GetPrecompiledObjectsRequest; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static GetListOfExamplesRequest create() => GetListOfExamplesRequest._(); - - GetListOfExamplesRequest createEmptyInstance() => create(); - - static $pb.PbList createRepeated() => - $pb.PbList(); - + static GetPrecompiledObjectsRequest create() => GetPrecompiledObjectsRequest._(); + GetPrecompiledObjectsRequest createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') - static GetListOfExamplesRequest getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static GetListOfExamplesRequest? _defaultInstance; + static GetPrecompiledObjectsRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static GetPrecompiledObjectsRequest? _defaultInstance; @$pb.TagNumber(1) Sdk get sdk => $_getN(0); - @$pb.TagNumber(1) - set sdk(Sdk v) { - setField(1, v); - } - + set sdk(Sdk v) { setField(1, v); } @$pb.TagNumber(1) $core.bool hasSdk() => $_has(0); - @$pb.TagNumber(1) void clearSdk() => clearField(1); @$pb.TagNumber(2) $core.String get category => $_getSZ(1); - @$pb.TagNumber(2) - set category($core.String v) { - $_setString(1, v); - } - + set category($core.String v) { $_setString(1, v); } @$pb.TagNumber(2) $core.bool hasCategory() => $_has(1); - @$pb.TagNumber(2) void clearCategory() => clearField(2); } -class Examples extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'Examples', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'api.v1'), - createEmptyInstance: create) - ..pPS( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'example') - ..hasRequiredFields = false; - - Examples._() : super(); - - factory Examples({ - $core.Iterable<$core.String>? example, +class PrecompiledObject extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'PrecompiledObject', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'api.v1'), createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'cloudPath') + ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name') + ..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'description') + ..e(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'type', $pb.PbFieldType.OE, defaultOrMaker: PrecompiledObjectType.EXAMPLE, valueOf: PrecompiledObjectType.valueOf, enumValues: PrecompiledObjectType.values) + ..hasRequiredFields = false + ; + + PrecompiledObject._() : super(); + factory PrecompiledObject({ + $core.String? cloudPath, + $core.String? name, + $core.String? description, + PrecompiledObjectType? type, }) { final _result = create(); - if (example != null) { - _result.example.addAll(example); + if (cloudPath != null) { + _result.cloudPath = cloudPath; + } + if (name != null) { + _result.name = name; + } + if (description != null) { + _result.description = description; + } + if (type != null) { + _result.type = type; } return _result; } - - factory Examples.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - - factory Examples.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') - Examples clone() => Examples()..mergeFromMessage(this); - - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - Examples copyWith(void Function(Examples) updates) => - super.copyWith((message) => updates(message as Examples)) - as Examples; // ignore: deprecated_member_use + factory PrecompiledObject.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory PrecompiledObject.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') + PrecompiledObject clone() => PrecompiledObject()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + PrecompiledObject copyWith(void Function(PrecompiledObject) updates) => super.copyWith((message) => updates(message as PrecompiledObject)) as PrecompiledObject; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static Examples create() => Examples._(); - - Examples createEmptyInstance() => create(); - - static $pb.PbList createRepeated() => $pb.PbList(); - + static PrecompiledObject create() => PrecompiledObject._(); + PrecompiledObject createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') - static Examples getDefault() => - _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static Examples? _defaultInstance; + static PrecompiledObject getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static PrecompiledObject? _defaultInstance; @$pb.TagNumber(1) - $core.List<$core.String> get example => $_getList(0); + $core.String get cloudPath => $_getSZ(0); + @$pb.TagNumber(1) + set cloudPath($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasCloudPath() => $_has(0); + @$pb.TagNumber(1) + void clearCloudPath() => 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 description => $_getSZ(2); + @$pb.TagNumber(3) + set description($core.String v) { $_setString(2, v); } + @$pb.TagNumber(3) + $core.bool hasDescription() => $_has(2); + @$pb.TagNumber(3) + void clearDescription() => clearField(3); + + @$pb.TagNumber(4) + PrecompiledObjectType get type => $_getN(3); + @$pb.TagNumber(4) + set type(PrecompiledObjectType v) { setField(4, v); } + @$pb.TagNumber(4) + $core.bool hasType() => $_has(3); + @$pb.TagNumber(4) + void clearType() => clearField(4); } -class CategoryList extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'CategoryList', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'api.v1'), - createEmptyInstance: create) - ..m<$core.String, Examples>( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'categoryExamples', - entryClassName: 'CategoryList.CategoryExamplesEntry', - keyFieldType: $pb.PbFieldType.OS, - valueFieldType: $pb.PbFieldType.OM, - valueCreator: Examples.create, - packageName: const $pb.PackageName('api.v1')) - ..hasRequiredFields = false; - - CategoryList._() : super(); - - factory CategoryList({ - $core.Map<$core.String, Examples>? categoryExamples, +class Categories_Category extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Categories.Category', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'api.v1'), createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'categoryName') + ..pc(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'precompiledObjects', $pb.PbFieldType.PM, subBuilder: PrecompiledObject.create) + ..hasRequiredFields = false + ; + + Categories_Category._() : super(); + factory Categories_Category({ + $core.String? categoryName, + $core.Iterable? precompiledObjects, }) { final _result = create(); - if (categoryExamples != null) { - _result.categoryExamples.addAll(categoryExamples); + if (categoryName != null) { + _result.categoryName = categoryName; + } + if (precompiledObjects != null) { + _result.precompiledObjects.addAll(precompiledObjects); } return _result; } - - factory CategoryList.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - - factory CategoryList.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') - CategoryList clone() => CategoryList()..mergeFromMessage(this); - - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - CategoryList copyWith(void Function(CategoryList) updates) => - super.copyWith((message) => updates(message as CategoryList)) - as CategoryList; // ignore: deprecated_member_use + factory Categories_Category.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory Categories_Category.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') + Categories_Category clone() => Categories_Category()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Categories_Category copyWith(void Function(Categories_Category) updates) => super.copyWith((message) => updates(message as Categories_Category)) as Categories_Category; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static CategoryList create() => CategoryList._(); + static Categories_Category create() => Categories_Category._(); + Categories_Category createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static Categories_Category getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static Categories_Category? _defaultInstance; - CategoryList createEmptyInstance() => create(); + @$pb.TagNumber(1) + $core.String get categoryName => $_getSZ(0); + @$pb.TagNumber(1) + set categoryName($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasCategoryName() => $_has(0); + @$pb.TagNumber(1) + void clearCategoryName() => clearField(1); + + @$pb.TagNumber(2) + $core.List get precompiledObjects => $_getList(1); +} - static $pb.PbList createRepeated() => - $pb.PbList(); +class Categories extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Categories', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'api.v1'), createEmptyInstance: create) + ..e(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'sdk', $pb.PbFieldType.OE, defaultOrMaker: Sdk.SDK_UNSPECIFIED, valueOf: Sdk.valueOf, enumValues: Sdk.values) + ..pc(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'categories', $pb.PbFieldType.PM, subBuilder: Categories_Category.create) + ..hasRequiredFields = false + ; + Categories._() : super(); + factory Categories({ + Sdk? sdk, + $core.Iterable? categories, + }) { + final _result = create(); + if (sdk != null) { + _result.sdk = sdk; + } + if (categories != null) { + _result.categories.addAll(categories); + } + return _result; + } + factory Categories.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory Categories.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') + Categories clone() => Categories()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Categories copyWith(void Function(Categories) updates) => super.copyWith((message) => updates(message as Categories)) as Categories; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') - static CategoryList getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static CategoryList? _defaultInstance; + static Categories create() => Categories._(); + Categories createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static Categories getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static Categories? _defaultInstance; @$pb.TagNumber(1) - $core.Map<$core.String, Examples> get categoryExamples => $_getMap(0); + Sdk get sdk => $_getN(0); + @$pb.TagNumber(1) + set sdk(Sdk v) { setField(1, v); } + @$pb.TagNumber(1) + $core.bool hasSdk() => $_has(0); + @$pb.TagNumber(1) + void clearSdk() => clearField(1); + + @$pb.TagNumber(2) + $core.List get categories => $_getList(1); } -class GetListOfExamplesResponse extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'GetListOfExamplesResponse', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'api.v1'), - createEmptyInstance: create) - ..m<$core.String, CategoryList>( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'sdkCategories', - entryClassName: 'GetListOfExamplesResponse.SdkCategoriesEntry', - keyFieldType: $pb.PbFieldType.OS, - valueFieldType: $pb.PbFieldType.OM, - valueCreator: CategoryList.create, - packageName: const $pb.PackageName('api.v1')) - ..hasRequiredFields = false; - - GetListOfExamplesResponse._() : super(); - - factory GetListOfExamplesResponse({ - $core.Map<$core.String, CategoryList>? sdkCategories, +class GetPrecompiledObjectsResponse extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GetPrecompiledObjectsResponse', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'api.v1'), createEmptyInstance: create) + ..pc(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'sdkCategories', $pb.PbFieldType.PM, subBuilder: Categories.create) + ..hasRequiredFields = false + ; + + GetPrecompiledObjectsResponse._() : super(); + factory GetPrecompiledObjectsResponse({ + $core.Iterable? sdkCategories, }) { final _result = create(); if (sdkCategories != null) { @@ -718,145 +863,86 @@ class GetListOfExamplesResponse extends $pb.GeneratedMessage { } return _result; } - - factory GetListOfExamplesResponse.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - - factory GetListOfExamplesResponse.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') - GetListOfExamplesResponse clone() => - GetListOfExamplesResponse()..mergeFromMessage(this); - - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - GetListOfExamplesResponse copyWith( - void Function(GetListOfExamplesResponse) updates) => - super.copyWith((message) => updates(message as GetListOfExamplesResponse)) - as GetListOfExamplesResponse; // ignore: deprecated_member_use + factory GetPrecompiledObjectsResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory GetPrecompiledObjectsResponse.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') + GetPrecompiledObjectsResponse clone() => GetPrecompiledObjectsResponse()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + GetPrecompiledObjectsResponse copyWith(void Function(GetPrecompiledObjectsResponse) updates) => super.copyWith((message) => updates(message as GetPrecompiledObjectsResponse)) as GetPrecompiledObjectsResponse; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static GetListOfExamplesResponse create() => GetListOfExamplesResponse._(); - - GetListOfExamplesResponse createEmptyInstance() => create(); - - static $pb.PbList createRepeated() => - $pb.PbList(); - + static GetPrecompiledObjectsResponse create() => GetPrecompiledObjectsResponse._(); + GetPrecompiledObjectsResponse createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') - static GetListOfExamplesResponse getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static GetListOfExamplesResponse? _defaultInstance; + static GetPrecompiledObjectsResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static GetPrecompiledObjectsResponse? _defaultInstance; @$pb.TagNumber(1) - $core.Map<$core.String, CategoryList> get sdkCategories => $_getMap(0); + $core.List get sdkCategories => $_getList(0); } -class GetExampleRequest extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'GetExampleRequest', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'api.v1'), - createEmptyInstance: create) - ..aOS( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'exampleUuid') - ..hasRequiredFields = false; - - GetExampleRequest._() : super(); - - factory GetExampleRequest({ - $core.String? exampleUuid, +class GetPrecompiledObjectRequest extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GetPrecompiledObjectRequest', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'api.v1'), createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'cloudPath') + ..hasRequiredFields = false + ; + + GetPrecompiledObjectRequest._() : super(); + factory GetPrecompiledObjectRequest({ + $core.String? cloudPath, }) { final _result = create(); - if (exampleUuid != null) { - _result.exampleUuid = exampleUuid; + if (cloudPath != null) { + _result.cloudPath = cloudPath; } return _result; } - - factory GetExampleRequest.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - - factory GetExampleRequest.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') - GetExampleRequest clone() => GetExampleRequest()..mergeFromMessage(this); - - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - GetExampleRequest copyWith(void Function(GetExampleRequest) updates) => - super.copyWith((message) => updates(message as GetExampleRequest)) - as GetExampleRequest; // ignore: deprecated_member_use + factory GetPrecompiledObjectRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory GetPrecompiledObjectRequest.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') + GetPrecompiledObjectRequest clone() => GetPrecompiledObjectRequest()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + GetPrecompiledObjectRequest copyWith(void Function(GetPrecompiledObjectRequest) updates) => super.copyWith((message) => updates(message as GetPrecompiledObjectRequest)) as GetPrecompiledObjectRequest; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static GetExampleRequest create() => GetExampleRequest._(); - - GetExampleRequest createEmptyInstance() => create(); - - static $pb.PbList createRepeated() => - $pb.PbList(); - + static GetPrecompiledObjectRequest create() => GetPrecompiledObjectRequest._(); + GetPrecompiledObjectRequest createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') - static GetExampleRequest getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static GetExampleRequest? _defaultInstance; + static GetPrecompiledObjectRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static GetPrecompiledObjectRequest? _defaultInstance; @$pb.TagNumber(1) - $core.String get exampleUuid => $_getSZ(0); - + $core.String get cloudPath => $_getSZ(0); @$pb.TagNumber(1) - set exampleUuid($core.String v) { - $_setString(0, v); - } - + set cloudPath($core.String v) { $_setString(0, v); } @$pb.TagNumber(1) - $core.bool hasExampleUuid() => $_has(0); - + $core.bool hasCloudPath() => $_has(0); @$pb.TagNumber(1) - void clearExampleUuid() => clearField(1); + void clearCloudPath() => clearField(1); } -class GetExampleResponse extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'GetExampleResponse', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'api.v1'), - createEmptyInstance: create) - ..aOS( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'code') - ..hasRequiredFields = false; - - GetExampleResponse._() : super(); - - factory GetExampleResponse({ +class GetPrecompiledObjectCodeResponse extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GetPrecompiledObjectCodeResponse', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'api.v1'), createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'code') + ..hasRequiredFields = false + ; + + GetPrecompiledObjectCodeResponse._() : super(); + factory GetPrecompiledObjectCodeResponse({ $core.String? code, }) { final _result = create(); @@ -865,52 +951,34 @@ class GetExampleResponse extends $pb.GeneratedMessage { } return _result; } - - factory GetExampleResponse.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - - factory GetExampleResponse.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') - GetExampleResponse clone() => GetExampleResponse()..mergeFromMessage(this); - - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - GetExampleResponse copyWith(void Function(GetExampleResponse) updates) => - super.copyWith((message) => updates(message as GetExampleResponse)) - as GetExampleResponse; // ignore: deprecated_member_use + factory GetPrecompiledObjectCodeResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory GetPrecompiledObjectCodeResponse.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') + GetPrecompiledObjectCodeResponse clone() => GetPrecompiledObjectCodeResponse()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + GetPrecompiledObjectCodeResponse copyWith(void Function(GetPrecompiledObjectCodeResponse) updates) => super.copyWith((message) => updates(message as GetPrecompiledObjectCodeResponse)) as GetPrecompiledObjectCodeResponse; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static GetExampleResponse create() => GetExampleResponse._(); - - GetExampleResponse createEmptyInstance() => create(); - - static $pb.PbList createRepeated() => - $pb.PbList(); - + static GetPrecompiledObjectCodeResponse create() => GetPrecompiledObjectCodeResponse._(); + GetPrecompiledObjectCodeResponse createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') - static GetExampleResponse getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static GetExampleResponse? _defaultInstance; + static GetPrecompiledObjectCodeResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static GetPrecompiledObjectCodeResponse? _defaultInstance; @$pb.TagNumber(1) $core.String get code => $_getSZ(0); - @$pb.TagNumber(1) - set code($core.String v) { - $_setString(0, v); - } - + set code($core.String v) { $_setString(0, v); } @$pb.TagNumber(1) $core.bool hasCode() => $_has(0); - @$pb.TagNumber(1) void clearCode() => clearField(1); } + diff --git a/playground/frontend/lib/api/v1/api.pbenum.dart b/playground/frontend/lib/api/v1/api.pbenum.dart index 7f689183913a..4f9a3da5ece0 100644 --- a/playground/frontend/lib/api/v1/api.pbenum.dart +++ b/playground/frontend/lib/api/v1/api.pbenum.dart @@ -1,20 +1,3 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ /// // Generated code. Do not modify. // source: api/v1/api.proto @@ -24,7 +7,6 @@ // ignore_for_file: UNDEFINED_SHOWN_NAME import 'dart:core' as $core; - import 'package:protobuf/protobuf.dart' as $pb; class Sdk extends $pb.ProtobufEnum { @@ -49,44 +31,34 @@ class Sdk extends $pb.ProtobufEnum { } class Status extends $pb.ProtobufEnum { - static const Status STATUS_UNSPECIFIED = Status._( - 0, - const $core.bool.fromEnvironment('protobuf.omit_enum_names') - ? '' - : 'STATUS_UNSPECIFIED'); - static const Status STATUS_EXECUTING = Status._( - 1, - const $core.bool.fromEnvironment('protobuf.omit_enum_names') - ? '' - : 'STATUS_EXECUTING'); - static const Status STATUS_FINISHED = Status._( - 2, - const $core.bool.fromEnvironment('protobuf.omit_enum_names') - ? '' - : 'STATUS_FINISHED'); - static const Status STATUS_ERROR = Status._( - 3, - const $core.bool.fromEnvironment('protobuf.omit_enum_names') - ? '' - : 'STATUS_ERROR'); - static const Status STATUS_COMPILE_ERROR = Status._( - 4, - const $core.bool.fromEnvironment('protobuf.omit_enum_names') - ? '' - : 'STATUS_COMPILE_ERROR'); - static const Status STATUS_RUN_TIMEOUT = Status._( - 5, - const $core.bool.fromEnvironment('protobuf.omit_enum_names') - ? '' - : 'STATUS_RUN_TIMEOUT'); + static const Status STATUS_UNSPECIFIED = Status._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'STATUS_UNSPECIFIED'); + static const Status STATUS_VALIDATING = Status._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'STATUS_VALIDATING'); + static const Status STATUS_VALIDATION_ERROR = Status._(2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'STATUS_VALIDATION_ERROR'); + static const Status STATUS_PREPARING = Status._(3, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'STATUS_PREPARING'); + static const Status STATUS_PREPARATION_ERROR = Status._(4, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'STATUS_PREPARATION_ERROR'); + static const Status STATUS_COMPILING = Status._(5, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'STATUS_COMPILING'); + static const Status STATUS_COMPILE_ERROR = Status._(6, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'STATUS_COMPILE_ERROR'); + static const Status STATUS_EXECUTING = Status._(7, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'STATUS_EXECUTING'); + static const Status STATUS_FINISHED = Status._(8, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'STATUS_FINISHED'); + static const Status STATUS_RUN_ERROR = Status._(9, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'STATUS_RUN_ERROR'); + static const Status STATUS_ERROR = Status._(10, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'STATUS_ERROR'); + static const Status STATUS_RUN_TIMEOUT = Status._(11, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'STATUS_RUN_TIMEOUT'); + static const Status STATUS_CANCELED = Status._(12, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'STATUS_CANCELED'); - static const $core.List values = [ + static const $core.List values = [ STATUS_UNSPECIFIED, + STATUS_VALIDATING, + STATUS_VALIDATION_ERROR, + STATUS_PREPARING, + STATUS_PREPARATION_ERROR, + STATUS_COMPILING, + STATUS_COMPILE_ERROR, STATUS_EXECUTING, STATUS_FINISHED, + STATUS_RUN_ERROR, STATUS_ERROR, - STATUS_COMPILE_ERROR, STATUS_RUN_TIMEOUT, + STATUS_CANCELED, ]; static final $core.Map<$core.int, Status> _byValue = $pb.ProtobufEnum.initByValue(values); @@ -95,3 +67,20 @@ class Status extends $pb.ProtobufEnum { const Status._($core.int v, $core.String n) : super(v, n); } +class PrecompiledObjectType extends $pb.ProtobufEnum { + static const PrecompiledObjectType EXAMPLE = PrecompiledObjectType._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'EXAMPLE'); + static const PrecompiledObjectType KATA = PrecompiledObjectType._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'KATA'); + static const PrecompiledObjectType UNIT_TEST = PrecompiledObjectType._(2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'UNIT_TEST'); + + static const $core.List values = [ + EXAMPLE, + KATA, + UNIT_TEST, + ]; + + static final $core.Map<$core.int, PrecompiledObjectType> _byValue = $pb.ProtobufEnum.initByValue(values); + static PrecompiledObjectType? valueOf($core.int value) => _byValue[value]; + + const PrecompiledObjectType._($core.int v, $core.String n) : super(v, n); +} + diff --git a/playground/frontend/lib/api/v1/api.pbgrpc.dart b/playground/frontend/lib/api/v1/api.pbgrpc.dart index 1401382b638d..30d31c1184f7 100644 --- a/playground/frontend/lib/api/v1/api.pbgrpc.dart +++ b/playground/frontend/lib/api/v1/api.pbgrpc.dart @@ -1,28 +1,16 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ /// +// Generated code. Do not modify. +// source: api/v1/api.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:async' as $async; + import 'dart:core' as $core; import 'package:grpc/service_api.dart' as $grpc; - import 'api.pb.dart' as $0; - export 'api.pb.dart'; class PlaygroundServiceClient extends $grpc.Client { @@ -44,30 +32,41 @@ class PlaygroundServiceClient extends $grpc.Client { ($0.GetRunOutputRequest value) => value.writeToBuffer(), ($core.List<$core.int> value) => $0.GetRunOutputResponse.fromBuffer(value)); + static final _$getRunError = + $grpc.ClientMethod<$0.GetRunErrorRequest, $0.GetRunErrorResponse>( + '/api.v1.PlaygroundService/GetRunError', + ($0.GetRunErrorRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => + $0.GetRunErrorResponse.fromBuffer(value)); static final _$getCompileOutput = $grpc.ClientMethod< $0.GetCompileOutputRequest, $0.GetCompileOutputResponse>( '/api.v1.PlaygroundService/GetCompileOutput', ($0.GetCompileOutputRequest value) => value.writeToBuffer(), ($core.List<$core.int> value) => $0.GetCompileOutputResponse.fromBuffer(value)); - static final _$getListOfExamples = $grpc.ClientMethod< - $0.GetListOfExamplesRequest, $0.GetListOfExamplesResponse>( - '/api.v1.PlaygroundService/GetListOfExamples', - ($0.GetListOfExamplesRequest value) => value.writeToBuffer(), + static final _$cancel = + $grpc.ClientMethod<$0.CancelRequest, $0.CancelResponse>( + '/api.v1.PlaygroundService/Cancel', + ($0.CancelRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => $0.CancelResponse.fromBuffer(value)); + static final _$getPrecompiledObjects = $grpc.ClientMethod< + $0.GetPrecompiledObjectsRequest, $0.GetPrecompiledObjectsResponse>( + '/api.v1.PlaygroundService/GetPrecompiledObjects', + ($0.GetPrecompiledObjectsRequest value) => value.writeToBuffer(), ($core.List<$core.int> value) => - $0.GetListOfExamplesResponse.fromBuffer(value)); - static final _$getExample = - $grpc.ClientMethod<$0.GetExampleRequest, $0.GetExampleResponse>( - '/api.v1.PlaygroundService/GetExample', - ($0.GetExampleRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => - $0.GetExampleResponse.fromBuffer(value)); - static final _$getExampleOutput = - $grpc.ClientMethod<$0.GetExampleRequest, $0.GetRunOutputResponse>( - '/api.v1.PlaygroundService/GetExampleOutput', - ($0.GetExampleRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => - $0.GetRunOutputResponse.fromBuffer(value)); + $0.GetPrecompiledObjectsResponse.fromBuffer(value)); + static final _$getPrecompiledObjectCode = $grpc.ClientMethod< + $0.GetPrecompiledObjectRequest, $0.GetPrecompiledObjectCodeResponse>( + '/api.v1.PlaygroundService/GetPrecompiledObjectCode', + ($0.GetPrecompiledObjectRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => + $0.GetPrecompiledObjectCodeResponse.fromBuffer(value)); + static final _$getPrecompiledObjectOutput = $grpc.ClientMethod< + $0.GetPrecompiledObjectRequest, $0.GetRunOutputResponse>( + '/api.v1.PlaygroundService/GetPrecompiledObjectOutput', + ($0.GetPrecompiledObjectRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => + $0.GetRunOutputResponse.fromBuffer(value)); PlaygroundServiceClient($grpc.ClientChannel channel, {$grpc.CallOptions? options, @@ -91,28 +90,41 @@ class PlaygroundServiceClient extends $grpc.Client { return $createUnaryCall(_$getRunOutput, request, options: options); } + $grpc.ResponseFuture<$0.GetRunErrorResponse> getRunError( + $0.GetRunErrorRequest request, + {$grpc.CallOptions? options}) { + return $createUnaryCall(_$getRunError, request, options: options); + } + $grpc.ResponseFuture<$0.GetCompileOutputResponse> getCompileOutput( $0.GetCompileOutputRequest request, {$grpc.CallOptions? options}) { return $createUnaryCall(_$getCompileOutput, request, options: options); } - $grpc.ResponseFuture<$0.GetListOfExamplesResponse> getListOfExamples( - $0.GetListOfExamplesRequest request, + $grpc.ResponseFuture<$0.CancelResponse> cancel($0.CancelRequest request, {$grpc.CallOptions? options}) { - return $createUnaryCall(_$getListOfExamples, request, options: options); + return $createUnaryCall(_$cancel, request, options: options); } - $grpc.ResponseFuture<$0.GetExampleResponse> getExample( - $0.GetExampleRequest request, + $grpc.ResponseFuture<$0.GetPrecompiledObjectsResponse> getPrecompiledObjects( + $0.GetPrecompiledObjectsRequest request, {$grpc.CallOptions? options}) { - return $createUnaryCall(_$getExample, request, options: options); + return $createUnaryCall(_$getPrecompiledObjects, request, options: options); + } + + $grpc.ResponseFuture<$0.GetPrecompiledObjectCodeResponse> + getPrecompiledObjectCode($0.GetPrecompiledObjectRequest request, + {$grpc.CallOptions? options}) { + return $createUnaryCall(_$getPrecompiledObjectCode, request, + options: options); } - $grpc.ResponseFuture<$0.GetRunOutputResponse> getExampleOutput( - $0.GetExampleRequest request, + $grpc.ResponseFuture<$0.GetRunOutputResponse> getPrecompiledObjectOutput( + $0.GetPrecompiledObjectRequest request, {$grpc.CallOptions? options}) { - return $createUnaryCall(_$getExampleOutput, request, options: options); + return $createUnaryCall(_$getPrecompiledObjectOutput, request, + options: options); } } @@ -145,6 +157,15 @@ abstract class PlaygroundServiceBase extends $grpc.Service { ($core.List<$core.int> value) => $0.GetRunOutputRequest.fromBuffer(value), ($0.GetRunOutputResponse value) => value.writeToBuffer())); + $addMethod( + $grpc.ServiceMethod<$0.GetRunErrorRequest, $0.GetRunErrorResponse>( + 'GetRunError', + getRunError_Pre, + false, + false, + ($core.List<$core.int> value) => + $0.GetRunErrorRequest.fromBuffer(value), + ($0.GetRunErrorResponse value) => value.writeToBuffer())); $addMethod($grpc.ServiceMethod<$0.GetCompileOutputRequest, $0.GetCompileOutputResponse>( 'GetCompileOutput', @@ -154,31 +175,40 @@ abstract class PlaygroundServiceBase extends $grpc.Service { ($core.List<$core.int> value) => $0.GetCompileOutputRequest.fromBuffer(value), ($0.GetCompileOutputResponse value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.GetListOfExamplesRequest, - $0.GetListOfExamplesResponse>( - 'GetListOfExamples', - getListOfExamples_Pre, + $addMethod($grpc.ServiceMethod<$0.CancelRequest, $0.CancelResponse>( + 'Cancel', + cancel_Pre, + false, + false, + ($core.List<$core.int> value) => $0.CancelRequest.fromBuffer(value), + ($0.CancelResponse value) => value.writeToBuffer())); + $addMethod($grpc.ServiceMethod<$0.GetPrecompiledObjectsRequest, + $0.GetPrecompiledObjectsResponse>( + 'GetPrecompiledObjects', + getPrecompiledObjects_Pre, false, false, ($core.List<$core.int> value) => - $0.GetListOfExamplesRequest.fromBuffer(value), - ($0.GetListOfExamplesResponse value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.GetExampleRequest, $0.GetExampleResponse>( - 'GetExample', - getExample_Pre, + $0.GetPrecompiledObjectsRequest.fromBuffer(value), + ($0.GetPrecompiledObjectsResponse value) => value.writeToBuffer())); + $addMethod($grpc.ServiceMethod<$0.GetPrecompiledObjectRequest, + $0.GetPrecompiledObjectCodeResponse>( + 'GetPrecompiledObjectCode', + getPrecompiledObjectCode_Pre, false, false, - ($core.List<$core.int> value) => $0.GetExampleRequest.fromBuffer(value), - ($0.GetExampleResponse value) => value.writeToBuffer())); - $addMethod( - $grpc.ServiceMethod<$0.GetExampleRequest, $0.GetRunOutputResponse>( - 'GetExampleOutput', - getExampleOutput_Pre, - false, - false, - ($core.List<$core.int> value) => - $0.GetExampleRequest.fromBuffer(value), - ($0.GetRunOutputResponse value) => value.writeToBuffer())); + ($core.List<$core.int> value) => + $0.GetPrecompiledObjectRequest.fromBuffer(value), + ($0.GetPrecompiledObjectCodeResponse value) => value.writeToBuffer())); + $addMethod($grpc.ServiceMethod<$0.GetPrecompiledObjectRequest, + $0.GetRunOutputResponse>( + 'GetPrecompiledObjectOutput', + getPrecompiledObjectOutput_Pre, + false, + false, + ($core.List<$core.int> value) => + $0.GetPrecompiledObjectRequest.fromBuffer(value), + ($0.GetRunOutputResponse value) => value.writeToBuffer())); } $async.Future<$0.RunCodeResponse> runCode_Pre( @@ -197,47 +227,56 @@ abstract class PlaygroundServiceBase extends $grpc.Service { return getRunOutput(call, await request); } + $async.Future<$0.GetRunErrorResponse> getRunError_Pre($grpc.ServiceCall call, + $async.Future<$0.GetRunErrorRequest> request) async { + return getRunError(call, await request); + } + $async.Future<$0.GetCompileOutputResponse> getCompileOutput_Pre( $grpc.ServiceCall call, $async.Future<$0.GetCompileOutputRequest> request) async { return getCompileOutput(call, await request); } - $async.Future<$0.GetListOfExamplesResponse> getListOfExamples_Pre( + $async.Future<$0.CancelResponse> cancel_Pre( + $grpc.ServiceCall call, $async.Future<$0.CancelRequest> request) async { + return cancel(call, await request); + } + + $async.Future<$0.GetPrecompiledObjectsResponse> getPrecompiledObjects_Pre( $grpc.ServiceCall call, - $async.Future<$0.GetListOfExamplesRequest> request) async { - return getListOfExamples(call, await request); + $async.Future<$0.GetPrecompiledObjectsRequest> request) async { + return getPrecompiledObjects(call, await request); } - $async.Future<$0.GetExampleResponse> getExample_Pre($grpc.ServiceCall call, - $async.Future<$0.GetExampleRequest> request) async { - return getExample(call, await request); + $async.Future<$0.GetPrecompiledObjectCodeResponse> + getPrecompiledObjectCode_Pre($grpc.ServiceCall call, + $async.Future<$0.GetPrecompiledObjectRequest> request) async { + return getPrecompiledObjectCode(call, await request); } - $async.Future<$0.GetRunOutputResponse> getExampleOutput_Pre( + $async.Future<$0.GetRunOutputResponse> getPrecompiledObjectOutput_Pre( $grpc.ServiceCall call, - $async.Future<$0.GetExampleRequest> request) async { - return getExampleOutput(call, await request); + $async.Future<$0.GetPrecompiledObjectRequest> request) async { + return getPrecompiledObjectOutput(call, await request); } $async.Future<$0.RunCodeResponse> runCode( $grpc.ServiceCall call, $0.RunCodeRequest request); - $async.Future<$0.CheckStatusResponse> checkStatus( $grpc.ServiceCall call, $0.CheckStatusRequest request); - $async.Future<$0.GetRunOutputResponse> getRunOutput( $grpc.ServiceCall call, $0.GetRunOutputRequest request); - + $async.Future<$0.GetRunErrorResponse> getRunError( + $grpc.ServiceCall call, $0.GetRunErrorRequest request); $async.Future<$0.GetCompileOutputResponse> getCompileOutput( $grpc.ServiceCall call, $0.GetCompileOutputRequest request); - - $async.Future<$0.GetListOfExamplesResponse> getListOfExamples( - $grpc.ServiceCall call, $0.GetListOfExamplesRequest request); - - $async.Future<$0.GetExampleResponse> getExample( - $grpc.ServiceCall call, $0.GetExampleRequest request); - - $async.Future<$0.GetRunOutputResponse> getExampleOutput( - $grpc.ServiceCall call, $0.GetExampleRequest request); + $async.Future<$0.CancelResponse> cancel( + $grpc.ServiceCall call, $0.CancelRequest request); + $async.Future<$0.GetPrecompiledObjectsResponse> getPrecompiledObjects( + $grpc.ServiceCall call, $0.GetPrecompiledObjectsRequest request); + $async.Future<$0.GetPrecompiledObjectCodeResponse> getPrecompiledObjectCode( + $grpc.ServiceCall call, $0.GetPrecompiledObjectRequest request); + $async.Future<$0.GetRunOutputResponse> getPrecompiledObjectOutput( + $grpc.ServiceCall call, $0.GetPrecompiledObjectRequest request); } diff --git a/playground/frontend/lib/api/v1/api.pbjson.dart b/playground/frontend/lib/api/v1/api.pbjson.dart index e087d8b7fc3c..6308a554c4f4 100644 --- a/playground/frontend/lib/api/v1/api.pbjson.dart +++ b/playground/frontend/lib/api/v1/api.pbjson.dart @@ -1,20 +1,3 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ /// // Generated code. Do not modify. // source: api/v1/api.proto @@ -44,28 +27,41 @@ const Status$json = const { '1': 'Status', '2': const [ const {'1': 'STATUS_UNSPECIFIED', '2': 0}, - const {'1': 'STATUS_EXECUTING', '2': 1}, - const {'1': 'STATUS_FINISHED', '2': 2}, - const {'1': 'STATUS_ERROR', '2': 3}, + const {'1': 'STATUS_VALIDATING', '2': 1}, + const {'1': 'STATUS_VALIDATION_ERROR', '2': 2}, + const {'1': 'STATUS_PREPARING', '2': 3}, + const {'1': 'STATUS_PREPARATION_ERROR', '2': 4}, + const {'1': 'STATUS_COMPILING', '2': 5}, + const {'1': 'STATUS_COMPILE_ERROR', '2': 6}, + const {'1': 'STATUS_EXECUTING', '2': 7}, + const {'1': 'STATUS_FINISHED', '2': 8}, + const {'1': 'STATUS_RUN_ERROR', '2': 9}, + const {'1': 'STATUS_ERROR', '2': 10}, + const {'1': 'STATUS_RUN_TIMEOUT', '2': 11}, + const {'1': 'STATUS_CANCELED', '2': 12}, ], }; /// Descriptor for `Status`. Decode as a `google.protobuf.EnumDescriptorProto`. -final $typed_data.Uint8List statusDescriptor = $convert.base64Decode( - 'CgZTdGF0dXMSFgoSU1RBVFVTX1VOU1BFQ0lGSUVEEAASFAoQU1RBVFVTX0VYRUNVVElORxABEhMKD1NUQVRVU19GSU5JU0hFRBACEhAKDFNUQVRVU19FUlJPUhADEhgKFFNUQVRVU19DT01QSUxFX0VSUk9SEAQSFgoSU1RBVFVTX1JVTl9USU1FT1VUEAU='); +final $typed_data.Uint8List statusDescriptor = $convert.base64Decode('CgZTdGF0dXMSFgoSU1RBVFVTX1VOU1BFQ0lGSUVEEAASFQoRU1RBVFVTX1ZBTElEQVRJTkcQARIbChdTVEFUVVNfVkFMSURBVElPTl9FUlJPUhACEhQKEFNUQVRVU19QUkVQQVJJTkcQAxIcChhTVEFUVVNfUFJFUEFSQVRJT05fRVJST1IQBBIUChBTVEFUVVNfQ09NUElMSU5HEAUSGAoUU1RBVFVTX0NPTVBJTEVfRVJST1IQBhIUChBTVEFUVVNfRVhFQ1VUSU5HEAcSEwoPU1RBVFVTX0ZJTklTSEVEEAgSFAoQU1RBVFVTX1JVTl9FUlJPUhAJEhAKDFNUQVRVU19FUlJPUhAKEhYKElNUQVRVU19SVU5fVElNRU9VVBALEhMKD1NUQVRVU19DQU5DRUxFRBAM'); +@$core.Deprecated('Use precompiledObjectTypeDescriptor instead') +const PrecompiledObjectType$json = const { + '1': 'PrecompiledObjectType', + '2': const [ + const {'1': 'EXAMPLE', '2': 0}, + const {'1': 'KATA', '2': 1}, + const {'1': 'UNIT_TEST', '2': 2}, + ], +}; + +/// Descriptor for `PrecompiledObjectType`. Decode as a `google.protobuf.EnumDescriptorProto`. +final $typed_data.Uint8List precompiledObjectTypeDescriptor = $convert.base64Decode('ChVQcmVjb21waWxlZE9iamVjdFR5cGUSCwoHRVhBTVBMRRAAEggKBEtBVEEQARINCglVTklUX1RFU1QQAg=='); @$core.Deprecated('Use runCodeRequestDescriptor instead') const RunCodeRequest$json = const { '1': 'RunCodeRequest', '2': const [ const {'1': 'code', '3': 1, '4': 1, '5': 9, '10': 'code'}, - const { - '1': 'sdk', - '3': 2, - '4': 1, - '5': 14, - '6': '.api.v1.Sdk', - '10': 'sdk' - }, + const {'1': 'sdk', '3': 2, '4': 1, '5': 14, '6': '.api.v1.Sdk', '10': 'sdk'}, ], }; @@ -137,143 +133,120 @@ const GetRunOutputResponse$json = const { '1': 'GetRunOutputResponse', '2': const [ const {'1': 'output', '3': 1, '4': 1, '5': 9, '10': 'output'}, - const { - '1': 'compilation_status', - '3': 2, - '4': 1, - '5': 14, - '6': '.api.v1.Status', - '10': 'compilationStatus' - }, ], }; /// Descriptor for `GetRunOutputResponse`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List getRunOutputResponseDescriptor = $convert.base64Decode( - 'ChRHZXRSdW5PdXRwdXRSZXNwb25zZRIWCgZvdXRwdXQYASABKAlSBm91dHB1dBI9ChJjb21waWxhdGlvbl9zdGF0dXMYAiABKA4yDi5hcGkudjEuU3RhdHVzUhFjb21waWxhdGlvblN0YXR1cw=='); -@$core.Deprecated('Use getListOfExamplesRequestDescriptor instead') -const GetListOfExamplesRequest$json = const { - '1': 'GetListOfExamplesRequest', +final $typed_data.Uint8List getRunOutputResponseDescriptor = $convert.base64Decode('ChRHZXRSdW5PdXRwdXRSZXNwb25zZRIWCgZvdXRwdXQYASABKAlSBm91dHB1dA=='); +@$core.Deprecated('Use getRunErrorRequestDescriptor instead') +const GetRunErrorRequest$json = const { + '1': 'GetRunErrorRequest', '2': const [ - const { - '1': 'sdk', - '3': 1, - '4': 1, - '5': 14, - '6': '.api.v1.Sdk', - '10': 'sdk' - }, - const {'1': 'category', '3': 2, '4': 1, '5': 9, '10': 'category'}, + const {'1': 'pipeline_uuid', '3': 1, '4': 1, '5': 9, '10': 'pipelineUuid'}, ], }; -/// Descriptor for `GetListOfExamplesRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List getListOfExamplesRequestDescriptor = - $convert.base64Decode( - 'ChhHZXRMaXN0T2ZFeGFtcGxlc1JlcXVlc3QSHQoDc2RrGAEgASgOMgsuYXBpLnYxLlNka1IDc2RrEhoKCGNhdGVnb3J5GAIgASgJUghjYXRlZ29yeQ=='); -@$core.Deprecated('Use examplesDescriptor instead') -const Examples$json = const { - '1': 'Examples', +/// Descriptor for `GetRunErrorRequest`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List getRunErrorRequestDescriptor = $convert.base64Decode('ChJHZXRSdW5FcnJvclJlcXVlc3QSIwoNcGlwZWxpbmVfdXVpZBgBIAEoCVIMcGlwZWxpbmVVdWlk'); +@$core.Deprecated('Use getRunErrorResponseDescriptor instead') +const GetRunErrorResponse$json = const { + '1': 'GetRunErrorResponse', '2': const [ - const {'1': 'example', '3': 1, '4': 3, '5': 9, '10': 'example'}, + const {'1': 'output', '3': 1, '4': 1, '5': 9, '10': 'output'}, + ], +}; + +/// Descriptor for `GetRunErrorResponse`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List getRunErrorResponseDescriptor = $convert.base64Decode('ChNHZXRSdW5FcnJvclJlc3BvbnNlEhYKBm91dHB1dBgBIAEoCVIGb3V0cHV0'); +@$core.Deprecated('Use cancelRequestDescriptor instead') +const CancelRequest$json = const { + '1': 'CancelRequest', + '2': const [ + const {'1': 'pipeline_uuid', '3': 1, '4': 1, '5': 9, '10': 'pipelineUuid'}, + ], +}; + +/// Descriptor for `CancelRequest`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List cancelRequestDescriptor = $convert.base64Decode('Cg1DYW5jZWxSZXF1ZXN0EiMKDXBpcGVsaW5lX3V1aWQYASABKAlSDHBpcGVsaW5lVXVpZA=='); +@$core.Deprecated('Use cancelResponseDescriptor instead') +const CancelResponse$json = const { + '1': 'CancelResponse', +}; + +/// Descriptor for `CancelResponse`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List cancelResponseDescriptor = $convert.base64Decode('Cg5DYW5jZWxSZXNwb25zZQ=='); +@$core.Deprecated('Use getPrecompiledObjectsRequestDescriptor instead') +const GetPrecompiledObjectsRequest$json = const { + '1': 'GetPrecompiledObjectsRequest', + '2': const [ + const {'1': 'sdk', '3': 1, '4': 1, '5': 14, '6': '.api.v1.Sdk', '10': 'sdk'}, + const {'1': 'category', '3': 2, '4': 1, '5': 9, '10': 'category'}, ], }; -/// Descriptor for `Examples`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List examplesDescriptor = - $convert.base64Decode('CghFeGFtcGxlcxIYCgdleGFtcGxlGAEgAygJUgdleGFtcGxl'); -@$core.Deprecated('Use categoryListDescriptor instead') -const CategoryList$json = const { - '1': 'CategoryList', +/// Descriptor for `GetPrecompiledObjectsRequest`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List getPrecompiledObjectsRequestDescriptor = $convert.base64Decode('ChxHZXRQcmVjb21waWxlZE9iamVjdHNSZXF1ZXN0Eh0KA3NkaxgBIAEoDjILLmFwaS52MS5TZGtSA3NkaxIaCghjYXRlZ29yeRgCIAEoCVIIY2F0ZWdvcnk='); +@$core.Deprecated('Use precompiledObjectDescriptor instead') +const PrecompiledObject$json = const { + '1': 'PrecompiledObject', '2': const [ - const { - '1': 'category_examples', - '3': 1, - '4': 3, - '5': 11, - '6': '.api.v1.CategoryList.CategoryExamplesEntry', - '10': 'categoryExamples' - }, + const {'1': 'cloud_path', '3': 1, '4': 1, '5': 9, '10': 'cloudPath'}, + const {'1': 'name', '3': 2, '4': 1, '5': 9, '10': 'name'}, + const {'1': 'description', '3': 3, '4': 1, '5': 9, '10': 'description'}, + const {'1': 'type', '3': 4, '4': 1, '5': 14, '6': '.api.v1.PrecompiledObjectType', '10': 'type'}, ], - '3': const [CategoryList_CategoryExamplesEntry$json], }; -@$core.Deprecated('Use categoryListDescriptor instead') -const CategoryList_CategoryExamplesEntry$json = const { - '1': 'CategoryExamplesEntry', +/// Descriptor for `PrecompiledObject`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List precompiledObjectDescriptor = $convert.base64Decode('ChFQcmVjb21waWxlZE9iamVjdBIdCgpjbG91ZF9wYXRoGAEgASgJUgljbG91ZFBhdGgSEgoEbmFtZRgCIAEoCVIEbmFtZRIgCgtkZXNjcmlwdGlvbhgDIAEoCVILZGVzY3JpcHRpb24SMQoEdHlwZRgEIAEoDjIdLmFwaS52MS5QcmVjb21waWxlZE9iamVjdFR5cGVSBHR5cGU='); +@$core.Deprecated('Use categoriesDescriptor instead') +const Categories$json = const { + '1': 'Categories', '2': const [ - const {'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'}, - const { - '1': 'value', - '3': 2, - '4': 1, - '5': 11, - '6': '.api.v1.Examples', - '10': 'value' - }, + const {'1': 'sdk', '3': 1, '4': 1, '5': 14, '6': '.api.v1.Sdk', '10': 'sdk'}, + const {'1': 'categories', '3': 2, '4': 3, '5': 11, '6': '.api.v1.Categories.Category', '10': 'categories'}, ], - '7': const {'7': true}, + '3': const [Categories_Category$json], }; -/// Descriptor for `CategoryList`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List categoryListDescriptor = $convert.base64Decode( - 'CgxDYXRlZ29yeUxpc3QSVwoRY2F0ZWdvcnlfZXhhbXBsZXMYASADKAsyKi5hcGkudjEuQ2F0ZWdvcnlMaXN0LkNhdGVnb3J5RXhhbXBsZXNFbnRyeVIQY2F0ZWdvcnlFeGFtcGxlcxpVChVDYXRlZ29yeUV4YW1wbGVzRW50cnkSEAoDa2V5GAEgASgJUgNrZXkSJgoFdmFsdWUYAiABKAsyEC5hcGkudjEuRXhhbXBsZXNSBXZhbHVlOgI4AQ=='); -@$core.Deprecated('Use getListOfExamplesResponseDescriptor instead') -const GetListOfExamplesResponse$json = const { - '1': 'GetListOfExamplesResponse', +@$core.Deprecated('Use categoriesDescriptor instead') +const Categories_Category$json = const { + '1': 'Category', '2': const [ - const { - '1': 'sdk_categories', - '3': 1, - '4': 3, - '5': 11, - '6': '.api.v1.GetListOfExamplesResponse.SdkCategoriesEntry', - '10': 'sdkCategories' - }, + const {'1': 'category_name', '3': 1, '4': 1, '5': 9, '10': 'categoryName'}, + const {'1': 'precompiled_objects', '3': 2, '4': 3, '5': 11, '6': '.api.v1.PrecompiledObject', '10': 'precompiledObjects'}, ], - '3': const [GetListOfExamplesResponse_SdkCategoriesEntry$json], }; -@$core.Deprecated('Use getListOfExamplesResponseDescriptor instead') -const GetListOfExamplesResponse_SdkCategoriesEntry$json = const { - '1': 'SdkCategoriesEntry', +/// Descriptor for `Categories`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List categoriesDescriptor = $convert.base64Decode('CgpDYXRlZ29yaWVzEh0KA3NkaxgBIAEoDjILLmFwaS52MS5TZGtSA3NkaxI7CgpjYXRlZ29yaWVzGAIgAygLMhsuYXBpLnYxLkNhdGVnb3JpZXMuQ2F0ZWdvcnlSCmNhdGVnb3JpZXMaewoIQ2F0ZWdvcnkSIwoNY2F0ZWdvcnlfbmFtZRgBIAEoCVIMY2F0ZWdvcnlOYW1lEkoKE3ByZWNvbXBpbGVkX29iamVjdHMYAiADKAsyGS5hcGkudjEuUHJlY29tcGlsZWRPYmplY3RSEnByZWNvbXBpbGVkT2JqZWN0cw=='); +@$core.Deprecated('Use getPrecompiledObjectsResponseDescriptor instead') +const GetPrecompiledObjectsResponse$json = const { + '1': 'GetPrecompiledObjectsResponse', '2': const [ - const {'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'}, - const { - '1': 'value', - '3': 2, - '4': 1, - '5': 11, - '6': '.api.v1.CategoryList', - '10': 'value' - }, + const {'1': 'sdk_categories', '3': 1, '4': 3, '5': 11, '6': '.api.v1.Categories', '10': 'sdkCategories'}, ], - '7': const {'7': true}, }; -/// Descriptor for `GetListOfExamplesResponse`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List getListOfExamplesResponseDescriptor = - $convert.base64Decode( - 'ChlHZXRMaXN0T2ZFeGFtcGxlc1Jlc3BvbnNlElsKDnNka19jYXRlZ29yaWVzGAEgAygLMjQuYXBpLnYxLkdldExpc3RPZkV4YW1wbGVzUmVzcG9uc2UuU2RrQ2F0ZWdvcmllc0VudHJ5Ug1zZGtDYXRlZ29yaWVzGlYKElNka0NhdGVnb3JpZXNFbnRyeRIQCgNrZXkYASABKAlSA2tleRIqCgV2YWx1ZRgCIAEoCzIULmFwaS52MS5DYXRlZ29yeUxpc3RSBXZhbHVlOgI4AQ=='); -@$core.Deprecated('Use getExampleRequestDescriptor instead') -const GetExampleRequest$json = const { - '1': 'GetExampleRequest', +/// Descriptor for `GetPrecompiledObjectsResponse`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List getPrecompiledObjectsResponseDescriptor = $convert.base64Decode('Ch1HZXRQcmVjb21waWxlZE9iamVjdHNSZXNwb25zZRI5Cg5zZGtfY2F0ZWdvcmllcxgBIAMoCzISLmFwaS52MS5DYXRlZ29yaWVzUg1zZGtDYXRlZ29yaWVz'); +@$core.Deprecated('Use getPrecompiledObjectRequestDescriptor instead') +const GetPrecompiledObjectRequest$json = const { + '1': 'GetPrecompiledObjectRequest', '2': const [ - const {'1': 'example_uuid', '3': 1, '4': 1, '5': 9, '10': 'exampleUuid'}, + const {'1': 'cloud_path', '3': 1, '4': 1, '5': 9, '10': 'cloudPath'}, ], }; -/// Descriptor for `GetExampleRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List getExampleRequestDescriptor = $convert.base64Decode( - 'ChFHZXRFeGFtcGxlUmVxdWVzdBIhCgxleGFtcGxlX3V1aWQYASABKAlSC2V4YW1wbGVVdWlk'); -@$core.Deprecated('Use getExampleResponseDescriptor instead') -const GetExampleResponse$json = const { - '1': 'GetExampleResponse', +/// Descriptor for `GetPrecompiledObjectRequest`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List getPrecompiledObjectRequestDescriptor = $convert.base64Decode('ChtHZXRQcmVjb21waWxlZE9iamVjdFJlcXVlc3QSHQoKY2xvdWRfcGF0aBgBIAEoCVIJY2xvdWRQYXRo'); +@$core.Deprecated('Use getPrecompiledObjectCodeResponseDescriptor instead') +const GetPrecompiledObjectCodeResponse$json = const { + '1': 'GetPrecompiledObjectCodeResponse', '2': const [ const {'1': 'code', '3': 1, '4': 1, '5': 9, '10': 'code'}, ], }; -/// Descriptor for `GetExampleResponse`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List getExampleResponseDescriptor = $convert - .base64Decode('ChJHZXRFeGFtcGxlUmVzcG9uc2USEgoEY29kZRgBIAEoCVIEY29kZQ=='); +/// Descriptor for `GetPrecompiledObjectCodeResponse`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List getPrecompiledObjectCodeResponseDescriptor = $convert.base64Decode('CiBHZXRQcmVjb21waWxlZE9iamVjdENvZGVSZXNwb25zZRISCgRjb2RlGAEgASgJUgRjb2Rl'); diff --git a/playground/frontend/lib/modules/examples/components/example_list/expansion_panel_item.dart b/playground/frontend/lib/modules/examples/components/example_list/expansion_panel_item.dart index cab096d88c58..eb09a5375685 100644 --- a/playground/frontend/lib/modules/examples/components/example_list/expansion_panel_item.dart +++ b/playground/frontend/lib/modules/examples/components/example_list/expansion_panel_item.dart @@ -36,12 +36,9 @@ class ExpansionPanelItem extends StatelessWidget { child: GestureDetector( onTap: () async { if (playgroundState.selectedExample != example) { - String source = await exampleState.getExampleSource(example.uuid); - example.setSource(source); - playgroundState.setExample(example); - exampleState.getExampleOutput(example.uuid).then((value) { - example.setOutputs(value); - }); + final exampleWithInfo = + await exampleState.loadExampleInfo(example); + playgroundState.setExample(exampleWithInfo); } }, child: Container( diff --git a/playground/frontend/lib/modules/examples/models/example_model.dart b/playground/frontend/lib/modules/examples/models/example_model.dart index aa7e916d7a46..e39124b566d5 100644 --- a/playground/frontend/lib/modules/examples/models/example_model.dart +++ b/playground/frontend/lib/modules/examples/models/example_model.dart @@ -41,14 +41,14 @@ extension ExampleTypeToString on ExampleType { class ExampleModel { final ExampleType type; final String name; - final String uuid; + final String path; final String description; String? source; String? outputs; ExampleModel({ required this.name, - required this.uuid, + required this.path, required this.description, required this.type, this.source, diff --git a/playground/frontend/lib/modules/examples/repositories/example_client/grpc_example_client.dart b/playground/frontend/lib/modules/examples/repositories/example_client/grpc_example_client.dart index 27682c59aac2..3dbfbf7c4784 100644 --- a/playground/frontend/lib/modules/examples/repositories/example_client/grpc_example_client.dart +++ b/playground/frontend/lib/modules/examples/repositories/example_client/grpc_example_client.dart @@ -21,6 +21,7 @@ import 'package:playground/api/v1/api.pbgrpc.dart' as grpc; import 'package:playground/constants/api.dart'; import 'package:playground/modules/editor/repository/code_repository/code_client/output_response.dart'; import 'package:playground/modules/examples/models/category_model.dart'; +import 'package:playground/modules/examples/models/example_model.dart'; import 'package:playground/modules/examples/repositories/example_client/example_client.dart'; import 'package:playground/modules/examples/repositories/models/get_example_request.dart'; import 'package:playground/modules/examples/repositories/models/get_example_response.dart'; @@ -45,7 +46,8 @@ class GrpcExampleClient implements ExampleClient { ) { return _runSafely( () => _client - .getListOfExamples(_getListOfExamplesRequestToGrpcRequest(request)) + .getPrecompiledObjects( + _getListOfExamplesRequestToGrpcRequest(request)) .then((response) => GetListOfExampleResponse( _toClientCategories(response.sdkCategories))), ); @@ -55,7 +57,7 @@ class GrpcExampleClient implements ExampleClient { Future getExample(GetExampleRequestWrapper request) { return _runSafely( () => _client - .getExample(_getExampleRequestToGrpcRequest(request)) + .getPrecompiledObjectCode(_getExampleRequestToGrpcRequest(request)) .then((response) => GetExampleResponse(response.code)), ); } @@ -64,7 +66,7 @@ class GrpcExampleClient implements ExampleClient { Future getExampleOutput(GetExampleRequestWrapper request) { return _runSafely( () => _client - .getExampleOutput(_getExampleRequestToGrpcRequest(request)) + .getPrecompiledObjectOutput(_getExampleRequestToGrpcRequest(request)) .then((response) => OutputResponse(response.output)), ); } @@ -77,20 +79,20 @@ class GrpcExampleClient implements ExampleClient { } } - grpc.GetListOfExamplesRequest _getListOfExamplesRequestToGrpcRequest( + grpc.GetPrecompiledObjectsRequest _getListOfExamplesRequestToGrpcRequest( GetListOfExamplesRequestWrapper request, ) { - return grpc.GetListOfExamplesRequest() + return grpc.GetPrecompiledObjectsRequest() ..category = request.category ?? '' ..sdk = request.sdk == null ? grpc.Sdk.SDK_UNSPECIFIED : _getGrpcSdk(request.sdk!); } - grpc.GetExampleRequest _getExampleRequestToGrpcRequest( + grpc.GetPrecompiledObjectRequest _getExampleRequestToGrpcRequest( GetExampleRequestWrapper request, ) { - return grpc.GetExampleRequest()..exampleUuid = request.uuid; + return grpc.GetPrecompiledObjectRequest()..cloudPath = request.path; } grpc.Sdk _getGrpcSdk(SDK sdk) { @@ -106,18 +108,62 @@ class GrpcExampleClient implements ExampleClient { } } + SDK _getAppSdk(grpc.Sdk sdk) { + switch (sdk) { + case grpc.Sdk.SDK_JAVA: + return SDK.java; + case grpc.Sdk.SDK_GO: + return SDK.go; + case grpc.Sdk.SDK_PYTHON: + return SDK.python; + case grpc.Sdk.SDK_SCIO: + return SDK.scio; + default: + return SDK.java; + } + } + + ExampleType _exampleTypeFromString(grpc.PrecompiledObjectType type) { + switch (type) { + case grpc.PrecompiledObjectType.EXAMPLE: + return ExampleType.example; + case grpc.PrecompiledObjectType.KATA: + return ExampleType.kata; + case grpc.PrecompiledObjectType.UNIT_TEST: + return ExampleType.test; + default: + return ExampleType.example; + } + } + Map> _toClientCategories( - Map response, + List response, ) { - Map> output = {}; - // for (SDK sdk in SDK.values) { - // final sdkName = sdk.displayName.toLowerCase(); - // if (response.containsKey(sdkName)) { - // response[sdkName]!.categoryExamples.forEach((key, value) { - // output[sdk]!.add(CategoryModel(name: key, examples: value.example)); - // }); - // } - // } - return output; + Map> sdkCategoriesMap = {}; + List>> entries = []; + for (var sdkMap in response) { + SDK sdk = _getAppSdk(sdkMap.sdk); + List categoriesForSdk = []; + for (var category in sdkMap.categories) { + List examples = category.precompiledObjects + .map((e) => ExampleModel( + name: e.name, + description: e.description, + type: _exampleTypeFromString(e.type), + path: e.cloudPath, + )) + .toList(); + categoriesForSdk.add(CategoryModel( + name: category.categoryName, + examples: examples, + )); + } + entries.add(MapEntry( + sdk, + categoriesForSdk, + )); + } + sdkCategoriesMap.addEntries(entries); + return sdkCategoriesMap; } } diff --git a/playground/frontend/lib/modules/examples/repositories/models/get_example_request.dart b/playground/frontend/lib/modules/examples/repositories/models/get_example_request.dart index bb749b55f255..a6ee699b3bed 100644 --- a/playground/frontend/lib/modules/examples/repositories/models/get_example_request.dart +++ b/playground/frontend/lib/modules/examples/repositories/models/get_example_request.dart @@ -1,5 +1,5 @@ class GetExampleRequestWrapper { - final String uuid; + final String path; - GetExampleRequestWrapper(this.uuid); + GetExampleRequestWrapper(this.path); } \ No newline at end of file diff --git a/playground/frontend/lib/pages/playground/components/playground_page_providers.dart b/playground/frontend/lib/pages/playground/components/playground_page_providers.dart index 5e671e30fe27..089dda32d95f 100644 --- a/playground/frontend/lib/pages/playground/components/playground_page_providers.dart +++ b/playground/frontend/lib/pages/playground/components/playground_page_providers.dart @@ -56,10 +56,10 @@ class PlaygroundPageProviders extends StatelessWidget { playground.selectedExample == null) { final defaultExample = exampleState .sdkCategories![playground.sdk]!.first.examples.first; - exampleState.getExampleSource(defaultExample.uuid).then((value) { + exampleState.getExampleSource(defaultExample.path).then((value) { defaultExample.setSource(value); }); - exampleState.getExampleOutput(defaultExample.uuid).then((value) { + exampleState.getExampleOutput(defaultExample.path).then((value) { defaultExample.setOutputs(value); }); return PlaygroundState( diff --git a/playground/frontend/lib/pages/playground/states/examples_state.dart b/playground/frontend/lib/pages/playground/states/examples_state.dart index 11b177d9f7e6..b1e44ce7f92d 100644 --- a/playground/frontend/lib/pages/playground/states/examples_state.dart +++ b/playground/frontend/lib/pages/playground/states/examples_state.dart @@ -18,6 +18,7 @@ import 'package:flutter/material.dart'; import 'package:playground/modules/examples/models/category_model.dart'; +import 'package:playground/modules/examples/models/example_model.dart'; import 'package:playground/modules/examples/repositories/example_repository.dart'; import 'package:playground/modules/examples/repositories/models/get_example_request.dart'; import 'package:playground/modules/examples/repositories/models/get_list_of_examples_request.dart'; @@ -26,6 +27,7 @@ import 'package:playground/modules/sdk/models/sdk.dart'; class ExampleState with ChangeNotifier { final ExampleRepository _exampleRepository; Map>? sdkCategories; + Map? defaultExamplesMap; bool isSelectorOpened = false; ExampleState(this._exampleRepository) { @@ -50,10 +52,19 @@ class ExampleState with ChangeNotifier { return source; } + Future loadExampleInfo(ExampleModel example) async { + String source = await getExampleSource(example.path); + example.setSource(source); + final outputs = await getExampleOutput(example.path); + example.setOutputs(outputs); + return example; + } + _loadCategories() async { sdkCategories = await _exampleRepository.getListOfExamples( GetListOfExamplesRequestWrapper(sdk: null, category: null), ); + _loadDefaultExamples(sdkCategories); notifyListeners(); } @@ -61,4 +72,23 @@ class ExampleState with ChangeNotifier { isSelectorOpened = !isSelectorOpened; notifyListeners(); } -} + + _loadDefaultExamples(sdkCategories) async { + defaultExamplesMap = {}; + List> entries = []; + for (SDK sdk in SDK.values) { + ExampleModel? defaultExample = sdkCategories![sdk]?.first.examples.first; + if (defaultExample != null) { + await getExampleSource(defaultExample.path).then((value) { + defaultExample.setSource(value); + }); + getExampleOutput(defaultExample.path).then((value) { + defaultExample.setOutputs(value); + }); + entries.add(MapEntry(sdk, defaultExample)); + } + } + defaultExamplesMap?.addEntries(entries); + notifyListeners(); + } +} \ No newline at end of file diff --git a/playground/frontend/test/pages/playground/states/example_selector_state_test.dart b/playground/frontend/test/pages/playground/states/example_selector_state_test.dart index 1b00ab6c153a..1f7be07a3d56 100644 --- a/playground/frontend/test/pages/playground/states/example_selector_state_test.dart +++ b/playground/frontend/test/pages/playground/states/example_selector_state_test.dart @@ -18,6 +18,8 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:playground/modules/examples/models/example_model.dart'; +import 'package:playground/modules/examples/repositories/example_client/example_client.dart'; +import 'package:playground/modules/examples/repositories/example_client/grpc_example_client.dart'; import 'package:playground/modules/examples/repositories/example_repository.dart'; import 'package:playground/pages/playground/states/example_selector_state.dart'; import 'package:playground/pages/playground/states/examples_state.dart'; @@ -26,12 +28,13 @@ import 'package:playground/pages/playground/states/playground_state.dart'; import 'mocks/categories_mock.dart'; final playgroundState = PlaygroundState(); +final ExampleClient client = GrpcExampleClient(); void main() { test( 'ExampleSelector state should notify all listeners about filter type change', () { - final exampleState = ExampleState(ExampleRepository()); + final exampleState = ExampleState(ExampleRepository(client)); final state = ExampleSelectorState(exampleState, playgroundState, []); state.addListener(() { expect(state.selectedFilterType, ExampleType.example); @@ -42,7 +45,7 @@ void main() { test( 'ExampleSelector state should notify all listeners about categories change', () { - final exampleState = ExampleState(ExampleRepository()); + final exampleState = ExampleState(ExampleRepository(client)); final state = ExampleSelectorState(exampleState, playgroundState, []); state.addListener(() { expect(state.categories, []); @@ -55,7 +58,7 @@ void main() { '- update categories and notify all listeners,' 'but should NOT:' '- affect Example state categories', () { - final exampleState = ExampleState(ExampleRepository()); + final exampleState = ExampleState(ExampleRepository(client)); final state = ExampleSelectorState( exampleState, playgroundState, @@ -63,7 +66,7 @@ void main() { ); state.addListener(() { expect(state.categories, []); - expect(exampleState.categoriesBySdkMap, exampleState.categoriesBySdkMap); + expect(exampleState.sdkCategories, exampleState.sdkCategories); }); state.sortCategories(); }); @@ -74,7 +77,7 @@ void main() { '- notify all listeners,' 'but should NOT:' '- affect Example state categories', () { - final exampleState = ExampleState(ExampleRepository()); + final exampleState = ExampleState(ExampleRepository(client)); final state = ExampleSelectorState( exampleState, playgroundState, @@ -82,7 +85,7 @@ void main() { ); state.addListener(() { expect(state.categories, examplesSortedByTypeMock); - expect(exampleState.categoriesBySdkMap, exampleState.categoriesBySdkMap); + expect(exampleState.sdkCategories, exampleState.sdkCategories); }); state.sortExamplesByType(unsortedExamples, ExampleType.kata); }); @@ -95,7 +98,7 @@ void main() { '- wait for full name of example,' '- be sensitive for register,' '- affect Example state categories', () { - final exampleState = ExampleState(ExampleRepository()); + final exampleState = ExampleState(ExampleRepository(client)); final state = ExampleSelectorState( exampleState, playgroundState, @@ -103,7 +106,7 @@ void main() { ); state.addListener(() { expect(state.categories, examplesSortedByNameMock); - expect(exampleState.categoriesBySdkMap, exampleState.categoriesBySdkMap); + expect(exampleState.sdkCategories, exampleState.sdkCategories); }); state.sortExamplesByName(unsortedExamples, 'X1'); }); diff --git a/playground/frontend/test/pages/playground/states/mocks/example_mock.dart b/playground/frontend/test/pages/playground/states/mocks/example_mock.dart index 743dc040dc5f..8e5bc277a199 100644 --- a/playground/frontend/test/pages/playground/states/mocks/example_mock.dart +++ b/playground/frontend/test/pages/playground/states/mocks/example_mock.dart @@ -22,10 +22,14 @@ final ExampleModel exampleMock1 = ExampleModel( source: 'ex1', name: 'Example', type: ExampleType.example, + description: 'description', + path: 'SDK/Category/Name', ); final ExampleModel exampleMock2 = ExampleModel( source: 'ex2', name: 'Kata', type: ExampleType.kata, + description: 'description', + path: 'SDK/Category/Name', ); From 1a32b633c20d7b90cfc32fdaa76062f822278ac4 Mon Sep 17 00:00:00 2001 From: Alexander Date: Fri, 12 Nov 2021 19:04:56 +0400 Subject: [PATCH 21/32] [BEAM-13101] Fixes after merge request --- playground/frontend/lib/constants/sizes.dart | 6 ------ .../editor/components/editor_textarea.dart | 2 +- .../code_client/grpc_code_client.dart | 8 ++++++++ .../lib/modules/sdk/components/sdk_selector.dart | 16 +++++++++------- .../lib/pages/playground/playground_page.dart | 7 +++++-- .../playground/states/playground_state.dart | 5 ----- .../playground/states/playground_state_test.dart | 4 ++-- 7 files changed, 25 insertions(+), 23 deletions(-) diff --git a/playground/frontend/lib/constants/sizes.dart b/playground/frontend/lib/constants/sizes.dart index 15c93d319219..a274baa4a9a3 100644 --- a/playground/frontend/lib/constants/sizes.dart +++ b/playground/frontend/lib/constants/sizes.dart @@ -52,9 +52,3 @@ const double kCursorSize = 1.0; const double kContainerHeight = 40.0; const double kCodeFontSize = 14.0; - -// cursor size -const double kCursorSize = 1.0; - -// container size -const double kContainerHeight = 40.0; diff --git a/playground/frontend/lib/modules/editor/components/editor_textarea.dart b/playground/frontend/lib/modules/editor/components/editor_textarea.dart index 670aa16f727d..7cdc7df89638 100644 --- a/playground/frontend/lib/modules/editor/components/editor_textarea.dart +++ b/playground/frontend/lib/modules/editor/components/editor_textarea.dart @@ -60,7 +60,7 @@ class _EditorTextAreaState extends State { void didChangeDependencies() { final themeProvider = Provider.of(context, listen: true); _codeController = CodeController( - text: _codeController?.text ?? widget.example?.sources[widget.sdk] ?? '', + text: _codeController?.text ?? widget.example?.source ?? '', language: _getLanguageFromSdk(), theme: themeProvider.isDarkMode ? kDarkCodeTheme : kLightCodeTheme, onChange: (newSource) => widget.onSourceChange(newSource), diff --git a/playground/frontend/lib/modules/editor/repository/code_repository/code_client/grpc_code_client.dart b/playground/frontend/lib/modules/editor/repository/code_repository/code_client/grpc_code_client.dart index d81244141ce1..6c6a06b59749 100644 --- a/playground/frontend/lib/modules/editor/repository/code_repository/code_client/grpc_code_client.dart +++ b/playground/frontend/lib/modules/editor/repository/code_repository/code_client/grpc_code_client.dart @@ -119,6 +119,14 @@ class GrpcCodeClient implements CodeClient { return RunCodeStatus.compileError; case grpc.Status.STATUS_RUN_TIMEOUT: return RunCodeStatus.timeout; + case grpc.Status.STATUS_CANCELED: + break; + case grpc.Status.STATUS_PREPARATION_ERROR: + break; + case grpc.Status.STATUS_PREPARING: + break; + case grpc.Status.STATUS_RUN_ERROR: + break; } return RunCodeStatus.unspecified; } diff --git a/playground/frontend/lib/modules/sdk/components/sdk_selector.dart b/playground/frontend/lib/modules/sdk/components/sdk_selector.dart index dd6ec041fa25..f6cf5104679b 100644 --- a/playground/frontend/lib/modules/sdk/components/sdk_selector.dart +++ b/playground/frontend/lib/modules/sdk/components/sdk_selector.dart @@ -60,13 +60,15 @@ class SDKSelector extends StatelessWidget { ...SDK.values.map((SDK value) { return SizedBox( width: double.infinity, - child: SdkSelectorRow( - sdk: value, - onSelect: () { - close(); - setSdk(value); - setExample(state.sdkCategories![value]!.first.examples.first); - }, + child: Consumer( + builder: (context, state, child) => SdkSelectorRow( + sdk: value, + onSelect: () { + close(); + setSdk(value); + setExample(state.sdkCategories![value]!.first.examples.first); + }, + ), ), ); }).toList() diff --git a/playground/frontend/lib/pages/playground/playground_page.dart b/playground/frontend/lib/pages/playground/playground_page.dart index 1bcd84dfd35a..03730d6df0e7 100644 --- a/playground/frontend/lib/pages/playground/playground_page.dart +++ b/playground/frontend/lib/pages/playground/playground_page.dart @@ -58,8 +58,11 @@ class PlaygroundPage extends StatelessWidget { ); }, ), - SDKSelector(sdk: state.sdk, setSdk: state.setSdk), - + SDKSelector( + sdk: state.sdk, + setSdk: state.setSdk, + setExample: state.setExample, + ), const NewExampleAction(), ResetAction(reset: state.reset), ], diff --git a/playground/frontend/lib/pages/playground/states/playground_state.dart b/playground/frontend/lib/pages/playground/states/playground_state.dart index fc8031bac95c..42a80b295519 100644 --- a/playground/frontend/lib/pages/playground/states/playground_state.dart +++ b/playground/frontend/lib/pages/playground/states/playground_state.dart @@ -36,11 +36,6 @@ class PlaygroundState with ChangeNotifier { RunCodeResult? _result; DateTime? resetKey; - String get examplesTitle { - final name = _selectedExample?.name ?? ''; - return name.substring(0, min(kTitleLength, name.length)); - } - PlaygroundState({ SDK sdk = SDK.java, ExampleModel? selectedExample, diff --git a/playground/frontend/test/pages/playground/states/playground_state_test.dart b/playground/frontend/test/pages/playground/states/playground_state_test.dart index 0b6d3e963b25..6516a8ffa6dd 100644 --- a/playground/frontend/test/pages/playground/states/playground_state_test.dart +++ b/playground/frontend/test/pages/playground/states/playground_state_test.dart @@ -39,10 +39,10 @@ void main() { test( 'Playground state reset should reset source to example notify all listeners', () { - final state = PlaygroundState(sdk: SDK.go, selectedExample: exampleMock); + final state = PlaygroundState(sdk: SDK.go, selectedExample: exampleMock1); state.setSource('source'); state.addListener(() { - expect(state.source, goExample); + expect(state.source, exampleMock1.source); }); state.reset(); }); From 4ff66ec0d8f6b5870b4821589bc6b0a60bc6a41b Mon Sep 17 00:00:00 2001 From: Alexander Date: Tue, 16 Nov 2021 15:26:51 +0400 Subject: [PATCH 22/32] [BEAM-13101] Example structure fixes, added licenses --- playground/frontend/lib/api/v1/api.pb.dart | 18 +++++++++++ .../frontend/lib/api/v1/api.pbenum.dart | 18 +++++++++++ .../frontend/lib/api/v1/api.pbgrpc.dart | 18 +++++++++++ .../frontend/lib/api/v1/api.pbjson.dart | 18 +++++++++++ .../examples/models/outputs_model.dart | 18 +++++++++++ .../example_client/example_client.dart | 18 +++++++++++ .../models/get_example_request.dart | 18 +++++++++++ .../models/get_example_response.dart | 18 +++++++++++ .../models/get_list_of_examples_request.dart | 18 +++++++++++ .../models/get_list_of_examples_response.dart | 18 +++++++++++ .../modules/sdk/components/sdk_selector.dart | 2 +- .../components/playground_page_providers.dart | 10 ++---- .../states/example_dropdown_state.dart | 32 ------------------- .../playground/states/examples_state.dart | 4 +-- 14 files changed, 185 insertions(+), 43 deletions(-) delete mode 100644 playground/frontend/lib/pages/playground/states/example_dropdown_state.dart diff --git a/playground/frontend/lib/api/v1/api.pb.dart b/playground/frontend/lib/api/v1/api.pb.dart index 40bd52b38003..e48303b6284c 100644 --- a/playground/frontend/lib/api/v1/api.pb.dart +++ b/playground/frontend/lib/api/v1/api.pb.dart @@ -1,3 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /// // Generated code. Do not modify. // source: api/v1/api.proto diff --git a/playground/frontend/lib/api/v1/api.pbenum.dart b/playground/frontend/lib/api/v1/api.pbenum.dart index 4f9a3da5ece0..08e3aebdd8d3 100644 --- a/playground/frontend/lib/api/v1/api.pbenum.dart +++ b/playground/frontend/lib/api/v1/api.pbenum.dart @@ -1,3 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /// // Generated code. Do not modify. // source: api/v1/api.proto diff --git a/playground/frontend/lib/api/v1/api.pbgrpc.dart b/playground/frontend/lib/api/v1/api.pbgrpc.dart index 30d31c1184f7..4f568c178c39 100644 --- a/playground/frontend/lib/api/v1/api.pbgrpc.dart +++ b/playground/frontend/lib/api/v1/api.pbgrpc.dart @@ -1,3 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /// // Generated code. Do not modify. // source: api/v1/api.proto diff --git a/playground/frontend/lib/api/v1/api.pbjson.dart b/playground/frontend/lib/api/v1/api.pbjson.dart index 6308a554c4f4..716377650544 100644 --- a/playground/frontend/lib/api/v1/api.pbjson.dart +++ b/playground/frontend/lib/api/v1/api.pbjson.dart @@ -1,3 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /// // Generated code. Do not modify. // source: api/v1/api.proto diff --git a/playground/frontend/lib/modules/examples/models/outputs_model.dart b/playground/frontend/lib/modules/examples/models/outputs_model.dart index a761909f46a8..a9b1bfa355b9 100644 --- a/playground/frontend/lib/modules/examples/models/outputs_model.dart +++ b/playground/frontend/lib/modules/examples/models/outputs_model.dart @@ -1,3 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + class OutputsModel { final String output; final String graph; diff --git a/playground/frontend/lib/modules/examples/repositories/example_client/example_client.dart b/playground/frontend/lib/modules/examples/repositories/example_client/example_client.dart index a03746770fe2..077024f77311 100644 --- a/playground/frontend/lib/modules/examples/repositories/example_client/example_client.dart +++ b/playground/frontend/lib/modules/examples/repositories/example_client/example_client.dart @@ -1,3 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import 'package:playground/modules/editor/repository/code_repository/code_client/output_response.dart'; import 'package:playground/modules/examples/repositories/models/get_example_request.dart'; import 'package:playground/modules/examples/repositories/models/get_example_response.dart'; diff --git a/playground/frontend/lib/modules/examples/repositories/models/get_example_request.dart b/playground/frontend/lib/modules/examples/repositories/models/get_example_request.dart index a6ee699b3bed..85b0c9c5224f 100644 --- a/playground/frontend/lib/modules/examples/repositories/models/get_example_request.dart +++ b/playground/frontend/lib/modules/examples/repositories/models/get_example_request.dart @@ -1,3 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + class GetExampleRequestWrapper { final String path; diff --git a/playground/frontend/lib/modules/examples/repositories/models/get_example_response.dart b/playground/frontend/lib/modules/examples/repositories/models/get_example_response.dart index 93808f16a17e..2892c777a71f 100644 --- a/playground/frontend/lib/modules/examples/repositories/models/get_example_response.dart +++ b/playground/frontend/lib/modules/examples/repositories/models/get_example_response.dart @@ -1,3 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + class GetExampleResponse { final String code; diff --git a/playground/frontend/lib/modules/examples/repositories/models/get_list_of_examples_request.dart b/playground/frontend/lib/modules/examples/repositories/models/get_list_of_examples_request.dart index f6061747d5fb..395c5d0cf91a 100644 --- a/playground/frontend/lib/modules/examples/repositories/models/get_list_of_examples_request.dart +++ b/playground/frontend/lib/modules/examples/repositories/models/get_list_of_examples_request.dart @@ -1,3 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import 'package:playground/modules/sdk/models/sdk.dart'; class GetListOfExamplesRequestWrapper { diff --git a/playground/frontend/lib/modules/examples/repositories/models/get_list_of_examples_response.dart b/playground/frontend/lib/modules/examples/repositories/models/get_list_of_examples_response.dart index ec249b0d1009..3b3f1b35760d 100644 --- a/playground/frontend/lib/modules/examples/repositories/models/get_list_of_examples_response.dart +++ b/playground/frontend/lib/modules/examples/repositories/models/get_list_of_examples_response.dart @@ -1,3 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import 'package:playground/modules/sdk/models/sdk.dart'; import 'package:playground/modules/examples/models/category_model.dart'; diff --git a/playground/frontend/lib/modules/sdk/components/sdk_selector.dart b/playground/frontend/lib/modules/sdk/components/sdk_selector.dart index f6cf5104679b..9fbd18850427 100644 --- a/playground/frontend/lib/modules/sdk/components/sdk_selector.dart +++ b/playground/frontend/lib/modules/sdk/components/sdk_selector.dart @@ -66,7 +66,7 @@ class SDKSelector extends StatelessWidget { onSelect: () { close(); setSdk(value); - setExample(state.sdkCategories![value]!.first.examples.first); + setExample(state.defaultExamplesMap![value]!); }, ), ), diff --git a/playground/frontend/lib/pages/playground/components/playground_page_providers.dart b/playground/frontend/lib/pages/playground/components/playground_page_providers.dart index 089dda32d95f..05a9d8a4db50 100644 --- a/playground/frontend/lib/pages/playground/components/playground_page_providers.dart +++ b/playground/frontend/lib/pages/playground/components/playground_page_providers.dart @@ -54,14 +54,8 @@ class PlaygroundPageProviders extends StatelessWidget { if (exampleState.sdkCategories != null && playground.selectedExample == null) { - final defaultExample = exampleState - .sdkCategories![playground.sdk]!.first.examples.first; - exampleState.getExampleSource(defaultExample.path).then((value) { - defaultExample.setSource(value); - }); - exampleState.getExampleOutput(defaultExample.path).then((value) { - defaultExample.setOutputs(value); - }); + final defaultExample = + exampleState.defaultExamplesMap![playground.sdk]!; return PlaygroundState( codeRepository: kCodeRepository, sdk: playground.sdk, diff --git a/playground/frontend/lib/pages/playground/states/example_dropdown_state.dart b/playground/frontend/lib/pages/playground/states/example_dropdown_state.dart deleted file mode 100644 index 38a966561fb1..000000000000 --- a/playground/frontend/lib/pages/playground/states/example_dropdown_state.dart +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import 'package:flutter/material.dart'; - -class ExampleDropdownState with ChangeNotifier { - String _selectedCategory; - - ExampleDropdownState([this._selectedCategory = 'All']); - - String get selectedCategory => _selectedCategory; - - setSelectedCategory(String name) async { - _selectedCategory = name; - notifyListeners(); - } -} diff --git a/playground/frontend/lib/pages/playground/states/examples_state.dart b/playground/frontend/lib/pages/playground/states/examples_state.dart index b1e44ce7f92d..58c53dec17f5 100644 --- a/playground/frontend/lib/pages/playground/states/examples_state.dart +++ b/playground/frontend/lib/pages/playground/states/examples_state.dart @@ -64,7 +64,7 @@ class ExampleState with ChangeNotifier { sdkCategories = await _exampleRepository.getListOfExamples( GetListOfExamplesRequestWrapper(sdk: null, category: null), ); - _loadDefaultExamples(sdkCategories); + await _loadDefaultExamples(sdkCategories); notifyListeners(); } @@ -91,4 +91,4 @@ class ExampleState with ChangeNotifier { defaultExamplesMap?.addEntries(entries); notifyListeners(); } -} \ No newline at end of file +} From 508c82ccf433b32448a171b0035dd2998eea7627 Mon Sep 17 00:00:00 2001 From: Alexander Date: Tue, 16 Nov 2021 15:31:10 +0400 Subject: [PATCH 23/32] [BEAM-13101] Removed unnecessary file and comment --- .../repositories/example_repository.dart | 18 ------------------ .../get_precompiled_outputs_request.dart | 0 2 files changed, 18 deletions(-) delete mode 100644 playground/frontend/lib/modules/examples/repositories/models/get_precompiled_outputs_request.dart diff --git a/playground/frontend/lib/modules/examples/repositories/example_repository.dart b/playground/frontend/lib/modules/examples/repositories/example_repository.dart index c986c99330fc..fb003e5e64a4 100644 --- a/playground/frontend/lib/modules/examples/repositories/example_repository.dart +++ b/playground/frontend/lib/modules/examples/repositories/example_repository.dart @@ -47,22 +47,4 @@ class ExampleRepository { final result = await _client.getExampleOutput(request); return result.output; } - -// Map> parseListOfExamplesResponse(Map data) { -// Map> output = {}; -// for (SDK sdk in SDK.values) { -// final sdkName = sdk.displayName.toLowerCase(); -// if (data.containsKey(sdkName)) { -// output[sdk] = data[sdkName] -// .map((category) => CategoryModel.fromJson(category)) -// .cast() -// .toList(); -// } -// } -// return output; -// } -// -// OutputsModel parsePrecompiledOutputs(Map data) { -// return OutputsModel.fromJson(data); -// } } diff --git a/playground/frontend/lib/modules/examples/repositories/models/get_precompiled_outputs_request.dart b/playground/frontend/lib/modules/examples/repositories/models/get_precompiled_outputs_request.dart deleted file mode 100644 index e69de29bb2d1..000000000000 From b73f5f70ac4184b56a0a03922731c5f2f69b9566 Mon Sep 17 00:00:00 2001 From: Sergey Kalinin <91209855+snkalinin@users.noreply.github.com> Date: Tue, 16 Nov 2021 14:59:11 +0300 Subject: [PATCH 24/32] [Playground][BEAM-12941][Bugfix] Fix workflows for playground applications (#83) * Update workflows for playground * Attempt to fix tests * Remove continue on error to catch errors * Fix linter problem for backend dockerfile * Update folder to run backend go linter * Moved flutter test to execution via gradle tasks --- .../workflows/build_playground_backend.yml | 14 ++++++++----- .../workflows/build_playground_frontend.yml | 20 +++++++------------ playground/backend/containers/java/Dockerfile | 2 +- 3 files changed, 17 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build_playground_backend.yml b/.github/workflows/build_playground_backend.yml index 96e8aae9b0d5..bd2868768246 100644 --- a/.github/workflows/build_playground_backend.yml +++ b/.github/workflows/build_playground_backend.yml @@ -17,10 +17,8 @@ name: Build And Deploy Playground Backend Application on: push: - branches: ['master', 'release-*'] tags: 'v*' pull_request: - branches: ['master', 'release-*'] tags: 'v*' paths: ['playground/backend/**'] workflow_dispatch: @@ -45,12 +43,14 @@ jobs: - name: Prepare Go lint env run: "sudo ./playground/backend/env_setup.sh" - name: Run Lint - run: "golangci-lint run internal/..." +# run: "golangci-lint run internal/..." + run: "golangci-lint run cmd/server/..." working-directory: playground/backend/ - continue-on-error: true + - name: Remove default github maven configuration + # This step is a workaround to avoid a decryption issue + run: rm ~/.m2/settings.xml - name: Run Tests run: ./gradlew playground:backend:test - continue-on-error: true - name: install npm uses: actions/setup-node@v2 with: @@ -62,12 +62,16 @@ jobs: working-directory: playground/backend/containers/java - name: Setup GCP account run: echo ${{ secrets.GCP_ACCESS_KEY }} | base64 -d > /tmp/gcp_access.json + if: startsWith(github.ref, 'ref/tags/') - name: Login to Docker Registry run: cat /tmp/gcp_access.json | docker login -u _json_key --password-stdin https://${{ secrets.REGISTRY_NAME }} + if: startsWith(github.ref, 'ref/tags/') - name: Preapre Build run: ./gradlew playground:backend:containers:java:dockerPush -Pdocker-repository-root='${{ secrets.REGISTRY_NAME}}/${{ secrets.PROJECT_ID }}/playground-repository' -Pbase-image='apache/beam_java8_sdk:${{ env.BEAM_VERSION }}' + if: startsWith(github.ref, 'ref/tags/') - name: Deploy Backend Application env: GOOGLE_APPLICATION_CREDENTIALS: /tmp/gcp_access.json run: terraform init && terraform apply -auto-approve -var="project_id=${{ secrets.PROJECT_ID }}" -var="docker_registry_address=${{ secrets.REGISTRY_NAME}}/${{ secrets.PROJECT_ID }}/playground-repository" working-directory: playground/terraform/applications/backend + if: startsWith(github.ref, 'ref/tags/') diff --git a/.github/workflows/build_playground_frontend.yml b/.github/workflows/build_playground_frontend.yml index 9c2d56a52428..f93e330442b0 100644 --- a/.github/workflows/build_playground_frontend.yml +++ b/.github/workflows/build_playground_frontend.yml @@ -17,12 +17,10 @@ name: Build And Deploy Playground Frontend Application on: push: - branches: ['master', 'release-*'] tags: 'v*' pull_request: - branches: ['master', 'release-*'] tags: 'v*' - paths: ['playground/backend/**'] + paths: ['playground/frontend/**'] workflow_dispatch: jobs: @@ -43,18 +41,10 @@ jobs: uses: subosito/flutter-action@v1 with: channel: 'stable' - - name: Prepare Flutter lint - run: "flutter pub add flutter_lints --dev" - working-directory: playground/frontend/ - continue-on-error: true - name: Run Lint - run: "flutter analyze" - working-directory: playground/frontend/ - continue-on-error: true + run: ./gradlew playground:frontend:analyze - name: Run Tests - run: flutter test - working-directory: playground/frontend/ - continue-on-error: true + run: ./gradlew playground:frontend:test - name: install npm uses: actions/setup-node@v2 with: @@ -66,12 +56,16 @@ jobs: working-directory: playground/frontend - name: Setup GCP account run: echo ${{ secrets.GCP_ACCESS_KEY }} | base64 -d > /tmp/gcp_access.json + if: startsWith(github.ref, 'ref/tags/') - name: Login to Docker Registry run: cat /tmp/gcp_access.json | docker login -u _json_key --password-stdin https://${{ secrets.REGISTRY_NAME }} + if: startsWith(github.ref, 'ref/tags/') - name: Preapre Build run: ./gradlew --debug playground:frontend:dockerPush -Pdocker-repository-root='${{ secrets.REGISTRY_NAME}}/${{ secrets.PROJECT_ID }}/playground-repository' + if: startsWith(github.ref, 'ref/tags/') - name: Deploy Backend Application env: GOOGLE_APPLICATION_CREDENTIALS: /tmp/gcp_access.json run: terraform init && terraform apply -auto-approve -var="project_id=${{ secrets.PROJECT_ID }}" -var="docker_registry_address=${{ secrets.REGISTRY_NAME}}/${{ secrets.PROJECT_ID }}/playground-repository" working-directory: playground/terraform/applications/backend + if: startsWith(github.ref, 'ref/tags/') diff --git a/playground/backend/containers/java/Dockerfile b/playground/backend/containers/java/Dockerfile index d7275020dcfa..8846368ff8b6 100644 --- a/playground/backend/containers/java/Dockerfile +++ b/playground/backend/containers/java/Dockerfile @@ -15,7 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. ############################################################################### -ARG BASE_IMAGE +ARG BASE_IMAGE=apache/beam_java8_sdk:latest FROM golang:1.17-buster AS build # Setup Go Environment From d449275b8ebd623760b34981f56c8f62b140ad9d Mon Sep 17 00:00:00 2001 From: Ilya Date: Tue, 16 Nov 2021 15:07:49 +0300 Subject: [PATCH 25/32] Revert "[Playground][BEAM-12941][Bugfix] Fix workflows for playground applications (#83)" (#88) This reverts commit b73f5f70ac4184b56a0a03922731c5f2f69b9566. --- .../workflows/build_playground_backend.yml | 14 +++++-------- .../workflows/build_playground_frontend.yml | 20 ++++++++++++------- playground/backend/containers/java/Dockerfile | 2 +- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build_playground_backend.yml b/.github/workflows/build_playground_backend.yml index bd2868768246..96e8aae9b0d5 100644 --- a/.github/workflows/build_playground_backend.yml +++ b/.github/workflows/build_playground_backend.yml @@ -17,8 +17,10 @@ name: Build And Deploy Playground Backend Application on: push: + branches: ['master', 'release-*'] tags: 'v*' pull_request: + branches: ['master', 'release-*'] tags: 'v*' paths: ['playground/backend/**'] workflow_dispatch: @@ -43,14 +45,12 @@ jobs: - name: Prepare Go lint env run: "sudo ./playground/backend/env_setup.sh" - name: Run Lint -# run: "golangci-lint run internal/..." - run: "golangci-lint run cmd/server/..." + run: "golangci-lint run internal/..." working-directory: playground/backend/ - - name: Remove default github maven configuration - # This step is a workaround to avoid a decryption issue - run: rm ~/.m2/settings.xml + continue-on-error: true - name: Run Tests run: ./gradlew playground:backend:test + continue-on-error: true - name: install npm uses: actions/setup-node@v2 with: @@ -62,16 +62,12 @@ jobs: working-directory: playground/backend/containers/java - name: Setup GCP account run: echo ${{ secrets.GCP_ACCESS_KEY }} | base64 -d > /tmp/gcp_access.json - if: startsWith(github.ref, 'ref/tags/') - name: Login to Docker Registry run: cat /tmp/gcp_access.json | docker login -u _json_key --password-stdin https://${{ secrets.REGISTRY_NAME }} - if: startsWith(github.ref, 'ref/tags/') - name: Preapre Build run: ./gradlew playground:backend:containers:java:dockerPush -Pdocker-repository-root='${{ secrets.REGISTRY_NAME}}/${{ secrets.PROJECT_ID }}/playground-repository' -Pbase-image='apache/beam_java8_sdk:${{ env.BEAM_VERSION }}' - if: startsWith(github.ref, 'ref/tags/') - name: Deploy Backend Application env: GOOGLE_APPLICATION_CREDENTIALS: /tmp/gcp_access.json run: terraform init && terraform apply -auto-approve -var="project_id=${{ secrets.PROJECT_ID }}" -var="docker_registry_address=${{ secrets.REGISTRY_NAME}}/${{ secrets.PROJECT_ID }}/playground-repository" working-directory: playground/terraform/applications/backend - if: startsWith(github.ref, 'ref/tags/') diff --git a/.github/workflows/build_playground_frontend.yml b/.github/workflows/build_playground_frontend.yml index f93e330442b0..9c2d56a52428 100644 --- a/.github/workflows/build_playground_frontend.yml +++ b/.github/workflows/build_playground_frontend.yml @@ -17,10 +17,12 @@ name: Build And Deploy Playground Frontend Application on: push: + branches: ['master', 'release-*'] tags: 'v*' pull_request: + branches: ['master', 'release-*'] tags: 'v*' - paths: ['playground/frontend/**'] + paths: ['playground/backend/**'] workflow_dispatch: jobs: @@ -41,10 +43,18 @@ jobs: uses: subosito/flutter-action@v1 with: channel: 'stable' + - name: Prepare Flutter lint + run: "flutter pub add flutter_lints --dev" + working-directory: playground/frontend/ + continue-on-error: true - name: Run Lint - run: ./gradlew playground:frontend:analyze + run: "flutter analyze" + working-directory: playground/frontend/ + continue-on-error: true - name: Run Tests - run: ./gradlew playground:frontend:test + run: flutter test + working-directory: playground/frontend/ + continue-on-error: true - name: install npm uses: actions/setup-node@v2 with: @@ -56,16 +66,12 @@ jobs: working-directory: playground/frontend - name: Setup GCP account run: echo ${{ secrets.GCP_ACCESS_KEY }} | base64 -d > /tmp/gcp_access.json - if: startsWith(github.ref, 'ref/tags/') - name: Login to Docker Registry run: cat /tmp/gcp_access.json | docker login -u _json_key --password-stdin https://${{ secrets.REGISTRY_NAME }} - if: startsWith(github.ref, 'ref/tags/') - name: Preapre Build run: ./gradlew --debug playground:frontend:dockerPush -Pdocker-repository-root='${{ secrets.REGISTRY_NAME}}/${{ secrets.PROJECT_ID }}/playground-repository' - if: startsWith(github.ref, 'ref/tags/') - name: Deploy Backend Application env: GOOGLE_APPLICATION_CREDENTIALS: /tmp/gcp_access.json run: terraform init && terraform apply -auto-approve -var="project_id=${{ secrets.PROJECT_ID }}" -var="docker_registry_address=${{ secrets.REGISTRY_NAME}}/${{ secrets.PROJECT_ID }}/playground-repository" working-directory: playground/terraform/applications/backend - if: startsWith(github.ref, 'ref/tags/') diff --git a/playground/backend/containers/java/Dockerfile b/playground/backend/containers/java/Dockerfile index 8846368ff8b6..d7275020dcfa 100644 --- a/playground/backend/containers/java/Dockerfile +++ b/playground/backend/containers/java/Dockerfile @@ -15,7 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. ############################################################################### -ARG BASE_IMAGE=apache/beam_java8_sdk:latest +ARG BASE_IMAGE FROM golang:1.17-buster AS build # Setup Go Environment From 82ee773541c6dc8a05dd64827a333e57b5a32244 Mon Sep 17 00:00:00 2001 From: Aydar Farrakhov Date: Wed, 17 Nov 2021 15:22:56 +0300 Subject: [PATCH 26/32] [BEAM-13101]: fix tests and refactor examples api --- playground/frontend/lib/constants/api.dart | 3 +- .../components/search_field/search_field.dart | 16 +++--- .../components/playground_page_providers.dart | 2 +- .../playground/states/examples_state.dart | 13 +++-- .../states/example_selector_state_test.dart | 52 ++++++++++--------- 5 files changed, 44 insertions(+), 42 deletions(-) diff --git a/playground/frontend/lib/constants/api.dart b/playground/frontend/lib/constants/api.dart index 4467d0457602..4f68a9f67ff4 100644 --- a/playground/frontend/lib/constants/api.dart +++ b/playground/frontend/lib/constants/api.dart @@ -16,4 +16,5 @@ * limitations under the License. */ -const String kApiClientURL = 'https://datatokenization.uc.r.appspot.com'; +const String kApiClientURL = + 'https://backend-dot-datatokenization.uc.r.appspot.com'; diff --git a/playground/frontend/lib/modules/examples/components/search_field/search_field.dart b/playground/frontend/lib/modules/examples/components/search_field/search_field.dart index 1889b53db120..a700ef74f4c3 100644 --- a/playground/frontend/lib/modules/examples/components/search_field/search_field.dart +++ b/playground/frontend/lib/modules/examples/components/search_field/search_field.dart @@ -75,14 +75,9 @@ class SearchField extends StatelessWidget { cursorColor: ThemeColors.of(context).lightGreyColor, cursorWidth: kCursorSize, textAlignVertical: TextAlignVertical.center, - onFieldSubmitted: (String filterText) { - state.setFilterText(filterText); - state.sortCategories(); - }, - onChanged: (String filterText) { - state.setFilterText(filterText); - state.sortCategories(); - }, + onFieldSubmitted: (String filterText) => + _onChange(state, filterText), + onChanged: (String filterText) => _onChange(state, filterText), maxLines: kMinLines, minLines: kMaxLines, ), @@ -90,4 +85,9 @@ class SearchField extends StatelessWidget { ), ); } + + _onChange(ExampleSelectorState state, String filterText) { + state.setFilterText(filterText); + state.sortCategories(); + } } diff --git a/playground/frontend/lib/pages/playground/components/playground_page_providers.dart b/playground/frontend/lib/pages/playground/components/playground_page_providers.dart index 05a9d8a4db50..464c9ef712f6 100644 --- a/playground/frontend/lib/pages/playground/components/playground_page_providers.dart +++ b/playground/frontend/lib/pages/playground/components/playground_page_providers.dart @@ -43,7 +43,7 @@ class PlaygroundPageProviders extends StatelessWidget { return MultiProvider( providers: [ ChangeNotifierProvider( - create: (context) => ExampleState(kExampleRepository), + create: (context) => ExampleState(kExampleRepository)..init(), ), ChangeNotifierProxyProvider( create: (context) => PlaygroundState(codeRepository: kCodeRepository), diff --git a/playground/frontend/lib/pages/playground/states/examples_state.dart b/playground/frontend/lib/pages/playground/states/examples_state.dart index 58c53dec17f5..7d62aed65f5f 100644 --- a/playground/frontend/lib/pages/playground/states/examples_state.dart +++ b/playground/frontend/lib/pages/playground/states/examples_state.dart @@ -30,7 +30,9 @@ class ExampleState with ChangeNotifier { Map? defaultExamplesMap; bool isSelectorOpened = false; - ExampleState(this._exampleRepository) { + ExampleState(this._exampleRepository); + + init() { _loadCategories(); } @@ -61,6 +63,7 @@ class ExampleState with ChangeNotifier { } _loadCategories() async { + print('load'); sdkCategories = await _exampleRepository.getListOfExamples( GetListOfExamplesRequestWrapper(sdk: null, category: null), ); @@ -79,12 +82,8 @@ class ExampleState with ChangeNotifier { for (SDK sdk in SDK.values) { ExampleModel? defaultExample = sdkCategories![sdk]?.first.examples.first; if (defaultExample != null) { - await getExampleSource(defaultExample.path).then((value) { - defaultExample.setSource(value); - }); - getExampleOutput(defaultExample.path).then((value) { - defaultExample.setOutputs(value); - }); + // load source and output async + loadExampleInfo(defaultExample); entries.add(MapEntry(sdk, defaultExample)); } } diff --git a/playground/frontend/test/pages/playground/states/example_selector_state_test.dart b/playground/frontend/test/pages/playground/states/example_selector_state_test.dart index 1f7be07a3d56..21259a5fcabf 100644 --- a/playground/frontend/test/pages/playground/states/example_selector_state_test.dart +++ b/playground/frontend/test/pages/playground/states/example_selector_state_test.dart @@ -17,19 +17,21 @@ */ import 'package:flutter_test/flutter_test.dart'; +import 'package:mockito/annotations.dart'; import 'package:playground/modules/examples/models/example_model.dart'; import 'package:playground/modules/examples/repositories/example_client/example_client.dart'; -import 'package:playground/modules/examples/repositories/example_client/grpc_example_client.dart'; import 'package:playground/modules/examples/repositories/example_repository.dart'; import 'package:playground/pages/playground/states/example_selector_state.dart'; import 'package:playground/pages/playground/states/examples_state.dart'; import 'package:playground/pages/playground/states/playground_state.dart'; +import 'example_selector_state_test.mocks.dart'; import 'mocks/categories_mock.dart'; final playgroundState = PlaygroundState(); -final ExampleClient client = GrpcExampleClient(); +final ExampleClient client = MockExampleClient(); +@GenerateMocks([ExampleClient]) void main() { test( 'ExampleSelector state should notify all listeners about filter type change', @@ -39,25 +41,25 @@ void main() { state.addListener(() { expect(state.selectedFilterType, ExampleType.example); }); - state.setSelectedFilterType(ExampleType.example); - }); + state.setSelectedFilterType(ExampleType.example); + }); test( 'ExampleSelector state should notify all listeners about categories change', - () { - final exampleState = ExampleState(ExampleRepository(client)); - final state = ExampleSelectorState(exampleState, playgroundState, []); - state.addListener(() { - expect(state.categories, []); - }); - state.setCategories([]); - }); + () { + final exampleState = ExampleState(ExampleRepository(client)); + final state = ExampleSelectorState(exampleState, playgroundState, []); + state.addListener(() { + expect(state.categories, []); + }); + state.setCategories([]); + }); test( 'ExampleSelector state sortCategories should:' - '- update categories and notify all listeners,' - 'but should NOT:' - '- affect Example state categories', () { + '- update categories and notify all listeners,' + 'but should NOT:' + '- affect Example state categories', () { final exampleState = ExampleState(ExampleRepository(client)); final state = ExampleSelectorState( exampleState, @@ -73,10 +75,10 @@ void main() { test( 'ExampleSelector state sortExamplesByType should:' - '- update categories,' - '- notify all listeners,' - 'but should NOT:' - '- affect Example state categories', () { + '- update categories,' + '- notify all listeners,' + 'but should NOT:' + '- affect Example state categories', () { final exampleState = ExampleState(ExampleRepository(client)); final state = ExampleSelectorState( exampleState, @@ -92,12 +94,12 @@ void main() { test( 'ExampleSelector state sortExamplesByName should:' - '- update categories' - '- notify all listeners,' - 'but should NOT:' - '- wait for full name of example,' - '- be sensitive for register,' - '- affect Example state categories', () { + '- update categories' + '- notify all listeners,' + 'but should NOT:' + '- wait for full name of example,' + '- be sensitive for register,' + '- affect Example state categories', () { final exampleState = ExampleState(ExampleRepository(client)); final state = ExampleSelectorState( exampleState, From e9b45b77a74f5b105746f044617786bf36d8629c Mon Sep 17 00:00:00 2001 From: Aydar Farrakhov Date: Wed, 17 Nov 2021 15:28:47 +0300 Subject: [PATCH 27/32] [BEAM-13101]: fix linter issues --- playground/frontend/analysis_options.yaml | 2 +- .../frontend/lib/pages/playground/states/examples_state.dart | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/playground/frontend/analysis_options.yaml b/playground/frontend/analysis_options.yaml index a74dda8af42c..40b7be9a76f8 100644 --- a/playground/frontend/analysis_options.yaml +++ b/playground/frontend/analysis_options.yaml @@ -28,7 +28,7 @@ include: package:flutter_lints/flutter.yaml # exclude generated files analyzer: - exclude: [lib/api/**, test/**.mocks.dart, lib/**.g.dart] + exclude: [ lib/api/**, test/**.mocks.dart, lib/**.g.dart, build/** ] linter: # The lint rules applied to this project can be customized in the diff --git a/playground/frontend/lib/pages/playground/states/examples_state.dart b/playground/frontend/lib/pages/playground/states/examples_state.dart index 7d62aed65f5f..796058808c58 100644 --- a/playground/frontend/lib/pages/playground/states/examples_state.dart +++ b/playground/frontend/lib/pages/playground/states/examples_state.dart @@ -63,7 +63,6 @@ class ExampleState with ChangeNotifier { } _loadCategories() async { - print('load'); sdkCategories = await _exampleRepository.getListOfExamples( GetListOfExamplesRequestWrapper(sdk: null, category: null), ); From 3881457dd955ec2a7858a8fe51a033fe325e5fd0 Mon Sep 17 00:00:00 2001 From: Aydar Farrakhov Date: Wed, 17 Nov 2021 16:17:01 +0300 Subject: [PATCH 28/32] [BEAM-13101]: add licence --- .../backend/internal/api/v1/api_grpc.pb.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/playground/backend/internal/api/v1/api_grpc.pb.go b/playground/backend/internal/api/v1/api_grpc.pb.go index ebc2a0ad0e58..93b5dd43e1a3 100644 --- a/playground/backend/internal/api/v1/api_grpc.pb.go +++ b/playground/backend/internal/api/v1/api_grpc.pb.go @@ -1,3 +1,20 @@ +// +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + // Code generated by protoc-gen-go-grpc. DO NOT EDIT. package playground From 1a11750995166909f00815a1533fb5041bb3a450 Mon Sep 17 00:00:00 2001 From: Aydar Farrakhov Date: Wed, 17 Nov 2021 16:18:51 +0300 Subject: [PATCH 29/32] [BEAM-13101]: format code --- playground/frontend/analysis_options.yaml | 1 + .../components/example_list/expansion_panel_item.dart | 2 +- .../examples/repositories/models/get_example_request.dart | 2 +- .../examples/repositories/models/get_example_response.dart | 2 +- .../repositories/models/get_list_of_examples_response.dart | 4 ++-- .../output/components/output_header/output_placements.dart | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/playground/frontend/analysis_options.yaml b/playground/frontend/analysis_options.yaml index 40b7be9a76f8..85c482936ac9 100644 --- a/playground/frontend/analysis_options.yaml +++ b/playground/frontend/analysis_options.yaml @@ -43,6 +43,7 @@ linter: # `// ignore_for_file: name_of_lint` syntax on the line or in the file # producing the lint. rules: + eol_at_end_of_file: true avoid_web_libraries_in_flutter: false # avoid_print: false # Uncomment to disable the `avoid_print` rule prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule diff --git a/playground/frontend/lib/modules/examples/components/example_list/expansion_panel_item.dart b/playground/frontend/lib/modules/examples/components/example_list/expansion_panel_item.dart index eb09a5375685..98baeef19823 100644 --- a/playground/frontend/lib/modules/examples/components/example_list/expansion_panel_item.dart +++ b/playground/frontend/lib/modules/examples/components/example_list/expansion_panel_item.dart @@ -37,7 +37,7 @@ class ExpansionPanelItem extends StatelessWidget { onTap: () async { if (playgroundState.selectedExample != example) { final exampleWithInfo = - await exampleState.loadExampleInfo(example); + await exampleState.loadExampleInfo(example); playgroundState.setExample(exampleWithInfo); } }, diff --git a/playground/frontend/lib/modules/examples/repositories/models/get_example_request.dart b/playground/frontend/lib/modules/examples/repositories/models/get_example_request.dart index 85b0c9c5224f..01ff465149d7 100644 --- a/playground/frontend/lib/modules/examples/repositories/models/get_example_request.dart +++ b/playground/frontend/lib/modules/examples/repositories/models/get_example_request.dart @@ -20,4 +20,4 @@ class GetExampleRequestWrapper { final String path; GetExampleRequestWrapper(this.path); -} \ No newline at end of file +} diff --git a/playground/frontend/lib/modules/examples/repositories/models/get_example_response.dart b/playground/frontend/lib/modules/examples/repositories/models/get_example_response.dart index 2892c777a71f..a8090a19908d 100644 --- a/playground/frontend/lib/modules/examples/repositories/models/get_example_response.dart +++ b/playground/frontend/lib/modules/examples/repositories/models/get_example_response.dart @@ -20,4 +20,4 @@ class GetExampleResponse { final String code; GetExampleResponse(this.code); -} \ No newline at end of file +} diff --git a/playground/frontend/lib/modules/examples/repositories/models/get_list_of_examples_response.dart b/playground/frontend/lib/modules/examples/repositories/models/get_list_of_examples_response.dart index 3b3f1b35760d..609c61df3ad0 100644 --- a/playground/frontend/lib/modules/examples/repositories/models/get_list_of_examples_response.dart +++ b/playground/frontend/lib/modules/examples/repositories/models/get_list_of_examples_response.dart @@ -16,11 +16,11 @@ * limitations under the License. */ -import 'package:playground/modules/sdk/models/sdk.dart'; import 'package:playground/modules/examples/models/category_model.dart'; +import 'package:playground/modules/sdk/models/sdk.dart'; class GetListOfExampleResponse { final Map> categories; GetListOfExampleResponse(this.categories); -} \ No newline at end of file +} diff --git a/playground/frontend/lib/modules/output/components/output_header/output_placements.dart b/playground/frontend/lib/modules/output/components/output_header/output_placements.dart index c55a66729b29..67d127d7c262 100644 --- a/playground/frontend/lib/modules/output/components/output_header/output_placements.dart +++ b/playground/frontend/lib/modules/output/components/output_header/output_placements.dart @@ -37,7 +37,7 @@ class OutputPlacements extends StatelessWidget { children: OutputPlacement.values .map( (placement) => Semantics( - label: '$kOutputPlacementSemantic ${placement.name}', + label: '$kOutputPlacementSemantic ${placement.name}', child: IconButton( splashRadius: kIconButtonSplashRadius, icon: SvgPicture.asset( From 1dc2b85a84bb73258592df69fc9f4bc95a1121ad Mon Sep 17 00:00:00 2001 From: Aydar Farrakhov Date: Wed, 17 Nov 2021 19:50:47 +0300 Subject: [PATCH 30/32] [BEAM-13101]: add missing mock file --- .../example_selector_state_test.mocks.dart | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 playground/frontend/test/pages/playground/states/example_selector_state_test.mocks.dart diff --git a/playground/frontend/test/pages/playground/states/example_selector_state_test.mocks.dart b/playground/frontend/test/pages/playground/states/example_selector_state_test.mocks.dart new file mode 100644 index 000000000000..204637e57e30 --- /dev/null +++ b/playground/frontend/test/pages/playground/states/example_selector_state_test.mocks.dart @@ -0,0 +1,89 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Mocks generated by Mockito 5.0.16 from annotations +// in playground/test/pages/playground/states/example_selector_state_test.dart. +// Do not manually edit this file. + +import 'dart:async' as _i6; + +import 'package:mockito/mockito.dart' as _i1; +import 'package:playground/modules/editor/repository/code_repository/code_client/output_response.dart' + as _i4; +import 'package:playground/modules/examples/repositories/example_client/example_client.dart' + as _i5; +import 'package:playground/modules/examples/repositories/models/get_example_request.dart' + as _i8; +import 'package:playground/modules/examples/repositories/models/get_example_response.dart' + as _i3; +import 'package:playground/modules/examples/repositories/models/get_list_of_examples_request.dart' + as _i7; +import 'package:playground/modules/examples/repositories/models/get_list_of_examples_response.dart' + as _i2; + +// ignore_for_file: avoid_redundant_argument_values +// ignore_for_file: avoid_setters_without_getters +// ignore_for_file: comment_references +// ignore_for_file: implementation_imports +// ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: prefer_const_constructors +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: camel_case_types + +class _FakeGetListOfExampleResponse_0 extends _i1.Fake + implements _i2.GetListOfExampleResponse {} + +class _FakeGetExampleResponse_1 extends _i1.Fake + implements _i3.GetExampleResponse {} + +class _FakeOutputResponse_2 extends _i1.Fake implements _i4.OutputResponse {} + +/// A class which mocks [ExampleClient]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockExampleClient extends _i1.Mock implements _i5.ExampleClient { + MockExampleClient() { + _i1.throwOnMissingStub(this); + } + + @override + _i6.Future<_i2.GetListOfExampleResponse> getListOfExamples( + _i7.GetListOfExamplesRequestWrapper? request) => + (super.noSuchMethod(Invocation.method(#getListOfExamples, [request]), + returnValue: Future<_i2.GetListOfExampleResponse>.value( + _FakeGetListOfExampleResponse_0())) + as _i6.Future<_i2.GetListOfExampleResponse>); + + @override + _i6.Future<_i3.GetExampleResponse> getExample( + _i8.GetExampleRequestWrapper? request) => + (super.noSuchMethod(Invocation.method(#getExample, [request]), + returnValue: Future<_i3.GetExampleResponse>.value( + _FakeGetExampleResponse_1())) + as _i6.Future<_i3.GetExampleResponse>); + + @override + _i6.Future<_i4.OutputResponse> getExampleOutput( + _i8.GetExampleRequestWrapper? request) => + (super.noSuchMethod(Invocation.method(#getExampleOutput, [request]), + returnValue: + Future<_i4.OutputResponse>.value(_FakeOutputResponse_2())) + as _i6.Future<_i4.OutputResponse>); + + @override + String toString() => super.toString(); +} From 653f73a566f8ace2580f85e6c7a8fe4aafe1173d Mon Sep 17 00:00:00 2001 From: Alexander Date: Thu, 18 Nov 2021 21:22:18 +0400 Subject: [PATCH 31/32] [BEAM-13101] Updated .proto file, regenerated proto --- playground/api/v1/api.proto | 9 +- playground/backend/internal/api/v1/api.pb.go | 140 ++++++++++-------- playground/frontend/lib/api/v1/api.pb.dart | 2 +- .../frontend/lib/api/v1/api.pbenum.dart | 14 +- .../frontend/lib/api/v1/api.pbjson.dart | 9 +- .../example_client/grpc_example_client.dart | 8 +- 6 files changed, 99 insertions(+), 83 deletions(-) diff --git a/playground/api/v1/api.proto b/playground/api/v1/api.proto index f25da7c71df0..47b4970a82e0 100644 --- a/playground/api/v1/api.proto +++ b/playground/api/v1/api.proto @@ -46,9 +46,10 @@ enum Status { } enum PrecompiledObjectType { - EXAMPLE = 0; - KATA = 1; - UNIT_TEST = 2; + PRECOMPILED_OBJECT_TYPE_UNSPECIFIED = 0; + PRECOMPILED_OBJECT_TYPE_EXAMPLE = 1; + PRECOMPILED_OBJECT_TYPE_KATA = 2; + PRECOMPILED_OBJECT_TYPE_UNIT_TEST = 3; } // RunCodeRequest represents a code text and options of SDK which executes the code. @@ -180,4 +181,4 @@ service PlaygroundService { // Get the precompiled details of an PrecompiledObject. rpc GetPrecompiledObjectOutput(GetPrecompiledObjectRequest) returns (GetRunOutputResponse); -} \ No newline at end of file +} diff --git a/playground/backend/internal/api/v1/api.pb.go b/playground/backend/internal/api/v1/api.pb.go index c0d95bfea7d7..dcafcabe2f97 100644 --- a/playground/backend/internal/api/v1/api.pb.go +++ b/playground/backend/internal/api/v1/api.pb.go @@ -174,22 +174,25 @@ func (Status) EnumDescriptor() ([]byte, []int) { type PrecompiledObjectType int32 const ( - PrecompiledObjectType_EXAMPLE PrecompiledObjectType = 0 - PrecompiledObjectType_KATA PrecompiledObjectType = 1 - PrecompiledObjectType_UNIT_TEST PrecompiledObjectType = 2 + PrecompiledObjectType_PRECOMPILED_OBJECT_TYPE_UNSPECIFIED PrecompiledObjectType = 0 + PrecompiledObjectType_PRECOMPILED_OBJECT_TYPE_EXAMPLE PrecompiledObjectType = 1 + PrecompiledObjectType_PRECOMPILED_OBJECT_TYPE_KATA PrecompiledObjectType = 2 + PrecompiledObjectType_PRECOMPILED_OBJECT_TYPE_UNIT_TEST PrecompiledObjectType = 3 ) // Enum value maps for PrecompiledObjectType. var ( PrecompiledObjectType_name = map[int32]string{ - 0: "EXAMPLE", - 1: "KATA", - 2: "UNIT_TEST", + 0: "PRECOMPILED_OBJECT_TYPE_UNSPECIFIED", + 1: "PRECOMPILED_OBJECT_TYPE_EXAMPLE", + 2: "PRECOMPILED_OBJECT_TYPE_KATA", + 3: "PRECOMPILED_OBJECT_TYPE_UNIT_TEST", } PrecompiledObjectType_value = map[string]int32{ - "EXAMPLE": 0, - "KATA": 1, - "UNIT_TEST": 2, + "PRECOMPILED_OBJECT_TYPE_UNSPECIFIED": 0, + "PRECOMPILED_OBJECT_TYPE_EXAMPLE": 1, + "PRECOMPILED_OBJECT_TYPE_KATA": 2, + "PRECOMPILED_OBJECT_TYPE_UNIT_TEST": 3, } ) @@ -928,7 +931,7 @@ func (x *PrecompiledObject) GetType() PrecompiledObjectType { if x != nil { return x.Type } - return PrecompiledObjectType_EXAMPLE + return PrecompiledObjectType_PRECOMPILED_OBJECT_TYPE_UNSPECIFIED } // Categories represent the array of messages with sdk and categories at this sdk @@ -1303,62 +1306,69 @@ var file_api_v1_api_proto_rawDesc = []byte{ 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x0a, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52, 0x55, 0x4e, 0x5f, 0x54, 0x49, 0x4d, 0x45, 0x4f, 0x55, 0x54, 0x10, 0x0b, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x41, 0x4e, 0x43, 0x45, 0x4c, - 0x45, 0x44, 0x10, 0x0c, 0x2a, 0x3d, 0x0a, 0x15, 0x50, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x70, 0x69, - 0x6c, 0x65, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, - 0x07, 0x45, 0x58, 0x41, 0x4d, 0x50, 0x4c, 0x45, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x4b, 0x41, - 0x54, 0x41, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x55, 0x4e, 0x49, 0x54, 0x5f, 0x54, 0x45, 0x53, - 0x54, 0x10, 0x02, 0x32, 0xec, 0x05, 0x0a, 0x11, 0x50, 0x6c, 0x61, 0x79, 0x67, 0x72, 0x6f, 0x75, - 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3a, 0x0a, 0x07, 0x52, 0x75, 0x6e, - 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x75, - 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x75, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x0b, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, - 0x65, 0x63, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, - 0x0c, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x1b, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6e, 0x4f, 0x75, 0x74, - 0x70, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x52, - 0x75, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, - 0x2e, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, - 0x52, 0x75, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x55, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x4f, 0x75, - 0x74, 0x70, 0x75, 0x74, 0x12, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, - 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, - 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x06, 0x43, 0x61, 0x6e, 0x63, 0x65, - 0x6c, 0x12, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, - 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x31, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x64, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x50, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, - 0x65, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0x24, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, - 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x25, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x65, 0x63, - 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x69, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x50, 0x72, 0x65, - 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6f, - 0x64, 0x65, 0x12, 0x23, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, + 0x45, 0x44, 0x10, 0x0c, 0x2a, 0xae, 0x01, 0x0a, 0x15, 0x50, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x70, + 0x69, 0x6c, 0x65, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x27, + 0x0a, 0x23, 0x50, 0x52, 0x45, 0x43, 0x4f, 0x4d, 0x50, 0x49, 0x4c, 0x45, 0x44, 0x5f, 0x4f, 0x42, + 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, + 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x23, 0x0a, 0x1f, 0x50, 0x52, 0x45, 0x43, 0x4f, + 0x4d, 0x50, 0x49, 0x4c, 0x45, 0x44, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x54, 0x59, + 0x50, 0x45, 0x5f, 0x45, 0x58, 0x41, 0x4d, 0x50, 0x4c, 0x45, 0x10, 0x01, 0x12, 0x20, 0x0a, 0x1c, + 0x50, 0x52, 0x45, 0x43, 0x4f, 0x4d, 0x50, 0x49, 0x4c, 0x45, 0x44, 0x5f, 0x4f, 0x42, 0x4a, 0x45, + 0x43, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4b, 0x41, 0x54, 0x41, 0x10, 0x02, 0x12, 0x25, + 0x0a, 0x21, 0x50, 0x52, 0x45, 0x43, 0x4f, 0x4d, 0x50, 0x49, 0x4c, 0x45, 0x44, 0x5f, 0x4f, 0x42, + 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x49, 0x54, 0x5f, 0x54, + 0x45, 0x53, 0x54, 0x10, 0x03, 0x32, 0xec, 0x05, 0x0a, 0x11, 0x50, 0x6c, 0x61, 0x79, 0x67, 0x72, + 0x6f, 0x75, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3a, 0x0a, 0x07, 0x52, + 0x75, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, + 0x52, 0x75, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x75, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x0b, 0x43, 0x68, 0x65, 0x63, 0x6b, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, + 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, + 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x49, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, + 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6e, 0x4f, + 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6e, 0x4f, 0x75, 0x74, 0x70, + 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x0b, 0x47, 0x65, + 0x74, 0x52, 0x75, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, + 0x65, 0x74, 0x52, 0x75, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x55, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, + 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, + 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x4f, 0x75, 0x74, 0x70, 0x75, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x06, 0x43, 0x61, 0x6e, + 0x63, 0x65, 0x6c, 0x12, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6e, + 0x63, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x64, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x50, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x70, + 0x69, 0x6c, 0x65, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0x24, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x70, 0x69, + 0x6c, 0x65, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x25, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, + 0x65, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x69, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x50, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, - 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x5f, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x50, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x70, 0x69, - 0x6c, 0x65, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, - 0x23, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x65, 0x63, - 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, - 0x74, 0x52, 0x75, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x42, 0x38, 0x5a, 0x36, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, - 0x65, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x6c, 0x61, 0x79, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, - 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, - 0x6c, 0x3b, 0x70, 0x6c, 0x61, 0x79, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x43, 0x6f, 0x64, 0x65, 0x12, 0x23, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, + 0x74, 0x50, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x4f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, + 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x5f, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x50, 0x72, 0x65, 0x63, 0x6f, 0x6d, + 0x70, 0x69, 0x6c, 0x65, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, + 0x74, 0x12, 0x23, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, + 0x65, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, + 0x47, 0x65, 0x74, 0x52, 0x75, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x38, 0x5a, 0x36, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x61, 0x70, 0x61, + 0x63, 0x68, 0x65, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x6c, 0x61, 0x79, 0x67, 0x72, 0x6f, 0x75, + 0x6e, 0x64, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, + 0x6e, 0x61, 0x6c, 0x3b, 0x70, 0x6c, 0x61, 0x79, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/playground/frontend/lib/api/v1/api.pb.dart b/playground/frontend/lib/api/v1/api.pb.dart index e48303b6284c..9a96e7d93a71 100644 --- a/playground/frontend/lib/api/v1/api.pb.dart +++ b/playground/frontend/lib/api/v1/api.pb.dart @@ -671,7 +671,7 @@ class PrecompiledObject extends $pb.GeneratedMessage { ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'cloudPath') ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name') ..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'description') - ..e(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'type', $pb.PbFieldType.OE, defaultOrMaker: PrecompiledObjectType.EXAMPLE, valueOf: PrecompiledObjectType.valueOf, enumValues: PrecompiledObjectType.values) + ..e(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'type', $pb.PbFieldType.OE, defaultOrMaker: PrecompiledObjectType.PRECOMPILED_OBJECT_TYPE_UNSPECIFIED, valueOf: PrecompiledObjectType.valueOf, enumValues: PrecompiledObjectType.values) ..hasRequiredFields = false ; diff --git a/playground/frontend/lib/api/v1/api.pbenum.dart b/playground/frontend/lib/api/v1/api.pbenum.dart index 08e3aebdd8d3..c4aa4bd2e887 100644 --- a/playground/frontend/lib/api/v1/api.pbenum.dart +++ b/playground/frontend/lib/api/v1/api.pbenum.dart @@ -86,14 +86,16 @@ class Status extends $pb.ProtobufEnum { } class PrecompiledObjectType extends $pb.ProtobufEnum { - static const PrecompiledObjectType EXAMPLE = PrecompiledObjectType._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'EXAMPLE'); - static const PrecompiledObjectType KATA = PrecompiledObjectType._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'KATA'); - static const PrecompiledObjectType UNIT_TEST = PrecompiledObjectType._(2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'UNIT_TEST'); + static const PrecompiledObjectType PRECOMPILED_OBJECT_TYPE_UNSPECIFIED = PrecompiledObjectType._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'PRECOMPILED_OBJECT_TYPE_UNSPECIFIED'); + static const PrecompiledObjectType PRECOMPILED_OBJECT_TYPE_EXAMPLE = PrecompiledObjectType._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'PRECOMPILED_OBJECT_TYPE_EXAMPLE'); + static const PrecompiledObjectType PRECOMPILED_OBJECT_TYPE_KATA = PrecompiledObjectType._(2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'PRECOMPILED_OBJECT_TYPE_KATA'); + static const PrecompiledObjectType PRECOMPILED_OBJECT_TYPE_UNIT_TEST = PrecompiledObjectType._(3, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'PRECOMPILED_OBJECT_TYPE_UNIT_TEST'); static const $core.List values = [ - EXAMPLE, - KATA, - UNIT_TEST, + PRECOMPILED_OBJECT_TYPE_UNSPECIFIED, + PRECOMPILED_OBJECT_TYPE_EXAMPLE, + PRECOMPILED_OBJECT_TYPE_KATA, + PRECOMPILED_OBJECT_TYPE_UNIT_TEST, ]; static final $core.Map<$core.int, PrecompiledObjectType> _byValue = $pb.ProtobufEnum.initByValue(values); diff --git a/playground/frontend/lib/api/v1/api.pbjson.dart b/playground/frontend/lib/api/v1/api.pbjson.dart index 716377650544..8b0e01f7917e 100644 --- a/playground/frontend/lib/api/v1/api.pbjson.dart +++ b/playground/frontend/lib/api/v1/api.pbjson.dart @@ -66,14 +66,15 @@ final $typed_data.Uint8List statusDescriptor = $convert.base64Decode('CgZTdGF0dX const PrecompiledObjectType$json = const { '1': 'PrecompiledObjectType', '2': const [ - const {'1': 'EXAMPLE', '2': 0}, - const {'1': 'KATA', '2': 1}, - const {'1': 'UNIT_TEST', '2': 2}, + const {'1': 'PRECOMPILED_OBJECT_TYPE_UNSPECIFIED', '2': 0}, + const {'1': 'PRECOMPILED_OBJECT_TYPE_EXAMPLE', '2': 1}, + const {'1': 'PRECOMPILED_OBJECT_TYPE_KATA', '2': 2}, + const {'1': 'PRECOMPILED_OBJECT_TYPE_UNIT_TEST', '2': 3}, ], }; /// Descriptor for `PrecompiledObjectType`. Decode as a `google.protobuf.EnumDescriptorProto`. -final $typed_data.Uint8List precompiledObjectTypeDescriptor = $convert.base64Decode('ChVQcmVjb21waWxlZE9iamVjdFR5cGUSCwoHRVhBTVBMRRAAEggKBEtBVEEQARINCglVTklUX1RFU1QQAg=='); +final $typed_data.Uint8List precompiledObjectTypeDescriptor = $convert.base64Decode('ChVQcmVjb21waWxlZE9iamVjdFR5cGUSJwojUFJFQ09NUElMRURfT0JKRUNUX1RZUEVfVU5TUEVDSUZJRUQQABIjCh9QUkVDT01QSUxFRF9PQkpFQ1RfVFlQRV9FWEFNUExFEAESIAocUFJFQ09NUElMRURfT0JKRUNUX1RZUEVfS0FUQRACEiUKIVBSRUNPTVBJTEVEX09CSkVDVF9UWVBFX1VOSVRfVEVTVBAD'); @$core.Deprecated('Use runCodeRequestDescriptor instead') const RunCodeRequest$json = const { '1': 'RunCodeRequest', diff --git a/playground/frontend/lib/modules/examples/repositories/example_client/grpc_example_client.dart b/playground/frontend/lib/modules/examples/repositories/example_client/grpc_example_client.dart index 3dbfbf7c4784..38dde184a38b 100644 --- a/playground/frontend/lib/modules/examples/repositories/example_client/grpc_example_client.dart +++ b/playground/frontend/lib/modules/examples/repositories/example_client/grpc_example_client.dart @@ -125,12 +125,14 @@ class GrpcExampleClient implements ExampleClient { ExampleType _exampleTypeFromString(grpc.PrecompiledObjectType type) { switch (type) { - case grpc.PrecompiledObjectType.EXAMPLE: + case grpc.PrecompiledObjectType.PRECOMPILED_OBJECT_TYPE_EXAMPLE: return ExampleType.example; - case grpc.PrecompiledObjectType.KATA: + case grpc.PrecompiledObjectType.PRECOMPILED_OBJECT_TYPE_KATA: return ExampleType.kata; - case grpc.PrecompiledObjectType.UNIT_TEST: + case grpc.PrecompiledObjectType.PRECOMPILED_OBJECT_TYPE_UNIT_TEST: return ExampleType.test; + case grpc.PrecompiledObjectType.PRECOMPILED_OBJECT_TYPE_UNSPECIFIED: + return ExampleType.all; default: return ExampleType.example; } From c3767c57b187748e474c9c834febfdbbf3a784b9 Mon Sep 17 00:00:00 2001 From: Alexander Date: Sun, 21 Nov 2021 13:31:24 +0400 Subject: [PATCH 32/32] [BEAM-13101] Fixed import in grpc example client --- .../repositories/example_client/grpc_example_client.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playground/frontend/lib/modules/examples/repositories/example_client/grpc_example_client.dart b/playground/frontend/lib/modules/examples/repositories/example_client/grpc_example_client.dart index 38dde184a38b..031d5da6b215 100644 --- a/playground/frontend/lib/modules/examples/repositories/example_client/grpc_example_client.dart +++ b/playground/frontend/lib/modules/examples/repositories/example_client/grpc_example_client.dart @@ -18,7 +18,7 @@ import 'package:grpc/grpc_web.dart'; import 'package:playground/api/v1/api.pbgrpc.dart' as grpc; -import 'package:playground/constants/api.dart'; +import 'package:playground/config.g.dart'; import 'package:playground/modules/editor/repository/code_repository/code_client/output_response.dart'; import 'package:playground/modules/examples/models/category_model.dart'; import 'package:playground/modules/examples/models/example_model.dart';