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

com.adyen.model.management.ModelConfiguration 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.Currency;
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;


/**
 * ModelConfiguration
 */
@JsonPropertyOrder({
  ModelConfiguration.JSON_PROPERTY_BRAND,
  ModelConfiguration.JSON_PROPERTY_COMMERCIAL,
  ModelConfiguration.JSON_PROPERTY_COUNTRY,
  ModelConfiguration.JSON_PROPERTY_CURRENCIES,
  ModelConfiguration.JSON_PROPERTY_SOURCES
})
@JsonTypeName("Configuration")

public class ModelConfiguration {
  public static final String JSON_PROPERTY_BRAND = "brand";
  private String brand;

  public static final String JSON_PROPERTY_COMMERCIAL = "commercial";
  private Boolean commercial;

  public static final String JSON_PROPERTY_COUNTRY = "country";
  private List country;

  public static final String JSON_PROPERTY_CURRENCIES = "currencies";
  private List currencies;

  public static final String JSON_PROPERTY_SOURCES = "sources";
  private List sources;

  public ModelConfiguration() { 
  }

  /**
   * Payment method, like **eftpos_australia** or **mc**. See the [possible values](https://docs.adyen.com/development-resources/paymentmethodvariant#management-api). 
   *
   * @param brand Payment method, like **eftpos_australia** or **mc**. See the [possible values](https://docs.adyen.com/development-resources/paymentmethodvariant#management-api). 
   * @return the current {@code ModelConfiguration} instance, allowing for method chaining
   */
  public ModelConfiguration brand(String brand) {
    this.brand = brand;
    return this;
  }

  /**
   * Payment method, like **eftpos_australia** or **mc**. See the [possible values](https://docs.adyen.com/development-resources/paymentmethodvariant#management-api). 
   * @return brand Payment method, like **eftpos_australia** or **mc**. See the [possible values](https://docs.adyen.com/development-resources/paymentmethodvariant#management-api). 
   */
  @JsonProperty(JSON_PROPERTY_BRAND)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public String getBrand() {
    return brand;
  }

  /**
   * Payment method, like **eftpos_australia** or **mc**. See the [possible values](https://docs.adyen.com/development-resources/paymentmethodvariant#management-api). 
   *
   * @param brand Payment method, like **eftpos_australia** or **mc**. See the [possible values](https://docs.adyen.com/development-resources/paymentmethodvariant#management-api). 
   */
  @JsonProperty(JSON_PROPERTY_BRAND)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setBrand(String brand) {
    this.brand = brand;
  }

  /**
   * Set to **true** to apply surcharges only to commercial/business cards.
   *
   * @param commercial Set to **true** to apply surcharges only to commercial/business cards.
   * @return the current {@code ModelConfiguration} instance, allowing for method chaining
   */
  public ModelConfiguration commercial(Boolean commercial) {
    this.commercial = commercial;
    return this;
  }

  /**
   * Set to **true** to apply surcharges only to commercial/business cards.
   * @return commercial Set to **true** to apply surcharges only to commercial/business cards.
   */
  @JsonProperty(JSON_PROPERTY_COMMERCIAL)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public Boolean getCommercial() {
    return commercial;
  }

  /**
   * Set to **true** to apply surcharges only to commercial/business cards.
   *
   * @param commercial Set to **true** to apply surcharges only to commercial/business cards.
   */
  @JsonProperty(JSON_PROPERTY_COMMERCIAL)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setCommercial(Boolean commercial) {
    this.commercial = commercial;
  }

  /**
   * The country/region of the card issuer. If used, the surcharge settings only apply to the card issued in that country/region.
   *
   * @param country The country/region of the card issuer. If used, the surcharge settings only apply to the card issued in that country/region.
   * @return the current {@code ModelConfiguration} instance, allowing for method chaining
   */
  public ModelConfiguration country(List country) {
    this.country = country;
    return this;
  }

  public ModelConfiguration addCountryItem(String countryItem) {
    if (this.country == null) {
      this.country = new ArrayList<>();
    }
    this.country.add(countryItem);
    return this;
  }

  /**
   * The country/region of the card issuer. If used, the surcharge settings only apply to the card issued in that country/region.
   * @return country The country/region of the card issuer. If used, the surcharge settings only apply to the card issued in that country/region.
   */
  @JsonProperty(JSON_PROPERTY_COUNTRY)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public List getCountry() {
    return country;
  }

