Ejemplo n.º 1
0
 private PrivateCatalogSettings(PrivateCatalogSettings existing) : base(existing)
 {
     gax::GaxPreconditions.CheckNotNull(existing, nameof(existing));
     SearchCatalogsSettings = existing.SearchCatalogsSettings;
     SearchProductsSettings = existing.SearchProductsSettings;
     SearchVersionsSettings = existing.SearchVersionsSettings;
     OnCopy(existing);
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Constructs a client wrapper for the PrivateCatalog service, with the specified gRPC client and settings.
        /// </summary>
        /// <param name="grpcClient">The underlying gRPC client.</param>
        /// <param name="settings">The base <see cref="PrivateCatalogSettings"/> used within this client.</param>
        public PrivateCatalogClientImpl(PrivateCatalog.PrivateCatalogClient grpcClient, PrivateCatalogSettings settings)
        {
            GrpcClient = grpcClient;
            PrivateCatalogSettings effectiveSettings = settings ?? PrivateCatalogSettings.GetDefault();
            gaxgrpc::ClientHelper  clientHelper      = new gaxgrpc::ClientHelper(effectiveSettings);

            _callSearchCatalogs = clientHelper.BuildApiCall <SearchCatalogsRequest, SearchCatalogsResponse>(grpcClient.SearchCatalogsAsync, grpcClient.SearchCatalogs, effectiveSettings.SearchCatalogsSettings).WithGoogleRequestParam("resource", request => request.Resource);
            Modify_ApiCall(ref _callSearchCatalogs);
            Modify_SearchCatalogsApiCall(ref _callSearchCatalogs);
            _callSearchProducts = clientHelper.BuildApiCall <SearchProductsRequest, SearchProductsResponse>(grpcClient.SearchProductsAsync, grpcClient.SearchProducts, effectiveSettings.SearchProductsSettings).WithGoogleRequestParam("resource", request => request.Resource);
            Modify_ApiCall(ref _callSearchProducts);
            Modify_SearchProductsApiCall(ref _callSearchProducts);
            _callSearchVersions = clientHelper.BuildApiCall <SearchVersionsRequest, SearchVersionsResponse>(grpcClient.SearchVersionsAsync, grpcClient.SearchVersions, effectiveSettings.SearchVersionsSettings).WithGoogleRequestParam("resource", request => request.Resource);
            Modify_ApiCall(ref _callSearchVersions);
            Modify_SearchVersionsApiCall(ref _callSearchVersions);
            OnConstruction(grpcClient, effectiveSettings, clientHelper);
        }
Ejemplo n.º 3
0
 partial void OnCopy(PrivateCatalogSettings existing);
Ejemplo n.º 4
0
 partial void OnConstruction(PrivateCatalog.PrivateCatalogClient grpcClient, PrivateCatalogSettings effectiveSettings, gaxgrpc::ClientHelper clientHelper);
Ejemplo n.º 5
0
        /// <summary>
        /// Creates a <see cref="PrivateCatalogClient"/> 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="PrivateCatalogSettings"/>.</param>
        /// <returns>The created <see cref="PrivateCatalogClient"/>.</returns>
        internal static PrivateCatalogClient Create(grpccore::CallInvoker callInvoker, PrivateCatalogSettings settings = null)
        {
            gax::GaxPreconditions.CheckNotNull(callInvoker, nameof(callInvoker));
            grpcinter::Interceptor interceptor = settings?.Interceptor;

            if (interceptor != null)
            {
                callInvoker = grpcinter::CallInvokerExtensions.Intercept(callInvoker, interceptor);
            }
            PrivateCatalog.PrivateCatalogClient grpcClient = new PrivateCatalog.PrivateCatalogClient(callInvoker);
            return(new PrivateCatalogClientImpl(grpcClient, settings));
        }