com.plaid.client.request.InstitutionsSearchRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of plaid-java Show documentation
Show all versions of plaid-java Show documentation
Bindings for the Plaid (plaid.com) API.
package com.plaid.client.request;
import com.plaid.client.internal.gson.RequiredField;
import com.plaid.client.request.common.BasePublicRequest;
import com.plaid.client.request.common.Product;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import static com.plaid.client.internal.Util.notEmpty;
import static com.plaid.client.internal.Util.notNull;
/**
* Request for the /institutions/search endpoint.
*
* @see https://plaid.com/docs/api
*/
public final class InstitutionsSearchRequest extends BasePublicRequest {
private String query;
private RequiredField> products = RequiredField.empty();
public InstitutionsSearchRequest(String query) {
notNull(query, "query");
this.query = query;
}
public InstitutionsSearchRequest withProducts(Product... products) {
notEmpty(products, "product");
if (!this.products.isPresent()) {
this.products = RequiredField.of(new ArrayList());
}
this.products.get().addAll(Arrays.asList(products));
return this;
}
}