com.adyen.model.marketpay.CreateAccountHolderResponse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of adyen-java-api-library Show documentation
Show all versions of adyen-java-api-library Show documentation
Adyen API Client Library for Java
/*
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Java API Library
*
* Copyright (c) 2020 Adyen B.V.
* This file is open source and available under the MIT license.
* See the LICENSE file for more info.
*/
package com.adyen.model.marketpay;
import com.fasterxml.jackson.annotation.JsonValue;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import static com.adyen.util.Util.toIndentedString;
/**
* CreateAccountHolderResponse
*/
public class CreateAccountHolderResponse {
@SerializedName("accountCode")
private String accountCode = null;
@SerializedName("accountHolderCode")
private String accountHolderCode = null;
@SerializedName("accountHolderDetails")
private AccountHolderDetails accountHolderDetails = null;
@SerializedName("accountHolderStatus")
private AccountHolderStatus accountHolderStatus = null;
@SerializedName("description")
private String description = null;
@SerializedName("invalidFields")
private List invalidFields = null;
/**
* The type of legal entity of the new account holder.
*/
@JsonAdapter(LegalEntityEnum.Adapter.class)
public enum LegalEntityEnum {
BUSINESS("Business"),
INDIVIDUAL("Individual"),
NONPROFIT("NonProfit"),
PARTNERSHIP("Partnership"),
PUBLICCOMPANY("PublicCompany");
@JsonValue
private String value;
LegalEntityEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static LegalEntityEnum fromValue(String text) {
return Arrays.stream(values()).
filter(s -> s.value.equals(text)).
findFirst().orElse(null);
}
public static class Adapter extends TypeAdapter {
@Override
public void write(final JsonWriter jsonWriter, final LegalEntityEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public LegalEntityEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return LegalEntityEnum.fromValue(String.valueOf(value));
}
}
}
@SerializedName("legalEntity")
private LegalEntityEnum legalEntity = null;
@SerializedName("primaryCurrency")
private String primaryCurrency = null;
@SerializedName("pspReference")
private String pspReference = null;
@SerializedName("resultCode")
private String resultCode = null;
@SerializedName("verification")
private KYCVerificationResult verification = null;
@SerializedName("verificationProfile")
private String verificationProfile = null;
public CreateAccountHolderResponse accountCode(String accountCode) {
this.accountCode = accountCode;
return this;
}
/**
* The code of a new account created for the account holder.
*
* @return accountCode
**/
public String getAccountCode() {
return accountCode;
}
public void setAccountCode(String accountCode) {
this.accountCode = accountCode;
}
public CreateAccountHolderResponse accountHolderCode(String accountHolderCode) {
this.accountHolderCode = accountHolderCode;
return this;
}
/**
* The code of the new account holder.
*
* @return accountHolderCode
**/
public String getAccountHolderCode() {
return accountHolderCode;
}
public void setAccountHolderCode(String accountHolderCode) {
this.accountHolderCode = accountHolderCode;
}
public CreateAccountHolderResponse accountHolderDetails(AccountHolderDetails accountHolderDetails) {
this.accountHolderDetails = accountHolderDetails;
return this;
}
/**
* Get accountHolderDetails
*
* @return accountHolderDetails
**/
public AccountHolderDetails getAccountHolderDetails() {
return accountHolderDetails;
}
public void setAccountHolderDetails(AccountHolderDetails accountHolderDetails) {
this.accountHolderDetails = accountHolderDetails;
}
public CreateAccountHolderResponse accountHolderStatus(AccountHolderStatus accountHolderStatus) {
this.accountHolderStatus = accountHolderStatus;
return this;
}
/**
* Get accountHolderStatus
*
* @return accountHolderStatus
**/
public AccountHolderStatus getAccountHolderStatus() {
return accountHolderStatus;
}
public void setAccountHolderStatus(AccountHolderStatus accountHolderStatus) {
this.accountHolderStatus = accountHolderStatus;
}
public CreateAccountHolderResponse description(String description) {
this.description = description;
return this;
}
/**
* The description of the new account holder.
*
* @return description
**/
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public CreateAccountHolderResponse invalidFields(List invalidFields) {
this.invalidFields = invalidFields;
return this;
}
public CreateAccountHolderResponse addInvalidFieldsItem(ErrorFieldType invalidFieldsItem) {
if (this.invalidFields == null) {
this.invalidFields = new ArrayList<>();
}
this.invalidFields.add(invalidFieldsItem);
return this;
}
/**
* A list of fields that caused the `/createAccountHolder` request to fail.
*
* @return invalidFields
**/
public List getInvalidFields() {
return invalidFields;
}
public void setInvalidFields(List invalidFields) {
this.invalidFields = invalidFields;
}
public CreateAccountHolderResponse legalEntity(LegalEntityEnum legalEntity) {
this.legalEntity = legalEntity;
return this;
}
/**
* The type of legal entity of the new account holder.
*
* @return legalEntity
**/
public LegalEntityEnum getLegalEntity() {
return legalEntity;
}
public void setLegalEntity(LegalEntityEnum legalEntity) {
this.legalEntity = legalEntity;
}
public CreateAccountHolderResponse primaryCurrency(String primaryCurrency) {
this.primaryCurrency = primaryCurrency;
return this;
}
/**
* The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes), with which the prospective account holder primarily deals.
*
* @return primaryCurrency
**/
public String getPrimaryCurrency() {
return primaryCurrency;
}
public void setPrimaryCurrency(String primaryCurrency) {
this.primaryCurrency = primaryCurrency;
}
public CreateAccountHolderResponse pspReference(String pspReference) {
this.pspReference = pspReference;
return this;
}
/**
* The reference of a request. Can be used to uniquely identify the request.
*
* @return pspReference
**/
public String getPspReference() {
return pspReference;
}
public void setPspReference(String pspReference) {
this.pspReference = pspReference;
}
public CreateAccountHolderResponse resultCode(String resultCode) {
this.resultCode = resultCode;
return this;
}
/**
* The result code.
*
* @return resultCode
**/
public String getResultCode() {
return resultCode;
}
public void setResultCode(String resultCode) {
this.resultCode = resultCode;
}
public CreateAccountHolderResponse verification(KYCVerificationResult verification) {
this.verification = verification;
return this;
}
/**
* Get verification
*
* @return verification
**/
public KYCVerificationResult getVerification() {
return verification;
}
public void setVerification(KYCVerificationResult verification) {
this.verification = verification;
}
/**
* The identifier of the profile that applies to this entity.
*
* @return verification
**/
public String getVerificationProfile() {
return verificationProfile;
}
public void setVerificationProfile(String verificationProfile) {
this.verificationProfile = verificationProfile;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CreateAccountHolderResponse createAccountHolderResponse = (CreateAccountHolderResponse) o;
return Objects.equals(this.accountCode, createAccountHolderResponse.accountCode) &&
Objects.equals(this.accountHolderCode, createAccountHolderResponse.accountHolderCode) &&
Objects.equals(this.accountHolderDetails, createAccountHolderResponse.accountHolderDetails) &&
Objects.equals(this.accountHolderStatus, createAccountHolderResponse.accountHolderStatus) &&
Objects.equals(this.description, createAccountHolderResponse.description) &&
Objects.equals(this.invalidFields, createAccountHolderResponse.invalidFields) &&
Objects.equals(this.legalEntity, createAccountHolderResponse.legalEntity) &&
Objects.equals(this.primaryCurrency, createAccountHolderResponse.primaryCurrency) &&
Objects.equals(this.pspReference, createAccountHolderResponse.pspReference) &&
Objects.equals(this.resultCode, createAccountHolderResponse.resultCode) &&
Objects.equals(this.verification, createAccountHolderResponse.verification) &&
Objects.equals(this.verificationProfile, createAccountHolderResponse.verificationProfile);
}
@Override
public int hashCode() {
return Objects.hash(accountCode, accountHolderCode, accountHolderDetails, accountHolderStatus, description, invalidFields, legalEntity, primaryCurrency, pspReference, resultCode, verification, verificationProfile);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CreateAccountHolderResponse {\n");
sb.append(" accountCode: ").append(toIndentedString(accountCode)).append("\n");
sb.append(" accountHolderCode: ").append(toIndentedString(accountHolderCode)).append("\n");
sb.append(" accountHolderDetails: ").append(toIndentedString(accountHolderDetails)).append("\n");
sb.append(" accountHolderStatus: ").append(toIndentedString(accountHolderStatus)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" invalidFields: ").append(toIndentedString(invalidFields)).append("\n");
sb.append(" legalEntity: ").append(toIndentedString(legalEntity)).append("\n");
sb.append(" primaryCurrency: ").append(toIndentedString(primaryCurrency)).append("\n");
sb.append(" pspReference: ").append(toIndentedString(pspReference)).append("\n");
sb.append(" resultCode: ").append(toIndentedString(resultCode)).append("\n");
sb.append(" verification: ").append(toIndentedString(verification)).append("\n");
sb.append(" verificationProfile: ").append(toIndentedString(verificationProfile)).append("\n");
sb.append("}");
return sb.toString();
}
}