All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.plaid.client.request.ItemMfaRequest Maven / Gradle / Ivy

There is a newer version: 27.0.0
Show newest version
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;
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy