/// <summary> /// Constructs a client wrapper for the ImageAnnotator service, with the specified gRPC client and settings. /// </summary> /// <param name="grpcClient">The underlying gRPC client.</param> /// <param name="settings">The base <see cref="ImageAnnotatorSettings"/> used within this client </param> public ImageAnnotatorClientImpl(ImageAnnotator.ImageAnnotatorClient grpcClient, ImageAnnotatorSettings settings) { GrpcClient = grpcClient; ImageAnnotatorSettings effectiveSettings = settings ?? ImageAnnotatorSettings.GetDefault(); ClientHelper clientHelper = new ClientHelper(effectiveSettings); _callBatchAnnotateImages = clientHelper.BuildApiCall <BatchAnnotateImagesRequest, BatchAnnotateImagesResponse>( GrpcClient.BatchAnnotateImagesAsync, GrpcClient.BatchAnnotateImages, effectiveSettings.BatchAnnotateImagesSettings); OnConstruction(grpcClient, effectiveSettings, clientHelper); }
/// <summary> /// Creates a <see cref="ImageAnnotatorClient"/> 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="ImageAnnotatorSettings"/>.</param> /// <returns>The created <see cref="ImageAnnotatorClient"/>.</returns> public static ImageAnnotatorClient Create(grpccore::CallInvoker callInvoker, ImageAnnotatorSettings settings = null) { gax::GaxPreconditions.CheckNotNull(callInvoker, nameof(callInvoker)); grpccore::Interceptors.Interceptor interceptor = settings?.Interceptor; if (interceptor != null) { callInvoker = grpccore::Interceptors.CallInvokerExtensions.Intercept(callInvoker, interceptor); } ImageAnnotator.ImageAnnotatorClient grpcClient = new ImageAnnotator.ImageAnnotatorClient(callInvoker); return(new ImageAnnotatorClientImpl(grpcClient, settings)); }
partial void OnConstruction(ImageAnnotator.ImageAnnotatorClient grpcClient, ImageAnnotatorSettings effectiveSettings, gaxgrpc::ClientHelper clientHelper);
/// <summary> /// Creates a <see cref="ImageAnnotatorClient"/> which uses the specified channel for remote operations. /// </summary> /// <param name="channel">The <see cref="grpccore::Channel"/> for remote operations. Must not be null.</param> /// <param name="settings">Optional <see cref="ImageAnnotatorSettings"/>.</param> /// <returns>The created <see cref="ImageAnnotatorClient"/>.</returns> public static ImageAnnotatorClient Create(grpccore::Channel channel, ImageAnnotatorSettings settings = null) { gax::GaxPreconditions.CheckNotNull(channel, nameof(channel)); ImageAnnotator.ImageAnnotatorClient grpcClient = new ImageAnnotator.ImageAnnotatorClient(channel); return(new ImageAnnotatorClientImpl(grpcClient, settings)); }