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

com.zuora.model.PaymentMethodSnapshotResponse Maven / Gradle / Ivy

There is a newer version: 3.2.1
Show newest version
/*
 * Zuora API Reference
 * REST API reference for the Zuora Billing, Payments, and Central Platform! Check out the [REST API Overview](https://www.zuora.com/developer/api-references/api/overview/).
 *
 * The version of the OpenAPI document: 2024-05-20
 * Contact: [email protected]
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package com.zuora.model;

import java.util.Objects;
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 com.zuora.model.GetPaymentMethodSnapshotResponseAchAccountType;
import com.zuora.model.GetPaymentMethodSnapshotResponseBankTransferType;
import com.zuora.model.GetPaymentMethodSnapshotResponsePaymentMethodStatus;
import com.zuora.model.GetPaymentMethodSnapshotResponsePaypalType;
import com.zuora.model.PaymentMethodMandateInfoMandateStatus;
import com.zuora.model.PaymentMethodType;
import com.zuora.model.ProxyGetPaymentMethodSnapshotCreditCardType;
import java.io.IOException;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.util.Arrays;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import com.google.gson.TypeAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;

import com.zuora.JSON;

/**
 * PaymentMethodSnapshotResponse
 */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0")
public class PaymentMethodSnapshotResponse {
  public static final String SERIALIZED_NAME_ACCOUNT_ID = "AccountId";
  @SerializedName(SERIALIZED_NAME_ACCOUNT_ID)
  private String accountId;

  public static final String SERIALIZED_NAME_ACH_ABA_CODE = "AchAbaCode";
  @SerializedName(SERIALIZED_NAME_ACH_ABA_CODE)
  private String achAbaCode;

  public static final String SERIALIZED_NAME_ACH_ACCOUNT_NAME = "AchAccountName";
  @SerializedName(SERIALIZED_NAME_ACH_ACCOUNT_NAME)
  private String achAccountName;

  public static final String SERIALIZED_NAME_ACH_ACCOUNT_NUMBER_MASK = "AchAccountNumberMask";
  @SerializedName(SERIALIZED_NAME_ACH_ACCOUNT_NUMBER_MASK)
  private String achAccountNumberMask;

  public static final String SERIALIZED_NAME_ACH_ACCOUNT_TYPE = "AchAccountType";
  @SerializedName(SERIALIZED_NAME_ACH_ACCOUNT_TYPE)
  private GetPaymentMethodSnapshotResponseAchAccountType achAccountType;

  public static final String SERIALIZED_NAME_ACH_BANK_NAME = "AchBankName";
  @SerializedName(SERIALIZED_NAME_ACH_BANK_NAME)
  private String achBankName;

  public static final String SERIALIZED_NAME_BANK_BRANCH_CODE = "BankBranchCode";
  @SerializedName(SERIALIZED_NAME_BANK_BRANCH_CODE)
  private String bankBranchCode;

  public static final String SERIALIZED_NAME_BANK_CHECK_DIGIT = "BankCheckDigit";
  @SerializedName(SERIALIZED_NAME_BANK_CHECK_DIGIT)
  private String bankCheckDigit;

  public static final String SERIALIZED_NAME_BANK_CITY = "BankCity";
  @SerializedName(SERIALIZED_NAME_BANK_CITY)
  private String bankCity;

  public static final String SERIALIZED_NAME_BANK_CODE = "BankCode";
  @SerializedName(SERIALIZED_NAME_BANK_CODE)
  private String bankCode;

  public static final String SERIALIZED_NAME_BANK_IDENTIFICATION_NUMBER = "BankIdentificationNumber";
  @SerializedName(SERIALIZED_NAME_BANK_IDENTIFICATION_NUMBER)
  private String bankIdentificationNumber;

  public static final String SERIALIZED_NAME_BANK_NAME = "BankName";
  @SerializedName(SERIALIZED_NAME_BANK_NAME)
  private String bankName;

  public static final String SERIALIZED_NAME_BANK_POSTAL_CODE = "BankPostalCode";
  @SerializedName(SERIALIZED_NAME_BANK_POSTAL_CODE)
  private String bankPostalCode;

  public static final String SERIALIZED_NAME_BANK_STREET_NAME = "BankStreetName";
  @SerializedName(SERIALIZED_NAME_BANK_STREET_NAME)
  private String bankStreetName;

  public static final String SERIALIZED_NAME_BANK_STREET_NUMBER = "BankStreetNumber";
  @SerializedName(SERIALIZED_NAME_BANK_STREET_NUMBER)
  private String bankStreetNumber;

  public static final String SERIALIZED_NAME_BANK_TRANSFER_ACCOUNT_NAME = "BankTransferAccountName";
  @SerializedName(SERIALIZED_NAME_BANK_TRANSFER_ACCOUNT_NAME)
  private String bankTransferAccountName;

  public static final String SERIALIZED_NAME_BANK_TRANSFER_ACCOUNT_NUMBER_MASK = "BankTransferAccountNumberMask";
  @SerializedName(SERIALIZED_NAME_BANK_TRANSFER_ACCOUNT_NUMBER_MASK)
  private String bankTransferAccountNumberMask;

  public static final String SERIALIZED_NAME_BANK_TRANSFER_ACCOUNT_TYPE = "BankTransferAccountType";
  @SerializedName(SERIALIZED_NAME_BANK_TRANSFER_ACCOUNT_TYPE)
  private String bankTransferAccountType;

  public static final String SERIALIZED_NAME_BANK_TRANSFER_TYPE = "BankTransferType";
  @SerializedName(SERIALIZED_NAME_BANK_TRANSFER_TYPE)
  private GetPaymentMethodSnapshotResponseBankTransferType bankTransferType;

  public static final String SERIALIZED_NAME_BUSINESS_IDENTIFICATION_CODE = "BusinessIdentificationCode";
  @SerializedName(SERIALIZED_NAME_BUSINESS_IDENTIFICATION_CODE)
  private String businessIdentificationCode;

  public static final String SERIALIZED_NAME_CITY = "City";
  @SerializedName(SERIALIZED_NAME_CITY)
  private String city;

  public static final String SERIALIZED_NAME_COMPANY_NAME = "CompanyName";
  @SerializedName(SERIALIZED_NAME_COMPANY_NAME)
  private String companyName;

  public static final String SERIALIZED_NAME_COUNTRY = "Country";
  @SerializedName(SERIALIZED_NAME_COUNTRY)
  private String country;

  public static final String SERIALIZED_NAME_CREDIT_CARD_ADDRESS1 = "CreditCardAddress1";
  @SerializedName(SERIALIZED_NAME_CREDIT_CARD_ADDRESS1)
  private String creditCardAddress1;

  public static final String SERIALIZED_NAME_CREDIT_CARD_ADDRESS2 = "CreditCardAddress2";
  @SerializedName(SERIALIZED_NAME_CREDIT_CARD_ADDRESS2)
  private String creditCardAddress2;

  public static final String SERIALIZED_NAME_CREDIT_CARD_CITY = "CreditCardCity";
  @SerializedName(SERIALIZED_NAME_CREDIT_CARD_CITY)
  private String creditCardCity;

  public static final String SERIALIZED_NAME_CREDIT_CARD_COUNTRY = "CreditCardCountry";
  @SerializedName(SERIALIZED_NAME_CREDIT_CARD_COUNTRY)
  private String creditCardCountry;

  public static final String SERIALIZED_NAME_CREDIT_CARD_EXPIRATION_MONTH = "CreditCardExpirationMonth";
  @SerializedName(SERIALIZED_NAME_CREDIT_CARD_EXPIRATION_MONTH)
  private Integer creditCardExpirationMonth;

  public static final String SERIALIZED_NAME_CREDIT_CARD_EXPIRATION_YEAR = "CreditCardExpirationYear";
  @SerializedName(SERIALIZED_NAME_CREDIT_CARD_EXPIRATION_YEAR)
  private Integer creditCardExpirationYear;

  public static final String SERIALIZED_NAME_CREDIT_CARD_HOLDER_NAME = "CreditCardHolderName";
  @SerializedName(SERIALIZED_NAME_CREDIT_CARD_HOLDER_NAME)
  private String creditCardHolderName;

  public static final String SERIALIZED_NAME_CREDIT_CARD_MASK_NUMBER = "CreditCardMaskNumber";
  @SerializedName(SERIALIZED_NAME_CREDIT_CARD_MASK_NUMBER)
  private String creditCardMaskNumber;

  public static final String SERIALIZED_NAME_CREDIT_CARD_POSTAL_CODE = "CreditCardPostalCode";
  @SerializedName(SERIALIZED_NAME_CREDIT_CARD_POSTAL_CODE)
  private String creditCardPostalCode;

  public static final String SERIALIZED_NAME_CREDIT_CARD_STATE = "CreditCardState";
  @SerializedName(SERIALIZED_NAME_CREDIT_CARD_STATE)
  private String creditCardState;

  public static final String SERIALIZED_NAME_CREDIT_CARD_TYPE = "CreditCardType";
  @SerializedName(SERIALIZED_NAME_CREDIT_CARD_TYPE)
  private ProxyGetPaymentMethodSnapshotCreditCardType creditCardType;

  public static final String SERIALIZED_NAME_DEVICE_SESSION_ID = "DeviceSessionId";
  @SerializedName(SERIALIZED_NAME_DEVICE_SESSION_ID)
  private String deviceSessionId;

  public static final String SERIALIZED_NAME_EMAIL = "Email";
  @SerializedName(SERIALIZED_NAME_EMAIL)
  private String email;

  public static final String SERIALIZED_NAME_EXISTING_MANDATE = "ExistingMandate";
  @SerializedName(SERIALIZED_NAME_EXISTING_MANDATE)
  private PaymentMethodMandateInfoMandateStatus existingMandate;

  public static final String SERIALIZED_NAME_FIRST_NAME = "FirstName";
  @SerializedName(SERIALIZED_NAME_FIRST_NAME)
  private String firstName;

  public static final String SERIALIZED_NAME_I_B_A_N = "IBAN";
  @SerializedName(SERIALIZED_NAME_I_B_A_N)
  private String IBAN;

  public static final String SERIALIZED_NAME_IP_ADDRESS = "IPAddress";
  @SerializedName(SERIALIZED_NAME_IP_ADDRESS)
  private String ipAddress;

  public static final String SERIALIZED_NAME_ID = "Id";
  @SerializedName(SERIALIZED_NAME_ID)
  private String id;

  public static final String SERIALIZED_NAME_IDENTITY_NUMBER = "IdentityNumber";
  @SerializedName(SERIALIZED_NAME_IDENTITY_NUMBER)
  private String identityNumber;

  public static final String SERIALIZED_NAME_IS_COMPANY = "IsCompany";
  @SerializedName(SERIALIZED_NAME_IS_COMPANY)
  private Boolean isCompany;

  public static final String SERIALIZED_NAME_LAST_FAILED_SALE_TRANSACTION_DATE = "LastFailedSaleTransactionDate";
  @SerializedName(SERIALIZED_NAME_LAST_FAILED_SALE_TRANSACTION_DATE)
  private OffsetDateTime lastFailedSaleTransactionDate;

  public static final String SERIALIZED_NAME_LAST_NAME = "LastName";
  @SerializedName(SERIALIZED_NAME_LAST_NAME)
  private String lastName;

  public static final String SERIALIZED_NAME_LAST_TRANSACTION_DATE_TIME = "LastTransactionDateTime";
  @SerializedName(SERIALIZED_NAME_LAST_TRANSACTION_DATE_TIME)
  private OffsetDateTime lastTransactionDateTime;

