private CompletionServiceSettings(CompletionServiceSettings existing) : base(existing)
 {
     gax::GaxPreconditions.CheckNotNull(existing, nameof(existing));
     CompleteQuerySettings                  = existing.CompleteQuerySettings;
     ImportCompletionDataSettings           = existing.ImportCompletionDataSettings;
     ImportCompletionDataOperationsSettings = existing.ImportCompletionDataOperationsSettings.Clone();
     OnCopy(existing);
 }
        /// <summary>
        /// Constructs a client wrapper for the CompletionService service, with the specified gRPC client and settings.
        /// </summary>
        /// <param name="grpcClient">The underlying gRPC client.</param>
        /// <param name="settings">The base <see cref="CompletionServiceSettings"/> used within this client.</param>
        public CompletionServiceClientImpl(CompletionService.CompletionServiceClient grpcClient, CompletionServiceSettings settings)
        {
            GrpcClient = grpcClient;
            CompletionServiceSettings effectiveSettings = settings ?? CompletionServiceSettings.GetDefault();
            gaxgrpc::ClientHelper     clientHelper      = new gaxgrpc::ClientHelper(effectiveSettings);

            ImportCompletionDataOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClient(), effectiveSettings.ImportCompletionDataOperationsSettings);
            _callCompleteQuery = clientHelper.BuildApiCall <CompleteQueryRequest, CompleteQueryResponse>(grpcClient.CompleteQueryAsync, grpcClient.CompleteQuery, effectiveSettings.CompleteQuerySettings).WithGoogleRequestParam("catalog", request => request.Catalog);
            Modify_ApiCall(ref _callCompleteQuery);
            Modify_CompleteQueryApiCall(ref _callCompleteQuery);
            _callImportCompletionData = clientHelper.BuildApiCall <ImportCompletionDataRequest, lro::Operation>(grpcClient.ImportCompletionDataAsync, grpcClient.ImportCompletionData, effectiveSettings.ImportCompletionDataSettings).WithGoogleRequestParam("parent", request => request.Parent);
            Modify_ApiCall(ref _callImportCompletionData);
            Modify_ImportCompletionDataApiCall(ref _callImportCompletionData);
            OnConstruction(grpcClient, effectiveSettings, clientHelper);
        }
 partial void OnCopy(CompletionServiceSettings existing);
 partial void OnConstruction(CompletionService.CompletionServiceClient grpcClient, CompletionServiceSettings effectiveSettings, gaxgrpc::ClientHelper clientHelper);
        /// <summary>
        /// Creates a <see cref="CompletionServiceClient"/> 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="CompletionServiceSettings"/>.</param>
        /// <returns>The created <see cref="CompletionServiceClient"/>.</returns>
        internal static CompletionServiceClient Create(grpccore::CallInvoker callInvoker, CompletionServiceSettings settings = null)
        {
            gax::GaxPreconditions.CheckNotNull(callInvoker, nameof(callInvoker));
            grpcinter::Interceptor interceptor = settings?.Interceptor;

            if (interceptor != null)
            {
                callInvoker = grpcinter::CallInvokerExtensions.Intercept(callInvoker, interceptor);
            }
            CompletionService.CompletionServiceClient grpcClient = new CompletionService.CompletionServiceClient(callInvoker);
            return(new CompletionServiceClientImpl(grpcClient, settings));
        }