Package com.plaid.client
Class PlaidClient
java.lang.Object
com.plaid.client.PlaidClient
public final class PlaidClient
extends java.lang.Object
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PlaidClient.Builder
static class
PlaidClient.PlaidApiHeadersInterceptor
-
Method Summary
Modifier and Type Method Description retrofit2.Retrofit
getRetrofit()
Visible for testing.static PlaidClient.Builder
newBuilder()
Start here! Creates a newPlaidClient.Builder
so you can make aPlaidClient
.ErrorResponse
parseError(retrofit2.Response response)
A helper to assist with decoding unsuccessful responses.PlaidApiService
service()
Get the RetrofitPlaidApiService
which backs this client.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Method Details
-
service
Get the RetrofitPlaidApiService
which backs this client. All Plaid API calls are called on this service object.- Returns:
- the
PlaidApiService
-
parseError
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
Start here! Creates a newPlaidClient.Builder
so you can make aPlaidClient
.- Returns:
- A brand new
PlaidClient.Builder
-