예제 #1
0
 /// <summary>
 /// Creates a <see cref="FeedItemTargetServiceClient"/> 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="FeedItemTargetServiceSettings"/>.</param>
 /// <returns>The created <see cref="FeedItemTargetServiceClient"/>.</returns>
 public static FeedItemTargetServiceClient Create(grpccore::CallInvoker callInvoker, FeedItemTargetServiceSettings settings = null)
 {
     gax::GaxPreconditions.CheckNotNull(callInvoker, nameof(callInvoker));
     grpccore::Interceptors.Interceptor interceptor = settings?.Interceptor;
     if (interceptor != null)
     {
         callInvoker = grpccore::Interceptors.CallInvokerExtensions.Intercept(callInvoker, interceptor);
     }
     FeedItemTargetService.FeedItemTargetServiceClient grpcClient = new FeedItemTargetService.FeedItemTargetServiceClient(callInvoker);
     return(new FeedItemTargetServiceClientImpl(grpcClient, settings));
 }
        /// <summary>
        /// Constructs a client wrapper for the FeedItemTargetService service, with the specified gRPC client and
        /// settings.
        /// </summary>
        /// <param name="grpcClient">The underlying gRPC client.</param>
        /// <param name="settings">The base <see cref="FeedItemTargetServiceSettings"/> used within this client.</param>
        public FeedItemTargetServiceClientImpl(FeedItemTargetService.FeedItemTargetServiceClient grpcClient, FeedItemTargetServiceSettings settings)
        {
            GrpcClient = grpcClient;
            FeedItemTargetServiceSettings effectiveSettings = settings ?? FeedItemTargetServiceSettings.GetDefault();
            gaxgrpc::ClientHelper         clientHelper      = new gaxgrpc::ClientHelper(effectiveSettings);

            _callGetFeedItemTarget = clientHelper.BuildApiCall <GetFeedItemTargetRequest, gagvr::FeedItemTarget>(grpcClient.GetFeedItemTargetAsync, grpcClient.GetFeedItemTarget, effectiveSettings.GetFeedItemTargetSettings).WithGoogleRequestParam("resource_name", request => request.ResourceName);
            Modify_ApiCall(ref _callGetFeedItemTarget);
            Modify_GetFeedItemTargetApiCall(ref _callGetFeedItemTarget);
            _callMutateFeedItemTargets = clientHelper.BuildApiCall <MutateFeedItemTargetsRequest, MutateFeedItemTargetsResponse>(grpcClient.MutateFeedItemTargetsAsync, grpcClient.MutateFeedItemTargets, effectiveSettings.MutateFeedItemTargetsSettings).WithGoogleRequestParam("customer_id", request => request.CustomerId);
            Modify_ApiCall(ref _callMutateFeedItemTargets);
            Modify_MutateFeedItemTargetsApiCall(ref _callMutateFeedItemTargets);
            OnConstruction(grpcClient, effectiveSettings, clientHelper);
        }
예제 #3
0
        /// <summary>
        /// Constructs a client wrapper for the FeedItemTargetService service, with the specified gRPC client and settings.
        /// </summary>
        /// <param name="grpcClient">The underlying gRPC client.</param>
        /// <param name="settings">The base <see cref="FeedItemTargetServiceSettings"/> used within this client </param>
        public FeedItemTargetServiceClientImpl(FeedItemTargetService.FeedItemTargetServiceClient grpcClient, FeedItemTargetServiceSettings settings)
        {
            GrpcClient = grpcClient;
            FeedItemTargetServiceSettings effectiveSettings = settings ?? FeedItemTargetServiceSettings.GetDefault();
            gaxgrpc::ClientHelper         clientHelper      = new gaxgrpc::ClientHelper(effectiveSettings);

            _callGetFeedItemTarget = clientHelper.BuildApiCall <GetFeedItemTargetRequest, gagvr::FeedItemTarget>(
                GrpcClient.GetFeedItemTargetAsync, GrpcClient.GetFeedItemTarget, effectiveSettings.GetFeedItemTargetSettings)
                                     .WithCallSettingsOverlay(request => gaxgrpc::CallSettings.FromHeader("x-goog-request-params", $"resource_name={request.ResourceName}"));
            _callMutateFeedItemTargets = clientHelper.BuildApiCall <MutateFeedItemTargetsRequest, MutateFeedItemTargetsResponse>(
                GrpcClient.MutateFeedItemTargetsAsync, GrpcClient.MutateFeedItemTargets, effectiveSettings.MutateFeedItemTargetsSettings)
                                         .WithCallSettingsOverlay(request => gaxgrpc::CallSettings.FromHeader("x-goog-request-params", $"customer_id={request.CustomerId}"));
            Modify_ApiCall(ref _callGetFeedItemTarget);
            Modify_GetFeedItemTargetApiCall(ref _callGetFeedItemTarget);
            Modify_ApiCall(ref _callMutateFeedItemTargets);
            Modify_MutateFeedItemTargetsApiCall(ref _callMutateFeedItemTargets);
            OnConstruction(grpcClient, effectiveSettings, clientHelper);
        }
 partial void OnConstruction(FeedItemTargetService.FeedItemTargetServiceClient grpcClient, FeedItemTargetServiceSettings effectiveSettings, gaxgrpc::ClientHelper clientHelper);