  public static final String SERIALIZED_NAME_LAST_TRANSACTION_STATUS = "LastTransactionStatus";
  @SerializedName(SERIALIZED_NAME_LAST_TRANSACTION_STATUS)
  private String lastTransactionStatus;

  public static final String SERIALIZED_NAME_MANDATE_CREATION_DATE = "MandateCreationDate";
  @SerializedName(SERIALIZED_NAME_MANDATE_CREATION_DATE)
  private LocalDate mandateCreationDate;

  public static final String SERIALIZED_NAME_MANDATE_I_D = "MandateID";
  @SerializedName(SERIALIZED_NAME_MANDATE_I_D)
  private String mandateID;

  public static final String SERIALIZED_NAME_MANDATE_RECEIVED = "MandateReceived";
  @SerializedName(SERIALIZED_NAME_MANDATE_RECEIVED)
  private String mandateReceived;

  public static final String SERIALIZED_NAME_MANDATE_UPDATE_DATE = "MandateUpdateDate";
  @SerializedName(SERIALIZED_NAME_MANDATE_UPDATE_DATE)
  private LocalDate mandateUpdateDate;

  public static final String SERIALIZED_NAME_MAX_CONSECUTIVE_PAYMENT_FAILURES = "MaxConsecutivePaymentFailures";
  @SerializedName(SERIALIZED_NAME_MAX_CONSECUTIVE_PAYMENT_FAILURES)
  private Integer maxConsecutivePaymentFailures;

  public static final String SERIALIZED_NAME_NAME = "Name";
  @SerializedName(SERIALIZED_NAME_NAME)
  private String name;

  public static final String SERIALIZED_NAME_NUM_CONSECUTIVE_FAILURES = "NumConsecutiveFailures";
  @SerializedName(SERIALIZED_NAME_NUM_CONSECUTIVE_FAILURES)
  private Integer numConsecutiveFailures;

  public static final String SERIALIZED_NAME_PAYMENT_METHOD_ID = "PaymentMethodId";
  @SerializedName(SERIALIZED_NAME_PAYMENT_METHOD_ID)
  private String paymentMethodId;

  public static final String SERIALIZED_NAME_PAYMENT_METHOD_STATUS = "PaymentMethodStatus";
  @SerializedName(SERIALIZED_NAME_PAYMENT_METHOD_STATUS)
  private GetPaymentMethodSnapshotResponsePaymentMethodStatus paymentMethodStatus;

  public static final String SERIALIZED_NAME_PAYMENT_RETRY_WINDOW = "PaymentRetryWindow";
  @SerializedName(SERIALIZED_NAME_PAYMENT_RETRY_WINDOW)
  private Integer paymentRetryWindow;

  public static final String SERIALIZED_NAME_PAYPAL_BAID = "PaypalBaid";
  @SerializedName(SERIALIZED_NAME_PAYPAL_BAID)
  private String paypalBaid;

  public static final String SERIALIZED_NAME_PAYPAL_EMAIL = "PaypalEmail";
  @SerializedName(SERIALIZED_NAME_PAYPAL_EMAIL)
  private String paypalEmail;

  public static final String SERIALIZED_NAME_PAYPAL_PREAPPROVAL_KEY = "PaypalPreapprovalKey";
  @SerializedName(SERIALIZED_NAME_PAYPAL_PREAPPROVAL_KEY)
  private String paypalPreapprovalKey;

  public static final String SERIALIZED_NAME_PAYPAL_TYPE = "PaypalType";
  @SerializedName(SERIALIZED_NAME_PAYPAL_TYPE)
  private GetPaymentMethodSnapshotResponsePaypalType paypalType;

  public static final String SERIALIZED_NAME_PHONE = "Phone";
  @SerializedName(SERIALIZED_NAME_PHONE)
  private String phone;

  public static final String SERIALIZED_NAME_POSTAL_CODE = "PostalCode";
  @SerializedName(SERIALIZED_NAME_POSTAL_CODE)
  private String postalCode;

  public static final String SERIALIZED_NAME_SECOND_TOKEN_ID = "SecondTokenId";
  @SerializedName(SERIALIZED_NAME_SECOND_TOKEN_ID)
  private String secondTokenId;

  public static final String SERIALIZED_NAME_STATE = "State";
  @SerializedName(SERIALIZED_NAME_STATE)
  private String state;

  public static final String SERIALIZED_NAME_STREET_NAME = "StreetName";
  @SerializedName(SERIALIZED_NAME_STREET_NAME)
  private String streetName;

  public static final String SERIALIZED_NAME_STREET_NUMBER = "StreetNumber";
  @SerializedName(SERIALIZED_NAME_STREET_NUMBER)
  private String streetNumber;

  public static final String SERIALIZED_NAME_TOKEN_ID = "TokenId";
  @SerializedName(SERIALIZED_NAME_TOKEN_ID)
  private String tokenId;

  public static final String SERIALIZED_NAME_TOTAL_NUMBER_OF_ERROR_PAYMENTS = "TotalNumberOfErrorPayments";
  @SerializedName(SERIALIZED_NAME_TOTAL_NUMBER_OF_ERROR_PAYMENTS)
  private Integer totalNumberOfErrorPayments;

  public static final String SERIALIZED_NAME_TOTAL_NUMBER_OF_PROCESSED_PAYMENTS = "TotalNumberOfProcessedPayments";
  @SerializedName(SERIALIZED_NAME_TOTAL_NUMBER_OF_PROCESSED_PAYMENTS)
  private Integer totalNumberOfProcessedPayments;

  public static final String SERIALIZED_NAME_TYPE = "Type";
  @SerializedName(SERIALIZED_NAME_TYPE)
  private PaymentMethodType type;

  public static final String SERIALIZED_NAME_USE_DEFAULT_RETRY_RULE = "UseDefaultRetryRule";
  @SerializedName(SERIALIZED_NAME_USE_DEFAULT_RETRY_RULE)
  private Boolean useDefaultRetryRule;

  public PaymentMethodSnapshotResponse() {
  }

  public PaymentMethodSnapshotResponse accountId(String accountId) {
    this.accountId = accountId;
    return this;
  }

  /**
   * The ID of the customer account associated with this payment method.
   * @return accountId
   */
  @javax.annotation.Nullable
  public String getAccountId() {
    return accountId;
  }

  public void setAccountId(String accountId) {
    this.accountId = accountId;
  }


  public PaymentMethodSnapshotResponse achAbaCode(String achAbaCode) {
    this.achAbaCode = achAbaCode;
    return this;
  }

  /**
   * The nine-digit routing number or ABA number used by banks. Applicable to ACH payment methods.
   * @return achAbaCode
   */
  @javax.annotation.Nullable
  public String getAchAbaCode() {
    return achAbaCode;
  }

  public void setAchAbaCode(String achAbaCode) {
    this.achAbaCode = achAbaCode;
  }


  public PaymentMethodSnapshotResponse achAccountName(String achAccountName) {
    this.achAccountName = achAccountName;
    return this;
  }

  /**
   * The name of the account holder, which can be either a person or a company. Applicable to ACH payment methods.
   * @return achAccountName
   */
  @javax.annotation.Nullable
  public String getAchAccountName() {
    return achAccountName;
  }

  public void setAchAccountName(String achAccountName) {
    this.achAccountName = achAccountName;
  }


  public PaymentMethodSnapshotResponse achAccountNumberMask(String achAccountNumberMask) {
    this.achAccountNumberMask = achAccountNumberMask;
    return this;
  }

  /**
   * This is a masked displayable version of the ACH account number, used for security purposes. For example: `XXXXXXXXX54321`.
   * @return achAccountNumberMask
   */
  @javax.annotation.Nullable
  public String getAchAccountNumberMask() {
    return achAccountNumberMask;
  }

  public void setAchAccountNumberMask(String achAccountNumberMask) {
    this.achAccountNumberMask = achAccountNumberMask;
  }


  public PaymentMethodSnapshotResponse achAccountType(GetPaymentMethodSnapshotResponseAchAccountType achAccountType) {
    this.achAccountType = achAccountType;
    return this;
  }

  /**
   * Get achAccountType
   * @return achAccountType
   */
  @javax.annotation.Nullable
  public GetPaymentMethodSnapshotResponseAchAccountType getAchAccountType() {
    return achAccountType;
  }

  public void setAchAccountType(GetPaymentMethodSnapshotResponseAchAccountType achAccountType) {
    this.achAccountType = achAccountType;
  }


  public PaymentMethodSnapshotResponse achBankName(String achBankName) {
    this.achBankName = achBankName;
    return this;
  }

  /**
   * The name of the bank where the ACH payment account is held.
   * @return achBankName
   */
  @javax.annotation.Nullable
  public String getAchBankName() {
    return achBankName;
  }

  public void setAchBankName(String achBankName) {
    this.achBankName = achBankName;
  }


  public PaymentMethodSnapshotResponse bankBranchCode(String bankBranchCode) {
    this.bankBranchCode = bankBranchCode;
    return this;
  }

  /**
   * The branch code of the bank used for direct debit.
   * @return bankBranchCode
   */
  @javax.annotation.Nullable
  public String getBankBranchCode() {
    return bankBranchCode;
  }

  public void setBankBranchCode(String bankBranchCode) {
    this.bankBranchCode = bankBranchCode;
  }


  public PaymentMethodSnapshotResponse bankCheckDigit(String bankCheckDigit) {
    this.bankCheckDigit = bankCheckDigit;
    return this;
  }

  /**
   * The check digit in the international bank account number, which confirms the validity of the account. Applicable to direct debit payment methods.
   * @return bankCheckDigit
   */
  @javax.annotation.Nullable
  public String getBankCheckDigit() {
    return bankCheckDigit;
  }

  public void setBankCheckDigit(String bankCheckDigit) {
    this.bankCheckDigit = bankCheckDigit;
  }


  public PaymentMethodSnapshotResponse bankCity(String bankCity) {
    this.bankCity = bankCity;
    return this;
  }

  /**
   * The city of the direct debit bank.
   * @return bankCity
   */
  @javax.annotation.Nullable
  public String getBankCity() {
    return bankCity;
  }

  public void setBankCity(String bankCity) {
    this.bankCity = bankCity;
  }


  public PaymentMethodSnapshotResponse bankCode(String bankCode) {
    this.bankCode = bankCode;
    return this;
  }

  /**
   * The sort code or number that identifies the bank. This is also known as the sort code.
   * @return bankCode
   */
  @javax.annotation.Nullable
  public String getBankCode() {
    return bankCode;
  }

  public void setBankCode(String bankCode) {
    this.bankCode = bankCode;
  }


  public PaymentMethodSnapshotResponse bankIdentificationNumber(String bankIdentificationNumber) {
    this.bankIdentificationNumber = bankIdentificationNumber;
    return this;
  }

  /**
   * The first six or eight digits of the payment method's number, such as the credit card number or account number. Banks use this number to identify a payment method.
   * @return bankIdentificationNumber
   */
  @javax.annotation.Nullable
  public String getBankIdentificationNumber() {
    return bankIdentificationNumber;
  }

  public void setBankIdentificationNumber(String bankIdentificationNumber) {
    this.bankIdentificationNumber = bankIdentificationNumber;
  }


  public PaymentMethodSnapshotResponse bankName(String bankName) {
    this.bankName = bankName;
    return this;
  }

  /**
   * The name of the direct debit bank.
   * @return bankName
   */
  @javax.annotation.Nullable
  public String getBankName() {
    return bankName;
  }

  public void setBankName(String bankName) {
    this.bankName = bankName;
  }


  public PaymentMethodSnapshotResponse bankPostalCode(String bankPostalCode) {
    this.bankPostalCode = bankPostalCode;
    return this;
  }

  /**
   * The zip code or postal code of the direct debit bank.
   * @return bankPostalCode
   */
  @javax.annotation.Nullable
  public String getBankPostalCode() {
    return bankPostalCode;
  }

