Class PromotedDeliveryClient.Builder

java.lang.Object
ai.promoted.delivery.client.PromotedDeliveryClient.Builder
Enclosing class:
PromotedDeliveryClient

public static class PromotedDeliveryClient.Builder extends Object
  • Method Details

    • withDeliveryEndpoint

      public PromotedDeliveryClient.Builder withDeliveryEndpoint(String deliveryEndpoint)
      Sets delivery endpoint.
      Parameters:
      deliveryEndpoint - the delivery endpoint
      Returns:
      the builder
    • withDeliveryApiKey

      public PromotedDeliveryClient.Builder withDeliveryApiKey(String deliveryApiKey)
      Sets delivery api key.
      Parameters:
      deliveryApiKey - the delivery api key
      Returns:
      the builder
    • withDeliveryTimeoutMillis

      public PromotedDeliveryClient.Builder withDeliveryTimeoutMillis(long deliveryTimeoutMillis)
      Sets delivery timeout millis.
      Parameters:
      deliveryTimeoutMillis - the delivery timeout millis
      Returns:
      the builder
    • withMetricsEndpoint

      public PromotedDeliveryClient.Builder withMetricsEndpoint(String metricsEndpoint)
      Sets metrics endpoint.
      Parameters:
      metricsEndpoint - the metrics endpoint
      Returns:
      the builder
    • withMetricsApiKey

      public PromotedDeliveryClient.Builder withMetricsApiKey(String metricsApiKey)
      Sets metrics aoi key.
      Parameters:
      metricsApiKey - the metrics api key
      Returns:
      the builder
    • withMetricsTimeoutMillis

      public PromotedDeliveryClient.Builder withMetricsTimeoutMillis(long metricsTimoutMillis)
      Sets metrics timeout millis.
      Parameters:
      metricsTimoutMillis - the metrics timout millis
      Returns:
      the builder
    • witPerformChecks

      public PromotedDeliveryClient.Builder witPerformChecks(boolean performChecks)
      Sets performChecks, which will optionally cause extra validations to occur on delivery requests.
      Parameters:
      performChecks - the performChecks value
      Returns:
      the builder
    • withBlockingShadowTraffic

      public PromotedDeliveryClient.Builder withBlockingShadowTraffic(boolean blockingShadowTraffic)
      Sets blockingShadowTraffic, which determines whether or not shadow traffic delivery is a blocking call.
      Parameters:
      blockingShadowTraffic - the blockingShadowTraffic value
      Returns:
      the builder
    • withWarmup

      public PromotedDeliveryClient.Builder withWarmup(boolean warmup)
      Sets warmup, which will optionally prime the HTTPClient connection pool.
      Parameters:
      warmup - the warmup
      Returns:
      the builder
    • withExecutor

      public PromotedDeliveryClient.Builder withExecutor(Executor executor)
      Sets executor.
      Parameters:
      executor - the metrics executor
      Returns:
      the builder
    • withApplyTreatmentChecker

      public PromotedDeliveryClient.Builder withApplyTreatmentChecker(ApplyTreatmentChecker applyTreatmentChecker)
      Sets apply treatment checker.
      Parameters:
      applyTreatmentChecker - the apply treatment checker
      Returns:
      the builder
    • withApiFactory

      public PromotedDeliveryClient.Builder withApiFactory(ApiFactory apiFactory)
      Sets API factory.
      Parameters:
      apiFactory - the API factory
      Returns:
      the builder
    • withMaxRequestInsertions

      public PromotedDeliveryClient.Builder withMaxRequestInsertions(int maxRequestInsertions)
      Sets max request insertions.
      Parameters:
      maxRequestInsertions - the max request insertions
      Returns:
      the builder
    • withShadowTrafficDeliveryRate

      public PromotedDeliveryClient.Builder withShadowTrafficDeliveryRate(float shadowTrafficDeliveryRate)
      Sets shadow traffic delivery rate.
      Parameters:
      shadowTrafficDeliveryRate - the shadow traffic delivery rate
      Returns:
      the builder
    • withSampler

      public PromotedDeliveryClient.Builder withSampler(Sampler sampler)
      Sets sampler, which we use for sampling shadow traffic.
      Parameters:
      sampler - the sampler
      Returns:
      the builder
    • build

      public PromotedDeliveryClient build()
      Returns:
      the promoted delivery client