/// <summary> /// Constructs a client wrapper for the AutoSuggestionService service, with the specified gRPC client and /// settings. /// </summary> /// <param name="grpcClient">The underlying gRPC client.</param> /// <param name="settings">The base <see cref="AutoSuggestionServiceSettings"/> used within this client.</param> public AutoSuggestionServiceClientImpl(AutoSuggestionService.AutoSuggestionServiceClient grpcClient, AutoSuggestionServiceSettings settings) { GrpcClient = grpcClient; AutoSuggestionServiceSettings effectiveSettings = settings ?? AutoSuggestionServiceSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); _callSuggestQueries = clientHelper.BuildApiCall <SuggestQueriesRequest, SuggestQueriesResponse>(grpcClient.SuggestQueriesAsync, grpcClient.SuggestQueries, effectiveSettings.SuggestQueriesSettings).WithGoogleRequestParam("parent", request => request.Parent); Modify_ApiCall(ref _callSuggestQueries); Modify_SuggestQueriesApiCall(ref _callSuggestQueries); OnConstruction(grpcClient, effectiveSettings, clientHelper); }
/// <summary> /// Creates a <see cref="AutoSuggestionServiceClient"/> 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="AutoSuggestionServiceSettings"/>.</param> /// <returns>The created <see cref="AutoSuggestionServiceClient"/>.</returns> internal static AutoSuggestionServiceClient Create(grpccore::CallInvoker callInvoker, AutoSuggestionServiceSettings settings = null) { gax::GaxPreconditions.CheckNotNull(callInvoker, nameof(callInvoker)); grpcinter::Interceptor interceptor = settings?.Interceptor; if (interceptor != null) { callInvoker = grpcinter::CallInvokerExtensions.Intercept(callInvoker, interceptor); } AutoSuggestionService.AutoSuggestionServiceClient grpcClient = new AutoSuggestionService.AutoSuggestionServiceClient(callInvoker); return(new AutoSuggestionServiceClientImpl(grpcClient, settings)); }
partial void OnConstruction(AutoSuggestionService.AutoSuggestionServiceClient grpcClient, AutoSuggestionServiceSettings effectiveSettings, gaxgrpc::ClientHelper clientHelper);