  public void setBankPostalCode(String bankPostalCode) {
    this.bankPostalCode = bankPostalCode;
  }


  public PaymentMethodSnapshotResponse bankStreetName(String bankStreetName) {
    this.bankStreetName = bankStreetName;
    return this;
  }

  /**
   * The name of the street of the direct debit bank.
   * @return bankStreetName
   */
  @javax.annotation.Nullable
  public String getBankStreetName() {
    return bankStreetName;
  }

  public void setBankStreetName(String bankStreetName) {
    this.bankStreetName = bankStreetName;
  }


  public PaymentMethodSnapshotResponse bankStreetNumber(String bankStreetNumber) {
    this.bankStreetNumber = bankStreetNumber;
    return this;
  }

  /**
   * The number of the direct debit bank.
   * @return bankStreetNumber
   */
  @javax.annotation.Nullable
  public String getBankStreetNumber() {
    return bankStreetNumber;
  }

  public void setBankStreetNumber(String bankStreetNumber) {
    this.bankStreetNumber = bankStreetNumber;
  }


  public PaymentMethodSnapshotResponse bankTransferAccountName(String bankTransferAccountName) {
    this.bankTransferAccountName = bankTransferAccountName;
    return this;
  }

  /**
   * The name on the direct debit bank account.
   * @return bankTransferAccountName
   */
  @javax.annotation.Nullable
  public String getBankTransferAccountName() {
    return bankTransferAccountName;
  }

  public void setBankTransferAccountName(String bankTransferAccountName) {
    this.bankTransferAccountName = bankTransferAccountName;
  }


  public PaymentMethodSnapshotResponse bankTransferAccountNumberMask(String bankTransferAccountNumberMask) {
    this.bankTransferAccountNumberMask = bankTransferAccountNumberMask;
    return this;
  }

  /**
   * This is a masked displayable version of the bank account number, used for security purposes. For example: `XXXXXXXXX54321`.
   * @return bankTransferAccountNumberMask
   */
  @javax.annotation.Nullable
  public String getBankTransferAccountNumberMask() {
    return bankTransferAccountNumberMask;
  }

  public void setBankTransferAccountNumberMask(String bankTransferAccountNumberMask) {
    this.bankTransferAccountNumberMask = bankTransferAccountNumberMask;
  }


  public PaymentMethodSnapshotResponse bankTransferAccountType(String bankTransferAccountType) {
    this.bankTransferAccountType = bankTransferAccountType;
    return this;
  }

  /**
   * The type of the customer's bank account. Applicable to direct debit payment methods.
   * @return bankTransferAccountType
   */
  @javax.annotation.Nullable
  public String getBankTransferAccountType() {
    return bankTransferAccountType;
  }

  public void setBankTransferAccountType(String bankTransferAccountType) {
    this.bankTransferAccountType = bankTransferAccountType;
  }


  public PaymentMethodSnapshotResponse bankTransferType(GetPaymentMethodSnapshotResponseBankTransferType bankTransferType) {
    this.bankTransferType = bankTransferType;
    return this;
  }

  /**
   * Get bankTransferType
   * @return bankTransferType
   */
  @javax.annotation.Nullable
  public GetPaymentMethodSnapshotResponseBankTransferType getBankTransferType() {
    return bankTransferType;
  }

  public void setBankTransferType(GetPaymentMethodSnapshotResponseBankTransferType bankTransferType) {
    this.bankTransferType = bankTransferType;
  }


  public PaymentMethodSnapshotResponse businessIdentificationCode(String businessIdentificationCode) {
    this.businessIdentificationCode = businessIdentificationCode;
    return this;
  }

  /**
   * The business identification code for Swiss direct payment methods that use the Global Collect payment gateway. Only applicable to direct debit payments in Switzerland with Global Collect.
   * @return businessIdentificationCode
   */
  @javax.annotation.Nullable
  public String getBusinessIdentificationCode() {
    return businessIdentificationCode;
  }

  public void setBusinessIdentificationCode(String businessIdentificationCode) {
    this.businessIdentificationCode = businessIdentificationCode;
  }


  public PaymentMethodSnapshotResponse city(String city) {
    this.city = city;
    return this;
  }

  /**
   * The city of the customer's address. Applicable to debit payment methods.
   * @return city
   */
  @javax.annotation.Nullable
  public String getCity() {
    return city;
  }

  public void setCity(String city) {
    this.city = city;
  }


  public PaymentMethodSnapshotResponse companyName(String companyName) {
    this.companyName = companyName;
    return this;
  }

  /**
   * The name of the company. 
   * @return companyName
   */
  @javax.annotation.Nullable
  public String getCompanyName() {
    return companyName;
  }

  public void setCompanyName(String companyName) {
    this.companyName = companyName;
  }


  public PaymentMethodSnapshotResponse country(String country) {
    this.country = country;
    return this;
  }

  /**
   * The two-letter country code of the customer's address. Applicable to direct debit payment methods.
   * @return country
   */
  @javax.annotation.Nullable
  public String getCountry() {
    return country;
  }

  public void setCountry(String country) {
    this.country = country;
  }


  public PaymentMethodSnapshotResponse creditCardAddress1(String creditCardAddress1) {
    this.creditCardAddress1 = creditCardAddress1;
    return this;
  }

  /**
   * The first line of the card holder's address, which is often a street address or business name. Applicable to credit card and direct debit payment methods.
   * @return creditCardAddress1
   */
  @javax.annotation.Nullable
  public String getCreditCardAddress1() {
    return creditCardAddress1;
  }

  public void setCreditCardAddress1(String creditCardAddress1) {
    this.creditCardAddress1 = creditCardAddress1;
  }


  public PaymentMethodSnapshotResponse creditCardAddress2(String creditCardAddress2) {
    this.creditCardAddress2 = creditCardAddress2;
    return this;
  }

  /**
   * The second line of the card holder's address. Applicable to credit card and direct debit payment methods.
   * @return creditCardAddress2
   */
  @javax.annotation.Nullable
  public String getCreditCardAddress2() {
    return creditCardAddress2;
  }

  public void setCreditCardAddress2(String creditCardAddress2) {
    this.creditCardAddress2 = creditCardAddress2;
  }


  public PaymentMethodSnapshotResponse creditCardCity(String creditCardCity) {
    this.creditCardCity = creditCardCity;
    return this;
  }

  /**
   * The city of the card holder's address. Applicable to credit card and direct debit payment methods.
   * @return creditCardCity
   */
  @javax.annotation.Nullable
  public String getCreditCardCity() {
    return creditCardCity;
  }

  public void setCreditCardCity(String creditCardCity) {
    this.creditCardCity = creditCardCity;
  }


  public PaymentMethodSnapshotResponse creditCardCountry(String creditCardCountry) {
    this.creditCardCountry = creditCardCountry;
    return this;
  }

  /**
   * The country of the card holder's address.
   * @return creditCardCountry
   */
  @javax.annotation.Nullable
  public String getCreditCardCountry() {
    return creditCardCountry;
  }

  public void setCreditCardCountry(String creditCardCountry) {
    this.creditCardCountry = creditCardCountry;
  }


  public PaymentMethodSnapshotResponse creditCardExpirationMonth(Integer creditCardExpirationMonth) {
    this.creditCardExpirationMonth = creditCardExpirationMonth;
    return this;
  }

  /**
   * The expiration month of the credit card or debit card. Applicable to credit card and direct debit payment methods.
   * @return creditCardExpirationMonth
   */
  @javax.annotation.Nullable
  public Integer getCreditCardExpirationMonth() {
    return creditCardExpirationMonth;
  }

  public void setCreditCardExpirationMonth(Integer creditCardExpirationMonth) {
    this.creditCardExpirationMonth = creditCardExpirationMonth;
  }


  public PaymentMethodSnapshotResponse creditCardExpirationYear(Integer creditCardExpirationYear) {
    this.creditCardExpirationYear = creditCardExpirationYear;
    return this;
  }

  /**
   * The expiration month of the credit card or debit card. Applicable to credit card and direct debit payment methods.
   * @return creditCardExpirationYear
   */
  @javax.annotation.Nullable
  public Integer getCreditCardExpirationYear() {
    return creditCardExpirationYear;
  }

  public void setCreditCardExpirationYear(Integer creditCardExpirationYear) {
    this.creditCardExpirationYear = creditCardExpirationYear;
  }


  public PaymentMethodSnapshotResponse creditCardHolderName(String creditCardHolderName) {
    this.creditCardHolderName = creditCardHolderName;
    return this;
  }

  /**
   * The full name of the card holder. Applicable to credit card and direct debit payment methods.
   * @return creditCardHolderName
   */
  @javax.annotation.Nullable
  public String getCreditCardHolderName() {
    return creditCardHolderName;
  }

  public void setCreditCardHolderName(String creditCardHolderName) {
    this.creditCardHolderName = creditCardHolderName;
  }


  public PaymentMethodSnapshotResponse creditCardMaskNumber(String creditCardMaskNumber) {
    this.creditCardMaskNumber = creditCardMaskNumber;
    return this;
  }

  /**
   * A masked version of the credit or debit card number.
   * @return creditCardMaskNumber
   */
  @javax.annotation.Nullable
  public String getCreditCardMaskNumber() {
    return creditCardMaskNumber;
  }

  public void setCreditCardMaskNumber(String creditCardMaskNumber) {
    this.creditCardMaskNumber = creditCardMaskNumber;
  }


  public PaymentMethodSnapshotResponse creditCardPostalCode(String creditCardPostalCode) {
    this.creditCardPostalCode = creditCardPostalCode;
    return this;
  }

  /**
   * The billing address's zip code.
   * @return creditCardPostalCode
   */
  @javax.annotation.Nullable
  public String getCreditCardPostalCode() {
    return creditCardPostalCode;
  }

  public void setCreditCardPostalCode(String creditCardPostalCode) {
    this.creditCardPostalCode = creditCardPostalCode;
  }


  public PaymentMethodSnapshotResponse creditCardState(String creditCardState) {
    this.creditCardState = creditCardState;
    return this;
  }

  /**
   * The billing address's state. Applicable if `CreditCardCountry` is either Canada or the US.
   * @return creditCardState
   */
  @javax.annotation.Nullable
  public String getCreditCardState() {
    return creditCardState;
  }

  public void setCreditCardState(String creditCardState) {
    this.creditCardState = creditCardState;
  }


  public PaymentMethodSnapshotResponse creditCardType(ProxyGetPaymentMethodSnapshotCreditCardType creditCardType) {
    this.creditCardType = creditCardType;
    return this;
  }

  /**
   * Get creditCardType
   * @return creditCardType
   */
  @javax.annotation.Nullable
  public ProxyGetPaymentMethodSnapshotCreditCardType getCreditCardType() {
    return creditCardType;
  }

  public void setCreditCardType(ProxyGetPaymentMethodSnapshotCreditCardType creditCardType) {
    this.creditCardType = creditCardType;
  }


  public PaymentMethodSnapshotResponse deviceSessionId(String deviceSessionId) {
    this.deviceSessionId = deviceSessionId;
    return this;
  }

  /**
   * The session ID of the user when the `PaymentMethod` was created or updated.
   * @return deviceSessionId
   */
  @javax.annotation.Nullable
  public String getDeviceSessionId() {
    return deviceSessionId;
  }

  public void setDeviceSessionId(String deviceSessionId) {
    this.deviceSessionId = deviceSessionId;
  }


  public PaymentMethodSnapshotResponse email(String email) {
    this.email = email;
    return this;
  }

  /**
   * An email address for the payment method in addition to the bill to contact email address.
   * @return email
   */
  @javax.annotation.Nullable
  public String getEmail() {
    return email;
  }

