/// <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); }
/// <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)); }
partial void OnCopy(CompletionSettings existing);
private CompletionSettings(CompletionSettings existing) : base(existing) { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); CompleteQuerySettings = existing.CompleteQuerySettings; OnCopy(existing); }
partial void OnConstruction(Completion.CompletionClient grpcClient, CompletionSettings effectiveSettings, gaxgrpc::ClientHelper clientHelper);