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

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

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

/**
 * AlipayIserviceCcmSwOrderSyncModel
 */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class AlipayIserviceCcmSwOrderSyncModel {
  public static final String SERIALIZED_NAME_AMOUNT = "amount";
  @SerializedName(SERIALIZED_NAME_AMOUNT)
  private String amount;

  public static final String SERIALIZED_NAME_LINK_URL = "link_url";
  @SerializedName(SERIALIZED_NAME_LINK_URL)
  private String linkUrl;

  public static final String SERIALIZED_NAME_LOGISTIC_COUNT = "logistic_count";
  @SerializedName(SERIALIZED_NAME_LOGISTIC_COUNT)
  private Integer logisticCount;

  public static final String SERIALIZED_NAME_LOGISTICS = "logistics";
  @SerializedName(SERIALIZED_NAME_LOGISTICS)
  private List logistics = null;

  public static final String SERIALIZED_NAME_ORDER_CREATE_TIME = "order_create_time";
  @SerializedName(SERIALIZED_NAME_ORDER_CREATE_TIME)
  private String orderCreateTime;

  public static final String SERIALIZED_NAME_ORDER_ID = "order_id";
  @SerializedName(SERIALIZED_NAME_ORDER_ID)
  private String orderId;

  public static final String SERIALIZED_NAME_ORDER_TYPE = "order_type";
  @SerializedName(SERIALIZED_NAME_ORDER_TYPE)
  private String orderType;

  public static final String SERIALIZED_NAME_SPU_COUNT = "spu_count";
  @SerializedName(SERIALIZED_NAME_SPU_COUNT)
  private Integer spuCount;

  public static final String SERIALIZED_NAME_SPUS = "spus";
  @SerializedName(SERIALIZED_NAME_SPUS)
  private List spus = null;

  public static final String SERIALIZED_NAME_STATUS = "status";
  @SerializedName(SERIALIZED_NAME_STATUS)
  private String status;

  public static final String SERIALIZED_NAME_SUB_STATUS = "sub_status";
  @SerializedName(SERIALIZED_NAME_SUB_STATUS)
  private String subStatus;

  public static final String SERIALIZED_NAME_USER_ID = "user_id";
  @SerializedName(SERIALIZED_NAME_USER_ID)
  private String userId;

  public AlipayIserviceCcmSwOrderSyncModel() { 
  }

  public AlipayIserviceCcmSwOrderSyncModel amount(String amount) {
    
    this.amount = amount;
    return this;
  }

   /**
   * 订单金额
   * @return amount
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "12234.33", value = "订单金额")

  public String getAmount() {
    return amount;
  }


  public void setAmount(String amount) {
    this.amount = amount;
  }


  public AlipayIserviceCcmSwOrderSyncModel linkUrl(String linkUrl) {
    
    this.linkUrl = linkUrl;
    return this;
  }

   /**
   * 订单链接
   * @return linkUrl
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "http://taobao.com/order/1214134234", value = "订单链接")

  public String getLinkUrl() {
    return linkUrl;
  }


  public void setLinkUrl(String linkUrl) {
    this.linkUrl = linkUrl;
  }


  public AlipayIserviceCcmSwOrderSyncModel logisticCount(Integer logisticCount) {
    
    this.logisticCount = logisticCount;
    return this;
  }

   /**
   * 订单物流数量
   * @return logisticCount
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "1", value = "订单物流数量")

  public Integer getLogisticCount() {
    return logisticCount;
  }


  public void setLogisticCount(Integer logisticCount) {
    this.logisticCount = logisticCount;
  }


  public AlipayIserviceCcmSwOrderSyncModel logistics(List logistics) {
    
    this.logistics = logistics;
    return this;
  }

  public AlipayIserviceCcmSwOrderSyncModel addLogisticsItem(LogisticInfo logisticsItem) {
    if (this.logistics == null) {
      this.logistics = new ArrayList<>();
    }
    this.logistics.add(logisticsItem);
    return this;
  }

   /**
   * 物流信息列表
   * @return logistics
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "物流信息列表")

  public List getLogistics() {
    return logistics;
  }


  public void setLogistics(List logistics) {
    this.logistics = logistics;
  }


  public AlipayIserviceCcmSwOrderSyncModel orderCreateTime(String orderCreateTime) {
    
    this.orderCreateTime = orderCreateTime;
    return this;
  }

   /**
   * 订单创建时间
   * @return orderCreateTime
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "2022-04-04 09:09:09", value = "订单创建时间")

  public String getOrderCreateTime() {
    return orderCreateTime;
  }


  public void setOrderCreateTime(String orderCreateTime) {
    this.orderCreateTime = orderCreateTime;
  }


  public AlipayIserviceCcmSwOrderSyncModel orderId(String orderId) {
    
    this.orderId = orderId;
    return this;
  }

   /**
   * 订单id
   * @return orderId
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "123121414", value = "订单id")

  public String getOrderId() {
    return orderId;
  }


  public void setOrderId(String orderId) {
    this.orderId = orderId;
  }


  public AlipayIserviceCcmSwOrderSyncModel orderType(String orderType) {
    
    this.orderType = orderType;
    return this;
  }

   /**
   * 普通订单:NORMAL 预售订单:PRE_SALE
   * @return orderType
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "NORMAL", value = "普通订单:NORMAL 预售订单:PRE_SALE")

  public String getOrderType() {
    return orderType;
  }


  public void setOrderType(String orderType) {
    this.orderType = orderType;
  }


  public AlipayIserviceCcmSwOrderSyncModel spuCount(Integer spuCount) {
    
    this.spuCount = spuCount;
    return this;
  }

   /**
   * 订单商品种类
   * @return spuCount
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "1", value = "订单商品种类")

  public Integer getSpuCount() {
    return spuCount;
  }


  public void setSpuCount(Integer spuCount) {
    this.spuCount = spuCount;
  }


  public AlipayIserviceCcmSwOrderSyncModel spus(List spus) {
    
    this.spus = spus;
    return this;
  }

  public AlipayIserviceCcmSwOrderSyncModel addSpusItem(SpuInfo spusItem) {
    if (this.spus == null) {
      this.spus = new ArrayList<>();
    }
    this.spus.add(spusItem);
    return this;
  }

   /**
   * 订单商品信息
   * @return spus
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "订单商品信息")

  public List getSpus() {
    return spus;
  }


  public void setSpus(List spus) {
    this.spus = spus;
  }


  public AlipayIserviceCcmSwOrderSyncModel status(String status) {
    
    this.status = status;
    return this;
  }

   /**
   * 订单状态,目前支持以下几种状态 下单未支付 WAIT_PAY 支付未发货 PAIED 已发货 IN_DELIVERY 售后中 IN_AFTER_SALE 订单完成 FINISHED
   * @return status
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "WAIT_PAY", value = "订单状态,目前支持以下几种状态 下单未支付 WAIT_PAY 支付未发货 PAIED 已发货 IN_DELIVERY 售后中 IN_AFTER_SALE 订单完成 FINISHED")

  public String getStatus() {
    return status;
  }


  public void setStatus(String status) {
    this.status = status;
  }


  public AlipayIserviceCcmSwOrderSyncModel subStatus(String subStatus) {
    
    this.subStatus = subStatus;
    return this;
  }

   /**
   * 订单子状态
   * @return subStatus
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "SIGNED", value = "订单子状态")

  public String getSubStatus() {
    return subStatus;
  }


  public void setSubStatus(String subStatus) {
    this.subStatus = subStatus;
  }


  public AlipayIserviceCcmSwOrderSyncModel userId(String userId) {
    
    this.userId = userId;
    return this;
  }

   /**
   * 下单用户id(外部系统ID)
   * @return userId
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "90932423423", value = "下单用户id(外部系统ID)")

  public String getUserId() {
    return userId;
  }


  public void setUserId(String userId) {
    this.userId = userId;
  }

  /**
   * 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 AlipayIserviceCcmSwOrderSyncModel instance itself
   */
  public AlipayIserviceCcmSwOrderSyncModel 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;
    }
    AlipayIserviceCcmSwOrderSyncModel alipayIserviceCcmSwOrderSyncModel = (AlipayIserviceCcmSwOrderSyncModel) o;
    return Objects.equals(this.amount, alipayIserviceCcmSwOrderSyncModel.amount) &&
        Objects.equals(this.linkUrl, alipayIserviceCcmSwOrderSyncModel.linkUrl) &&
        Objects.equals(this.logisticCount, alipayIserviceCcmSwOrderSyncModel.logisticCount) &&
        Objects.equals(this.logistics, alipayIserviceCcmSwOrderSyncModel.logistics) &&
        Objects.equals(this.orderCreateTime, alipayIserviceCcmSwOrderSyncModel.orderCreateTime) &&
        Objects.equals(this.orderId, alipayIserviceCcmSwOrderSyncModel.orderId) &&
        Objects.equals(this.orderType, alipayIserviceCcmSwOrderSyncModel.orderType) &&
        Objects.equals(this.spuCount, alipayIserviceCcmSwOrderSyncModel.spuCount) &&
        Objects.equals(this.spus, alipayIserviceCcmSwOrderSyncModel.spus) &&
        Objects.equals(this.status, alipayIserviceCcmSwOrderSyncModel.status) &&
        Objects.equals(this.subStatus, alipayIserviceCcmSwOrderSyncModel.subStatus) &&
        Objects.equals(this.userId, alipayIserviceCcmSwOrderSyncModel.userId)&&
        Objects.equals(this.additionalProperties, alipayIserviceCcmSwOrderSyncModel.additionalProperties);
  }

  @Override
  public int hashCode() {
    return Objects.hash(amount, linkUrl, logisticCount, logistics, orderCreateTime, orderId, orderType, spuCount, spus, status, subStatus, userId, additionalProperties);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class AlipayIserviceCcmSwOrderSyncModel {\n");
    sb.append("    amount: ").append(toIndentedString(amount)).append("\n");
    sb.append("    linkUrl: ").append(toIndentedString(linkUrl)).append("\n");
    sb.append("    logisticCount: ").append(toIndentedString(logisticCount)).append("\n");
    sb.append("    logistics: ").append(toIndentedString(logistics)).append("\n");
    sb.append("    orderCreateTime: ").append(toIndentedString(orderCreateTime)).append("\n");
    sb.append("    orderId: ").append(toIndentedString(orderId)).append("\n");
    sb.append("    orderType: ").append(toIndentedString(orderType)).append("\n");
    sb.append("    spuCount: ").append(toIndentedString(spuCount)).append("\n");
    sb.append("    spus: ").append(toIndentedString(spus)).append("\n");
    sb.append("    status: ").append(toIndentedString(status)).append("\n");
    sb.append("    subStatus: ").append(toIndentedString(subStatus)).append("\n");
    sb.append("    userId: ").append(toIndentedString(userId)).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("amount");
    openapiFields.add("link_url");
    openapiFields.add("logistic_count");
    openapiFields.add("logistics");
    openapiFields.add("order_create_time");
    openapiFields.add("order_id");
    openapiFields.add("order_type");
    openapiFields.add("spu_count");
    openapiFields.add("spus");
    openapiFields.add("status");
    openapiFields.add("sub_status");
    openapiFields.add("user_id");

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

        // validate the optional field `logistics` (array)
        for (int i = 0; i < jsonArraylogistics.size(); i++) {
          LogisticInfo.validateJsonObject(jsonArraylogistics.get(i).getAsJsonObject());
        };
      }
      if (jsonObj.get("order_create_time") != null && !jsonObj.get("order_create_time").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `order_create_time` to be a primitive type in the JSON string but got `%s`", jsonObj.get("order_create_time").toString()));
      }
      if (jsonObj.get("order_id") != null && !jsonObj.get("order_id").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `order_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("order_id").toString()));
      }
      if (jsonObj.get("order_type") != null && !jsonObj.get("order_type").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `order_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("order_type").toString()));
      }
      JsonArray jsonArrayspus = jsonObj.getAsJsonArray("spus");
      if (jsonArrayspus != null) {
        // ensure the json data is an array
        if (!jsonObj.get("spus").isJsonArray()) {
          throw new IllegalArgumentException(String.format("Expected the field `spus` to be an array in the JSON string but got `%s`", jsonObj.get("spus").toString()));
        }

        // validate the optional field `spus` (array)
        for (int i = 0; i < jsonArrayspus.size(); i++) {
          SpuInfo.validateJsonObject(jsonArrayspus.get(i).getAsJsonObject());
        };
      }
      if (jsonObj.get("status") != null && !jsonObj.get("status").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString()));
      }
      if (jsonObj.get("sub_status") != null && !jsonObj.get("sub_status").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `sub_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sub_status").toString()));
      }
      if (jsonObj.get("user_id") != null && !jsonObj.get("user_id").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `user_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("user_id").toString()));
      }
  }

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

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

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





© 2015 - 2024 Weber Informatics LLC | Privacy Policy