Class Pain001Client.Builder

java.lang.Object
com.pain001.sdk.Pain001Client.Builder
Enclosing class:
Pain001Client

public static final class Pain001Client.Builder extends Object
Builds a Pain001Client.
  • Method Details

    • baseUrl

      public Pain001Client.Builder baseUrl(String baseUrl)
      The server's base URL, for example http://127.0.0.1:8000: http or https, with a host, and no query or fragment. A trailing slash is ignored.
      Parameters:
      baseUrl - the server's base URL
      Returns:
      this builder
    • apiKey

      public Pain001Client.Builder apiKey(String apiKey)
      An API key, sent as Authorization: Bearer <key>; null sends none.
      Parameters:
      apiKey - the key, or null
      Returns:
      this builder
    • timeout

      public Pain001Client.Builder timeout(Duration timeout)
      The connect and per-request timeout; 30 seconds when not set.
      Parameters:
      timeout - a positive duration
      Returns:
      this builder
    • retryPolicy

      public Pain001Client.Builder retryPolicy(RetryPolicy retryPolicy)
      Retries GET calls under retryPolicy; null (the default) sends every request once. POST calls are never retried.
      Parameters:
      retryPolicy - the policy, or null for none
      Returns:
      this builder
    • build

      public Pain001Client build()
      Builds the client.
      Returns:
      the immutable, thread-safe client
      Throws:
      IllegalArgumentException - when the base URL is missing or malformed, or the timeout is not positive