// Generated by the protocol buffer compiler. DO NOT EDIT! // source: route_guide.proto #region Designer generated code using System; using System.Threading; using System.Threading.Tasks; using Grpc.Core; namespace Routeguide { public static class RouteGuide { static readonly string __ServiceName = "routeguide.RouteGuide"; static readonly Marshaller __Marshaller_Point = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Routeguide.Point.Parser.ParseFrom); static readonly Marshaller __Marshaller_Feature = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Routeguide.Feature.Parser.ParseFrom); static readonly Marshaller __Marshaller_Rectangle = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Routeguide.Rectangle.Parser.ParseFrom); static readonly Marshaller __Marshaller_RouteSummary = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Routeguide.RouteSummary.Parser.ParseFrom); static readonly Marshaller __Marshaller_RouteNote = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Routeguide.RouteNote.Parser.ParseFrom); static readonly Method __Method_GetFeature = new Method( MethodType.Unary, __ServiceName, "GetFeature", __Marshaller_Point, __Marshaller_Feature); static readonly Method __Method_ListFeatures = new Method( MethodType.ServerStreaming, __ServiceName, "ListFeatures", __Marshaller_Rectangle, __Marshaller_Feature); static readonly Method __Method_RecordRoute = new Method( MethodType.ClientStreaming, __ServiceName, "RecordRoute", __Marshaller_Point, __Marshaller_RouteSummary); static readonly Method __Method_RouteChat = new Method( MethodType.DuplexStreaming, __ServiceName, "RouteChat", __Marshaller_RouteNote, __Marshaller_RouteNote); // service descriptor public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor { get { return global::Routeguide.Proto.RouteGuide.Descriptor.Services[0]; } } // client interface public interface IRouteGuideClient { global::Routeguide.Feature GetFeature(global::Routeguide.Point request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); global::Routeguide.Feature GetFeature(global::Routeguide.Point request, CallOptions options); AsyncUnaryCall GetFeatureAsync(global::Routeguide.Point request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); AsyncUnaryCall GetFeatureAsync(global::Routeguide.Point request, CallOptions options); AsyncServerStreamingCall ListFeatures(global::Routeguide.Rectangle request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); AsyncServerStreamingCall ListFeatures(global::Routeguide.Rectangle request, CallOptions options); AsyncClientStreamingCall RecordRoute(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); AsyncClientStreamingCall RecordRoute(CallOptions options); AsyncDuplexStreamingCall RouteChat(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); AsyncDuplexStreamingCall RouteChat(CallOptions options); } // server-side interface public interface IRouteGuide { Task GetFeature(global::Routeguide.Point request, ServerCallContext context); Task ListFeatures(global::Routeguide.Rectangle request, IServerStreamWriter responseStream, ServerCallContext context); Task RecordRoute(IAsyncStreamReader requestStream, ServerCallContext context); Task RouteChat(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context); } // client stub public class RouteGuideClient : ClientBase, IRouteGuideClient { public RouteGuideClient(Channel channel) : base(channel) { } public global::Routeguide.Feature GetFeature(global::Routeguide.Point request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { var call = CreateCall(__Method_GetFeature, new CallOptions(headers, deadline, cancellationToken)); return Calls.BlockingUnaryCall(call, request); } public global::Routeguide.Feature GetFeature(global::Routeguide.Point request, CallOptions options) { var call = CreateCall(__Method_GetFeature, options); return Calls.BlockingUnaryCall(call, request); } public AsyncUnaryCall GetFeatureAsync(global::Routeguide.Point request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { var call = CreateCall(__Method_GetFeature, new CallOptions(headers, deadline, cancellationToken)); return Calls.AsyncUnaryCall(call, request); } public AsyncUnaryCall GetFeatureAsync(global::Routeguide.Point request, CallOptions options) { var call = CreateCall(__Method_GetFeature, options); return Calls.AsyncUnaryCall(call, request); } public AsyncServerStreamingCall ListFeatures(global::Routeguide.Rectangle request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { var call = CreateCall(__Method_ListFeatures, new CallOptions(headers, deadline, cancellationToken)); return Calls.AsyncServerStreamingCall(call, request); } public AsyncServerStreamingCall ListFeatures(global::Routeguide.Rectangle request, CallOptions options) { var call = CreateCall(__Method_ListFeatures, options); return Calls.AsyncServerStreamingCall(call, request); } public AsyncClientStreamingCall RecordRoute(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { var call = CreateCall(__Method_RecordRoute, new CallOptions(headers, deadline, cancellationToken)); return Calls.AsyncClientStreamingCall(call); } public AsyncClientStreamingCall RecordRoute(CallOptions options) { var call = CreateCall(__Method_RecordRoute, options); return Calls.AsyncClientStreamingCall(call); } public AsyncDuplexStreamingCall RouteChat(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { var call = CreateCall(__Method_RouteChat, new CallOptions(headers, deadline, cancellationToken)); return Calls.AsyncDuplexStreamingCall(call); } public AsyncDuplexStreamingCall RouteChat(CallOptions options) { var call = CreateCall(__Method_RouteChat, options); return Calls.AsyncDuplexStreamingCall(call); } } // creates service definition that can be registered with a server public static ServerServiceDefinition BindService(IRouteGuide serviceImpl) { return ServerServiceDefinition.CreateBuilder(__ServiceName) .AddMethod(__Method_GetFeature, serviceImpl.GetFeature) .AddMethod(__Method_ListFeatures, serviceImpl.ListFeatures) .AddMethod(__Method_RecordRoute, serviceImpl.RecordRoute) .AddMethod(__Method_RouteChat, serviceImpl.RouteChat).Build(); } // creates a new client public static RouteGuideClient NewClient(Channel channel) { return new RouteGuideClient(channel); } } } #endregion