blob: f5eb2e922119a587d3f46ee4adcfe195afb33a03 [file] [log] [blame]
abstract class TestServiceBase extends GeneratedService {
$async.Future<SomeReply> aMethod(ServerContext ctx, SomeRequest request);
$async.Future<$0.AnotherReply> anotherMethod(ServerContext ctx, $0.EmptyMessage request);
GeneratedMessage createRequest(String method) {
switch (method) {
case 'AMethod': return new SomeRequest();
case 'AnotherMethod': return new $0.EmptyMessage();
default: throw new ArgumentError('Unknown method: $method');
}
}
$async.Future<GeneratedMessage> handleCall(ServerContext ctx, String method, GeneratedMessage request) {
switch (method) {
case 'AMethod': return this.aMethod(ctx, request);
case 'AnotherMethod': return this.anotherMethod(ctx, request);
default: throw new ArgumentError('Unknown method: $method');
}
}
Map<String, dynamic> get $json => TestServiceBase$json;
Map<String, Map<String, dynamic>> get $messageJson => TestServiceBase$messageJson;
}