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