com.plaid.client.request.ItemMfaRequest 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.BaseAccessTokenRequest;
import com.plaid.client.request.common.MfaType;
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 /item/mfa endpoint.
*
* @see https://plaid.com/docs/api
*/
public final class ItemMfaRequest extends BaseAccessTokenRequest {
private final MfaType mfaType;
private RequiredField> responses = RequiredField.empty();
private Options options;
public ItemMfaRequest(String accessToken, MfaType mfaType) {
super(accessToken);
notNull(mfaType, "mfaType");
this.mfaType = mfaType;
}
public ItemMfaRequest withResponsesToken(String responsesToken) {
this.options = new Options(responsesToken);
return this;
}
public ItemMfaRequest withResponses(String... responses) {
this.withResponses(Arrays.asList(responses));
return this;
}
public ItemMfaRequest withResponses(List responses) {
notEmpty(responses, "responses");
this.responses = RequiredField.of(new ArrayList<>(responses));
return this;
}
private static class Options {
private final String responsesToken;
private Options(String responsesToken) {
this.responsesToken = responsesToken;
}
}
}