示例#1
0
 /// <summary>
 /// Creates a <see cref="CompletionClient"/> 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="CompletionSettings"/>.</param>
 /// <returns>The created <see cref="CompletionClient"/>.</returns>
 public static CompletionClient Create(grpccore::CallInvoker callInvoker, CompletionSettings settings = null)
 {
     gax::GaxPreconditions.CheckNotNull(callInvoker, nameof(callInvoker));
     grpccore::Interceptors.Interceptor interceptor = settings?.Interceptor;
     if (interceptor != null)
     {
         callInvoker = grpccore::Interceptors.CallInvokerExtensions.Intercept(callInvoker, interceptor);
     }
     Completion.CompletionClient grpcClient = new Completion.CompletionClient(callInvoker);
     return(new CompletionClientImpl(grpcClient, settings));
 }
        /// <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);
        }
示例#3
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);
        }
示例#4
0
 partial void OnConstruction(Completion.CompletionClient grpcClient, CompletionSettings effectiveSettings, gaxgrpc::ClientHelper clientHelper);