Class Zulip.Builder

java.lang.Object
com.github.jamesnetherton.zulip.client.Zulip.Builder
Enclosing class:
Zulip

public static final class Zulip.Builder extends Object
Builder class for constructing the Zulip Client.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • apiKey

      public Zulip.Builder apiKey(String apiKey)
      Sets the Zulip API key to use for authentication with the Zulip server.
      Parameters:
      apiKey - The user API key
      Returns:
      This Zulip.Builder object
      See Also:
    • email

      public Zulip.Builder email(String email)
      Sets the Zulip email address to use for authentication with the Zulip server.
      Parameters:
      email - The user email address
      Returns:
      This Zulip.Builder object
    • httpClientFactory

      public Zulip.Builder httpClientFactory(ZulipHttpClientFactory httpClientFactory)
      Sets a custom ZulipHttpClientFactory to enable the Zulip client to use an HTTP client other than the default Apache Commons HTTP client.
      Parameters:
      httpClientFactory - The ZulipHttpClientFactory implementation
      Returns:
      This Zulip.Builder object
    • insecure

      public Zulip.Builder insecure(boolean insecure)
      Sets whether the Zulip HTTP client should ignore SSL certificate validation errors. This is not recommended for production use.
      Parameters:
      insecure - true if unknown certificates should be trusted. false to not trust unknown certificates and to receive an exception
      Returns:
      This Zulip.Builder object
    • proxyUrl

      public Zulip.Builder proxyUrl(String proxyUrl)
      Sets the proxy server URL that the Zulip HTTP client should use when making requests to the Zulip server.
      Parameters:
      proxyUrl - The proxy server URL
      Returns:
      This Zulip.Builder object
    • proxyUsername

      public Zulip.Builder proxyUsername(String proxyUsername)
      Sets the proxy server user name that the Zulip HTTP client should use when making requests to the Zulip server.
      Parameters:
      proxyUsername - The proxy server username
      Returns:
      This Zulip.Builder object
    • proxyPassword

      public Zulip.Builder proxyPassword(String proxyPassword)
      Sets the proxy server password that the Zulip HTTP client should use when making requests to the Zulip server.
      Parameters:
      proxyPassword - The proxy server password
      Returns:
      This Zulip.Builder object
    • site

      public Zulip.Builder site(String site)
      Sets the URL of the Zulip server.
      Parameters:
      site - The URL of the Zulip server. Note this should be without the /api/v1 suffix.
      Returns:
      This Zulip.Builder object
    • build

      public Zulip build() throws ZulipClientException
      Builds a new Zulip instance.
      Returns:
      A new Zulip client object
      Throws:
      ZulipClientException