content: /*
   * Adyen Checkout API
   *
   * The version of the OpenAPI document: 71
   *
   *
   * 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.checkout;
  
  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.HashMap;
  import java.util.List;
  import java.util.Map;
  import java.util.logging.Logger;
  
  /** PaymentMethod */
  @JsonPropertyOrder({
    PaymentMethod.JSON_PROPERTY_APPS,
    PaymentMethod.JSON_PROPERTY_BRAND,
    PaymentMethod.JSON_PROPERTY_BRANDS,
    PaymentMethod.JSON_PROPERTY_CONFIGURATION,
    PaymentMethod.JSON_PROPERTY_FUNDING_SOURCE,
    PaymentMethod.JSON_PROPERTY_GROUP,
    PaymentMethod.JSON_PROPERTY_INPUT_DETAILS,
    PaymentMethod.JSON_PROPERTY_ISSUERS,
    PaymentMethod.JSON_PROPERTY_NAME,
    PaymentMethod.JSON_PROPERTY_PROMOTED,
    PaymentMethod.JSON_PROPERTY_TYPE
  })
  public class PaymentMethod {
    public static final String JSON_PROPERTY_APPS = "apps";
    private List<PaymentMethodUPIApps> apps;
  
    public static final String JSON_PROPERTY_BRAND = "brand";
    private String brand;
  
    public static final String JSON_PROPERTY_BRANDS = "brands";
    private List<String> brands;
  
    public static final String JSON_PROPERTY_CONFIGURATION = "configuration";
    private Map<String, String> configuration;
  
    /** The funding source of the payment method. */
    public enum FundingSourceEnum {
      CREDIT(String.valueOf("credit")),
  
      DEBIT(String.valueOf("debit"));
  
      private static final Logger LOG = Logger.getLogger(FundingSourceEnum.class.getName());
  
      private String value;
  
      FundingSourceEnum(String value) {
        this.value = value;
      }
  
      @JsonValue
      public String getValue() {
        return value;
      }
  
      @Override
      public String toString() {
        return String.valueOf(value);
      }
  
      @JsonCreator
      public static FundingSourceEnum fromValue(String value) {
        for (FundingSourceEnum b : FundingSourceEnum.values()) {
          if (b.value.equals(value)) {
            return b;
          }
        }
        // handling unexpected value
        LOG.warning(
            "FundingSourceEnum: unexpected enum value '"
                + value
                + "' - Supported values are "
                + Arrays.toString(FundingSourceEnum.values()));
        return null;
      }
    }
  
    public static final String JSON_PROPERTY_FUNDING_SOURCE = "fundingSource";
    private FundingSourceEnum fundingSource;
  
    public static final String JSON_PROPERTY_GROUP = "group";
    private PaymentMethodGroup group;
  
    public static final String JSON_PROPERTY_INPUT_DETAILS = "inputDetails";
    @Deprecated // deprecated
    private List<InputDetail> inputDetails;
  
    public static final String JSON_PROPERTY_ISSUERS = "issuers";
    private List<PaymentMethodIssuer> issuers;
  
    public static final String JSON_PROPERTY_NAME = "name";
    private String name;
  
    public static final String JSON_PROPERTY_PROMOTED = "promoted";
    private Boolean promoted;
  
    public static final String JSON_PROPERTY_TYPE = "type";
    private String type;
  
    public PaymentMethod() {}
  
    /**
     * A list of apps for this payment method.
     *
     * @param apps A list of apps for this payment method.
     * @return the current {@code PaymentMethod} instance, allowing for method chaining
     */
    public PaymentMethod apps(List<PaymentMethodUPIApps> apps) {
      this.apps = apps;
      return this;
    }
  
    public PaymentMethod addAppsItem(PaymentMethodUPIApps appsItem) {
      if (this.apps == null) {
        this.apps = new ArrayList<>();
      }
      this.apps.add(appsItem);
      return this;
    }
  
    /**
     * A list of apps for this payment method.
     *
     * @return apps A list of apps for this payment method.
     */
    @JsonProperty(JSON_PROPERTY_APPS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public List<PaymentMethodUPIApps> getApps() {
      return apps;
    }
  
    /**
     * A list of apps for this payment method.
     *
     * @param apps A list of apps for this payment method.
     */
    @JsonProperty(JSON_PROPERTY_APPS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setApps(List<PaymentMethodUPIApps> apps) {
      this.apps = apps;
    }
  
    /**
     * Brand for the selected gift card. For example: plastix, hmclub.
     *
     * @param brand Brand for the selected gift card. For example: plastix, hmclub.
     * @return the current {@code PaymentMethod} instance, allowing for method chaining
     */
    public PaymentMethod brand(String brand) {
      this.brand = brand;
      return this;
    }
  
    /**
     * Brand for the selected gift card. For example: plastix, hmclub.
     *
     * @return brand Brand for the selected gift card. For example: plastix, hmclub.
     */
    @JsonProperty(JSON_PROPERTY_BRAND)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getBrand() {
      return brand;
    }
  
    /**
     * Brand for the selected gift card. For example: plastix, hmclub.
     *
     * @param brand Brand for the selected gift card. For example: plastix, hmclub.
     */
    @JsonProperty(JSON_PROPERTY_BRAND)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setBrand(String brand) {
      this.brand = brand;
    }
  
    /**
     * List of possible brands. For example: visa, mc.
     *
     * @param brands List of possible brands. For example: visa, mc.
     * @return the current {@code PaymentMethod} instance, allowing for method chaining
     */
    public PaymentMethod brands(List<String> brands) {
      this.brands = brands;
      return this;
    }
  
    public PaymentMethod addBrandsItem(String brandsItem) {
      if (this.brands == null) {
        this.brands = new ArrayList<>();
      }
      this.brands.add(brandsItem);
      return this;
    }
  
    /**
     * List of possible brands. For example: visa, mc.
     *
     * @return brands List of possible brands. For example: visa, mc.
     */
    @JsonProperty(JSON_PROPERTY_BRANDS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public List<String> getBrands() {
      return brands;
    }
  
    /**
     * List of possible brands. For example: visa, mc.
     *
     * @param brands List of possible brands. For example: visa, mc.
     */
    @JsonProperty(JSON_PROPERTY_BRANDS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setBrands(List<String> brands) {
      this.brands = brands;
    }
  
    /**
     * The configuration of the payment method.
     *
     * @param configuration The configuration of the payment method.
     * @return the current {@code PaymentMethod} instance, allowing for method chaining
     */
    public PaymentMethod configuration(Map<String, String> configuration) {
      this.configuration = configuration;
      return this;
    }
  
    public PaymentMethod putConfigurationItem(String key, String configurationItem) {
      if (this.configuration == null) {
        this.configuration = new HashMap<>();
      }
      this.configuration.put(key, configurationItem);
      return this;
    }
  
    /**
     * The configuration of the payment method.
     *
     * @return configuration The configuration of the payment method.
     */
    @JsonProperty(JSON_PROPERTY_CONFIGURATION)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public Map<String, String> getConfiguration() {
      return configuration;
    }
  
    /**
     * The configuration of the payment method.
     *
     * @param configuration The configuration of the payment method.
     */
    @JsonProperty(JSON_PROPERTY_CONFIGURATION)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setConfiguration(Map<String, String> configuration) {
      this.configuration = configuration;
    }
  
    /**
     * The funding source of the payment method.
     *
     * @param fundingSource The funding source of the payment method.
     * @return the current {@code PaymentMethod} instance, allowing for method chaining
     */
    public PaymentMethod fundingSource(FundingSourceEnum fundingSource) {
      this.fundingSource = fundingSource;
      return this;
    }
  
    /**
     * The funding source of the payment method.
     *
     * @return fundingSource The funding source of the payment method.
     */
    @JsonProperty(JSON_PROPERTY_FUNDING_SOURCE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public FundingSourceEnum getFundingSource() {
      return fundingSource;
    }
  
    /**
     * The funding source of the payment method.
     *
     * @param fundingSource The funding source of the payment method.
     */
    @JsonProperty(JSON_PROPERTY_FUNDING_SOURCE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setFundingSource(FundingSourceEnum fundingSource) {
      this.fundingSource = fundingSource;
    }
  
    /**
     * group
     *
     * @param group
     * @return the current {@code PaymentMethod} instance, allowing for method chaining
     */
    public PaymentMethod group(PaymentMethodGroup group) {
      this.group = group;
      return this;
    }
  
    /**
     * Get group
     *
     * @return group
     */
    @JsonProperty(JSON_PROPERTY_GROUP)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public PaymentMethodGroup getGroup() {
      return group;
    }
  
    /**
     * group
     *
     * @param group
     */
    @JsonProperty(JSON_PROPERTY_GROUP)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setGroup(PaymentMethodGroup group) {
      this.group = group;
    }
  
    /**
     * All input details to be provided to complete the payment with this payment method.
     *
     * @param inputDetails All input details to be provided to complete the payment with this payment
     *     method.
     * @return the current {@code PaymentMethod} instance, allowing for method chaining
     * @deprecated
     */
    @Deprecated // deprecated
    public PaymentMethod inputDetails(List<InputDetail> inputDetails) {
      this.inputDetails = inputDetails;
      return this;
    }
  
    public PaymentMethod addInputDetailsItem(InputDetail inputDetailsItem) {
      if (this.inputDetails == null) {
        this.inputDetails = new ArrayList<>();
      }
      this.inputDetails.add(inputDetailsItem);
      return this;
    }
  
    /**
     * All input details to be provided to complete the payment with this payment method.
     *
     * @return inputDetails All input details to be provided to complete the payment with this payment
     *     method.
     * @deprecated // deprecated
     */
    @Deprecated // deprecated
    @JsonProperty(JSON_PROPERTY_INPUT_DETAILS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public List<InputDetail> getInputDetails() {
      return inputDetails;
    }
  
    /**
     * All input details to be provided to complete the payment with this payment method.
     *
     * @param inputDetails All input details to be provided to complete the payment with this payment
     *     method.
     * @deprecated
     */
    @Deprecated // deprecated
    @JsonProperty(JSON_PROPERTY_INPUT_DETAILS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setInputDetails(List<InputDetail> inputDetails) {
      this.inputDetails = inputDetails;
    }
  
    /**
     * A list of issuers for this payment method.
     *
     * @param issuers A list of issuers for this payment method.
     * @return the current {@code PaymentMethod} instance, allowing for method chaining
     */
    public PaymentMethod issuers(List<PaymentMethodIssuer> issuers) {
      this.issuers = issuers;
      return this;
    }
  
    public PaymentMethod addIssuersItem(PaymentMethodIssuer issuersItem) {
      if (this.issuers == null) {
        this.issuers = new ArrayList<>();
      }
      this.issuers.add(issuersItem);
      return this;
    }
  
    /**
     * A list of issuers for this payment method.
     *
     * @return issuers A list of issuers for this payment method.
     */
    @JsonProperty(JSON_PROPERTY_ISSUERS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public List<PaymentMethodIssuer> getIssuers() {
      return issuers;
    }
  
    /**
     * A list of issuers for this payment method.
     *
     * @param issuers A list of issuers for this payment method.
     */
    @JsonProperty(JSON_PROPERTY_ISSUERS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setIssuers(List<PaymentMethodIssuer> issuers) {
      this.issuers = issuers;
    }
  
    /**
     * The displayable name of this payment method.
     *
     * @param name The displayable name of this payment method.
     * @return the current {@code PaymentMethod} instance, allowing for method chaining
     */
    public PaymentMethod name(String name) {
      this.name = name;
      return this;
    }
  
    /**
     * The displayable name of this payment method.
     *
     * @return name The displayable name of this payment method.
     */
    @JsonProperty(JSON_PROPERTY_NAME)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getName() {
      return name;
    }
  
    /**
     * The displayable name of this payment method.
     *
     * @param name The displayable name of this payment method.
     */
    @JsonProperty(JSON_PROPERTY_NAME)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setName(String name) {
      this.name = name;
    }
  
    /**
     * Indicates whether this payment method should be promoted or not.
     *
     * @param promoted Indicates whether this payment method should be promoted or not.
     * @return the current {@code PaymentMethod} instance, allowing for method chaining
     */
    public PaymentMethod promoted(Boolean promoted) {
      this.promoted = promoted;
      return this;
    }
  
    /**
     * Indicates whether this payment method should be promoted or not.
     *
     * @return promoted Indicates whether this payment method should be promoted or not.
     */
    @JsonProperty(JSON_PROPERTY_PROMOTED)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public Boolean getPromoted() {
      return promoted;
    }
  
    /**
     * Indicates whether this payment method should be promoted or not.
     *
     * @param promoted Indicates whether this payment method should be promoted or not.
     */
    @JsonProperty(JSON_PROPERTY_PROMOTED)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setPromoted(Boolean promoted) {
      this.promoted = promoted;
    }
  
    /**
     * The unique payment method code.
     *
     * @param type The unique payment method code.
     * @return the current {@code PaymentMethod} instance, allowing for method chaining
     */
    public PaymentMethod type(String type) {
      this.type = type;
      return this;
    }
  
    /**
     * The unique payment method code.
     *
     * @return type The unique payment method code.
     */
    @JsonProperty(JSON_PROPERTY_TYPE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getType() {
      return type;
    }
  
    /**
     * The unique payment method code.
     *
     * @param type The unique payment method code.
     */
    @JsonProperty(JSON_PROPERTY_TYPE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setType(String type) {
      this.type = type;
    }
  
    /** Return true if this PaymentMethod object is equal to o. */
    @Override
    public boolean equals(Object o) {
      if (this == o) {
        return true;
      }
      if (o == null || getClass() != o.getClass()) {
        return false;
      }
      PaymentMethod paymentMethod = (PaymentMethod) o;
      return Objects.equals(this.apps, paymentMethod.apps)
          && Objects.equals(this.brand, paymentMethod.brand)
          && Objects.equals(this.brands, paymentMethod.brands)
          && Objects.equals(this.configuration, paymentMethod.configuration)
          && Objects.equals(this.fundingSource, paymentMethod.fundingSource)
          && Objects.equals(this.group, paymentMethod.group)
          && Objects.equals(this.inputDetails, paymentMethod.inputDetails)
          && Objects.equals(this.issuers, paymentMethod.issuers)
          && Objects.equals(this.name, paymentMethod.name)
          && Objects.equals(this.promoted, paymentMethod.promoted)
          && Objects.equals(this.type, paymentMethod.type);
    }
  
    @Override
    public int hashCode() {
      return Objects.hash(
          apps,
          brand,
          brands,
          configuration,
          fundingSource,
          group,
          inputDetails,
          issuers,
          name,
          promoted,
          type);
    }
  
    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder();
      sb.append("class PaymentMethod {\n");
      sb.append("    apps: ").append(toIndentedString(apps)).append("\n");
      sb.append("    brand: ").append(toIndentedString(brand)).append("\n");
      sb.append("    brands: ").append(toIndentedString(brands)).append("\n");
      sb.append("    configuration: ").append(toIndentedString(configuration)).append("\n");
      sb.append("    fundingSource: ").append(toIndentedString(fundingSource)).append("\n");
      sb.append("    group: ").append(toIndentedString(group)).append("\n");
      sb.append("    inputDetails: ").append(toIndentedString(inputDetails)).append("\n");
      sb.append("    issuers: ").append(toIndentedString(issuers)).append("\n");
      sb.append("    name: ").append(toIndentedString(name)).append("\n");
      sb.append("    promoted: ").append(toIndentedString(promoted)).append("\n");
      sb.append("    type: ").append(toIndentedString(type)).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 PaymentMethod given an JSON string
     *
     * @param jsonString JSON string
     * @return An instance of PaymentMethod
     * @throws JsonProcessingException if the JSON string is invalid with respect to PaymentMethod
     */
    public static PaymentMethod fromJson(String jsonString) throws JsonProcessingException {
      return JSON.getMapper().readValue(jsonString, PaymentMethod.class);
    }
  
    /**
     * Convert an instance of PaymentMethod to an JSON string
     *
     * @return JSON string
     */
    public String toJson() throws JsonProcessingException {
      return JSON.getMapper().writeValueAsString(this);
    }
  }
  