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

com.plaid.client.response.ItemCreateResponse Maven / Gradle / Ivy

There is a newer version: 27.0.0
Show newest version
package com.plaid.client.response;

import com.plaid.client.request.common.MfaType;

import java.util.List;

/**
 * Combined response object for both normal and MFA-related responses to /item/create calls.
 *
 * You can use {@link #isMfaResponse()} and {@link #isItemResponse()} to determine which kind of response
 * was received from the server.
 *
 * @see https://plaid.com/docs/api
 */
public final class ItemCreateResponse extends BaseResponse {
  // normal response fields
  private String accessToken;
  private ItemStatus item;
  // MFA response fields
  private String device;
  private List deviceList;
  private MfaType mfaType;
  private List questions;
  private List selections;

  public static class MfaDevice {
    private String deviceId;
    private String type;
    private String mask;

    public String getDeviceId() {
      return deviceId;
    }

    public String getType() {
      return type;
    }

    public String getMask() {
      return mask;
    }
  }

  public String getAccessToken() {
    return accessToken;
  }

  public ItemStatus getItem() {
    return item;
  }

  public String getDevice() {
    return device;
  }

  public MfaType getMfaType() {
    return mfaType;
  }

  public List getQuestions() {
    return questions;
  }

  public List getDeviceList() {
    return deviceList;
  }

  public List getSelections() {
    return selections;
  }

  /**
   * @return true this is a normal response containing an item.
   */
  public boolean isItemResponse() {
    return item != null;
  }

  /**
   * @return true this is an MFA response, and MFA will be required before proceeding.
   */
  public boolean isMfaResponse() {
    return mfaType != null;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy