/// <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, ServiceUsageBase serviceImpl) { serviceBinder.AddMethod(__Method_EnableService, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Google.Cloud.ServiceUsage.V1.EnableServiceRequest, global::Google.LongRunning.Operation>(serviceImpl.EnableService)); serviceBinder.AddMethod(__Method_DisableService, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Google.Cloud.ServiceUsage.V1.DisableServiceRequest, global::Google.LongRunning.Operation>(serviceImpl.DisableService)); serviceBinder.AddMethod(__Method_GetService, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Google.Cloud.ServiceUsage.V1.GetServiceRequest, global::Google.Cloud.ServiceUsage.V1.Service>(serviceImpl.GetService)); serviceBinder.AddMethod(__Method_ListServices, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Google.Cloud.ServiceUsage.V1.ListServicesRequest, global::Google.Cloud.ServiceUsage.V1.ListServicesResponse>(serviceImpl.ListServices)); serviceBinder.AddMethod(__Method_BatchEnableServices, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Google.Cloud.ServiceUsage.V1.BatchEnableServicesRequest, global::Google.LongRunning.Operation>(serviceImpl.BatchEnableServices)); serviceBinder.AddMethod(__Method_BatchGetServices, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Google.Cloud.ServiceUsage.V1.BatchGetServicesRequest, global::Google.Cloud.ServiceUsage.V1.BatchGetServicesResponse>(serviceImpl.BatchGetServices)); }
/// <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(ServiceUsageBase serviceImpl) { return(grpc::ServerServiceDefinition.CreateBuilder() .AddMethod(__Method_EnableService, serviceImpl.EnableService) .AddMethod(__Method_DisableService, serviceImpl.DisableService) .AddMethod(__Method_GetService, serviceImpl.GetService) .AddMethod(__Method_ListServices, serviceImpl.ListServices) .AddMethod(__Method_BatchEnableServices, serviceImpl.BatchEnableServices) .AddMethod(__Method_BatchGetServices, serviceImpl.BatchGetServices).Build()); }