Imported Upstream version 1.34.0
[platform/upstream/grpc.git] / examples / csharp / HelloworldXamarin / HelloworldXamarin / HelloworldGrpc.cs
1 // Generated by the protocol buffer compiler.  DO NOT EDIT!
2 // source: helloworld.proto
3 // Original file comments:
4 // Copyright 2015 gRPC authors.
5 //
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
9 //
10 //     http://www.apache.org/licenses/LICENSE-2.0
11 //
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.
17 //
18 #pragma warning disable 1591
19 #region Designer generated code
20
21 using System;
22 using System.Threading;
23 using System.Threading.Tasks;
24 using grpc = global::Grpc.Core;
25
26 namespace Helloworld {
27   /// <summary>
28   /// The greeting service definition.
29   /// </summary>
30   public static partial class Greeter
31   {
32     static readonly string __ServiceName = "helloworld.Greeter";
33
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);
36
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,
39         __ServiceName,
40         "SayHello",
41         __Marshaller_HelloRequest,
42         __Marshaller_HelloReply);
43
44     /// <summary>Service descriptor</summary>
45     public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
46     {
47       get { return global::Helloworld.HelloworldReflection.Descriptor.Services[0]; }
48     }
49
50     /// <summary>Base class for server-side implementations of Greeter</summary>
51     public abstract partial class GreeterBase
52     {
53       /// <summary>
54       /// Sends a greeting
55       /// </summary>
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)
60       {
61         throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
62       }
63
64     }
65
66     /// <summary>Client for Greeter</summary>
67     public partial class GreeterClient : grpc::ClientBase<GreeterClient>
68     {
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)
72       {
73       }
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)
77       {
78       }
79       /// <summary>Protected parameterless constructor to allow creation of test doubles.</summary>
80       protected GreeterClient() : base()
81       {
82       }
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)
86       {
87       }
88
89       /// <summary>
90       /// Sends a greeting
91       /// </summary>
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))
98       {
99         return SayHello(request, new grpc::CallOptions(headers, deadline, cancellationToken));
100       }
101       /// <summary>
102       /// Sends a greeting
103       /// </summary>
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)
108       {
109         return CallInvoker.BlockingUnaryCall(__Method_SayHello, null, options, request);
110       }
111       /// <summary>
112       /// Sends a greeting
113       /// </summary>
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))
120       {
121         return SayHelloAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
122       }
123       /// <summary>
124       /// Sends a greeting
125       /// </summary>
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)
130       {
131         return CallInvoker.AsyncUnaryCall(__Method_SayHello, null, options, request);
132       }
133       /// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
134       protected override GreeterClient NewInstance(ClientBaseConfiguration configuration)
135       {
136         return new GreeterClient(configuration);
137       }
138     }
139
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)
143     {
144       return grpc::ServerServiceDefinition.CreateBuilder()
145           .AddMethod(__Method_SayHello, serviceImpl.SayHello).Build();
146     }
147
148   }
149 }
150 #endregion