Class PlaidClient

java.lang.Object
com.plaid.client.PlaidClient

public final class PlaidClient
extends java.lang.Object
  • Method Details

    • service

      public PlaidApiService service()
      Get the Retrofit PlaidApiService which backs this client. All Plaid API calls are called on this service object.
      Returns:
      the PlaidApiService
    • parseError

      public ErrorResponse parseError​(retrofit2.Response response)
      A helper to assist with decoding unsuccessful responses. This is not done automatically, because an unsuccessful result may have many causes such as network issues, intervening HTTP proxies, load balancers, partial responses, etc, which means that a response can easily be incomplete, or not even the expected well-formed JSON error. Therefore, even when using this helper, be prepared for it to throw an exception instead of successfully decoding every error response!
      Parameters:
      response - the unsuccessful response object to deserialize.
      Returns:
      the resulting ErrorResponse, assuming deserialization succeeded.
      Throws:
      java.lang.RuntimeException - if the response cannot be deserialized
    • getRetrofit

      public retrofit2.Retrofit getRetrofit()
      Visible for testing.
      Returns:
      the underlying Retrofit client.
    • newBuilder

      public static PlaidClient.Builder newBuilder()
      Start here! Creates a new PlaidClient.Builder so you can make a PlaidClient.
      Returns:
      A brand new PlaidClient.Builder