Ejemplo n.º 1
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).WithGoogleRequestParam("tenant", request => request.Tenant);
            Modify_ApiCall(ref _callCompleteQuery);
            Modify_CompleteQueryApiCall(ref _callCompleteQuery);
            OnConstruction(grpcClient, effectiveSettings, clientHelper);
        }
Ejemplo n.º 2
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>
        internal static CompletionClient Create(grpccore::CallInvoker callInvoker, CompletionSettings settings = null)
        {
            gax::GaxPreconditions.CheckNotNull(callInvoker, nameof(callInvoker));
            grpcinter::Interceptor interceptor = settings?.Interceptor;

            if (interceptor != null)
            {
                callInvoker = grpcinter::CallInvokerExtensions.Intercept(callInvoker, interceptor);
            }
            Completion.CompletionClient grpcClient = new Completion.CompletionClient(callInvoker);
            return(new CompletionClientImpl(grpcClient, settings));
        }
Ejemplo n.º 3
0
 partial void OnCopy(CompletionSettings existing);
Ejemplo n.º 4
0
 private CompletionSettings(CompletionSettings existing) : base(existing)
 {
     gax::GaxPreconditions.CheckNotNull(existing, nameof(existing));
     CompleteQuerySettings = existing.CompleteQuerySettings;
     OnCopy(existing);
 }
Ejemplo n.º 5
0
 partial void OnConstruction(Completion.CompletionClient grpcClient, CompletionSettings effectiveSettings, gaxgrpc::ClientHelper clientHelper);