com.paypal.sdk.models.PayPalWalletVaultInstruction Maven / Gradle / Ivy
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
package com.paypal.sdk.models;
import com.fasterxml.jackson.annotation.JsonGetter;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonSetter;
/**
* This is a model class for PayPalWalletVaultInstruction type.
*/
public class PayPalWalletVaultInstruction {
private StoreInVaultInstruction storeInVault;
private String description;
private PayPalPaymentTokenUsagePattern usagePattern;
private PayPalPaymentTokenUsageType usageType;
private PayPalPaymentTokenCustomerType customerType;
private Boolean permitMultiplePaymentTokens;
/**
* Default constructor.
*/
public PayPalWalletVaultInstruction() {
customerType = PayPalPaymentTokenCustomerType.CONSUMER;
permitMultiplePaymentTokens = false;
}
/**
* Initialization constructor.
* @param usageType PayPalPaymentTokenUsageType value for usageType.
* @param storeInVault StoreInVaultInstruction value for storeInVault.
* @param description String value for description.
* @param usagePattern PayPalPaymentTokenUsagePattern value for usagePattern.
* @param customerType PayPalPaymentTokenCustomerType value for customerType.
* @param permitMultiplePaymentTokens Boolean value for permitMultiplePaymentTokens.
*/
public PayPalWalletVaultInstruction(
PayPalPaymentTokenUsageType usageType,
StoreInVaultInstruction storeInVault,
String description,
PayPalPaymentTokenUsagePattern usagePattern,
PayPalPaymentTokenCustomerType customerType,
Boolean permitMultiplePaymentTokens) {
this.storeInVault = storeInVault;
this.description = description;
this.usagePattern = usagePattern;
this.usageType = usageType;
this.customerType = customerType;
this.permitMultiplePaymentTokens = permitMultiplePaymentTokens;
}
/**
* Getter for StoreInVault.
* Defines how and when the payment source gets vaulted.
* @return Returns the StoreInVaultInstruction
*/
@JsonGetter("store_in_vault")
@JsonInclude(JsonInclude.Include.NON_NULL)
public StoreInVaultInstruction getStoreInVault() {
return storeInVault;
}
/**
* Setter for StoreInVault.
* Defines how and when the payment source gets vaulted.
* @param storeInVault Value for StoreInVaultInstruction
*/
@JsonSetter("store_in_vault")
public void setStoreInVault(StoreInVaultInstruction storeInVault) {
this.storeInVault = storeInVault;
}
/**
* Getter for Description.
* The description displayed to PayPal consumer on the approval flow for PayPal, as well as on
* the PayPal payment token management experience on PayPal.com.
* @return Returns the String
*/
@JsonGetter("description")
@JsonInclude(JsonInclude.Include.NON_NULL)
public String getDescription() {
return description;
}
/**
* Setter for Description.
* The description displayed to PayPal consumer on the approval flow for PayPal, as well as on
* the PayPal payment token management experience on PayPal.com.
* @param description Value for String
*/
@JsonSetter("description")
public void setDescription(String description) {
this.description = description;
}
/**
* Getter for UsagePattern.
* Expected business/pricing model for the billing agreement.
* @return Returns the PayPalPaymentTokenUsagePattern
*/
@JsonGetter("usage_pattern")
@JsonInclude(JsonInclude.Include.NON_NULL)
public PayPalPaymentTokenUsagePattern getUsagePattern() {
return usagePattern;
}
/**
* Setter for UsagePattern.
* Expected business/pricing model for the billing agreement.
* @param usagePattern Value for PayPalPaymentTokenUsagePattern
*/
@JsonSetter("usage_pattern")
public void setUsagePattern(PayPalPaymentTokenUsagePattern usagePattern) {
this.usagePattern = usagePattern;
}
/**
* Getter for UsageType.
* The usage type associated with the PayPal payment token.
* @return Returns the PayPalPaymentTokenUsageType
*/
@JsonGetter("usage_type")
public PayPalPaymentTokenUsageType getUsageType() {
return usageType;
}
/**
* Setter for UsageType.
* The usage type associated with the PayPal payment token.
* @param usageType Value for PayPalPaymentTokenUsageType
*/
@JsonSetter("usage_type")
public void setUsageType(PayPalPaymentTokenUsageType usageType) {
this.usageType = usageType;
}
/**
* Getter for CustomerType.
* The customer type associated with the PayPal payment token. This is to indicate whether the
* customer acting on the merchant / platform is either a business or a consumer.
* @return Returns the PayPalPaymentTokenCustomerType
*/
@JsonGetter("customer_type")
@JsonInclude(JsonInclude.Include.NON_NULL)
public PayPalPaymentTokenCustomerType getCustomerType() {
return customerType;
}
/**
* Setter for CustomerType.
* The customer type associated with the PayPal payment token. This is to indicate whether the
* customer acting on the merchant / platform is either a business or a consumer.
* @param customerType Value for PayPalPaymentTokenCustomerType
*/
@JsonSetter("customer_type")
public void setCustomerType(PayPalPaymentTokenCustomerType customerType) {
this.customerType = customerType;
}
/**
* Getter for PermitMultiplePaymentTokens.
* Create multiple payment tokens for the same payer, merchant/platform combination. Use this
* when the customer has not logged in at merchant/platform. The payment token thus generated,
* can then also be used to create the customer account at merchant/platform. Use this also when
* multiple payment tokens are required for the same payer, different customer at
* merchant/platform. This helps to identify customers distinctly even though they may share the
* same PayPal account. This only applies to PayPal payment source.
* @return Returns the Boolean
*/
@JsonGetter("permit_multiple_payment_tokens")
@JsonInclude(JsonInclude.Include.NON_NULL)
public Boolean getPermitMultiplePaymentTokens() {
return permitMultiplePaymentTokens;
}
/**
* Setter for PermitMultiplePaymentTokens.
* Create multiple payment tokens for the same payer, merchant/platform combination. Use this
* when the customer has not logged in at merchant/platform. The payment token thus generated,
* can then also be used to create the customer account at merchant/platform. Use this also when
* multiple payment tokens are required for the same payer, different customer at
* merchant/platform. This helps to identify customers distinctly even though they may share the
* same PayPal account. This only applies to PayPal payment source.
* @param permitMultiplePaymentTokens Value for Boolean
*/
@JsonSetter("permit_multiple_payment_tokens")
public void setPermitMultiplePaymentTokens(Boolean permitMultiplePaymentTokens) {
this.permitMultiplePaymentTokens = permitMultiplePaymentTokens;
}
/**
* Converts this PayPalWalletVaultInstruction into string format.
* @return String representation of this class
*/
@Override
public String toString() {
return "PayPalWalletVaultInstruction [" + "usageType=" + usageType + ", storeInVault="
+ storeInVault + ", description=" + description + ", usagePattern=" + usagePattern
+ ", customerType=" + customerType + ", permitMultiplePaymentTokens="
+ permitMultiplePaymentTokens + "]";
}
/**
* Builds a new {@link PayPalWalletVaultInstruction.Builder} object.
* Creates the instance with the state of the current model.
* @return a new {@link PayPalWalletVaultInstruction.Builder} object
*/
public Builder toBuilder() {
Builder builder = new Builder(usageType)
.storeInVault(getStoreInVault())
.description(getDescription())
.usagePattern(getUsagePattern())
.customerType(getCustomerType())
.permitMultiplePaymentTokens(getPermitMultiplePaymentTokens());
return builder;
}
/**
* Class to build instances of {@link PayPalWalletVaultInstruction}.
*/
public static class Builder {
private PayPalPaymentTokenUsageType usageType;
private StoreInVaultInstruction storeInVault;
private String description;
private PayPalPaymentTokenUsagePattern usagePattern;
private PayPalPaymentTokenCustomerType customerType =
PayPalPaymentTokenCustomerType.CONSUMER;
private Boolean permitMultiplePaymentTokens = false;
/**
* Initialization constructor.
*/
public Builder() {
}
/**
* Initialization constructor.
* @param usageType PayPalPaymentTokenUsageType value for usageType.
*/
public Builder(PayPalPaymentTokenUsageType usageType) {
this.usageType = usageType;
}
/**
* Setter for usageType.
* @param usageType PayPalPaymentTokenUsageType value for usageType.
* @return Builder
*/
public Builder usageType(PayPalPaymentTokenUsageType usageType) {
this.usageType = usageType;
return this;
}
/**
* Setter for storeInVault.
* @param storeInVault StoreInVaultInstruction value for storeInVault.
* @return Builder
*/
public Builder storeInVault(StoreInVaultInstruction storeInVault) {
this.storeInVault = storeInVault;
return this;
}
/**
* Setter for description.
* @param description String value for description.
* @return Builder
*/
public Builder description(String description) {
this.description = description;
return this;
}
/**
* Setter for usagePattern.
* @param usagePattern PayPalPaymentTokenUsagePattern value for usagePattern.
* @return Builder
*/
public Builder usagePattern(PayPalPaymentTokenUsagePattern usagePattern) {
this.usagePattern = usagePattern;
return this;
}
/**
* Setter for customerType.
* @param customerType PayPalPaymentTokenCustomerType value for customerType.
* @return Builder
*/
public Builder customerType(PayPalPaymentTokenCustomerType customerType) {
this.customerType = customerType;
return this;
}
/**
* Setter for permitMultiplePaymentTokens.
* @param permitMultiplePaymentTokens Boolean value for permitMultiplePaymentTokens.
* @return Builder
*/
public Builder permitMultiplePaymentTokens(Boolean permitMultiplePaymentTokens) {
this.permitMultiplePaymentTokens = permitMultiplePaymentTokens;
return this;
}
/**
* Builds a new {@link PayPalWalletVaultInstruction} object using the set fields.
* @return {@link PayPalWalletVaultInstruction}
*/
public PayPalWalletVaultInstruction build() {
return new PayPalWalletVaultInstruction(usageType, storeInVault, description,
usagePattern, customerType, permitMultiplePaymentTokens);
}
}
}