Ejemplo n.º 1
0
        /// <summary>
        /// Constructs a client wrapper for the SearchService service, with the specified gRPC client and settings.
        /// </summary>
        /// <param name="grpcClient">The underlying gRPC client.</param>
        /// <param name="settings">The base <see cref="SearchServiceSettings"/> used within this client.</param>
        public SearchServiceClientImpl(SearchService.SearchServiceClient grpcClient, SearchServiceSettings settings)
        {
            GrpcClient = grpcClient;
            SearchServiceSettings effectiveSettings = settings ?? SearchServiceSettings.GetDefault();
            gaxgrpc::ClientHelper clientHelper      = new gaxgrpc::ClientHelper(effectiveSettings);

            _callSearch = clientHelper.BuildApiCall <SearchRequest, SearchResponse>(grpcClient.SearchAsync, grpcClient.Search, effectiveSettings.SearchSettings).WithGoogleRequestParam("placement", request => request.Placement);
            Modify_ApiCall(ref _callSearch);
            Modify_SearchApiCall(ref _callSearch);
            OnConstruction(grpcClient, effectiveSettings, clientHelper);
        }
Ejemplo n.º 2
0
 partial void OnCopy(SearchServiceSettings existing);
Ejemplo n.º 3
0
 private SearchServiceSettings(SearchServiceSettings existing) : base(existing)
 {
     gax::GaxPreconditions.CheckNotNull(existing, nameof(existing));
     SearchSettings = existing.SearchSettings;
     OnCopy(existing);
 }
Ejemplo n.º 4
0
 partial void OnConstruction(SearchService.SearchServiceClient grpcClient, SearchServiceSettings effectiveSettings, gaxgrpc::ClientHelper clientHelper);
Ejemplo n.º 5
0
        /// <summary>
        /// Creates a <see cref="SearchServiceClient"/> 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="SearchServiceSettings"/>.</param>
        /// <returns>The created <see cref="SearchServiceClient"/>.</returns>
        internal static SearchServiceClient Create(grpccore::CallInvoker callInvoker, SearchServiceSettings settings = null)
        {
            gax::GaxPreconditions.CheckNotNull(callInvoker, nameof(callInvoker));
            grpcinter::Interceptor interceptor = settings?.Interceptor;

            if (interceptor != null)
            {
                callInvoker = grpcinter::CallInvokerExtensions.Intercept(callInvoker, interceptor);
            }
            SearchService.SearchServiceClient grpcClient = new SearchService.SearchServiceClient(callInvoker);
            return(new SearchServiceClientImpl(grpcClient, settings));
        }