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

com.adyen.model.management.PaymentMethodResponse Maven / Gradle / Ivy

There is a newer version: 38.1.0
Show newest version
/*
 * 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 java.util.Objects;
import java.util.Map;
import java.util.HashMap;
import com.adyen.model.management.PaginationLinks;
import com.adyen.model.management.PaymentMethod;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.core.JsonProcessingException;


/**
 * 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 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 {
    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_WAP(String.valueOf("alipay_wap")),
    
    AMEX(String.valueOf("amex")),
    
    APPLEPAY(String.valueOf("applepay")),
    
    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")),
    
    CARTEBANCAIRE(String.valueOf("cartebancaire")),
    
    CLEARPAY(String.valueOf("clearpay")),
    
    CLICKTOPAY(String.valueOf("clicktopay")),
    
    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")),
    
    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")),
    
    MAESTRO(String.valueOf("maestro")),
    
    MBWAY(String.valueOf("mbway")),
    
    MC(String.valueOf("mc")),
    
    MCDEBIT(String.valueOf("mcdebit")),
    
    MEALVOUCHER_FR(String.valueOf("mealVoucher_FR")),
    
    MOBILEPAY(String.valueOf("mobilepay")),
    
    MULTIBANCO(String.valueOf("multibanco")),
    
    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")),
    
    PULSE(String.valueOf("pulse")),
    
    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_CREDIT(String.valueOf("up_brazil_credit")),
    
    VALE_REFEICAO(String.valueOf("vale_refeicao")),
    
    VALE_REFEICAO_PREPAID(String.valueOf("vale_refeicao_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 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;
        }
      }
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }
  }

  public static final String JSON_PROPERTY_TYPES_WITH_ERRORS = "typesWithErrors";
  private List 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 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 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 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;
  }

  /**
   * Payment method types with errors.
   *
   * @param typesWithErrors Payment method types with errors.
   * @return the current {@code PaymentMethodResponse} instance, allowing for method chaining
   */
  public PaymentMethodResponse typesWithErrors(List 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;
  }

  /**
   * Payment method types with errors.
   * @return typesWithErrors Payment method types with errors.
   */
  @JsonProperty(JSON_PROPERTY_TYPES_WITH_ERRORS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public List getTypesWithErrors() {
    return typesWithErrors;
  }

  /**
   * Payment method types with errors.
   *
   * @param typesWithErrors Payment method types with errors.
   */
  @JsonProperty(JSON_PROPERTY_TYPES_WITH_ERRORS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setTypesWithErrors(List 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);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy