diff --git a/melos.yaml b/melos.yaml index 396d82143..88808b097 100644 --- a/melos.yaml +++ b/melos.yaml @@ -49,7 +49,7 @@ scripts: # run build_runner to generate code in all packages generate: > - melos exec -c 1 --fail-fast --depends-on=build_runner -- \ + melos exec -c 1 --fail-fast --depends-on=build_runner --order-dependents -- \ fvm dart run build_runner build --delete-conflicting-outputs # run gen-l10n to generate localizations in all packages @@ -72,3 +72,12 @@ scripts: # run pub upgrade in all packages upgrade: melos pub upgrade + + # generate protobuf files in app_center_ratings_client + protoc: + run: | + rm -rf ./packages/app_center_ratings_client/lib/src/generated/* && + protoc \ + --dart_out=grpc:./packages/app_center_ratings_client/lib/src/generated \ + -I./packages/app_center_ratings_client/protos ./packages/app_center_ratings_client/protos/*.proto \ + google/protobuf/timestamp.proto google/protobuf/empty.proto diff --git a/packages/app_center/lib/ratings/rated_category_model.dart b/packages/app_center/lib/ratings/rated_category_model.dart index 0aa6285d6..efd07d7a3 100644 --- a/packages/app_center/lib/ratings/rated_category_model.dart +++ b/packages/app_center/lib/ratings/rated_category_model.dart @@ -21,7 +21,8 @@ class RatedCategoryModel extends _$RatedCategoryModel { for (final category in categories) { final chart = await _ratings.getChart(category); for (var i = 0; snaps.length < numberOfSnaps && i < chart.length; i++) { - final snap = await _snapd.findById(chart[i].rating.snapId); + final snap = + (await _snapd.find(name: chart[i].rating.snapName)).singleOrNull; if (snap != null && snap.screenshotUrls.isNotEmpty) { snaps.add(snap); } diff --git a/packages/app_center/lib/ratings/rated_category_model.g.dart b/packages/app_center/lib/ratings/rated_category_model.g.dart deleted file mode 100644 index dcf66aa17..000000000 --- a/packages/app_center/lib/ratings/rated_category_model.g.dart +++ /dev/null @@ -1,199 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'rated_category_model.dart'; - -// ************************************************************************** -// RiverpodGenerator -// ************************************************************************** - -String _$ratedCategoryModelHash() => - r'5fad0c098fbb1b6f11ea7904a51da353c3826e84'; - -/// Copied from Dart SDK -class _SystemHash { - _SystemHash._(); - - static int combine(int hash, int value) { - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + value); - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10)); - return hash ^ (hash >> 6); - } - - static int finish(int hash) { - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3)); - // ignore: parameter_assignments - hash = hash ^ (hash >> 11); - return 0x1fffffff & (hash + ((0x00003fff & hash) << 15)); - } -} - -abstract class _$RatedCategoryModel - extends BuildlessAutoDisposeAsyncNotifier> { - late final List categories; - late final int numberOfSnaps; - - FutureOr> build( - List categories, - int numberOfSnaps, - ); -} - -/// See also [RatedCategoryModel]. -@ProviderFor(RatedCategoryModel) -const ratedCategoryModelProvider = RatedCategoryModelFamily(); - -/// See also [RatedCategoryModel]. -class RatedCategoryModelFamily extends Family>> { - /// See also [RatedCategoryModel]. - const RatedCategoryModelFamily(); - - /// See also [RatedCategoryModel]. - RatedCategoryModelProvider call( - List categories, - int numberOfSnaps, - ) { - return RatedCategoryModelProvider( - categories, - numberOfSnaps, - ); - } - - @override - RatedCategoryModelProvider getProviderOverride( - covariant RatedCategoryModelProvider provider, - ) { - return call( - provider.categories, - provider.numberOfSnaps, - ); - } - - static const Iterable? _dependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'ratedCategoryModelProvider'; -} - -/// See also [RatedCategoryModel]. -class RatedCategoryModelProvider extends AutoDisposeAsyncNotifierProviderImpl< - RatedCategoryModel, List> { - /// See also [RatedCategoryModel]. - RatedCategoryModelProvider( - List categories, - int numberOfSnaps, - ) : this._internal( - () => RatedCategoryModel() - ..categories = categories - ..numberOfSnaps = numberOfSnaps, - from: ratedCategoryModelProvider, - name: r'ratedCategoryModelProvider', - debugGetCreateSourceHash: - const bool.fromEnvironment('dart.vm.product') - ? null - : _$ratedCategoryModelHash, - dependencies: RatedCategoryModelFamily._dependencies, - allTransitiveDependencies: - RatedCategoryModelFamily._allTransitiveDependencies, - categories: categories, - numberOfSnaps: numberOfSnaps, - ); - - RatedCategoryModelProvider._internal( - super._createNotifier, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - required this.categories, - required this.numberOfSnaps, - }) : super.internal(); - - final List categories; - final int numberOfSnaps; - - @override - FutureOr> runNotifierBuild( - covariant RatedCategoryModel notifier, - ) { - return notifier.build( - categories, - numberOfSnaps, - ); - } - - @override - Override overrideWith(RatedCategoryModel Function() create) { - return ProviderOverride( - origin: this, - override: RatedCategoryModelProvider._internal( - () => create() - ..categories = categories - ..numberOfSnaps = numberOfSnaps, - from: from, - name: null, - dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - categories: categories, - numberOfSnaps: numberOfSnaps, - ), - ); - } - - @override - AutoDisposeAsyncNotifierProviderElement> - createElement() { - return _RatedCategoryModelProviderElement(this); - } - - @override - bool operator ==(Object other) { - return other is RatedCategoryModelProvider && - other.categories == categories && - other.numberOfSnaps == numberOfSnaps; - } - - @override - int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, categories.hashCode); - hash = _SystemHash.combine(hash, numberOfSnaps.hashCode); - - return _SystemHash.finish(hash); - } -} - -mixin RatedCategoryModelRef on AutoDisposeAsyncNotifierProviderRef> { - /// The parameter `categories` of this provider. - List get categories; - - /// The parameter `numberOfSnaps` of this provider. - int get numberOfSnaps; -} - -class _RatedCategoryModelProviderElement - extends AutoDisposeAsyncNotifierProviderElement> with RatedCategoryModelRef { - _RatedCategoryModelProviderElement(super.provider); - - @override - List get categories => - (origin as RatedCategoryModelProvider).categories; - @override - int get numberOfSnaps => (origin as RatedCategoryModelProvider).numberOfSnaps; -} -// ignore_for_file: type=lint -// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member diff --git a/packages/app_center/lib/ratings/ratings_data.dart b/packages/app_center/lib/ratings/ratings_data.dart index b5ffbadb0..4b55b7cd8 100644 --- a/packages/app_center/lib/ratings/ratings_data.dart +++ b/packages/app_center/lib/ratings/ratings_data.dart @@ -12,6 +12,7 @@ class RatingsData with _$RatingsData { required int snapRevision, required Rating? rating, required VoteStatus? voteStatus, + required String snapName, }) = _RatingsData; factory RatingsData.fromJson(Map json) => diff --git a/packages/app_center/lib/ratings/ratings_model.dart b/packages/app_center/lib/ratings/ratings_model.dart index c9824b014..06df81017 100644 --- a/packages/app_center/lib/ratings/ratings_model.dart +++ b/packages/app_center/lib/ratings/ratings_model.dart @@ -43,6 +43,7 @@ class RatingsModel extends _$RatingsModel { snapRevision: snap.revision, rating: rating, voteStatus: _getUserVote(snap.revision, votes), + snapName: snapName, ); cacheFile.writeRatingsDataSync(ratingsData); @@ -60,6 +61,7 @@ class RatingsModel extends _$RatingsModel { snapRevision: ratingsData.snapRevision, voteUp: voteUp, dateTime: clock.now(), + snapName: ratingsData.snapName, ); await _ratings.vote(vote); state = AsyncData(ratingsData.copyWith(voteStatus: voteStatus)); diff --git a/packages/app_center/lib/ratings/ratings_service.dart b/packages/app_center/lib/ratings/ratings_service.dart index e297c00f6..9cd242be5 100644 --- a/packages/app_center/lib/ratings/ratings_service.dart +++ b/packages/app_center/lib/ratings/ratings_service.dart @@ -54,11 +54,6 @@ class RatingsService { await client.delete(_jwt!); } - Future> listMyVotes(String snapFilter) async { - await _ensureValidToken(); - return client.listMyVotes(snapFilter, _jwt!); - } - Future> getSnapVotes(String snapId) async { await _ensureValidToken(); return client.getSnapVotes(snapId, _jwt!); diff --git a/packages/app_center/lib/snapd/snapd_service.dart b/packages/app_center/lib/snapd/snapd_service.dart index f4f5afa26..49a42e737 100644 --- a/packages/app_center/lib/snapd/snapd_service.dart +++ b/packages/app_center/lib/snapd/snapd_service.dart @@ -1,34 +1,8 @@ import 'package:app_center/snapd/snapd_cache.dart'; import 'package:app_center/snapd/snapd_watcher.dart'; -import 'package:collection/collection.dart'; import 'package:snapd/snapd.dart'; class SnapdService extends SnapdClient with SnapdCache, SnapdWatcher { Future waitChange(String changeId) => watchChange(changeId).firstWhere((change) => change.ready); - - Future findById(String snapId) async { - final queryParams = { - 'series': '16', - 'remote': 'true', - 'snap-id': snapId, - }; - Map result; - try { - result = await getAssertions( - assertion: 'snap-declaration', - params: queryParams, - ); - } on Exception catch (_) { - return null; - } - - if (result.isEmpty) { - return null; - } - final declaration = SnapDeclaration.fromJson(result); - final findResult = await find(name: declaration.snapName); - return findResult - .singleWhereOrNull((element) => element.id == declaration.snapId); - } } diff --git a/packages/app_center/test/app_card_test.dart b/packages/app_center/test/app_card_test.dart index f81ae0d4a..6d626aa34 100644 --- a/packages/app_center/test/app_card_test.dart +++ b/packages/app_center/test/app_card_test.dart @@ -7,10 +7,12 @@ import 'package:ubuntu_service/ubuntu_service.dart'; import 'test_utils.dart'; const snapId = 'r4LxMVp7zWramXsJQAKdamxy6TAWlaDD'; +const snapName = 'signal-desktop'; const snapRating = Rating( snapId: snapId, totalVotes: 123, ratingsBand: RatingsBand.good, + snapName: snapName, ); final snap = createSnap( diff --git a/packages/app_center/test/games_page_test.dart b/packages/app_center/test/games_page_test.dart index 40fe95508..16d133e24 100644 --- a/packages/app_center/test/games_page_test.dart +++ b/packages/app_center/test/games_page_test.dart @@ -11,10 +11,12 @@ import 'package:ubuntu_service/ubuntu_service.dart'; import 'test_utils.dart'; const snapId = 'r4LxMVp7zWramXsJQAKdamxy6TAWlaDD'; +const snapName = 'signal-desktop'; const snapRating = Rating( snapId: snapId, totalVotes: 123, ratingsBand: RatingsBand.good, + snapName: snapName, ); void main() { diff --git a/packages/app_center/test/ratings_model_test.dart b/packages/app_center/test/ratings_model_test.dart index e51d6ca40..9a994ba28 100644 --- a/packages/app_center/test/ratings_model_test.dart +++ b/packages/app_center/test/ratings_model_test.dart @@ -10,7 +10,7 @@ import 'test_utils.dart'; void main() { final snap = createSnap( name: 'firefox', - id: 'firefox', + id: '1234', revision: 42, ); @@ -18,16 +18,18 @@ void main() { registerMockSnapdService(storeSnap: snap); registerMockRatingsService( rating: const Rating( - snapId: 'firefox', + snapId: '1234', totalVotes: 1337, ratingsBand: RatingsBand.veryGood, + snapName: 'firefox', ), snapVotes: [ Vote( - snapId: 'firefox', + snapId: '1234', snapRevision: 42, voteUp: true, dateTime: DateTime(1970), + snapName: 'firefox', ), ], ); @@ -43,9 +45,10 @@ void main() { ratingsData.rating, equals( const Rating( - snapId: 'firefox', + snapId: '1234', totalVotes: 1337, ratingsBand: RatingsBand.veryGood, + snapName: 'firefox', ), ), ); @@ -66,9 +69,10 @@ void main() { mockService.vote( Vote( dateTime: DateTime(1984), - snapId: 'firefox', + snapId: '1234', snapRevision: 42, voteUp: false, + snapName: 'firefox', ), ), ).called(1); diff --git a/packages/app_center/test/ratings_service_test.dart b/packages/app_center/test/ratings_service_test.dart index 1db0db1e3..37dc57a01 100644 --- a/packages/app_center/test/ratings_service_test.dart +++ b/packages/app_center/test/ratings_service_test.dart @@ -11,9 +11,10 @@ void main() { final mockClient = createMockRatingsClient( token: 'jwt', rating: const Rating( - snapId: 'firefox', + snapId: '1234', totalVotes: 1337, ratingsBand: RatingsBand.veryGood, + snapName: 'firefox', ), ); final service = RatingsService(mockClient, id: 'myId'); @@ -24,9 +25,10 @@ void main() { rating, equals( const Rating( - snapId: 'firefox', + snapId: '1234', totalVotes: 1337, ratingsBand: RatingsBand.veryGood, + snapName: 'firefox', ), ), ); @@ -39,17 +41,19 @@ void main() { ChartData( rawRating: 117, rating: Rating( - snapId: 'john', + snapId: '4321', totalVotes: 117, ratingsBand: RatingsBand.veryGood, + snapName: 'john', ), ), ChartData( rawRating: 104, rating: Rating( - snapId: 'fred', + snapId: '5678', totalVotes: 104, ratingsBand: RatingsBand.veryGood, + snapName: 'fred', ), ), ], @@ -64,17 +68,19 @@ void main() { const ChartData( rawRating: 117, rating: Rating( - snapId: 'john', + snapId: '4321', totalVotes: 117, ratingsBand: RatingsBand.veryGood, + snapName: 'john', ), ), const ChartData( rawRating: 104, rating: Rating( - snapId: 'fred', + snapId: '5678', totalVotes: 104, ratingsBand: RatingsBand.veryGood, + snapName: 'fred', ), ), ]), @@ -87,14 +93,15 @@ void main() { await service.vote( Vote( - snapId: 'thunderbird', + snapId: '7890', snapRevision: 42, voteUp: true, dateTime: DateTime(1970), + snapName: 'thunderbird', ), ); verify(mockClient.authenticate('myId')).called(1); - verify(mockClient.vote('thunderbird', 42, true, 'jwt')).called(1); + verify(mockClient.vote('7890', 42, true, 'jwt')).called(1); }); test('delete', () async { @@ -106,62 +113,33 @@ void main() { verify(mockClient.delete('jwt')).called(1); }); - test('list my votes', () async { - final mockClient = createMockRatingsClient( - token: 'jwt', - myVotes: [ - Vote( - snapId: 'testsnap', - snapRevision: 1, - voteUp: false, - dateTime: DateTime(1984), - ), - ], - ); - final service = RatingsService(mockClient, id: 'myId'); - - final votes = await service.listMyVotes('testsnap'); - verify(mockClient.authenticate('myId')).called(1); - expect( - votes, - equals( - [ - Vote( - snapId: 'testsnap', - snapRevision: 1, - voteUp: false, - dateTime: DateTime(1984), - ), - ], - ), - ); - }); - test('snap votes', () async { final mockClient = createMockRatingsClient( token: 'jwt', snapVotes: [ Vote( - snapId: 'testsnap2', + snapId: '1111', snapRevision: 2, voteUp: true, dateTime: DateTime(1999), + snapName: 'testSnap2', ), ], ); final service = RatingsService(mockClient, id: 'myId'); - final votes = await service.getSnapVotes('testsnap2'); + final votes = await service.getSnapVotes('testSnap2'); verify(mockClient.authenticate('myId')).called(1); expect( votes, equals( [ Vote( - snapId: 'testsnap2', + snapId: '1111', snapRevision: 2, voteUp: true, dateTime: DateTime(1999), + snapName: 'testSnap2', ), ], ), diff --git a/packages/app_center/test/search_page_test.dart b/packages/app_center/test/search_page_test.dart index 175b6f761..363d41ffa 100644 --- a/packages/app_center/test/search_page_test.dart +++ b/packages/app_center/test/search_page_test.dart @@ -14,10 +14,12 @@ import 'test_utils.dart'; import 'test_utils.mocks.dart'; const snapId = 'r4LxMVp7zWramXsJQAKdamxy6TAWlaDD'; +const snapName = 'signal-desktop'; const snapRating = Rating( snapId: snapId, totalVotes: 123, ratingsBand: RatingsBand.good, + snapName: snapName, ); void main() { diff --git a/packages/app_center/test/snap_page_test.dart b/packages/app_center/test/snap_page_test.dart index 55ccb470f..bf1d5d8e5 100644 --- a/packages/app_center/test/snap_page_test.dart +++ b/packages/app_center/test/snap_page_test.dart @@ -17,10 +17,12 @@ import 'test_utils.dart'; import 'test_utils.mocks.dart'; const snapId = 'r4LxMVp7zWramXsJQAKdamxy6TAWlaDD'; +const snapName = 'signal-desktop'; const snapRating = Rating( snapId: snapId, totalVotes: 123, ratingsBand: RatingsBand.good, + snapName: snapName, ); final localSnap = createSnap( diff --git a/packages/app_center/test/test_utils.dart b/packages/app_center/test/test_utils.dart index 4bdb409dc..0c2c2e1f7 100644 --- a/packages/app_center/test/test_utils.dart +++ b/packages/app_center/test/test_utils.dart @@ -304,6 +304,7 @@ MockRatingsService registerMockRatingsService({ snapId: '', totalVotes: 0, ratingsBand: RatingsBand.insufficientVotes, + snapName: '', ), ); when(service.getSnapVotes(any)).thenAnswer((_) async => snapVotes ?? []); @@ -316,7 +317,6 @@ MockRatingsService registerMockRatingsService({ MockRatingsClient createMockRatingsClient({ String? token, Rating? rating, - List? myVotes, List? snapVotes, List? chartData, }) { @@ -329,9 +329,9 @@ MockRatingsClient createMockRatingsClient({ snapId: '', totalVotes: 0, ratingsBand: RatingsBand.insufficientVotes, + snapName: '', ), ); - when(client.listMyVotes(any, any)).thenAnswer((_) async => myVotes ?? []); when(client.getSnapVotes(any, any)).thenAnswer((_) async => snapVotes ?? []); when(client.getChart(any, any, any)).thenAnswer((_) async => chartData ?? []); return client; diff --git a/packages/app_center_ratings_client/lib/src/chart.freezed.dart b/packages/app_center_ratings_client/lib/src/chart.freezed.dart deleted file mode 100644 index 5db1e2b60..000000000 --- a/packages/app_center_ratings_client/lib/src/chart.freezed.dart +++ /dev/null @@ -1,176 +0,0 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: type=lint -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark - -part of 'chart.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -T _$identity(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -/// @nodoc -mixin _$ChartData { - double get rawRating => throw _privateConstructorUsedError; - Rating get rating => throw _privateConstructorUsedError; - - /// Create a copy of ChartData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ChartDataCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $ChartDataCopyWith<$Res> { - factory $ChartDataCopyWith(ChartData value, $Res Function(ChartData) then) = - _$ChartDataCopyWithImpl<$Res, ChartData>; - @useResult - $Res call({double rawRating, Rating rating}); - - $RatingCopyWith<$Res> get rating; -} - -/// @nodoc -class _$ChartDataCopyWithImpl<$Res, $Val extends ChartData> - implements $ChartDataCopyWith<$Res> { - _$ChartDataCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ChartData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? rawRating = null, - Object? rating = null, - }) { - return _then(_value.copyWith( - rawRating: null == rawRating - ? _value.rawRating - : rawRating // ignore: cast_nullable_to_non_nullable - as double, - rating: null == rating - ? _value.rating - : rating // ignore: cast_nullable_to_non_nullable - as Rating, - ) as $Val); - } - - /// Create a copy of ChartData - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $RatingCopyWith<$Res> get rating { - return $RatingCopyWith<$Res>(_value.rating, (value) { - return _then(_value.copyWith(rating: value) as $Val); - }); - } -} - -/// @nodoc -abstract class _$$ChartDataImplCopyWith<$Res> - implements $ChartDataCopyWith<$Res> { - factory _$$ChartDataImplCopyWith( - _$ChartDataImpl value, $Res Function(_$ChartDataImpl) then) = - __$$ChartDataImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({double rawRating, Rating rating}); - - @override - $RatingCopyWith<$Res> get rating; -} - -/// @nodoc -class __$$ChartDataImplCopyWithImpl<$Res> - extends _$ChartDataCopyWithImpl<$Res, _$ChartDataImpl> - implements _$$ChartDataImplCopyWith<$Res> { - __$$ChartDataImplCopyWithImpl( - _$ChartDataImpl _value, $Res Function(_$ChartDataImpl) _then) - : super(_value, _then); - - /// Create a copy of ChartData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? rawRating = null, - Object? rating = null, - }) { - return _then(_$ChartDataImpl( - rawRating: null == rawRating - ? _value.rawRating - : rawRating // ignore: cast_nullable_to_non_nullable - as double, - rating: null == rating - ? _value.rating - : rating // ignore: cast_nullable_to_non_nullable - as Rating, - )); - } -} - -/// @nodoc - -class _$ChartDataImpl implements _ChartData { - const _$ChartDataImpl({required this.rawRating, required this.rating}); - - @override - final double rawRating; - @override - final Rating rating; - - @override - String toString() { - return 'ChartData(rawRating: $rawRating, rating: $rating)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ChartDataImpl && - (identical(other.rawRating, rawRating) || - other.rawRating == rawRating) && - (identical(other.rating, rating) || other.rating == rating)); - } - - @override - int get hashCode => Object.hash(runtimeType, rawRating, rating); - - /// Create a copy of ChartData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ChartDataImplCopyWith<_$ChartDataImpl> get copyWith => - __$$ChartDataImplCopyWithImpl<_$ChartDataImpl>(this, _$identity); -} - -abstract class _ChartData implements ChartData { - const factory _ChartData( - {required final double rawRating, - required final Rating rating}) = _$ChartDataImpl; - - @override - double get rawRating; - @override - Rating get rating; - - /// Create a copy of ChartData - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChartDataImplCopyWith<_$ChartDataImpl> get copyWith => - throw _privateConstructorUsedError; -} diff --git a/packages/app_center_ratings_client/lib/src/generated/google/protobuf/empty.pb.dart b/packages/app_center_ratings_client/lib/src/generated/google/protobuf/empty.pb.dart index 2701c1874..05ae77c7c 100644 --- a/packages/app_center_ratings_client/lib/src/generated/google/protobuf/empty.pb.dart +++ b/packages/app_center_ratings_client/lib/src/generated/google/protobuf/empty.pb.dart @@ -20,34 +20,26 @@ import 'package:protobuf/protobuf.dart' as $pb; /// service Foo { /// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); /// } -/// -/// The JSON representation for `Empty` is empty JSON object `{}`. class Empty extends $pb.GeneratedMessage { factory Empty() => create(); Empty._() : super(); - factory Empty.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory Empty.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); + factory Empty.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory Empty.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - _omitMessageNames ? '' : 'Empty', - package: - const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'), - createEmptyInstance: create) - ..hasRequiredFields = false; + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'Empty', package: const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'), createEmptyInstance: create) + ..hasRequiredFields = false + ; - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') Empty clone() => Empty()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - Empty copyWith(void Function(Empty) updates) => - super.copyWith((message) => updates(message as Empty)) as Empty; + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Empty copyWith(void Function(Empty) updates) => super.copyWith((message) => updates(message as Empty)) as Empty; $pb.BuilderInfo get info_ => _i; @@ -56,10 +48,9 @@ class Empty extends $pb.GeneratedMessage { Empty createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') - static Empty getDefault() => - _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static Empty getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static Empty? _defaultInstance; } -const _omitMessageNames = - $core.bool.fromEnvironment('protobuf.omit_message_names'); + +const _omitMessageNames = $core.bool.fromEnvironment('protobuf.omit_message_names'); diff --git a/packages/app_center_ratings_client/lib/src/generated/google/protobuf/empty.pbenum.dart b/packages/app_center_ratings_client/lib/src/generated/google/protobuf/empty.pbenum.dart index 2f2a76136..510bac1d0 100644 --- a/packages/app_center_ratings_client/lib/src/generated/google/protobuf/empty.pbenum.dart +++ b/packages/app_center_ratings_client/lib/src/generated/google/protobuf/empty.pbenum.dart @@ -8,3 +8,4 @@ // ignore_for_file: constant_identifier_names, library_prefixes // ignore_for_file: non_constant_identifier_names, prefer_final_fields // ignore_for_file: unnecessary_import, unnecessary_this, unused_import + diff --git a/packages/app_center_ratings_client/lib/src/generated/google/protobuf/empty.pbjson.dart b/packages/app_center_ratings_client/lib/src/generated/google/protobuf/empty.pbjson.dart index 35f6e2eca..c7245b67b 100644 --- a/packages/app_center_ratings_client/lib/src/generated/google/protobuf/empty.pbjson.dart +++ b/packages/app_center_ratings_client/lib/src/generated/google/protobuf/empty.pbjson.dart @@ -19,5 +19,6 @@ const Empty$json = { }; /// Descriptor for `Empty`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List emptyDescriptor = - $convert.base64Decode('CgVFbXB0eQ=='); +final $typed_data.Uint8List emptyDescriptor = $convert.base64Decode( + 'CgVFbXB0eQ=='); + diff --git a/packages/app_center_ratings_client/lib/src/generated/google/protobuf/timestamp.pb.dart b/packages/app_center_ratings_client/lib/src/generated/google/protobuf/timestamp.pb.dart index 99ba83a78..85f80767a 100644 --- a/packages/app_center_ratings_client/lib/src/generated/google/protobuf/timestamp.pb.dart +++ b/packages/app_center_ratings_client/lib/src/generated/google/protobuf/timestamp.pb.dart @@ -121,33 +121,25 @@ class Timestamp extends $pb.GeneratedMessage with $mixin.TimestampMixin { return $result; } Timestamp._() : super(); - factory Timestamp.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory Timestamp.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); + factory Timestamp.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory Timestamp.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - _omitMessageNames ? '' : 'Timestamp', - package: - const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'), - createEmptyInstance: create, - toProto3Json: $mixin.TimestampMixin.toProto3JsonHelper, - fromProto3Json: $mixin.TimestampMixin.fromProto3JsonHelper) + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'Timestamp', package: const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'), createEmptyInstance: create, toProto3Json: $mixin.TimestampMixin.toProto3JsonHelper, fromProto3Json: $mixin.TimestampMixin.fromProto3JsonHelper) ..aInt64(1, _omitFieldNames ? '' : 'seconds') ..a<$core.int>(2, _omitFieldNames ? '' : 'nanos', $pb.PbFieldType.O3) - ..hasRequiredFields = false; + ..hasRequiredFields = false + ; - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') Timestamp clone() => Timestamp()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - Timestamp copyWith(void Function(Timestamp) updates) => - super.copyWith((message) => updates(message as Timestamp)) as Timestamp; + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Timestamp copyWith(void Function(Timestamp) updates) => super.copyWith((message) => updates(message as Timestamp)) as Timestamp; $pb.BuilderInfo get info_ => _i; @@ -156,8 +148,7 @@ class Timestamp extends $pb.GeneratedMessage with $mixin.TimestampMixin { Timestamp createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') - static Timestamp getDefault() => - _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static Timestamp getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static Timestamp? _defaultInstance; /// Represents seconds of UTC time since Unix epoch @@ -166,10 +157,7 @@ class Timestamp extends $pb.GeneratedMessage with $mixin.TimestampMixin { @$pb.TagNumber(1) $fixnum.Int64 get seconds => $_getI64(0); @$pb.TagNumber(1) - set seconds($fixnum.Int64 v) { - $_setInt64(0, v); - } - + set seconds($fixnum.Int64 v) { $_setInt64(0, v); } @$pb.TagNumber(1) $core.bool hasSeconds() => $_has(0); @$pb.TagNumber(1) @@ -182,15 +170,11 @@ class Timestamp extends $pb.GeneratedMessage with $mixin.TimestampMixin { @$pb.TagNumber(2) $core.int get nanos => $_getIZ(1); @$pb.TagNumber(2) - set nanos($core.int v) { - $_setSignedInt32(1, v); - } - + set nanos($core.int v) { $_setSignedInt32(1, v); } @$pb.TagNumber(2) $core.bool hasNanos() => $_has(1); @$pb.TagNumber(2) void clearNanos() => clearField(2); - /// Creates a new instance from [dateTime]. /// /// Time zone information will not be preserved. @@ -201,6 +185,6 @@ class Timestamp extends $pb.GeneratedMessage with $mixin.TimestampMixin { } } + const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names'); -const _omitMessageNames = - $core.bool.fromEnvironment('protobuf.omit_message_names'); +const _omitMessageNames = $core.bool.fromEnvironment('protobuf.omit_message_names'); diff --git a/packages/app_center_ratings_client/lib/src/generated/google/protobuf/timestamp.pbenum.dart b/packages/app_center_ratings_client/lib/src/generated/google/protobuf/timestamp.pbenum.dart index a194b8050..30275f6a8 100644 --- a/packages/app_center_ratings_client/lib/src/generated/google/protobuf/timestamp.pbenum.dart +++ b/packages/app_center_ratings_client/lib/src/generated/google/protobuf/timestamp.pbenum.dart @@ -8,3 +8,4 @@ // ignore_for_file: constant_identifier_names, library_prefixes // ignore_for_file: non_constant_identifier_names, prefer_final_fields // ignore_for_file: unnecessary_import, unnecessary_this, unused_import + diff --git a/packages/app_center_ratings_client/lib/src/generated/google/protobuf/timestamp.pbjson.dart b/packages/app_center_ratings_client/lib/src/generated/google/protobuf/timestamp.pbjson.dart index 39ab20fad..3dfd63b54 100644 --- a/packages/app_center_ratings_client/lib/src/generated/google/protobuf/timestamp.pbjson.dart +++ b/packages/app_center_ratings_client/lib/src/generated/google/protobuf/timestamp.pbjson.dart @@ -26,3 +26,4 @@ const Timestamp$json = { final $typed_data.Uint8List timestampDescriptor = $convert.base64Decode( 'CglUaW1lc3RhbXASGAoHc2Vjb25kcxgBIAEoA1IHc2Vjb25kcxIUCgVuYW5vcxgCIAEoBVIFbm' 'Fub3M='); + diff --git a/packages/app_center_ratings_client/lib/src/generated/ratings_features_app.pb.dart b/packages/app_center_ratings_client/lib/src/generated/ratings_features_app.pb.dart index 6ea544c2b..6f60f4d79 100644 --- a/packages/app_center_ratings_client/lib/src/generated/ratings_features_app.pb.dart +++ b/packages/app_center_ratings_client/lib/src/generated/ratings_features_app.pb.dart @@ -13,7 +13,7 @@ import 'dart:core' as $core; import 'package:protobuf/protobuf.dart' as $pb; -import 'ratings_features_common.pb.dart' as $1; +import 'ratings_features_common.pb.dart' as $4; class GetRatingRequest extends $pb.GeneratedMessage { factory GetRatingRequest({ @@ -26,51 +26,39 @@ class GetRatingRequest extends $pb.GeneratedMessage { return $result; } GetRatingRequest._() : super(); - factory GetRatingRequest.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory GetRatingRequest.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - _omitMessageNames ? '' : 'GetRatingRequest', - package: const $pb.PackageName( - _omitMessageNames ? '' : 'ratings.features.app'), - createEmptyInstance: create) + factory GetRatingRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory GetRatingRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'GetRatingRequest', package: const $pb.PackageName(_omitMessageNames ? '' : 'ratings.features.app'), createEmptyInstance: create) ..aOS(1, _omitFieldNames ? '' : 'snapId') - ..hasRequiredFields = false; + ..hasRequiredFields = false + ; - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') GetRatingRequest clone() => GetRatingRequest()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - GetRatingRequest copyWith(void Function(GetRatingRequest) updates) => - super.copyWith((message) => updates(message as GetRatingRequest)) - as GetRatingRequest; + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + GetRatingRequest copyWith(void Function(GetRatingRequest) updates) => super.copyWith((message) => updates(message as GetRatingRequest)) as GetRatingRequest; $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static GetRatingRequest create() => GetRatingRequest._(); GetRatingRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); + static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') - static GetRatingRequest getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); + static GetRatingRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static GetRatingRequest? _defaultInstance; @$pb.TagNumber(1) $core.String get snapId => $_getSZ(0); @$pb.TagNumber(1) - set snapId($core.String v) { - $_setString(0, v); - } - + set snapId($core.String v) { $_setString(0, v); } @$pb.TagNumber(1) $core.bool hasSnapId() => $_has(0); @$pb.TagNumber(1) @@ -79,7 +67,7 @@ class GetRatingRequest extends $pb.GeneratedMessage { class GetRatingResponse extends $pb.GeneratedMessage { factory GetRatingResponse({ - $1.Rating? rating, + $4.Rating? rating, }) { final $result = create(); if (rating != null) { @@ -88,60 +76,47 @@ class GetRatingResponse extends $pb.GeneratedMessage { return $result; } GetRatingResponse._() : super(); - factory GetRatingResponse.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory GetRatingResponse.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - _omitMessageNames ? '' : 'GetRatingResponse', - package: const $pb.PackageName( - _omitMessageNames ? '' : 'ratings.features.app'), - createEmptyInstance: create) - ..aOM<$1.Rating>(1, _omitFieldNames ? '' : 'rating', - subBuilder: $1.Rating.create) - ..hasRequiredFields = false; - - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') + factory GetRatingResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory GetRatingResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'GetRatingResponse', package: const $pb.PackageName(_omitMessageNames ? '' : 'ratings.features.app'), createEmptyInstance: create) + ..aOM<$4.Rating>(1, _omitFieldNames ? '' : 'rating', subBuilder: $4.Rating.create) + ..hasRequiredFields = false + ; + + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') GetRatingResponse clone() => GetRatingResponse()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - GetRatingResponse copyWith(void Function(GetRatingResponse) updates) => - super.copyWith((message) => updates(message as GetRatingResponse)) - as GetRatingResponse; + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + GetRatingResponse copyWith(void Function(GetRatingResponse) updates) => super.copyWith((message) => updates(message as GetRatingResponse)) as GetRatingResponse; $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static GetRatingResponse create() => GetRatingResponse._(); GetRatingResponse createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); + static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') - static GetRatingResponse getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); + static GetRatingResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static GetRatingResponse? _defaultInstance; @$pb.TagNumber(1) - $1.Rating get rating => $_getN(0); + $4.Rating get rating => $_getN(0); @$pb.TagNumber(1) - set rating($1.Rating v) { - setField(1, v); - } - + set rating($4.Rating v) { setField(1, v); } @$pb.TagNumber(1) $core.bool hasRating() => $_has(0); @$pb.TagNumber(1) void clearRating() => clearField(1); @$pb.TagNumber(1) - $1.Rating ensureRating() => $_ensure(0); + $4.Rating ensureRating() => $_ensure(0); } + const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names'); -const _omitMessageNames = - $core.bool.fromEnvironment('protobuf.omit_message_names'); +const _omitMessageNames = $core.bool.fromEnvironment('protobuf.omit_message_names'); diff --git a/packages/app_center_ratings_client/lib/src/generated/ratings_features_app.pbenum.dart b/packages/app_center_ratings_client/lib/src/generated/ratings_features_app.pbenum.dart new file mode 100644 index 000000000..a1f69ff8e --- /dev/null +++ b/packages/app_center_ratings_client/lib/src/generated/ratings_features_app.pbenum.dart @@ -0,0 +1,11 @@ +// +// Generated code. Do not modify. +// source: ratings_features_app.proto +// +// @dart = 2.12 + +// ignore_for_file: annotate_overrides, camel_case_types, comment_references +// ignore_for_file: constant_identifier_names, library_prefixes +// ignore_for_file: non_constant_identifier_names, prefer_final_fields +// ignore_for_file: unnecessary_import, unnecessary_this, unused_import + diff --git a/packages/app_center_ratings_client/lib/src/generated/ratings_features_app.pbgrpc.dart b/packages/app_center_ratings_client/lib/src/generated/ratings_features_app.pbgrpc.dart index e9c187c60..3046f2418 100644 --- a/packages/app_center_ratings_client/lib/src/generated/ratings_features_app.pbgrpc.dart +++ b/packages/app_center_ratings_client/lib/src/generated/ratings_features_app.pbgrpc.dart @@ -12,50 +12,48 @@ import 'dart:async' as $async; import 'dart:core' as $core; -import 'package:app_center_ratings_client/src/generated/ratings_features_app.pb.dart' - as $0; import 'package:grpc/service_api.dart' as $grpc; import 'package:protobuf/protobuf.dart' as $pb; +import 'ratings_features_app.pb.dart' as $0; + export 'ratings_features_app.pb.dart'; @$pb.GrpcServiceName('ratings.features.app.App') class AppClient extends $grpc.Client { + static final _$getRating = $grpc.ClientMethod<$0.GetRatingRequest, $0.GetRatingResponse>( + '/ratings.features.app.App/GetRating', + ($0.GetRatingRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => $0.GetRatingResponse.fromBuffer(value)); + AppClient($grpc.ClientChannel channel, {$grpc.CallOptions? options, $core.Iterable<$grpc.ClientInterceptor>? interceptors}) - : super(channel, options: options, interceptors: interceptors); - static final _$getRating = - $grpc.ClientMethod<$0.GetRatingRequest, $0.GetRatingResponse>( - '/ratings.features.app.App/GetRating', - (value) => value.writeToBuffer(), - (value) => $0.GetRatingResponse.fromBuffer(value)); - - $grpc.ResponseFuture<$0.GetRatingResponse> getRating( - $0.GetRatingRequest request, - {$grpc.CallOptions? options}) { + : super(channel, options: options, + interceptors: interceptors); + + $grpc.ResponseFuture<$0.GetRatingResponse> getRating($0.GetRatingRequest request, {$grpc.CallOptions? options}) { return $createUnaryCall(_$getRating, request, options: options); } } @$pb.GrpcServiceName('ratings.features.app.App') abstract class AppServiceBase extends $grpc.Service { + $core.String get $name => 'ratings.features.app.App'; + AppServiceBase() { $addMethod($grpc.ServiceMethod<$0.GetRatingRequest, $0.GetRatingResponse>( 'GetRating', getRating_Pre, false, false, - (value) => $0.GetRatingRequest.fromBuffer(value), - (value) => value.writeToBuffer())); + ($core.List<$core.int> value) => $0.GetRatingRequest.fromBuffer(value), + ($0.GetRatingResponse value) => value.writeToBuffer())); } - $core.String get $name => 'ratings.features.app.App'; - $async.Future<$0.GetRatingResponse> getRating_Pre($grpc.ServiceCall call, - $async.Future<$0.GetRatingRequest> request) async { + $async.Future<$0.GetRatingResponse> getRating_Pre($grpc.ServiceCall call, $async.Future<$0.GetRatingRequest> request) async { return getRating(call, await request); } - $async.Future<$0.GetRatingResponse> getRating( - $grpc.ServiceCall call, $0.GetRatingRequest request); + $async.Future<$0.GetRatingResponse> getRating($grpc.ServiceCall call, $0.GetRatingRequest request); } diff --git a/packages/app_center_ratings_client/lib/src/generated/ratings_features_app.pbjson.dart b/packages/app_center_ratings_client/lib/src/generated/ratings_features_app.pbjson.dart index 62661ec17..f2029a358 100644 --- a/packages/app_center_ratings_client/lib/src/generated/ratings_features_app.pbjson.dart +++ b/packages/app_center_ratings_client/lib/src/generated/ratings_features_app.pbjson.dart @@ -29,14 +29,7 @@ final $typed_data.Uint8List getRatingRequestDescriptor = $convert.base64Decode( const GetRatingResponse$json = { '1': 'GetRatingResponse', '2': [ - { - '1': 'rating', - '3': 1, - '4': 1, - '5': 11, - '6': '.ratings.features.common.Rating', - '10': 'rating' - }, + {'1': 'rating', '3': 1, '4': 1, '5': 11, '6': '.ratings.features.common.Rating', '10': 'rating'}, ], }; @@ -44,3 +37,4 @@ const GetRatingResponse$json = { final $typed_data.Uint8List getRatingResponseDescriptor = $convert.base64Decode( 'ChFHZXRSYXRpbmdSZXNwb25zZRI3CgZyYXRpbmcYASABKAsyHy5yYXRpbmdzLmZlYXR1cmVzLm' 'NvbW1vbi5SYXRpbmdSBnJhdGluZw=='); + diff --git a/packages/app_center_ratings_client/lib/src/generated/ratings_features_chart.pb.dart b/packages/app_center_ratings_client/lib/src/generated/ratings_features_chart.pb.dart index d558fb93c..7051de259 100644 --- a/packages/app_center_ratings_client/lib/src/generated/ratings_features_chart.pb.dart +++ b/packages/app_center_ratings_client/lib/src/generated/ratings_features_chart.pb.dart @@ -14,7 +14,7 @@ import 'dart:core' as $core; import 'package:protobuf/protobuf.dart' as $pb; import 'ratings_features_chart.pbenum.dart'; -import 'ratings_features_common.pb.dart' as $1; +import 'ratings_features_common.pb.dart' as $4; export 'ratings_features_chart.pbenum.dart'; @@ -157,7 +157,7 @@ class GetChartResponse extends $pb.GeneratedMessage { class ChartData extends $pb.GeneratedMessage { factory ChartData({ $core.double? rawRating, - $1.Rating? rating, + $4.Rating? rating, }) { final $result = create(); if (rawRating != null) { @@ -174,7 +174,7 @@ class ChartData extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'ChartData', package: const $pb.PackageName(_omitMessageNames ? '' : 'ratings.features.chart'), createEmptyInstance: create) ..a<$core.double>(1, _omitFieldNames ? '' : 'rawRating', $pb.PbFieldType.OF) - ..aOM<$1.Rating>(2, _omitFieldNames ? '' : 'rating', subBuilder: $1.Rating.create) + ..aOM<$4.Rating>(2, _omitFieldNames ? '' : 'rating', subBuilder: $4.Rating.create) ..hasRequiredFields = false ; @@ -209,15 +209,15 @@ class ChartData extends $pb.GeneratedMessage { void clearRawRating() => clearField(1); @$pb.TagNumber(2) - $1.Rating get rating => $_getN(1); + $4.Rating get rating => $_getN(1); @$pb.TagNumber(2) - set rating($1.Rating v) { setField(2, v); } + set rating($4.Rating v) { setField(2, v); } @$pb.TagNumber(2) $core.bool hasRating() => $_has(1); @$pb.TagNumber(2) void clearRating() => clearField(2); @$pb.TagNumber(2) - $1.Rating ensureRating() => $_ensure(1); + $4.Rating ensureRating() => $_ensure(1); } diff --git a/packages/app_center_ratings_client/lib/src/generated/ratings_features_chart.pbgrpc.dart b/packages/app_center_ratings_client/lib/src/generated/ratings_features_chart.pbgrpc.dart index d49f05ff2..a3f578e7a 100644 --- a/packages/app_center_ratings_client/lib/src/generated/ratings_features_chart.pbgrpc.dart +++ b/packages/app_center_ratings_client/lib/src/generated/ratings_features_chart.pbgrpc.dart @@ -15,16 +15,16 @@ import 'dart:core' as $core; import 'package:grpc/service_api.dart' as $grpc; import 'package:protobuf/protobuf.dart' as $pb; -import 'ratings_features_chart.pb.dart' as $0; +import 'ratings_features_chart.pb.dart' as $1; export 'ratings_features_chart.pb.dart'; @$pb.GrpcServiceName('ratings.features.chart.Chart') class ChartClient extends $grpc.Client { - static final _$getChart = $grpc.ClientMethod<$0.GetChartRequest, $0.GetChartResponse>( + static final _$getChart = $grpc.ClientMethod<$1.GetChartRequest, $1.GetChartResponse>( '/ratings.features.chart.Chart/GetChart', - ($0.GetChartRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.GetChartResponse.fromBuffer(value)); + ($1.GetChartRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => $1.GetChartResponse.fromBuffer(value)); ChartClient($grpc.ClientChannel channel, {$grpc.CallOptions? options, @@ -32,7 +32,7 @@ class ChartClient extends $grpc.Client { : super(channel, options: options, interceptors: interceptors); - $grpc.ResponseFuture<$0.GetChartResponse> getChart($0.GetChartRequest request, {$grpc.CallOptions? options}) { + $grpc.ResponseFuture<$1.GetChartResponse> getChart($1.GetChartRequest request, {$grpc.CallOptions? options}) { return $createUnaryCall(_$getChart, request, options: options); } } @@ -42,18 +42,18 @@ abstract class ChartServiceBase extends $grpc.Service { $core.String get $name => 'ratings.features.chart.Chart'; ChartServiceBase() { - $addMethod($grpc.ServiceMethod<$0.GetChartRequest, $0.GetChartResponse>( + $addMethod($grpc.ServiceMethod<$1.GetChartRequest, $1.GetChartResponse>( 'GetChart', getChart_Pre, false, false, - ($core.List<$core.int> value) => $0.GetChartRequest.fromBuffer(value), - ($0.GetChartResponse value) => value.writeToBuffer())); + ($core.List<$core.int> value) => $1.GetChartRequest.fromBuffer(value), + ($1.GetChartResponse value) => value.writeToBuffer())); } - $async.Future<$0.GetChartResponse> getChart_Pre($grpc.ServiceCall call, $async.Future<$0.GetChartRequest> request) async { + $async.Future<$1.GetChartResponse> getChart_Pre($grpc.ServiceCall call, $async.Future<$1.GetChartRequest> request) async { return getChart(call, await request); } - $async.Future<$0.GetChartResponse> getChart($grpc.ServiceCall call, $0.GetChartRequest request); + $async.Future<$1.GetChartResponse> getChart($grpc.ServiceCall call, $1.GetChartRequest request); } diff --git a/packages/app_center_ratings_client/lib/src/generated/ratings_features_common.pb.dart b/packages/app_center_ratings_client/lib/src/generated/ratings_features_common.pb.dart index a980ba0b8..31df7187c 100644 --- a/packages/app_center_ratings_client/lib/src/generated/ratings_features_common.pb.dart +++ b/packages/app_center_ratings_client/lib/src/generated/ratings_features_common.pb.dart @@ -23,6 +23,7 @@ class Rating extends $pb.GeneratedMessage { $core.String? snapId, $fixnum.Int64? totalVotes, RatingsBand? ratingsBand, + $core.String? snapName, }) { final $result = create(); if (snapId != null) { @@ -34,41 +35,33 @@ class Rating extends $pb.GeneratedMessage { if (ratingsBand != null) { $result.ratingsBand = ratingsBand; } + if (snapName != null) { + $result.snapName = snapName; + } return $result; } Rating._() : super(); - factory Rating.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory Rating.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - _omitMessageNames ? '' : 'Rating', - package: const $pb.PackageName( - _omitMessageNames ? '' : 'ratings.features.common'), - createEmptyInstance: create) + factory Rating.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory Rating.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'Rating', package: const $pb.PackageName(_omitMessageNames ? '' : 'ratings.features.common'), createEmptyInstance: create) ..aOS(1, _omitFieldNames ? '' : 'snapId') - ..a<$fixnum.Int64>( - 2, _omitFieldNames ? '' : 'totalVotes', $pb.PbFieldType.OU6, - defaultOrMaker: $fixnum.Int64.ZERO) - ..e( - 3, _omitFieldNames ? '' : 'ratingsBand', $pb.PbFieldType.OE, - defaultOrMaker: RatingsBand.VERY_GOOD, - valueOf: RatingsBand.valueOf, - enumValues: RatingsBand.values) - ..hasRequiredFields = false; - - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') + ..a<$fixnum.Int64>(2, _omitFieldNames ? '' : 'totalVotes', $pb.PbFieldType.OU6, defaultOrMaker: $fixnum.Int64.ZERO) + ..e(3, _omitFieldNames ? '' : 'ratingsBand', $pb.PbFieldType.OE, defaultOrMaker: RatingsBand.VERY_GOOD, valueOf: RatingsBand.valueOf, enumValues: RatingsBand.values) + ..aOS(4, _omitFieldNames ? '' : 'snapName') + ..hasRequiredFields = false + ; + + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') Rating clone() => Rating()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - Rating copyWith(void Function(Rating) updates) => - super.copyWith((message) => updates(message as Rating)) as Rating; + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Rating copyWith(void Function(Rating) updates) => super.copyWith((message) => updates(message as Rating)) as Rating; $pb.BuilderInfo get info_ => _i; @@ -77,17 +70,13 @@ class Rating extends $pb.GeneratedMessage { Rating createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') - static Rating getDefault() => - _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static Rating getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static Rating? _defaultInstance; @$pb.TagNumber(1) $core.String get snapId => $_getSZ(0); @$pb.TagNumber(1) - set snapId($core.String v) { - $_setString(0, v); - } - + set snapId($core.String v) { $_setString(0, v); } @$pb.TagNumber(1) $core.bool hasSnapId() => $_has(0); @$pb.TagNumber(1) @@ -96,10 +85,7 @@ class Rating extends $pb.GeneratedMessage { @$pb.TagNumber(2) $fixnum.Int64 get totalVotes => $_getI64(1); @$pb.TagNumber(2) - set totalVotes($fixnum.Int64 v) { - $_setInt64(1, v); - } - + set totalVotes($fixnum.Int64 v) { $_setInt64(1, v); } @$pb.TagNumber(2) $core.bool hasTotalVotes() => $_has(1); @$pb.TagNumber(2) @@ -108,16 +94,22 @@ class Rating extends $pb.GeneratedMessage { @$pb.TagNumber(3) RatingsBand get ratingsBand => $_getN(2); @$pb.TagNumber(3) - set ratingsBand(RatingsBand v) { - setField(3, v); - } - + set ratingsBand(RatingsBand v) { setField(3, v); } @$pb.TagNumber(3) $core.bool hasRatingsBand() => $_has(2); @$pb.TagNumber(3) void clearRatingsBand() => clearField(3); + + @$pb.TagNumber(4) + $core.String get snapName => $_getSZ(3); + @$pb.TagNumber(4) + set snapName($core.String v) { $_setString(3, v); } + @$pb.TagNumber(4) + $core.bool hasSnapName() => $_has(3); + @$pb.TagNumber(4) + void clearSnapName() => clearField(4); } + const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names'); -const _omitMessageNames = - $core.bool.fromEnvironment('protobuf.omit_message_names'); +const _omitMessageNames = $core.bool.fromEnvironment('protobuf.omit_message_names'); diff --git a/packages/app_center_ratings_client/lib/src/generated/ratings_features_common.pbenum.dart b/packages/app_center_ratings_client/lib/src/generated/ratings_features_common.pbenum.dart index 3b190bcdb..eae1f87d9 100644 --- a/packages/app_center_ratings_client/lib/src/generated/ratings_features_common.pbenum.dart +++ b/packages/app_center_ratings_client/lib/src/generated/ratings_features_common.pbenum.dart @@ -14,20 +14,14 @@ import 'dart:core' as $core; import 'package:protobuf/protobuf.dart' as $pb; class RatingsBand extends $pb.ProtobufEnum { - static const RatingsBand VERY_GOOD = - RatingsBand._(0, _omitEnumNames ? '' : 'VERY_GOOD'); - static const RatingsBand GOOD = - RatingsBand._(1, _omitEnumNames ? '' : 'GOOD'); - static const RatingsBand NEUTRAL = - RatingsBand._(2, _omitEnumNames ? '' : 'NEUTRAL'); - static const RatingsBand POOR = - RatingsBand._(3, _omitEnumNames ? '' : 'POOR'); - static const RatingsBand VERY_POOR = - RatingsBand._(4, _omitEnumNames ? '' : 'VERY_POOR'); - static const RatingsBand INSUFFICIENT_VOTES = - RatingsBand._(5, _omitEnumNames ? '' : 'INSUFFICIENT_VOTES'); - - static const $core.List values = [ + static const RatingsBand VERY_GOOD = RatingsBand._(0, _omitEnumNames ? '' : 'VERY_GOOD'); + static const RatingsBand GOOD = RatingsBand._(1, _omitEnumNames ? '' : 'GOOD'); + static const RatingsBand NEUTRAL = RatingsBand._(2, _omitEnumNames ? '' : 'NEUTRAL'); + static const RatingsBand POOR = RatingsBand._(3, _omitEnumNames ? '' : 'POOR'); + static const RatingsBand VERY_POOR = RatingsBand._(4, _omitEnumNames ? '' : 'VERY_POOR'); + static const RatingsBand INSUFFICIENT_VOTES = RatingsBand._(5, _omitEnumNames ? '' : 'INSUFFICIENT_VOTES'); + + static const $core.List values = [ VERY_GOOD, GOOD, NEUTRAL, @@ -36,11 +30,11 @@ class RatingsBand extends $pb.ProtobufEnum { INSUFFICIENT_VOTES, ]; - static final $core.Map<$core.int, RatingsBand> _byValue = - $pb.ProtobufEnum.initByValue(values); + static final $core.Map<$core.int, RatingsBand> _byValue = $pb.ProtobufEnum.initByValue(values); static RatingsBand? valueOf($core.int value) => _byValue[value]; const RatingsBand._($core.int v, $core.String n) : super(v, n); } + const _omitEnumNames = $core.bool.fromEnvironment('protobuf.omit_enum_names'); diff --git a/packages/app_center_ratings_client/lib/src/generated/ratings_features_common.pbjson.dart b/packages/app_center_ratings_client/lib/src/generated/ratings_features_common.pbjson.dart index 295512611..a27efe1f6 100644 --- a/packages/app_center_ratings_client/lib/src/generated/ratings_features_common.pbjson.dart +++ b/packages/app_center_ratings_client/lib/src/generated/ratings_features_common.pbjson.dart @@ -37,14 +37,8 @@ const Rating$json = { '2': [ {'1': 'snap_id', '3': 1, '4': 1, '5': 9, '10': 'snapId'}, {'1': 'total_votes', '3': 2, '4': 1, '5': 4, '10': 'totalVotes'}, - { - '1': 'ratings_band', - '3': 3, - '4': 1, - '5': 14, - '6': '.ratings.features.common.RatingsBand', - '10': 'ratingsBand' - }, + {'1': 'ratings_band', '3': 3, '4': 1, '5': 14, '6': '.ratings.features.common.RatingsBand', '10': 'ratingsBand'}, + {'1': 'snap_name', '3': 4, '4': 1, '5': 9, '10': 'snapName'}, ], }; @@ -52,4 +46,6 @@ const Rating$json = { final $typed_data.Uint8List ratingDescriptor = $convert.base64Decode( 'CgZSYXRpbmcSFwoHc25hcF9pZBgBIAEoCVIGc25hcElkEh8KC3RvdGFsX3ZvdGVzGAIgASgEUg' 'p0b3RhbFZvdGVzEkcKDHJhdGluZ3NfYmFuZBgDIAEoDjIkLnJhdGluZ3MuZmVhdHVyZXMuY29t' - 'bW9uLlJhdGluZ3NCYW5kUgtyYXRpbmdzQmFuZA=='); + 'bW9uLlJhdGluZ3NCYW5kUgtyYXRpbmdzQmFuZBIbCglzbmFwX25hbWUYBCABKAlSCHNuYXBOYW' + '1l'); + diff --git a/packages/app_center_ratings_client/lib/src/generated/ratings_features_user.pb.dart b/packages/app_center_ratings_client/lib/src/generated/ratings_features_user.pb.dart index 491e677c0..10de52835 100644 --- a/packages/app_center_ratings_client/lib/src/generated/ratings_features_user.pb.dart +++ b/packages/app_center_ratings_client/lib/src/generated/ratings_features_user.pb.dart @@ -13,7 +13,7 @@ import 'dart:core' as $core; import 'package:protobuf/protobuf.dart' as $pb; -import 'google/protobuf/timestamp.pb.dart' as $2; +import 'google/protobuf/timestamp.pb.dart' as $5; class AuthenticateRequest extends $pb.GeneratedMessage { factory AuthenticateRequest({ @@ -26,51 +26,39 @@ class AuthenticateRequest extends $pb.GeneratedMessage { return $result; } AuthenticateRequest._() : super(); - factory AuthenticateRequest.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory AuthenticateRequest.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - _omitMessageNames ? '' : 'AuthenticateRequest', - package: const $pb.PackageName( - _omitMessageNames ? '' : 'ratings.features.user'), - createEmptyInstance: create) + factory AuthenticateRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory AuthenticateRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'AuthenticateRequest', package: const $pb.PackageName(_omitMessageNames ? '' : 'ratings.features.user'), createEmptyInstance: create) ..aOS(1, _omitFieldNames ? '' : 'id') - ..hasRequiredFields = false; + ..hasRequiredFields = false + ; - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') AuthenticateRequest clone() => AuthenticateRequest()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - AuthenticateRequest copyWith(void Function(AuthenticateRequest) updates) => - super.copyWith((message) => updates(message as AuthenticateRequest)) - as AuthenticateRequest; + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + AuthenticateRequest copyWith(void Function(AuthenticateRequest) updates) => super.copyWith((message) => updates(message as AuthenticateRequest)) as AuthenticateRequest; $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static AuthenticateRequest create() => AuthenticateRequest._(); AuthenticateRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); + static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') - static AuthenticateRequest getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); + static AuthenticateRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static AuthenticateRequest? _defaultInstance; @$pb.TagNumber(1) $core.String get id => $_getSZ(0); @$pb.TagNumber(1) - set id($core.String v) { - $_setString(0, v); - } - + set id($core.String v) { $_setString(0, v); } @$pb.TagNumber(1) $core.bool hasId() => $_has(0); @$pb.TagNumber(1) @@ -88,52 +76,39 @@ class AuthenticateResponse extends $pb.GeneratedMessage { return $result; } AuthenticateResponse._() : super(); - factory AuthenticateResponse.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory AuthenticateResponse.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - _omitMessageNames ? '' : 'AuthenticateResponse', - package: const $pb.PackageName( - _omitMessageNames ? '' : 'ratings.features.user'), - createEmptyInstance: create) + factory AuthenticateResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory AuthenticateResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'AuthenticateResponse', package: const $pb.PackageName(_omitMessageNames ? '' : 'ratings.features.user'), createEmptyInstance: create) ..aOS(1, _omitFieldNames ? '' : 'token') - ..hasRequiredFields = false; - - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - AuthenticateResponse clone() => - AuthenticateResponse()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - AuthenticateResponse copyWith(void Function(AuthenticateResponse) updates) => - super.copyWith((message) => updates(message as AuthenticateResponse)) - as AuthenticateResponse; + ..hasRequiredFields = false + ; + + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + AuthenticateResponse clone() => AuthenticateResponse()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + AuthenticateResponse copyWith(void Function(AuthenticateResponse) updates) => super.copyWith((message) => updates(message as AuthenticateResponse)) as AuthenticateResponse; $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static AuthenticateResponse create() => AuthenticateResponse._(); AuthenticateResponse createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); + static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') - static AuthenticateResponse getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); + static AuthenticateResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static AuthenticateResponse? _defaultInstance; @$pb.TagNumber(1) $core.String get token => $_getSZ(0); @$pb.TagNumber(1) - set token($core.String v) { - $_setString(0, v); - } - + set token($core.String v) { $_setString(0, v); } @$pb.TagNumber(1) $core.bool hasToken() => $_has(0); @$pb.TagNumber(1) @@ -151,51 +126,39 @@ class ListMyVotesRequest extends $pb.GeneratedMessage { return $result; } ListMyVotesRequest._() : super(); - factory ListMyVotesRequest.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory ListMyVotesRequest.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - _omitMessageNames ? '' : 'ListMyVotesRequest', - package: const $pb.PackageName( - _omitMessageNames ? '' : 'ratings.features.user'), - createEmptyInstance: create) + factory ListMyVotesRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory ListMyVotesRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'ListMyVotesRequest', package: const $pb.PackageName(_omitMessageNames ? '' : 'ratings.features.user'), createEmptyInstance: create) ..aOS(1, _omitFieldNames ? '' : 'snapIdFilter') - ..hasRequiredFields = false; + ..hasRequiredFields = false + ; - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') ListMyVotesRequest clone() => ListMyVotesRequest()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - ListMyVotesRequest copyWith(void Function(ListMyVotesRequest) updates) => - super.copyWith((message) => updates(message as ListMyVotesRequest)) - as ListMyVotesRequest; + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + ListMyVotesRequest copyWith(void Function(ListMyVotesRequest) updates) => super.copyWith((message) => updates(message as ListMyVotesRequest)) as ListMyVotesRequest; $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static ListMyVotesRequest create() => ListMyVotesRequest._(); ListMyVotesRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); + static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') - static ListMyVotesRequest getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); + static ListMyVotesRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static ListMyVotesRequest? _defaultInstance; @$pb.TagNumber(1) $core.String get snapIdFilter => $_getSZ(0); @$pb.TagNumber(1) - set snapIdFilter($core.String v) { - $_setString(0, v); - } - + set snapIdFilter($core.String v) { $_setString(0, v); } @$pb.TagNumber(1) $core.bool hasSnapIdFilter() => $_has(0); @$pb.TagNumber(1) @@ -213,43 +176,33 @@ class ListMyVotesResponse extends $pb.GeneratedMessage { return $result; } ListMyVotesResponse._() : super(); - factory ListMyVotesResponse.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory ListMyVotesResponse.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - _omitMessageNames ? '' : 'ListMyVotesResponse', - package: const $pb.PackageName( - _omitMessageNames ? '' : 'ratings.features.user'), - createEmptyInstance: create) - ..pc(1, _omitFieldNames ? '' : 'votes', $pb.PbFieldType.PM, - subBuilder: Vote.create) - ..hasRequiredFields = false; - - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') + factory ListMyVotesResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory ListMyVotesResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'ListMyVotesResponse', package: const $pb.PackageName(_omitMessageNames ? '' : 'ratings.features.user'), createEmptyInstance: create) + ..pc(1, _omitFieldNames ? '' : 'votes', $pb.PbFieldType.PM, subBuilder: Vote.create) + ..hasRequiredFields = false + ; + + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') ListMyVotesResponse clone() => ListMyVotesResponse()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - ListMyVotesResponse copyWith(void Function(ListMyVotesResponse) updates) => - super.copyWith((message) => updates(message as ListMyVotesResponse)) - as ListMyVotesResponse; + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + ListMyVotesResponse copyWith(void Function(ListMyVotesResponse) updates) => super.copyWith((message) => updates(message as ListMyVotesResponse)) as ListMyVotesResponse; $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static ListMyVotesResponse create() => ListMyVotesResponse._(); ListMyVotesResponse createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); + static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') - static ListMyVotesResponse getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); + static ListMyVotesResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static ListMyVotesResponse? _defaultInstance; @$pb.TagNumber(1) @@ -267,51 +220,39 @@ class GetSnapVotesRequest extends $pb.GeneratedMessage { return $result; } GetSnapVotesRequest._() : super(); - factory GetSnapVotesRequest.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory GetSnapVotesRequest.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - _omitMessageNames ? '' : 'GetSnapVotesRequest', - package: const $pb.PackageName( - _omitMessageNames ? '' : 'ratings.features.user'), - createEmptyInstance: create) + factory GetSnapVotesRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory GetSnapVotesRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'GetSnapVotesRequest', package: const $pb.PackageName(_omitMessageNames ? '' : 'ratings.features.user'), createEmptyInstance: create) ..aOS(1, _omitFieldNames ? '' : 'snapId') - ..hasRequiredFields = false; + ..hasRequiredFields = false + ; - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') GetSnapVotesRequest clone() => GetSnapVotesRequest()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - GetSnapVotesRequest copyWith(void Function(GetSnapVotesRequest) updates) => - super.copyWith((message) => updates(message as GetSnapVotesRequest)) - as GetSnapVotesRequest; + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + GetSnapVotesRequest copyWith(void Function(GetSnapVotesRequest) updates) => super.copyWith((message) => updates(message as GetSnapVotesRequest)) as GetSnapVotesRequest; $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static GetSnapVotesRequest create() => GetSnapVotesRequest._(); GetSnapVotesRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); + static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') - static GetSnapVotesRequest getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); + static GetSnapVotesRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static GetSnapVotesRequest? _defaultInstance; @$pb.TagNumber(1) $core.String get snapId => $_getSZ(0); @$pb.TagNumber(1) - set snapId($core.String v) { - $_setString(0, v); - } - + set snapId($core.String v) { $_setString(0, v); } @$pb.TagNumber(1) $core.bool hasSnapId() => $_has(0); @$pb.TagNumber(1) @@ -329,44 +270,33 @@ class GetSnapVotesResponse extends $pb.GeneratedMessage { return $result; } GetSnapVotesResponse._() : super(); - factory GetSnapVotesResponse.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory GetSnapVotesResponse.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - _omitMessageNames ? '' : 'GetSnapVotesResponse', - package: const $pb.PackageName( - _omitMessageNames ? '' : 'ratings.features.user'), - createEmptyInstance: create) - ..pc(1, _omitFieldNames ? '' : 'votes', $pb.PbFieldType.PM, - subBuilder: Vote.create) - ..hasRequiredFields = false; - - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - GetSnapVotesResponse clone() => - GetSnapVotesResponse()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - GetSnapVotesResponse copyWith(void Function(GetSnapVotesResponse) updates) => - super.copyWith((message) => updates(message as GetSnapVotesResponse)) - as GetSnapVotesResponse; + factory GetSnapVotesResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory GetSnapVotesResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'GetSnapVotesResponse', package: const $pb.PackageName(_omitMessageNames ? '' : 'ratings.features.user'), createEmptyInstance: create) + ..pc(1, _omitFieldNames ? '' : 'votes', $pb.PbFieldType.PM, subBuilder: Vote.create) + ..hasRequiredFields = false + ; + + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + GetSnapVotesResponse clone() => GetSnapVotesResponse()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + GetSnapVotesResponse copyWith(void Function(GetSnapVotesResponse) updates) => super.copyWith((message) => updates(message as GetSnapVotesResponse)) as GetSnapVotesResponse; $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static GetSnapVotesResponse create() => GetSnapVotesResponse._(); GetSnapVotesResponse createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); + static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') - static GetSnapVotesResponse getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); + static GetSnapVotesResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static GetSnapVotesResponse? _defaultInstance; @$pb.TagNumber(1) @@ -378,7 +308,8 @@ class Vote extends $pb.GeneratedMessage { $core.String? snapId, $core.int? snapRevision, $core.bool? voteUp, - $2.Timestamp? timestamp, + $5.Timestamp? timestamp, + $core.String? snapName, }) { final $result = create(); if (snapId != null) { @@ -393,37 +324,34 @@ class Vote extends $pb.GeneratedMessage { if (timestamp != null) { $result.timestamp = timestamp; } + if (snapName != null) { + $result.snapName = snapName; + } return $result; } Vote._() : super(); - factory Vote.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory Vote.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - _omitMessageNames ? '' : 'Vote', - package: const $pb.PackageName( - _omitMessageNames ? '' : 'ratings.features.user'), - createEmptyInstance: create) + factory Vote.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory Vote.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'Vote', package: const $pb.PackageName(_omitMessageNames ? '' : 'ratings.features.user'), createEmptyInstance: create) ..aOS(1, _omitFieldNames ? '' : 'snapId') ..a<$core.int>(2, _omitFieldNames ? '' : 'snapRevision', $pb.PbFieldType.O3) ..aOB(3, _omitFieldNames ? '' : 'voteUp') - ..aOM<$2.Timestamp>(4, _omitFieldNames ? '' : 'timestamp', - subBuilder: $2.Timestamp.create) - ..hasRequiredFields = false; - - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') + ..aOM<$5.Timestamp>(4, _omitFieldNames ? '' : 'timestamp', subBuilder: $5.Timestamp.create) + ..aOS(5, _omitFieldNames ? '' : 'snapName') + ..hasRequiredFields = false + ; + + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') Vote clone() => Vote()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - Vote copyWith(void Function(Vote) updates) => - super.copyWith((message) => updates(message as Vote)) as Vote; + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Vote copyWith(void Function(Vote) updates) => super.copyWith((message) => updates(message as Vote)) as Vote; $pb.BuilderInfo get info_ => _i; @@ -432,17 +360,13 @@ class Vote extends $pb.GeneratedMessage { Vote createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') - static Vote getDefault() => - _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static Vote getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static Vote? _defaultInstance; @$pb.TagNumber(1) $core.String get snapId => $_getSZ(0); @$pb.TagNumber(1) - set snapId($core.String v) { - $_setString(0, v); - } - + set snapId($core.String v) { $_setString(0, v); } @$pb.TagNumber(1) $core.bool hasSnapId() => $_has(0); @$pb.TagNumber(1) @@ -451,10 +375,7 @@ class Vote extends $pb.GeneratedMessage { @$pb.TagNumber(2) $core.int get snapRevision => $_getIZ(1); @$pb.TagNumber(2) - set snapRevision($core.int v) { - $_setSignedInt32(1, v); - } - + set snapRevision($core.int v) { $_setSignedInt32(1, v); } @$pb.TagNumber(2) $core.bool hasSnapRevision() => $_has(1); @$pb.TagNumber(2) @@ -463,28 +384,31 @@ class Vote extends $pb.GeneratedMessage { @$pb.TagNumber(3) $core.bool get voteUp => $_getBF(2); @$pb.TagNumber(3) - set voteUp($core.bool v) { - $_setBool(2, v); - } - + set voteUp($core.bool v) { $_setBool(2, v); } @$pb.TagNumber(3) $core.bool hasVoteUp() => $_has(2); @$pb.TagNumber(3) void clearVoteUp() => clearField(3); @$pb.TagNumber(4) - $2.Timestamp get timestamp => $_getN(3); + $5.Timestamp get timestamp => $_getN(3); @$pb.TagNumber(4) - set timestamp($2.Timestamp v) { - setField(4, v); - } - + set timestamp($5.Timestamp v) { setField(4, v); } @$pb.TagNumber(4) $core.bool hasTimestamp() => $_has(3); @$pb.TagNumber(4) void clearTimestamp() => clearField(4); @$pb.TagNumber(4) - $2.Timestamp ensureTimestamp() => $_ensure(3); + $5.Timestamp ensureTimestamp() => $_ensure(3); + + @$pb.TagNumber(5) + $core.String get snapName => $_getSZ(4); + @$pb.TagNumber(5) + set snapName($core.String v) { $_setString(4, v); } + @$pb.TagNumber(5) + $core.bool hasSnapName() => $_has(4); + @$pb.TagNumber(5) + void clearSnapName() => clearField(5); } class VoteRequest extends $pb.GeneratedMessage { @@ -506,33 +430,26 @@ class VoteRequest extends $pb.GeneratedMessage { return $result; } VoteRequest._() : super(); - factory VoteRequest.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory VoteRequest.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - _omitMessageNames ? '' : 'VoteRequest', - package: const $pb.PackageName( - _omitMessageNames ? '' : 'ratings.features.user'), - createEmptyInstance: create) + factory VoteRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory VoteRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'VoteRequest', package: const $pb.PackageName(_omitMessageNames ? '' : 'ratings.features.user'), createEmptyInstance: create) ..aOS(1, _omitFieldNames ? '' : 'snapId') ..a<$core.int>(2, _omitFieldNames ? '' : 'snapRevision', $pb.PbFieldType.O3) ..aOB(3, _omitFieldNames ? '' : 'voteUp') - ..hasRequiredFields = false; + ..hasRequiredFields = false + ; - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') VoteRequest clone() => VoteRequest()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - VoteRequest copyWith(void Function(VoteRequest) updates) => - super.copyWith((message) => updates(message as VoteRequest)) - as VoteRequest; + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + VoteRequest copyWith(void Function(VoteRequest) updates) => super.copyWith((message) => updates(message as VoteRequest)) as VoteRequest; $pb.BuilderInfo get info_ => _i; @@ -541,17 +458,13 @@ class VoteRequest extends $pb.GeneratedMessage { VoteRequest createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') - static VoteRequest getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); + static VoteRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static VoteRequest? _defaultInstance; @$pb.TagNumber(1) $core.String get snapId => $_getSZ(0); @$pb.TagNumber(1) - set snapId($core.String v) { - $_setString(0, v); - } - + set snapId($core.String v) { $_setString(0, v); } @$pb.TagNumber(1) $core.bool hasSnapId() => $_has(0); @$pb.TagNumber(1) @@ -560,10 +473,7 @@ class VoteRequest extends $pb.GeneratedMessage { @$pb.TagNumber(2) $core.int get snapRevision => $_getIZ(1); @$pb.TagNumber(2) - set snapRevision($core.int v) { - $_setSignedInt32(1, v); - } - + set snapRevision($core.int v) { $_setSignedInt32(1, v); } @$pb.TagNumber(2) $core.bool hasSnapRevision() => $_has(1); @$pb.TagNumber(2) @@ -572,16 +482,13 @@ class VoteRequest extends $pb.GeneratedMessage { @$pb.TagNumber(3) $core.bool get voteUp => $_getBF(2); @$pb.TagNumber(3) - set voteUp($core.bool v) { - $_setBool(2, v); - } - + set voteUp($core.bool v) { $_setBool(2, v); } @$pb.TagNumber(3) $core.bool hasVoteUp() => $_has(2); @$pb.TagNumber(3) void clearVoteUp() => clearField(3); } + const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names'); -const _omitMessageNames = - $core.bool.fromEnvironment('protobuf.omit_message_names'); +const _omitMessageNames = $core.bool.fromEnvironment('protobuf.omit_message_names'); diff --git a/packages/app_center_ratings_client/lib/src/generated/ratings_features_user.pbenum.dart b/packages/app_center_ratings_client/lib/src/generated/ratings_features_user.pbenum.dart new file mode 100644 index 000000000..a7e7d5df3 --- /dev/null +++ b/packages/app_center_ratings_client/lib/src/generated/ratings_features_user.pbenum.dart @@ -0,0 +1,11 @@ +// +// Generated code. Do not modify. +// source: ratings_features_user.proto +// +// @dart = 2.12 + +// ignore_for_file: annotate_overrides, camel_case_types, comment_references +// ignore_for_file: constant_identifier_names, library_prefixes +// ignore_for_file: non_constant_identifier_names, prefer_final_fields +// ignore_for_file: unnecessary_import, unnecessary_this, unused_import + diff --git a/packages/app_center_ratings_client/lib/src/generated/ratings_features_user.pbgrpc.dart b/packages/app_center_ratings_client/lib/src/generated/ratings_features_user.pbgrpc.dart index 3c357f791..39fc8ff27 100644 --- a/packages/app_center_ratings_client/lib/src/generated/ratings_features_user.pbgrpc.dart +++ b/packages/app_center_ratings_client/lib/src/generated/ratings_features_user.pbgrpc.dart @@ -12,151 +12,109 @@ import 'dart:async' as $async; import 'dart:core' as $core; -import 'package:app_center_ratings_client/src/generated/google/protobuf/empty.pb.dart' - as $1; -import 'package:app_center_ratings_client/src/generated/ratings_features_user.pb.dart' - as $0; import 'package:grpc/service_api.dart' as $grpc; import 'package:protobuf/protobuf.dart' as $pb; +import 'google/protobuf/empty.pb.dart' as $3; +import 'ratings_features_user.pb.dart' as $2; + export 'ratings_features_user.pb.dart'; @$pb.GrpcServiceName('ratings.features.user.User') class UserClient extends $grpc.Client { + static final _$authenticate = $grpc.ClientMethod<$2.AuthenticateRequest, $2.AuthenticateResponse>( + '/ratings.features.user.User/Authenticate', + ($2.AuthenticateRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => $2.AuthenticateResponse.fromBuffer(value)); + static final _$delete = $grpc.ClientMethod<$3.Empty, $3.Empty>( + '/ratings.features.user.User/Delete', + ($3.Empty value) => value.writeToBuffer(), + ($core.List<$core.int> value) => $3.Empty.fromBuffer(value)); + static final _$vote = $grpc.ClientMethod<$2.VoteRequest, $3.Empty>( + '/ratings.features.user.User/Vote', + ($2.VoteRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => $3.Empty.fromBuffer(value)); + static final _$getSnapVotes = $grpc.ClientMethod<$2.GetSnapVotesRequest, $2.GetSnapVotesResponse>( + '/ratings.features.user.User/GetSnapVotes', + ($2.GetSnapVotesRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => $2.GetSnapVotesResponse.fromBuffer(value)); + UserClient($grpc.ClientChannel channel, {$grpc.CallOptions? options, $core.Iterable<$grpc.ClientInterceptor>? interceptors}) - : super(channel, options: options, interceptors: interceptors); - static final _$authenticate = - $grpc.ClientMethod<$0.AuthenticateRequest, $0.AuthenticateResponse>( - '/ratings.features.user.User/Authenticate', - (value) => value.writeToBuffer(), - (value) => $0.AuthenticateResponse.fromBuffer(value)); - static final _$delete = $grpc.ClientMethod<$1.Empty, $1.Empty>( - '/ratings.features.user.User/Delete', - (value) => value.writeToBuffer(), - (value) => $1.Empty.fromBuffer(value)); - static final _$vote = $grpc.ClientMethod<$0.VoteRequest, $1.Empty>( - '/ratings.features.user.User/Vote', - (value) => value.writeToBuffer(), - (value) => $1.Empty.fromBuffer(value)); - static final _$listMyVotes = - $grpc.ClientMethod<$0.ListMyVotesRequest, $0.ListMyVotesResponse>( - '/ratings.features.user.User/ListMyVotes', - (value) => value.writeToBuffer(), - (value) => $0.ListMyVotesResponse.fromBuffer(value)); - static final _$getSnapVotes = - $grpc.ClientMethod<$0.GetSnapVotesRequest, $0.GetSnapVotesResponse>( - '/ratings.features.user.User/GetSnapVotes', - (value) => value.writeToBuffer(), - (value) => $0.GetSnapVotesResponse.fromBuffer(value)); - - $grpc.ResponseFuture<$0.AuthenticateResponse> authenticate( - $0.AuthenticateRequest request, - {$grpc.CallOptions? options}) { + : super(channel, options: options, + interceptors: interceptors); + + $grpc.ResponseFuture<$2.AuthenticateResponse> authenticate($2.AuthenticateRequest request, {$grpc.CallOptions? options}) { return $createUnaryCall(_$authenticate, request, options: options); } - $grpc.ResponseFuture<$1.Empty> delete($1.Empty request, - {$grpc.CallOptions? options}) { + $grpc.ResponseFuture<$3.Empty> delete($3.Empty request, {$grpc.CallOptions? options}) { return $createUnaryCall(_$delete, request, options: options); } - $grpc.ResponseFuture<$1.Empty> vote($0.VoteRequest request, - {$grpc.CallOptions? options}) { + $grpc.ResponseFuture<$3.Empty> vote($2.VoteRequest request, {$grpc.CallOptions? options}) { return $createUnaryCall(_$vote, request, options: options); } - $grpc.ResponseFuture<$0.ListMyVotesResponse> listMyVotes( - $0.ListMyVotesRequest request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$listMyVotes, request, options: options); - } - - $grpc.ResponseFuture<$0.GetSnapVotesResponse> getSnapVotes( - $0.GetSnapVotesRequest request, - {$grpc.CallOptions? options}) { + $grpc.ResponseFuture<$2.GetSnapVotesResponse> getSnapVotes($2.GetSnapVotesRequest request, {$grpc.CallOptions? options}) { return $createUnaryCall(_$getSnapVotes, request, options: options); } } @$pb.GrpcServiceName('ratings.features.user.User') abstract class UserServiceBase extends $grpc.Service { + $core.String get $name => 'ratings.features.user.User'; + UserServiceBase() { - $addMethod( - $grpc.ServiceMethod<$0.AuthenticateRequest, $0.AuthenticateResponse>( - 'Authenticate', - authenticate_Pre, - false, - false, - (value) => $0.AuthenticateRequest.fromBuffer(value), - (value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$1.Empty, $1.Empty>( + $addMethod($grpc.ServiceMethod<$2.AuthenticateRequest, $2.AuthenticateResponse>( + 'Authenticate', + authenticate_Pre, + false, + false, + ($core.List<$core.int> value) => $2.AuthenticateRequest.fromBuffer(value), + ($2.AuthenticateResponse value) => value.writeToBuffer())); + $addMethod($grpc.ServiceMethod<$3.Empty, $3.Empty>( 'Delete', delete_Pre, false, false, - (value) => $1.Empty.fromBuffer(value), - (value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.VoteRequest, $1.Empty>( + ($core.List<$core.int> value) => $3.Empty.fromBuffer(value), + ($3.Empty value) => value.writeToBuffer())); + $addMethod($grpc.ServiceMethod<$2.VoteRequest, $3.Empty>( 'Vote', vote_Pre, false, false, - (value) => $0.VoteRequest.fromBuffer(value), - (value) => value.writeToBuffer())); - $addMethod( - $grpc.ServiceMethod<$0.ListMyVotesRequest, $0.ListMyVotesResponse>( - 'ListMyVotes', - listMyVotes_Pre, - false, - false, - (value) => $0.ListMyVotesRequest.fromBuffer(value), - (value) => value.writeToBuffer())); - $addMethod( - $grpc.ServiceMethod<$0.GetSnapVotesRequest, $0.GetSnapVotesResponse>( - 'GetSnapVotes', - getSnapVotes_Pre, - false, - false, - (value) => $0.GetSnapVotesRequest.fromBuffer(value), - (value) => value.writeToBuffer())); + ($core.List<$core.int> value) => $2.VoteRequest.fromBuffer(value), + ($3.Empty value) => value.writeToBuffer())); + $addMethod($grpc.ServiceMethod<$2.GetSnapVotesRequest, $2.GetSnapVotesResponse>( + 'GetSnapVotes', + getSnapVotes_Pre, + false, + false, + ($core.List<$core.int> value) => $2.GetSnapVotesRequest.fromBuffer(value), + ($2.GetSnapVotesResponse value) => value.writeToBuffer())); } - $core.String get $name => 'ratings.features.user.User'; - $async.Future<$0.AuthenticateResponse> authenticate_Pre( - $grpc.ServiceCall call, - $async.Future<$0.AuthenticateRequest> request) async { + $async.Future<$2.AuthenticateResponse> authenticate_Pre($grpc.ServiceCall call, $async.Future<$2.AuthenticateRequest> request) async { return authenticate(call, await request); } - $async.Future<$1.Empty> delete_Pre( - $grpc.ServiceCall call, $async.Future<$1.Empty> request) async { + $async.Future<$3.Empty> delete_Pre($grpc.ServiceCall call, $async.Future<$3.Empty> request) async { return delete(call, await request); } - $async.Future<$1.Empty> vote_Pre( - $grpc.ServiceCall call, $async.Future<$0.VoteRequest> request) async { + $async.Future<$3.Empty> vote_Pre($grpc.ServiceCall call, $async.Future<$2.VoteRequest> request) async { return vote(call, await request); } - $async.Future<$0.ListMyVotesResponse> listMyVotes_Pre($grpc.ServiceCall call, - $async.Future<$0.ListMyVotesRequest> request) async { - return listMyVotes(call, await request); - } - - $async.Future<$0.GetSnapVotesResponse> getSnapVotes_Pre( - $grpc.ServiceCall call, - $async.Future<$0.GetSnapVotesRequest> request) async { + $async.Future<$2.GetSnapVotesResponse> getSnapVotes_Pre($grpc.ServiceCall call, $async.Future<$2.GetSnapVotesRequest> request) async { return getSnapVotes(call, await request); } - $async.Future<$0.AuthenticateResponse> authenticate( - $grpc.ServiceCall call, $0.AuthenticateRequest request); - $async.Future<$1.Empty> delete($grpc.ServiceCall call, $1.Empty request); - $async.Future<$1.Empty> vote($grpc.ServiceCall call, $0.VoteRequest request); - $async.Future<$0.ListMyVotesResponse> listMyVotes( - $grpc.ServiceCall call, $0.ListMyVotesRequest request); - $async.Future<$0.GetSnapVotesResponse> getSnapVotes( - $grpc.ServiceCall call, $0.GetSnapVotesRequest request); + $async.Future<$2.AuthenticateResponse> authenticate($grpc.ServiceCall call, $2.AuthenticateRequest request); + $async.Future<$3.Empty> delete($grpc.ServiceCall call, $3.Empty request); + $async.Future<$3.Empty> vote($grpc.ServiceCall call, $2.VoteRequest request); + $async.Future<$2.GetSnapVotesResponse> getSnapVotes($grpc.ServiceCall call, $2.GetSnapVotesRequest request); } diff --git a/packages/app_center_ratings_client/lib/src/generated/ratings_features_user.pbjson.dart b/packages/app_center_ratings_client/lib/src/generated/ratings_features_user.pbjson.dart index 2e566da7f..e4a07c4a6 100644 --- a/packages/app_center_ratings_client/lib/src/generated/ratings_features_user.pbjson.dart +++ b/packages/app_center_ratings_client/lib/src/generated/ratings_features_user.pbjson.dart @@ -22,8 +22,8 @@ const AuthenticateRequest$json = { }; /// Descriptor for `AuthenticateRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List authenticateRequestDescriptor = $convert - .base64Decode('ChNBdXRoZW50aWNhdGVSZXF1ZXN0Eg4KAmlkGAEgASgJUgJpZA=='); +final $typed_data.Uint8List authenticateRequestDescriptor = $convert.base64Decode( + 'ChNBdXRoZW50aWNhdGVSZXF1ZXN0Eg4KAmlkGAEgASgJUgJpZA=='); @$core.Deprecated('Use authenticateResponseDescriptor instead') const AuthenticateResponse$json = { @@ -34,9 +34,8 @@ const AuthenticateResponse$json = { }; /// Descriptor for `AuthenticateResponse`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List authenticateResponseDescriptor = - $convert.base64Decode( - 'ChRBdXRoZW50aWNhdGVSZXNwb25zZRIUCgV0b2tlbhgBIAEoCVIFdG9rZW4='); +final $typed_data.Uint8List authenticateResponseDescriptor = $convert.base64Decode( + 'ChRBdXRoZW50aWNhdGVSZXNwb25zZRIUCgV0b2tlbhgBIAEoCVIFdG9rZW4='); @$core.Deprecated('Use listMyVotesRequestDescriptor instead') const ListMyVotesRequest$json = { @@ -55,14 +54,7 @@ final $typed_data.Uint8List listMyVotesRequestDescriptor = $convert.base64Decode const ListMyVotesResponse$json = { '1': 'ListMyVotesResponse', '2': [ - { - '1': 'votes', - '3': 1, - '4': 3, - '5': 11, - '6': '.ratings.features.user.Vote', - '10': 'votes' - }, + {'1': 'votes', '3': 1, '4': 3, '5': 11, '6': '.ratings.features.user.Vote', '10': 'votes'}, ], }; @@ -80,22 +72,14 @@ const GetSnapVotesRequest$json = { }; /// Descriptor for `GetSnapVotesRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List getSnapVotesRequestDescriptor = - $convert.base64Decode( - 'ChNHZXRTbmFwVm90ZXNSZXF1ZXN0EhcKB3NuYXBfaWQYASABKAlSBnNuYXBJZA=='); +final $typed_data.Uint8List getSnapVotesRequestDescriptor = $convert.base64Decode( + 'ChNHZXRTbmFwVm90ZXNSZXF1ZXN0EhcKB3NuYXBfaWQYASABKAlSBnNuYXBJZA=='); @$core.Deprecated('Use getSnapVotesResponseDescriptor instead') const GetSnapVotesResponse$json = { '1': 'GetSnapVotesResponse', '2': [ - { - '1': 'votes', - '3': 1, - '4': 3, - '5': 11, - '6': '.ratings.features.user.Vote', - '10': 'votes' - }, + {'1': 'votes', '3': 1, '4': 3, '5': 11, '6': '.ratings.features.user.Vote', '10': 'votes'}, ], }; @@ -111,14 +95,8 @@ const Vote$json = { {'1': 'snap_id', '3': 1, '4': 1, '5': 9, '10': 'snapId'}, {'1': 'snap_revision', '3': 2, '4': 1, '5': 5, '10': 'snapRevision'}, {'1': 'vote_up', '3': 3, '4': 1, '5': 8, '10': 'voteUp'}, - { - '1': 'timestamp', - '3': 4, - '4': 1, - '5': 11, - '6': '.google.protobuf.Timestamp', - '10': 'timestamp' - }, + {'1': 'timestamp', '3': 4, '4': 1, '5': 11, '6': '.google.protobuf.Timestamp', '10': 'timestamp'}, + {'1': 'snap_name', '3': 5, '4': 1, '5': 9, '10': 'snapName'}, ], }; @@ -126,7 +104,8 @@ const Vote$json = { final $typed_data.Uint8List voteDescriptor = $convert.base64Decode( 'CgRWb3RlEhcKB3NuYXBfaWQYASABKAlSBnNuYXBJZBIjCg1zbmFwX3JldmlzaW9uGAIgASgFUg' 'xzbmFwUmV2aXNpb24SFwoHdm90ZV91cBgDIAEoCFIGdm90ZVVwEjgKCXRpbWVzdGFtcBgEIAEo' - 'CzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXBSCXRpbWVzdGFtcA=='); + 'CzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXBSCXRpbWVzdGFtcBIbCglzbmFwX25hbWUYBS' + 'ABKAlSCHNuYXBOYW1l'); @$core.Deprecated('Use voteRequestDescriptor instead') const VoteRequest$json = { @@ -142,3 +121,4 @@ const VoteRequest$json = { final $typed_data.Uint8List voteRequestDescriptor = $convert.base64Decode( 'CgtWb3RlUmVxdWVzdBIXCgdzbmFwX2lkGAEgASgJUgZzbmFwSWQSIwoNc25hcF9yZXZpc2lvbh' 'gCIAEoBVIMc25hcFJldmlzaW9uEhcKB3ZvdGVfdXAYAyABKAhSBnZvdGVVcA=='); + diff --git a/packages/app_center_ratings_client/lib/src/ratings.dart b/packages/app_center_ratings_client/lib/src/ratings.dart index dc71c3097..8a0e19aec 100644 --- a/packages/app_center_ratings_client/lib/src/ratings.dart +++ b/packages/app_center_ratings_client/lib/src/ratings.dart @@ -13,6 +13,7 @@ class Rating with _$Rating { required String snapId, required int totalVotes, required RatingsBand ratingsBand, + required String snapName, }) = _Rating; factory Rating.fromJson(Map json) => _$RatingFromJson(json); @@ -33,6 +34,7 @@ extension RatingFromDTO on pb.Rating { snapId: snapId, totalVotes: totalVotes.toInt(), ratingsBand: ratingsBand.fromDTO(), + snapName: snapName, ); } } diff --git a/packages/app_center_ratings_client/lib/src/ratings.freezed.dart b/packages/app_center_ratings_client/lib/src/ratings.freezed.dart deleted file mode 100644 index b256fdc52..000000000 --- a/packages/app_center_ratings_client/lib/src/ratings.freezed.dart +++ /dev/null @@ -1,200 +0,0 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: type=lint -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark - -part of 'ratings.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -T _$identity(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -Rating _$RatingFromJson(Map json) { - return _Rating.fromJson(json); -} - -/// @nodoc -mixin _$Rating { - String get snapId => throw _privateConstructorUsedError; - int get totalVotes => throw _privateConstructorUsedError; - RatingsBand get ratingsBand => throw _privateConstructorUsedError; - - /// Serializes this Rating to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of Rating - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $RatingCopyWith get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $RatingCopyWith<$Res> { - factory $RatingCopyWith(Rating value, $Res Function(Rating) then) = - _$RatingCopyWithImpl<$Res, Rating>; - @useResult - $Res call({String snapId, int totalVotes, RatingsBand ratingsBand}); -} - -/// @nodoc -class _$RatingCopyWithImpl<$Res, $Val extends Rating> - implements $RatingCopyWith<$Res> { - _$RatingCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of Rating - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? snapId = null, - Object? totalVotes = null, - Object? ratingsBand = null, - }) { - return _then(_value.copyWith( - snapId: null == snapId - ? _value.snapId - : snapId // ignore: cast_nullable_to_non_nullable - as String, - totalVotes: null == totalVotes - ? _value.totalVotes - : totalVotes // ignore: cast_nullable_to_non_nullable - as int, - ratingsBand: null == ratingsBand - ? _value.ratingsBand - : ratingsBand // ignore: cast_nullable_to_non_nullable - as RatingsBand, - ) as $Val); - } -} - -/// @nodoc -abstract class _$$RatingImplCopyWith<$Res> implements $RatingCopyWith<$Res> { - factory _$$RatingImplCopyWith( - _$RatingImpl value, $Res Function(_$RatingImpl) then) = - __$$RatingImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({String snapId, int totalVotes, RatingsBand ratingsBand}); -} - -/// @nodoc -class __$$RatingImplCopyWithImpl<$Res> - extends _$RatingCopyWithImpl<$Res, _$RatingImpl> - implements _$$RatingImplCopyWith<$Res> { - __$$RatingImplCopyWithImpl( - _$RatingImpl _value, $Res Function(_$RatingImpl) _then) - : super(_value, _then); - - /// Create a copy of Rating - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? snapId = null, - Object? totalVotes = null, - Object? ratingsBand = null, - }) { - return _then(_$RatingImpl( - snapId: null == snapId - ? _value.snapId - : snapId // ignore: cast_nullable_to_non_nullable - as String, - totalVotes: null == totalVotes - ? _value.totalVotes - : totalVotes // ignore: cast_nullable_to_non_nullable - as int, - ratingsBand: null == ratingsBand - ? _value.ratingsBand - : ratingsBand // ignore: cast_nullable_to_non_nullable - as RatingsBand, - )); - } -} - -/// @nodoc -@JsonSerializable() -class _$RatingImpl implements _Rating { - const _$RatingImpl( - {required this.snapId, - required this.totalVotes, - required this.ratingsBand}); - - factory _$RatingImpl.fromJson(Map json) => - _$$RatingImplFromJson(json); - - @override - final String snapId; - @override - final int totalVotes; - @override - final RatingsBand ratingsBand; - - @override - String toString() { - return 'Rating(snapId: $snapId, totalVotes: $totalVotes, ratingsBand: $ratingsBand)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$RatingImpl && - (identical(other.snapId, snapId) || other.snapId == snapId) && - (identical(other.totalVotes, totalVotes) || - other.totalVotes == totalVotes) && - (identical(other.ratingsBand, ratingsBand) || - other.ratingsBand == ratingsBand)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, snapId, totalVotes, ratingsBand); - - /// Create a copy of Rating - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$RatingImplCopyWith<_$RatingImpl> get copyWith => - __$$RatingImplCopyWithImpl<_$RatingImpl>(this, _$identity); - - @override - Map toJson() { - return _$$RatingImplToJson( - this, - ); - } -} - -abstract class _Rating implements Rating { - const factory _Rating( - {required final String snapId, - required final int totalVotes, - required final RatingsBand ratingsBand}) = _$RatingImpl; - - factory _Rating.fromJson(Map json) = _$RatingImpl.fromJson; - - @override - String get snapId; - @override - int get totalVotes; - @override - RatingsBand get ratingsBand; - - /// Create a copy of Rating - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$RatingImplCopyWith<_$RatingImpl> get copyWith => - throw _privateConstructorUsedError; -} diff --git a/packages/app_center_ratings_client/lib/src/ratings_client.dart b/packages/app_center_ratings_client/lib/src/ratings_client.dart index ba6f3ba02..195969b57 100644 --- a/packages/app_center_ratings_client/lib/src/ratings_client.dart +++ b/packages/app_center_ratings_client/lib/src/ratings_client.dart @@ -94,17 +94,6 @@ class RatingsClient { return grpcResponse.votes.map((vote) => vote.fromDTO()).toList(); } - Future> listMyVotes(String snapIdFilter, String token) async { - final request = user_pb.ListMyVotesRequest(snapIdFilter: snapIdFilter); - final callOptions = - CallOptions(metadata: {'authorization': 'Bearer $token'}); - final grpcResponse = await _userClient.listMyVotes( - request, - options: callOptions, - ); - return grpcResponse.votes.map((vote) => vote.fromDTO()).toList(); - } - Future vote( String snapId, int snapRevision, diff --git a/packages/app_center_ratings_client/lib/src/vote.dart b/packages/app_center_ratings_client/lib/src/vote.dart index b878ce29d..53ac1512f 100644 --- a/packages/app_center_ratings_client/lib/src/vote.dart +++ b/packages/app_center_ratings_client/lib/src/vote.dart @@ -11,6 +11,7 @@ class Vote with _$Vote { required int snapRevision, required bool voteUp, required DateTime dateTime, + required String snapName, }) = _Vote; } @@ -21,6 +22,7 @@ extension VoteFromDTO on pb.Vote { snapRevision: snapRevision, voteUp: voteUp, dateTime: timestamp.toDateTime(), + snapName: snapName, ); } } diff --git a/packages/app_center_ratings_client/lib/src/vote.freezed.dart b/packages/app_center_ratings_client/lib/src/vote.freezed.dart deleted file mode 100644 index 71f30237a..000000000 --- a/packages/app_center_ratings_client/lib/src/vote.freezed.dart +++ /dev/null @@ -1,198 +0,0 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: type=lint -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark - -part of 'vote.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -T _$identity(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -/// @nodoc -mixin _$Vote { - String get snapId => throw _privateConstructorUsedError; - int get snapRevision => throw _privateConstructorUsedError; - bool get voteUp => throw _privateConstructorUsedError; - DateTime get dateTime => throw _privateConstructorUsedError; - - /// Create a copy of Vote - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $VoteCopyWith get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $VoteCopyWith<$Res> { - factory $VoteCopyWith(Vote value, $Res Function(Vote) then) = - _$VoteCopyWithImpl<$Res, Vote>; - @useResult - $Res call({String snapId, int snapRevision, bool voteUp, DateTime dateTime}); -} - -/// @nodoc -class _$VoteCopyWithImpl<$Res, $Val extends Vote> - implements $VoteCopyWith<$Res> { - _$VoteCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of Vote - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? snapId = null, - Object? snapRevision = null, - Object? voteUp = null, - Object? dateTime = null, - }) { - return _then(_value.copyWith( - snapId: null == snapId - ? _value.snapId - : snapId // ignore: cast_nullable_to_non_nullable - as String, - snapRevision: null == snapRevision - ? _value.snapRevision - : snapRevision // ignore: cast_nullable_to_non_nullable - as int, - voteUp: null == voteUp - ? _value.voteUp - : voteUp // ignore: cast_nullable_to_non_nullable - as bool, - dateTime: null == dateTime - ? _value.dateTime - : dateTime // ignore: cast_nullable_to_non_nullable - as DateTime, - ) as $Val); - } -} - -/// @nodoc -abstract class _$$VoteImplCopyWith<$Res> implements $VoteCopyWith<$Res> { - factory _$$VoteImplCopyWith( - _$VoteImpl value, $Res Function(_$VoteImpl) then) = - __$$VoteImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({String snapId, int snapRevision, bool voteUp, DateTime dateTime}); -} - -/// @nodoc -class __$$VoteImplCopyWithImpl<$Res> - extends _$VoteCopyWithImpl<$Res, _$VoteImpl> - implements _$$VoteImplCopyWith<$Res> { - __$$VoteImplCopyWithImpl(_$VoteImpl _value, $Res Function(_$VoteImpl) _then) - : super(_value, _then); - - /// Create a copy of Vote - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? snapId = null, - Object? snapRevision = null, - Object? voteUp = null, - Object? dateTime = null, - }) { - return _then(_$VoteImpl( - snapId: null == snapId - ? _value.snapId - : snapId // ignore: cast_nullable_to_non_nullable - as String, - snapRevision: null == snapRevision - ? _value.snapRevision - : snapRevision // ignore: cast_nullable_to_non_nullable - as int, - voteUp: null == voteUp - ? _value.voteUp - : voteUp // ignore: cast_nullable_to_non_nullable - as bool, - dateTime: null == dateTime - ? _value.dateTime - : dateTime // ignore: cast_nullable_to_non_nullable - as DateTime, - )); - } -} - -/// @nodoc - -class _$VoteImpl implements _Vote { - const _$VoteImpl( - {required this.snapId, - required this.snapRevision, - required this.voteUp, - required this.dateTime}); - - @override - final String snapId; - @override - final int snapRevision; - @override - final bool voteUp; - @override - final DateTime dateTime; - - @override - String toString() { - return 'Vote(snapId: $snapId, snapRevision: $snapRevision, voteUp: $voteUp, dateTime: $dateTime)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$VoteImpl && - (identical(other.snapId, snapId) || other.snapId == snapId) && - (identical(other.snapRevision, snapRevision) || - other.snapRevision == snapRevision) && - (identical(other.voteUp, voteUp) || other.voteUp == voteUp) && - (identical(other.dateTime, dateTime) || - other.dateTime == dateTime)); - } - - @override - int get hashCode => - Object.hash(runtimeType, snapId, snapRevision, voteUp, dateTime); - - /// Create a copy of Vote - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$VoteImplCopyWith<_$VoteImpl> get copyWith => - __$$VoteImplCopyWithImpl<_$VoteImpl>(this, _$identity); -} - -abstract class _Vote implements Vote { - const factory _Vote( - {required final String snapId, - required final int snapRevision, - required final bool voteUp, - required final DateTime dateTime}) = _$VoteImpl; - - @override - String get snapId; - @override - int get snapRevision; - @override - bool get voteUp; - @override - DateTime get dateTime; - - /// Create a copy of Vote - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$VoteImplCopyWith<_$VoteImpl> get copyWith => - throw _privateConstructorUsedError; -} diff --git a/packages/app_center_ratings_client/protos/ratings_features_common.proto b/packages/app_center_ratings_client/protos/ratings_features_common.proto index 84a53d5e2..de62d520d 100644 --- a/packages/app_center_ratings_client/protos/ratings_features_common.proto +++ b/packages/app_center_ratings_client/protos/ratings_features_common.proto @@ -6,6 +6,7 @@ message Rating { string snap_id = 1; uint64 total_votes = 2; RatingsBand ratings_band = 3; + string snap_name = 4; } enum RatingsBand { diff --git a/packages/app_center_ratings_client/protos/ratings_features_user.proto b/packages/app_center_ratings_client/protos/ratings_features_user.proto index 1ab2a6497..bd395f16e 100644 --- a/packages/app_center_ratings_client/protos/ratings_features_user.proto +++ b/packages/app_center_ratings_client/protos/ratings_features_user.proto @@ -10,7 +10,6 @@ service User { rpc Delete (google.protobuf.Empty) returns (google.protobuf.Empty) {} rpc Vote (VoteRequest) returns (google.protobuf.Empty) {} - rpc ListMyVotes (ListMyVotesRequest) returns (ListMyVotesResponse) {} rpc GetSnapVotes(GetSnapVotesRequest) returns (GetSnapVotesResponse) {} } @@ -43,6 +42,7 @@ message Vote { int32 snap_revision = 2; bool vote_up = 3; google.protobuf.Timestamp timestamp = 4; + string snap_name = 5; } message VoteRequest { diff --git a/packages/app_center_ratings_client/pubspec.yaml b/packages/app_center_ratings_client/pubspec.yaml index d99b2a75d..79e805790 100644 --- a/packages/app_center_ratings_client/pubspec.yaml +++ b/packages/app_center_ratings_client/pubspec.yaml @@ -11,6 +11,7 @@ dependencies: freezed: ^2.5.7 freezed_annotation: ^2.4.4 grpc: ^4.0.1 + json_annotation: ^4.9.0 meta: ^1.15.0 protobuf: ^3.1.0 protoc_plugin: ^21.1.2 diff --git a/packages/app_center_ratings_client/test/ratings_client_test.dart b/packages/app_center_ratings_client/test/ratings_client_test.dart index b61ac96b1..58cdc32f0 100644 --- a/packages/app_center_ratings_client/test/ratings_client_test.dart +++ b/packages/app_center_ratings_client/test/ratings_client_test.dart @@ -33,6 +33,7 @@ void main() { const snapId = 'foobar'; const token = 'bar'; const timeframe = chart.Timeframe.month; + const snapName = 'foobarName'; final pbChartList = [ pb_chart.ChartData( rawRating: 3, @@ -40,6 +41,7 @@ void main() { snapId: snapId, totalVotes: Int64(105), ratingsBand: RatingsBand.NEUTRAL, + snapName: snapName, ), ), ]; @@ -51,6 +53,7 @@ void main() { snapId: snapId, totalVotes: 105, ratingsBand: ratings.RatingsBand.neutral, + snapName: snapName, ), ), ]; @@ -98,15 +101,18 @@ void main() { test('get rating', () async { const snapId = 'foo'; const token = 'bar'; + const snapName = 'fooName'; final pbRating = Rating( snapId: snapId, totalVotes: Int64(105), ratingsBand: RatingsBand.NEUTRAL, + snapName: snapName, ); const expectedResponse = ratings.Rating( snapId: snapId, totalVotes: 105, ratingsBand: ratings.RatingsBand.neutral, + snapName: snapName, ); final mockResponse = pb.GetRatingResponse(rating: pbRating); final request = pb.GetRatingRequest(snapId: snapId); @@ -158,69 +164,6 @@ void main() { ); }); - test('list user votes', () async { - const snapIdFilter = 'foo'; - const token = 'bar'; - final time = DateTime.now().toUtc(); - final mockVotes = [ - Vote( - snapId: 'foo1', - snapRevision: 1, - voteUp: true, - timestamp: Timestamp.fromDateTime(time), - ), - Vote( - snapId: 'foo2', - snapRevision: 2, - voteUp: false, - timestamp: Timestamp.fromDateTime(time), - ), - ]; - final expectedResponse = [ - user.Vote( - snapId: 'foo1', - snapRevision: 1, - voteUp: true, - dateTime: time, - ), - user.Vote( - snapId: 'foo2', - snapRevision: 2, - voteUp: false, - dateTime: time, - ), - ]; - final mockResponse = ListMyVotesResponse(votes: mockVotes); - final request = ListMyVotesRequest(snapIdFilter: snapIdFilter); - - when( - mockUserClient.listMyVotes( - request, - options: anyNamed('options'), - ), - ).thenAnswer((_) => MockResponseFuture(mockResponse)); - final response = await ratingsClient.listMyVotes( - snapIdFilter, - token, - ); - expect(response, equals(expectedResponse)); - - final capturedArgs = verify( - mockUserClient.listMyVotes( - request, - options: captureAnyNamed('options'), - ), - ).captured; - final capturedOptions = capturedArgs.single as CallOptions; - expect( - capturedOptions.metadata, - containsPair( - 'authorization', - 'Bearer $token', - ), - ); - }); - test('user votes', () async { const snapId = 'foo'; const snapRevision = 1; @@ -261,8 +204,9 @@ void main() { }); test('user votes by snap id', () async { - const snapId = 'foo'; + const snapId = '123'; const token = 'bar'; + const snapName = 'foo'; final time = DateTime.now().toUtc(); final mockVotes = [ Vote( @@ -270,12 +214,14 @@ void main() { snapRevision: 1, voteUp: true, timestamp: Timestamp.fromDateTime(time), + snapName: snapName, ), Vote( snapId: snapId, snapRevision: 2, voteUp: false, timestamp: Timestamp.fromDateTime(time), + snapName: snapName, ), ]; final expectedResponse = [ @@ -284,12 +230,14 @@ void main() { snapRevision: 1, voteUp: true, dateTime: time, + snapName: snapName, ), user.Vote( snapId: snapId, snapRevision: 2, voteUp: false, dateTime: time, + snapName: snapName, ), ]; final mockResponse = GetSnapVotesResponse(votes: mockVotes); diff --git a/packages/app_center_ratings_client/test/ratings_client_test.mocks.dart b/packages/app_center_ratings_client/test/ratings_client_test.mocks.dart index 01103ca21..5977382fa 100644 --- a/packages/app_center_ratings_client/test/ratings_client_test.mocks.dart +++ b/packages/app_center_ratings_client/test/ratings_client_test.mocks.dart @@ -254,27 +254,6 @@ class MockUserClient extends _i1.Mock implements _i7.UserClient { ), ) as _i2.ResponseFuture<_i9.Empty>); - @override - _i2.ResponseFuture<_i8.ListMyVotesResponse> listMyVotes( - _i8.ListMyVotesRequest? request, { - _i2.CallOptions? options, - }) => - (super.noSuchMethod( - Invocation.method( - #listMyVotes, - [request], - {#options: options}, - ), - returnValue: _FakeResponseFuture_0<_i8.ListMyVotesResponse>( - this, - Invocation.method( - #listMyVotes, - [request], - {#options: options}, - ), - ), - ) as _i2.ResponseFuture<_i8.ListMyVotesResponse>); - @override _i2.ResponseFuture<_i8.GetSnapVotesResponse> getSnapVotes( _i8.GetSnapVotesRequest? request, { diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index d61b4354d..3b1e95f39 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -41,8 +41,8 @@ parts: fvm dart pub global run melos clean fvm dart pub global run melos bootstrap set -e - - fvm dart pub global run melos exec -c 1 --fail-fast --depends-on=build_runner -- \ + + fvm dart pub global run melos exec -c 1 --fail-fast --depends-on=build_runner --order-dependents -- \ fvm dart run build_runner build --delete-conflicting-outputs cd packages/app_center