  public void setEmail(String email) {
    this.email = email;
  }


  public PaymentMethodSnapshotResponse existingMandate(PaymentMethodMandateInfoMandateStatus existingMandate) {
    this.existingMandate = existingMandate;
    return this;
  }

  /**
   * Get existingMandate
   * @return existingMandate
   */
  @javax.annotation.Nullable
  public PaymentMethodMandateInfoMandateStatus getExistingMandate() {
    return existingMandate;
  }

  public void setExistingMandate(PaymentMethodMandateInfoMandateStatus existingMandate) {
    this.existingMandate = existingMandate;
  }


  public PaymentMethodSnapshotResponse firstName(String firstName) {
    this.firstName = firstName;
    return this;
  }

  /**
   * The customer's first name. Only applicable to direct debit payment methods.
   * @return firstName
   */
  @javax.annotation.Nullable
  public String getFirstName() {
    return firstName;
  }

  public void setFirstName(String firstName) {
    this.firstName = firstName;
  }


  public PaymentMethodSnapshotResponse IBAN(String IBAN) {
    this.IBAN = IBAN;
    return this;
  }

  /**
   * The International Bank Account Number. Only applicable to direct debit payment methods.
   * @return IBAN
   */
  @javax.annotation.Nullable
  public String getIBAN() {
    return IBAN;
  }

  public void setIBAN(String IBAN) {
    this.IBAN = IBAN;
  }


  public PaymentMethodSnapshotResponse ipAddress(String ipAddress) {
    this.ipAddress = ipAddress;
    return this;
  }

  /**
   * The IP address of the user when the payment method was created or updated.
   * @return ipAddress
   */
  @javax.annotation.Nullable
  public String getIpAddress() {
    return ipAddress;
  }

  public void setIpAddress(String ipAddress) {
    this.ipAddress = ipAddress;
  }


  public PaymentMethodSnapshotResponse id(String id) {
    this.id = id;
    return this;
  }

