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

com.alipay.v3.model.AlipayMarketingCampaignCashTriggerResponseModel Maven / Gradle / Ivy

There is a newer version: 3.1.6.ALL
Show newest version
/*
 * 支付宝开放平台API
 * 支付宝开放平台v3协议文档
 *
 * The version of the OpenAPI document: 2024-01-12
 * 
 *
 * 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.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 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;

/**
 * AlipayMarketingCampaignCashTriggerResponseModel
 */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class AlipayMarketingCampaignCashTriggerResponseModel {
  public static final String SERIALIZED_NAME_BIZ_NO = "biz_no";
  @SerializedName(SERIALIZED_NAME_BIZ_NO)
  private String bizNo;

  public static final String SERIALIZED_NAME_COUPON_NAME = "coupon_name";
  @SerializedName(SERIALIZED_NAME_COUPON_NAME)
  private String couponName;

  public static final String SERIALIZED_NAME_ERROR_MSG = "error_msg";
  @SerializedName(SERIALIZED_NAME_ERROR_MSG)
  private String errorMsg;

  public static final String SERIALIZED_NAME_MERCHANT_LOGO = "merchant_logo";
  @SerializedName(SERIALIZED_NAME_MERCHANT_LOGO)
  private String merchantLogo;

  public static final String SERIALIZED_NAME_OUT_BIZ_NO = "out_biz_no";
  @SerializedName(SERIALIZED_NAME_OUT_BIZ_NO)
  private String outBizNo;

  public static final String SERIALIZED_NAME_PARTNER_ID = "partner_id";
  @SerializedName(SERIALIZED_NAME_PARTNER_ID)
  private String partnerId;

  public static final String SERIALIZED_NAME_PRIZE_AMOUNT = "prize_amount";
  @SerializedName(SERIALIZED_NAME_PRIZE_AMOUNT)
  private String prizeAmount;

  public static final String SERIALIZED_NAME_PRIZE_MSG = "prize_msg";
  @SerializedName(SERIALIZED_NAME_PRIZE_MSG)
  private String prizeMsg;

  public static final String SERIALIZED_NAME_REPEAT_TRIGGER_FLAG = "repeat_trigger_flag";
  @SerializedName(SERIALIZED_NAME_REPEAT_TRIGGER_FLAG)
  private String repeatTriggerFlag;

  public static final String SERIALIZED_NAME_TRIGGER_RESULT = "trigger_result";
  @SerializedName(SERIALIZED_NAME_TRIGGER_RESULT)
  private String triggerResult;

  public AlipayMarketingCampaignCashTriggerResponseModel() { 
  }

  public AlipayMarketingCampaignCashTriggerResponseModel bizNo(String bizNo) {
    
    this.bizNo = bizNo;
    return this;
  }

   /**
   * 支付宝业务号,发奖成功时返回,调用者可提供此字符串进行问题排查与核对等
   * @return bizNo
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "20170117110070001502640004976114", value = "支付宝业务号,发奖成功时返回,调用者可提供此字符串进行问题排查与核对等")

  public String getBizNo() {
    return bizNo;
  }


  public void setBizNo(String bizNo) {
    this.bizNo = bizNo;
  }


  public AlipayMarketingCampaignCashTriggerResponseModel couponName(String couponName) {
    
    this.couponName = couponName;
    return this;
  }

   /**
   * 红包名称,创建活动时设置,用于账单列表和详情、红包列表和详情的展示
   * @return couponName
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "***周年庆红包", value = "红包名称,创建活动时设置,用于账单列表和详情、红包列表和详情的展示")

  public String getCouponName() {
    return couponName;
  }


  public void setCouponName(String couponName) {
    this.couponName = couponName;
  }


  public AlipayMarketingCampaignCashTriggerResponseModel errorMsg(String errorMsg) {
    
    this.errorMsg = errorMsg;
    return this;
  }

   /**
   * 用户领取失败的错误信息描述
   * @return errorMsg
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "用户实名验证不通过", value = "用户领取失败的错误信息描述")

  public String getErrorMsg() {
    return errorMsg;
  }


  public void setErrorMsg(String errorMsg) {
    this.errorMsg = errorMsg;
  }


  public AlipayMarketingCampaignCashTriggerResponseModel merchantLogo(String merchantLogo) {
    
    this.merchantLogo = merchantLogo;
    return this;
  }

   /**
   * 商户头像logo的图片url地址,用于账单和红包列表、详情的展示
   * @return merchantLogo
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "http://tfs.alipay.com/images/partner/1111111xxxxxxx_160x160", value = "商户头像logo的图片url地址,用于账单和红包列表、详情的展示")

  public String getMerchantLogo() {
    return merchantLogo;
  }


  public void setMerchantLogo(String merchantLogo) {
    this.merchantLogo = merchantLogo;
  }


  public AlipayMarketingCampaignCashTriggerResponseModel outBizNo(String outBizNo) {
    
    this.outBizNo = outBizNo;
    return this;
  }

   /**
   * 外部业务号,回填请求中的out_biz_no,请求参数中传了out_biz_no就会回传回去,如果不传就回传默认的\"default_out_biz_no\",请求者可用于日志记录与核对等
   * @return outBizNo
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "2017021319450001", value = "外部业务号,回填请求中的out_biz_no,请求参数中传了out_biz_no就会回传回去,如果不传就回传默认的\"default_out_biz_no\",请求者可用于日志记录与核对等")

  public String getOutBizNo() {
    return outBizNo;
  }


  public void setOutBizNo(String outBizNo) {
    this.outBizNo = outBizNo;
  }


  public AlipayMarketingCampaignCashTriggerResponseModel partnerId(String partnerId) {
    
    this.partnerId = partnerId;
    return this;
  }

   /**
   * 发送红包商户签约pid,发奖成功时非空
   * @return partnerId
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "2088123456789012", value = "发送红包商户签约pid,发奖成功时非空")

  public String getPartnerId() {
    return partnerId;
  }


  public void setPartnerId(String partnerId) {
    this.partnerId = partnerId;
  }


  public AlipayMarketingCampaignCashTriggerResponseModel prizeAmount(String prizeAmount) {
    
    this.prizeAmount = prizeAmount;
    return this;
  }

   /**
   * 现金红包金额,发奖成功时非空,单位为元,保留两位小数
   * @return prizeAmount
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "234.40", value = "现金红包金额,发奖成功时非空,单位为元,保留两位小数")

  public String getPrizeAmount() {
    return prizeAmount;
  }


  public void setPrizeAmount(String prizeAmount) {
    this.prizeAmount = prizeAmount;
  }


  public AlipayMarketingCampaignCashTriggerResponseModel prizeMsg(String prizeMsg) {
    
    this.prizeMsg = prizeMsg;
    return this;
  }

   /**
   * 活动文案,用于账单的备注展示、红包详情页的文案展示
   * @return prizeMsg
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "XXX送您大红包,祝您中秋快乐", value = "活动文案,用于账单的备注展示、红包详情页的文案展示")

  public String getPrizeMsg() {
    return prizeMsg;
  }


  public void setPrizeMsg(String prizeMsg) {
    this.prizeMsg = prizeMsg;
  }


  public AlipayMarketingCampaignCashTriggerResponseModel repeatTriggerFlag(String repeatTriggerFlag) {
    
    this.repeatTriggerFlag = repeatTriggerFlag;
    return this;
  }

   /**
   * 用户是否重复领取,如果重复领取,返回的是之前的中奖结果,如果是首次领取,则走发奖流程
   * @return repeatTriggerFlag
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "true或false", value = "用户是否重复领取,如果重复领取,返回的是之前的中奖结果,如果是首次领取,则走发奖流程")

  public String getRepeatTriggerFlag() {
    return repeatTriggerFlag;
  }


  public void setRepeatTriggerFlag(String repeatTriggerFlag) {
    this.repeatTriggerFlag = repeatTriggerFlag;
  }


  public AlipayMarketingCampaignCashTriggerResponseModel triggerResult(String triggerResult) {
    
    this.triggerResult = triggerResult;
    return this;
  }

   /**
   * 是否中奖结果状态,取值为true或false。如果为true表示发奖成功,这时返回的结果中的其他字段非空;如果为false表示发奖失败,这时返回的其他字段为空
   * @return triggerResult
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "true", value = "是否中奖结果状态,取值为true或false。如果为true表示发奖成功,这时返回的结果中的其他字段非空;如果为false表示发奖失败,这时返回的其他字段为空")

  public String getTriggerResult() {
    return triggerResult;
  }


  public void setTriggerResult(String triggerResult) {
    this.triggerResult = triggerResult;
  }

  /**
   * 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 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 AlipayMarketingCampaignCashTriggerResponseModel instance itself
   */
  public AlipayMarketingCampaignCashTriggerResponseModel putAdditionalProperty(String key, Object value) {
    if (this.additionalProperties == null) {
        this.additionalProperties = new HashMap();
    }
    this.additionalProperties.put(key, value);
    return this;
  }

  /**
   * Return the additional (undeclared) property.
   *
   * @return a map of objects
   */
  public Map 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;
    }
    AlipayMarketingCampaignCashTriggerResponseModel alipayMarketingCampaignCashTriggerResponseModel = (AlipayMarketingCampaignCashTriggerResponseModel) o;
    return Objects.equals(this.bizNo, alipayMarketingCampaignCashTriggerResponseModel.bizNo) &&
        Objects.equals(this.couponName, alipayMarketingCampaignCashTriggerResponseModel.couponName) &&
        Objects.equals(this.errorMsg, alipayMarketingCampaignCashTriggerResponseModel.errorMsg) &&
        Objects.equals(this.merchantLogo, alipayMarketingCampaignCashTriggerResponseModel.merchantLogo) &&
        Objects.equals(this.outBizNo, alipayMarketingCampaignCashTriggerResponseModel.outBizNo) &&
        Objects.equals(this.partnerId, alipayMarketingCampaignCashTriggerResponseModel.partnerId) &&
        Objects.equals(this.prizeAmount, alipayMarketingCampaignCashTriggerResponseModel.prizeAmount) &&
        Objects.equals(this.prizeMsg, alipayMarketingCampaignCashTriggerResponseModel.prizeMsg) &&
        Objects.equals(this.repeatTriggerFlag, alipayMarketingCampaignCashTriggerResponseModel.repeatTriggerFlag) &&
        Objects.equals(this.triggerResult, alipayMarketingCampaignCashTriggerResponseModel.triggerResult)&&
        Objects.equals(this.additionalProperties, alipayMarketingCampaignCashTriggerResponseModel.additionalProperties);
  }

  @Override
  public int hashCode() {
    return Objects.hash(bizNo, couponName, errorMsg, merchantLogo, outBizNo, partnerId, prizeAmount, prizeMsg, repeatTriggerFlag, triggerResult, additionalProperties);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class AlipayMarketingCampaignCashTriggerResponseModel {\n");
    sb.append("    bizNo: ").append(toIndentedString(bizNo)).append("\n");
    sb.append("    couponName: ").append(toIndentedString(couponName)).append("\n");
    sb.append("    errorMsg: ").append(toIndentedString(errorMsg)).append("\n");
    sb.append("    merchantLogo: ").append(toIndentedString(merchantLogo)).append("\n");
    sb.append("    outBizNo: ").append(toIndentedString(outBizNo)).append("\n");
    sb.append("    partnerId: ").append(toIndentedString(partnerId)).append("\n");
    sb.append("    prizeAmount: ").append(toIndentedString(prizeAmount)).append("\n");
    sb.append("    prizeMsg: ").append(toIndentedString(prizeMsg)).append("\n");
    sb.append("    repeatTriggerFlag: ").append(toIndentedString(repeatTriggerFlag)).append("\n");
    sb.append("    triggerResult: ").append(toIndentedString(triggerResult)).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 openapiFields;
  public static HashSet openapiRequiredFields;

  static {
    // a set of all properties/fields (JSON key names)
    openapiFields = new HashSet();
    openapiFields.add("biz_no");
    openapiFields.add("coupon_name");
    openapiFields.add("error_msg");
    openapiFields.add("merchant_logo");
    openapiFields.add("out_biz_no");
    openapiFields.add("partner_id");
    openapiFields.add("prize_amount");
    openapiFields.add("prize_msg");
    openapiFields.add("repeat_trigger_flag");
    openapiFields.add("trigger_result");

    // a set of required properties/fields (JSON key names)
    openapiRequiredFields = new HashSet();
  }

 /**
  * 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 AlipayMarketingCampaignCashTriggerResponseModel
  */
  public static void validateJsonObject(JsonObject jsonObj) throws IOException {
      if (jsonObj == null) {
        if (AlipayMarketingCampaignCashTriggerResponseModel.openapiRequiredFields.isEmpty()) {
          return;
        } else { // has required fields
          throw new IllegalArgumentException(String.format("The required field(s) %s in AlipayMarketingCampaignCashTriggerResponseModel is not found in the empty JSON string", AlipayMarketingCampaignCashTriggerResponseModel.openapiRequiredFields.toString()));
        }
      }
      if (jsonObj.get("biz_no") != null && !jsonObj.get("biz_no").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `biz_no` to be a primitive type in the JSON string but got `%s`", jsonObj.get("biz_no").toString()));
      }
      if (jsonObj.get("coupon_name") != null && !jsonObj.get("coupon_name").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `coupon_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("coupon_name").toString()));
      }
      if (jsonObj.get("error_msg") != null && !jsonObj.get("error_msg").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `error_msg` to be a primitive type in the JSON string but got `%s`", jsonObj.get("error_msg").toString()));
      }
      if (jsonObj.get("merchant_logo") != null && !jsonObj.get("merchant_logo").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `merchant_logo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchant_logo").toString()));
      }
      if (jsonObj.get("out_biz_no") != null && !jsonObj.get("out_biz_no").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `out_biz_no` to be a primitive type in the JSON string but got `%s`", jsonObj.get("out_biz_no").toString()));
      }
      if (jsonObj.get("partner_id") != null && !jsonObj.get("partner_id").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `partner_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("partner_id").toString()));
      }
      if (jsonObj.get("prize_amount") != null && !jsonObj.get("prize_amount").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `prize_amount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("prize_amount").toString()));
      }
      if (jsonObj.get("prize_msg") != null && !jsonObj.get("prize_msg").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `prize_msg` to be a primitive type in the JSON string but got `%s`", jsonObj.get("prize_msg").toString()));
      }
      if (jsonObj.get("repeat_trigger_flag") != null && !jsonObj.get("repeat_trigger_flag").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `repeat_trigger_flag` to be a primitive type in the JSON string but got `%s`", jsonObj.get("repeat_trigger_flag").toString()));
      }
      if (jsonObj.get("trigger_result") != null && !jsonObj.get("trigger_result").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `trigger_result` to be a primitive type in the JSON string but got `%s`", jsonObj.get("trigger_result").toString()));
      }
  }

  public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
    @SuppressWarnings("unchecked")
    @Override
    public  TypeAdapter create(Gson gson, TypeToken type) {
       if (!AlipayMarketingCampaignCashTriggerResponseModel.class.isAssignableFrom(type.getRawType())) {
         return null; // this class only serializes 'AlipayMarketingCampaignCashTriggerResponseModel' and its subtypes
       }
       final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class);
       final TypeAdapter thisAdapter
                        = gson.getDelegateAdapter(this, TypeToken.get(AlipayMarketingCampaignCashTriggerResponseModel.class));

       return (TypeAdapter) new TypeAdapter() {
           @Override
           public void write(JsonWriter out, AlipayMarketingCampaignCashTriggerResponseModel value) throws IOException {
             JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
             obj.remove("additionalProperties");
             // serialize additonal properties
             if (value.getAdditionalProperties() != null) {
               for (Map.Entry 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 AlipayMarketingCampaignCashTriggerResponseModel read(JsonReader in) throws IOException {
             JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
             validateJsonObject(jsonObj);
             // store additional fields in the deserialized instance
             AlipayMarketingCampaignCashTriggerResponseModel instance = thisAdapter.fromJsonTree(jsonObj);
             for (Map.Entry 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 AlipayMarketingCampaignCashTriggerResponseModel given an JSON string
  *
  * @param jsonString JSON string
  * @return An instance of AlipayMarketingCampaignCashTriggerResponseModel
  * @throws IOException if the JSON string is invalid with respect to AlipayMarketingCampaignCashTriggerResponseModel
  */
  public static AlipayMarketingCampaignCashTriggerResponseModel fromJson(String jsonString) throws IOException {
    return JSON.getGson().fromJson(jsonString, AlipayMarketingCampaignCashTriggerResponseModel.class);
  }

 /**
  * Convert an instance of AlipayMarketingCampaignCashTriggerResponseModel to an JSON string
  *
  * @return JSON string
  */
  public String toJson() {
    return JSON.getGson().toJson(this);
  }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy