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.JsonInclude;
  import com.fasterxml.jackson.annotation.JsonProperty;
  import com.fasterxml.jackson.annotation.JsonPropertyOrder;
  import com.fasterxml.jackson.core.JsonProcessingException;
  import java.util.*;
  import java.util.ArrayList;
  import java.util.HashMap;
  import java.util.List;
  import java.util.Map;
  
  /** SubInputDetail */
  @JsonPropertyOrder({
    SubInputDetail.JSON_PROPERTY_CONFIGURATION,
    SubInputDetail.JSON_PROPERTY_ITEMS,
    SubInputDetail.JSON_PROPERTY_KEY,
    SubInputDetail.JSON_PROPERTY_OPTIONAL,
    SubInputDetail.JSON_PROPERTY_TYPE,
    SubInputDetail.JSON_PROPERTY_VALUE
  })
  public class SubInputDetail {
    public static final String JSON_PROPERTY_CONFIGURATION = "configuration";
    private Map<String, String> configuration;
  
    public static final String JSON_PROPERTY_ITEMS = "items";
    private List<Item> items;
  
    public static final String JSON_PROPERTY_KEY = "key";
    private String key;
  
    public static final String JSON_PROPERTY_OPTIONAL = "optional";
    private Boolean optional;
  
    public static final String JSON_PROPERTY_TYPE = "type";
    private String type;
  
    public static final String JSON_PROPERTY_VALUE = "value";
    private String value;
  
    public SubInputDetail() {}
  
    /**
     * Configuration parameters for the required input.
     *
     * @param configuration Configuration parameters for the required input.
     * @return the current {@code SubInputDetail} instance, allowing for method chaining
     */
    public SubInputDetail configuration(Map<String, String> configuration) {
      this.configuration = configuration;
      return this;
    }
  
    public SubInputDetail putConfigurationItem(String key, String configurationItem) {
      if (this.configuration == null) {
        this.configuration = new HashMap<>();
      }
      this.configuration.put(key, configurationItem);
      return this;
    }
  
    /**
     * Configuration parameters for the required input.
     *
     * @return configuration Configuration parameters for the required input.
     */
    @JsonProperty(JSON_PROPERTY_CONFIGURATION)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public Map<String, String> getConfiguration() {
      return configuration;
    }
  
    /**
     * Configuration parameters for the required input.
     *
     * @param configuration Configuration parameters for the required input.
     */
    @JsonProperty(JSON_PROPERTY_CONFIGURATION)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setConfiguration(Map<String, String> configuration) {
      this.configuration = configuration;
    }
  
    /**
     * In case of a select, the items to choose from.
     *
     * @param items In case of a select, the items to choose from.
     * @return the current {@code SubInputDetail} instance, allowing for method chaining
     */
    public SubInputDetail items(List<Item> items) {
      this.items = items;
      return this;
    }
  
    public SubInputDetail addItemsItem(Item itemsItem) {
      if (this.items == null) {
        this.items = new ArrayList<>();
      }
      this.items.add(itemsItem);
      return this;
    }
  
    /**
     * In case of a select, the items to choose from.
     *
     * @return items In case of a select, the items to choose from.
     */
    @JsonProperty(JSON_PROPERTY_ITEMS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public List<Item> getItems() {
      return items;
    }
  
    /**
     * In case of a select, the items to choose from.
     *
     * @param items In case of a select, the items to choose from.
     */
    @JsonProperty(JSON_PROPERTY_ITEMS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setItems(List<Item> items) {
      this.items = items;
    }
  
    /**
     * The value to provide in the result.
     *
     * @param key The value to provide in the result.
     * @return the current {@code SubInputDetail} instance, allowing for method chaining
     */
    public SubInputDetail key(String key) {
      this.key = key;
      return this;
    }
  
    /**
     * The value to provide in the result.
     *
     * @return key The value to provide in the result.
     */
    @JsonProperty(JSON_PROPERTY_KEY)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getKey() {
      return key;
    }
  
    /**
     * The value to provide in the result.
     *
     * @param key The value to provide in the result.
     */
    @JsonProperty(JSON_PROPERTY_KEY)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setKey(String key) {
      this.key = key;
    }
  
    /**
     * True if this input is optional to provide.
     *
     * @param optional True if this input is optional to provide.
     * @return the current {@code SubInputDetail} instance, allowing for method chaining
     */
    public SubInputDetail optional(Boolean optional) {
      this.optional = optional;
      return this;
    }
  
    /**
     * True if this input is optional to provide.
     *
     * @return optional True if this input is optional to provide.
     */
    @JsonProperty(JSON_PROPERTY_OPTIONAL)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public Boolean getOptional() {
      return optional;
    }
  
    /**
     * True if this input is optional to provide.
     *
     * @param optional True if this input is optional to provide.
     */
    @JsonProperty(JSON_PROPERTY_OPTIONAL)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setOptional(Boolean optional) {
      this.optional = optional;
    }
  
    /**
     * The type of the required input.
     *
     * @param type The type of the required input.
     * @return the current {@code SubInputDetail} instance, allowing for method chaining
     */
    public SubInputDetail type(String type) {
      this.type = type;
      return this;
    }
  
    /**
     * The type of the required input.
     *
     * @return type The type of the required input.
     */
    @JsonProperty(JSON_PROPERTY_TYPE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getType() {
      return type;
    }
  
    /**
     * The type of the required input.
     *
     * @param type The type of the required input.
     */
    @JsonProperty(JSON_PROPERTY_TYPE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setType(String type) {
      this.type = type;
    }
  
    /**
     * The value can be pre-filled, if available.
     *
     * @param value The value can be pre-filled, if available.
     * @return the current {@code SubInputDetail} instance, allowing for method chaining
     */
    public SubInputDetail value(String value) {
      this.value = value;
      return this;
    }
  
    /**
     * The value can be pre-filled, if available.
     *
     * @return value The value can be pre-filled, if available.
     */
    @JsonProperty(JSON_PROPERTY_VALUE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getValue() {
      return value;
    }
  
    /**
     * The value can be pre-filled, if available.
     *
     * @param value The value can be pre-filled, if available.
     */
    @JsonProperty(JSON_PROPERTY_VALUE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setValue(String value) {
      this.value = value;
    }
  
    /** Return true if this SubInputDetail object is equal to o. */
    @Override
    public boolean equals(Object o) {
      if (this == o) {
        return true;
      }
      if (o == null || getClass() != o.getClass()) {
        return false;
      }
      SubInputDetail subInputDetail = (SubInputDetail) o;
      return Objects.equals(this.configuration, subInputDetail.configuration)
          && Objects.equals(this.items, subInputDetail.items)
          && Objects.equals(this.key, subInputDetail.key)
          && Objects.equals(this.optional, subInputDetail.optional)
          && Objects.equals(this.type, subInputDetail.type)
          && Objects.equals(this.value, subInputDetail.value);
    }
  
    @Override
    public int hashCode() {
      return Objects.hash(configuration, items, key, optional, type, value);
    }
  
    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder();
      sb.append("class SubInputDetail {\n");
      sb.append("    configuration: ").append(toIndentedString(configuration)).append("\n");
      sb.append("    items: ").append(toIndentedString(items)).append("\n");
      sb.append("    key: ").append(toIndentedString(key)).append("\n");
      sb.append("    optional: ").append(toIndentedString(optional)).append("\n");
      sb.append("    type: ").append(toIndentedString(type)).append("\n");
      sb.append("    value: ").append(toIndentedString(value)).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 SubInputDetail given an JSON string
     *
     * @param jsonString JSON string
     * @return An instance of SubInputDetail
     * @throws JsonProcessingException if the JSON string is invalid with respect to SubInputDetail
     */
    public static SubInputDetail fromJson(String jsonString) throws JsonProcessingException {
      return JSON.getMapper().readValue(jsonString, SubInputDetail.class);
    }
  
    /**
     * Convert an instance of SubInputDetail to an JSON string
     *
     * @return JSON string
     */
    public String toJson() throws JsonProcessingException {
      return JSON.getMapper().writeValueAsString(this);
    }
  }
  