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

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

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

import com.plaid.client.request.common.BasePublicRequest;
import com.plaid.client.internal.gson.Optional;
import com.plaid.client.request.common.Product;

import java.util.ArrayList;
import java.util.List;

import static com.plaid.client.internal.Util.notEmpty;
import static com.plaid.client.internal.Util.notNull;

/**
 * Request for the /sandbox/public_token/create endpoint.
 *
 * @see https://plaid.com/docs/api/
 */
public final class SandboxPublicTokenCreateRequest extends BasePublicRequest {
  private String institutionId;
  private List initialProducts;
  private Optional options = Optional.empty();

  public SandboxPublicTokenCreateRequest(String institutionId, List initialProducts) {
    notNull(institutionId, "institutionId");
    notEmpty(initialProducts, "initialProducts");

    this.initialProducts = new ArrayList<>(initialProducts);
    this.institutionId = institutionId;
  }

  public SandboxPublicTokenCreateRequest withOptionWebhook(String webhook) {
    notNull(webhook, "webhook");
    options = options.orElse(new Options());
    options.get().webhook = webhook;
    return this;
  }  

  private static class Options {
    private String webhook;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy