content: /*
   * Management API
   *
   * The version of the OpenAPI document: 3
   *
   *
   * 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.adyen.model.management;
  
  import com.fasterxml.jackson.annotation.JsonCreator;
  import com.fasterxml.jackson.annotation.JsonInclude;
  import com.fasterxml.jackson.annotation.JsonProperty;
  import com.fasterxml.jackson.annotation.JsonPropertyOrder;
  import com.fasterxml.jackson.annotation.JsonValue;
  import com.fasterxml.jackson.core.JsonProcessingException;
  import java.util.*;
  import java.util.ArrayList;
  import java.util.Arrays;
  import java.util.List;
  import java.util.logging.Logger;
  
  /** PaymentMethodResponse */
  @JsonPropertyOrder({
    PaymentMethodResponse.JSON_PROPERTY_LINKS,
    PaymentMethodResponse.JSON_PROPERTY_DATA,
    PaymentMethodResponse.JSON_PROPERTY_ITEMS_TOTAL,
    PaymentMethodResponse.JSON_PROPERTY_PAGES_TOTAL,
    PaymentMethodResponse.JSON_PROPERTY_TYPES_WITH_ERRORS
  })
  public class PaymentMethodResponse {
    public static final String JSON_PROPERTY_LINKS = "_links";
    private PaginationLinks links;
  
    public static final String JSON_PROPERTY_DATA = "data";
    private List<PaymentMethod> data;
  
    public static final String JSON_PROPERTY_ITEMS_TOTAL = "itemsTotal";
    private Integer itemsTotal;
  
    public static final String JSON_PROPERTY_PAGES_TOTAL = "pagesTotal";
    private Integer pagesTotal;
  
    /** Gets or Sets typesWithErrors */
    public enum TypesWithErrorsEnum {
      ABRAPETITE(String.valueOf("abrapetite")),
  
      ABRAPETITE_CREDIT(String.valueOf("abrapetite_credit")),
  
      ABRAPETITE_DEBIT(String.valueOf("abrapetite_debit")),
  
      ABRAPETITE_PREPAID(String.valueOf("abrapetite_prepaid")),
  
      ACCEL(String.valueOf("accel")),
  
      ACH(String.valueOf("ach")),
  
      AFFIRM(String.valueOf("affirm")),
  
      AFTERPAYTOUCH(String.valueOf("afterpaytouch")),
  
      ALELO(String.valueOf("alelo")),
  
      ALIPAY(String.valueOf("alipay")),
  
      ALIPAY_HK(String.valueOf("alipay_hk")),
  
      ALIPAY_PLUS(String.valueOf("alipay_plus")),
  
      ALIPAY_WAP(String.valueOf("alipay_wap")),
  
      AMEX(String.valueOf("amex")),
  
      APPLEPAY(String.valueOf("applepay")),
  
      AVANCARD(String.valueOf("avancard")),
  
      AVANCARD_CREDIT(String.valueOf("avancard_credit")),
  
      AVANCARD_DEBIT(String.valueOf("avancard_debit")),
  
      BANESE_CARD(String.valueOf("banese_card")),
  
      BANESE_CARD_CREDIT(String.valueOf("banese_card_credit")),
  
      BANESE_CARD_DEBIT(String.valueOf("banese_card_debit")),
  
      BANESE_CARD_PREPAID(String.valueOf("banese_card_prepaid")),
  
      BCMC(String.valueOf("bcmc")),
  
      BLIK(String.valueOf("blik")),
  
      BR_SCHEMES(String.valueOf("br_schemes")),
  
      CARTEBANCAIRE(String.valueOf("cartebancaire")),
  
      CLEARPAY(String.valueOf("clearpay")),
  
      CLICKTOPAY(String.valueOf("clicktopay")),
  
      COOPER(String.valueOf("cooper")),
  
      COOPER_CREDIT(String.valueOf("cooper_credit")),
  
      COOPER_DEBIT(String.valueOf("cooper_debit")),
  
      COOPER_FOOD_DEBIT(String.valueOf("cooper_food_debit")),
  
      COOPER_MEAL_DEBIT(String.valueOf("cooper_meal_debit")),
  
      COOPER_PREPAID(String.valueOf("cooper_prepaid")),
  
      COOPER_PRIVATE_CREDIT(String.valueOf("cooper_private_credit")),
  
      COOPER_RETAIL_CREDIT(String.valueOf("cooper_retail_credit")),
  
      CREDTODOS(String.valueOf("credtodos")),
  
      CREDTODOS_PRIVATE_CREDIT(String.valueOf("credtodos_private_credit")),
  
      CREDTODOS_PRIVATE_DEBIT(String.valueOf("credtodos_private_debit")),
  
      CUP(String.valueOf("cup")),
  
      DINERS(String.valueOf("diners")),
  
      DIRECTDEBIT_GB(String.valueOf("directdebit_GB")),
  
      DISCOVER(String.valueOf("discover")),
  
      EBANKING_FI(String.valueOf("ebanking_FI")),
  
      EFT_DIRECTDEBIT_CA(String.valueOf("eft_directdebit_CA")),
  
      EFTPOS_AUSTRALIA(String.valueOf("eftpos_australia")),
  
      ELO(String.valueOf("elo")),
  
      ELOCREDIT(String.valueOf("elocredit")),
  
      ELODEBIT(String.valueOf("elodebit")),
  
      GIROCARD(String.valueOf("girocard")),
  
      GOOGLEPAY(String.valueOf("googlepay")),
  
      GREEN_CARD(String.valueOf("green_card")),
  
      GREEN_CARD_CREDIT(String.valueOf("green_card_credit")),
  
      GREEN_CARD_DEBIT(String.valueOf("green_card_debit")),
  
      GREEN_CARD_FOOD_PREPAID(String.valueOf("green_card_food_prepaid")),
  
      GREEN_CARD_MEAL_PREPAID(String.valueOf("green_card_meal_prepaid")),
  
      GREEN_CARD_PREPAID(String.valueOf("green_card_prepaid")),
  
      HIPER(String.valueOf("hiper")),
  
      HIPERCARD(String.valueOf("hipercard")),
  
      IDEAL(String.valueOf("ideal")),
  
      INTERAC_CARD(String.valueOf("interac_card")),
  
      JCB(String.valueOf("jcb")),
  
      KLARNA(String.valueOf("klarna")),
  
      KLARNA_ACCOUNT(String.valueOf("klarna_account")),
  
      KLARNA_PAYNOW(String.valueOf("klarna_paynow")),
  
      LE_CARD(String.valueOf("le_card")),
  
      LE_CARD_CREDIT(String.valueOf("le_card_credit")),
  
      LE_CARD_DEBIT(String.valueOf("le_card_debit")),
  
      MAESTRO(String.valueOf("maestro")),
  
      MAESTRO_USA(String.valueOf("maestro_usa")),
  
      MAXIFROTA(String.valueOf("maxifrota")),
  
      MAXIFROTA_PREPAID(String.valueOf("maxifrota_prepaid")),
  
      MBWAY(String.valueOf("mbway")),
  
      MC(String.valueOf("mc")),
  
      MCDEBIT(String.valueOf("mcdebit")),
  
      MEALVOUCHER_FR(String.valueOf("mealVoucher_FR")),
  
      MEGALEVE(String.valueOf("megaleve")),
  
      MEGALEVE_CREDIT(String.valueOf("megaleve_credit")),
  
      MEGALEVE_DEBIT(String.valueOf("megaleve_debit")),
  
      MOBILEPAY(String.valueOf("mobilepay")),
  
      MULTIBANCO(String.valueOf("multibanco")),
  
      NUTRICASH(String.valueOf("nutricash")),
  
      NUTRICASH_PREPAID(String.valueOf("nutricash_prepaid")),
  
      NYCE(String.valueOf("nyce")),
  
      ONLINEBANKING_PL(String.valueOf("onlineBanking_PL")),
  
      PAYBYBANK(String.valueOf("paybybank")),
  
      PAYBYBANK_PLAID(String.valueOf("paybybank_plaid")),
  
      PAYME(String.valueOf("payme")),
  
      PAYME_POS(String.valueOf("payme_pos")),
  
      PAYNOW(String.valueOf("paynow")),
  
      PAYNOW_POS(String.valueOf("paynow_pos")),
  
      PAYPAL(String.valueOf("paypal")),
  
      PAYTO(String.valueOf("payto")),
  
      PERSONAL_CARD(String.valueOf("personal_card")),
  
      PERSONAL_CARD_CREDIT(String.valueOf("personal_card_credit")),
  
      PERSONAL_CARD_DEBIT(String.valueOf("personal_card_debit")),
  
      PULSE(String.valueOf("pulse")),
  
      ROMCARD(String.valueOf("romcard")),
  
      ROMCARD_CREDIT(String.valueOf("romcard_credit")),
  
      ROMCARD_DEBIT(String.valueOf("romcard_debit")),
  
      SENFF(String.valueOf("senff")),
  
      SENFF_CREDIT(String.valueOf("senff_credit")),
  
      SEPADIRECTDEBIT(String.valueOf("sepadirectdebit")),
  
      SODEXO(String.valueOf("sodexo")),
  
      STAR(String.valueOf("star")),
  
      SWISH(String.valueOf("swish")),
  
      TICKET(String.valueOf("ticket")),
  
      TODO_GIFTCARD(String.valueOf("todo_giftcard")),
  
      TRUSTLY(String.valueOf("trustly")),
  
      TWINT(String.valueOf("twint")),
  
      TWINT_POS(String.valueOf("twint_pos")),
  
      UP_BRAZIL(String.valueOf("up_brazil")),
  
      UP_BRAZIL_CREDIT(String.valueOf("up_brazil_credit")),
  
      UP_BRAZIL_DEBIT(String.valueOf("up_brazil_debit")),
  
      UP_BRAZIL_PREPAID(String.valueOf("up_brazil_prepaid")),
  
      VALE_REFEICAO(String.valueOf("vale_refeicao")),
  
      VALE_REFEICAO_PREPAID(String.valueOf("vale_refeicao_prepaid")),
  
      VEGAS_CARD(String.valueOf("vegas_card")),
  
      VEGAS_CARD_CREDIT(String.valueOf("vegas_card_credit")),
  
      VEGAS_CARD_DEBIT(String.valueOf("vegas_card_debit")),
  
      VERO_CARD(String.valueOf("vero_card")),
  
      VERO_CARD_CREDIT(String.valueOf("vero_card_credit")),
  
      VERO_CARD_DEBIT(String.valueOf("vero_card_debit")),
  
      VERO_CARD_PREPAID(String.valueOf("vero_card_prepaid")),
  
      VIPPS(String.valueOf("vipps")),
  
      VISA(String.valueOf("visa")),
  
      VISADEBIT(String.valueOf("visadebit")),
  
      VPAY(String.valueOf("vpay")),
  
      WECHATPAY(String.valueOf("wechatpay")),
  
      WECHATPAY_POS(String.valueOf("wechatpay_pos"));
  
      private static final Logger LOG = Logger.getLogger(TypesWithErrorsEnum.class.getName());
  
      private String value;
  
      TypesWithErrorsEnum(String value) {
        this.value = value;
      }
  
      @JsonValue
      public String getValue() {
        return value;
      }
  
      @Override
      public String toString() {
        return String.valueOf(value);
      }
  
      @JsonCreator
      public static TypesWithErrorsEnum fromValue(String value) {
        for (TypesWithErrorsEnum b : TypesWithErrorsEnum.values()) {
          if (b.value.equals(value)) {
            return b;
          }
        }
        // handling unexpected value
        LOG.warning(
            "TypesWithErrorsEnum: unexpected enum value '"
                + value
                + "' - Supported values are "
                + Arrays.toString(TypesWithErrorsEnum.values()));
        return null;
      }
    }
  
    public static final String JSON_PROPERTY_TYPES_WITH_ERRORS = "typesWithErrors";
    private List<TypesWithErrorsEnum> typesWithErrors;
  
    public PaymentMethodResponse() {}
  
    /**
     * links
     *
     * @param links
     * @return the current {@code PaymentMethodResponse} instance, allowing for method chaining
     */
    public PaymentMethodResponse links(PaginationLinks links) {
      this.links = links;
      return this;
    }
  
    /**
     * Get links
     *
     * @return links
     */
    @JsonProperty(JSON_PROPERTY_LINKS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public PaginationLinks getLinks() {
      return links;
    }
  
    /**
     * links
     *
     * @param links
     */
    @JsonProperty(JSON_PROPERTY_LINKS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setLinks(PaginationLinks links) {
      this.links = links;
    }
  
    /**
     * The list of supported payment methods and their details.
     *
     * @param data The list of supported payment methods and their details.
     * @return the current {@code PaymentMethodResponse} instance, allowing for method chaining
     */
    public PaymentMethodResponse data(List<PaymentMethod> data) {
      this.data = data;
      return this;
    }
  
    public PaymentMethodResponse addDataItem(PaymentMethod dataItem) {
      if (this.data == null) {
        this.data = new ArrayList<>();
      }
      this.data.add(dataItem);
      return this;
    }
  
    /**
     * The list of supported payment methods and their details.
     *
     * @return data The list of supported payment methods and their details.
     */
    @JsonProperty(JSON_PROPERTY_DATA)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public List<PaymentMethod> getData() {
      return data;
    }
  
    /**
     * The list of supported payment methods and their details.
     *
     * @param data The list of supported payment methods and their details.
     */
    @JsonProperty(JSON_PROPERTY_DATA)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setData(List<PaymentMethod> data) {
      this.data = data;
    }
  
    /**
     * Total number of items.
     *
     * @param itemsTotal Total number of items.
     * @return the current {@code PaymentMethodResponse} instance, allowing for method chaining
     */
    public PaymentMethodResponse itemsTotal(Integer itemsTotal) {
      this.itemsTotal = itemsTotal;
      return this;
    }
  
    /**
     * Total number of items.
     *
     * @return itemsTotal Total number of items.
     */
    @JsonProperty(JSON_PROPERTY_ITEMS_TOTAL)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public Integer getItemsTotal() {
      return itemsTotal;
    }
  
    /**
     * Total number of items.
     *
     * @param itemsTotal Total number of items.
     */
    @JsonProperty(JSON_PROPERTY_ITEMS_TOTAL)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setItemsTotal(Integer itemsTotal) {
      this.itemsTotal = itemsTotal;
    }
  
    /**
     * Total number of pages.
     *
     * @param pagesTotal Total number of pages.
     * @return the current {@code PaymentMethodResponse} instance, allowing for method chaining
     */
    public PaymentMethodResponse pagesTotal(Integer pagesTotal) {
      this.pagesTotal = pagesTotal;
      return this;
    }
  
    /**
     * Total number of pages.
     *
     * @return pagesTotal Total number of pages.
     */
    @JsonProperty(JSON_PROPERTY_PAGES_TOTAL)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public Integer getPagesTotal() {
      return pagesTotal;
    }
  
    /**
     * Total number of pages.
     *
     * @param pagesTotal Total number of pages.
     */
    @JsonProperty(JSON_PROPERTY_PAGES_TOTAL)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setPagesTotal(Integer pagesTotal) {
      this.pagesTotal = pagesTotal;
    }
  
    /**
     * The payment method types that were not successfully requested and their corresponding errors.
     *
     * @param typesWithErrors The payment method types that were not successfully requested and their
     *     corresponding errors.
     * @return the current {@code PaymentMethodResponse} instance, allowing for method chaining
     */
    public PaymentMethodResponse typesWithErrors(List<TypesWithErrorsEnum> typesWithErrors) {
      this.typesWithErrors = typesWithErrors;
      return this;
    }
  
    public PaymentMethodResponse addTypesWithErrorsItem(TypesWithErrorsEnum typesWithErrorsItem) {
      if (this.typesWithErrors == null) {
        this.typesWithErrors = new ArrayList<>();
      }
      this.typesWithErrors.add(typesWithErrorsItem);
      return this;
    }
  
    /**
     * The payment method types that were not successfully requested and their corresponding errors.
     *
     * @return typesWithErrors The payment method types that were not successfully requested and their
     *     corresponding errors.
     */
    @JsonProperty(JSON_PROPERTY_TYPES_WITH_ERRORS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public List<TypesWithErrorsEnum> getTypesWithErrors() {
      return typesWithErrors;
    }
  
    /**
     * The payment method types that were not successfully requested and their corresponding errors.
     *
     * @param typesWithErrors The payment method types that were not successfully requested and their
     *     corresponding errors.
     */
    @JsonProperty(JSON_PROPERTY_TYPES_WITH_ERRORS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setTypesWithErrors(List<TypesWithErrorsEnum> typesWithErrors) {
      this.typesWithErrors = typesWithErrors;
    }
  
    /** Return true if this PaymentMethodResponse object is equal to o. */
    @Override
    public boolean equals(Object o) {
      if (this == o) {
        return true;
      }
      if (o == null || getClass() != o.getClass()) {
        return false;
      }
      PaymentMethodResponse paymentMethodResponse = (PaymentMethodResponse) o;
      return Objects.equals(this.links, paymentMethodResponse.links)
          && Objects.equals(this.data, paymentMethodResponse.data)
          && Objects.equals(this.itemsTotal, paymentMethodResponse.itemsTotal)
          && Objects.equals(this.pagesTotal, paymentMethodResponse.pagesTotal)
          && Objects.equals(this.typesWithErrors, paymentMethodResponse.typesWithErrors);
    }
  
    @Override
    public int hashCode() {
      return Objects.hash(links, data, itemsTotal, pagesTotal, typesWithErrors);
    }
  
    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder();
      sb.append("class PaymentMethodResponse {\n");
      sb.append("    links: ").append(toIndentedString(links)).append("\n");
      sb.append("    data: ").append(toIndentedString(data)).append("\n");
      sb.append("    itemsTotal: ").append(toIndentedString(itemsTotal)).append("\n");
      sb.append("    pagesTotal: ").append(toIndentedString(pagesTotal)).append("\n");
      sb.append("    typesWithErrors: ").append(toIndentedString(typesWithErrors)).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    ");
    }
  
    /**
     * Create an instance of PaymentMethodResponse given an JSON string
     *
     * @param jsonString JSON string
     * @return An instance of PaymentMethodResponse
     * @throws JsonProcessingException if the JSON string is invalid with respect to
     *     PaymentMethodResponse
     */
    public static PaymentMethodResponse fromJson(String jsonString) throws JsonProcessingException {
      return JSON.getMapper().readValue(jsonString, PaymentMethodResponse.class);
    }
  
    /**
     * Convert an instance of PaymentMethodResponse to an JSON string
     *
     * @return JSON string
     */
    public String toJson() throws JsonProcessingException {
      return JSON.getMapper().writeValueAsString(this);
    }
  }
  