  /**
   * The country/region of the card issuer. If used, the surcharge settings only apply to the card issued in that country/region.
   *
   * @param country The country/region of the card issuer. If used, the surcharge settings only apply to the card issued in that country/region.
   */
  @JsonProperty(JSON_PROPERTY_COUNTRY)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setCountry(List country) {
    this.country = country;
  }

  /**
   * Currency and percentage or amount of the surcharge.
   *
   * @param currencies Currency and percentage or amount of the surcharge.
   * @return the current {@code ModelConfiguration} instance, allowing for method chaining
   */
  public ModelConfiguration currencies(List currencies) {
    this.currencies = currencies;
    return this;
  }

  public ModelConfiguration addCurrenciesItem(Currency currenciesItem) {
    if (this.currencies == null) {
      this.currencies = new ArrayList<>();
    }
    this.currencies.add(currenciesItem);
    return this;
  }

  /**
   * Currency and percentage or amount of the surcharge.
   * @return currencies Currency and percentage or amount of the surcharge.
   */
  @JsonProperty(JSON_PROPERTY_CURRENCIES)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public List getCurrencies() {
    return currencies;
  }

  /**
   * Currency and percentage or amount of the surcharge.
   *
   * @param currencies Currency and percentage or amount of the surcharge.
   */
  @JsonProperty(JSON_PROPERTY_CURRENCIES)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setCurrencies(List currencies) {
    this.currencies = currencies;
  }

  /**
   * Funding source. Possible values: * **Credit** * **Debit**
   *
   * @param sources Funding source. Possible values: * **Credit** * **Debit**
   * @return the current {@code ModelConfiguration} instance, allowing for method chaining
   */
  public ModelConfiguration sources(List sources) {
    this.sources = sources;
    return this;
  }

  public ModelConfiguration addSourcesItem(String sourcesItem) {
    if (this.sources == null) {
      this.sources = new ArrayList<>();
    }
    this.sources.add(sourcesItem);
    return this;
  }

  /**
   * Funding source. Possible values: * **Credit** * **Debit**
   * @return sources Funding source. Possible values: * **Credit** * **Debit**
   */
  @JsonProperty(JSON_PROPERTY_SOURCES)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public List getSources() {
    return sources;
  }

  /**
   * Funding source. Possible values: * **Credit** * **Debit**
   *
   * @param sources Funding source. Possible values: * **Credit** * **Debit**
   */
  @JsonProperty(JSON_PROPERTY_SOURCES)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setSources(List sources) {
    this.sources = sources;
  }

  /**
   * Return true if this Configuration object is equal to o.
   */
  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ModelConfiguration configuration = (ModelConfiguration) o;
    return Objects.equals(this.brand, configuration.brand) &&
        Objects.equals(this.commercial, configuration.commercial) &&
        Objects.equals(this.country, configuration.country) &&
        Objects.equals(this.currencies, configuration.currencies) &&
        Objects.equals(this.sources, configuration.sources);
  }

  @Override
  public int hashCode() {
    return Objects.hash(brand, commercial, country, currencies, sources);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ModelConfiguration {\n");
    sb.append("    brand: ").append(toIndentedString(brand)).append("\n");
    sb.append("    commercial: ").append(toIndentedString(commercial)).append("\n");
    sb.append("    country: ").append(toIndentedString(country)).append("\n");
    sb.append("    currencies: ").append(toIndentedString(currencies)).append("\n");
    sb.append("    sources: ").append(toIndentedString(sources)).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 ModelConfiguration given an JSON string
   *
   * @param jsonString JSON string
   * @return An instance of ModelConfiguration
   * @throws JsonProcessingException if the JSON string is invalid with respect to ModelConfiguration
   */
  public static ModelConfiguration fromJson(String jsonString) throws JsonProcessingException {
    return JSON.getMapper().readValue(jsonString, ModelConfiguration.class);
  }
/**
  * Convert an instance of ModelConfiguration to an JSON string
  *
  * @return JSON string
  */
  public String toJson() throws JsonProcessingException {
    return JSON.getMapper().writeValueAsString(this);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy