diff --git a/src/compiler/csharp_generator.cc b/src/compiler/csharp_generator.cc index cc7a7a96aea..ce1e6b94c3f 100644 --- a/src/compiler/csharp_generator.cc +++ b/src/compiler/csharp_generator.cc @@ -203,13 +203,13 @@ std::string GetServerClassName(const ServiceDescriptor *service) { std::string GetCSharpMethodType(MethodType method_type) { switch (method_type) { case METHODTYPE_NO_STREAMING: - return "MethodType.Unary"; + return "grpc::MethodType.Unary"; case METHODTYPE_CLIENT_STREAMING: - return "MethodType.ClientStreaming"; + return "grpc::MethodType.ClientStreaming"; case METHODTYPE_SERVER_STREAMING: - return "MethodType.ServerStreaming"; + return "grpc::MethodType.ServerStreaming"; case METHODTYPE_BIDI_STREAMING: - return "MethodType.DuplexStreaming"; + return "grpc::MethodType.DuplexStreaming"; } GOOGLE_LOG(FATAL) << "Can't get here."; return ""; @@ -243,16 +243,19 @@ std::string GetAccessLevel(bool internal_access) { std::string GetMethodReturnTypeClient(const MethodDescriptor *method) { switch (GetMethodType(method)) { case METHODTYPE_NO_STREAMING: - return "AsyncUnaryCall<" + GetClassName(method->output_type()) + ">"; + return "grpc::AsyncUnaryCall<" + GetClassName(method->output_type()) + + ">"; case METHODTYPE_CLIENT_STREAMING: - return "AsyncClientStreamingCall<" + GetClassName(method->input_type()) + - ", " + GetClassName(method->output_type()) + ">"; + return "grpc::AsyncClientStreamingCall<" + + GetClassName(method->input_type()) + ", " + + GetClassName(method->output_type()) + ">"; case METHODTYPE_SERVER_STREAMING: - return "AsyncServerStreamingCall<" + GetClassName(method->output_type()) + - ">"; + return "grpc::AsyncServerStreamingCall<" + + GetClassName(method->output_type()) + ">"; case METHODTYPE_BIDI_STREAMING: - return "AsyncDuplexStreamingCall<" + GetClassName(method->input_type()) + - ", " + GetClassName(method->output_type()) + ">"; + return "grpc::AsyncDuplexStreamingCall<" + + GetClassName(method->input_type()) + ", " + + GetClassName(method->output_type()) + ">"; } GOOGLE_LOG(FATAL) << "Can't get here."; return ""; @@ -265,7 +268,7 @@ std::string GetMethodRequestParamServer(const MethodDescriptor *method) { return GetClassName(method->input_type()) + " request"; case METHODTYPE_CLIENT_STREAMING: case METHODTYPE_BIDI_STREAMING: - return "IAsyncStreamReader<" + GetClassName(method->input_type()) + + return "grpc::IAsyncStreamReader<" + GetClassName(method->input_type()) + "> requestStream"; } GOOGLE_LOG(FATAL) << "Can't get here."; @@ -293,8 +296,8 @@ std::string GetMethodResponseStreamMaybe(const MethodDescriptor *method) { return ""; case METHODTYPE_SERVER_STREAMING: case METHODTYPE_BIDI_STREAMING: - return ", IServerStreamWriter<" + GetClassName(method->output_type()) + - "> responseStream"; + return ", grpc::IServerStreamWriter<" + + GetClassName(method->output_type()) + "> responseStream"; } GOOGLE_LOG(FATAL) << "Can't get here."; return ""; @@ -325,8 +328,8 @@ void GenerateMarshallerFields(Printer *out, const ServiceDescriptor *service) { for (size_t i = 0; i < used_messages.size(); i++) { const Descriptor *message = used_messages[i]; out->Print( - "static readonly Marshaller<$type$> $fieldname$ = " - "Marshallers.Create((arg) => " + "static readonly grpc::Marshaller<$type$> $fieldname$ = " + "grpc::Marshallers.Create((arg) => " "global::Google.Protobuf.MessageExtensions.ToByteArray(arg), " "$type$.Parser.ParseFrom);\n", "fieldname", GetMarshallerFieldName(message), "type", @@ -337,8 +340,8 @@ void GenerateMarshallerFields(Printer *out, const ServiceDescriptor *service) { void GenerateStaticMethodField(Printer *out, const MethodDescriptor *method) { out->Print( - "static readonly Method<$request$, $response$> $fieldname$ = new " - "Method<$request$, $response$>(\n", + "static readonly grpc::Method<$request$, $response$> $fieldname$ = new " + "grpc::Method<$request$, $response$>(\n", "fieldname", GetMethodFieldName(method), "request", GetClassName(method->input_type()), "response", GetClassName(method->output_type())); @@ -389,7 +392,7 @@ void GenerateServerClass(Printer *out, const ServiceDescriptor *service) { out->Print( "public virtual $returntype$ " "$methodname$($request$$response_stream_maybe$, " - "ServerCallContext context)\n", + "grpc::ServerCallContext context)\n", "methodname", method->name(), "returntype", GetMethodReturnTypeServer(method), "request", GetMethodRequestParamServer(method), "response_stream_maybe", @@ -397,8 +400,8 @@ void GenerateServerClass(Printer *out, const ServiceDescriptor *service) { out->Print("{\n"); out->Indent(); out->Print( - "throw new RpcException(" - "new Status(StatusCode.Unimplemented, \"\"));\n"); + "throw new grpc::RpcException(" + "new grpc::Status(grpc::StatusCode.Unimplemented, \"\"));\n"); out->Outdent(); out->Print("}\n\n"); } @@ -410,7 +413,7 @@ void GenerateServerClass(Printer *out, const ServiceDescriptor *service) { void GenerateClientStub(Printer *out, const ServiceDescriptor *service) { out->Print("/// Client for $servicename$\n", "servicename", GetServiceClassName(service)); - out->Print("public partial class $name$ : ClientBase<$name$>\n", "name", + out->Print("public partial class $name$ : grpc::ClientBase<$name$>\n", "name", GetClientClassName(service)); out->Print("{\n"); out->Indent(); @@ -421,7 +424,7 @@ void GenerateClientStub(Printer *out, const ServiceDescriptor *service) { "/// The channel to use to make remote " "calls.\n", "servicename", GetServiceClassName(service)); - out->Print("public $name$(Channel channel) : base(channel)\n", "name", + out->Print("public $name$(grpc::Channel channel) : base(channel)\n", "name", GetClientClassName(service)); out->Print("{\n"); out->Print("}\n"); @@ -431,8 +434,9 @@ void GenerateClientStub(Printer *out, const ServiceDescriptor *service) { "/// The callInvoker to use to make remote " "calls.\n", "servicename", GetServiceClassName(service)); - out->Print("public $name$(CallInvoker callInvoker) : base(callInvoker)\n", - "name", GetClientClassName(service)); + out->Print( + "public $name$(grpc::CallInvoker callInvoker) : base(callInvoker)\n", + "name", GetClientClassName(service)); out->Print("{\n"); out->Print("}\n"); out->Print( @@ -461,7 +465,8 @@ void GenerateClientStub(Printer *out, const ServiceDescriptor *service) { // unary calls have an extra synchronous stub method GenerateDocCommentClientMethod(out, method, true, false); out->Print( - "public virtual $response$ $methodname$($request$ request, Metadata " + "public virtual $response$ $methodname$($request$ request, " + "grpc::Metadata " "headers = null, DateTime? deadline = null, CancellationToken " "cancellationToken = default(CancellationToken))\n", "methodname", method->name(), "request", @@ -470,7 +475,8 @@ void GenerateClientStub(Printer *out, const ServiceDescriptor *service) { out->Print("{\n"); out->Indent(); out->Print( - "return $methodname$(request, new CallOptions(headers, deadline, " + "return $methodname$(request, new grpc::CallOptions(headers, " + "deadline, " "cancellationToken));\n", "methodname", method->name()); out->Outdent(); @@ -480,7 +486,7 @@ void GenerateClientStub(Printer *out, const ServiceDescriptor *service) { GenerateDocCommentClientMethod(out, method, true, true); out->Print( "public virtual $response$ $methodname$($request$ request, " - "CallOptions options)\n", + "grpc::CallOptions options)\n", "methodname", method->name(), "request", GetClassName(method->input_type()), "response", GetClassName(method->output_type())); @@ -500,7 +506,8 @@ void GenerateClientStub(Printer *out, const ServiceDescriptor *service) { } GenerateDocCommentClientMethod(out, method, false, false); out->Print( - "public virtual $returntype$ $methodname$($request_maybe$Metadata " + "public virtual $returntype$ " + "$methodname$($request_maybe$grpc::Metadata " "headers = null, DateTime? deadline = null, CancellationToken " "cancellationToken = default(CancellationToken))\n", "methodname", method_name, "request_maybe", @@ -510,7 +517,8 @@ void GenerateClientStub(Printer *out, const ServiceDescriptor *service) { out->Indent(); out->Print( - "return $methodname$($request_maybe$new CallOptions(headers, deadline, " + "return $methodname$($request_maybe$new grpc::CallOptions(headers, " + "deadline, " "cancellationToken));\n", "methodname", method_name, "request_maybe", GetMethodRequestParamMaybe(method, true)); @@ -520,7 +528,8 @@ void GenerateClientStub(Printer *out, const ServiceDescriptor *service) { // overload taking CallOptions as a param GenerateDocCommentClientMethod(out, method, false, true); out->Print( - "public virtual $returntype$ $methodname$($request_maybe$CallOptions " + "public virtual $returntype$ " + "$methodname$($request_maybe$grpc::CallOptions " "options)\n", "methodname", method_name, "request_maybe", GetMethodRequestParamMaybe(method), "returntype", @@ -587,13 +596,13 @@ void GenerateBindServiceMethod(Printer *out, const ServiceDescriptor *service) { "/// An object implementing the server-side" " handling logic.\n"); out->Print( - "public static ServerServiceDefinition BindService($implclass$ " + "public static grpc::ServerServiceDefinition BindService($implclass$ " "serviceImpl)\n", "implclass", GetServerClassName(service)); out->Print("{\n"); out->Indent(); - out->Print("return ServerServiceDefinition.CreateBuilder()\n"); + out->Print("return grpc::ServerServiceDefinition.CreateBuilder()\n"); out->Indent(); out->Indent(); for (int i = 0; i < service->method_count(); i++) { @@ -681,7 +690,7 @@ grpc::string GetServices(const FileDescriptor *file, bool generate_client, out.Print("using System;\n"); out.Print("using System.Threading;\n"); out.Print("using System.Threading.Tasks;\n"); - out.Print("using Grpc.Core;\n"); + out.Print("using grpc = global::Grpc.Core;\n"); out.Print("\n"); out.Print("namespace $namespace$ {\n", "namespace", GetFileNamespace(file)); diff --git a/src/csharp/Grpc.Examples/MathGrpc.cs b/src/csharp/Grpc.Examples/MathGrpc.cs index 3364b8ce8ec..1f2e67d916d 100644 --- a/src/csharp/Grpc.Examples/MathGrpc.cs +++ b/src/csharp/Grpc.Examples/MathGrpc.cs @@ -35,41 +35,41 @@ using System; using System.Threading; using System.Threading.Tasks; -using Grpc.Core; +using grpc = global::Grpc.Core; namespace Math { public static partial class Math { static readonly string __ServiceName = "math.Math"; - static readonly Marshaller __Marshaller_DivArgs = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.DivArgs.Parser.ParseFrom); - static readonly Marshaller __Marshaller_DivReply = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.DivReply.Parser.ParseFrom); - static readonly Marshaller __Marshaller_FibArgs = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.FibArgs.Parser.ParseFrom); - static readonly Marshaller __Marshaller_Num = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.Num.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_DivArgs = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.DivArgs.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_DivReply = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.DivReply.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_FibArgs = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.FibArgs.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_Num = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.Num.Parser.ParseFrom); - static readonly Method __Method_Div = new Method( - MethodType.Unary, + static readonly grpc::Method __Method_Div = new grpc::Method( + grpc::MethodType.Unary, __ServiceName, "Div", __Marshaller_DivArgs, __Marshaller_DivReply); - static readonly Method __Method_DivMany = new Method( - MethodType.DuplexStreaming, + static readonly grpc::Method __Method_DivMany = new grpc::Method( + grpc::MethodType.DuplexStreaming, __ServiceName, "DivMany", __Marshaller_DivArgs, __Marshaller_DivReply); - static readonly Method __Method_Fib = new Method( - MethodType.ServerStreaming, + static readonly grpc::Method __Method_Fib = new grpc::Method( + grpc::MethodType.ServerStreaming, __ServiceName, "Fib", __Marshaller_FibArgs, __Marshaller_Num); - static readonly Method __Method_Sum = new Method( - MethodType.ClientStreaming, + static readonly grpc::Method __Method_Sum = new grpc::Method( + grpc::MethodType.ClientStreaming, __ServiceName, "Sum", __Marshaller_Num, @@ -91,9 +91,9 @@ namespace Math { /// The request received from the client. /// The context of the server-side call handler being invoked. /// The response to send back to the client (wrapped by a task). - public virtual global::System.Threading.Tasks.Task Div(global::Math.DivArgs request, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task Div(global::Math.DivArgs request, grpc::ServerCallContext context) { - throw new RpcException(new Status(StatusCode.Unimplemented, "")); + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } /// @@ -106,9 +106,9 @@ namespace Math { /// Used for sending responses back to the client. /// The context of the server-side call handler being invoked. /// A task indicating completion of the handler. - public virtual global::System.Threading.Tasks.Task DivMany(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task DivMany(grpc::IAsyncStreamReader requestStream, grpc::IServerStreamWriter responseStream, grpc::ServerCallContext context) { - throw new RpcException(new Status(StatusCode.Unimplemented, "")); + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } /// @@ -120,9 +120,9 @@ namespace Math { /// Used for sending responses back to the client. /// The context of the server-side call handler being invoked. /// A task indicating completion of the handler. - public virtual global::System.Threading.Tasks.Task Fib(global::Math.FibArgs request, IServerStreamWriter responseStream, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task Fib(global::Math.FibArgs request, grpc::IServerStreamWriter responseStream, grpc::ServerCallContext context) { - throw new RpcException(new Status(StatusCode.Unimplemented, "")); + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } /// @@ -132,24 +132,24 @@ namespace Math { /// Used for reading requests from the client. /// The context of the server-side call handler being invoked. /// The response to send back to the client (wrapped by a task). - public virtual global::System.Threading.Tasks.Task Sum(IAsyncStreamReader requestStream, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task Sum(grpc::IAsyncStreamReader requestStream, grpc::ServerCallContext context) { - throw new RpcException(new Status(StatusCode.Unimplemented, "")); + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } } /// Client for Math - public partial class MathClient : ClientBase + public partial class MathClient : grpc::ClientBase { /// Creates a new client for Math /// The channel to use to make remote calls. - public MathClient(Channel channel) : base(channel) + public MathClient(grpc::Channel channel) : base(channel) { } /// Creates a new client for Math that uses a custom CallInvoker. /// The callInvoker to use to make remote calls. - public MathClient(CallInvoker callInvoker) : base(callInvoker) + public MathClient(grpc::CallInvoker callInvoker) : base(callInvoker) { } /// Protected parameterless constructor to allow creation of test doubles. @@ -171,9 +171,9 @@ namespace Math { /// An optional deadline for the call. The call will be cancelled if deadline is hit. /// An optional token for canceling the call. /// The response received from the server. - public virtual global::Math.DivReply Div(global::Math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual global::Math.DivReply Div(global::Math.DivArgs request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return Div(request, new CallOptions(headers, deadline, cancellationToken)); + return Div(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// /// Div divides DivArgs.dividend by DivArgs.divisor and returns the quotient @@ -182,7 +182,7 @@ namespace Math { /// The request to send to the server. /// The options for the call. /// The response received from the server. - public virtual global::Math.DivReply Div(global::Math.DivArgs request, CallOptions options) + public virtual global::Math.DivReply Div(global::Math.DivArgs request, grpc::CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_Div, null, options, request); } @@ -195,9 +195,9 @@ namespace Math { /// An optional deadline for the call. The call will be cancelled if deadline is hit. /// An optional token for canceling the call. /// The call object. - public virtual AsyncUnaryCall DivAsync(global::Math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual grpc::AsyncUnaryCall DivAsync(global::Math.DivArgs request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return DivAsync(request, new CallOptions(headers, deadline, cancellationToken)); + return DivAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// /// Div divides DivArgs.dividend by DivArgs.divisor and returns the quotient @@ -206,7 +206,7 @@ namespace Math { /// The request to send to the server. /// The options for the call. /// The call object. - public virtual AsyncUnaryCall DivAsync(global::Math.DivArgs request, CallOptions options) + public virtual grpc::AsyncUnaryCall DivAsync(global::Math.DivArgs request, grpc::CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_Div, null, options, request); } @@ -220,9 +220,9 @@ namespace Math { /// An optional deadline for the call. The call will be cancelled if deadline is hit. /// An optional token for canceling the call. /// The call object. - public virtual AsyncDuplexStreamingCall DivMany(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual grpc::AsyncDuplexStreamingCall DivMany(grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return DivMany(new CallOptions(headers, deadline, cancellationToken)); + return DivMany(new grpc::CallOptions(headers, deadline, cancellationToken)); } /// /// DivMany accepts an arbitrary number of division args from the client stream @@ -232,7 +232,7 @@ namespace Math { /// /// The options for the call. /// The call object. - public virtual AsyncDuplexStreamingCall DivMany(CallOptions options) + public virtual grpc::AsyncDuplexStreamingCall DivMany(grpc::CallOptions options) { return CallInvoker.AsyncDuplexStreamingCall(__Method_DivMany, null, options); } @@ -246,9 +246,9 @@ namespace Math { /// An optional deadline for the call. The call will be cancelled if deadline is hit. /// An optional token for canceling the call. /// The call object. - public virtual AsyncServerStreamingCall Fib(global::Math.FibArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual grpc::AsyncServerStreamingCall Fib(global::Math.FibArgs request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return Fib(request, new CallOptions(headers, deadline, cancellationToken)); + return Fib(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// /// Fib generates numbers in the Fibonacci sequence. If FibArgs.limit > 0, Fib @@ -258,7 +258,7 @@ namespace Math { /// The request to send to the server. /// The options for the call. /// The call object. - public virtual AsyncServerStreamingCall Fib(global::Math.FibArgs request, CallOptions options) + public virtual grpc::AsyncServerStreamingCall Fib(global::Math.FibArgs request, grpc::CallOptions options) { return CallInvoker.AsyncServerStreamingCall(__Method_Fib, null, options, request); } @@ -270,9 +270,9 @@ namespace Math { /// An optional deadline for the call. The call will be cancelled if deadline is hit. /// An optional token for canceling the call. /// The call object. - public virtual AsyncClientStreamingCall Sum(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual grpc::AsyncClientStreamingCall Sum(grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return Sum(new CallOptions(headers, deadline, cancellationToken)); + return Sum(new grpc::CallOptions(headers, deadline, cancellationToken)); } /// /// Sum sums a stream of numbers, returning the final result once the stream @@ -280,7 +280,7 @@ namespace Math { /// /// The options for the call. /// The call object. - public virtual AsyncClientStreamingCall Sum(CallOptions options) + public virtual grpc::AsyncClientStreamingCall Sum(grpc::CallOptions options) { return CallInvoker.AsyncClientStreamingCall(__Method_Sum, null, options); } @@ -293,9 +293,9 @@ namespace Math { /// Creates service definition that can be registered with a server /// An object implementing the server-side handling logic. - public static ServerServiceDefinition BindService(MathBase serviceImpl) + public static grpc::ServerServiceDefinition BindService(MathBase serviceImpl) { - return ServerServiceDefinition.CreateBuilder() + return grpc::ServerServiceDefinition.CreateBuilder() .AddMethod(__Method_Div, serviceImpl.Div) .AddMethod(__Method_DivMany, serviceImpl.DivMany) .AddMethod(__Method_Fib, serviceImpl.Fib) diff --git a/src/csharp/Grpc.HealthCheck/HealthGrpc.cs b/src/csharp/Grpc.HealthCheck/HealthGrpc.cs index 020c2df5657..d3115f3da16 100644 --- a/src/csharp/Grpc.HealthCheck/HealthGrpc.cs +++ b/src/csharp/Grpc.HealthCheck/HealthGrpc.cs @@ -35,18 +35,18 @@ using System; using System.Threading; using System.Threading.Tasks; -using Grpc.Core; +using grpc = global::Grpc.Core; namespace Grpc.Health.V1 { public static partial class Health { static readonly string __ServiceName = "grpc.health.v1.Health"; - static readonly Marshaller __Marshaller_HealthCheckRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Health.V1.HealthCheckRequest.Parser.ParseFrom); - static readonly Marshaller __Marshaller_HealthCheckResponse = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Health.V1.HealthCheckResponse.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_HealthCheckRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Health.V1.HealthCheckRequest.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_HealthCheckResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Health.V1.HealthCheckResponse.Parser.ParseFrom); - static readonly Method __Method_Check = new Method( - MethodType.Unary, + static readonly grpc::Method __Method_Check = new grpc::Method( + grpc::MethodType.Unary, __ServiceName, "Check", __Marshaller_HealthCheckRequest, @@ -61,24 +61,24 @@ namespace Grpc.Health.V1 { /// Base class for server-side implementations of Health public abstract partial class HealthBase { - public virtual global::System.Threading.Tasks.Task Check(global::Grpc.Health.V1.HealthCheckRequest request, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task Check(global::Grpc.Health.V1.HealthCheckRequest request, grpc::ServerCallContext context) { - throw new RpcException(new Status(StatusCode.Unimplemented, "")); + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } } /// Client for Health - public partial class HealthClient : ClientBase + public partial class HealthClient : grpc::ClientBase { /// Creates a new client for Health /// The channel to use to make remote calls. - public HealthClient(Channel channel) : base(channel) + public HealthClient(grpc::Channel channel) : base(channel) { } /// Creates a new client for Health that uses a custom CallInvoker. /// The callInvoker to use to make remote calls. - public HealthClient(CallInvoker callInvoker) : base(callInvoker) + public HealthClient(grpc::CallInvoker callInvoker) : base(callInvoker) { } /// Protected parameterless constructor to allow creation of test doubles. @@ -91,19 +91,19 @@ namespace Grpc.Health.V1 { { } - public virtual global::Grpc.Health.V1.HealthCheckResponse Check(global::Grpc.Health.V1.HealthCheckRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual global::Grpc.Health.V1.HealthCheckResponse Check(global::Grpc.Health.V1.HealthCheckRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return Check(request, new CallOptions(headers, deadline, cancellationToken)); + return Check(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } - public virtual global::Grpc.Health.V1.HealthCheckResponse Check(global::Grpc.Health.V1.HealthCheckRequest request, CallOptions options) + public virtual global::Grpc.Health.V1.HealthCheckResponse Check(global::Grpc.Health.V1.HealthCheckRequest request, grpc::CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_Check, null, options, request); } - public virtual AsyncUnaryCall CheckAsync(global::Grpc.Health.V1.HealthCheckRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual grpc::AsyncUnaryCall CheckAsync(global::Grpc.Health.V1.HealthCheckRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return CheckAsync(request, new CallOptions(headers, deadline, cancellationToken)); + return CheckAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } - public virtual AsyncUnaryCall CheckAsync(global::Grpc.Health.V1.HealthCheckRequest request, CallOptions options) + public virtual grpc::AsyncUnaryCall CheckAsync(global::Grpc.Health.V1.HealthCheckRequest request, grpc::CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_Check, null, options, request); } @@ -116,9 +116,9 @@ namespace Grpc.Health.V1 { /// Creates service definition that can be registered with a server /// An object implementing the server-side handling logic. - public static ServerServiceDefinition BindService(HealthBase serviceImpl) + public static grpc::ServerServiceDefinition BindService(HealthBase serviceImpl) { - return ServerServiceDefinition.CreateBuilder() + return grpc::ServerServiceDefinition.CreateBuilder() .AddMethod(__Method_Check, serviceImpl.Check).Build(); } diff --git a/src/csharp/Grpc.IntegrationTesting/MetricsGrpc.cs b/src/csharp/Grpc.IntegrationTesting/MetricsGrpc.cs index 8b58622d530..c80ffa8cf67 100644 --- a/src/csharp/Grpc.IntegrationTesting/MetricsGrpc.cs +++ b/src/csharp/Grpc.IntegrationTesting/MetricsGrpc.cs @@ -41,26 +41,26 @@ using System; using System.Threading; using System.Threading.Tasks; -using Grpc.Core; +using grpc = global::Grpc.Core; namespace Grpc.Testing { public static partial class MetricsService { static readonly string __ServiceName = "grpc.testing.MetricsService"; - static readonly Marshaller __Marshaller_EmptyMessage = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.EmptyMessage.Parser.ParseFrom); - static readonly Marshaller __Marshaller_GaugeResponse = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.GaugeResponse.Parser.ParseFrom); - static readonly Marshaller __Marshaller_GaugeRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.GaugeRequest.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_EmptyMessage = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.EmptyMessage.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_GaugeResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.GaugeResponse.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_GaugeRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.GaugeRequest.Parser.ParseFrom); - static readonly Method __Method_GetAllGauges = new Method( - MethodType.ServerStreaming, + static readonly grpc::Method __Method_GetAllGauges = new grpc::Method( + grpc::MethodType.ServerStreaming, __ServiceName, "GetAllGauges", __Marshaller_EmptyMessage, __Marshaller_GaugeResponse); - static readonly Method __Method_GetGauge = new Method( - MethodType.Unary, + static readonly grpc::Method __Method_GetGauge = new grpc::Method( + grpc::MethodType.Unary, __ServiceName, "GetGauge", __Marshaller_GaugeRequest, @@ -83,9 +83,9 @@ namespace Grpc.Testing { /// Used for sending responses back to the client. /// The context of the server-side call handler being invoked. /// A task indicating completion of the handler. - public virtual global::System.Threading.Tasks.Task GetAllGauges(global::Grpc.Testing.EmptyMessage request, IServerStreamWriter responseStream, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task GetAllGauges(global::Grpc.Testing.EmptyMessage request, grpc::IServerStreamWriter responseStream, grpc::ServerCallContext context) { - throw new RpcException(new Status(StatusCode.Unimplemented, "")); + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } /// @@ -94,24 +94,24 @@ namespace Grpc.Testing { /// The request received from the client. /// The context of the server-side call handler being invoked. /// The response to send back to the client (wrapped by a task). - public virtual global::System.Threading.Tasks.Task GetGauge(global::Grpc.Testing.GaugeRequest request, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task GetGauge(global::Grpc.Testing.GaugeRequest request, grpc::ServerCallContext context) { - throw new RpcException(new Status(StatusCode.Unimplemented, "")); + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } } /// Client for MetricsService - public partial class MetricsServiceClient : ClientBase + public partial class MetricsServiceClient : grpc::ClientBase { /// Creates a new client for MetricsService /// The channel to use to make remote calls. - public MetricsServiceClient(Channel channel) : base(channel) + public MetricsServiceClient(grpc::Channel channel) : base(channel) { } /// Creates a new client for MetricsService that uses a custom CallInvoker. /// The callInvoker to use to make remote calls. - public MetricsServiceClient(CallInvoker callInvoker) : base(callInvoker) + public MetricsServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) { } /// Protected parameterless constructor to allow creation of test doubles. @@ -133,9 +133,9 @@ namespace Grpc.Testing { /// An optional deadline for the call. The call will be cancelled if deadline is hit. /// An optional token for canceling the call. /// The call object. - public virtual AsyncServerStreamingCall GetAllGauges(global::Grpc.Testing.EmptyMessage request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual grpc::AsyncServerStreamingCall GetAllGauges(global::Grpc.Testing.EmptyMessage request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return GetAllGauges(request, new CallOptions(headers, deadline, cancellationToken)); + return GetAllGauges(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// /// Returns the values of all the gauges that are currently being maintained by @@ -144,7 +144,7 @@ namespace Grpc.Testing { /// The request to send to the server. /// The options for the call. /// The call object. - public virtual AsyncServerStreamingCall GetAllGauges(global::Grpc.Testing.EmptyMessage request, CallOptions options) + public virtual grpc::AsyncServerStreamingCall GetAllGauges(global::Grpc.Testing.EmptyMessage request, grpc::CallOptions options) { return CallInvoker.AsyncServerStreamingCall(__Method_GetAllGauges, null, options, request); } @@ -156,9 +156,9 @@ namespace Grpc.Testing { /// An optional deadline for the call. The call will be cancelled if deadline is hit. /// An optional token for canceling the call. /// The response received from the server. - public virtual global::Grpc.Testing.GaugeResponse GetGauge(global::Grpc.Testing.GaugeRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual global::Grpc.Testing.GaugeResponse GetGauge(global::Grpc.Testing.GaugeRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return GetGauge(request, new CallOptions(headers, deadline, cancellationToken)); + return GetGauge(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// /// Returns the value of one gauge @@ -166,7 +166,7 @@ namespace Grpc.Testing { /// The request to send to the server. /// The options for the call. /// The response received from the server. - public virtual global::Grpc.Testing.GaugeResponse GetGauge(global::Grpc.Testing.GaugeRequest request, CallOptions options) + public virtual global::Grpc.Testing.GaugeResponse GetGauge(global::Grpc.Testing.GaugeRequest request, grpc::CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_GetGauge, null, options, request); } @@ -178,9 +178,9 @@ namespace Grpc.Testing { /// An optional deadline for the call. The call will be cancelled if deadline is hit. /// An optional token for canceling the call. /// The call object. - public virtual AsyncUnaryCall GetGaugeAsync(global::Grpc.Testing.GaugeRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual grpc::AsyncUnaryCall GetGaugeAsync(global::Grpc.Testing.GaugeRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return GetGaugeAsync(request, new CallOptions(headers, deadline, cancellationToken)); + return GetGaugeAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// /// Returns the value of one gauge @@ -188,7 +188,7 @@ namespace Grpc.Testing { /// The request to send to the server. /// The options for the call. /// The call object. - public virtual AsyncUnaryCall GetGaugeAsync(global::Grpc.Testing.GaugeRequest request, CallOptions options) + public virtual grpc::AsyncUnaryCall GetGaugeAsync(global::Grpc.Testing.GaugeRequest request, grpc::CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_GetGauge, null, options, request); } @@ -201,9 +201,9 @@ namespace Grpc.Testing { /// Creates service definition that can be registered with a server /// An object implementing the server-side handling logic. - public static ServerServiceDefinition BindService(MetricsServiceBase serviceImpl) + public static grpc::ServerServiceDefinition BindService(MetricsServiceBase serviceImpl) { - return ServerServiceDefinition.CreateBuilder() + return grpc::ServerServiceDefinition.CreateBuilder() .AddMethod(__Method_GetAllGauges, serviceImpl.GetAllGauges) .AddMethod(__Method_GetGauge, serviceImpl.GetGauge).Build(); } diff --git a/src/csharp/Grpc.IntegrationTesting/ServicesGrpc.cs b/src/csharp/Grpc.IntegrationTesting/ServicesGrpc.cs index 5135d9ab66d..bb95c8a549f 100644 --- a/src/csharp/Grpc.IntegrationTesting/ServicesGrpc.cs +++ b/src/csharp/Grpc.IntegrationTesting/ServicesGrpc.cs @@ -37,25 +37,25 @@ using System; using System.Threading; using System.Threading.Tasks; -using Grpc.Core; +using grpc = global::Grpc.Core; namespace Grpc.Testing { public static partial class BenchmarkService { static readonly string __ServiceName = "grpc.testing.BenchmarkService"; - static readonly Marshaller __Marshaller_SimpleRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleRequest.Parser.ParseFrom); - static readonly Marshaller __Marshaller_SimpleResponse = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleResponse.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_SimpleRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleRequest.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_SimpleResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleResponse.Parser.ParseFrom); - static readonly Method __Method_UnaryCall = new Method( - MethodType.Unary, + static readonly grpc::Method __Method_UnaryCall = new grpc::Method( + grpc::MethodType.Unary, __ServiceName, "UnaryCall", __Marshaller_SimpleRequest, __Marshaller_SimpleResponse); - static readonly Method __Method_StreamingCall = new Method( - MethodType.DuplexStreaming, + static readonly grpc::Method __Method_StreamingCall = new grpc::Method( + grpc::MethodType.DuplexStreaming, __ServiceName, "StreamingCall", __Marshaller_SimpleRequest, @@ -77,9 +77,9 @@ namespace Grpc.Testing { /// The request received from the client. /// The context of the server-side call handler being invoked. /// The response to send back to the client (wrapped by a task). - public virtual global::System.Threading.Tasks.Task UnaryCall(global::Grpc.Testing.SimpleRequest request, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task UnaryCall(global::Grpc.Testing.SimpleRequest request, grpc::ServerCallContext context) { - throw new RpcException(new Status(StatusCode.Unimplemented, "")); + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } /// @@ -90,24 +90,24 @@ namespace Grpc.Testing { /// Used for sending responses back to the client. /// The context of the server-side call handler being invoked. /// A task indicating completion of the handler. - public virtual global::System.Threading.Tasks.Task StreamingCall(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task StreamingCall(grpc::IAsyncStreamReader requestStream, grpc::IServerStreamWriter responseStream, grpc::ServerCallContext context) { - throw new RpcException(new Status(StatusCode.Unimplemented, "")); + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } } /// Client for BenchmarkService - public partial class BenchmarkServiceClient : ClientBase + public partial class BenchmarkServiceClient : grpc::ClientBase { /// Creates a new client for BenchmarkService /// The channel to use to make remote calls. - public BenchmarkServiceClient(Channel channel) : base(channel) + public BenchmarkServiceClient(grpc::Channel channel) : base(channel) { } /// Creates a new client for BenchmarkService that uses a custom CallInvoker. /// The callInvoker to use to make remote calls. - public BenchmarkServiceClient(CallInvoker callInvoker) : base(callInvoker) + public BenchmarkServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) { } /// Protected parameterless constructor to allow creation of test doubles. @@ -129,9 +129,9 @@ namespace Grpc.Testing { /// An optional deadline for the call. The call will be cancelled if deadline is hit. /// An optional token for canceling the call. /// The response received from the server. - public virtual global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return UnaryCall(request, new CallOptions(headers, deadline, cancellationToken)); + return UnaryCall(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// /// One request followed by one response. @@ -140,7 +140,7 @@ namespace Grpc.Testing { /// The request to send to the server. /// The options for the call. /// The response received from the server. - public virtual global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, CallOptions options) + public virtual global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, grpc::CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_UnaryCall, null, options, request); } @@ -153,9 +153,9 @@ namespace Grpc.Testing { /// An optional deadline for the call. The call will be cancelled if deadline is hit. /// An optional token for canceling the call. /// The call object. - public virtual AsyncUnaryCall UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual grpc::AsyncUnaryCall UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return UnaryCallAsync(request, new CallOptions(headers, deadline, cancellationToken)); + return UnaryCallAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// /// One request followed by one response. @@ -164,7 +164,7 @@ namespace Grpc.Testing { /// The request to send to the server. /// The options for the call. /// The call object. - public virtual AsyncUnaryCall UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, CallOptions options) + public virtual grpc::AsyncUnaryCall UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, grpc::CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_UnaryCall, null, options, request); } @@ -176,9 +176,9 @@ namespace Grpc.Testing { /// An optional deadline for the call. The call will be cancelled if deadline is hit. /// An optional token for canceling the call. /// The call object. - public virtual AsyncDuplexStreamingCall StreamingCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual grpc::AsyncDuplexStreamingCall StreamingCall(grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return StreamingCall(new CallOptions(headers, deadline, cancellationToken)); + return StreamingCall(new grpc::CallOptions(headers, deadline, cancellationToken)); } /// /// One request followed by one response. @@ -186,7 +186,7 @@ namespace Grpc.Testing { /// /// The options for the call. /// The call object. - public virtual AsyncDuplexStreamingCall StreamingCall(CallOptions options) + public virtual grpc::AsyncDuplexStreamingCall StreamingCall(grpc::CallOptions options) { return CallInvoker.AsyncDuplexStreamingCall(__Method_StreamingCall, null, options); } @@ -199,9 +199,9 @@ namespace Grpc.Testing { /// Creates service definition that can be registered with a server /// An object implementing the server-side handling logic. - public static ServerServiceDefinition BindService(BenchmarkServiceBase serviceImpl) + public static grpc::ServerServiceDefinition BindService(BenchmarkServiceBase serviceImpl) { - return ServerServiceDefinition.CreateBuilder() + return grpc::ServerServiceDefinition.CreateBuilder() .AddMethod(__Method_UnaryCall, serviceImpl.UnaryCall) .AddMethod(__Method_StreamingCall, serviceImpl.StreamingCall).Build(); } @@ -211,37 +211,37 @@ namespace Grpc.Testing { { static readonly string __ServiceName = "grpc.testing.WorkerService"; - static readonly Marshaller __Marshaller_ServerArgs = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ServerArgs.Parser.ParseFrom); - static readonly Marshaller __Marshaller_ServerStatus = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ServerStatus.Parser.ParseFrom); - static readonly Marshaller __Marshaller_ClientArgs = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ClientArgs.Parser.ParseFrom); - static readonly Marshaller __Marshaller_ClientStatus = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ClientStatus.Parser.ParseFrom); - static readonly Marshaller __Marshaller_CoreRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.CoreRequest.Parser.ParseFrom); - static readonly Marshaller __Marshaller_CoreResponse = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.CoreResponse.Parser.ParseFrom); - static readonly Marshaller __Marshaller_Void = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Void.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_ServerArgs = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ServerArgs.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_ServerStatus = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ServerStatus.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_ClientArgs = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ClientArgs.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_ClientStatus = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ClientStatus.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_CoreRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.CoreRequest.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_CoreResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.CoreResponse.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_Void = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Void.Parser.ParseFrom); - static readonly Method __Method_RunServer = new Method( - MethodType.DuplexStreaming, + static readonly grpc::Method __Method_RunServer = new grpc::Method( + grpc::MethodType.DuplexStreaming, __ServiceName, "RunServer", __Marshaller_ServerArgs, __Marshaller_ServerStatus); - static readonly Method __Method_RunClient = new Method( - MethodType.DuplexStreaming, + static readonly grpc::Method __Method_RunClient = new grpc::Method( + grpc::MethodType.DuplexStreaming, __ServiceName, "RunClient", __Marshaller_ClientArgs, __Marshaller_ClientStatus); - static readonly Method __Method_CoreCount = new Method( - MethodType.Unary, + static readonly grpc::Method __Method_CoreCount = new grpc::Method( + grpc::MethodType.Unary, __ServiceName, "CoreCount", __Marshaller_CoreRequest, __Marshaller_CoreResponse); - static readonly Method __Method_QuitWorker = new Method( - MethodType.Unary, + static readonly grpc::Method __Method_QuitWorker = new grpc::Method( + grpc::MethodType.Unary, __ServiceName, "QuitWorker", __Marshaller_Void, @@ -268,9 +268,9 @@ namespace Grpc.Testing { /// Used for sending responses back to the client. /// The context of the server-side call handler being invoked. /// A task indicating completion of the handler. - public virtual global::System.Threading.Tasks.Task RunServer(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task RunServer(grpc::IAsyncStreamReader requestStream, grpc::IServerStreamWriter responseStream, grpc::ServerCallContext context) { - throw new RpcException(new Status(StatusCode.Unimplemented, "")); + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } /// @@ -285,9 +285,9 @@ namespace Grpc.Testing { /// Used for sending responses back to the client. /// The context of the server-side call handler being invoked. /// A task indicating completion of the handler. - public virtual global::System.Threading.Tasks.Task RunClient(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task RunClient(grpc::IAsyncStreamReader requestStream, grpc::IServerStreamWriter responseStream, grpc::ServerCallContext context) { - throw new RpcException(new Status(StatusCode.Unimplemented, "")); + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } /// @@ -296,9 +296,9 @@ namespace Grpc.Testing { /// The request received from the client. /// The context of the server-side call handler being invoked. /// The response to send back to the client (wrapped by a task). - public virtual global::System.Threading.Tasks.Task CoreCount(global::Grpc.Testing.CoreRequest request, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task CoreCount(global::Grpc.Testing.CoreRequest request, grpc::ServerCallContext context) { - throw new RpcException(new Status(StatusCode.Unimplemented, "")); + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } /// @@ -307,24 +307,24 @@ namespace Grpc.Testing { /// The request received from the client. /// The context of the server-side call handler being invoked. /// The response to send back to the client (wrapped by a task). - public virtual global::System.Threading.Tasks.Task QuitWorker(global::Grpc.Testing.Void request, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task QuitWorker(global::Grpc.Testing.Void request, grpc::ServerCallContext context) { - throw new RpcException(new Status(StatusCode.Unimplemented, "")); + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } } /// Client for WorkerService - public partial class WorkerServiceClient : ClientBase + public partial class WorkerServiceClient : grpc::ClientBase { /// Creates a new client for WorkerService /// The channel to use to make remote calls. - public WorkerServiceClient(Channel channel) : base(channel) + public WorkerServiceClient(grpc::Channel channel) : base(channel) { } /// Creates a new client for WorkerService that uses a custom CallInvoker. /// The callInvoker to use to make remote calls. - public WorkerServiceClient(CallInvoker callInvoker) : base(callInvoker) + public WorkerServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) { } /// Protected parameterless constructor to allow creation of test doubles. @@ -349,9 +349,9 @@ namespace Grpc.Testing { /// An optional deadline for the call. The call will be cancelled if deadline is hit. /// An optional token for canceling the call. /// The call object. - public virtual AsyncDuplexStreamingCall RunServer(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual grpc::AsyncDuplexStreamingCall RunServer(grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return RunServer(new CallOptions(headers, deadline, cancellationToken)); + return RunServer(new grpc::CallOptions(headers, deadline, cancellationToken)); } /// /// Start server with specified workload. @@ -363,7 +363,7 @@ namespace Grpc.Testing { /// /// The options for the call. /// The call object. - public virtual AsyncDuplexStreamingCall RunServer(CallOptions options) + public virtual grpc::AsyncDuplexStreamingCall RunServer(grpc::CallOptions options) { return CallInvoker.AsyncDuplexStreamingCall(__Method_RunServer, null, options); } @@ -379,9 +379,9 @@ namespace Grpc.Testing { /// An optional deadline for the call. The call will be cancelled if deadline is hit. /// An optional token for canceling the call. /// The call object. - public virtual AsyncDuplexStreamingCall RunClient(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual grpc::AsyncDuplexStreamingCall RunClient(grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return RunClient(new CallOptions(headers, deadline, cancellationToken)); + return RunClient(new grpc::CallOptions(headers, deadline, cancellationToken)); } /// /// Start client with specified workload. @@ -393,7 +393,7 @@ namespace Grpc.Testing { /// /// The options for the call. /// The call object. - public virtual AsyncDuplexStreamingCall RunClient(CallOptions options) + public virtual grpc::AsyncDuplexStreamingCall RunClient(grpc::CallOptions options) { return CallInvoker.AsyncDuplexStreamingCall(__Method_RunClient, null, options); } @@ -405,9 +405,9 @@ namespace Grpc.Testing { /// An optional deadline for the call. The call will be cancelled if deadline is hit. /// An optional token for canceling the call. /// The response received from the server. - public virtual global::Grpc.Testing.CoreResponse CoreCount(global::Grpc.Testing.CoreRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual global::Grpc.Testing.CoreResponse CoreCount(global::Grpc.Testing.CoreRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return CoreCount(request, new CallOptions(headers, deadline, cancellationToken)); + return CoreCount(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// /// Just return the core count - unary call @@ -415,7 +415,7 @@ namespace Grpc.Testing { /// The request to send to the server. /// The options for the call. /// The response received from the server. - public virtual global::Grpc.Testing.CoreResponse CoreCount(global::Grpc.Testing.CoreRequest request, CallOptions options) + public virtual global::Grpc.Testing.CoreResponse CoreCount(global::Grpc.Testing.CoreRequest request, grpc::CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_CoreCount, null, options, request); } @@ -427,9 +427,9 @@ namespace Grpc.Testing { /// An optional deadline for the call. The call will be cancelled if deadline is hit. /// An optional token for canceling the call. /// The call object. - public virtual AsyncUnaryCall CoreCountAsync(global::Grpc.Testing.CoreRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual grpc::AsyncUnaryCall CoreCountAsync(global::Grpc.Testing.CoreRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return CoreCountAsync(request, new CallOptions(headers, deadline, cancellationToken)); + return CoreCountAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// /// Just return the core count - unary call @@ -437,7 +437,7 @@ namespace Grpc.Testing { /// The request to send to the server. /// The options for the call. /// The call object. - public virtual AsyncUnaryCall CoreCountAsync(global::Grpc.Testing.CoreRequest request, CallOptions options) + public virtual grpc::AsyncUnaryCall CoreCountAsync(global::Grpc.Testing.CoreRequest request, grpc::CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_CoreCount, null, options, request); } @@ -449,9 +449,9 @@ namespace Grpc.Testing { /// An optional deadline for the call. The call will be cancelled if deadline is hit. /// An optional token for canceling the call. /// The response received from the server. - public virtual global::Grpc.Testing.Void QuitWorker(global::Grpc.Testing.Void request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual global::Grpc.Testing.Void QuitWorker(global::Grpc.Testing.Void request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return QuitWorker(request, new CallOptions(headers, deadline, cancellationToken)); + return QuitWorker(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// /// Quit this worker @@ -459,7 +459,7 @@ namespace Grpc.Testing { /// The request to send to the server. /// The options for the call. /// The response received from the server. - public virtual global::Grpc.Testing.Void QuitWorker(global::Grpc.Testing.Void request, CallOptions options) + public virtual global::Grpc.Testing.Void QuitWorker(global::Grpc.Testing.Void request, grpc::CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_QuitWorker, null, options, request); } @@ -471,9 +471,9 @@ namespace Grpc.Testing { /// An optional deadline for the call. The call will be cancelled if deadline is hit. /// An optional token for canceling the call. /// The call object. - public virtual AsyncUnaryCall QuitWorkerAsync(global::Grpc.Testing.Void request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual grpc::AsyncUnaryCall QuitWorkerAsync(global::Grpc.Testing.Void request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return QuitWorkerAsync(request, new CallOptions(headers, deadline, cancellationToken)); + return QuitWorkerAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// /// Quit this worker @@ -481,7 +481,7 @@ namespace Grpc.Testing { /// The request to send to the server. /// The options for the call. /// The call object. - public virtual AsyncUnaryCall QuitWorkerAsync(global::Grpc.Testing.Void request, CallOptions options) + public virtual grpc::AsyncUnaryCall QuitWorkerAsync(global::Grpc.Testing.Void request, grpc::CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_QuitWorker, null, options, request); } @@ -494,9 +494,9 @@ namespace Grpc.Testing { /// Creates service definition that can be registered with a server /// An object implementing the server-side handling logic. - public static ServerServiceDefinition BindService(WorkerServiceBase serviceImpl) + public static grpc::ServerServiceDefinition BindService(WorkerServiceBase serviceImpl) { - return ServerServiceDefinition.CreateBuilder() + return grpc::ServerServiceDefinition.CreateBuilder() .AddMethod(__Method_RunServer, serviceImpl.RunServer) .AddMethod(__Method_RunClient, serviceImpl.RunClient) .AddMethod(__Method_CoreCount, serviceImpl.CoreCount) diff --git a/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs b/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs index 0265f8e821e..77f76ebbe9c 100644 --- a/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs +++ b/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs @@ -38,7 +38,7 @@ using System; using System.Threading; using System.Threading.Tasks; -using Grpc.Core; +using grpc = global::Grpc.Core; namespace Grpc.Testing { /// @@ -49,65 +49,65 @@ namespace Grpc.Testing { { static readonly string __ServiceName = "grpc.testing.TestService"; - static readonly Marshaller __Marshaller_Empty = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Empty.Parser.ParseFrom); - static readonly Marshaller __Marshaller_SimpleRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleRequest.Parser.ParseFrom); - static readonly Marshaller __Marshaller_SimpleResponse = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleResponse.Parser.ParseFrom); - static readonly Marshaller __Marshaller_StreamingOutputCallRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.StreamingOutputCallRequest.Parser.ParseFrom); - static readonly Marshaller __Marshaller_StreamingOutputCallResponse = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.StreamingOutputCallResponse.Parser.ParseFrom); - static readonly Marshaller __Marshaller_StreamingInputCallRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.StreamingInputCallRequest.Parser.ParseFrom); - static readonly Marshaller __Marshaller_StreamingInputCallResponse = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.StreamingInputCallResponse.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_Empty = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Empty.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_SimpleRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleRequest.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_SimpleResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleResponse.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_StreamingOutputCallRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.StreamingOutputCallRequest.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_StreamingOutputCallResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.StreamingOutputCallResponse.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_StreamingInputCallRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.StreamingInputCallRequest.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_StreamingInputCallResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.StreamingInputCallResponse.Parser.ParseFrom); - static readonly Method __Method_EmptyCall = new Method( - MethodType.Unary, + static readonly grpc::Method __Method_EmptyCall = new grpc::Method( + grpc::MethodType.Unary, __ServiceName, "EmptyCall", __Marshaller_Empty, __Marshaller_Empty); - static readonly Method __Method_UnaryCall = new Method( - MethodType.Unary, + static readonly grpc::Method __Method_UnaryCall = new grpc::Method( + grpc::MethodType.Unary, __ServiceName, "UnaryCall", __Marshaller_SimpleRequest, __Marshaller_SimpleResponse); - static readonly Method __Method_CacheableUnaryCall = new Method( - MethodType.Unary, + static readonly grpc::Method __Method_CacheableUnaryCall = new grpc::Method( + grpc::MethodType.Unary, __ServiceName, "CacheableUnaryCall", __Marshaller_SimpleRequest, __Marshaller_SimpleResponse); - static readonly Method __Method_StreamingOutputCall = new Method( - MethodType.ServerStreaming, + static readonly grpc::Method __Method_StreamingOutputCall = new grpc::Method( + grpc::MethodType.ServerStreaming, __ServiceName, "StreamingOutputCall", __Marshaller_StreamingOutputCallRequest, __Marshaller_StreamingOutputCallResponse); - static readonly Method __Method_StreamingInputCall = new Method( - MethodType.ClientStreaming, + static readonly grpc::Method __Method_StreamingInputCall = new grpc::Method( + grpc::MethodType.ClientStreaming, __ServiceName, "StreamingInputCall", __Marshaller_StreamingInputCallRequest, __Marshaller_StreamingInputCallResponse); - static readonly Method __Method_FullDuplexCall = new Method( - MethodType.DuplexStreaming, + static readonly grpc::Method __Method_FullDuplexCall = new grpc::Method( + grpc::MethodType.DuplexStreaming, __ServiceName, "FullDuplexCall", __Marshaller_StreamingOutputCallRequest, __Marshaller_StreamingOutputCallResponse); - static readonly Method __Method_HalfDuplexCall = new Method( - MethodType.DuplexStreaming, + static readonly grpc::Method __Method_HalfDuplexCall = new grpc::Method( + grpc::MethodType.DuplexStreaming, __ServiceName, "HalfDuplexCall", __Marshaller_StreamingOutputCallRequest, __Marshaller_StreamingOutputCallResponse); - static readonly Method __Method_UnimplementedCall = new Method( - MethodType.Unary, + static readonly grpc::Method __Method_UnimplementedCall = new grpc::Method( + grpc::MethodType.Unary, __ServiceName, "UnimplementedCall", __Marshaller_Empty, @@ -128,9 +128,9 @@ namespace Grpc.Testing { /// The request received from the client. /// The context of the server-side call handler being invoked. /// The response to send back to the client (wrapped by a task). - public virtual global::System.Threading.Tasks.Task EmptyCall(global::Grpc.Testing.Empty request, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task EmptyCall(global::Grpc.Testing.Empty request, grpc::ServerCallContext context) { - throw new RpcException(new Status(StatusCode.Unimplemented, "")); + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } /// @@ -139,9 +139,9 @@ namespace Grpc.Testing { /// The request received from the client. /// The context of the server-side call handler being invoked. /// The response to send back to the client (wrapped by a task). - public virtual global::System.Threading.Tasks.Task UnaryCall(global::Grpc.Testing.SimpleRequest request, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task UnaryCall(global::Grpc.Testing.SimpleRequest request, grpc::ServerCallContext context) { - throw new RpcException(new Status(StatusCode.Unimplemented, "")); + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } /// @@ -152,9 +152,9 @@ namespace Grpc.Testing { /// The request received from the client. /// The context of the server-side call handler being invoked. /// The response to send back to the client (wrapped by a task). - public virtual global::System.Threading.Tasks.Task CacheableUnaryCall(global::Grpc.Testing.SimpleRequest request, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task CacheableUnaryCall(global::Grpc.Testing.SimpleRequest request, grpc::ServerCallContext context) { - throw new RpcException(new Status(StatusCode.Unimplemented, "")); + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } /// @@ -165,9 +165,9 @@ namespace Grpc.Testing { /// Used for sending responses back to the client. /// The context of the server-side call handler being invoked. /// A task indicating completion of the handler. - public virtual global::System.Threading.Tasks.Task StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, IServerStreamWriter responseStream, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, grpc::IServerStreamWriter responseStream, grpc::ServerCallContext context) { - throw new RpcException(new Status(StatusCode.Unimplemented, "")); + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } /// @@ -177,9 +177,9 @@ namespace Grpc.Testing { /// Used for reading requests from the client. /// The context of the server-side call handler being invoked. /// The response to send back to the client (wrapped by a task). - public virtual global::System.Threading.Tasks.Task StreamingInputCall(IAsyncStreamReader requestStream, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task StreamingInputCall(grpc::IAsyncStreamReader requestStream, grpc::ServerCallContext context) { - throw new RpcException(new Status(StatusCode.Unimplemented, "")); + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } /// @@ -191,9 +191,9 @@ namespace Grpc.Testing { /// Used for sending responses back to the client. /// The context of the server-side call handler being invoked. /// A task indicating completion of the handler. - public virtual global::System.Threading.Tasks.Task FullDuplexCall(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task FullDuplexCall(grpc::IAsyncStreamReader requestStream, grpc::IServerStreamWriter responseStream, grpc::ServerCallContext context) { - throw new RpcException(new Status(StatusCode.Unimplemented, "")); + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } /// @@ -206,9 +206,9 @@ namespace Grpc.Testing { /// Used for sending responses back to the client. /// The context of the server-side call handler being invoked. /// A task indicating completion of the handler. - public virtual global::System.Threading.Tasks.Task HalfDuplexCall(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task HalfDuplexCall(grpc::IAsyncStreamReader requestStream, grpc::IServerStreamWriter responseStream, grpc::ServerCallContext context) { - throw new RpcException(new Status(StatusCode.Unimplemented, "")); + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } /// @@ -218,24 +218,24 @@ namespace Grpc.Testing { /// The request received from the client. /// The context of the server-side call handler being invoked. /// The response to send back to the client (wrapped by a task). - public virtual global::System.Threading.Tasks.Task UnimplementedCall(global::Grpc.Testing.Empty request, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task UnimplementedCall(global::Grpc.Testing.Empty request, grpc::ServerCallContext context) { - throw new RpcException(new Status(StatusCode.Unimplemented, "")); + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } } /// Client for TestService - public partial class TestServiceClient : ClientBase + public partial class TestServiceClient : grpc::ClientBase { /// Creates a new client for TestService /// The channel to use to make remote calls. - public TestServiceClient(Channel channel) : base(channel) + public TestServiceClient(grpc::Channel channel) : base(channel) { } /// Creates a new client for TestService that uses a custom CallInvoker. /// The callInvoker to use to make remote calls. - public TestServiceClient(CallInvoker callInvoker) : base(callInvoker) + public TestServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) { } /// Protected parameterless constructor to allow creation of test doubles. @@ -256,9 +256,9 @@ namespace Grpc.Testing { /// An optional deadline for the call. The call will be cancelled if deadline is hit. /// An optional token for canceling the call. /// The response received from the server. - public virtual global::Grpc.Testing.Empty EmptyCall(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual global::Grpc.Testing.Empty EmptyCall(global::Grpc.Testing.Empty request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return EmptyCall(request, new CallOptions(headers, deadline, cancellationToken)); + return EmptyCall(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// /// One empty request followed by one empty response. @@ -266,7 +266,7 @@ namespace Grpc.Testing { /// The request to send to the server. /// The options for the call. /// The response received from the server. - public virtual global::Grpc.Testing.Empty EmptyCall(global::Grpc.Testing.Empty request, CallOptions options) + public virtual global::Grpc.Testing.Empty EmptyCall(global::Grpc.Testing.Empty request, grpc::CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_EmptyCall, null, options, request); } @@ -278,9 +278,9 @@ namespace Grpc.Testing { /// An optional deadline for the call. The call will be cancelled if deadline is hit. /// An optional token for canceling the call. /// The call object. - public virtual AsyncUnaryCall EmptyCallAsync(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual grpc::AsyncUnaryCall EmptyCallAsync(global::Grpc.Testing.Empty request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return EmptyCallAsync(request, new CallOptions(headers, deadline, cancellationToken)); + return EmptyCallAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// /// One empty request followed by one empty response. @@ -288,7 +288,7 @@ namespace Grpc.Testing { /// The request to send to the server. /// The options for the call. /// The call object. - public virtual AsyncUnaryCall EmptyCallAsync(global::Grpc.Testing.Empty request, CallOptions options) + public virtual grpc::AsyncUnaryCall EmptyCallAsync(global::Grpc.Testing.Empty request, grpc::CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_EmptyCall, null, options, request); } @@ -300,9 +300,9 @@ namespace Grpc.Testing { /// An optional deadline for the call. The call will be cancelled if deadline is hit. /// An optional token for canceling the call. /// The response received from the server. - public virtual global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return UnaryCall(request, new CallOptions(headers, deadline, cancellationToken)); + return UnaryCall(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// /// One request followed by one response. @@ -310,7 +310,7 @@ namespace Grpc.Testing { /// The request to send to the server. /// The options for the call. /// The response received from the server. - public virtual global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, CallOptions options) + public virtual global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, grpc::CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_UnaryCall, null, options, request); } @@ -322,9 +322,9 @@ namespace Grpc.Testing { /// An optional deadline for the call. The call will be cancelled if deadline is hit. /// An optional token for canceling the call. /// The call object. - public virtual AsyncUnaryCall UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual grpc::AsyncUnaryCall UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return UnaryCallAsync(request, new CallOptions(headers, deadline, cancellationToken)); + return UnaryCallAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// /// One request followed by one response. @@ -332,7 +332,7 @@ namespace Grpc.Testing { /// The request to send to the server. /// The options for the call. /// The call object. - public virtual AsyncUnaryCall UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, CallOptions options) + public virtual grpc::AsyncUnaryCall UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, grpc::CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_UnaryCall, null, options, request); } @@ -346,9 +346,9 @@ namespace Grpc.Testing { /// An optional deadline for the call. The call will be cancelled if deadline is hit. /// An optional token for canceling the call. /// The response received from the server. - public virtual global::Grpc.Testing.SimpleResponse CacheableUnaryCall(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual global::Grpc.Testing.SimpleResponse CacheableUnaryCall(global::Grpc.Testing.SimpleRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return CacheableUnaryCall(request, new CallOptions(headers, deadline, cancellationToken)); + return CacheableUnaryCall(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// /// One request followed by one response. Response has cache control @@ -358,7 +358,7 @@ namespace Grpc.Testing { /// The request to send to the server. /// The options for the call. /// The response received from the server. - public virtual global::Grpc.Testing.SimpleResponse CacheableUnaryCall(global::Grpc.Testing.SimpleRequest request, CallOptions options) + public virtual global::Grpc.Testing.SimpleResponse CacheableUnaryCall(global::Grpc.Testing.SimpleRequest request, grpc::CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_CacheableUnaryCall, null, options, request); } @@ -372,9 +372,9 @@ namespace Grpc.Testing { /// An optional deadline for the call. The call will be cancelled if deadline is hit. /// An optional token for canceling the call. /// The call object. - public virtual AsyncUnaryCall CacheableUnaryCallAsync(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual grpc::AsyncUnaryCall CacheableUnaryCallAsync(global::Grpc.Testing.SimpleRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return CacheableUnaryCallAsync(request, new CallOptions(headers, deadline, cancellationToken)); + return CacheableUnaryCallAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// /// One request followed by one response. Response has cache control @@ -384,7 +384,7 @@ namespace Grpc.Testing { /// The request to send to the server. /// The options for the call. /// The call object. - public virtual AsyncUnaryCall CacheableUnaryCallAsync(global::Grpc.Testing.SimpleRequest request, CallOptions options) + public virtual grpc::AsyncUnaryCall CacheableUnaryCallAsync(global::Grpc.Testing.SimpleRequest request, grpc::CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_CacheableUnaryCall, null, options, request); } @@ -397,9 +397,9 @@ namespace Grpc.Testing { /// An optional deadline for the call. The call will be cancelled if deadline is hit. /// An optional token for canceling the call. /// The call object. - public virtual AsyncServerStreamingCall StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual grpc::AsyncServerStreamingCall StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return StreamingOutputCall(request, new CallOptions(headers, deadline, cancellationToken)); + return StreamingOutputCall(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// /// One request followed by a sequence of responses (streamed download). @@ -408,7 +408,7 @@ namespace Grpc.Testing { /// The request to send to the server. /// The options for the call. /// The call object. - public virtual AsyncServerStreamingCall StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, CallOptions options) + public virtual grpc::AsyncServerStreamingCall StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, grpc::CallOptions options) { return CallInvoker.AsyncServerStreamingCall(__Method_StreamingOutputCall, null, options, request); } @@ -420,9 +420,9 @@ namespace Grpc.Testing { /// An optional deadline for the call. The call will be cancelled if deadline is hit. /// An optional token for canceling the call. /// The call object. - public virtual AsyncClientStreamingCall StreamingInputCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual grpc::AsyncClientStreamingCall StreamingInputCall(grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return StreamingInputCall(new CallOptions(headers, deadline, cancellationToken)); + return StreamingInputCall(new grpc::CallOptions(headers, deadline, cancellationToken)); } /// /// A sequence of requests followed by one response (streamed upload). @@ -430,7 +430,7 @@ namespace Grpc.Testing { /// /// The options for the call. /// The call object. - public virtual AsyncClientStreamingCall StreamingInputCall(CallOptions options) + public virtual grpc::AsyncClientStreamingCall StreamingInputCall(grpc::CallOptions options) { return CallInvoker.AsyncClientStreamingCall(__Method_StreamingInputCall, null, options); } @@ -443,9 +443,9 @@ namespace Grpc.Testing { /// An optional deadline for the call. The call will be cancelled if deadline is hit. /// An optional token for canceling the call. /// The call object. - public virtual AsyncDuplexStreamingCall FullDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual grpc::AsyncDuplexStreamingCall FullDuplexCall(grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return FullDuplexCall(new CallOptions(headers, deadline, cancellationToken)); + return FullDuplexCall(new grpc::CallOptions(headers, deadline, cancellationToken)); } /// /// A sequence of requests with each request served by the server immediately. @@ -454,7 +454,7 @@ namespace Grpc.Testing { /// /// The options for the call. /// The call object. - public virtual AsyncDuplexStreamingCall FullDuplexCall(CallOptions options) + public virtual grpc::AsyncDuplexStreamingCall FullDuplexCall(grpc::CallOptions options) { return CallInvoker.AsyncDuplexStreamingCall(__Method_FullDuplexCall, null, options); } @@ -468,9 +468,9 @@ namespace Grpc.Testing { /// An optional deadline for the call. The call will be cancelled if deadline is hit. /// An optional token for canceling the call. /// The call object. - public virtual AsyncDuplexStreamingCall HalfDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual grpc::AsyncDuplexStreamingCall HalfDuplexCall(grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return HalfDuplexCall(new CallOptions(headers, deadline, cancellationToken)); + return HalfDuplexCall(new grpc::CallOptions(headers, deadline, cancellationToken)); } /// /// A sequence of requests followed by a sequence of responses. @@ -480,7 +480,7 @@ namespace Grpc.Testing { /// /// The options for the call. /// The call object. - public virtual AsyncDuplexStreamingCall HalfDuplexCall(CallOptions options) + public virtual grpc::AsyncDuplexStreamingCall HalfDuplexCall(grpc::CallOptions options) { return CallInvoker.AsyncDuplexStreamingCall(__Method_HalfDuplexCall, null, options); } @@ -493,9 +493,9 @@ namespace Grpc.Testing { /// An optional deadline for the call. The call will be cancelled if deadline is hit. /// An optional token for canceling the call. /// The response received from the server. - public virtual global::Grpc.Testing.Empty UnimplementedCall(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual global::Grpc.Testing.Empty UnimplementedCall(global::Grpc.Testing.Empty request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return UnimplementedCall(request, new CallOptions(headers, deadline, cancellationToken)); + return UnimplementedCall(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// /// The test server will not implement this method. It will be used @@ -504,7 +504,7 @@ namespace Grpc.Testing { /// The request to send to the server. /// The options for the call. /// The response received from the server. - public virtual global::Grpc.Testing.Empty UnimplementedCall(global::Grpc.Testing.Empty request, CallOptions options) + public virtual global::Grpc.Testing.Empty UnimplementedCall(global::Grpc.Testing.Empty request, grpc::CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_UnimplementedCall, null, options, request); } @@ -517,9 +517,9 @@ namespace Grpc.Testing { /// An optional deadline for the call. The call will be cancelled if deadline is hit. /// An optional token for canceling the call. /// The call object. - public virtual AsyncUnaryCall UnimplementedCallAsync(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual grpc::AsyncUnaryCall UnimplementedCallAsync(global::Grpc.Testing.Empty request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return UnimplementedCallAsync(request, new CallOptions(headers, deadline, cancellationToken)); + return UnimplementedCallAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// /// The test server will not implement this method. It will be used @@ -528,7 +528,7 @@ namespace Grpc.Testing { /// The request to send to the server. /// The options for the call. /// The call object. - public virtual AsyncUnaryCall UnimplementedCallAsync(global::Grpc.Testing.Empty request, CallOptions options) + public virtual grpc::AsyncUnaryCall UnimplementedCallAsync(global::Grpc.Testing.Empty request, grpc::CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_UnimplementedCall, null, options, request); } @@ -541,9 +541,9 @@ namespace Grpc.Testing { /// Creates service definition that can be registered with a server /// An object implementing the server-side handling logic. - public static ServerServiceDefinition BindService(TestServiceBase serviceImpl) + public static grpc::ServerServiceDefinition BindService(TestServiceBase serviceImpl) { - return ServerServiceDefinition.CreateBuilder() + return grpc::ServerServiceDefinition.CreateBuilder() .AddMethod(__Method_EmptyCall, serviceImpl.EmptyCall) .AddMethod(__Method_UnaryCall, serviceImpl.UnaryCall) .AddMethod(__Method_CacheableUnaryCall, serviceImpl.CacheableUnaryCall) @@ -563,10 +563,10 @@ namespace Grpc.Testing { { static readonly string __ServiceName = "grpc.testing.UnimplementedService"; - static readonly Marshaller __Marshaller_Empty = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Empty.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_Empty = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Empty.Parser.ParseFrom); - static readonly Method __Method_UnimplementedCall = new Method( - MethodType.Unary, + static readonly grpc::Method __Method_UnimplementedCall = new grpc::Method( + grpc::MethodType.Unary, __ServiceName, "UnimplementedCall", __Marshaller_Empty, @@ -587,24 +587,24 @@ namespace Grpc.Testing { /// The request received from the client. /// The context of the server-side call handler being invoked. /// The response to send back to the client (wrapped by a task). - public virtual global::System.Threading.Tasks.Task UnimplementedCall(global::Grpc.Testing.Empty request, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task UnimplementedCall(global::Grpc.Testing.Empty request, grpc::ServerCallContext context) { - throw new RpcException(new Status(StatusCode.Unimplemented, "")); + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } } /// Client for UnimplementedService - public partial class UnimplementedServiceClient : ClientBase + public partial class UnimplementedServiceClient : grpc::ClientBase { /// Creates a new client for UnimplementedService /// The channel to use to make remote calls. - public UnimplementedServiceClient(Channel channel) : base(channel) + public UnimplementedServiceClient(grpc::Channel channel) : base(channel) { } /// Creates a new client for UnimplementedService that uses a custom CallInvoker. /// The callInvoker to use to make remote calls. - public UnimplementedServiceClient(CallInvoker callInvoker) : base(callInvoker) + public UnimplementedServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) { } /// Protected parameterless constructor to allow creation of test doubles. @@ -625,9 +625,9 @@ namespace Grpc.Testing { /// An optional deadline for the call. The call will be cancelled if deadline is hit. /// An optional token for canceling the call. /// The response received from the server. - public virtual global::Grpc.Testing.Empty UnimplementedCall(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual global::Grpc.Testing.Empty UnimplementedCall(global::Grpc.Testing.Empty request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return UnimplementedCall(request, new CallOptions(headers, deadline, cancellationToken)); + return UnimplementedCall(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// /// A call that no server should implement @@ -635,7 +635,7 @@ namespace Grpc.Testing { /// The request to send to the server. /// The options for the call. /// The response received from the server. - public virtual global::Grpc.Testing.Empty UnimplementedCall(global::Grpc.Testing.Empty request, CallOptions options) + public virtual global::Grpc.Testing.Empty UnimplementedCall(global::Grpc.Testing.Empty request, grpc::CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_UnimplementedCall, null, options, request); } @@ -647,9 +647,9 @@ namespace Grpc.Testing { /// An optional deadline for the call. The call will be cancelled if deadline is hit. /// An optional token for canceling the call. /// The call object. - public virtual AsyncUnaryCall UnimplementedCallAsync(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual grpc::AsyncUnaryCall UnimplementedCallAsync(global::Grpc.Testing.Empty request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return UnimplementedCallAsync(request, new CallOptions(headers, deadline, cancellationToken)); + return UnimplementedCallAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// /// A call that no server should implement @@ -657,7 +657,7 @@ namespace Grpc.Testing { /// The request to send to the server. /// The options for the call. /// The call object. - public virtual AsyncUnaryCall UnimplementedCallAsync(global::Grpc.Testing.Empty request, CallOptions options) + public virtual grpc::AsyncUnaryCall UnimplementedCallAsync(global::Grpc.Testing.Empty request, grpc::CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_UnimplementedCall, null, options, request); } @@ -670,9 +670,9 @@ namespace Grpc.Testing { /// Creates service definition that can be registered with a server /// An object implementing the server-side handling logic. - public static ServerServiceDefinition BindService(UnimplementedServiceBase serviceImpl) + public static grpc::ServerServiceDefinition BindService(UnimplementedServiceBase serviceImpl) { - return ServerServiceDefinition.CreateBuilder() + return grpc::ServerServiceDefinition.CreateBuilder() .AddMethod(__Method_UnimplementedCall, serviceImpl.UnimplementedCall).Build(); } @@ -684,19 +684,19 @@ namespace Grpc.Testing { { static readonly string __ServiceName = "grpc.testing.ReconnectService"; - static readonly Marshaller __Marshaller_ReconnectParams = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ReconnectParams.Parser.ParseFrom); - static readonly Marshaller __Marshaller_Empty = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Empty.Parser.ParseFrom); - static readonly Marshaller __Marshaller_ReconnectInfo = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ReconnectInfo.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_ReconnectParams = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ReconnectParams.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_Empty = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Empty.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_ReconnectInfo = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ReconnectInfo.Parser.ParseFrom); - static readonly Method __Method_Start = new Method( - MethodType.Unary, + static readonly grpc::Method __Method_Start = new grpc::Method( + grpc::MethodType.Unary, __ServiceName, "Start", __Marshaller_ReconnectParams, __Marshaller_Empty); - static readonly Method __Method_Stop = new Method( - MethodType.Unary, + static readonly grpc::Method __Method_Stop = new grpc::Method( + grpc::MethodType.Unary, __ServiceName, "Stop", __Marshaller_Empty, @@ -711,29 +711,29 @@ namespace Grpc.Testing { /// Base class for server-side implementations of ReconnectService public abstract partial class ReconnectServiceBase { - public virtual global::System.Threading.Tasks.Task Start(global::Grpc.Testing.ReconnectParams request, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task Start(global::Grpc.Testing.ReconnectParams request, grpc::ServerCallContext context) { - throw new RpcException(new Status(StatusCode.Unimplemented, "")); + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } - public virtual global::System.Threading.Tasks.Task Stop(global::Grpc.Testing.Empty request, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task Stop(global::Grpc.Testing.Empty request, grpc::ServerCallContext context) { - throw new RpcException(new Status(StatusCode.Unimplemented, "")); + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } } /// Client for ReconnectService - public partial class ReconnectServiceClient : ClientBase + public partial class ReconnectServiceClient : grpc::ClientBase { /// Creates a new client for ReconnectService /// The channel to use to make remote calls. - public ReconnectServiceClient(Channel channel) : base(channel) + public ReconnectServiceClient(grpc::Channel channel) : base(channel) { } /// Creates a new client for ReconnectService that uses a custom CallInvoker. /// The callInvoker to use to make remote calls. - public ReconnectServiceClient(CallInvoker callInvoker) : base(callInvoker) + public ReconnectServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) { } /// Protected parameterless constructor to allow creation of test doubles. @@ -746,35 +746,35 @@ namespace Grpc.Testing { { } - public virtual global::Grpc.Testing.Empty Start(global::Grpc.Testing.ReconnectParams request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual global::Grpc.Testing.Empty Start(global::Grpc.Testing.ReconnectParams request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return Start(request, new CallOptions(headers, deadline, cancellationToken)); + return Start(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } - public virtual global::Grpc.Testing.Empty Start(global::Grpc.Testing.ReconnectParams request, CallOptions options) + public virtual global::Grpc.Testing.Empty Start(global::Grpc.Testing.ReconnectParams request, grpc::CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_Start, null, options, request); } - public virtual AsyncUnaryCall StartAsync(global::Grpc.Testing.ReconnectParams request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual grpc::AsyncUnaryCall StartAsync(global::Grpc.Testing.ReconnectParams request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return StartAsync(request, new CallOptions(headers, deadline, cancellationToken)); + return StartAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } - public virtual AsyncUnaryCall StartAsync(global::Grpc.Testing.ReconnectParams request, CallOptions options) + public virtual grpc::AsyncUnaryCall StartAsync(global::Grpc.Testing.ReconnectParams request, grpc::CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_Start, null, options, request); } - public virtual global::Grpc.Testing.ReconnectInfo Stop(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual global::Grpc.Testing.ReconnectInfo Stop(global::Grpc.Testing.Empty request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return Stop(request, new CallOptions(headers, deadline, cancellationToken)); + return Stop(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } - public virtual global::Grpc.Testing.ReconnectInfo Stop(global::Grpc.Testing.Empty request, CallOptions options) + public virtual global::Grpc.Testing.ReconnectInfo Stop(global::Grpc.Testing.Empty request, grpc::CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_Stop, null, options, request); } - public virtual AsyncUnaryCall StopAsync(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual grpc::AsyncUnaryCall StopAsync(global::Grpc.Testing.Empty request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return StopAsync(request, new CallOptions(headers, deadline, cancellationToken)); + return StopAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } - public virtual AsyncUnaryCall StopAsync(global::Grpc.Testing.Empty request, CallOptions options) + public virtual grpc::AsyncUnaryCall StopAsync(global::Grpc.Testing.Empty request, grpc::CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_Stop, null, options, request); } @@ -787,9 +787,9 @@ namespace Grpc.Testing { /// Creates service definition that can be registered with a server /// An object implementing the server-side handling logic. - public static ServerServiceDefinition BindService(ReconnectServiceBase serviceImpl) + public static grpc::ServerServiceDefinition BindService(ReconnectServiceBase serviceImpl) { - return ServerServiceDefinition.CreateBuilder() + return grpc::ServerServiceDefinition.CreateBuilder() .AddMethod(__Method_Start, serviceImpl.Start) .AddMethod(__Method_Stop, serviceImpl.Stop).Build(); } diff --git a/src/csharp/Grpc.Reflection/ReflectionGrpc.cs b/src/csharp/Grpc.Reflection/ReflectionGrpc.cs index 5bd7558be58..45321587f58 100644 --- a/src/csharp/Grpc.Reflection/ReflectionGrpc.cs +++ b/src/csharp/Grpc.Reflection/ReflectionGrpc.cs @@ -37,18 +37,18 @@ using System; using System.Threading; using System.Threading.Tasks; -using Grpc.Core; +using grpc = global::Grpc.Core; namespace Grpc.Reflection.V1Alpha { public static partial class ServerReflection { static readonly string __ServiceName = "grpc.reflection.v1alpha.ServerReflection"; - static readonly Marshaller __Marshaller_ServerReflectionRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Reflection.V1Alpha.ServerReflectionRequest.Parser.ParseFrom); - static readonly Marshaller __Marshaller_ServerReflectionResponse = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Reflection.V1Alpha.ServerReflectionResponse.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_ServerReflectionRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Reflection.V1Alpha.ServerReflectionRequest.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_ServerReflectionResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Reflection.V1Alpha.ServerReflectionResponse.Parser.ParseFrom); - static readonly Method __Method_ServerReflectionInfo = new Method( - MethodType.DuplexStreaming, + static readonly grpc::Method __Method_ServerReflectionInfo = new grpc::Method( + grpc::MethodType.DuplexStreaming, __ServiceName, "ServerReflectionInfo", __Marshaller_ServerReflectionRequest, @@ -71,24 +71,24 @@ namespace Grpc.Reflection.V1Alpha { /// Used for sending responses back to the client. /// The context of the server-side call handler being invoked. /// A task indicating completion of the handler. - public virtual global::System.Threading.Tasks.Task ServerReflectionInfo(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task ServerReflectionInfo(grpc::IAsyncStreamReader requestStream, grpc::IServerStreamWriter responseStream, grpc::ServerCallContext context) { - throw new RpcException(new Status(StatusCode.Unimplemented, "")); + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } } /// Client for ServerReflection - public partial class ServerReflectionClient : ClientBase + public partial class ServerReflectionClient : grpc::ClientBase { /// Creates a new client for ServerReflection /// The channel to use to make remote calls. - public ServerReflectionClient(Channel channel) : base(channel) + public ServerReflectionClient(grpc::Channel channel) : base(channel) { } /// Creates a new client for ServerReflection that uses a custom CallInvoker. /// The callInvoker to use to make remote calls. - public ServerReflectionClient(CallInvoker callInvoker) : base(callInvoker) + public ServerReflectionClient(grpc::CallInvoker callInvoker) : base(callInvoker) { } /// Protected parameterless constructor to allow creation of test doubles. @@ -109,9 +109,9 @@ namespace Grpc.Reflection.V1Alpha { /// An optional deadline for the call. The call will be cancelled if deadline is hit. /// An optional token for canceling the call. /// The call object. - public virtual AsyncDuplexStreamingCall ServerReflectionInfo(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual grpc::AsyncDuplexStreamingCall ServerReflectionInfo(grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return ServerReflectionInfo(new CallOptions(headers, deadline, cancellationToken)); + return ServerReflectionInfo(new grpc::CallOptions(headers, deadline, cancellationToken)); } /// /// The reflection service is structured as a bidirectional stream, ensuring @@ -119,7 +119,7 @@ namespace Grpc.Reflection.V1Alpha { /// /// The options for the call. /// The call object. - public virtual AsyncDuplexStreamingCall ServerReflectionInfo(CallOptions options) + public virtual grpc::AsyncDuplexStreamingCall ServerReflectionInfo(grpc::CallOptions options) { return CallInvoker.AsyncDuplexStreamingCall(__Method_ServerReflectionInfo, null, options); } @@ -132,9 +132,9 @@ namespace Grpc.Reflection.V1Alpha { /// Creates service definition that can be registered with a server /// An object implementing the server-side handling logic. - public static ServerServiceDefinition BindService(ServerReflectionBase serviceImpl) + public static grpc::ServerServiceDefinition BindService(ServerReflectionBase serviceImpl) { - return ServerServiceDefinition.CreateBuilder() + return grpc::ServerServiceDefinition.CreateBuilder() .AddMethod(__Method_ServerReflectionInfo, serviceImpl.ServerReflectionInfo).Build(); }