/// <summary>
        /// Constructs a client wrapper for the Completion service, with the specified gRPC client and settings.
        /// </summary>
        /// <param name="grpcClient">The underlying gRPC client.</param>
        /// <param name="settings">The base <see cref="CompletionSettings"/> used within this client.</param>
        public CompletionClientImpl(Completion.CompletionClient grpcClient, CompletionSettings settings)
        {
            GrpcClient = grpcClient;
            CompletionSettings    effectiveSettings = settings ?? CompletionSettings.GetDefault();
            gaxgrpc::ClientHelper clientHelper      = new gaxgrpc::ClientHelper(effectiveSettings);

            _callCompleteQuery = clientHelper.BuildApiCall <CompleteQueryRequest, CompleteQueryResponse>(grpcClient.CompleteQueryAsync, grpcClient.CompleteQuery, effectiveSettings.CompleteQuerySettings).WithGoogleRequestParam("parent", request => request.Parent);
            Modify_ApiCall(ref _callCompleteQuery);
            Modify_CompleteQueryApiCall(ref _callCompleteQuery);
            OnConstruction(grpcClient, effectiveSettings, clientHelper);
        }
示例#2
0
        /// <summary>
        /// Constructs a client wrapper for the Completion service, with the specified gRPC client and settings.
        /// </summary>
        /// <param name="grpcClient">The underlying gRPC client.</param>
        /// <param name="settings">The base <see cref="CompletionSettings"/> used within this client </param>
        public CompletionClientImpl(Completion.CompletionClient grpcClient, CompletionSettings settings)
        {
            GrpcClient = grpcClient;
            CompletionSettings    effectiveSettings = settings ?? CompletionSettings.GetDefault();
            gaxgrpc::ClientHelper clientHelper      = new gaxgrpc::ClientHelper(effectiveSettings);

            _callCompleteQuery = clientHelper.BuildApiCall <CompleteQueryRequest, CompleteQueryResponse>(
                GrpcClient.CompleteQueryAsync, GrpcClient.CompleteQuery, effectiveSettings.CompleteQuerySettings)
                                 .WithCallSettingsOverlay(request => gaxgrpc::CallSettings.FromHeader("x-goog-request-params", $"parent={request.Parent}"));
            Modify_ApiCall(ref _callCompleteQuery);
            Modify_CompleteQueryApiCall(ref _callCompleteQuery);
            OnConstruction(grpcClient, effectiveSettings, clientHelper);
        }