1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: helloworld.proto
3 // Original file comments:
4 // Copyright 2015 gRPC authors.
6 // Licensed under the Apache License, Version 2.0 (the "License");
7 // you may not use this file except in compliance with the License.
8 // You may obtain a copy of the License at
10 // http://www.apache.org/licenses/LICENSE-2.0
12 // Unless required by applicable law or agreed to in writing, software
13 // distributed under the License is distributed on an "AS IS" BASIS,
14 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 // See the License for the specific language governing permissions and
16 // limitations under the License.
18 #pragma warning disable 1591
19 #region Designer generated code
22 using System.Threading;
23 using System.Threading.Tasks;
24 using grpc = global::Grpc.Core;
26 namespace Helloworld {
28 /// The greeting service definition.
30 public static partial class Greeter
32 static readonly string __ServiceName = "helloworld.Greeter";
34 static readonly grpc::Marshaller<global::Helloworld.HelloRequest> __Marshaller_HelloRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Helloworld.HelloRequest.Parser.ParseFrom);
35 static readonly grpc::Marshaller<global::Helloworld.HelloReply> __Marshaller_HelloReply = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Helloworld.HelloReply.Parser.ParseFrom);
37 static readonly grpc::Method<global::Helloworld.HelloRequest, global::Helloworld.HelloReply> __Method_SayHello = new grpc::Method<global::Helloworld.HelloRequest, global::Helloworld.HelloReply>(
38 grpc::MethodType.Unary,
41 __Marshaller_HelloRequest,
42 __Marshaller_HelloReply);
44 /// <summary>Service descriptor</summary>
45 public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
47 get { return global::Helloworld.HelloworldReflection.Descriptor.Services[0]; }
50 /// <summary>Base class for server-side implementations of Greeter</summary>
51 public abstract partial class GreeterBase
56 /// <param name="request">The request received from the client.</param>
57 /// <param name="context">The context of the server-side call handler being invoked.</param>
58 /// <returns>The response to send back to the client (wrapped by a task).</returns>
59 public virtual global::System.Threading.Tasks.Task<global::Helloworld.HelloReply> SayHello(global::Helloworld.HelloRequest request, grpc::ServerCallContext context)
61 throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
66 /// <summary>Client for Greeter</summary>
67 public partial class GreeterClient : grpc::ClientBase<GreeterClient>
69 /// <summary>Creates a new client for Greeter</summary>
70 /// <param name="channel">The channel to use to make remote calls.</param>
71 public GreeterClient(grpc::Channel channel) : base(channel)
74 /// <summary>Creates a new client for Greeter that uses a custom <c>CallInvoker</c>.</summary>
75 /// <param name="callInvoker">The callInvoker to use to make remote calls.</param>
76 public GreeterClient(grpc::CallInvoker callInvoker) : base(callInvoker)
79 /// <summary>Protected parameterless constructor to allow creation of test doubles.</summary>
80 protected GreeterClient() : base()
83 /// <summary>Protected constructor to allow creation of configured clients.</summary>
84 /// <param name="configuration">The client configuration.</param>
85 protected GreeterClient(ClientBaseConfiguration configuration) : base(configuration)
92 /// <param name="request">The request to send to the server.</param>
93 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
94 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
95 /// <param name="cancellationToken">An optional token for canceling the call.</param>
96 /// <returns>The response received from the server.</returns>
97 public virtual global::Helloworld.HelloReply SayHello(global::Helloworld.HelloRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
99 return SayHello(request, new grpc::CallOptions(headers, deadline, cancellationToken));
104 /// <param name="request">The request to send to the server.</param>
105 /// <param name="options">The options for the call.</param>
106 /// <returns>The response received from the server.</returns>
107 public virtual global::Helloworld.HelloReply SayHello(global::Helloworld.HelloRequest request, grpc::CallOptions options)
109 return CallInvoker.BlockingUnaryCall(__Method_SayHello, null, options, request);
114 /// <param name="request">The request to send to the server.</param>
115 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
116 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
117 /// <param name="cancellationToken">An optional token for canceling the call.</param>
118 /// <returns>The call object.</returns>
119 public virtual grpc::AsyncUnaryCall<global::Helloworld.HelloReply> SayHelloAsync(global::Helloworld.HelloRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
121 return SayHelloAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
126 /// <param name="request">The request to send to the server.</param>
127 /// <param name="options">The options for the call.</param>
128 /// <returns>The call object.</returns>
129 public virtual grpc::AsyncUnaryCall<global::Helloworld.HelloReply> SayHelloAsync(global::Helloworld.HelloRequest request, grpc::CallOptions options)
131 return CallInvoker.AsyncUnaryCall(__Method_SayHello, null, options, request);
133 /// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
134 protected override GreeterClient NewInstance(ClientBaseConfiguration configuration)
136 return new GreeterClient(configuration);
140 /// <summary>Creates service definition that can be registered with a server</summary>
141 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
142 public static grpc::ServerServiceDefinition BindService(GreeterBase serviceImpl)
144 return grpc::ServerServiceDefinition.CreateBuilder()
145 .AddMethod(__Method_SayHello, serviceImpl.SayHello).Build();