Class EasyPostClient

java.lang.Object
com.easypost.service.EasyPostClient

public class EasyPostClient extends Object
  • Field Details

  • Constructor Details

    • EasyPostClient

      public EasyPostClient(String apiKey) throws MissingParameterError
      EasyPostClient constructor.
      Parameters:
      apiKey - API key for API calls.
      Throws:
      MissingParameterError - When the request fails.
    • EasyPostClient

      public EasyPostClient(String apiKey, String apiBase) throws MissingParameterError
      EasyPostClient constructor.
      Parameters:
      apiKey - API key for API calls.
      apiBase - API base for API calls.
      Throws:
      MissingParameterError - When the request fails.
    • EasyPostClient

      public EasyPostClient(String apiKey, int connectTimeoutMilliseconds) throws MissingParameterError
      EasyPostClient constructor.
      Parameters:
      apiKey - API key for API calls.
      connectTimeoutMilliseconds - Timeout for connection.
      Throws:
      MissingParameterError - When the request fails.
    • EasyPostClient

      public EasyPostClient(String apiKey, int connectTimeoutMilliseconds, String apiBase) throws MissingParameterError
      EasyPostClient constructor.
      Parameters:
      apiKey - API key for API calls.
      connectTimeoutMilliseconds - Timeout for connection.
      apiBase - API base for API calls.
      Throws:
      MissingParameterError - When the request fails.
    • EasyPostClient

      public EasyPostClient(String apiKey, int connectTimeoutMilliseconds, int readTimeoutMilliseconds) throws MissingParameterError
      EasyPostClient constructor.
      Parameters:
      apiKey - API key for API calls.
      connectTimeoutMilliseconds - Timeout for connection.
      readTimeoutMilliseconds - Timeout for read.
      Throws:
      MissingParameterError - When the request fails.
    • EasyPostClient

      public EasyPostClient(String apiKey, int connectTimeoutMilliseconds, int readTimeoutMilliseconds, String apiBase) throws MissingParameterError
      EasyPostClient constructor.
      Parameters:
      apiKey - API key for API calls.
      connectTimeoutMilliseconds - Timeout for connection.
      readTimeoutMilliseconds - Timeout for read.
      apiBase - API base for API calls.
      Throws:
      MissingParameterError - When the request fails.
  • Method Details

    • subscribeToRequestHook

      public void subscribeToRequestHook(Function<RequestHookResponses,Object> function)
      Subscribes to a request hook from the given function.
      Parameters:
      function - The function to be subscribed to the request hook
    • unsubscribeFromRequestHook

      public void unsubscribeFromRequestHook(Function<RequestHookResponses,Object> function)
      Unsubscribes to a request hook from the given function.
      Parameters:
      function - The function to be unsubscribed from the request hook
    • subscribeToResponseHook

      public void subscribeToResponseHook(Function<ResponseHookResponses,Object> function)
      Subscribes to a response hook from the given function.
      Parameters:
      function - The function to be subscribed to the response hook
    • unsubscribeFromResponseHook

      public void unsubscribeFromResponseHook(Function<ResponseHookResponses,Object> function)
      Unubscribes to a response hook from the given function.
      Parameters:
      function - The function to be unsubscribed from the response hook
    • getConnectionTimeoutMilliseconds

      public int getConnectionTimeoutMilliseconds()
      Get connection timeout milliseconds for this EasyPostClient object.
      Returns:
      the connection timeout for this EasyPostClient object
    • getReadTimeoutMilliseconds

      public int getReadTimeoutMilliseconds()
      Get read timeout milliseconds for this EasyPostClient object.
      Returns:
      the read timeout for this EasyPostClient object
    • getApiKey

      public String getApiKey()
      Get API key for this EasyPostClient object.
      Returns:
      the API key for this EasyPostClient object
    • getApiVersion

      public String getApiVersion()
      Get API version for this EasyPostClient object.
      Returns:
      the API version for this EasyPostClient object.
    • getApiBase

      public String getApiBase()
      Get API base for this EasyPostClient object.
      Returns:
      the API base for this EasyPostClient object.