  /**
   * Object identifier.
   * @return id
   */
  @javax.annotation.Nullable
  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }


  public PaymentMethodSnapshotResponse identityNumber(String identityNumber) {
    this.identityNumber = identityNumber;
    return this;
  }

  /**
   * The unique identity number of the customer account.  
   * @return identityNumber
   */
  @javax.annotation.Nullable
  public String getIdentityNumber() {
    return identityNumber;
  }

  public void setIdentityNumber(String identityNumber) {
    this.identityNumber = identityNumber;
  }


  public PaymentMethodSnapshotResponse isCompany(Boolean isCompany) {
    this.isCompany = isCompany;
    return this;
  }

  /**
   * Whether the customer account is a company. 
   * @return isCompany
   */
  @javax.annotation.Nullable
  public Boolean getIsCompany() {
    return isCompany;
  }

  public void setIsCompany(Boolean isCompany) {
    this.isCompany = isCompany;
  }


  public PaymentMethodSnapshotResponse lastFailedSaleTransactionDate(OffsetDateTime lastFailedSaleTransactionDate) {
    this.lastFailedSaleTransactionDate = lastFailedSaleTransactionDate;
    return this;
  }

  /**
   * The date of the last failed attempt to collect payment with this payment method.
   * @return lastFailedSaleTransactionDate
   */
  @javax.annotation.Nullable
  public OffsetDateTime getLastFailedSaleTransactionDate() {
    return lastFailedSaleTransactionDate;
  }

  public void setLastFailedSaleTransactionDate(OffsetDateTime lastFailedSaleTransactionDate) {
    this.lastFailedSaleTransactionDate = lastFailedSaleTransactionDate;
  }


  public PaymentMethodSnapshotResponse lastName(String lastName) {
    this.lastName = lastName;
    return this;
  }

  /**
   * The customer's last name. Only applicable to direct debit payment methods.
   * @return lastName
   */
  @javax.annotation.Nullable
  public String getLastName() {
    return lastName;
  }

  public void setLastName(String lastName) {
    this.lastName = lastName;
  }


  public PaymentMethodSnapshotResponse lastTransactionDateTime(OffsetDateTime lastTransactionDateTime) {
    this.lastTransactionDateTime = lastTransactionDateTime;
    return this;
  }

  /**
   * The date of the most recent transaction.
   * @return lastTransactionDateTime
   */
  @javax.annotation.Nullable
  public OffsetDateTime getLastTransactionDateTime() {
    return lastTransactionDateTime;
  }

  public void setLastTransactionDateTime(OffsetDateTime lastTransactionDateTime) {
    this.lastTransactionDateTime = lastTransactionDateTime;
  }


  public PaymentMethodSnapshotResponse lastTransactionStatus(String lastTransactionStatus) {
    this.lastTransactionStatus = lastTransactionStatus;
    return this;
  }

  /**
   * The status of the most recent transaction.
   * @return lastTransactionStatus
   */
  @javax.annotation.Nullable
  public String getLastTransactionStatus() {
    return lastTransactionStatus;
  }

  public void setLastTransactionStatus(String lastTransactionStatus) {
    this.lastTransactionStatus = lastTransactionStatus;
  }


  public PaymentMethodSnapshotResponse mandateCreationDate(LocalDate mandateCreationDate) {
    this.mandateCreationDate = mandateCreationDate;
    return this;
  }

  /**
   * The date when the mandate was created, in `yyyy-mm-dd` format. A mandate is a signed authorization for UK and NL customers. Only applicable to direct debit payment methods.
   * @return mandateCreationDate
   */
  @javax.annotation.Nullable
  public LocalDate getMandateCreationDate() {
    return mandateCreationDate;
  }

  public void setMandateCreationDate(LocalDate mandateCreationDate) {
    this.mandateCreationDate = mandateCreationDate;
  }


  public PaymentMethodSnapshotResponse mandateID(String mandateID) {
    this.mandateID = mandateID;
    return this;
  }

  /**
   * The ID of the mandate. A mandate is a signed authorization for UK and NL customers. Only applicable to direct debit payment methods.
   * @return mandateID
   */
  @javax.annotation.Nullable
  public String getMandateID() {
    return mandateID;
  }

  public void setMandateID(String mandateID) {
    this.mandateID = mandateID;
  }


  public PaymentMethodSnapshotResponse mandateReceived(String mandateReceived) {
    this.mandateReceived = mandateReceived;
    return this;
  }

  /**
   * Indicates if  the mandate was received. A mandate is a signed authorization for UK and NL customers. Only applicable to direct debit payment methods.
   * @return mandateReceived
   */
  @javax.annotation.Nullable
  public String getMandateReceived() {
    return mandateReceived;
  }

  public void setMandateReceived(String mandateReceived) {
    this.mandateReceived = mandateReceived;
  }


  public PaymentMethodSnapshotResponse mandateUpdateDate(LocalDate mandateUpdateDate) {
    this.mandateUpdateDate = mandateUpdateDate;
    return this;
  }

  /**
   * The date when the mandate was last updated, in `yyyy-mm-dd` format. A mandate is a signed authorization for UK and NL customers. Only applicable to direct debit payment methods.
   * @return mandateUpdateDate
   */
  @javax.annotation.Nullable
  public LocalDate getMandateUpdateDate() {
    return mandateUpdateDate;
  }

  public void setMandateUpdateDate(LocalDate mandateUpdateDate) {
    this.mandateUpdateDate = mandateUpdateDate;
  }


  public PaymentMethodSnapshotResponse maxConsecutivePaymentFailures(Integer maxConsecutivePaymentFailures) {
    this.maxConsecutivePaymentFailures = maxConsecutivePaymentFailures;
    return this;
  }

  /**
   * The number of allowable consecutive failures Zuora attempts with the payment method before stopping.
   * @return maxConsecutivePaymentFailures
   */
  @javax.annotation.Nullable
  public Integer getMaxConsecutivePaymentFailures() {
    return maxConsecutivePaymentFailures;
  }

  public void setMaxConsecutivePaymentFailures(Integer maxConsecutivePaymentFailures) {
    this.maxConsecutivePaymentFailures = maxConsecutivePaymentFailures;
  }


  public PaymentMethodSnapshotResponse name(String name) {
    this.name = name;
    return this;
  }

  /**
   * The name of the payment method.
   * @return name
   */
  @javax.annotation.Nullable
  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }


  public PaymentMethodSnapshotResponse numConsecutiveFailures(Integer numConsecutiveFailures) {
    this.numConsecutiveFailures = numConsecutiveFailures;
    return this;
  }

  /**
   * The number of consecutive failed payment for the payment method.
   * @return numConsecutiveFailures
   */
  @javax.annotation.Nullable
  public Integer getNumConsecutiveFailures() {
    return numConsecutiveFailures;
  }

  public void setNumConsecutiveFailures(Integer numConsecutiveFailures) {
    this.numConsecutiveFailures = numConsecutiveFailures;
  }


  public PaymentMethodSnapshotResponse paymentMethodId(String paymentMethodId) {
    this.paymentMethodId = paymentMethodId;
    return this;
  }

  /**
   * Object identifier of the payment method.
   * @return paymentMethodId
   */
  @javax.annotation.Nullable
  public String getPaymentMethodId() {
    return paymentMethodId;
  }

  public void setPaymentMethodId(String paymentMethodId) {
    this.paymentMethodId = paymentMethodId;
  }


  public PaymentMethodSnapshotResponse paymentMethodStatus(GetPaymentMethodSnapshotResponsePaymentMethodStatus paymentMethodStatus) {
    this.paymentMethodStatus = paymentMethodStatus;
    return this;
  }

  /**
   * Get paymentMethodStatus
   * @return paymentMethodStatus
   */
  @javax.annotation.Nullable
  public GetPaymentMethodSnapshotResponsePaymentMethodStatus getPaymentMethodStatus() {
    return paymentMethodStatus;
  }

  public void setPaymentMethodStatus(GetPaymentMethodSnapshotResponsePaymentMethodStatus paymentMethodStatus) {
    this.paymentMethodStatus = paymentMethodStatus;
  }


  public PaymentMethodSnapshotResponse paymentRetryWindow(Integer paymentRetryWindow) {
    this.paymentRetryWindow = paymentRetryWindow;
    return this;
  }

  /**
   * The retry interval setting, which prevents making a payment attempt if the last failed attempt was within the last specified number of hours.
   * @return paymentRetryWindow
   */
  @javax.annotation.Nullable
  public Integer getPaymentRetryWindow() {
    return paymentRetryWindow;
  }

  public void setPaymentRetryWindow(Integer paymentRetryWindow) {
    this.paymentRetryWindow = paymentRetryWindow;
  }


  public PaymentMethodSnapshotResponse paypalBaid(String paypalBaid) {
    this.paypalBaid = paypalBaid;
    return this;
  }

  /**
   * The PayPal billing agreement ID, which is a contract between two PayPal accounts.
   * @return paypalBaid
   */
  @javax.annotation.Nullable
  public String getPaypalBaid() {
    return paypalBaid;
  }

  public void setPaypalBaid(String paypalBaid) {
    this.paypalBaid = paypalBaid;
  }


  public PaymentMethodSnapshotResponse paypalEmail(String paypalEmail) {
    this.paypalEmail = paypalEmail;
    return this;
  }

  /**
   * The email address associated with the account holder's PayPal account or of the PayPal account of the person paying for the service.
   * @return paypalEmail
   */
  @javax.annotation.Nullable
  public String getPaypalEmail() {
    return paypalEmail;
  }

  public void setPaypalEmail(String paypalEmail) {
    this.paypalEmail = paypalEmail;
  }


  public PaymentMethodSnapshotResponse paypalPreapprovalKey(String paypalPreapprovalKey) {
    this.paypalPreapprovalKey = paypalPreapprovalKey;
    return this;
  }

  /**
   * PayPal's Adaptive Payments API key.
   * @return paypalPreapprovalKey
   */
  @javax.annotation.Nullable
  public String getPaypalPreapprovalKey() {
    return paypalPreapprovalKey;
  }

  public void setPaypalPreapprovalKey(String paypalPreapprovalKey) {
    this.paypalPreapprovalKey = paypalPreapprovalKey;
  }


  public PaymentMethodSnapshotResponse paypalType(GetPaymentMethodSnapshotResponsePaypalType paypalType) {
    this.paypalType = paypalType;
    return this;
  }

  /**
   * Get paypalType
   * @return paypalType
   */
  @javax.annotation.Nullable
  public GetPaymentMethodSnapshotResponsePaypalType getPaypalType() {
    return paypalType;
  }

  public void setPaypalType(GetPaymentMethodSnapshotResponsePaypalType paypalType) {
    this.paypalType = paypalType;
  }


  public PaymentMethodSnapshotResponse phone(String phone) {
    this.phone = phone;
    return this;
  }

  /**
   * The phone number that the account holder registered with the bank. This field is used for credit card validation when passing to a gateway.
   * @return phone
   */
  @javax.annotation.Nullable
  public String getPhone() {
    return phone;
  }

  public void setPhone(String phone) {
    this.phone = phone;
  }


  public PaymentMethodSnapshotResponse postalCode(String postalCode) {
    this.postalCode = postalCode;
    return this;
  }

  /**
   * The zip code of the customer's address. Only applicable to direct debit payment methods.
   * @return postalCode
   */
  @javax.annotation.Nullable
  public String getPostalCode() {
    return postalCode;
  }

  public void setPostalCode(String postalCode) {
    this.postalCode = postalCode;
  }


  public PaymentMethodSnapshotResponse secondTokenId(String secondTokenId) {
    this.secondTokenId = secondTokenId;
    return this;
  }

  /**
   * A gateway unique identifier that replaces sensitive payment method data. Applicable to CC Reference Transaction payment methods.
   * @return secondTokenId
   */
  @javax.annotation.Nullable
  public String getSecondTokenId() {
    return secondTokenId;
  }

  public void setSecondTokenId(String secondTokenId) {
    this.secondTokenId = secondTokenId;
  }


  public PaymentMethodSnapshotResponse state(String state) {
    this.state = state;
    return this;
  }

  /**
   * The state of the customer's address. Only applicable to direct debit payment methods.
   * @return state
   */
  @javax.annotation.Nullable
  public String getState() {
    return state;
  }

  public void setState(String state) {
    this.state = state;
  }


  public PaymentMethodSnapshotResponse streetName(String streetName) {
    this.streetName = streetName;
    return this;
  }

  /**
   * The street name of the customer's address. Only applicable to direct debit payment methods.
   * @return streetName
   */
  @javax.annotation.Nullable
  public String getStreetName() {
    return streetName;
  }

  public void setStreetName(String streetName) {
    this.streetName = streetName;
  }


  public PaymentMethodSnapshotResponse streetNumber(String streetNumber) {
    this.streetNumber = streetNumber;
    return this;
  }

  /**
   * The street number of the customer's address. Only applicable to direct debit payment methods.
   * @return streetNumber
   */
  @javax.annotation.Nullable
  public String getStreetNumber() {
    return streetNumber;
  }

  public void setStreetNumber(String streetNumber) {
    this.streetNumber = streetNumber;
  }


  public PaymentMethodSnapshotResponse tokenId(String tokenId) {
    this.tokenId = tokenId;
    return this;
  }

  /**
   * A gateway unique identifier that replaces sensitive payment method data or represents a gateway's unique customer profile. Applicable to CC Reference Transaction payment methods.
   * @return tokenId
   */
  @javax.annotation.Nullable
  public String getTokenId() {
    return tokenId;
  }

  public void setTokenId(String tokenId) {
    this.tokenId = tokenId;
  }


  public PaymentMethodSnapshotResponse totalNumberOfErrorPayments(Integer totalNumberOfErrorPayments) {
    this.totalNumberOfErrorPayments = totalNumberOfErrorPayments;
    return this;
  }

  /**
   * The number of error payments that used this payment method.
   * @return totalNumberOfErrorPayments
   */
  @javax.annotation.Nullable
  public Integer getTotalNumberOfErrorPayments() {
    return totalNumberOfErrorPayments;
  }

  public void setTotalNumberOfErrorPayments(Integer totalNumberOfErrorPayments) {
    this.totalNumberOfErrorPayments = totalNumberOfErrorPayments;
  }


  public PaymentMethodSnapshotResponse totalNumberOfProcessedPayments(Integer totalNumberOfProcessedPayments) {
    this.totalNumberOfProcessedPayments = totalNumberOfProcessedPayments;
    return this;
  }

  /**
   * The number of successful payments that used this payment method.
   * @return totalNumberOfProcessedPayments
   */
  @javax.annotation.Nullable
  public Integer getTotalNumberOfProcessedPayments() {
    return totalNumberOfProcessedPayments;
  }

  public void setTotalNumberOfProcessedPayments(Integer totalNumberOfProcessedPayments) {
    this.totalNumberOfProcessedPayments = totalNumberOfProcessedPayments;
  }


  public PaymentMethodSnapshotResponse type(PaymentMethodType type) {
    this.type = type;
    return this;
  }

  /**
   * Get type
   * @return type
   */
  @javax.annotation.Nullable
  public PaymentMethodType getType() {
    return type;
  }

  public void setType(PaymentMethodType type) {
    this.type = type;
  }


  public PaymentMethodSnapshotResponse useDefaultRetryRule(Boolean useDefaultRetryRule) {
    this.useDefaultRetryRule = useDefaultRetryRule;
    return this;
  }

  /**
   * Determines whether to use the default retry rules configured in the Zuora Payments settings.
   * @return useDefaultRetryRule
   */
  @javax.annotation.Nullable
  public Boolean getUseDefaultRetryRule() {
    return useDefaultRetryRule;
  }

  public void setUseDefaultRetryRule(Boolean useDefaultRetryRule) {
    this.useDefaultRetryRule = useDefaultRetryRule;
  }

  /**
   * A container for additional, undeclared properties.
   * This is a holder for any undeclared properties as specified with
   * the 'additionalProperties' keyword in the OAS document.
   */
  private Map additionalProperties;

  /**
   * Set the additional (undeclared) property with the specified name and value.
   * If the property does not already exist, create it otherwise replace it.
   *
   * @param key name of the property
   * @param value value of the property
   * @return the PaymentMethodSnapshotResponse instance itself
   */
  public PaymentMethodSnapshotResponse putAdditionalProperty(String key, Object value) {
    if (this.additionalProperties == null) {
        this.additionalProperties = new HashMap();
    }
    this.additionalProperties.put(key, value);
    return this;
  }

  /**
   * Return the additional (undeclared) property.
   *
   * @return a map of objects
   */
  public Map getAdditionalProperties() {
    return additionalProperties;
  }

  /**
   * Return the additional (undeclared) property with the specified name.
   *
   * @param key name of the property
   * @return an object
   */
  public Object getAdditionalProperty(String key) {
    if (this.additionalProperties == null) {
        return null;
    }
    return this.additionalProperties.get(key);
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    PaymentMethodSnapshotResponse paymentMethodSnapshotResponse = (PaymentMethodSnapshotResponse) o;
    return Objects.equals(this.accountId, paymentMethodSnapshotResponse.accountId) &&
        Objects.equals(this.achAbaCode, paymentMethodSnapshotResponse.achAbaCode) &&
        Objects.equals(this.achAccountName, paymentMethodSnapshotResponse.achAccountName) &&
        Objects.equals(this.achAccountNumberMask, paymentMethodSnapshotResponse.achAccountNumberMask) &&
        Objects.equals(this.achAccountType, paymentMethodSnapshotResponse.achAccountType) &&
        Objects.equals(this.achBankName, paymentMethodSnapshotResponse.achBankName) &&
        Objects.equals(this.bankBranchCode, paymentMethodSnapshotResponse.bankBranchCode) &&
        Objects.equals(this.bankCheckDigit, paymentMethodSnapshotResponse.bankCheckDigit) &&
        Objects.equals(this.bankCity, paymentMethodSnapshotResponse.bankCity) &&
        Objects.equals(this.bankCode, paymentMethodSnapshotResponse.bankCode) &&
        Objects.equals(this.bankIdentificationNumber, paymentMethodSnapshotResponse.bankIdentificationNumber) &&
        Objects.equals(this.bankName, paymentMethodSnapshotResponse.bankName) &&
        Objects.equals(this.bankPostalCode, paymentMethodSnapshotResponse.bankPostalCode) &&
        Objects.equals(this.bankStreetName, paymentMethodSnapshotResponse.bankStreetName) &&
        Objects.equals(this.bankStreetNumber, paymentMethodSnapshotResponse.bankStreetNumber) &&
        Objects.equals(this.bankTransferAccountName, paymentMethodSnapshotResponse.bankTransferAccountName) &&
        Objects.equals(this.bankTransferAccountNumberMask, paymentMethodSnapshotResponse.bankTransferAccountNumberMask) &&
        Objects.equals(this.bankTransferAccountType, paymentMethodSnapshotResponse.bankTransferAccountType) &&
        Objects.equals(this.bankTransferType, paymentMethodSnapshotResponse.bankTransferType) &&
        Objects.equals(this.businessIdentificationCode, paymentMethodSnapshotResponse.businessIdentificationCode) &&
        Objects.equals(this.city, paymentMethodSnapshotResponse.city) &&
        Objects.equals(this.companyName, paymentMethodSnapshotResponse.companyName) &&
        Objects.equals(this.country, paymentMethodSnapshotResponse.country) &&
        Objects.equals(this.creditCardAddress1, paymentMethodSnapshotResponse.creditCardAddress1) &&
        Objects.equals(this.creditCardAddress2, paymentMethodSnapshotResponse.creditCardAddress2) &&
        Objects.equals(this.creditCardCity, paymentMethodSnapshotResponse.creditCardCity) &&
        Objects.equals(this.creditCardCountry, paymentMethodSnapshotResponse.creditCardCountry) &&
        Objects.equals(this.creditCardExpirationMonth, paymentMethodSnapshotResponse.creditCardExpirationMonth) &&
        Objects.equals(this.creditCardExpirationYear, paymentMethodSnapshotResponse.creditCardExpirationYear) &&
        Objects.equals(this.creditCardHolderName, paymentMethodSnapshotResponse.creditCardHolderName) &&
        Objects.equals(this.creditCardMaskNumber, paymentMethodSnapshotResponse.creditCardMaskNumber) &&
        Objects.equals(this.creditCardPostalCode, paymentMethodSnapshotResponse.creditCardPostalCode) &&
        Objects.equals(this.creditCardState, paymentMethodSnapshotResponse.creditCardState) &&
        Objects.equals(this.creditCardType, paymentMethodSnapshotResponse.creditCardType) &&
        Objects.equals(this.deviceSessionId, paymentMethodSnapshotResponse.deviceSessionId) &&
        Objects.equals(this.email, paymentMethodSnapshotResponse.email) &&
        Objects.equals(this.existingMandate, paymentMethodSnapshotResponse.existingMandate) &&
        Objects.equals(this.firstName, paymentMethodSnapshotResponse.firstName) &&
        Objects.equals(this.IBAN, paymentMethodSnapshotResponse.IBAN) &&
        Objects.equals(this.ipAddress, paymentMethodSnapshotResponse.ipAddress) &&
        Objects.equals(this.id, paymentMethodSnapshotResponse.id) &&
        Objects.equals(this.identityNumber, paymentMethodSnapshotResponse.identityNumber) &&
        Objects.equals(this.isCompany, paymentMethodSnapshotResponse.isCompany) &&
        Objects.equals(this.lastFailedSaleTransactionDate, paymentMethodSnapshotResponse.lastFailedSaleTransactionDate) &&
        Objects.equals(this.lastName, paymentMethodSnapshotResponse.lastName) &&
        Objects.equals(this.lastTransactionDateTime, paymentMethodSnapshotResponse.lastTransactionDateTime) &&
        Objects.equals(this.lastTransactionStatus, paymentMethodSnapshotResponse.lastTransactionStatus) &&
        Objects.equals(this.mandateCreationDate, paymentMethodSnapshotResponse.mandateCreationDate) &&
        Objects.equals(this.mandateID, paymentMethodSnapshotResponse.mandateID) &&
        Objects.equals(this.mandateReceived, paymentMethodSnapshotResponse.mandateReceived) &&
        Objects.equals(this.mandateUpdateDate, paymentMethodSnapshotResponse.mandateUpdateDate) &&
        Objects.equals(this.maxConsecutivePaymentFailures, paymentMethodSnapshotResponse.maxConsecutivePaymentFailures) &&
        Objects.equals(this.name, paymentMethodSnapshotResponse.name) &&
        Objects.equals(this.numConsecutiveFailures, paymentMethodSnapshotResponse.numConsecutiveFailures) &&
        Objects.equals(this.paymentMethodId, paymentMethodSnapshotResponse.paymentMethodId) &&
        Objects.equals(this.paymentMethodStatus, paymentMethodSnapshotResponse.paymentMethodStatus) &&
        Objects.equals(this.paymentRetryWindow, paymentMethodSnapshotResponse.paymentRetryWindow) &&
        Objects.equals(this.paypalBaid, paymentMethodSnapshotResponse.paypalBaid) &&
        Objects.equals(this.paypalEmail, paymentMethodSnapshotResponse.paypalEmail) &&
        Objects.equals(this.paypalPreapprovalKey, paymentMethodSnapshotResponse.paypalPreapprovalKey) &&
        Objects.equals(this.paypalType, paymentMethodSnapshotResponse.paypalType) &&
        Objects.equals(this.phone, paymentMethodSnapshotResponse.phone) &&
        Objects.equals(this.postalCode, paymentMethodSnapshotResponse.postalCode) &&
        Objects.equals(this.secondTokenId, paymentMethodSnapshotResponse.secondTokenId) &&
        Objects.equals(this.state, paymentMethodSnapshotResponse.state) &&
        Objects.equals(this.streetName, paymentMethodSnapshotResponse.streetName) &&
        Objects.equals(this.streetNumber, paymentMethodSnapshotResponse.streetNumber) &&
        Objects.equals(this.tokenId, paymentMethodSnapshotResponse.tokenId) &&
        Objects.equals(this.totalNumberOfErrorPayments, paymentMethodSnapshotResponse.totalNumberOfErrorPayments) &&
        Objects.equals(this.totalNumberOfProcessedPayments, paymentMethodSnapshotResponse.totalNumberOfProcessedPayments) &&
        Objects.equals(this.type, paymentMethodSnapshotResponse.type) &&
        Objects.equals(this.useDefaultRetryRule, paymentMethodSnapshotResponse.useDefaultRetryRule)&&
        Objects.equals(this.additionalProperties, paymentMethodSnapshotResponse.additionalProperties);
  }

  @Override
  public int hashCode() {
    return Objects.hash(accountId, achAbaCode, achAccountName, achAccountNumberMask, achAccountType, achBankName, bankBranchCode, bankCheckDigit, bankCity, bankCode, bankIdentificationNumber, bankName, bankPostalCode, bankStreetName, bankStreetNumber, bankTransferAccountName, bankTransferAccountNumberMask, bankTransferAccountType, bankTransferType, businessIdentificationCode, city, companyName, country, creditCardAddress1, creditCardAddress2, creditCardCity, creditCardCountry, creditCardExpirationMonth, creditCardExpirationYear, creditCardHolderName, creditCardMaskNumber, creditCardPostalCode, creditCardState, creditCardType, deviceSessionId, email, existingMandate, firstName, IBAN, ipAddress, id, identityNumber, isCompany, lastFailedSaleTransactionDate, lastName, lastTransactionDateTime, lastTransactionStatus, mandateCreationDate, mandateID, mandateReceived, mandateUpdateDate, maxConsecutivePaymentFailures, name, numConsecutiveFailures, paymentMethodId, paymentMethodStatus, paymentRetryWindow, paypalBaid, paypalEmail, paypalPreapprovalKey, paypalType, phone, postalCode, secondTokenId, state, streetName, streetNumber, tokenId, totalNumberOfErrorPayments, totalNumberOfProcessedPayments, type, useDefaultRetryRule, additionalProperties);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class PaymentMethodSnapshotResponse {\n");
    sb.append("    accountId: ").append(toIndentedString(accountId)).append("\n");
    sb.append("    achAbaCode: ").append(toIndentedString(achAbaCode)).append("\n");
    sb.append("    achAccountName: ").append(toIndentedString(achAccountName)).append("\n");
    sb.append("    achAccountNumberMask: ").append(toIndentedString(achAccountNumberMask)).append("\n");
    sb.append("    achAccountType: ").append(toIndentedString(achAccountType)).append("\n");
    sb.append("    achBankName: ").append(toIndentedString(achBankName)).append("\n");
    sb.append("    bankBranchCode: ").append(toIndentedString(bankBranchCode)).append("\n");
    sb.append("    bankCheckDigit: ").append(toIndentedString(bankCheckDigit)).append("\n");
    sb.append("    bankCity: ").append(toIndentedString(bankCity)).append("\n");
    sb.append("    bankCode: ").append(toIndentedString(bankCode)).append("\n");
    sb.append("    bankIdentificationNumber: ").append(toIndentedString(bankIdentificationNumber)).append("\n");
    sb.append("    bankName: ").append(toIndentedString(bankName)).append("\n");
    sb.append("    bankPostalCode: ").append(toIndentedString(bankPostalCode)).append("\n");
    sb.append("    bankStreetName: ").append(toIndentedString(bankStreetName)).append("\n");
    sb.append("    bankStreetNumber: ").append(toIndentedString(bankStreetNumber)).append("\n");
    sb.append("    bankTransferAccountName: ").append(toIndentedString(bankTransferAccountName)).append("\n");
    sb.append("    bankTransferAccountNumberMask: ").append(toIndentedString(bankTransferAccountNumberMask)).append("\n");
    sb.append("    bankTransferAccountType: ").append(toIndentedString(bankTransferAccountType)).append("\n");
    sb.append("    bankTransferType: ").append(toIndentedString(bankTransferType)).append("\n");
    sb.append("    businessIdentificationCode: ").append(toIndentedString(businessIdentificationCode)).append("\n");
    sb.append("    city: ").append(toIndentedString(city)).append("\n");
    sb.append("    companyName: ").append(toIndentedString(companyName)).append("\n");
    sb.append("    country: ").append(toIndentedString(country)).append("\n");
    sb.append("    creditCardAddress1: ").append(toIndentedString(creditCardAddress1)).append("\n");
    sb.append("    creditCardAddress2: ").append(toIndentedString(creditCardAddress2)).append("\n");
    sb.append("    creditCardCity: ").append(toIndentedString(creditCardCity)).append("\n");
    sb.append("    creditCardCountry: ").append(toIndentedString(creditCardCountry)).append("\n");
    sb.append("    creditCardExpirationMonth: ").append(toIndentedString(creditCardExpirationMonth)).append("\n");
    sb.append("    creditCardExpirationYear: ").append(toIndentedString(creditCardExpirationYear)).append("\n");
    sb.append("    creditCardHolderName: ").append(toIndentedString(creditCardHolderName)).append("\n");
    sb.append("    creditCardMaskNumber: ").append(toIndentedString(creditCardMaskNumber)).append("\n");
    sb.append("    creditCardPostalCode: ").append(toIndentedString(creditCardPostalCode)).append("\n");
    sb.append("    creditCardState: ").append(toIndentedString(creditCardState)).append("\n");
    sb.append("    creditCardType: ").append(toIndentedString(creditCardType)).append("\n");
    sb.append("    deviceSessionId: ").append(toIndentedString(deviceSessionId)).append("\n");
    sb.append("    email: ").append(toIndentedString(email)).append("\n");
    sb.append("    existingMandate: ").append(toIndentedString(existingMandate)).append("\n");
    sb.append("    firstName: ").append(toIndentedString(firstName)).append("\n");
    sb.append("    IBAN: ").append(toIndentedString(IBAN)).append("\n");
    sb.append("    ipAddress: ").append(toIndentedString(ipAddress)).append("\n");
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    identityNumber: ").append(toIndentedString(identityNumber)).append("\n");
    sb.append("    isCompany: ").append(toIndentedString(isCompany)).append("\n");
    sb.append("    lastFailedSaleTransactionDate: ").append(toIndentedString(lastFailedSaleTransactionDate)).append("\n");
    sb.append("    lastName: ").append(toIndentedString(lastName)).append("\n");
    sb.append("    lastTransactionDateTime: ").append(toIndentedString(lastTransactionDateTime)).append("\n");
    sb.append("    lastTransactionStatus: ").append(toIndentedString(lastTransactionStatus)).append("\n");
    sb.append("    mandateCreationDate: ").append(toIndentedString(mandateCreationDate)).append("\n");
    sb.append("    mandateID: ").append(toIndentedString(mandateID)).append("\n");
    sb.append("    mandateReceived: ").append(toIndentedString(mandateReceived)).append("\n");
    sb.append("    mandateUpdateDate: ").append(toIndentedString(mandateUpdateDate)).append("\n");
    sb.append("    maxConsecutivePaymentFailures: ").append(toIndentedString(maxConsecutivePaymentFailures)).append("\n");
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    numConsecutiveFailures: ").append(toIndentedString(numConsecutiveFailures)).append("\n");
    sb.append("    paymentMethodId: ").append(toIndentedString(paymentMethodId)).append("\n");
    sb.append("    paymentMethodStatus: ").append(toIndentedString(paymentMethodStatus)).append("\n");
    sb.append("    paymentRetryWindow: ").append(toIndentedString(paymentRetryWindow)).append("\n");
    sb.append("    paypalBaid: ").append(toIndentedString(paypalBaid)).append("\n");
    sb.append("    paypalEmail: ").append(toIndentedString(paypalEmail)).append("\n");
    sb.append("    paypalPreapprovalKey: ").append(toIndentedString(paypalPreapprovalKey)).append("\n");
    sb.append("    paypalType: ").append(toIndentedString(paypalType)).append("\n");
    sb.append("    phone: ").append(toIndentedString(phone)).append("\n");
    sb.append("    postalCode: ").append(toIndentedString(postalCode)).append("\n");
    sb.append("    secondTokenId: ").append(toIndentedString(secondTokenId)).append("\n");
    sb.append("    state: ").append(toIndentedString(state)).append("\n");
    sb.append("    streetName: ").append(toIndentedString(streetName)).append("\n");
    sb.append("    streetNumber: ").append(toIndentedString(streetNumber)).append("\n");
    sb.append("    tokenId: ").append(toIndentedString(tokenId)).append("\n");
    sb.append("    totalNumberOfErrorPayments: ").append(toIndentedString(totalNumberOfErrorPayments)).append("\n");
    sb.append("    totalNumberOfProcessedPayments: ").append(toIndentedString(totalNumberOfProcessedPayments)).append("\n");
    sb.append("    type: ").append(toIndentedString(type)).append("\n");
    sb.append("    useDefaultRetryRule: ").append(toIndentedString(useDefaultRetryRule)).append("\n");
    sb.append("    additionalProperties: ").append(toIndentedString(additionalProperties)).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    ");
  }


  public static HashSet openapiFields;
  public static HashSet openapiRequiredFields;

  static {
    // a set of all properties/fields (JSON key names)
    openapiFields = new HashSet();
    openapiFields.add("AccountId");
    openapiFields.add("AchAbaCode");
    openapiFields.add("AchAccountName");
    openapiFields.add("AchAccountNumberMask");
    openapiFields.add("AchAccountType");
    openapiFields.add("AchBankName");
    openapiFields.add("BankBranchCode");
    openapiFields.add("BankCheckDigit");
    openapiFields.add("BankCity");
    openapiFields.add("BankCode");
    openapiFields.add("BankIdentificationNumber");
    openapiFields.add("BankName");
    openapiFields.add("BankPostalCode");
    openapiFields.add("BankStreetName");
    openapiFields.add("BankStreetNumber");
    openapiFields.add("BankTransferAccountName");
    openapiFields.add("BankTransferAccountNumberMask");
    openapiFields.add("BankTransferAccountType");
    openapiFields.add("BankTransferType");
    openapiFields.add("BusinessIdentificationCode");
    openapiFields.add("City");
    openapiFields.add("CompanyName");
    openapiFields.add("Country");
    openapiFields.add("CreditCardAddress1");
    openapiFields.add("CreditCardAddress2");
    openapiFields.add("CreditCardCity");
    openapiFields.add("CreditCardCountry");
    openapiFields.add("CreditCardExpirationMonth");
    openapiFields.add("CreditCardExpirationYear");
    openapiFields.add("CreditCardHolderName");
    openapiFields.add("CreditCardMaskNumber");
    openapiFields.add("CreditCardPostalCode");
    openapiFields.add("CreditCardState");
    openapiFields.add("CreditCardType");
    openapiFields.add("DeviceSessionId");
    openapiFields.add("Email");
    openapiFields.add("ExistingMandate");
    openapiFields.add("FirstName");
    openapiFields.add("IBAN");
    openapiFields.add("IPAddress");
    openapiFields.add("Id");
    openapiFields.add("IdentityNumber");
    openapiFields.add("IsCompany");
    openapiFields.add("LastFailedSaleTransactionDate");
    openapiFields.add("LastName");
    openapiFields.add("LastTransactionDateTime");
    openapiFields.add("LastTransactionStatus");
    openapiFields.add("MandateCreationDate");
    openapiFields.add("MandateID");
    openapiFields.add("MandateReceived");
    openapiFields.add("MandateUpdateDate");
    openapiFields.add("MaxConsecutivePaymentFailures");
    openapiFields.add("Name");
    openapiFields.add("NumConsecutiveFailures");
    openapiFields.add("PaymentMethodId");
    openapiFields.add("PaymentMethodStatus");
    openapiFields.add("PaymentRetryWindow");
    openapiFields.add("PaypalBaid");
    openapiFields.add("PaypalEmail");
    openapiFields.add("PaypalPreapprovalKey");
    openapiFields.add("PaypalType");
    openapiFields.add("Phone");
    openapiFields.add("PostalCode");
    openapiFields.add("SecondTokenId");
    openapiFields.add("State");
    openapiFields.add("StreetName");
    openapiFields.add("StreetNumber");
    openapiFields.add("TokenId");
    openapiFields.add("TotalNumberOfErrorPayments");
    openapiFields.add("TotalNumberOfProcessedPayments");
    openapiFields.add("Type");
    openapiFields.add("UseDefaultRetryRule");

    // a set of required properties/fields (JSON key names)
    openapiRequiredFields = new HashSet();
  }

  /**
   * Validates the JSON Element and throws an exception if issues found
   *
   * @param jsonElement JSON Element
   * @throws IOException if the JSON Element is invalid with respect to PaymentMethodSnapshotResponse
   */
  public static void validateJsonElement(JsonElement jsonElement) throws IOException {
      if (jsonElement == null) {
        if (!PaymentMethodSnapshotResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
          throw new IllegalArgumentException(String.format("The required field(s) %s in PaymentMethodSnapshotResponse is not found in the empty JSON string", PaymentMethodSnapshotResponse.openapiRequiredFields.toString()));
        }
      }
        JsonObject jsonObj = jsonElement.getAsJsonObject();
      if ((jsonObj.get("AccountId") != null && !jsonObj.get("AccountId").isJsonNull()) && !jsonObj.get("AccountId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `AccountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AccountId").toString()));
      }
      if ((jsonObj.get("AchAbaCode") != null && !jsonObj.get("AchAbaCode").isJsonNull()) && !jsonObj.get("AchAbaCode").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `AchAbaCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AchAbaCode").toString()));
      }
      if ((jsonObj.get("AchAccountName") != null && !jsonObj.get("AchAccountName").isJsonNull()) && !jsonObj.get("AchAccountName").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `AchAccountName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AchAccountName").toString()));
      }
      if ((jsonObj.get("AchAccountNumberMask") != null && !jsonObj.get("AchAccountNumberMask").isJsonNull()) && !jsonObj.get("AchAccountNumberMask").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `AchAccountNumberMask` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AchAccountNumberMask").toString()));
      }
      if ((jsonObj.get("AchAccountType") != null && !jsonObj.get("AchAccountType").isJsonNull()) && !jsonObj.get("AchAccountType").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `AchAccountType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AchAccountType").toString()));
      }
      // validate the optional field `AchAccountType`
      if (jsonObj.get("AchAccountType") != null && !jsonObj.get("AchAccountType").isJsonNull()) {
        GetPaymentMethodSnapshotResponseAchAccountType.validateJsonElement(jsonObj.get("AchAccountType"));
      }
      if ((jsonObj.get("AchBankName") != null && !jsonObj.get("AchBankName").isJsonNull()) && !jsonObj.get("AchBankName").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `AchBankName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AchBankName").toString()));
      }
      if ((jsonObj.get("BankBranchCode") != null && !jsonObj.get("BankBranchCode").isJsonNull()) && !jsonObj.get("BankBranchCode").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `BankBranchCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("BankBranchCode").toString()));
      }
      if ((jsonObj.get("BankCheckDigit") != null && !jsonObj.get("BankCheckDigit").isJsonNull()) && !jsonObj.get("BankCheckDigit").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `BankCheckDigit` to be a primitive type in the JSON string but got `%s`", jsonObj.get("BankCheckDigit").toString()));
      }
      if ((jsonObj.get("BankCity") != null && !jsonObj.get("BankCity").isJsonNull()) && !jsonObj.get("BankCity").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `BankCity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("BankCity").toString()));
      }
      if ((jsonObj.get("BankCode") != null && !jsonObj.get("BankCode").isJsonNull()) && !jsonObj.get("BankCode").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `BankCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("BankCode").toString()));
      }
      if ((jsonObj.get("BankIdentificationNumber") != null && !jsonObj.get("BankIdentificationNumber").isJsonNull()) && !jsonObj.get("BankIdentificationNumber").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `BankIdentificationNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("BankIdentificationNumber").toString()));
      }
      if ((jsonObj.get("BankName") != null && !jsonObj.get("BankName").isJsonNull()) && !jsonObj.get("BankName").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `BankName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("BankName").toString()));
      }
      if ((jsonObj.get("BankPostalCode") != null && !jsonObj.get("BankPostalCode").isJsonNull()) && !jsonObj.get("BankPostalCode").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `BankPostalCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("BankPostalCode").toString()));
      }
      if ((jsonObj.get("BankStreetName") != null && !jsonObj.get("BankStreetName").isJsonNull()) && !jsonObj.get("BankStreetName").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `BankStreetName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("BankStreetName").toString()));
      }
      if ((jsonObj.get("BankStreetNumber") != null && !jsonObj.get("BankStreetNumber").isJsonNull()) && !jsonObj.get("BankStreetNumber").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `BankStreetNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("BankStreetNumber").toString()));
      }
      if ((jsonObj.get("BankTransferAccountName") != null && !jsonObj.get("BankTransferAccountName").isJsonNull()) && !jsonObj.get("BankTransferAccountName").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `BankTransferAccountName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("BankTransferAccountName").toString()));
      }
      if ((jsonObj.get("BankTransferAccountNumberMask") != null && !jsonObj.get("BankTransferAccountNumberMask").isJsonNull()) && !jsonObj.get("BankTransferAccountNumberMask").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `BankTransferAccountNumberMask` to be a primitive type in the JSON string but got `%s`", jsonObj.get("BankTransferAccountNumberMask").toString()));
      }
      if ((jsonObj.get("BankTransferAccountType") != null && !jsonObj.get("BankTransferAccountType").isJsonNull()) && !jsonObj.get("BankTransferAccountType").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `BankTransferAccountType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("BankTransferAccountType").toString()));
      }
      if ((jsonObj.get("BankTransferType") != null && !jsonObj.get("BankTransferType").isJsonNull()) && !jsonObj.get("BankTransferType").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `BankTransferType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("BankTransferType").toString()));
      }
      // validate the optional field `BankTransferType`
      if (jsonObj.get("BankTransferType") != null && !jsonObj.get("BankTransferType").isJsonNull()) {
        GetPaymentMethodSnapshotResponseBankTransferType.validateJsonElement(jsonObj.get("BankTransferType"));
      }
      if ((jsonObj.get("BusinessIdentificationCode") != null && !jsonObj.get("BusinessIdentificationCode").isJsonNull()) && !jsonObj.get("BusinessIdentificationCode").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `BusinessIdentificationCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("BusinessIdentificationCode").toString()));
      }
      if ((jsonObj.get("City") != null && !jsonObj.get("City").isJsonNull()) && !jsonObj.get("City").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `City` to be a primitive type in the JSON string but got `%s`", jsonObj.get("City").toString()));
      }
      if ((jsonObj.get("CompanyName") != null && !jsonObj.get("CompanyName").isJsonNull()) && !jsonObj.get("CompanyName").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `CompanyName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CompanyName").toString()));
      }
      if ((jsonObj.get("Country") != null && !jsonObj.get("Country").isJsonNull()) && !jsonObj.get("Country").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `Country` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Country").toString()));
      }
      if ((jsonObj.get("CreditCardAddress1") != null && !jsonObj.get("CreditCardAddress1").isJsonNull()) && !jsonObj.get("CreditCardAddress1").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `CreditCardAddress1` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CreditCardAddress1").toString()));
      }
      if ((jsonObj.get("CreditCardAddress2") != null && !jsonObj.get("CreditCardAddress2").isJsonNull()) && !jsonObj.get("CreditCardAddress2").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `CreditCardAddress2` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CreditCardAddress2").toString()));
      }
      if ((jsonObj.get("CreditCardCity") != null && !jsonObj.get("CreditCardCity").isJsonNull()) && !jsonObj.get("CreditCardCity").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `CreditCardCity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CreditCardCity").toString()));
      }
      if ((jsonObj.get("CreditCardCountry") != null && !jsonObj.get("CreditCardCountry").isJsonNull()) && !jsonObj.get("CreditCardCountry").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `CreditCardCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CreditCardCountry").toString()));
      }
      if ((jsonObj.get("CreditCardHolderName") != null && !jsonObj.get("CreditCardHolderName").isJsonNull()) && !jsonObj.get("CreditCardHolderName").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `CreditCardHolderName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CreditCardHolderName").toString()));
      }
      if ((jsonObj.get("CreditCardMaskNumber") != null && !jsonObj.get("CreditCardMaskNumber").isJsonNull()) && !jsonObj.get("CreditCardMaskNumber").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `CreditCardMaskNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CreditCardMaskNumber").toString()));
      }
      if ((jsonObj.get("CreditCardPostalCode") != null && !jsonObj.get("CreditCardPostalCode").isJsonNull()) && !jsonObj.get("CreditCardPostalCode").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `CreditCardPostalCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CreditCardPostalCode").toString()));
      }
      if ((jsonObj.get("CreditCardState") != null && !jsonObj.get("CreditCardState").isJsonNull()) && !jsonObj.get("CreditCardState").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `CreditCardState` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CreditCardState").toString()));
      }
      if ((jsonObj.get("CreditCardType") != null && !jsonObj.get("CreditCardType").isJsonNull()) && !jsonObj.get("CreditCardType").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `CreditCardType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CreditCardType").toString()));
      }
      // validate the optional field `CreditCardType`
      if (jsonObj.get("CreditCardType") != null && !jsonObj.get("CreditCardType").isJsonNull()) {
        ProxyGetPaymentMethodSnapshotCreditCardType.validateJsonElement(jsonObj.get("CreditCardType"));
      }
      if ((jsonObj.get("DeviceSessionId") != null && !jsonObj.get("DeviceSessionId").isJsonNull()) && !jsonObj.get("DeviceSessionId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `DeviceSessionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DeviceSessionId").toString()));
      }
      if ((jsonObj.get("Email") != null && !jsonObj.get("Email").isJsonNull()) && !jsonObj.get("Email").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `Email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Email").toString()));
      }
      if ((jsonObj.get("ExistingMandate") != null && !jsonObj.get("ExistingMandate").isJsonNull()) && !jsonObj.get("ExistingMandate").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `ExistingMandate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ExistingMandate").toString()));
      }
      // validate the optional field `ExistingMandate`
      if (jsonObj.get("ExistingMandate") != null && !jsonObj.get("ExistingMandate").isJsonNull()) {
        PaymentMethodMandateInfoMandateStatus.validateJsonElement(jsonObj.get("ExistingMandate"));
      }
      if ((jsonObj.get("FirstName") != null && !jsonObj.get("FirstName").isJsonNull()) && !jsonObj.get("FirstName").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `FirstName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FirstName").toString()));
      }
      if ((jsonObj.get("IBAN") != null && !jsonObj.get("IBAN").isJsonNull()) && !jsonObj.get("IBAN").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `IBAN` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IBAN").toString()));
      }
      if ((jsonObj.get("IPAddress") != null && !jsonObj.get("IPAddress").isJsonNull()) && !jsonObj.get("IPAddress").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `IPAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IPAddress").toString()));
      }
      if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !jsonObj.get("Id").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `Id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Id").toString()));
      }
      if ((jsonObj.get("IdentityNumber") != null && !jsonObj.get("IdentityNumber").isJsonNull()) && !jsonObj.get("IdentityNumber").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `IdentityNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IdentityNumber").toString()));
      }
      if ((jsonObj.get("LastName") != null && !jsonObj.get("LastName").isJsonNull()) && !jsonObj.get("LastName").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `LastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LastName").toString()));
      }
      if ((jsonObj.get("LastTransactionStatus") != null && !jsonObj.get("LastTransactionStatus").isJsonNull()) && !jsonObj.get("LastTransactionStatus").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `LastTransactionStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LastTransactionStatus").toString()));
      }
      if ((jsonObj.get("MandateID") != null && !jsonObj.get("MandateID").isJsonNull()) && !jsonObj.get("MandateID").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `MandateID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("MandateID").toString()));
      }
      if ((jsonObj.get("MandateReceived") != null && !jsonObj.get("MandateReceived").isJsonNull()) && !jsonObj.get("MandateReceived").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `MandateReceived` to be a primitive type in the JSON string but got `%s`", jsonObj.get("MandateReceived").toString()));
      }
      if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !jsonObj.get("Name").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `Name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Name").toString()));
      }
      if ((jsonObj.get("PaymentMethodId") != null && !jsonObj.get("PaymentMethodId").isJsonNull()) && !jsonObj.get("PaymentMethodId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `PaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PaymentMethodId").toString()));
      }
      if ((jsonObj.get("PaymentMethodStatus") != null && !jsonObj.get("PaymentMethodStatus").isJsonNull()) && !jsonObj.get("PaymentMethodStatus").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `PaymentMethodStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PaymentMethodStatus").toString()));
      }
      // validate the optional field `PaymentMethodStatus`
      if (jsonObj.get("PaymentMethodStatus") != null && !jsonObj.get("PaymentMethodStatus").isJsonNull()) {
        GetPaymentMethodSnapshotResponsePaymentMethodStatus.validateJsonElement(jsonObj.get("PaymentMethodStatus"));
      }
      if ((jsonObj.get("PaypalBaid") != null && !jsonObj.get("PaypalBaid").isJsonNull()) && !jsonObj.get("PaypalBaid").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `PaypalBaid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PaypalBaid").toString()));
      }
      if ((jsonObj.get("PaypalEmail") != null && !jsonObj.get("PaypalEmail").isJsonNull()) && !jsonObj.get("PaypalEmail").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `PaypalEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PaypalEmail").toString()));
      }
      if ((jsonObj.get("PaypalPreapprovalKey") != null && !jsonObj.get("PaypalPreapprovalKey").isJsonNull()) && !jsonObj.get("PaypalPreapprovalKey").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `PaypalPreapprovalKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PaypalPreapprovalKey").toString()));
      }
      if ((jsonObj.get("PaypalType") != null && !jsonObj.get("PaypalType").isJsonNull()) && !jsonObj.get("PaypalType").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `PaypalType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PaypalType").toString()));
      }
      // validate the optional field `PaypalType`
      if (jsonObj.get("PaypalType") != null && !jsonObj.get("PaypalType").isJsonNull()) {
        GetPaymentMethodSnapshotResponsePaypalType.validateJsonElement(jsonObj.get("PaypalType"));
      }
      if ((jsonObj.get("Phone") != null && !jsonObj.get("Phone").isJsonNull()) && !jsonObj.get("Phone").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `Phone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Phone").toString()));
      }
      if ((jsonObj.get("PostalCode") != null && !jsonObj.get("PostalCode").isJsonNull()) && !jsonObj.get("PostalCode").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `PostalCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PostalCode").toString()));
      }
      if ((jsonObj.get("SecondTokenId") != null && !jsonObj.get("SecondTokenId").isJsonNull()) && !jsonObj.get("SecondTokenId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `SecondTokenId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SecondTokenId").toString()));
      }
      if ((jsonObj.get("State") != null && !jsonObj.get("State").isJsonNull()) && !jsonObj.get("State").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `State` to be a primitive type in the JSON string but got `%s`", jsonObj.get("State").toString()));
      }
      if ((jsonObj.get("StreetName") != null && !jsonObj.get("StreetName").isJsonNull()) && !jsonObj.get("StreetName").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `StreetName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("StreetName").toString()));
      }
      if ((jsonObj.get("StreetNumber") != null && !jsonObj.get("StreetNumber").isJsonNull()) && !jsonObj.get("StreetNumber").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `StreetNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("StreetNumber").toString()));
      }
      if ((jsonObj.get("TokenId") != null && !jsonObj.get("TokenId").isJsonNull()) && !jsonObj.get("TokenId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `TokenId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TokenId").toString()));
      }
      if ((jsonObj.get("Type") != null && !jsonObj.get("Type").isJsonNull()) && !jsonObj.get("Type").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `Type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Type").toString()));
      }
      // validate the optional field `Type`
      if (jsonObj.get("Type") != null && !jsonObj.get("Type").isJsonNull()) {
        PaymentMethodType.validateJsonElement(jsonObj.get("Type"));
      }
  }

  public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
    @SuppressWarnings("unchecked")
    @Override
    public  TypeAdapter create(Gson gson, TypeToken type) {
       if (!PaymentMethodSnapshotResponse.class.isAssignableFrom(type.getRawType())) {
         return null; // this class only serializes 'PaymentMethodSnapshotResponse' and its subtypes
       }
       final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class);
       final TypeAdapter thisAdapter
                        = gson.getDelegateAdapter(this, TypeToken.get(PaymentMethodSnapshotResponse.class));

       return (TypeAdapter) new TypeAdapter() {
           @Override
           public void write(JsonWriter out, PaymentMethodSnapshotResponse value) throws IOException {
             JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
             obj.remove("additionalProperties");

             // support null values
             out.beginObject();
             Iterator iterator = obj.entrySet().iterator();
             while(iterator.hasNext()) {
                 Map.Entry e = (Map.Entry) iterator.next();
                 out.name((String)e.getKey());
                 elementAdapter.write(out, e.getValue());
             }

             // end

             // serialize additional properties
             if (value.getAdditionalProperties() != null) {
               // support null values
               boolean oldSerializeNulls = out.getSerializeNulls();
               out.setSerializeNulls(true); //force serialize
               // end
               for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
                 if (entry.getValue() instanceof String)
                   obj.addProperty(entry.getKey(), (String) entry.getValue());
                 else if (entry.getValue() instanceof Number)
                   obj.addProperty(entry.getKey(), (Number) entry.getValue());
                 else if (entry.getValue() instanceof Boolean)
                   obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
                 else if (entry.getValue() instanceof Character)
                   obj.addProperty(entry.getKey(), (Character) entry.getValue());
                 else if (entry.getValue() == null)
                    obj.add(entry.getKey(), null);
                 else {
                   JsonElement jsonElement = gson.toJsonTree(entry.getValue());
                   if (jsonElement.isJsonArray()) {
                     obj.add(entry.getKey(), jsonElement.getAsJsonArray());
                   } else {
                     obj.add(entry.getKey(), jsonElement.getAsJsonObject());
                   }
                 }
                 out.name((String)entry.getKey());
                 elementAdapter.write(out, obj.get(entry.getKey()));
               }
               out.setSerializeNulls(oldSerializeNulls); //restore
             }
             out.endObject();

           }

           @Override
           public PaymentMethodSnapshotResponse read(JsonReader in) throws IOException {
             JsonElement jsonElement = elementAdapter.read(in);
             validateJsonElement(jsonElement);
             JsonObject jsonObj = jsonElement.getAsJsonObject();
             // store additional fields in the deserialized instance
             PaymentMethodSnapshotResponse instance = thisAdapter.fromJsonTree(jsonObj);
             for (Map.Entry entry : jsonObj.entrySet()) {
               if (!openapiFields.contains(entry.getKey())) {
                 if (entry.getValue().isJsonPrimitive()) { // primitive type
                   if (entry.getValue().getAsJsonPrimitive().isString())
                     instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
                   else if (entry.getValue().getAsJsonPrimitive().isNumber())
                     instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
                   else if (entry.getValue().getAsJsonPrimitive().isBoolean())
                     instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
                   else
                     throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
                 } else if (entry.getValue().isJsonArray()) {
                     instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
                 } else { // JSON object
                     instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
                 }
               }
             }
             return instance;
           }

       }.nullSafe();
    }
  }

  /**
   * Create an instance of PaymentMethodSnapshotResponse given an JSON string
   *
   * @param jsonString JSON string
   * @return An instance of PaymentMethodSnapshotResponse
   * @throws IOException if the JSON string is invalid with respect to PaymentMethodSnapshotResponse
   */
  public static PaymentMethodSnapshotResponse fromJson(String jsonString) throws IOException {
    return JSON.getGson().fromJson(jsonString, PaymentMethodSnapshotResponse.class);
  }

  /**
   * Convert an instance of PaymentMethodSnapshotResponse to an JSON string
   *
   * @return JSON string
   */
  public String toJson() {
    return JSON.getGson().toJson(this);
  }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy