org.openapitools.client.model.CcRefCard Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zuora-sdk-java Show documentation
Show all versions of zuora-sdk-java Show documentation
The SDK of JAVA language for Zuora pricing system
/*
* Quickstart API Reference
* Zuora Quickstart API is the API that helps you achieve fundamental use cases.
* It provides a much simplified object model and improved performance, enabling developers to easily learn and use.
*/
package org.openapitools.client.model;
import java.util.Objects;
import java.util.Arrays;
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 io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.math.BigDecimal;
import org.openapitools.client.JSON.CustomFieldAdapter;
import org.openapitools.client.JSON.NullableFieldAdapter;
/**
* CcRefCard
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class CcRefCard {
/**
* Card brand.
*/
@JsonAdapter(BrandEnum.Adapter.class)
public enum BrandEnum {
VISA("visa"),
MASTERCARD("mastercard"),
AMERICAN_EXPRESS("american_express"),
DISCOVER("discover"),
JCB("jcb"),
DINERS("diners"),
UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api");
private String value;
BrandEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static BrandEnum fromValue(String value) {
for (BrandEnum b : BrandEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter {
@Override
public void write(final JsonWriter jsonWriter, final BrandEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public BrandEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return BrandEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_BRAND = "brand";
@SerializedName(SERIALIZED_NAME_BRAND)
private BrandEnum brand;
public static final String SERIALIZED_NAME_EXPIRY_MONTH = "expiry_month";
@SerializedName(SERIALIZED_NAME_EXPIRY_MONTH)
private BigDecimal expiryMonth;
public static final String SERIALIZED_NAME_EXPIRY_YEAR = "expiry_year";
@SerializedName(SERIALIZED_NAME_EXPIRY_YEAR)
private BigDecimal expiryYear;
public static final String SERIALIZED_NAME_LAST4 = "last_4";
@SerializedName(SERIALIZED_NAME_LAST4)
private String last4;
public CcRefCard() {
}
public CcRefCard(
String last4
) {
this();
this.last4 = last4;
}
public CcRefCard brand(BrandEnum brand) {
this.brand = brand;
return this;
}
/**
* Card brand.
* @return brand
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Card brand.")
public BrandEnum getBrand() {
return brand;
}
public void setBrand(BrandEnum brand) {
this.brand = brand;
}
public CcRefCard expiryMonth(BigDecimal expiryMonth) {
this.expiryMonth = expiryMonth;
return this;
}
/**
* One or two digit expiration month (1-12) of the credit card.
* @return expiryMonth
**/
@javax.annotation.Nullable
@ApiModelProperty(example = "10", value = "One or two digit expiration month (1-12) of the credit card.")
public BigDecimal getExpiryMonth() {
return expiryMonth;
}
public void setExpiryMonth(BigDecimal expiryMonth) {
this.expiryMonth = expiryMonth;
}
public CcRefCard expiryYear(BigDecimal expiryYear) {
this.expiryYear = expiryYear;
return this;
}
/**
* Two- or four-digit number representing the card's expiration year.
* @return expiryYear
**/
@javax.annotation.Nullable
@ApiModelProperty(example = "2024", value = "Two- or four-digit number representing the card's expiration year.")
public BigDecimal getExpiryYear() {
return expiryYear;
}
public void setExpiryYear(BigDecimal expiryYear) {
this.expiryYear = expiryYear;
}
/**
* The last four digits of the card number.
* @return last4
**/
@javax.annotation.Nullable
@ApiModelProperty(example = "2042", value = "The last four digits of the card number.")
public String getLast4() {
return last4;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CcRefCard ccRefCard = (CcRefCard) o;
return Objects.equals(this.brand, ccRefCard.brand) &&
Objects.equals(this.expiryMonth, ccRefCard.expiryMonth) &&
Objects.equals(this.expiryYear, ccRefCard.expiryYear) &&
Objects.equals(this.last4, ccRefCard.last4);
}
@Override
public int hashCode() {
return Objects.hash(brand, expiryMonth, expiryYear, last4);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CcRefCard {\n");
sb.append(" brand: ").append(toIndentedString(brand)).append("\n");
sb.append(" expiryMonth: ").append(toIndentedString(expiryMonth)).append("\n");
sb.append(" expiryYear: ").append(toIndentedString(expiryYear)).append("\n");
sb.append(" last4: ").append(toIndentedString(last4)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy