blob: 3bf477fb819781ca06adb43b81911bf7df1ec84e [file] [log] [blame]
///
// Generated code. Do not modify.
// source: test
///
// ignore_for_file: camel_case_types,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name
import 'dart:async' as $async;
import 'package:grpc/service_api.dart' as $grpc;
import 'dart:core' as $core show int, String, List;
import 'test.pb.dart' as $0;
export 'test.pb.dart';
class TestClient extends $grpc.Client {
static final _$unary = $grpc.ClientMethod<Input, Output>(
'/Test/Unary',
(Input value) => value.writeToBuffer(),
($core.List<$core.int> value) => Output.fromBuffer(value));
static final _$clientStreaming = $grpc.ClientMethod<Input, Output>(
'/Test/ClientStreaming',
(Input value) => value.writeToBuffer(),
($core.List<$core.int> value) => Output.fromBuffer(value));
static final _$serverStreaming = $grpc.ClientMethod<Input, Output>(
'/Test/ServerStreaming',
(Input value) => value.writeToBuffer(),
($core.List<$core.int> value) => Output.fromBuffer(value));
static final _$bidirectional = $grpc.ClientMethod<Input, Output>(
'/Test/Bidirectional',
(Input value) => value.writeToBuffer(),
($core.List<$core.int> value) => Output.fromBuffer(value));
TestClient($grpc.ClientChannel channel, {$grpc.CallOptions options})
: super(channel, options: options);
$grpc.ResponseFuture<Output> unary(Input request,
{$grpc.CallOptions options}) {
final call = $createCall(_$unary, $async.Stream.fromIterable([request]),
options: options);
return $grpc.ResponseFuture(call);
}
$grpc.ResponseFuture<Output> clientStreaming($async.Stream<Input> request,
{$grpc.CallOptions options}) {
final call = $createCall(_$clientStreaming, request, options: options);
return $grpc.ResponseFuture(call);
}
$grpc.ResponseStream<Output> serverStreaming(Input request,
{$grpc.CallOptions options}) {
final call = $createCall(
_$serverStreaming, $async.Stream.fromIterable([request]),
options: options);
return $grpc.ResponseStream(call);
}
$grpc.ResponseStream<Output> bidirectional($async.Stream<Input> request,
{$grpc.CallOptions options}) {
final call = $createCall(_$bidirectional, request, options: options);
return $grpc.ResponseStream(call);
}
}
abstract class TestServiceBase extends $grpc.Service {
$core.String get $name => 'Test';
TestServiceBase() {
$addMethod($grpc.ServiceMethod<Input, Output>(
'Unary',
unary_Pre,
false,
false,
($core.List<$core.int> value) => Input.fromBuffer(value),
(Output value) => value.writeToBuffer()));
$addMethod($grpc.ServiceMethod<Input, Output>(
'ClientStreaming',
clientStreaming,
true,
false,
($core.List<$core.int> value) => Input.fromBuffer(value),
(Output value) => value.writeToBuffer()));
$addMethod($grpc.ServiceMethod<Input, Output>(
'ServerStreaming',
serverStreaming_Pre,
false,
true,
($core.List<$core.int> value) => Input.fromBuffer(value),
(Output value) => value.writeToBuffer()));
$addMethod($grpc.ServiceMethod<Input, Output>(
'Bidirectional',
bidirectional,
true,
true,
($core.List<$core.int> value) => Input.fromBuffer(value),
(Output value) => value.writeToBuffer()));
}
$async.Future<Output> unary_Pre(
$grpc.ServiceCall call, $async.Future request) async {
return unary(call, await request);
}
$async.Stream<Output> serverStreaming_Pre(
$grpc.ServiceCall call, $async.Future request) async* {
yield* serverStreaming(call, (await request) as Input);
}
$async.Future<Output> unary($grpc.ServiceCall call, Input request);
$async.Future<Output> clientStreaming(
$grpc.ServiceCall call, $async.Stream<Input> request);
$async.Stream<Output> serverStreaming($grpc.ServiceCall call, Input request);
$async.Stream<Output> bidirectional(
$grpc.ServiceCall call, $async.Stream<Input> request);
}