Update generated code using latest protoc_plugin. (#30)

Preparation for updating the call generation logic.
This commit is contained in:
Jakob Andersen 2017-08-23 12:47:48 +02:00 committed by GitHub
parent 83ee9c2edb
commit 05bb6a5d08
7 changed files with 84 additions and 92 deletions

View File

@ -12,7 +12,7 @@ import 'package:protobuf/protobuf.dart';
class Record extends GeneratedMessage { class Record extends GeneratedMessage {
static final BuilderInfo _i = new BuilderInfo('Record') static final BuilderInfo _i = new BuilderInfo('Record')
..a/*<String>*/(1, 'value', PbFieldType.OS) ..a<String>(1, 'value', PbFieldType.OS)
..hasRequiredFields = false; ..hasRequiredFields = false;
Record() : super(); Record() : super();
@ -48,7 +48,7 @@ class _ReadonlyRecord extends Record with ReadonlyMessageMixin {}
class Number extends GeneratedMessage { class Number extends GeneratedMessage {
static final BuilderInfo _i = new BuilderInfo('Number') static final BuilderInfo _i = new BuilderInfo('Number')
..a/*<int>*/(1, 'value', PbFieldType.O3) ..a<int>(1, 'value', PbFieldType.O3)
..hasRequiredFields = false; ..hasRequiredFields = false;
Number() : super(); Number() : super();

View File

@ -29,7 +29,7 @@ $ dart bin/client.dart
If you have made changes to the message or service definition in If you have made changes to the message or service definition in
`protos/route_guide.proto` and need to regenerate the corresponding Dart files, `protos/route_guide.proto` and need to regenerate the corresponding Dart files,
you will need to have protoc version 3.0.0 or higher and the Dart protoc plugin you will need to have protoc version 3.0.0 or higher and the Dart protoc plugin
version 0.7.3 or higher on your PATH. version 0.7.6 or higher on your PATH.
To install protoc, see the instructions on To install protoc, see the instructions on
[the Protocol Buffers website](https://developers.google.com/protocol-buffers/). [the Protocol Buffers website](https://developers.google.com/protocol-buffers/).

View File

@ -12,8 +12,8 @@ import 'package:protobuf/protobuf.dart';
class Point extends GeneratedMessage { class Point extends GeneratedMessage {
static final BuilderInfo _i = new BuilderInfo('Point') static final BuilderInfo _i = new BuilderInfo('Point')
..a/*<int>*/(1, 'latitude', PbFieldType.O3) ..a<int>(1, 'latitude', PbFieldType.O3)
..a/*<int>*/(2, 'longitude', PbFieldType.O3) ..a<int>(2, 'longitude', PbFieldType.O3)
..hasRequiredFields = false; ..hasRequiredFields = false;
Point() : super(); Point() : super();
@ -56,8 +56,8 @@ class _ReadonlyPoint extends Point with ReadonlyMessageMixin {}
class Rectangle extends GeneratedMessage { class Rectangle extends GeneratedMessage {
static final BuilderInfo _i = new BuilderInfo('Rectangle') static final BuilderInfo _i = new BuilderInfo('Rectangle')
..a/*<Point>*/(1, 'lo', PbFieldType.OM, Point.getDefault, Point.create) ..a<Point>(1, 'lo', PbFieldType.OM, Point.getDefault, Point.create)
..a/*<Point>*/(2, 'hi', PbFieldType.OM, Point.getDefault, Point.create) ..a<Point>(2, 'hi', PbFieldType.OM, Point.getDefault, Point.create)
..hasRequiredFields = false; ..hasRequiredFields = false;
Rectangle() : super(); Rectangle() : super();
@ -101,9 +101,8 @@ class _ReadonlyRectangle extends Rectangle with ReadonlyMessageMixin {}
class Feature extends GeneratedMessage { class Feature extends GeneratedMessage {
static final BuilderInfo _i = new BuilderInfo('Feature') static final BuilderInfo _i = new BuilderInfo('Feature')
..a/*<String>*/(1, 'name', PbFieldType.OS) ..a<String>(1, 'name', PbFieldType.OS)
..a/*<Point>*/( ..a<Point>(2, 'location', PbFieldType.OM, Point.getDefault, Point.create)
2, 'location', PbFieldType.OM, Point.getDefault, Point.create)
..hasRequiredFields = false; ..hasRequiredFields = false;
Feature() : super(); Feature() : super();
@ -147,9 +146,8 @@ class _ReadonlyFeature extends Feature with ReadonlyMessageMixin {}
class RouteNote extends GeneratedMessage { class RouteNote extends GeneratedMessage {
static final BuilderInfo _i = new BuilderInfo('RouteNote') static final BuilderInfo _i = new BuilderInfo('RouteNote')
..a/*<Point>*/( ..a<Point>(1, 'location', PbFieldType.OM, Point.getDefault, Point.create)
1, 'location', PbFieldType.OM, Point.getDefault, Point.create) ..a<String>(2, 'message', PbFieldType.OS)
..a/*<String>*/(2, 'message', PbFieldType.OS)
..hasRequiredFields = false; ..hasRequiredFields = false;
RouteNote() : super(); RouteNote() : super();
@ -193,10 +191,10 @@ class _ReadonlyRouteNote extends RouteNote with ReadonlyMessageMixin {}
class RouteSummary extends GeneratedMessage { class RouteSummary extends GeneratedMessage {
static final BuilderInfo _i = new BuilderInfo('RouteSummary') static final BuilderInfo _i = new BuilderInfo('RouteSummary')
..a/*<int>*/(1, 'pointCount', PbFieldType.O3) ..a<int>(1, 'pointCount', PbFieldType.O3)
..a/*<int>*/(2, 'featureCount', PbFieldType.O3) ..a<int>(2, 'featureCount', PbFieldType.O3)
..a/*<int>*/(3, 'distance', PbFieldType.O3) ..a<int>(3, 'distance', PbFieldType.O3)
..a/*<int>*/(4, 'elapsedTime', PbFieldType.O3) ..a<int>(4, 'elapsedTime', PbFieldType.O3)
..hasRequiredFields = false; ..hasRequiredFields = false;
RouteSummary() : super(); RouteSummary() : super();

View File

@ -12,9 +12,7 @@ import 'package:grpc/grpc.dart';
import 'route_guide.pb.dart'; import 'route_guide.pb.dart';
export 'route_guide.pb.dart'; export 'route_guide.pb.dart';
class RouteGuideClient { class RouteGuideClient extends Client {
final ClientChannel _channel;
static final _$getFeature = new ClientMethod<Point, Feature>( static final _$getFeature = new ClientMethod<Point, Feature>(
'/routeguide.RouteGuide/GetFeature', '/routeguide.RouteGuide/GetFeature',
(Point value) => value.writeToBuffer(), (Point value) => value.writeToBuffer(),
@ -32,32 +30,36 @@ class RouteGuideClient {
(RouteNote value) => value.writeToBuffer(), (RouteNote value) => value.writeToBuffer(),
(List<int> value) => new RouteNote.fromBuffer(value)); (List<int> value) => new RouteNote.fromBuffer(value));
RouteGuideClient(this._channel); RouteGuideClient(ClientChannel channel, {CallOptions options})
: super(channel, options: options);
ResponseFuture<Feature> getFeature(Point request) { ResponseFuture<Feature> getFeature(Point request, {CallOptions options}) {
final call = new ClientCall(_channel, _$getFeature); final call = $createCall(_$getFeature, options: options);
call.request call.request
..add(request) ..add(request)
..close(); ..close();
return new ResponseFuture(call); return new ResponseFuture(call);
} }
ResponseStream<Feature> listFeatures(Rectangle request) { ResponseStream<Feature> listFeatures(Rectangle request,
final call = new ClientCall(_channel, _$listFeatures); {CallOptions options}) {
final call = $createCall(_$listFeatures, options: options);
call.request call.request
..add(request) ..add(request)
..close(); ..close();
return new ResponseStream(call); return new ResponseStream(call);
} }
ResponseFuture<RouteSummary> recordRoute(Stream<Point> request) { ResponseFuture<RouteSummary> recordRoute(Stream<Point> request,
final call = new ClientCall(_channel, _$recordRoute); {CallOptions options}) {
final call = $createCall(_$recordRoute, options: options);
request.pipe(call.request); request.pipe(call.request);
return new ResponseFuture(call); return new ResponseFuture(call);
} }
ResponseStream<RouteNote> routeChat(Stream<RouteNote> request) { ResponseStream<RouteNote> routeChat(Stream<RouteNote> request,
final call = new ClientCall(_channel, _$routeChat); {CallOptions options}) {
final call = $createCall(_$routeChat, options: options);
request.pipe(call.request); request.pipe(call.request);
return new ResponseStream(call); return new ResponseStream(call);
} }

View File

@ -16,7 +16,7 @@ export 'messages.pbenum.dart';
class BoolValue extends GeneratedMessage { class BoolValue extends GeneratedMessage {
static final BuilderInfo _i = new BuilderInfo('BoolValue') static final BuilderInfo _i = new BuilderInfo('BoolValue')
..a/*<bool>*/(1, 'value', PbFieldType.OB) ..a<bool>(1, 'value', PbFieldType.OB)
..hasRequiredFields = false; ..hasRequiredFields = false;
BoolValue() : super(); BoolValue() : super();
@ -52,9 +52,9 @@ class _ReadonlyBoolValue extends BoolValue with ReadonlyMessageMixin {}
class Payload extends GeneratedMessage { class Payload extends GeneratedMessage {
static final BuilderInfo _i = new BuilderInfo('Payload') static final BuilderInfo _i = new BuilderInfo('Payload')
..e/*<PayloadType>*/(1, 'type', PbFieldType.OE, PayloadType.COMPRESSABLE, ..e<PayloadType>(1, 'type', PbFieldType.OE, PayloadType.COMPRESSABLE,
PayloadType.valueOf) PayloadType.valueOf)
..a/*<List<int>>*/(2, 'body', PbFieldType.OY) ..a<List<int>>(2, 'body', PbFieldType.OY)
..hasRequiredFields = false; ..hasRequiredFields = false;
Payload() : super(); Payload() : super();
@ -98,8 +98,8 @@ class _ReadonlyPayload extends Payload with ReadonlyMessageMixin {}
class EchoStatus extends GeneratedMessage { class EchoStatus extends GeneratedMessage {
static final BuilderInfo _i = new BuilderInfo('EchoStatus') static final BuilderInfo _i = new BuilderInfo('EchoStatus')
..a/*<int>*/(1, 'code', PbFieldType.O3) ..a<int>(1, 'code', PbFieldType.O3)
..a/*<String>*/(2, 'message', PbFieldType.OS) ..a<String>(2, 'message', PbFieldType.OS)
..hasRequiredFields = false; ..hasRequiredFields = false;
EchoStatus() : super(); EchoStatus() : super();
@ -143,19 +143,19 @@ class _ReadonlyEchoStatus extends EchoStatus with ReadonlyMessageMixin {}
class SimpleRequest extends GeneratedMessage { class SimpleRequest extends GeneratedMessage {
static final BuilderInfo _i = new BuilderInfo('SimpleRequest') static final BuilderInfo _i = new BuilderInfo('SimpleRequest')
..e/*<PayloadType>*/(1, 'responseType', PbFieldType.OE, ..e<PayloadType>(1, 'responseType', PbFieldType.OE,
PayloadType.COMPRESSABLE, PayloadType.valueOf) PayloadType.COMPRESSABLE, PayloadType.valueOf)
..a/*<int>*/(2, 'responseSize', PbFieldType.O3) ..a<int>(2, 'responseSize', PbFieldType.O3)
..a/*<Payload>*/( ..a<Payload>(
3, 'payload', PbFieldType.OM, Payload.getDefault, Payload.create) 3, 'payload', PbFieldType.OM, Payload.getDefault, Payload.create)
..a/*<bool>*/(4, 'fillUsername', PbFieldType.OB) ..a<bool>(4, 'fillUsername', PbFieldType.OB)
..a/*<bool>*/(5, 'fillOauthScope', PbFieldType.OB) ..a<bool>(5, 'fillOauthScope', PbFieldType.OB)
..a/*<BoolValue>*/(6, 'responseCompressed', PbFieldType.OM, ..a<BoolValue>(6, 'responseCompressed', PbFieldType.OM,
BoolValue.getDefault, BoolValue.create)
..a/*<EchoStatus>*/(7, 'responseStatus', PbFieldType.OM,
EchoStatus.getDefault, EchoStatus.create)
..a/*<BoolValue>*/(8, 'expectCompressed', PbFieldType.OM,
BoolValue.getDefault, BoolValue.create) BoolValue.getDefault, BoolValue.create)
..a<EchoStatus>(7, 'responseStatus', PbFieldType.OM, EchoStatus.getDefault,
EchoStatus.create)
..a<BoolValue>(8, 'expectCompressed', PbFieldType.OM, BoolValue.getDefault,
BoolValue.create)
..hasRequiredFields = false; ..hasRequiredFields = false;
SimpleRequest() : super(); SimpleRequest() : super();
@ -249,10 +249,10 @@ class _ReadonlySimpleRequest extends SimpleRequest with ReadonlyMessageMixin {}
class SimpleResponse extends GeneratedMessage { class SimpleResponse extends GeneratedMessage {
static final BuilderInfo _i = new BuilderInfo('SimpleResponse') static final BuilderInfo _i = new BuilderInfo('SimpleResponse')
..a/*<Payload>*/( ..a<Payload>(
1, 'payload', PbFieldType.OM, Payload.getDefault, Payload.create) 1, 'payload', PbFieldType.OM, Payload.getDefault, Payload.create)
..a/*<String>*/(2, 'username', PbFieldType.OS) ..a<String>(2, 'username', PbFieldType.OS)
..a/*<String>*/(3, 'oauthScope', PbFieldType.OS) ..a<String>(3, 'oauthScope', PbFieldType.OS)
..hasRequiredFields = false; ..hasRequiredFields = false;
SimpleResponse() : super(); SimpleResponse() : super();
@ -308,10 +308,10 @@ class _ReadonlySimpleResponse extends SimpleResponse with ReadonlyMessageMixin {
class StreamingInputCallRequest extends GeneratedMessage { class StreamingInputCallRequest extends GeneratedMessage {
static final BuilderInfo _i = new BuilderInfo('StreamingInputCallRequest') static final BuilderInfo _i = new BuilderInfo('StreamingInputCallRequest')
..a/*<Payload>*/( ..a<Payload>(
1, 'payload', PbFieldType.OM, Payload.getDefault, Payload.create) 1, 'payload', PbFieldType.OM, Payload.getDefault, Payload.create)
..a/*<BoolValue>*/(2, 'expectCompressed', PbFieldType.OM, ..a<BoolValue>(2, 'expectCompressed', PbFieldType.OM, BoolValue.getDefault,
BoolValue.getDefault, BoolValue.create) BoolValue.create)
..hasRequiredFields = false; ..hasRequiredFields = false;
StreamingInputCallRequest() : super(); StreamingInputCallRequest() : super();
@ -361,7 +361,7 @@ class _ReadonlyStreamingInputCallRequest extends StreamingInputCallRequest
class StreamingInputCallResponse extends GeneratedMessage { class StreamingInputCallResponse extends GeneratedMessage {
static final BuilderInfo _i = new BuilderInfo('StreamingInputCallResponse') static final BuilderInfo _i = new BuilderInfo('StreamingInputCallResponse')
..a/*<int>*/(1, 'aggregatedPayloadSize', PbFieldType.O3) ..a<int>(1, 'aggregatedPayloadSize', PbFieldType.O3)
..hasRequiredFields = false; ..hasRequiredFields = false;
StreamingInputCallResponse() : super(); StreamingInputCallResponse() : super();
@ -404,9 +404,9 @@ class _ReadonlyStreamingInputCallResponse extends StreamingInputCallResponse
class ResponseParameters extends GeneratedMessage { class ResponseParameters extends GeneratedMessage {
static final BuilderInfo _i = new BuilderInfo('ResponseParameters') static final BuilderInfo _i = new BuilderInfo('ResponseParameters')
..a/*<int>*/(1, 'size', PbFieldType.O3) ..a<int>(1, 'size', PbFieldType.O3)
..a/*<int>*/(2, 'intervalUs', PbFieldType.O3) ..a<int>(2, 'intervalUs', PbFieldType.O3)
..a/*<BoolValue>*/( ..a<BoolValue>(
3, 'compressed', PbFieldType.OM, BoolValue.getDefault, BoolValue.create) 3, 'compressed', PbFieldType.OM, BoolValue.getDefault, BoolValue.create)
..hasRequiredFields = false; ..hasRequiredFields = false;
@ -464,14 +464,14 @@ class _ReadonlyResponseParameters extends ResponseParameters
class StreamingOutputCallRequest extends GeneratedMessage { class StreamingOutputCallRequest extends GeneratedMessage {
static final BuilderInfo _i = new BuilderInfo('StreamingOutputCallRequest') static final BuilderInfo _i = new BuilderInfo('StreamingOutputCallRequest')
..e/*<PayloadType>*/(1, 'responseType', PbFieldType.OE, ..e<PayloadType>(1, 'responseType', PbFieldType.OE,
PayloadType.COMPRESSABLE, PayloadType.valueOf) PayloadType.COMPRESSABLE, PayloadType.valueOf)
..pp/*<ResponseParameters>*/(2, 'responseParameters', PbFieldType.PM, ..pp<ResponseParameters>(2, 'responseParameters', PbFieldType.PM,
ResponseParameters.$checkItem, ResponseParameters.create) ResponseParameters.$checkItem, ResponseParameters.create)
..a/*<Payload>*/( ..a<Payload>(
3, 'payload', PbFieldType.OM, Payload.getDefault, Payload.create) 3, 'payload', PbFieldType.OM, Payload.getDefault, Payload.create)
..a/*<EchoStatus>*/(7, 'responseStatus', PbFieldType.OM, ..a<EchoStatus>(7, 'responseStatus', PbFieldType.OM, EchoStatus.getDefault,
EchoStatus.getDefault, EchoStatus.create) EchoStatus.create)
..hasRequiredFields = false; ..hasRequiredFields = false;
StreamingOutputCallRequest() : super(); StreamingOutputCallRequest() : super();
@ -532,7 +532,7 @@ class _ReadonlyStreamingOutputCallRequest extends StreamingOutputCallRequest
class StreamingOutputCallResponse extends GeneratedMessage { class StreamingOutputCallResponse extends GeneratedMessage {
static final BuilderInfo _i = new BuilderInfo('StreamingOutputCallResponse') static final BuilderInfo _i = new BuilderInfo('StreamingOutputCallResponse')
..a/*<Payload>*/( ..a<Payload>(
1, 'payload', PbFieldType.OM, Payload.getDefault, Payload.create) 1, 'payload', PbFieldType.OM, Payload.getDefault, Payload.create)
..hasRequiredFields = false; ..hasRequiredFields = false;
@ -576,7 +576,7 @@ class _ReadonlyStreamingOutputCallResponse extends StreamingOutputCallResponse
class ReconnectParams extends GeneratedMessage { class ReconnectParams extends GeneratedMessage {
static final BuilderInfo _i = new BuilderInfo('ReconnectParams') static final BuilderInfo _i = new BuilderInfo('ReconnectParams')
..a/*<int>*/(1, 'maxReconnectBackoffMs', PbFieldType.O3) ..a<int>(1, 'maxReconnectBackoffMs', PbFieldType.O3)
..hasRequiredFields = false; ..hasRequiredFields = false;
ReconnectParams() : super(); ReconnectParams() : super();
@ -616,8 +616,8 @@ class _ReadonlyReconnectParams extends ReconnectParams
class ReconnectInfo extends GeneratedMessage { class ReconnectInfo extends GeneratedMessage {
static final BuilderInfo _i = new BuilderInfo('ReconnectInfo') static final BuilderInfo _i = new BuilderInfo('ReconnectInfo')
..a/*<bool>*/(1, 'passed', PbFieldType.OB) ..a<bool>(1, 'passed', PbFieldType.OB)
..p/*<int>*/(2, 'backoffMs', PbFieldType.P3) ..p<int>(2, 'backoffMs', PbFieldType.P3)
..hasRequiredFields = false; ..hasRequiredFields = false;
ReconnectInfo() : super(); ReconnectInfo() : super();

View File

@ -13,9 +13,7 @@ import 'empty.pb.dart';
import 'messages.pb.dart'; import 'messages.pb.dart';
export 'test.pb.dart'; export 'test.pb.dart';
class TestServiceClient { class TestServiceClient extends Client {
final ClientChannel _channel;
static final _$emptyCall = new ClientMethod<Empty, Empty>( static final _$emptyCall = new ClientMethod<Empty, Empty>(
'/grpc.testing.TestService/EmptyCall', '/grpc.testing.TestService/EmptyCall',
(Empty value) => value.writeToBuffer(), (Empty value) => value.writeToBuffer(),
@ -58,10 +56,11 @@ class TestServiceClient {
(Empty value) => value.writeToBuffer(), (Empty value) => value.writeToBuffer(),
(List<int> value) => new Empty.fromBuffer(value)); (List<int> value) => new Empty.fromBuffer(value));
TestServiceClient(this._channel); TestServiceClient(ClientChannel channel, {CallOptions options})
: super(channel, options: options);
ResponseFuture<Empty> emptyCall(Empty request, {CallOptions options}) { ResponseFuture<Empty> emptyCall(Empty request, {CallOptions options}) {
final call = new ClientCall(_channel, _$emptyCall, options: options); final call = $createCall(_$emptyCall, options: options);
call.request call.request
..add(request) ..add(request)
..close(); ..close();
@ -70,7 +69,7 @@ class TestServiceClient {
ResponseFuture<SimpleResponse> unaryCall(SimpleRequest request, ResponseFuture<SimpleResponse> unaryCall(SimpleRequest request,
{CallOptions options}) { {CallOptions options}) {
final call = new ClientCall(_channel, _$unaryCall, options: options); final call = $createCall(_$unaryCall, options: options);
call.request call.request
..add(request) ..add(request)
..close(); ..close();
@ -79,8 +78,7 @@ class TestServiceClient {
ResponseFuture<SimpleResponse> cacheableUnaryCall(SimpleRequest request, ResponseFuture<SimpleResponse> cacheableUnaryCall(SimpleRequest request,
{CallOptions options}) { {CallOptions options}) {
final call = final call = $createCall(_$cacheableUnaryCall, options: options);
new ClientCall(_channel, _$cacheableUnaryCall, options: options);
call.request call.request
..add(request) ..add(request)
..close(); ..close();
@ -90,8 +88,7 @@ class TestServiceClient {
ResponseStream<StreamingOutputCallResponse> streamingOutputCall( ResponseStream<StreamingOutputCallResponse> streamingOutputCall(
StreamingOutputCallRequest request, StreamingOutputCallRequest request,
{CallOptions options}) { {CallOptions options}) {
final call = final call = $createCall(_$streamingOutputCall, options: options);
new ClientCall(_channel, _$streamingOutputCall, options: options);
call.request call.request
..add(request) ..add(request)
..close(); ..close();
@ -101,8 +98,7 @@ class TestServiceClient {
ResponseFuture<StreamingInputCallResponse> streamingInputCall( ResponseFuture<StreamingInputCallResponse> streamingInputCall(
Stream<StreamingInputCallRequest> request, Stream<StreamingInputCallRequest> request,
{CallOptions options}) { {CallOptions options}) {
final call = final call = $createCall(_$streamingInputCall, options: options);
new ClientCall(_channel, _$streamingInputCall, options: options);
request.pipe(call.request); request.pipe(call.request);
return new ResponseFuture(call); return new ResponseFuture(call);
} }
@ -110,7 +106,7 @@ class TestServiceClient {
ResponseStream<StreamingOutputCallResponse> fullDuplexCall( ResponseStream<StreamingOutputCallResponse> fullDuplexCall(
Stream<StreamingOutputCallRequest> request, Stream<StreamingOutputCallRequest> request,
{CallOptions options}) { {CallOptions options}) {
final call = new ClientCall(_channel, _$fullDuplexCall, options: options); final call = $createCall(_$fullDuplexCall, options: options);
request.pipe(call.request); request.pipe(call.request);
return new ResponseStream(call); return new ResponseStream(call);
} }
@ -118,15 +114,14 @@ class TestServiceClient {
ResponseStream<StreamingOutputCallResponse> halfDuplexCall( ResponseStream<StreamingOutputCallResponse> halfDuplexCall(
Stream<StreamingOutputCallRequest> request, Stream<StreamingOutputCallRequest> request,
{CallOptions options}) { {CallOptions options}) {
final call = new ClientCall(_channel, _$halfDuplexCall, options: options); final call = $createCall(_$halfDuplexCall, options: options);
request.pipe(call.request); request.pipe(call.request);
return new ResponseStream(call); return new ResponseStream(call);
} }
ResponseFuture<Empty> unimplementedCall(Empty request, ResponseFuture<Empty> unimplementedCall(Empty request,
{CallOptions options}) { {CallOptions options}) {
final call = final call = $createCall(_$unimplementedCall, options: options);
new ClientCall(_channel, _$unimplementedCall, options: options);
call.request call.request
..add(request) ..add(request)
..close(); ..close();
@ -222,20 +217,18 @@ abstract class TestServiceBase extends Service {
ServiceCall call, Stream<StreamingOutputCallRequest> request); ServiceCall call, Stream<StreamingOutputCallRequest> request);
} }
class UnimplementedServiceClient { class UnimplementedServiceClient extends Client {
final ClientChannel _channel;
static final _$unimplementedCall = new ClientMethod<Empty, Empty>( static final _$unimplementedCall = new ClientMethod<Empty, Empty>(
'/grpc.testing.UnimplementedService/UnimplementedCall', '/grpc.testing.UnimplementedService/UnimplementedCall',
(Empty value) => value.writeToBuffer(), (Empty value) => value.writeToBuffer(),
(List<int> value) => new Empty.fromBuffer(value)); (List<int> value) => new Empty.fromBuffer(value));
UnimplementedServiceClient(this._channel); UnimplementedServiceClient(ClientChannel channel, {CallOptions options})
: super(channel, options: options);
ResponseFuture<Empty> unimplementedCall(Empty request, ResponseFuture<Empty> unimplementedCall(Empty request,
{CallOptions options}) { {CallOptions options}) {
final call = final call = $createCall(_$unimplementedCall, options: options);
new ClientCall(_channel, _$unimplementedCall, options: options);
call.request call.request
..add(request) ..add(request)
..close(); ..close();
@ -264,9 +257,7 @@ abstract class UnimplementedServiceBase extends Service {
Future<Empty> unimplementedCall(ServiceCall call, Empty request); Future<Empty> unimplementedCall(ServiceCall call, Empty request);
} }
class ReconnectServiceClient { class ReconnectServiceClient extends Client {
final ClientChannel _channel;
static final _$start = new ClientMethod<ReconnectParams, Empty>( static final _$start = new ClientMethod<ReconnectParams, Empty>(
'/grpc.testing.ReconnectService/Start', '/grpc.testing.ReconnectService/Start',
(ReconnectParams value) => value.writeToBuffer(), (ReconnectParams value) => value.writeToBuffer(),
@ -276,10 +267,11 @@ class ReconnectServiceClient {
(Empty value) => value.writeToBuffer(), (Empty value) => value.writeToBuffer(),
(List<int> value) => new ReconnectInfo.fromBuffer(value)); (List<int> value) => new ReconnectInfo.fromBuffer(value));
ReconnectServiceClient(this._channel); ReconnectServiceClient(ClientChannel channel, {CallOptions options})
: super(channel, options: options);
ResponseFuture<Empty> start(ReconnectParams request, {CallOptions options}) { ResponseFuture<Empty> start(ReconnectParams request, {CallOptions options}) {
final call = new ClientCall(_channel, _$start, options: options); final call = $createCall(_$start, options: options);
call.request call.request
..add(request) ..add(request)
..close(); ..close();
@ -287,7 +279,7 @@ class ReconnectServiceClient {
} }
ResponseFuture<ReconnectInfo> stop(Empty request, {CallOptions options}) { ResponseFuture<ReconnectInfo> stop(Empty request, {CallOptions options}) {
final call = new ClientCall(_channel, _$stop, options: options); final call = $createCall(_$stop, options: options);
call.request call.request
..add(request) ..add(request)
..close(); ..close();

View File

@ -64,7 +64,7 @@ class ClientChannel {
{this.port = 443, this.options = const ChannelOptions()}); {this.port = 443, this.options = const ChannelOptions()});
/// Returns a connection to this [Channel]'s RPC endpoint. The connection may /// Returns a connection to this [Channel]'s RPC endpoint. The connection may
/// be shared between multiple RPC calls. /// be shared between multiple RPCs.
Future<ClientTransportConnection> connect() async { Future<ClientTransportConnection> connect() async {
final securityContext = options.securityContext; final securityContext = options.securityContext;