content: /*
   * 支付宝开放平台API
   * 支付宝开放平台v3协议文档
   *
   * The version of the OpenAPI document: 2024-01-10
   * 
   *
   * 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;
  
  /**
   * ExpenseRecepitInfo
   */
  @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
  public class ExpenseRecepitInfo {
    public static final String SERIALIZED_NAME_AMOUNT = "amount";
    @SerializedName(SERIALIZED_NAME_AMOUNT)
    private Integer amount;
  
    public static final String SERIALIZED_NAME_EMPLOYEE_ID = "employee_id";
    @SerializedName(SERIALIZED_NAME_EMPLOYEE_ID)
    private String employeeId;
  
    public static final String SERIALIZED_NAME_PRODUCT_CODE = "product_code";
    @SerializedName(SERIALIZED_NAME_PRODUCT_CODE)
    private String productCode;
  
    public static final String SERIALIZED_NAME_PRODUCT_COUNT = "product_count";
    @SerializedName(SERIALIZED_NAME_PRODUCT_COUNT)
    private Integer productCount;
  
    public static final String SERIALIZED_NAME_PRODUCT_NAME = "product_name";
    @SerializedName(SERIALIZED_NAME_PRODUCT_NAME)
    private String productName;
  
    public static final String SERIALIZED_NAME_TOTAL_AMOUNT = "total_amount";
    @SerializedName(SERIALIZED_NAME_TOTAL_AMOUNT)
    private Integer totalAmount;
  
    public static final String SERIALIZED_NAME_VOUCHER_ID = "voucher_id";
    @SerializedName(SERIALIZED_NAME_VOUCHER_ID)
    private String voucherId;
  
    public ExpenseRecepitInfo() { 
    }
  
    public ExpenseRecepitInfo amount(Integer amount) {
      
      this.amount = amount;
      return this;
    }
  
     /**
     * 商品单价（单位：分）
     * @return amount
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "10", value = "商品单价（单位：分）")
  
    public Integer getAmount() {
      return amount;
    }
  
  
    public void setAmount(Integer amount) {
      this.amount = amount;
    }
  
  
    public ExpenseRecepitInfo employeeId(String employeeId) {
      
      this.employeeId = employeeId;
      return this;
    }
  
     /**
     * 所属员工uid
     * @return employeeId
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "2088123412341234", value = "所属员工uid")
  
    public String getEmployeeId() {
      return employeeId;
    }
  
  
    public void setEmployeeId(String employeeId) {
      this.employeeId = employeeId;
    }
  
  
    public ExpenseRecepitInfo productCode(String productCode) {
      
      this.productCode = productCode;
      return this;
    }
  
     /**
     * 商品编码
     * @return productCode
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "商品编码", value = "商品编码")
  
    public String getProductCode() {
      return productCode;
    }
  
  
    public void setProductCode(String productCode) {
      this.productCode = productCode;
    }
  
  
    public ExpenseRecepitInfo productCount(Integer productCount) {
      
      this.productCount = productCount;
      return this;
    }
  
     /**
     * product_count
     * @return productCount
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "1234", value = "product_count")
  
    public Integer getProductCount() {
      return productCount;
    }
  
  
    public void setProductCount(Integer productCount) {
      this.productCount = productCount;
    }
  
  
    public ExpenseRecepitInfo productName(String productName) {
      
      this.productName = productName;
      return this;
    }
  
     /**
     * 商品名称
     * @return productName
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "商品名称", value = "商品名称")
  
    public String getProductName() {
      return productName;
    }
  
  
    public void setProductName(String productName) {
      this.productName = productName;
    }
  
  
    public ExpenseRecepitInfo totalAmount(Integer totalAmount) {
      
      this.totalAmount = totalAmount;
      return this;
    }
  
     /**
     * 商品总价（单位：分）
     * @return totalAmount
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "10", value = "商品总价（单位：分）")
  
    public Integer getTotalAmount() {
      return totalAmount;
    }
  
  
    public void setTotalAmount(Integer totalAmount) {
      this.totalAmount = totalAmount;
    }
  
  
    public ExpenseRecepitInfo voucherId(String voucherId) {
      
      this.voucherId = voucherId;
      return this;
    }
  
     /**
     * 凭证id
     * @return voucherId
    **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "2020123100152601930000003650", value = "凭证id")
  
    public String getVoucherId() {
      return voucherId;
    }
  
  
    public void setVoucherId(String voucherId) {
      this.voucherId = voucherId;
    }
  
  
  
    @Override
    public boolean equals(Object o) {
      if (this == o) {
        return true;
      }
      if (o == null || getClass() != o.getClass()) {
        return false;
      }
      ExpenseRecepitInfo expenseRecepitInfo = (ExpenseRecepitInfo) o;
      return Objects.equals(this.amount, expenseRecepitInfo.amount) &&
          Objects.equals(this.employeeId, expenseRecepitInfo.employeeId) &&
          Objects.equals(this.productCode, expenseRecepitInfo.productCode) &&
          Objects.equals(this.productCount, expenseRecepitInfo.productCount) &&
          Objects.equals(this.productName, expenseRecepitInfo.productName) &&
          Objects.equals(this.totalAmount, expenseRecepitInfo.totalAmount) &&
          Objects.equals(this.voucherId, expenseRecepitInfo.voucherId);
    }
  
    @Override
    public int hashCode() {
      return Objects.hash(amount, employeeId, productCode, productCount, productName, totalAmount, voucherId);
    }
  
    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder();
      sb.append("class ExpenseRecepitInfo {\n");
      sb.append("    amount: ").append(toIndentedString(amount)).append("\n");
      sb.append("    employeeId: ").append(toIndentedString(employeeId)).append("\n");
      sb.append("    productCode: ").append(toIndentedString(productCode)).append("\n");
      sb.append("    productCount: ").append(toIndentedString(productCount)).append("\n");
      sb.append("    productName: ").append(toIndentedString(productName)).append("\n");
      sb.append("    totalAmount: ").append(toIndentedString(totalAmount)).append("\n");
      sb.append("    voucherId: ").append(toIndentedString(voucherId)).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("amount");
      openapiFields.add("employee_id");
      openapiFields.add("product_code");
      openapiFields.add("product_count");
      openapiFields.add("product_name");
      openapiFields.add("total_amount");
      openapiFields.add("voucher_id");
  
      // 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 ExpenseRecepitInfo
    */
    public static void validateJsonObject(JsonObject jsonObj) throws IOException {
        if (jsonObj == null) {
          if (ExpenseRecepitInfo.openapiRequiredFields.isEmpty()) {
            return;
          } else { // has required fields
            throw new IllegalArgumentException(String.format("The required field(s) %s in ExpenseRecepitInfo is not found in the empty JSON string", ExpenseRecepitInfo.openapiRequiredFields.toString()));
          }
        }
  
        Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
        // check to see if the JSON string contains additional fields
        for (Entry<String, JsonElement> entry : entries) {
          if (!ExpenseRecepitInfo.openapiFields.contains(entry.getKey())) {
            throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ExpenseRecepitInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
          }
        }
        if (jsonObj.get("employee_id") != null && !jsonObj.get("employee_id").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `employee_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("employee_id").toString()));
        }
        if (jsonObj.get("product_code") != null && !jsonObj.get("product_code").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `product_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("product_code").toString()));
        }
        if (jsonObj.get("product_name") != null && !jsonObj.get("product_name").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `product_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("product_name").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()));
        }
    }
  
    public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
      @SuppressWarnings("unchecked")
      @Override
      public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
         if (!ExpenseRecepitInfo.class.isAssignableFrom(type.getRawType())) {
           return null; // this class only serializes 'ExpenseRecepitInfo' and its subtypes
         }
         final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
         final TypeAdapter<ExpenseRecepitInfo> thisAdapter
                          = gson.getDelegateAdapter(this, TypeToken.get(ExpenseRecepitInfo.class));
  
         return (TypeAdapter<T>) new TypeAdapter<ExpenseRecepitInfo>() {
             @Override
             public void write(JsonWriter out, ExpenseRecepitInfo value) throws IOException {
               JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
               elementAdapter.write(out, obj);
             }
  
             @Override
             public ExpenseRecepitInfo read(JsonReader in) throws IOException {
               JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
               validateJsonObject(jsonObj);
               return thisAdapter.fromJsonTree(jsonObj);
             }
  
         }.nullSafe();
      }
    }
  
   /**
    * Create an instance of ExpenseRecepitInfo given an JSON string
    *
    * @param jsonString JSON string
    * @return An instance of ExpenseRecepitInfo
    * @throws IOException if the JSON string is invalid with respect to ExpenseRecepitInfo
    */
    public static ExpenseRecepitInfo fromJson(String jsonString) throws IOException {
      return JSON.getGson().fromJson(jsonString, ExpenseRecepitInfo.class);
    }
  
   /**
    * Convert an instance of ExpenseRecepitInfo to an JSON string
    *
    * @return JSON string
    */
    public String toJson() {
      return JSON.getGson().toJson(this);
    }
  }
  
  