Пример #1
0
 /// <summary>Register service method with a service binder with or without implementation. Useful when customizing the  service binding logic.
 /// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
 /// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
 public static void BindService(grpc::ServiceBinderBase serviceBinder, FlowsBase serviceImpl)
 {
     serviceBinder.AddMethod(__Method_CreateFlow, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Google.Cloud.Dialogflow.Cx.V3.CreateFlowRequest, global::Google.Cloud.Dialogflow.Cx.V3.Flow>(serviceImpl.CreateFlow));
     serviceBinder.AddMethod(__Method_DeleteFlow, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Google.Cloud.Dialogflow.Cx.V3.DeleteFlowRequest, global::Google.Protobuf.WellKnownTypes.Empty>(serviceImpl.DeleteFlow));
     serviceBinder.AddMethod(__Method_ListFlows, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Google.Cloud.Dialogflow.Cx.V3.ListFlowsRequest, global::Google.Cloud.Dialogflow.Cx.V3.ListFlowsResponse>(serviceImpl.ListFlows));
     serviceBinder.AddMethod(__Method_GetFlow, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Google.Cloud.Dialogflow.Cx.V3.GetFlowRequest, global::Google.Cloud.Dialogflow.Cx.V3.Flow>(serviceImpl.GetFlow));
     serviceBinder.AddMethod(__Method_UpdateFlow, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Google.Cloud.Dialogflow.Cx.V3.UpdateFlowRequest, global::Google.Cloud.Dialogflow.Cx.V3.Flow>(serviceImpl.UpdateFlow));
     serviceBinder.AddMethod(__Method_TrainFlow, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Google.Cloud.Dialogflow.Cx.V3.TrainFlowRequest, global::Google.LongRunning.Operation>(serviceImpl.TrainFlow));
 }
Пример #2
0
 /// <summary>Creates service definition that can be registered with a server</summary>
 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
 public static grpc::ServerServiceDefinition BindService(FlowsBase serviceImpl)
 {
     return(grpc::ServerServiceDefinition.CreateBuilder()
            .AddMethod(__Method_CreateFlow, serviceImpl.CreateFlow)
            .AddMethod(__Method_DeleteFlow, serviceImpl.DeleteFlow)
            .AddMethod(__Method_ListFlows, serviceImpl.ListFlows)
            .AddMethod(__Method_GetFlow, serviceImpl.GetFlow)
            .AddMethod(__Method_UpdateFlow, serviceImpl.UpdateFlow)
            .AddMethod(__Method_TrainFlow, serviceImpl.TrainFlow).Build());
 }