com.plaid.client.request.ItemCredentialsEncryptRequest 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.request.common.BasePublicRequest;
import java.util.HashMap;
import java.util.Map;
import static com.plaid.client.internal.Util.arrayToMap;
import static com.plaid.client.internal.Util.notEmpty;
/**
* Request for the /item/credentials/encrypt endpoint.
*
* @see https://plaid.com/docs/api
*/
public final class ItemCredentialsEncryptRequest extends BasePublicRequest {
private Map credentials;
public ItemCredentialsEncryptRequest(Map credentials) {
notEmpty(credentials, "credentials");
this.credentials = new HashMap<>(credentials);
}
/**
* Convenience constructor for credentials. Each 2 consecutive arguments are a (name,value) pair,
* so this method will only accept an even number of arguments.
*
* For example:
*
* ItemCredentialsEncryptRequest("username", "alice", "password", "supersecret");
*
*
* More generally:
*
* ItemCredentialsEncryptRequest(name1, value1, name2, value2, ...);
*
*
* @param namesAndValues A series of credential names and corresponding values.
*/
public ItemCredentialsEncryptRequest(String... namesAndValues) {
this.credentials = arrayToMap(namesAndValues);
}
}