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

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

The newest version!
/*
 * 支付宝开放平台API
 * 支付宝开放平台v3协议文档
 *
 * The version of the OpenAPI document: 2024-08-30
 * 
 *
 * 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.PaidOuterCardTemplateConfDTO;
import com.alipay.v3.model.PubChannelDTO;
import com.alipay.v3.model.TemplateActionInfoDTO;
import com.alipay.v3.model.TemplateBenefitInfoDTO;
import com.alipay.v3.model.TemplateCardLevelConfDTO;
import com.alipay.v3.model.TemplateColumnInfoDTO;
import com.alipay.v3.model.TemplateFieldRuleDTO;
import com.alipay.v3.model.TemplateFormConfig;
import com.alipay.v3.model.TemplateMdcodeNotifyConfDTO;
import com.alipay.v3.model.TemplateOpenCardConfDTO;
import com.alipay.v3.model.TemplateStyleInfoDTO;
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;

/**
 * AlipayMarketingCardTemplateCreateModel
 */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class AlipayMarketingCardTemplateCreateModel {
  public static final String SERIALIZED_NAME_ACCESS_VERSION = "access_version";
  @SerializedName(SERIALIZED_NAME_ACCESS_VERSION)
  private String accessVersion;

  public static final String SERIALIZED_NAME_BIZ_NO_PREFIX = "biz_no_prefix";
  @SerializedName(SERIALIZED_NAME_BIZ_NO_PREFIX)
  private String bizNoPrefix;

  public static final String SERIALIZED_NAME_BIZ_NO_SUFFIX_LEN = "biz_no_suffix_len";
  @SerializedName(SERIALIZED_NAME_BIZ_NO_SUFFIX_LEN)
  private String bizNoSuffixLen;

  public static final String SERIALIZED_NAME_CARD_ACTION_LIST = "card_action_list";
  @SerializedName(SERIALIZED_NAME_CARD_ACTION_LIST)
  private List cardActionList = null;

  public static final String SERIALIZED_NAME_CARD_LEVEL_CONF = "card_level_conf";
  @SerializedName(SERIALIZED_NAME_CARD_LEVEL_CONF)
  private List cardLevelConf = null;

  public static final String SERIALIZED_NAME_CARD_SPEC_TAG = "card_spec_tag";
  @SerializedName(SERIALIZED_NAME_CARD_SPEC_TAG)
  private String cardSpecTag;

  public static final String SERIALIZED_NAME_CARD_TYPE = "card_type";
  @SerializedName(SERIALIZED_NAME_CARD_TYPE)
  private String cardType;

  public static final String SERIALIZED_NAME_COLUMN_INFO_LIST = "column_info_list";
  @SerializedName(SERIALIZED_NAME_COLUMN_INFO_LIST)
  private List columnInfoList = null;

  public static final String SERIALIZED_NAME_FIELD_RULE_LIST = "field_rule_list";
  @SerializedName(SERIALIZED_NAME_FIELD_RULE_LIST)
  private List fieldRuleList = null;

  public static final String SERIALIZED_NAME_MDCODE_NOTIFY_CONF = "mdcode_notify_conf";
  @SerializedName(SERIALIZED_NAME_MDCODE_NOTIFY_CONF)
  private TemplateMdcodeNotifyConfDTO mdcodeNotifyConf;

  public static final String SERIALIZED_NAME_NOTIFY_URL = "notify_url";
  @SerializedName(SERIALIZED_NAME_NOTIFY_URL)
  private String notifyUrl;

  public static final String SERIALIZED_NAME_OPEN_CARD_CONF = "open_card_conf";
  @SerializedName(SERIALIZED_NAME_OPEN_CARD_CONF)
  private TemplateOpenCardConfDTO openCardConf;

  public static final String SERIALIZED_NAME_PAID_OUTER_CARD_CONF = "paid_outer_card_conf";
  @SerializedName(SERIALIZED_NAME_PAID_OUTER_CARD_CONF)
  private PaidOuterCardTemplateConfDTO paidOuterCardConf;

  public static final String SERIALIZED_NAME_PUB_CHANNELS = "pub_channels";
  @SerializedName(SERIALIZED_NAME_PUB_CHANNELS)
  private List pubChannels = null;

  public static final String SERIALIZED_NAME_REQUEST_ID = "request_id";
  @SerializedName(SERIALIZED_NAME_REQUEST_ID)
  private String requestId;

  public static final String SERIALIZED_NAME_SERVICE_LABEL_LIST = "service_label_list";
  @SerializedName(SERIALIZED_NAME_SERVICE_LABEL_LIST)
  private List serviceLabelList = null;

  public static final String SERIALIZED_NAME_SHOP_IDS = "shop_ids";
  @SerializedName(SERIALIZED_NAME_SHOP_IDS)
  private List shopIds = null;

  public static final String SERIALIZED_NAME_SPI_APP_ID = "spi_app_id";
  @SerializedName(SERIALIZED_NAME_SPI_APP_ID)
  private String spiAppId;

  public static final String SERIALIZED_NAME_TEMPLATE_BENEFIT_INFO = "template_benefit_info";
  @SerializedName(SERIALIZED_NAME_TEMPLATE_BENEFIT_INFO)
  private List templateBenefitInfo = null;

  public static final String SERIALIZED_NAME_TEMPLATE_FORM_CONFIG = "template_form_config";
  @SerializedName(SERIALIZED_NAME_TEMPLATE_FORM_CONFIG)
  private TemplateFormConfig templateFormConfig;

  public static final String SERIALIZED_NAME_TEMPLATE_STYLE_INFO = "template_style_info";
  @SerializedName(SERIALIZED_NAME_TEMPLATE_STYLE_INFO)
  private TemplateStyleInfoDTO templateStyleInfo;

  public static final String SERIALIZED_NAME_WRITE_OFF_TYPE = "write_off_type";
  @SerializedName(SERIALIZED_NAME_WRITE_OFF_TYPE)
  private String writeOffType;

  public AlipayMarketingCardTemplateCreateModel() { 
  }

  public AlipayMarketingCardTemplateCreateModel accessVersion(String accessVersion) {
    
    this.accessVersion = accessVersion;
    return this;
  }

   /**
   * 接入版本
   * @return accessVersion
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "basic", value = "接入版本")

  public String getAccessVersion() {
    return accessVersion;
  }


  public void setAccessVersion(String accessVersion) {
    this.accessVersion = accessVersion;
  }


  public AlipayMarketingCardTemplateCreateModel bizNoPrefix(String bizNoPrefix) {
    
    this.bizNoPrefix = bizNoPrefix;
    return this;
  }

   /**
   * 业务卡号前缀,由商户指定  支付宝业务卡号生成规则:biz_no_prefix(商户指定)卡号前缀 + biz_no_suffix(实时生成)卡号后缀
   * @return bizNoPrefix
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "prex", value = "业务卡号前缀,由商户指定  支付宝业务卡号生成规则:biz_no_prefix(商户指定)卡号前缀 + biz_no_suffix(实时生成)卡号后缀")

  public String getBizNoPrefix() {
    return bizNoPrefix;
  }


  public void setBizNoPrefix(String bizNoPrefix) {
    this.bizNoPrefix = bizNoPrefix;
  }


  public AlipayMarketingCardTemplateCreateModel bizNoSuffixLen(String bizNoSuffixLen) {
    
    this.bizNoSuffixLen = bizNoSuffixLen;
    return this;
  }

   /**
   * 业务卡号后缀长度,与biz_no_prefix配合,扣除系统预留2位,剩下对应seq长度。在生成卡号时,若seq位数不足前置补0,若seq位数超出则以实际为准。举例:设为10,其中8位用于生成seq,可覆盖1亿用户,即使seq超过1亿,生成卡号也不报错,但总长度不得超过32位。建议按需设置合适的值,以获得长度一致的业务卡号,建议长度20,性能更好。
   * @return bizNoSuffixLen
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "20", value = "业务卡号后缀长度,与biz_no_prefix配合,扣除系统预留2位,剩下对应seq长度。在生成卡号时,若seq位数不足前置补0,若seq位数超出则以实际为准。举例:设为10,其中8位用于生成seq,可覆盖1亿用户,即使seq超过1亿,生成卡号也不报错,但总长度不得超过32位。建议按需设置合适的值,以获得长度一致的业务卡号,建议长度20,性能更好。")

  public String getBizNoSuffixLen() {
    return bizNoSuffixLen;
  }


  public void setBizNoSuffixLen(String bizNoSuffixLen) {
    this.bizNoSuffixLen = bizNoSuffixLen;
  }


  public AlipayMarketingCardTemplateCreateModel cardActionList(List cardActionList) {
    
    this.cardActionList = cardActionList;
    return this;
  }

  public AlipayMarketingCardTemplateCreateModel addCardActionListItem(TemplateActionInfoDTO cardActionListItem) {
    if (this.cardActionList == null) {
      this.cardActionList = new ArrayList<>();
    }
    this.cardActionList.add(cardActionListItem);
    return this;
  }

   /**
   * \"卡行动点配置; 行动点,即用户可点击跳转的区块,类似按钮控件的交互; 单张卡最多定制3个行动点。如果各项的配置内容完全一样,展示时会进行去重。\"
   * @return cardActionList
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "\"卡行动点配置; 行动点,即用户可点击跳转的区块,类似按钮控件的交互; 单张卡最多定制3个行动点。如果各项的配置内容完全一样,展示时会进行去重。\"")

  public List getCardActionList() {
    return cardActionList;
  }


  public void setCardActionList(List cardActionList) {
    this.cardActionList = cardActionList;
  }


  public AlipayMarketingCardTemplateCreateModel cardLevelConf(List cardLevelConf) {
    
    this.cardLevelConf = cardLevelConf;
    return this;
  }

  public AlipayMarketingCardTemplateCreateModel addCardLevelConfItem(TemplateCardLevelConfDTO cardLevelConfItem) {
    if (this.cardLevelConf == null) {
      this.cardLevelConf = new ArrayList<>();
    }
    this.cardLevelConf.add(cardLevelConfItem);
    return this;
  }

   /**
   * 卡级别配置
   * @return cardLevelConf
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "卡级别配置")

  public List getCardLevelConf() {
    return cardLevelConf;
  }


  public void setCardLevelConf(List cardLevelConf) {
    this.cardLevelConf = cardLevelConf;
  }


  public AlipayMarketingCardTemplateCreateModel cardSpecTag(String cardSpecTag) {
    
    this.cardSpecTag = cardSpecTag;
    return this;
  }

   /**
   * 卡特定标签,只供特定业务使用,通常接入无需关注
   * @return cardSpecTag
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "NONE", value = "卡特定标签,只供特定业务使用,通常接入无需关注")

  public String getCardSpecTag() {
    return cardSpecTag;
  }


  public void setCardSpecTag(String cardSpecTag) {
    this.cardSpecTag = cardSpecTag;
  }


  public AlipayMarketingCardTemplateCreateModel cardType(String cardType) {
    
    this.cardType = cardType;
    return this;
  }

   /**
   * 卡类型
   * @return cardType
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "OUT_MEMBER_CARD", value = "卡类型")

  public String getCardType() {
    return cardType;
  }


  public void setCardType(String cardType) {
    this.cardType = cardType;
  }


  public AlipayMarketingCardTemplateCreateModel columnInfoList(List columnInfoList) {
    
    this.columnInfoList = columnInfoList;
    return this;
  }

  public AlipayMarketingCardTemplateCreateModel addColumnInfoListItem(TemplateColumnInfoDTO columnInfoListItem) {
    if (this.columnInfoList == null) {
      this.columnInfoList = new ArrayList<>();
    }
    this.columnInfoList.add(columnInfoListItem);
    return this;
  }

   /**
   * 栏位信息
   * @return columnInfoList
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "栏位信息")

  public List getColumnInfoList() {
    return columnInfoList;
  }


  public void setColumnInfoList(List columnInfoList) {
    this.columnInfoList = columnInfoList;
  }


  public AlipayMarketingCardTemplateCreateModel fieldRuleList(List fieldRuleList) {
    
    this.fieldRuleList = fieldRuleList;
    return this;
  }

  public AlipayMarketingCardTemplateCreateModel addFieldRuleListItem(TemplateFieldRuleDTO fieldRuleListItem) {
    if (this.fieldRuleList == null) {
      this.fieldRuleList = new ArrayList<>();
    }
    this.fieldRuleList.add(fieldRuleListItem);
    return this;
  }

   /**
   * \"字段规则列表,会员卡开卡过程中,会员卡信息的生成规则, 例如:卡有效期为开卡后两年内有效,则设置为:DATE_IN_FUTURE\"
   * @return fieldRuleList
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "\"字段规则列表,会员卡开卡过程中,会员卡信息的生成规则, 例如:卡有效期为开卡后两年内有效,则设置为:DATE_IN_FUTURE\"")

  public List getFieldRuleList() {
    return fieldRuleList;
  }


  public void setFieldRuleList(List fieldRuleList) {
    this.fieldRuleList = fieldRuleList;
  }


  public AlipayMarketingCardTemplateCreateModel mdcodeNotifyConf(TemplateMdcodeNotifyConfDTO mdcodeNotifyConf) {
    
    this.mdcodeNotifyConf = mdcodeNotifyConf;
    return this;
  }

   /**
   * Get mdcodeNotifyConf
   * @return mdcodeNotifyConf
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public TemplateMdcodeNotifyConfDTO getMdcodeNotifyConf() {
    return mdcodeNotifyConf;
  }


  public void setMdcodeNotifyConf(TemplateMdcodeNotifyConfDTO mdcodeNotifyConf) {
    this.mdcodeNotifyConf = mdcodeNotifyConf;
  }


  public AlipayMarketingCardTemplateCreateModel notifyUrl(String notifyUrl) {
    
    this.notifyUrl = notifyUrl;
    return this;
  }

   /**
   * 通知地址
   * @return notifyUrl
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "通知地址")

  public String getNotifyUrl() {
    return notifyUrl;
  }


  public void setNotifyUrl(String notifyUrl) {
    this.notifyUrl = notifyUrl;
  }


  public AlipayMarketingCardTemplateCreateModel openCardConf(TemplateOpenCardConfDTO openCardConf) {
    
    this.openCardConf = openCardConf;
    return this;
  }

   /**
   * Get openCardConf
   * @return openCardConf
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public TemplateOpenCardConfDTO getOpenCardConf() {
    return openCardConf;
  }


  public void setOpenCardConf(TemplateOpenCardConfDTO openCardConf) {
    this.openCardConf = openCardConf;
  }


  public AlipayMarketingCardTemplateCreateModel paidOuterCardConf(PaidOuterCardTemplateConfDTO paidOuterCardConf) {
    
    this.paidOuterCardConf = paidOuterCardConf;
    return this;
  }

   /**
   * Get paidOuterCardConf
   * @return paidOuterCardConf
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public PaidOuterCardTemplateConfDTO getPaidOuterCardConf() {
    return paidOuterCardConf;
  }


  public void setPaidOuterCardConf(PaidOuterCardTemplateConfDTO paidOuterCardConf) {
    this.paidOuterCardConf = paidOuterCardConf;
  }


  public AlipayMarketingCardTemplateCreateModel pubChannels(List pubChannels) {
    
    this.pubChannels = pubChannels;
    return this;
  }

  public AlipayMarketingCardTemplateCreateModel addPubChannelsItem(PubChannelDTO pubChannelsItem) {
    if (this.pubChannels == null) {
      this.pubChannels = new ArrayList<>();
    }
    this.pubChannels.add(pubChannelsItem);
    return this;
  }

   /**
   * 卡模板投放渠道
   * @return pubChannels
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "卡模板投放渠道")

  public List getPubChannels() {
    return pubChannels;
  }


  public void setPubChannels(List pubChannels) {
    this.pubChannels = pubChannels;
  }


  public AlipayMarketingCardTemplateCreateModel requestId(String requestId) {
    
    this.requestId = requestId;
    return this;
  }

   /**
   * 请求ID,商家自定义且并保证唯一性。
   * @return requestId
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "2024072100000001234", value = "请求ID,商家自定义且并保证唯一性。")

  public String getRequestId() {
    return requestId;
  }


  public void setRequestId(String requestId) {
    this.requestId = requestId;
  }


  public AlipayMarketingCardTemplateCreateModel serviceLabelList(List serviceLabelList) {
    
    this.serviceLabelList = serviceLabelList;
    return this;
  }

  public AlipayMarketingCardTemplateCreateModel addServiceLabelListItem(String serviceLabelListItem) {
    if (this.serviceLabelList == null) {
      this.serviceLabelList = new ArrayList<>();
    }
    this.serviceLabelList.add(serviceLabelListItem);
    return this;
  }

   /**
   * 服务标签列表
   * @return serviceLabelList
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "[\"HUABEI_FUWU\"]", value = "服务标签列表")

  public List getServiceLabelList() {
    return serviceLabelList;
  }


  public void setServiceLabelList(List serviceLabelList) {
    this.serviceLabelList = serviceLabelList;
  }


  public AlipayMarketingCardTemplateCreateModel shopIds(List shopIds) {
    
    this.shopIds = shopIds;
    return this;
  }

  public AlipayMarketingCardTemplateCreateModel addShopIdsItem(String shopIdsItem) {
    if (this.shopIds == null) {
      this.shopIds = new ArrayList<>();
    }
    this.shopIds.add(shopIdsItem);
    return this;
  }

   /**
   * 会员卡上架门店id(支付宝门店id),即发放会员卡的商家门店id
   * @return shopIds
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "[\"2015122900077000000002409504\"]", value = "会员卡上架门店id(支付宝门店id),即发放会员卡的商家门店id")

  public List getShopIds() {
    return shopIds;
  }


  public void setShopIds(List shopIds) {
    this.shopIds = shopIds;
  }


  public AlipayMarketingCardTemplateCreateModel spiAppId(String spiAppId) {
    
    this.spiAppId = spiAppId;
    return this;
  }

   /**
   * spi应用id,为实现spi.alipay.user.opencard.get接口的app_id。若是第三方代理模式,可以设置成服务商的 APPID 或者是商家自己的 APPID; 若不是第三方代理模式,只能设置商家自己的 APPID。
   * @return spiAppId
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "2021001160639010", value = "spi应用id,为实现spi.alipay.user.opencard.get接口的app_id。若是第三方代理模式,可以设置成服务商的 APPID 或者是商家自己的 APPID; 若不是第三方代理模式,只能设置商家自己的 APPID。")

  public String getSpiAppId() {
    return spiAppId;
  }


  public void setSpiAppId(String spiAppId) {
    this.spiAppId = spiAppId;
  }


  public AlipayMarketingCardTemplateCreateModel templateBenefitInfo(List templateBenefitInfo) {
    
    this.templateBenefitInfo = templateBenefitInfo;
    return this;
  }

  public AlipayMarketingCardTemplateCreateModel addTemplateBenefitInfoItem(TemplateBenefitInfoDTO templateBenefitInfoItem) {
    if (this.templateBenefitInfo == null) {
      this.templateBenefitInfo = new ArrayList<>();
    }
    this.templateBenefitInfo.add(templateBenefitInfoItem);
    return this;
  }

   /**
   * \"权益信息, 1、在卡包的卡详情页面会自动添加“会员权益”栏位,展现此字段配置的会员卡权益信息, 2、如果添加门店渠道,则可在门店页展现会员卡的权益\"
   * @return templateBenefitInfo
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "\"权益信息, 1、在卡包的卡详情页面会自动添加“会员权益”栏位,展现此字段配置的会员卡权益信息, 2、如果添加门店渠道,则可在门店页展现会员卡的权益\"")

  public List getTemplateBenefitInfo() {
    return templateBenefitInfo;
  }


  public void setTemplateBenefitInfo(List templateBenefitInfo) {
    this.templateBenefitInfo = templateBenefitInfo;
  }


  public AlipayMarketingCardTemplateCreateModel templateFormConfig(TemplateFormConfig templateFormConfig) {
    
    this.templateFormConfig = templateFormConfig;
    return this;
  }

   /**
   * Get templateFormConfig
   * @return templateFormConfig
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public TemplateFormConfig getTemplateFormConfig() {
    return templateFormConfig;
  }


  public void setTemplateFormConfig(TemplateFormConfig templateFormConfig) {
    this.templateFormConfig = templateFormConfig;
  }


  public AlipayMarketingCardTemplateCreateModel templateStyleInfo(TemplateStyleInfoDTO templateStyleInfo) {
    
    this.templateStyleInfo = templateStyleInfo;
    return this;
  }

   /**
   * Get templateStyleInfo
   * @return templateStyleInfo
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public TemplateStyleInfoDTO getTemplateStyleInfo() {
    return templateStyleInfo;
  }


  public void setTemplateStyleInfo(TemplateStyleInfoDTO templateStyleInfo) {
    this.templateStyleInfo = templateStyleInfo;
  }


  public AlipayMarketingCardTemplateCreateModel writeOffType(String writeOffType) {
    
    this.writeOffType = writeOffType;
    return this;
  }

   /**
   * 卡包详情页面中展现出的卡码(可用于扫码核销)  (1) 静态码 qrcode: 二维码,扫码得商户开卡传入的external_card_no barcode: 条形码,扫码得商户开卡传入的external_card_no  (2) 动态码-支付宝生成码值(动态码会在2分钟左右后过期) dqrcode: 动态二维码,扫码得到的码值可配合会员卡查询接口使用 dbarcode: 动态条形码,扫码得到的码值可配合会员卡查询接口使用  (3) 动态码-商家自主生成码值(码值、时效性都由商户控制) mdqrcode: 商户动态二维码,扫码得商户自主传入的码值 mdbarcode: 商户动态条码,扫码得商户自主传入的码值 如需使用商户动态码,对接详情参见 <a  href=\"https://opendocs.alipay.com/open/02y7gt\">商户动态发码</a>。
   * @return writeOffType
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "qrcode", value = "卡包详情页面中展现出的卡码(可用于扫码核销)  (1) 静态码 qrcode: 二维码,扫码得商户开卡传入的external_card_no barcode: 条形码,扫码得商户开卡传入的external_card_no  (2) 动态码-支付宝生成码值(动态码会在2分钟左右后过期) dqrcode: 动态二维码,扫码得到的码值可配合会员卡查询接口使用 dbarcode: 动态条形码,扫码得到的码值可配合会员卡查询接口使用  (3) 动态码-商家自主生成码值(码值、时效性都由商户控制) mdqrcode: 商户动态二维码,扫码得商户自主传入的码值 mdbarcode: 商户动态条码,扫码得商户自主传入的码值 如需使用商户动态码,对接详情参见 商户动态发码。")

  public String getWriteOffType() {
    return writeOffType;
  }


  public void setWriteOffType(String writeOffType) {
    this.writeOffType = writeOffType;
  }

  /**
   * 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 AlipayMarketingCardTemplateCreateModel instance itself
   */
  public AlipayMarketingCardTemplateCreateModel 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;
    }
    AlipayMarketingCardTemplateCreateModel alipayMarketingCardTemplateCreateModel = (AlipayMarketingCardTemplateCreateModel) o;
    return Objects.equals(this.accessVersion, alipayMarketingCardTemplateCreateModel.accessVersion) &&
        Objects.equals(this.bizNoPrefix, alipayMarketingCardTemplateCreateModel.bizNoPrefix) &&
        Objects.equals(this.bizNoSuffixLen, alipayMarketingCardTemplateCreateModel.bizNoSuffixLen) &&
        Objects.equals(this.cardActionList, alipayMarketingCardTemplateCreateModel.cardActionList) &&
        Objects.equals(this.cardLevelConf, alipayMarketingCardTemplateCreateModel.cardLevelConf) &&
        Objects.equals(this.cardSpecTag, alipayMarketingCardTemplateCreateModel.cardSpecTag) &&
        Objects.equals(this.cardType, alipayMarketingCardTemplateCreateModel.cardType) &&
        Objects.equals(this.columnInfoList, alipayMarketingCardTemplateCreateModel.columnInfoList) &&
        Objects.equals(this.fieldRuleList, alipayMarketingCardTemplateCreateModel.fieldRuleList) &&
        Objects.equals(this.mdcodeNotifyConf, alipayMarketingCardTemplateCreateModel.mdcodeNotifyConf) &&
        Objects.equals(this.notifyUrl, alipayMarketingCardTemplateCreateModel.notifyUrl) &&
        Objects.equals(this.openCardConf, alipayMarketingCardTemplateCreateModel.openCardConf) &&
        Objects.equals(this.paidOuterCardConf, alipayMarketingCardTemplateCreateModel.paidOuterCardConf) &&
        Objects.equals(this.pubChannels, alipayMarketingCardTemplateCreateModel.pubChannels) &&
        Objects.equals(this.requestId, alipayMarketingCardTemplateCreateModel.requestId) &&
        Objects.equals(this.serviceLabelList, alipayMarketingCardTemplateCreateModel.serviceLabelList) &&
        Objects.equals(this.shopIds, alipayMarketingCardTemplateCreateModel.shopIds) &&
        Objects.equals(this.spiAppId, alipayMarketingCardTemplateCreateModel.spiAppId) &&
        Objects.equals(this.templateBenefitInfo, alipayMarketingCardTemplateCreateModel.templateBenefitInfo) &&
        Objects.equals(this.templateFormConfig, alipayMarketingCardTemplateCreateModel.templateFormConfig) &&
        Objects.equals(this.templateStyleInfo, alipayMarketingCardTemplateCreateModel.templateStyleInfo) &&
        Objects.equals(this.writeOffType, alipayMarketingCardTemplateCreateModel.writeOffType)&&
        Objects.equals(this.additionalProperties, alipayMarketingCardTemplateCreateModel.additionalProperties);
  }

  @Override
  public int hashCode() {
    return Objects.hash(accessVersion, bizNoPrefix, bizNoSuffixLen, cardActionList, cardLevelConf, cardSpecTag, cardType, columnInfoList, fieldRuleList, mdcodeNotifyConf, notifyUrl, openCardConf, paidOuterCardConf, pubChannels, requestId, serviceLabelList, shopIds, spiAppId, templateBenefitInfo, templateFormConfig, templateStyleInfo, writeOffType, additionalProperties);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class AlipayMarketingCardTemplateCreateModel {\n");
    sb.append("    accessVersion: ").append(toIndentedString(accessVersion)).append("\n");
    sb.append("    bizNoPrefix: ").append(toIndentedString(bizNoPrefix)).append("\n");
    sb.append("    bizNoSuffixLen: ").append(toIndentedString(bizNoSuffixLen)).append("\n");
    sb.append("    cardActionList: ").append(toIndentedString(cardActionList)).append("\n");
    sb.append("    cardLevelConf: ").append(toIndentedString(cardLevelConf)).append("\n");
    sb.append("    cardSpecTag: ").append(toIndentedString(cardSpecTag)).append("\n");
    sb.append("    cardType: ").append(toIndentedString(cardType)).append("\n");
    sb.append("    columnInfoList: ").append(toIndentedString(columnInfoList)).append("\n");
    sb.append("    fieldRuleList: ").append(toIndentedString(fieldRuleList)).append("\n");
    sb.append("    mdcodeNotifyConf: ").append(toIndentedString(mdcodeNotifyConf)).append("\n");
    sb.append("    notifyUrl: ").append(toIndentedString(notifyUrl)).append("\n");
    sb.append("    openCardConf: ").append(toIndentedString(openCardConf)).append("\n");
    sb.append("    paidOuterCardConf: ").append(toIndentedString(paidOuterCardConf)).append("\n");
    sb.append("    pubChannels: ").append(toIndentedString(pubChannels)).append("\n");
    sb.append("    requestId: ").append(toIndentedString(requestId)).append("\n");
    sb.append("    serviceLabelList: ").append(toIndentedString(serviceLabelList)).append("\n");
    sb.append("    shopIds: ").append(toIndentedString(shopIds)).append("\n");
    sb.append("    spiAppId: ").append(toIndentedString(spiAppId)).append("\n");
    sb.append("    templateBenefitInfo: ").append(toIndentedString(templateBenefitInfo)).append("\n");
    sb.append("    templateFormConfig: ").append(toIndentedString(templateFormConfig)).append("\n");
    sb.append("    templateStyleInfo: ").append(toIndentedString(templateStyleInfo)).append("\n");
    sb.append("    writeOffType: ").append(toIndentedString(writeOffType)).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("access_version");
    openapiFields.add("biz_no_prefix");
    openapiFields.add("biz_no_suffix_len");
    openapiFields.add("card_action_list");
    openapiFields.add("card_level_conf");
    openapiFields.add("card_spec_tag");
    openapiFields.add("card_type");
    openapiFields.add("column_info_list");
    openapiFields.add("field_rule_list");
    openapiFields.add("mdcode_notify_conf");
    openapiFields.add("notify_url");
    openapiFields.add("open_card_conf");
    openapiFields.add("paid_outer_card_conf");
    openapiFields.add("pub_channels");
    openapiFields.add("request_id");
    openapiFields.add("service_label_list");
    openapiFields.add("shop_ids");
    openapiFields.add("spi_app_id");
    openapiFields.add("template_benefit_info");
    openapiFields.add("template_form_config");
    openapiFields.add("template_style_info");
    openapiFields.add("write_off_type");

    // 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 AlipayMarketingCardTemplateCreateModel
  */
  public static void validateJsonObject(JsonObject jsonObj) throws IOException {
      if (jsonObj == null) {
        if (AlipayMarketingCardTemplateCreateModel.openapiRequiredFields.isEmpty()) {
          return;
        } else { // has required fields
          throw new IllegalArgumentException(String.format("The required field(s) %s in AlipayMarketingCardTemplateCreateModel is not found in the empty JSON string", AlipayMarketingCardTemplateCreateModel.openapiRequiredFields.toString()));
        }
      }
      if (jsonObj.get("access_version") != null && !jsonObj.get("access_version").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `access_version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("access_version").toString()));
      }
      if (jsonObj.get("biz_no_prefix") != null && !jsonObj.get("biz_no_prefix").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `biz_no_prefix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("biz_no_prefix").toString()));
      }
      if (jsonObj.get("biz_no_suffix_len") != null && !jsonObj.get("biz_no_suffix_len").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `biz_no_suffix_len` to be a primitive type in the JSON string but got `%s`", jsonObj.get("biz_no_suffix_len").toString()));
      }
      JsonArray jsonArraycardActionList = jsonObj.getAsJsonArray("card_action_list");
      if (jsonArraycardActionList != null) {
        // ensure the json data is an array
        if (!jsonObj.get("card_action_list").isJsonArray()) {
          throw new IllegalArgumentException(String.format("Expected the field `card_action_list` to be an array in the JSON string but got `%s`", jsonObj.get("card_action_list").toString()));
        }

        // validate the optional field `card_action_list` (array)
        for (int i = 0; i < jsonArraycardActionList.size(); i++) {
          TemplateActionInfoDTO.validateJsonObject(jsonArraycardActionList.get(i).getAsJsonObject());
        };
      }
      JsonArray jsonArraycardLevelConf = jsonObj.getAsJsonArray("card_level_conf");
      if (jsonArraycardLevelConf != null) {
        // ensure the json data is an array
        if (!jsonObj.get("card_level_conf").isJsonArray()) {
          throw new IllegalArgumentException(String.format("Expected the field `card_level_conf` to be an array in the JSON string but got `%s`", jsonObj.get("card_level_conf").toString()));
        }

        // validate the optional field `card_level_conf` (array)
        for (int i = 0; i < jsonArraycardLevelConf.size(); i++) {
          TemplateCardLevelConfDTO.validateJsonObject(jsonArraycardLevelConf.get(i).getAsJsonObject());
        };
      }
      if (jsonObj.get("card_spec_tag") != null && !jsonObj.get("card_spec_tag").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `card_spec_tag` to be a primitive type in the JSON string but got `%s`", jsonObj.get("card_spec_tag").toString()));
      }
      if (jsonObj.get("card_type") != null && !jsonObj.get("card_type").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `card_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("card_type").toString()));
      }
      JsonArray jsonArraycolumnInfoList = jsonObj.getAsJsonArray("column_info_list");
      if (jsonArraycolumnInfoList != null) {
        // ensure the json data is an array
        if (!jsonObj.get("column_info_list").isJsonArray()) {
          throw new IllegalArgumentException(String.format("Expected the field `column_info_list` to be an array in the JSON string but got `%s`", jsonObj.get("column_info_list").toString()));
        }

        // validate the optional field `column_info_list` (array)
        for (int i = 0; i < jsonArraycolumnInfoList.size(); i++) {
          TemplateColumnInfoDTO.validateJsonObject(jsonArraycolumnInfoList.get(i).getAsJsonObject());
        };
      }
      JsonArray jsonArrayfieldRuleList = jsonObj.getAsJsonArray("field_rule_list");
      if (jsonArrayfieldRuleList != null) {
        // ensure the json data is an array
        if (!jsonObj.get("field_rule_list").isJsonArray()) {
          throw new IllegalArgumentException(String.format("Expected the field `field_rule_list` to be an array in the JSON string but got `%s`", jsonObj.get("field_rule_list").toString()));
        }

        // validate the optional field `field_rule_list` (array)
        for (int i = 0; i < jsonArrayfieldRuleList.size(); i++) {
          TemplateFieldRuleDTO.validateJsonObject(jsonArrayfieldRuleList.get(i).getAsJsonObject());
        };
      }
      // validate the optional field `mdcode_notify_conf`
      if (jsonObj.getAsJsonObject("mdcode_notify_conf") != null) {
        TemplateMdcodeNotifyConfDTO.validateJsonObject(jsonObj.getAsJsonObject("mdcode_notify_conf"));
      }
      if (jsonObj.get("notify_url") != null && !jsonObj.get("notify_url").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `notify_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("notify_url").toString()));
      }
      // validate the optional field `open_card_conf`
      if (jsonObj.getAsJsonObject("open_card_conf") != null) {
        TemplateOpenCardConfDTO.validateJsonObject(jsonObj.getAsJsonObject("open_card_conf"));
      }
      // validate the optional field `paid_outer_card_conf`
      if (jsonObj.getAsJsonObject("paid_outer_card_conf") != null) {
        PaidOuterCardTemplateConfDTO.validateJsonObject(jsonObj.getAsJsonObject("paid_outer_card_conf"));
      }
      JsonArray jsonArraypubChannels = jsonObj.getAsJsonArray("pub_channels");
      if (jsonArraypubChannels != null) {
        // ensure the json data is an array
        if (!jsonObj.get("pub_channels").isJsonArray()) {
          throw new IllegalArgumentException(String.format("Expected the field `pub_channels` to be an array in the JSON string but got `%s`", jsonObj.get("pub_channels").toString()));
        }

        // validate the optional field `pub_channels` (array)
        for (int i = 0; i < jsonArraypubChannels.size(); i++) {
          PubChannelDTO.validateJsonObject(jsonArraypubChannels.get(i).getAsJsonObject());
        };
      }
      if (jsonObj.get("request_id") != null && !jsonObj.get("request_id").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `request_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("request_id").toString()));
      }
      // ensure the json data is an array
      if (jsonObj.get("service_label_list") != null && !jsonObj.get("service_label_list").isJsonArray()) {
        throw new IllegalArgumentException(String.format("Expected the field `service_label_list` to be an array in the JSON string but got `%s`", jsonObj.get("service_label_list").toString()));
      }
      // ensure the json data is an array
      if (jsonObj.get("shop_ids") != null && !jsonObj.get("shop_ids").isJsonArray()) {
        throw new IllegalArgumentException(String.format("Expected the field `shop_ids` to be an array in the JSON string but got `%s`", jsonObj.get("shop_ids").toString()));
      }
      if (jsonObj.get("spi_app_id") != null && !jsonObj.get("spi_app_id").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `spi_app_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("spi_app_id").toString()));
      }
      JsonArray jsonArraytemplateBenefitInfo = jsonObj.getAsJsonArray("template_benefit_info");
      if (jsonArraytemplateBenefitInfo != null) {
        // ensure the json data is an array
        if (!jsonObj.get("template_benefit_info").isJsonArray()) {
          throw new IllegalArgumentException(String.format("Expected the field `template_benefit_info` to be an array in the JSON string but got `%s`", jsonObj.get("template_benefit_info").toString()));
        }

        // validate the optional field `template_benefit_info` (array)
        for (int i = 0; i < jsonArraytemplateBenefitInfo.size(); i++) {
          TemplateBenefitInfoDTO.validateJsonObject(jsonArraytemplateBenefitInfo.get(i).getAsJsonObject());
        };
      }
      // validate the optional field `template_form_config`
      if (jsonObj.getAsJsonObject("template_form_config") != null) {
        TemplateFormConfig.validateJsonObject(jsonObj.getAsJsonObject("template_form_config"));
      }
      // validate the optional field `template_style_info`
      if (jsonObj.getAsJsonObject("template_style_info") != null) {
        TemplateStyleInfoDTO.validateJsonObject(jsonObj.getAsJsonObject("template_style_info"));
      }
      if (jsonObj.get("write_off_type") != null && !jsonObj.get("write_off_type").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `write_off_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("write_off_type").toString()));
      }
  }

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

       return (TypeAdapter) new TypeAdapter() {
           @Override
           public void write(JsonWriter out, AlipayMarketingCardTemplateCreateModel 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 AlipayMarketingCardTemplateCreateModel read(JsonReader in) throws IOException {
             JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
             validateJsonObject(jsonObj);
             // store additional fields in the deserialized instance
             AlipayMarketingCardTemplateCreateModel 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 AlipayMarketingCardTemplateCreateModel given an JSON string
  *
  * @param jsonString JSON string
  * @return An instance of AlipayMarketingCardTemplateCreateModel
  * @throws IOException if the JSON string is invalid with respect to AlipayMarketingCardTemplateCreateModel
  */
  public static AlipayMarketingCardTemplateCreateModel fromJson(String jsonString) throws IOException {
    return JSON.getGson().fromJson(jsonString, AlipayMarketingCardTemplateCreateModel.class);
  }

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





© 2015 - 2024 Weber Informatics LLC | Privacy Policy