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