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

            _callGetBiddingStrategy = clientHelper.BuildApiCall <GetBiddingStrategyRequest, gagvr::BiddingStrategy>(grpcClient.GetBiddingStrategyAsync, grpcClient.GetBiddingStrategy, effectiveSettings.GetBiddingStrategySettings).WithGoogleRequestParam("resource_name", request => request.ResourceName);
            Modify_ApiCall(ref _callGetBiddingStrategy);
            Modify_GetBiddingStrategyApiCall(ref _callGetBiddingStrategy);
            _callMutateBiddingStrategies = clientHelper.BuildApiCall <MutateBiddingStrategiesRequest, MutateBiddingStrategiesResponse>(grpcClient.MutateBiddingStrategiesAsync, grpcClient.MutateBiddingStrategies, effectiveSettings.MutateBiddingStrategiesSettings).WithGoogleRequestParam("customer_id", request => request.CustomerId);
            Modify_ApiCall(ref _callMutateBiddingStrategies);
            Modify_MutateBiddingStrategiesApiCall(ref _callMutateBiddingStrategies);
            OnConstruction(grpcClient, effectiveSettings, clientHelper);
        }
        /// <summary>
        /// Constructs a client wrapper for the BiddingStrategyService service, with the specified gRPC client and settings.
        /// </summary>
        /// <param name="grpcClient">The underlying gRPC client.</param>
        /// <param name="settings">The base <see cref="BiddingStrategyServiceSettings"/> used within this client </param>
        public BiddingStrategyServiceClientImpl(BiddingStrategyService.BiddingStrategyServiceClient grpcClient, BiddingStrategyServiceSettings settings)
        {
            GrpcClient = grpcClient;
            BiddingStrategyServiceSettings effectiveSettings = settings ?? BiddingStrategyServiceSettings.GetDefault();
            gaxgrpc::ClientHelper          clientHelper      = new gaxgrpc::ClientHelper(effectiveSettings);

            _callGetBiddingStrategy = clientHelper.BuildApiCall <GetBiddingStrategyRequest, gagvr::BiddingStrategy>(
                GrpcClient.GetBiddingStrategyAsync, GrpcClient.GetBiddingStrategy, effectiveSettings.GetBiddingStrategySettings)
                                      .WithCallSettingsOverlay(request => gaxgrpc::CallSettings.FromHeader("x-goog-request-params", $"resource_name={request.ResourceName}"));
            _callMutateBiddingStrategies = clientHelper.BuildApiCall <MutateBiddingStrategiesRequest, MutateBiddingStrategiesResponse>(
                GrpcClient.MutateBiddingStrategiesAsync, GrpcClient.MutateBiddingStrategies, effectiveSettings.MutateBiddingStrategiesSettings)
                                           .WithCallSettingsOverlay(request => gaxgrpc::CallSettings.FromHeader("x-goog-request-params", $"customer_id={request.CustomerId}"));
            Modify_ApiCall(ref _callGetBiddingStrategy);
            Modify_GetBiddingStrategyApiCall(ref _callGetBiddingStrategy);
            Modify_ApiCall(ref _callMutateBiddingStrategies);
            Modify_MutateBiddingStrategiesApiCall(ref _callMutateBiddingStrategies);
            OnConstruction(grpcClient, effectiveSettings, clientHelper);
        }