/// <summary> /// Constructs a client wrapper for the Publisher service, with the specified gRPC client and settings. /// </summary> /// <param name="grpcClient">The underlying gRPC client.</param> /// <param name="settings">The base <see cref="PublisherSettings"/> used within this client.</param> public PublisherClientImpl(Publisher.PublisherClient grpcClient, PublisherSettings settings) { GrpcClient = grpcClient; PublisherSettings effectiveSettings = settings ?? PublisherSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); _callPublishChannelConnectionEvents = clientHelper.BuildApiCall <PublishChannelConnectionEventsRequest, PublishChannelConnectionEventsResponse>(grpcClient.PublishChannelConnectionEventsAsync, grpcClient.PublishChannelConnectionEvents, effectiveSettings.PublishChannelConnectionEventsSettings).WithGoogleRequestParam("channel_connection", request => request.ChannelConnection); Modify_ApiCall(ref _callPublishChannelConnectionEvents); Modify_PublishChannelConnectionEventsApiCall(ref _callPublishChannelConnectionEvents); OnConstruction(grpcClient, effectiveSettings, clientHelper); }
/// <summary> /// Creates a <see cref="PublisherClient"/> which uses the specified call invoker for remote operations. /// </summary> /// <param name="callInvoker"> /// The <see cref="grpccore::CallInvoker"/> for remote operations. Must not be null. /// </param> /// <param name="settings">Optional <see cref="PublisherSettings"/>.</param> /// <returns>The created <see cref="PublisherClient"/>.</returns> internal static PublisherClient Create(grpccore::CallInvoker callInvoker, PublisherSettings settings = null) { gax::GaxPreconditions.CheckNotNull(callInvoker, nameof(callInvoker)); grpcinter::Interceptor interceptor = settings?.Interceptor; if (interceptor != null) { callInvoker = grpcinter::CallInvokerExtensions.Intercept(callInvoker, interceptor); } Publisher.PublisherClient grpcClient = new Publisher.PublisherClient(callInvoker); return(new PublisherClientImpl(grpcClient, settings)); }
partial void OnConstruction(Publisher.PublisherClient grpcClient, PublisherSettings effectiveSettings, gaxgrpc::ClientHelper clientHelper);