content: /*
   * 支付宝开放平台API
   * 支付宝开放平台v3协议文档
   *
   * The version of the OpenAPI document: 2025-08-26
   * 
   *
   * 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.alipay.v3.model;
  
  import java.util.Objects;
  import java.util.Arrays;
  import com.alipay.v3.model.ItemPromoInfo;
  import com.alipay.v3.model.QuotaInfoDTO;
  import com.google.gson.TypeAdapter;
  import com.google.gson.annotations.JsonAdapter;
  import com.google.gson.annotations.SerializedName;
  import com.google.gson.stream.JsonReader;
  import com.google.gson.stream.JsonWriter;
  import io.swagger.annotations.ApiModel;
  import io.swagger.annotations.ApiModelProperty;
  import java.io.IOException;
  import java.util.ArrayList;
  import java.util.List;
  
  import com.google.gson.Gson;
  import com.google.gson.GsonBuilder;
  import com.google.gson.JsonArray;
  import com.google.gson.JsonDeserializationContext;
  import com.google.gson.JsonDeserializer;
  import com.google.gson.JsonElement;
  import com.google.gson.JsonObject;
  import com.google.gson.JsonParseException;
  import com.google.gson.TypeAdapterFactory;
  import com.google.gson.reflect.TypeToken;
  
  import java.lang.reflect.Type;
  import java.util.HashMap;
  import java.util.HashSet;
  import java.util.Map;
  import java.util.Map.Entry;
  import java.util.Set;
  
  import com.alipay.v3.JSON;
  
  /**
   * VoucherConsultInfo
   */
  @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
  public class VoucherConsultInfo {
    public static final String SERIALIZED_NAME_ACTIVE_TIME = "active_time";
    @SerializedName(SERIALIZED_NAME_ACTIVE_TIME)
    private String activeTime;
  
    public static final String SERIALIZED_NAME_ASSET_TYPE = "asset_type";
    @SerializedName(SERIALIZED_NAME_ASSET_TYPE)
    private String assetType;
  
    public static final String SERIALIZED_NAME_ASSETS_CODE = "assets_code";
    @SerializedName(SERIALIZED_NAME_ASSETS_CODE)
    private String assetsCode;
  
    public static final String SERIALIZED_NAME_CEILING_AMOUNT = "ceiling_amount";
    @SerializedName(SERIALIZED_NAME_CEILING_AMOUNT)
    private String ceilingAmount;
  
    public static final String SERIALIZED_NAME_EXPIRED_TIME = "expired_time";
    @SerializedName(SERIALIZED_NAME_EXPIRED_TIME)
    private String expiredTime;
  
    public static final String SERIALIZED_NAME_ITEM_PROMO_INFO = "item_promo_info";
    @SerializedName(SERIALIZED_NAME_ITEM_PROMO_INFO)
    private ItemPromoInfo itemPromoInfo;
  
    public static final String SERIALIZED_NAME_OPTIMAL = "optimal";
    @SerializedName(SERIALIZED_NAME_OPTIMAL)
    private Boolean optimal;
  
    public static final String SERIALIZED_NAME_PROMO_AMOUNT = "promo_amount";
    @SerializedName(SERIALIZED_NAME_PROMO_AMOUNT)
    private String promoAmount;
  
    public static final String SERIALIZED_NAME_PROMO_TEXT = "promo_text";
    @SerializedName(SERIALIZED_NAME_PROMO_TEXT)
    private String promoText;
  
    public static final String SERIALIZED_NAME_PROMO_TYPE = "promo_type";
    @SerializedName(SERIALIZED_NAME_PROMO_TYPE)
    private String promoType;
  
    public static final String SERIALIZED_NAME_QUOTA_INFO_LIST = "quota_info_list";
    @SerializedName(SERIALIZED_NAME_QUOTA_INFO_LIST)
    private List<QuotaInfoDTO> quotaInfoList = null;
  
    public static final String SERIALIZED_NAME_REDUCTION_AMOUNT = "reduction_amount";
    @SerializedName(SERIALIZED_NAME_REDUCTION_AMOUNT)
    private String reductionAmount;
  
    public static final String SERIALIZED_NAME_REDUCTION_RATIO = "reduction_ratio";
    @SerializedName(SERIALIZED_NAME_REDUCTION_RATIO)
    private String reductionRatio;
  
    public static final String SERIALIZED_NAME_SPECIFIED_AMOUNT = "specified_amount";
    @SerializedName(SERIALIZED_NAME_SPECIFIED_AMOUNT)
    private String specifiedAmount;
  
    public static final String SERIALIZED_NAME_THRESHOLD_AMOUNT = "threshold_amount";
    @SerializedName(SERIALIZED_NAME_THRESHOLD_AMOUNT)
    private String thresholdAmount;
  
    public static final String SERIALIZED_NAME_VOUCHER_ID = "voucher_id";
    @SerializedName(SERIALIZED_NAME_VOUCHER_ID)
    private String voucherId;
  
    public static final String SERIALIZED_NAME_VOUCHER_NAME = "voucher_name";
    @SerializedName(SERIALIZED_NAME_VOUCHER_NAME)
    private String voucherName;
  
    public static final String SERIALIZED_NAME_VOUCHER_TYPE = "voucher_type";
    @SerializedName(SERIALIZED_NAME_VOUCHER_TYPE)
    private String voucherType;
  
    public VoucherConsultInfo() { 
    }
  
    public VoucherConsultInfo activeTime(String activeTime) {
      
      this.activeTime = activeTime;
      return this;
    }
  
     /**
     * 开始时间，立减为活动开始时间，券为券生效时间
     * @return activeTime
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "2025-05-31 19:57:51", value = "开始时间，立减为活动开始时间，券为券生效时间")
  
    public String getActiveTime() {
      return activeTime;
    }
  
  
    public void setActiveTime(String activeTime) {
      this.activeTime = activeTime;
    }
  
  
    public VoucherConsultInfo assetType(String assetType) {
      
      this.assetType = assetType;
      return this;
    }
  
     /**
     * 资产优惠类型，用于区分不同优惠
     * @return assetType
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "DISCOUNT", value = "资产优惠类型，用于区分不同优惠")
  
    public String getAssetType() {
      return assetType;
    }
  
  
    public void setAssetType(String assetType) {
      this.assetType = assetType;
    }
  
  
    public VoucherConsultInfo assetsCode(String assetsCode) {
      
      this.assetsCode = assetsCode;
      return this;
    }
  
     /**
     * 资产编码
     * @return assetsCode
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "ALIPAY_CHANNEL_DISCOUNT", value = "资产编码")
  
    public String getAssetsCode() {
      return assetsCode;
    }
  
  
    public void setAssetsCode(String assetsCode) {
      this.assetsCode = assetsCode;
    }
  
  
    public VoucherConsultInfo ceilingAmount(String ceilingAmount) {
      
      this.ceilingAmount = ceilingAmount;
      return this;
    }
  
     /**
     * 封顶优惠金额，单位为元
     * @return ceilingAmount
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "4.0", value = "封顶优惠金额，单位为元")
  
    public String getCeilingAmount() {
      return ceilingAmount;
    }
  
  
    public void setCeilingAmount(String ceilingAmount) {
      this.ceilingAmount = ceilingAmount;
    }
  
  
    public VoucherConsultInfo expiredTime(String expiredTime) {
      
      this.expiredTime = expiredTime;
      return this;
    }
  
     /**
     * 结束时间，立减为活动结束时间，券为券失效时间
     * @return expiredTime
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "2025-05-31 19:57:51", value = "结束时间，立减为活动结束时间，券为券失效时间")
  
    public String getExpiredTime() {
      return expiredTime;
    }
  
  
    public void setExpiredTime(String expiredTime) {
      this.expiredTime = expiredTime;
    }
  
  
    public VoucherConsultInfo itemPromoInfo(ItemPromoInfo itemPromoInfo) {
      
      this.itemPromoInfo = itemPromoInfo;
      return this;
    }
  
     /**
     * Get itemPromoInfo
     * @return itemPromoInfo
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(value = "")
  
    public ItemPromoInfo getItemPromoInfo() {
      return itemPromoInfo;
    }
  
  
    public void setItemPromoInfo(ItemPromoInfo itemPromoInfo) {
      this.itemPromoInfo = itemPromoInfo;
    }
  
  
    public VoucherConsultInfo optimal(Boolean optimal) {
      
      this.optimal = optimal;
      return this;
    }
  
     /**
     * 是否为可使用的互斥券中最优的（目前返回的记录该值均为true，即可忽略该值判断）
     * @return optimal
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "true", value = "是否为可使用的互斥券中最优的（目前返回的记录该值均为true，即可忽略该值判断）")
  
    public Boolean getOptimal() {
      return optimal;
    }
  
  
    public void setOptimal(Boolean optimal) {
      this.optimal = optimal;
    }
  
  
    public VoucherConsultInfo promoAmount(String promoAmount) {
      
      this.promoAmount = promoAmount;
      return this;
    }
  
     /**
     * 优惠总金额，单位为元
     * @return promoAmount
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "30.00", value = "优惠总金额，单位为元")
  
    public String getPromoAmount() {
      return promoAmount;
    }
  
  
    public void setPromoAmount(String promoAmount) {
      this.promoAmount = promoAmount;
    }
  
  
    public VoucherConsultInfo promoText(String promoText) {
      
      this.promoText = promoText;
      return this;
    }
  
     /**
     * 优惠文案
     * @return promoText
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "大杯拿铁限时享受满10减1", value = "优惠文案")
  
    public String getPromoText() {
      return promoText;
    }
  
  
    public void setPromoText(String promoText) {
      this.promoText = promoText;
    }
  
  
    public VoucherConsultInfo promoType(String promoType) {
      
      this.promoType = promoType;
      return this;
    }
  
     /**
     * 优惠类型： 代金(FIX),折扣(DISCOUNT),减至(SPECIAL，即特价券)
     * @return promoType
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "FIX", value = "优惠类型： 代金(FIX),折扣(DISCOUNT),减至(SPECIAL，即特价券)")
  
    public String getPromoType() {
      return promoType;
    }
  
  
    public void setPromoType(String promoType) {
      this.promoType = promoType;
    }
  
  
    public VoucherConsultInfo quotaInfoList(List<QuotaInfoDTO> quotaInfoList) {
      
      this.quotaInfoList = quotaInfoList;
      return this;
    }
  
    public VoucherConsultInfo addQuotaInfoListItem(QuotaInfoDTO quotaInfoListItem) {
      if (this.quotaInfoList == null) {
        this.quotaInfoList = new ArrayList<>();
      }
      this.quotaInfoList.add(quotaInfoListItem);
      return this;
    }
  
     /**
     * 额度信息
     * @return quotaInfoList
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(value = "额度信息")
  
    public List<QuotaInfoDTO> getQuotaInfoList() {
      return quotaInfoList;
    }
  
  
    public void setQuotaInfoList(List<QuotaInfoDTO> quotaInfoList) {
      this.quotaInfoList = quotaInfoList;
    }
  
  
    public VoucherConsultInfo reductionAmount(String reductionAmount) {
      
      this.reductionAmount = reductionAmount;
      return this;
    }
  
     /**
     * 满减金额，单位为元，仅针对代金券
     * @return reductionAmount
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "2.0", value = "满减金额，单位为元，仅针对代金券")
  
    public String getReductionAmount() {
      return reductionAmount;
    }
  
  
    public void setReductionAmount(String reductionAmount) {
      this.reductionAmount = reductionAmount;
    }
  
  
    public VoucherConsultInfo reductionRatio(String reductionRatio) {
      
      this.reductionRatio = reductionRatio;
      return this;
    }
  
     /**
     * 优惠额度，小数表示，0.7 表示 30% 的折扣
     * @return reductionRatio
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "0.7", value = "优惠额度，小数表示，0.7 表示 30% 的折扣")
  
    public String getReductionRatio() {
      return reductionRatio;
    }
  
  
    public void setReductionRatio(String reductionRatio) {
      this.reductionRatio = reductionRatio;
    }
  
  
    public VoucherConsultInfo specifiedAmount(String specifiedAmount) {
      
      this.specifiedAmount = specifiedAmount;
      return this;
    }
  
     /**
     * 减至金额，单位为元，仅针对减至券
     * @return specifiedAmount
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "32.0", value = "减至金额，单位为元，仅针对减至券")
  
    public String getSpecifiedAmount() {
      return specifiedAmount;
    }
  
  
    public void setSpecifiedAmount(String specifiedAmount) {
      this.specifiedAmount = specifiedAmount;
    }
  
  
    public VoucherConsultInfo thresholdAmount(String thresholdAmount) {
      
      this.thresholdAmount = thresholdAmount;
      return this;
    }
  
     /**
     * 优惠门槛，单位为元（部分券没有门槛金额）
     * @return thresholdAmount
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "120.00", value = "优惠门槛，单位为元（部分券没有门槛金额）")
  
    public String getThresholdAmount() {
      return thresholdAmount;
    }
  
  
    public void setThresholdAmount(String thresholdAmount) {
      this.thresholdAmount = thresholdAmount;
    }
  
  
    public VoucherConsultInfo voucherId(String voucherId) {
      
      this.voucherId = voucherId;
      return this;
    }
  
     /**
     * 券id
     * @return voucherId
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "202010220007300232330005DGEE", value = "券id")
  
    public String getVoucherId() {
      return voucherId;
    }
  
  
    public void setVoucherId(String voucherId) {
      this.voucherId = voucherId;
    }
  
  
    public VoucherConsultInfo voucherName(String voucherName) {
      
      this.voucherName = voucherName;
      return this;
    }
  
     /**
     * 券名称
     * @return voucherName
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "商家全场5折优惠", value = "券名称")
  
    public String getVoucherName() {
      return voucherName;
    }
  
  
    public void setVoucherName(String voucherName) {
      this.voucherName = voucherName;
    }
  
  
    public VoucherConsultInfo voucherType(String voucherType) {
      
      this.voucherType = voucherType;
      return this;
    }
  
     /**
     * 券类型： 1）全场券(ALL) 2）单品券(ITEM)
     * @return voucherType
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "ALL", value = "券类型： 1）全场券(ALL) 2）单品券(ITEM)")
  
    public String getVoucherType() {
      return voucherType;
    }
  
  
    public void setVoucherType(String voucherType) {
      this.voucherType = voucherType;
    }
  
    /**
     * A container for additional, undeclared properties.
     * This is a holder for any undeclared properties as specified with
     * the 'additionalProperties' keyword in the OAS document.
     */
    private Map<String, Object> additionalProperties;
  
    /**
     * Set the additional (undeclared) property with the specified name and value.
     * If the property does not already exist, create it otherwise replace it.
     *
     * @param key name of the property
     * @param value value of the property
     * @return the VoucherConsultInfo instance itself
     */
    public VoucherConsultInfo putAdditionalProperty(String key, Object value) {
      if (this.additionalProperties == null) {
          this.additionalProperties = new HashMap<String, Object>();
      }
      this.additionalProperties.put(key, value);
      return this;
    }
  
    /**
     * Return the additional (undeclared) property.
     *
     * @return a map of objects
     */
    public Map<String, Object> getAdditionalProperties() {
      return additionalProperties;
    }
  
    /**
     * Return the additional (undeclared) property with the specified name.
     *
     * @param key name of the property
     * @return an object
     */
    public Object getAdditionalProperty(String key) {
      if (this.additionalProperties == null) {
          return null;
      }
      return this.additionalProperties.get(key);
    }
  
  
    @Override
    public boolean equals(Object o) {
      if (this == o) {
        return true;
      }
      if (o == null || getClass() != o.getClass()) {
        return false;
      }
      VoucherConsultInfo voucherConsultInfo = (VoucherConsultInfo) o;
      return Objects.equals(this.activeTime, voucherConsultInfo.activeTime) &&
          Objects.equals(this.assetType, voucherConsultInfo.assetType) &&
          Objects.equals(this.assetsCode, voucherConsultInfo.assetsCode) &&
          Objects.equals(this.ceilingAmount, voucherConsultInfo.ceilingAmount) &&
          Objects.equals(this.expiredTime, voucherConsultInfo.expiredTime) &&
          Objects.equals(this.itemPromoInfo, voucherConsultInfo.itemPromoInfo) &&
          Objects.equals(this.optimal, voucherConsultInfo.optimal) &&
          Objects.equals(this.promoAmount, voucherConsultInfo.promoAmount) &&
          Objects.equals(this.promoText, voucherConsultInfo.promoText) &&
          Objects.equals(this.promoType, voucherConsultInfo.promoType) &&
          Objects.equals(this.quotaInfoList, voucherConsultInfo.quotaInfoList) &&
          Objects.equals(this.reductionAmount, voucherConsultInfo.reductionAmount) &&
          Objects.equals(this.reductionRatio, voucherConsultInfo.reductionRatio) &&
          Objects.equals(this.specifiedAmount, voucherConsultInfo.specifiedAmount) &&
          Objects.equals(this.thresholdAmount, voucherConsultInfo.thresholdAmount) &&
          Objects.equals(this.voucherId, voucherConsultInfo.voucherId) &&
          Objects.equals(this.voucherName, voucherConsultInfo.voucherName) &&
          Objects.equals(this.voucherType, voucherConsultInfo.voucherType)&&
          Objects.equals(this.additionalProperties, voucherConsultInfo.additionalProperties);
    }
  
    @Override
    public int hashCode() {
      return Objects.hash(activeTime, assetType, assetsCode, ceilingAmount, expiredTime, itemPromoInfo, optimal, promoAmount, promoText, promoType, quotaInfoList, reductionAmount, reductionRatio, specifiedAmount, thresholdAmount, voucherId, voucherName, voucherType, additionalProperties);
    }
  
    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder();
      sb.append("class VoucherConsultInfo {\n");
      sb.append("    activeTime: ").append(toIndentedString(activeTime)).append("\n");
      sb.append("    assetType: ").append(toIndentedString(assetType)).append("\n");
      sb.append("    assetsCode: ").append(toIndentedString(assetsCode)).append("\n");
      sb.append("    ceilingAmount: ").append(toIndentedString(ceilingAmount)).append("\n");
      sb.append("    expiredTime: ").append(toIndentedString(expiredTime)).append("\n");
      sb.append("    itemPromoInfo: ").append(toIndentedString(itemPromoInfo)).append("\n");
      sb.append("    optimal: ").append(toIndentedString(optimal)).append("\n");
      sb.append("    promoAmount: ").append(toIndentedString(promoAmount)).append("\n");
      sb.append("    promoText: ").append(toIndentedString(promoText)).append("\n");
      sb.append("    promoType: ").append(toIndentedString(promoType)).append("\n");
      sb.append("    quotaInfoList: ").append(toIndentedString(quotaInfoList)).append("\n");
      sb.append("    reductionAmount: ").append(toIndentedString(reductionAmount)).append("\n");
      sb.append("    reductionRatio: ").append(toIndentedString(reductionRatio)).append("\n");
      sb.append("    specifiedAmount: ").append(toIndentedString(specifiedAmount)).append("\n");
      sb.append("    thresholdAmount: ").append(toIndentedString(thresholdAmount)).append("\n");
      sb.append("    voucherId: ").append(toIndentedString(voucherId)).append("\n");
      sb.append("    voucherName: ").append(toIndentedString(voucherName)).append("\n");
      sb.append("    voucherType: ").append(toIndentedString(voucherType)).append("\n");
      sb.append("    additionalProperties: ").append(toIndentedString(additionalProperties)).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    ");
    }
  
  
    public static HashSet<String> openapiFields;
    public static HashSet<String> openapiRequiredFields;
  
    static {
      // a set of all properties/fields (JSON key names)
      openapiFields = new HashSet<String>();
      openapiFields.add("active_time");
      openapiFields.add("asset_type");
      openapiFields.add("assets_code");
      openapiFields.add("ceiling_amount");
      openapiFields.add("expired_time");
      openapiFields.add("item_promo_info");
      openapiFields.add("optimal");
      openapiFields.add("promo_amount");
      openapiFields.add("promo_text");
      openapiFields.add("promo_type");
      openapiFields.add("quota_info_list");
      openapiFields.add("reduction_amount");
      openapiFields.add("reduction_ratio");
      openapiFields.add("specified_amount");
      openapiFields.add("threshold_amount");
      openapiFields.add("voucher_id");
      openapiFields.add("voucher_name");
      openapiFields.add("voucher_type");
  
      // a set of required properties/fields (JSON key names)
      openapiRequiredFields = new HashSet<String>();
    }
  
   /**
    * Validates the JSON Object and throws an exception if issues found
    *
    * @param jsonObj JSON Object
    * @throws IOException if the JSON Object is invalid with respect to VoucherConsultInfo
    */
    public static void validateJsonObject(JsonObject jsonObj) throws IOException {
        if (jsonObj == null) {
          if (VoucherConsultInfo.openapiRequiredFields.isEmpty()) {
            return;
          } else { // has required fields
            throw new IllegalArgumentException(String.format("The required field(s) %s in VoucherConsultInfo is not found in the empty JSON string", VoucherConsultInfo.openapiRequiredFields.toString()));
          }
        }
        if (jsonObj.get("active_time") != null && !jsonObj.get("active_time").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `active_time` to be a primitive type in the JSON string but got `%s`", jsonObj.get("active_time").toString()));
        }
        if (jsonObj.get("asset_type") != null && !jsonObj.get("asset_type").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `asset_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("asset_type").toString()));
        }
        if (jsonObj.get("assets_code") != null && !jsonObj.get("assets_code").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `assets_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("assets_code").toString()));
        }
        if (jsonObj.get("ceiling_amount") != null && !jsonObj.get("ceiling_amount").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `ceiling_amount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ceiling_amount").toString()));
        }
        if (jsonObj.get("expired_time") != null && !jsonObj.get("expired_time").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `expired_time` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expired_time").toString()));
        }
        // validate the optional field `item_promo_info`
        if (jsonObj.getAsJsonObject("item_promo_info") != null) {
          ItemPromoInfo.validateJsonObject(jsonObj.getAsJsonObject("item_promo_info"));
        }
        if (jsonObj.get("promo_amount") != null && !jsonObj.get("promo_amount").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `promo_amount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("promo_amount").toString()));
        }
        if (jsonObj.get("promo_text") != null && !jsonObj.get("promo_text").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `promo_text` to be a primitive type in the JSON string but got `%s`", jsonObj.get("promo_text").toString()));
        }
        if (jsonObj.get("promo_type") != null && !jsonObj.get("promo_type").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `promo_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("promo_type").toString()));
        }
        JsonArray jsonArrayquotaInfoList = jsonObj.getAsJsonArray("quota_info_list");
        if (jsonArrayquotaInfoList != null) {
          // ensure the json data is an array
          if (!jsonObj.get("quota_info_list").isJsonArray()) {
            throw new IllegalArgumentException(String.format("Expected the field `quota_info_list` to be an array in the JSON string but got `%s`", jsonObj.get("quota_info_list").toString()));
          }
  
          // validate the optional field `quota_info_list` (array)
          for (int i = 0; i < jsonArrayquotaInfoList.size(); i++) {
            QuotaInfoDTO.validateJsonObject(jsonArrayquotaInfoList.get(i).getAsJsonObject());
          };
        }
        if (jsonObj.get("reduction_amount") != null && !jsonObj.get("reduction_amount").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `reduction_amount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reduction_amount").toString()));
        }
        if (jsonObj.get("reduction_ratio") != null && !jsonObj.get("reduction_ratio").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `reduction_ratio` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reduction_ratio").toString()));
        }
        if (jsonObj.get("specified_amount") != null && !jsonObj.get("specified_amount").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `specified_amount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("specified_amount").toString()));
        }
        if (jsonObj.get("threshold_amount") != null && !jsonObj.get("threshold_amount").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `threshold_amount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threshold_amount").toString()));
        }
        if (jsonObj.get("voucher_id") != null && !jsonObj.get("voucher_id").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `voucher_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("voucher_id").toString()));
        }
        if (jsonObj.get("voucher_name") != null && !jsonObj.get("voucher_name").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `voucher_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("voucher_name").toString()));
        }
        if (jsonObj.get("voucher_type") != null && !jsonObj.get("voucher_type").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `voucher_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("voucher_type").toString()));
        }
    }
  
    public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
      @SuppressWarnings("unchecked")
      @Override
      public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
         if (!VoucherConsultInfo.class.isAssignableFrom(type.getRawType())) {
           return null; // this class only serializes 'VoucherConsultInfo' and its subtypes
         }
         final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
         final TypeAdapter<VoucherConsultInfo> thisAdapter
                          = gson.getDelegateAdapter(this, TypeToken.get(VoucherConsultInfo.class));
  
         return (TypeAdapter<T>) new TypeAdapter<VoucherConsultInfo>() {
             @Override
             public void write(JsonWriter out, VoucherConsultInfo value) throws IOException {
               JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
               obj.remove("additionalProperties");
               // serialize additonal properties
               if (value.getAdditionalProperties() != null) {
                 for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) {
                   if (entry.getValue() instanceof String)
                     obj.addProperty(entry.getKey(), (String) entry.getValue());
                   else if (entry.getValue() instanceof Number)
                     obj.addProperty(entry.getKey(), (Number) entry.getValue());
                   else if (entry.getValue() instanceof Boolean)
                     obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
                   else if (entry.getValue() instanceof Character)
                     obj.addProperty(entry.getKey(), (Character) entry.getValue());
                   else {
                     obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject());
                   }
                 }
               }
               elementAdapter.write(out, obj);
             }
  
             @Override
             public VoucherConsultInfo read(JsonReader in) throws IOException {
               JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
               validateJsonObject(jsonObj);
               // store additional fields in the deserialized instance
               VoucherConsultInfo instance = thisAdapter.fromJsonTree(jsonObj);
               for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) {
                 if (!openapiFields.contains(entry.getKey())) {
                   if (entry.getValue().isJsonPrimitive()) { // primitive type
                     if (entry.getValue().getAsJsonPrimitive().isString())
                       instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
                     else if (entry.getValue().getAsJsonPrimitive().isNumber())
                       instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
                     else if (entry.getValue().getAsJsonPrimitive().isBoolean())
                       instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
                     else
                       throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
                   } else { // non-primitive type
                     instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
                   }
                 }
               }
               return instance;
             }
  
         }.nullSafe();
      }
    }
  
   /**
    * Create an instance of VoucherConsultInfo given an JSON string
    *
    * @param jsonString JSON string
    * @return An instance of VoucherConsultInfo
    * @throws IOException if the JSON string is invalid with respect to VoucherConsultInfo
    */
    public static VoucherConsultInfo fromJson(String jsonString) throws IOException {
      return JSON.getGson().fromJson(jsonString, VoucherConsultInfo.class);
    }
  
   /**
    * Convert an instance of VoucherConsultInfo to an JSON string
    *
    * @return JSON string
    */
    public String toJson() {
      return JSON.getGson().toJson(this);
    }
  }
  
  