From 92d8639ecaaf5077eeb6b60ad2e62f287fa62d30 Mon Sep 17 00:00:00 2001 From: kevin Date: Fri, 31 May 2019 15:44:07 +0200 Subject: [PATCH] generate code from proto --- .vscode/tasks.json | 7 +- analysis_options.yaml | 1 + common/generated_io/lib/generated_io.dart | 28 +++++ .../lib/src/models/password.pb.dart | 67 +++++++++++ .../lib/src/models/password.pbenum.dart | 6 + .../lib/src/models/password.pbjson.dart | 18 +++ .../generated_io/lib/src/models/tag.pb.dart | 56 ++++++++++ .../lib/src/models/tag.pbenum.dart | 6 + .../lib/src/models/tag.pbjson.dart | 16 +++ .../lib/src/services/accounts_service.pb.dart | 71 ++++++++++++ .../src/services/accounts_service.pbenum.dart | 6 + .../src/services/accounts_service.pbgrpc.dart | 77 +++++++++++++ .../src/services/accounts_service.pbjson.dart | 21 ++++ .../authentication_service.pbgrpc.dart | 48 ++++++++ .../src/services/passwords_service.pb.dart | 44 ++++++++ .../services/passwords_service.pbenum.dart | 6 + .../services/passwords_service.pbgrpc.dart | 105 ++++++++++++++++++ .../services/passwords_service.pbjson.dart | 14 +++ .../lib/src/services/tags_service.pb.dart | 71 ++++++++++++ .../lib/src/services/tags_service.pbenum.dart | 6 + .../lib/src/services/tags_service.pbgrpc.dart | 102 +++++++++++++++++ .../lib/src/services/tags_service.pbjson.dart | 21 ++++ 22 files changed, 796 insertions(+), 1 deletion(-) create mode 100644 common/generated_io/lib/src/models/password.pb.dart create mode 100644 common/generated_io/lib/src/models/password.pbenum.dart create mode 100644 common/generated_io/lib/src/models/password.pbjson.dart create mode 100644 common/generated_io/lib/src/models/tag.pb.dart create mode 100644 common/generated_io/lib/src/models/tag.pbenum.dart create mode 100644 common/generated_io/lib/src/models/tag.pbjson.dart create mode 100644 common/generated_io/lib/src/services/accounts_service.pb.dart create mode 100644 common/generated_io/lib/src/services/accounts_service.pbenum.dart create mode 100644 common/generated_io/lib/src/services/accounts_service.pbgrpc.dart create mode 100644 common/generated_io/lib/src/services/accounts_service.pbjson.dart create mode 100644 common/generated_io/lib/src/services/passwords_service.pb.dart create mode 100644 common/generated_io/lib/src/services/passwords_service.pbenum.dart create mode 100644 common/generated_io/lib/src/services/passwords_service.pbgrpc.dart create mode 100644 common/generated_io/lib/src/services/passwords_service.pbjson.dart create mode 100644 common/generated_io/lib/src/services/tags_service.pb.dart create mode 100644 common/generated_io/lib/src/services/tags_service.pbenum.dart create mode 100644 common/generated_io/lib/src/services/tags_service.pbgrpc.dart create mode 100644 common/generated_io/lib/src/services/tags_service.pbjson.dart diff --git a/.vscode/tasks.json b/.vscode/tasks.json index c348d32..103a6e3 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -13,7 +13,12 @@ "-Ithird_party/protobuf/src", "-Ithird_party/googleapis", "google/protobuf/empty.proto", - "services/authentication_service.proto" + "models/tag.proto", + "models/password.proto", + "services/authentication_service.proto", + "services/accounts_service.proto", + "services/passwords_service.proto", + "services/tags_service.proto", ], }, { diff --git a/analysis_options.yaml b/analysis_options.yaml index bb7a648..4628776 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -1,3 +1,4 @@ analyzer: exclude: - third_party + - common/generated_io diff --git a/common/generated_io/lib/generated_io.dart b/common/generated_io/lib/generated_io.dart index 36ce892..eb090ad 100644 --- a/common/generated_io/lib/generated_io.dart +++ b/common/generated_io/lib/generated_io.dart @@ -3,6 +3,34 @@ export 'package:generated_io/src/google/protobuf/empty.pb.dart'; export 'package:generated_io/src/google/protobuf/empty.pbenum.dart'; export 'package:generated_io/src/google/protobuf/empty.pbjson.dart'; +// password model +export 'package:generated_io/src/models/password.pb.dart'; +export 'package:generated_io/src/models/password.pbenum.dart'; +export 'package:generated_io/src/models/password.pbjson.dart'; + +// tag model +export 'package:generated_io/src/models/tag.pb.dart'; +export 'package:generated_io/src/models/tag.pbenum.dart'; +export 'package:generated_io/src/models/tag.pbjson.dart'; + +// accounts service +export 'package:generated_io/src/services/accounts_service.pb.dart'; +export 'package:generated_io/src/services/accounts_service.pbenum.dart'; +export 'package:generated_io/src/services/accounts_service.pbgrpc.dart'; +export 'package:generated_io/src/services/accounts_service.pbjson.dart'; + +// passwords service +export 'package:generated_io/src/services/passwords_service.pb.dart'; +export 'package:generated_io/src/services/passwords_service.pbenum.dart'; +export 'package:generated_io/src/services/passwords_service.pbgrpc.dart'; +export 'package:generated_io/src/services/passwords_service.pbjson.dart'; + +// tags service +export 'package:generated_io/src/services/tags_service.pb.dart'; +export 'package:generated_io/src/services/tags_service.pbenum.dart'; +export 'package:generated_io/src/services/tags_service.pbgrpc.dart'; +export 'package:generated_io/src/services/tags_service.pbjson.dart'; + // authentication service export 'package:generated_io/src/services/authentication_service.pb.dart'; export 'package:generated_io/src/services/authentication_service.pbenum.dart'; diff --git a/common/generated_io/lib/src/models/password.pb.dart b/common/generated_io/lib/src/models/password.pb.dart new file mode 100644 index 0000000..7e666da --- /dev/null +++ b/common/generated_io/lib/src/models/password.pb.dart @@ -0,0 +1,67 @@ +/// +// Generated code. Do not modify. +// source: models/password.proto +/// +// ignore_for_file: non_constant_identifier_names,library_prefixes,unused_import + +// ignore: UNUSED_SHOWN_NAME +import 'dart:core' show int, bool, double, String, List, Map, override; + +import 'package:protobuf/protobuf.dart' as $pb; + +import 'tag.pb.dart' as $2; + +class Password extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = new $pb.BuilderInfo('Password', package: const $pb.PackageName('stashall')) + ..aOS(1, 'id') + ..aOS(2, 'login') + ..aOS(3, 'encryptedPassword') + ..pp<$2.Tag>(4, 'tags', $pb.PbFieldType.PM, $2.Tag.$checkItem, $2.Tag.create) + ..aOS(5, 'description') + ..aOS(6, 'url') + ..hasRequiredFields = false + ; + + Password() : super(); + Password.fromBuffer(List i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) : super.fromBuffer(i, r); + Password.fromJson(String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) : super.fromJson(i, r); + Password clone() => new Password()..mergeFromMessage(this); + Password copyWith(void Function(Password) updates) => super.copyWith((message) => updates(message as Password)); + $pb.BuilderInfo get info_ => _i; + static Password create() => new Password(); + Password createEmptyInstance() => create(); + static $pb.PbList createRepeated() => new $pb.PbList(); + static Password getDefault() => _defaultInstance ??= create()..freeze(); + static Password _defaultInstance; + static void $checkItem(Password v) { + if (v is! Password) $pb.checkItemFailed(v, _i.qualifiedMessageName); + } + + String get id => $_getS(0, ''); + set id(String v) { $_setString(0, v); } + bool hasId() => $_has(0); + void clearId() => clearField(1); + + String get login => $_getS(1, ''); + set login(String v) { $_setString(1, v); } + bool hasLogin() => $_has(1); + void clearLogin() => clearField(2); + + String get encryptedPassword => $_getS(2, ''); + set encryptedPassword(String v) { $_setString(2, v); } + bool hasEncryptedPassword() => $_has(2); + void clearEncryptedPassword() => clearField(3); + + List<$2.Tag> get tags => $_getList(3); + + String get description => $_getS(4, ''); + set description(String v) { $_setString(4, v); } + bool hasDescription() => $_has(4); + void clearDescription() => clearField(5); + + String get url => $_getS(5, ''); + set url(String v) { $_setString(5, v); } + bool hasUrl() => $_has(5); + void clearUrl() => clearField(6); +} + diff --git a/common/generated_io/lib/src/models/password.pbenum.dart b/common/generated_io/lib/src/models/password.pbenum.dart new file mode 100644 index 0000000..26d6c85 --- /dev/null +++ b/common/generated_io/lib/src/models/password.pbenum.dart @@ -0,0 +1,6 @@ +/// +// Generated code. Do not modify. +// source: models/password.proto +/// +// ignore_for_file: non_constant_identifier_names,library_prefixes,unused_import + diff --git a/common/generated_io/lib/src/models/password.pbjson.dart b/common/generated_io/lib/src/models/password.pbjson.dart new file mode 100644 index 0000000..a93c833 --- /dev/null +++ b/common/generated_io/lib/src/models/password.pbjson.dart @@ -0,0 +1,18 @@ +/// +// Generated code. Do not modify. +// source: models/password.proto +/// +// ignore_for_file: non_constant_identifier_names,library_prefixes,unused_import + +const Password$json = const { + '1': 'Password', + '2': const [ + const {'1': 'id', '3': 1, '4': 1, '5': 9, '10': 'id'}, + const {'1': 'login', '3': 2, '4': 1, '5': 9, '10': 'login'}, + const {'1': 'encryptedPassword', '3': 3, '4': 1, '5': 9, '10': 'encryptedPassword'}, + const {'1': 'tags', '3': 4, '4': 3, '5': 11, '6': '.stashall.Tag', '10': 'tags'}, + const {'1': 'description', '3': 5, '4': 1, '5': 9, '10': 'description'}, + const {'1': 'url', '3': 6, '4': 1, '5': 9, '10': 'url'}, + ], +}; + diff --git a/common/generated_io/lib/src/models/tag.pb.dart b/common/generated_io/lib/src/models/tag.pb.dart new file mode 100644 index 0000000..377f2fb --- /dev/null +++ b/common/generated_io/lib/src/models/tag.pb.dart @@ -0,0 +1,56 @@ +/// +// Generated code. Do not modify. +// source: models/tag.proto +/// +// ignore_for_file: non_constant_identifier_names,library_prefixes,unused_import + +// ignore: UNUSED_SHOWN_NAME +import 'dart:core' show int, bool, double, String, List, Map, override; + +import 'package:protobuf/protobuf.dart' as $pb; + +class Tag extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = new $pb.BuilderInfo('Tag', package: const $pb.PackageName('stashall')) + ..aOS(1, 'id') + ..aOS(2, 'label') + ..aOS(3, 'description') + ..aOS(4, 'color') + ..hasRequiredFields = false + ; + + Tag() : super(); + Tag.fromBuffer(List i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) : super.fromBuffer(i, r); + Tag.fromJson(String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) : super.fromJson(i, r); + Tag clone() => new Tag()..mergeFromMessage(this); + Tag copyWith(void Function(Tag) updates) => super.copyWith((message) => updates(message as Tag)); + $pb.BuilderInfo get info_ => _i; + static Tag create() => new Tag(); + Tag createEmptyInstance() => create(); + static $pb.PbList createRepeated() => new $pb.PbList(); + static Tag getDefault() => _defaultInstance ??= create()..freeze(); + static Tag _defaultInstance; + static void $checkItem(Tag v) { + if (v is! Tag) $pb.checkItemFailed(v, _i.qualifiedMessageName); + } + + String get id => $_getS(0, ''); + set id(String v) { $_setString(0, v); } + bool hasId() => $_has(0); + void clearId() => clearField(1); + + String get label => $_getS(1, ''); + set label(String v) { $_setString(1, v); } + bool hasLabel() => $_has(1); + void clearLabel() => clearField(2); + + String get description => $_getS(2, ''); + set description(String v) { $_setString(2, v); } + bool hasDescription() => $_has(2); + void clearDescription() => clearField(3); + + String get color => $_getS(3, ''); + set color(String v) { $_setString(3, v); } + bool hasColor() => $_has(3); + void clearColor() => clearField(4); +} + diff --git a/common/generated_io/lib/src/models/tag.pbenum.dart b/common/generated_io/lib/src/models/tag.pbenum.dart new file mode 100644 index 0000000..006a968 --- /dev/null +++ b/common/generated_io/lib/src/models/tag.pbenum.dart @@ -0,0 +1,6 @@ +/// +// Generated code. Do not modify. +// source: models/tag.proto +/// +// ignore_for_file: non_constant_identifier_names,library_prefixes,unused_import + diff --git a/common/generated_io/lib/src/models/tag.pbjson.dart b/common/generated_io/lib/src/models/tag.pbjson.dart new file mode 100644 index 0000000..d3dec82 --- /dev/null +++ b/common/generated_io/lib/src/models/tag.pbjson.dart @@ -0,0 +1,16 @@ +/// +// Generated code. Do not modify. +// source: models/tag.proto +/// +// ignore_for_file: non_constant_identifier_names,library_prefixes,unused_import + +const Tag$json = const { + '1': 'Tag', + '2': const [ + const {'1': 'id', '3': 1, '4': 1, '5': 9, '10': 'id'}, + const {'1': 'label', '3': 2, '4': 1, '5': 9, '10': 'label'}, + const {'1': 'description', '3': 3, '4': 1, '5': 9, '10': 'description'}, + const {'1': 'color', '3': 4, '4': 1, '5': 9, '10': 'color'}, + ], +}; + diff --git a/common/generated_io/lib/src/services/accounts_service.pb.dart b/common/generated_io/lib/src/services/accounts_service.pb.dart new file mode 100644 index 0000000..003da76 --- /dev/null +++ b/common/generated_io/lib/src/services/accounts_service.pb.dart @@ -0,0 +1,71 @@ +/// +// Generated code. Do not modify. +// source: services/accounts_service.proto +/// +// ignore_for_file: non_constant_identifier_names,library_prefixes,unused_import + +// ignore: UNUSED_SHOWN_NAME +import 'dart:core' show int, bool, double, String, List, Map, override; + +import 'package:protobuf/protobuf.dart' as $pb; + +class CreateAccountRequest extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = new $pb.BuilderInfo('CreateAccountRequest', package: const $pb.PackageName('stashall')) + ..aOS(1, 'email') + ..aOS(2, 'password') + ..hasRequiredFields = false + ; + + CreateAccountRequest() : super(); + CreateAccountRequest.fromBuffer(List i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) : super.fromBuffer(i, r); + CreateAccountRequest.fromJson(String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) : super.fromJson(i, r); + CreateAccountRequest clone() => new CreateAccountRequest()..mergeFromMessage(this); + CreateAccountRequest copyWith(void Function(CreateAccountRequest) updates) => super.copyWith((message) => updates(message as CreateAccountRequest)); + $pb.BuilderInfo get info_ => _i; + static CreateAccountRequest create() => new CreateAccountRequest(); + CreateAccountRequest createEmptyInstance() => create(); + static $pb.PbList createRepeated() => new $pb.PbList(); + static CreateAccountRequest getDefault() => _defaultInstance ??= create()..freeze(); + static CreateAccountRequest _defaultInstance; + static void $checkItem(CreateAccountRequest v) { + if (v is! CreateAccountRequest) $pb.checkItemFailed(v, _i.qualifiedMessageName); + } + + String get email => $_getS(0, ''); + set email(String v) { $_setString(0, v); } + bool hasEmail() => $_has(0); + void clearEmail() => clearField(1); + + String get password => $_getS(1, ''); + set password(String v) { $_setString(1, v); } + bool hasPassword() => $_has(1); + void clearPassword() => clearField(2); +} + +class MeResponse extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = new $pb.BuilderInfo('MeResponse', package: const $pb.PackageName('stashall')) + ..aOS(1, 'email') + ..hasRequiredFields = false + ; + + MeResponse() : super(); + MeResponse.fromBuffer(List i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) : super.fromBuffer(i, r); + MeResponse.fromJson(String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) : super.fromJson(i, r); + MeResponse clone() => new MeResponse()..mergeFromMessage(this); + MeResponse copyWith(void Function(MeResponse) updates) => super.copyWith((message) => updates(message as MeResponse)); + $pb.BuilderInfo get info_ => _i; + static MeResponse create() => new MeResponse(); + MeResponse createEmptyInstance() => create(); + static $pb.PbList createRepeated() => new $pb.PbList(); + static MeResponse getDefault() => _defaultInstance ??= create()..freeze(); + static MeResponse _defaultInstance; + static void $checkItem(MeResponse v) { + if (v is! MeResponse) $pb.checkItemFailed(v, _i.qualifiedMessageName); + } + + String get email => $_getS(0, ''); + set email(String v) { $_setString(0, v); } + bool hasEmail() => $_has(0); + void clearEmail() => clearField(1); +} + diff --git a/common/generated_io/lib/src/services/accounts_service.pbenum.dart b/common/generated_io/lib/src/services/accounts_service.pbenum.dart new file mode 100644 index 0000000..1e58ab6 --- /dev/null +++ b/common/generated_io/lib/src/services/accounts_service.pbenum.dart @@ -0,0 +1,6 @@ +/// +// Generated code. Do not modify. +// source: services/accounts_service.proto +/// +// ignore_for_file: non_constant_identifier_names,library_prefixes,unused_import + diff --git a/common/generated_io/lib/src/services/accounts_service.pbgrpc.dart b/common/generated_io/lib/src/services/accounts_service.pbgrpc.dart new file mode 100644 index 0000000..7d8f6e1 --- /dev/null +++ b/common/generated_io/lib/src/services/accounts_service.pbgrpc.dart @@ -0,0 +1,77 @@ +/// +// Generated code. Do not modify. +// source: services/accounts_service.proto +/// +// ignore_for_file: non_constant_identifier_names,library_prefixes,unused_import + +import 'dart:async' as $async; + +import 'package:grpc/grpc.dart'; + +import 'accounts_service.pb.dart'; +import '../google/protobuf/empty.pb.dart' as $0; +export 'accounts_service.pb.dart'; + +class AccountsServiceClient extends Client { + static final _$createAccount = + new ClientMethod( + '/stashall.AccountsService/createAccount', + (CreateAccountRequest value) => value.writeToBuffer(), + (List value) => new $0.Empty.fromBuffer(value)); + static final _$me = new ClientMethod<$0.Empty, MeResponse>( + '/stashall.AccountsService/me', + ($0.Empty value) => value.writeToBuffer(), + (List value) => new MeResponse.fromBuffer(value)); + + AccountsServiceClient(ClientChannel channel, {CallOptions options}) + : super(channel, options: options); + + ResponseFuture<$0.Empty> createAccount(CreateAccountRequest request, + {CallOptions options}) { + final call = $createCall( + _$createAccount, new $async.Stream.fromIterable([request]), + options: options); + return new ResponseFuture(call); + } + + ResponseFuture me($0.Empty request, {CallOptions options}) { + final call = $createCall(_$me, new $async.Stream.fromIterable([request]), + options: options); + return new ResponseFuture(call); + } +} + +abstract class AccountsServiceBase extends Service { + String get $name => 'stashall.AccountsService'; + + AccountsServiceBase() { + $addMethod(new ServiceMethod( + 'createAccount', + createAccount_Pre, + false, + false, + (List value) => new CreateAccountRequest.fromBuffer(value), + ($0.Empty value) => value.writeToBuffer())); + $addMethod(new ServiceMethod<$0.Empty, MeResponse>( + 'me', + me_Pre, + false, + false, + (List value) => new $0.Empty.fromBuffer(value), + (MeResponse value) => value.writeToBuffer())); + } + + $async.Future<$0.Empty> createAccount_Pre( + ServiceCall call, $async.Future request) async { + return createAccount(call, await request); + } + + $async.Future me_Pre( + ServiceCall call, $async.Future request) async { + return me(call, await request); + } + + $async.Future<$0.Empty> createAccount( + ServiceCall call, CreateAccountRequest request); + $async.Future me(ServiceCall call, $0.Empty request); +} diff --git a/common/generated_io/lib/src/services/accounts_service.pbjson.dart b/common/generated_io/lib/src/services/accounts_service.pbjson.dart new file mode 100644 index 0000000..fe443c8 --- /dev/null +++ b/common/generated_io/lib/src/services/accounts_service.pbjson.dart @@ -0,0 +1,21 @@ +/// +// Generated code. Do not modify. +// source: services/accounts_service.proto +/// +// ignore_for_file: non_constant_identifier_names,library_prefixes,unused_import + +const CreateAccountRequest$json = const { + '1': 'CreateAccountRequest', + '2': const [ + const {'1': 'email', '3': 1, '4': 1, '5': 9, '10': 'email'}, + const {'1': 'password', '3': 2, '4': 1, '5': 9, '10': 'password'}, + ], +}; + +const MeResponse$json = const { + '1': 'MeResponse', + '2': const [ + const {'1': 'email', '3': 1, '4': 1, '5': 9, '10': 'email'}, + ], +}; + diff --git a/common/generated_io/lib/src/services/authentication_service.pbgrpc.dart b/common/generated_io/lib/src/services/authentication_service.pbgrpc.dart index efc7bab..552ea4f 100644 --- a/common/generated_io/lib/src/services/authentication_service.pbgrpc.dart +++ b/common/generated_io/lib/src/services/authentication_service.pbgrpc.dart @@ -17,6 +17,14 @@ class AuthenticationServiceClient extends Client { '/stashall.AuthenticationService/signin', (SigninRequest value) => value.writeToBuffer(), (List value) => new $0.Empty.fromBuffer(value)); + static final _$signout = new ClientMethod<$0.Empty, $0.Empty>( + '/stashall.AuthenticationService/signout', + ($0.Empty value) => value.writeToBuffer(), + (List value) => new $0.Empty.fromBuffer(value)); + static final _$isLogged = new ClientMethod<$0.Empty, $0.Empty>( + '/stashall.AuthenticationService/isLogged', + ($0.Empty value) => value.writeToBuffer(), + (List value) => new $0.Empty.fromBuffer(value)); AuthenticationServiceClient(ClientChannel channel, {CallOptions options}) : super(channel, options: options); @@ -28,6 +36,20 @@ class AuthenticationServiceClient extends Client { options: options); return new ResponseFuture(call); } + + ResponseFuture<$0.Empty> signout($0.Empty request, {CallOptions options}) { + final call = $createCall( + _$signout, new $async.Stream.fromIterable([request]), + options: options); + return new ResponseFuture(call); + } + + ResponseFuture<$0.Empty> isLogged($0.Empty request, {CallOptions options}) { + final call = $createCall( + _$isLogged, new $async.Stream.fromIterable([request]), + options: options); + return new ResponseFuture(call); + } } abstract class AuthenticationServiceBase extends Service { @@ -41,6 +63,20 @@ abstract class AuthenticationServiceBase extends Service { false, (List value) => new SigninRequest.fromBuffer(value), ($0.Empty value) => value.writeToBuffer())); + $addMethod(new ServiceMethod<$0.Empty, $0.Empty>( + 'signout', + signout_Pre, + false, + false, + (List value) => new $0.Empty.fromBuffer(value), + ($0.Empty value) => value.writeToBuffer())); + $addMethod(new ServiceMethod<$0.Empty, $0.Empty>( + 'isLogged', + isLogged_Pre, + false, + false, + (List value) => new $0.Empty.fromBuffer(value), + ($0.Empty value) => value.writeToBuffer())); } $async.Future<$0.Empty> signin_Pre( @@ -48,5 +84,17 @@ abstract class AuthenticationServiceBase extends Service { return signin(call, await request); } + $async.Future<$0.Empty> signout_Pre( + ServiceCall call, $async.Future request) async { + return signout(call, await request); + } + + $async.Future<$0.Empty> isLogged_Pre( + ServiceCall call, $async.Future request) async { + return isLogged(call, await request); + } + $async.Future<$0.Empty> signin(ServiceCall call, SigninRequest request); + $async.Future<$0.Empty> signout(ServiceCall call, $0.Empty request); + $async.Future<$0.Empty> isLogged(ServiceCall call, $0.Empty request); } diff --git a/common/generated_io/lib/src/services/passwords_service.pb.dart b/common/generated_io/lib/src/services/passwords_service.pb.dart new file mode 100644 index 0000000..2f0b760 --- /dev/null +++ b/common/generated_io/lib/src/services/passwords_service.pb.dart @@ -0,0 +1,44 @@ +/// +// Generated code. Do not modify. +// source: services/passwords_service.proto +/// +// ignore_for_file: non_constant_identifier_names,library_prefixes,unused_import + +// ignore: UNUSED_SHOWN_NAME +import 'dart:core' show int, bool, double, String, List, Map, override; + +import 'package:protobuf/protobuf.dart' as $pb; + +class CreatePasswordRequest extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = new $pb.BuilderInfo('CreatePasswordRequest', package: const $pb.PackageName('stashall')) + ..aOS(1, 'login') + ..aOS(2, 'password') + ..hasRequiredFields = false + ; + + CreatePasswordRequest() : super(); + CreatePasswordRequest.fromBuffer(List i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) : super.fromBuffer(i, r); + CreatePasswordRequest.fromJson(String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) : super.fromJson(i, r); + CreatePasswordRequest clone() => new CreatePasswordRequest()..mergeFromMessage(this); + CreatePasswordRequest copyWith(void Function(CreatePasswordRequest) updates) => super.copyWith((message) => updates(message as CreatePasswordRequest)); + $pb.BuilderInfo get info_ => _i; + static CreatePasswordRequest create() => new CreatePasswordRequest(); + CreatePasswordRequest createEmptyInstance() => create(); + static $pb.PbList createRepeated() => new $pb.PbList(); + static CreatePasswordRequest getDefault() => _defaultInstance ??= create()..freeze(); + static CreatePasswordRequest _defaultInstance; + static void $checkItem(CreatePasswordRequest v) { + if (v is! CreatePasswordRequest) $pb.checkItemFailed(v, _i.qualifiedMessageName); + } + + String get login => $_getS(0, ''); + set login(String v) { $_setString(0, v); } + bool hasLogin() => $_has(0); + void clearLogin() => clearField(1); + + String get password => $_getS(1, ''); + set password(String v) { $_setString(1, v); } + bool hasPassword() => $_has(1); + void clearPassword() => clearField(2); +} + diff --git a/common/generated_io/lib/src/services/passwords_service.pbenum.dart b/common/generated_io/lib/src/services/passwords_service.pbenum.dart new file mode 100644 index 0000000..8af6080 --- /dev/null +++ b/common/generated_io/lib/src/services/passwords_service.pbenum.dart @@ -0,0 +1,6 @@ +/// +// Generated code. Do not modify. +// source: services/passwords_service.proto +/// +// ignore_for_file: non_constant_identifier_names,library_prefixes,unused_import + diff --git a/common/generated_io/lib/src/services/passwords_service.pbgrpc.dart b/common/generated_io/lib/src/services/passwords_service.pbgrpc.dart new file mode 100644 index 0000000..c0fb987 --- /dev/null +++ b/common/generated_io/lib/src/services/passwords_service.pbgrpc.dart @@ -0,0 +1,105 @@ +/// +// Generated code. Do not modify. +// source: services/passwords_service.proto +/// +// ignore_for_file: non_constant_identifier_names,library_prefixes,unused_import + +import 'dart:async' as $async; + +import 'package:grpc/grpc.dart'; + +import 'passwords_service.pb.dart'; +import '../google/protobuf/empty.pb.dart' as $0; +import '../models/password.pb.dart' as $1; +export 'passwords_service.pb.dart'; + +class PasswordsServiceClient extends Client { + static final _$createPassword = + new ClientMethod( + '/stashall.PasswordsService/createPassword', + (CreatePasswordRequest value) => value.writeToBuffer(), + (List value) => new $0.Empty.fromBuffer(value)); + static final _$editPassword = new ClientMethod<$1.Password, $0.Empty>( + '/stashall.PasswordsService/editPassword', + ($1.Password value) => value.writeToBuffer(), + (List value) => new $0.Empty.fromBuffer(value)); + static final _$deletePassword = new ClientMethod<$1.Password, $0.Empty>( + '/stashall.PasswordsService/deletePassword', + ($1.Password value) => value.writeToBuffer(), + (List value) => new $0.Empty.fromBuffer(value)); + + PasswordsServiceClient(ClientChannel channel, {CallOptions options}) + : super(channel, options: options); + + ResponseFuture<$0.Empty> createPassword(CreatePasswordRequest request, + {CallOptions options}) { + final call = $createCall( + _$createPassword, new $async.Stream.fromIterable([request]), + options: options); + return new ResponseFuture(call); + } + + ResponseFuture<$0.Empty> editPassword($1.Password request, + {CallOptions options}) { + final call = $createCall( + _$editPassword, new $async.Stream.fromIterable([request]), + options: options); + return new ResponseFuture(call); + } + + ResponseFuture<$0.Empty> deletePassword($1.Password request, + {CallOptions options}) { + final call = $createCall( + _$deletePassword, new $async.Stream.fromIterable([request]), + options: options); + return new ResponseFuture(call); + } +} + +abstract class PasswordsServiceBase extends Service { + String get $name => 'stashall.PasswordsService'; + + PasswordsServiceBase() { + $addMethod(new ServiceMethod( + 'createPassword', + createPassword_Pre, + false, + false, + (List value) => new CreatePasswordRequest.fromBuffer(value), + ($0.Empty value) => value.writeToBuffer())); + $addMethod(new ServiceMethod<$1.Password, $0.Empty>( + 'editPassword', + editPassword_Pre, + false, + false, + (List value) => new $1.Password.fromBuffer(value), + ($0.Empty value) => value.writeToBuffer())); + $addMethod(new ServiceMethod<$1.Password, $0.Empty>( + 'deletePassword', + deletePassword_Pre, + false, + false, + (List value) => new $1.Password.fromBuffer(value), + ($0.Empty value) => value.writeToBuffer())); + } + + $async.Future<$0.Empty> createPassword_Pre( + ServiceCall call, $async.Future request) async { + return createPassword(call, await request); + } + + $async.Future<$0.Empty> editPassword_Pre( + ServiceCall call, $async.Future request) async { + return editPassword(call, await request); + } + + $async.Future<$0.Empty> deletePassword_Pre( + ServiceCall call, $async.Future request) async { + return deletePassword(call, await request); + } + + $async.Future<$0.Empty> createPassword( + ServiceCall call, CreatePasswordRequest request); + $async.Future<$0.Empty> editPassword(ServiceCall call, $1.Password request); + $async.Future<$0.Empty> deletePassword(ServiceCall call, $1.Password request); +} diff --git a/common/generated_io/lib/src/services/passwords_service.pbjson.dart b/common/generated_io/lib/src/services/passwords_service.pbjson.dart new file mode 100644 index 0000000..4b180bc --- /dev/null +++ b/common/generated_io/lib/src/services/passwords_service.pbjson.dart @@ -0,0 +1,14 @@ +/// +// Generated code. Do not modify. +// source: services/passwords_service.proto +/// +// ignore_for_file: non_constant_identifier_names,library_prefixes,unused_import + +const CreatePasswordRequest$json = const { + '1': 'CreatePasswordRequest', + '2': const [ + const {'1': 'login', '3': 1, '4': 1, '5': 9, '10': 'login'}, + const {'1': 'password', '3': 2, '4': 1, '5': 9, '10': 'password'}, + ], +}; + diff --git a/common/generated_io/lib/src/services/tags_service.pb.dart b/common/generated_io/lib/src/services/tags_service.pb.dart new file mode 100644 index 0000000..b109d91 --- /dev/null +++ b/common/generated_io/lib/src/services/tags_service.pb.dart @@ -0,0 +1,71 @@ +/// +// Generated code. Do not modify. +// source: services/tags_service.proto +/// +// ignore_for_file: non_constant_identifier_names,library_prefixes,unused_import + +// ignore: UNUSED_SHOWN_NAME +import 'dart:core' show int, bool, double, String, List, Map, override; + +import 'package:protobuf/protobuf.dart' as $pb; + +class CreateTagRequest extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = new $pb.BuilderInfo('CreateTagRequest', package: const $pb.PackageName('stashall')) + ..aOS(1, 'label') + ..aOS(2, 'color') + ..hasRequiredFields = false + ; + + CreateTagRequest() : super(); + CreateTagRequest.fromBuffer(List i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) : super.fromBuffer(i, r); + CreateTagRequest.fromJson(String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) : super.fromJson(i, r); + CreateTagRequest clone() => new CreateTagRequest()..mergeFromMessage(this); + CreateTagRequest copyWith(void Function(CreateTagRequest) updates) => super.copyWith((message) => updates(message as CreateTagRequest)); + $pb.BuilderInfo get info_ => _i; + static CreateTagRequest create() => new CreateTagRequest(); + CreateTagRequest createEmptyInstance() => create(); + static $pb.PbList createRepeated() => new $pb.PbList(); + static CreateTagRequest getDefault() => _defaultInstance ??= create()..freeze(); + static CreateTagRequest _defaultInstance; + static void $checkItem(CreateTagRequest v) { + if (v is! CreateTagRequest) $pb.checkItemFailed(v, _i.qualifiedMessageName); + } + + String get label => $_getS(0, ''); + set label(String v) { $_setString(0, v); } + bool hasLabel() => $_has(0); + void clearLabel() => clearField(1); + + String get color => $_getS(1, ''); + set color(String v) { $_setString(1, v); } + bool hasColor() => $_has(1); + void clearColor() => clearField(2); +} + +class DeleteTagRequest extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = new $pb.BuilderInfo('DeleteTagRequest', package: const $pb.PackageName('stashall')) + ..aOS(1, 'id') + ..hasRequiredFields = false + ; + + DeleteTagRequest() : super(); + DeleteTagRequest.fromBuffer(List i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) : super.fromBuffer(i, r); + DeleteTagRequest.fromJson(String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) : super.fromJson(i, r); + DeleteTagRequest clone() => new DeleteTagRequest()..mergeFromMessage(this); + DeleteTagRequest copyWith(void Function(DeleteTagRequest) updates) => super.copyWith((message) => updates(message as DeleteTagRequest)); + $pb.BuilderInfo get info_ => _i; + static DeleteTagRequest create() => new DeleteTagRequest(); + DeleteTagRequest createEmptyInstance() => create(); + static $pb.PbList createRepeated() => new $pb.PbList(); + static DeleteTagRequest getDefault() => _defaultInstance ??= create()..freeze(); + static DeleteTagRequest _defaultInstance; + static void $checkItem(DeleteTagRequest v) { + if (v is! DeleteTagRequest) $pb.checkItemFailed(v, _i.qualifiedMessageName); + } + + String get id => $_getS(0, ''); + set id(String v) { $_setString(0, v); } + bool hasId() => $_has(0); + void clearId() => clearField(1); +} + diff --git a/common/generated_io/lib/src/services/tags_service.pbenum.dart b/common/generated_io/lib/src/services/tags_service.pbenum.dart new file mode 100644 index 0000000..f38f175 --- /dev/null +++ b/common/generated_io/lib/src/services/tags_service.pbenum.dart @@ -0,0 +1,6 @@ +/// +// Generated code. Do not modify. +// source: services/tags_service.proto +/// +// ignore_for_file: non_constant_identifier_names,library_prefixes,unused_import + diff --git a/common/generated_io/lib/src/services/tags_service.pbgrpc.dart b/common/generated_io/lib/src/services/tags_service.pbgrpc.dart new file mode 100644 index 0000000..4956c71 --- /dev/null +++ b/common/generated_io/lib/src/services/tags_service.pbgrpc.dart @@ -0,0 +1,102 @@ +/// +// Generated code. Do not modify. +// source: services/tags_service.proto +/// +// ignore_for_file: non_constant_identifier_names,library_prefixes,unused_import + +import 'dart:async' as $async; + +import 'package:grpc/grpc.dart'; + +import 'tags_service.pb.dart'; +import '../models/tag.pb.dart' as $2; +import '../google/protobuf/empty.pb.dart' as $0; +export 'tags_service.pb.dart'; + +class TagsServiceClient extends Client { + static final _$createTag = new ClientMethod( + '/stashall.TagsService/createTag', + (CreateTagRequest value) => value.writeToBuffer(), + (List value) => new $2.Tag.fromBuffer(value)); + static final _$editTag = new ClientMethod<$2.Tag, $0.Empty>( + '/stashall.TagsService/editTag', + ($2.Tag value) => value.writeToBuffer(), + (List value) => new $0.Empty.fromBuffer(value)); + static final _$deleteTag = new ClientMethod( + '/stashall.TagsService/deleteTag', + (DeleteTagRequest value) => value.writeToBuffer(), + (List value) => new $0.Empty.fromBuffer(value)); + + TagsServiceClient(ClientChannel channel, {CallOptions options}) + : super(channel, options: options); + + ResponseFuture<$2.Tag> createTag(CreateTagRequest request, + {CallOptions options}) { + final call = $createCall( + _$createTag, new $async.Stream.fromIterable([request]), + options: options); + return new ResponseFuture(call); + } + + ResponseFuture<$0.Empty> editTag($2.Tag request, {CallOptions options}) { + final call = $createCall( + _$editTag, new $async.Stream.fromIterable([request]), + options: options); + return new ResponseFuture(call); + } + + ResponseFuture<$0.Empty> deleteTag(DeleteTagRequest request, + {CallOptions options}) { + final call = $createCall( + _$deleteTag, new $async.Stream.fromIterable([request]), + options: options); + return new ResponseFuture(call); + } +} + +abstract class TagsServiceBase extends Service { + String get $name => 'stashall.TagsService'; + + TagsServiceBase() { + $addMethod(new ServiceMethod( + 'createTag', + createTag_Pre, + false, + false, + (List value) => new CreateTagRequest.fromBuffer(value), + ($2.Tag value) => value.writeToBuffer())); + $addMethod(new ServiceMethod<$2.Tag, $0.Empty>( + 'editTag', + editTag_Pre, + false, + false, + (List value) => new $2.Tag.fromBuffer(value), + ($0.Empty value) => value.writeToBuffer())); + $addMethod(new ServiceMethod( + 'deleteTag', + deleteTag_Pre, + false, + false, + (List value) => new DeleteTagRequest.fromBuffer(value), + ($0.Empty value) => value.writeToBuffer())); + } + + $async.Future<$2.Tag> createTag_Pre( + ServiceCall call, $async.Future request) async { + return createTag(call, await request); + } + + $async.Future<$0.Empty> editTag_Pre( + ServiceCall call, $async.Future request) async { + return editTag(call, await request); + } + + $async.Future<$0.Empty> deleteTag_Pre( + ServiceCall call, $async.Future request) async { + return deleteTag(call, await request); + } + + $async.Future<$2.Tag> createTag(ServiceCall call, CreateTagRequest request); + $async.Future<$0.Empty> editTag(ServiceCall call, $2.Tag request); + $async.Future<$0.Empty> deleteTag(ServiceCall call, DeleteTagRequest request); +} diff --git a/common/generated_io/lib/src/services/tags_service.pbjson.dart b/common/generated_io/lib/src/services/tags_service.pbjson.dart new file mode 100644 index 0000000..c1a8062 --- /dev/null +++ b/common/generated_io/lib/src/services/tags_service.pbjson.dart @@ -0,0 +1,21 @@ +/// +// Generated code. Do not modify. +// source: services/tags_service.proto +/// +// ignore_for_file: non_constant_identifier_names,library_prefixes,unused_import + +const CreateTagRequest$json = const { + '1': 'CreateTagRequest', + '2': const [ + const {'1': 'label', '3': 1, '4': 1, '5': 9, '10': 'label'}, + const {'1': 'color', '3': 2, '4': 1, '5': 9, '10': 'color'}, + ], +}; + +const DeleteTagRequest$json = const { + '1': 'DeleteTagRequest', + '2': const [ + const {'1': 'id', '3': 1, '4': 1, '5': 9, '10': 'id'}, + ], +}; +