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

com.alipay.v3.model.SearchOrderDetailDataServiceItems 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;

/**
 * SearchOrderDetailDataServiceItems
 */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class SearchOrderDetailDataServiceItems {
  public static final String SERIALIZED_NAME_AREA_CODES = "area_codes";
  @SerializedName(SERIALIZED_NAME_AREA_CODES)
  private String areaCodes;

  public static final String SERIALIZED_NAME_CARRIER_CODE = "carrier_code";
  @SerializedName(SERIALIZED_NAME_CARRIER_CODE)
  private String carrierCode;

  public static final String SERIALIZED_NAME_CARRIER_LIST = "carrier_list";
  @SerializedName(SERIALIZED_NAME_CARRIER_LIST)
  private String carrierList;

  public static final String SERIALIZED_NAME_CATEGORY_ATTRIBUTE_VALUE = "category_attribute_value";
  @SerializedName(SERIALIZED_NAME_CATEGORY_ATTRIBUTE_VALUE)
  private String categoryAttributeValue;

  public static final String SERIALIZED_NAME_CATEGORY_CODE = "category_code";
  @SerializedName(SERIALIZED_NAME_CATEGORY_CODE)
  private String categoryCode;

  public static final String SERIALIZED_NAME_CATEGORY_IDS = "category_ids";
  @SerializedName(SERIALIZED_NAME_CATEGORY_IDS)
  private String categoryIds;

  public static final String SERIALIZED_NAME_CHANNEL_TYPE = "channel_type";
  @SerializedName(SERIALIZED_NAME_CHANNEL_TYPE)
  private String channelType;

  public static final String SERIALIZED_NAME_DESC = "desc";
  @SerializedName(SERIALIZED_NAME_DESC)
  private String desc;

  public static final String SERIALIZED_NAME_IMG = "img";
  @SerializedName(SERIALIZED_NAME_IMG)
  private String img;

  public static final String SERIALIZED_NAME_KEY_WORD = "key_word";
  @SerializedName(SERIALIZED_NAME_KEY_WORD)
  private String keyWord;

  public static final String SERIALIZED_NAME_KEY_WORD_LIST = "key_word_list";
  @SerializedName(SERIALIZED_NAME_KEY_WORD_LIST)
  private String keyWordList;

  public static final String SERIALIZED_NAME_LOGO = "logo";
  @SerializedName(SERIALIZED_NAME_LOGO)
  private String logo;

  public static final String SERIALIZED_NAME_NAME = "name";
  @SerializedName(SERIALIZED_NAME_NAME)
  private String name;

  public static final String SERIALIZED_NAME_PARENT_SERVICE_CODE = "parent_service_code";
  @SerializedName(SERIALIZED_NAME_PARENT_SERVICE_CODE)
  private String parentServiceCode;

  public static final String SERIALIZED_NAME_REGION = "region";
  @SerializedName(SERIALIZED_NAME_REGION)
  private String region;

  public static final String SERIALIZED_NAME_SERV_SEARCH_CATALOGS = "serv_search_catalogs";
  @SerializedName(SERIALIZED_NAME_SERV_SEARCH_CATALOGS)
  private String servSearchCatalogs;

  public static final String SERIALIZED_NAME_SERV_SEARCH_KEYWORDS = "serv_search_keywords";
  @SerializedName(SERIALIZED_NAME_SERV_SEARCH_KEYWORDS)
  private String servSearchKeywords;

  public static final String SERIALIZED_NAME_SERVICE_CODE = "service_code";
  @SerializedName(SERIALIZED_NAME_SERVICE_CODE)
  private String serviceCode;

  public static final String SERIALIZED_NAME_SERVICE_NAME = "service_name";
  @SerializedName(SERIALIZED_NAME_SERVICE_NAME)
  private String serviceName;

  public static final String SERIALIZED_NAME_SERVICE_TIME_END = "service_time_end";
  @SerializedName(SERIALIZED_NAME_SERVICE_TIME_END)
  private String serviceTimeEnd;

  public static final String SERIALIZED_NAME_SERVICE_TIME_START = "service_time_start";
  @SerializedName(SERIALIZED_NAME_SERVICE_TIME_START)
  private String serviceTimeStart;

  public static final String SERIALIZED_NAME_SHORT_DESC = "short_desc";
  @SerializedName(SERIALIZED_NAME_SHORT_DESC)
  private String shortDesc;

  public static final String SERIALIZED_NAME_SPEC_CODE = "spec_code";
  @SerializedName(SERIALIZED_NAME_SPEC_CODE)
  private String specCode;

  public static final String SERIALIZED_NAME_TEMPLATE_ID = "template_id";
  @SerializedName(SERIALIZED_NAME_TEMPLATE_ID)
  private String templateId;

  public SearchOrderDetailDataServiceItems() { 
  }

  public SearchOrderDetailDataServiceItems areaCodes(String areaCodes) {
    
    this.areaCodes = areaCodes;
    return this;
  }

   /**
   * 服务工单详情area_codes
   * @return areaCodes
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "1", value = "服务工单详情area_codes")

  public String getAreaCodes() {
    return areaCodes;
  }


  public void setAreaCodes(String areaCodes) {
    this.areaCodes = areaCodes;
  }


  public SearchOrderDetailDataServiceItems carrierCode(String carrierCode) {
    
    this.carrierCode = carrierCode;
    return this;
  }

   /**
   * carrier_code
   * @return carrierCode
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "2019021863152020", value = "carrier_code")

  public String getCarrierCode() {
    return carrierCode;
  }


  public void setCarrierCode(String carrierCode) {
    this.carrierCode = carrierCode;
  }


  public SearchOrderDetailDataServiceItems carrierList(String carrierList) {
    
    this.carrierList = carrierList;
    return this;
  }

   /**
   * 服务工单数据carrier_list
   * @return carrierList
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "111", value = "服务工单数据carrier_list")

  public String getCarrierList() {
    return carrierList;
  }


  public void setCarrierList(String carrierList) {
    this.carrierList = carrierList;
  }


  public SearchOrderDetailDataServiceItems categoryAttributeValue(String categoryAttributeValue) {
    
    this.categoryAttributeValue = categoryAttributeValue;
    return this;
  }

   /**
   * 服务工单category_attribute_value
   * @return categoryAttributeValue
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "111", value = "服务工单category_attribute_value")

  public String getCategoryAttributeValue() {
    return categoryAttributeValue;
  }


  public void setCategoryAttributeValue(String categoryAttributeValue) {
    this.categoryAttributeValue = categoryAttributeValue;
  }


  public SearchOrderDetailDataServiceItems categoryCode(String categoryCode) {
    
    this.categoryCode = categoryCode;
    return this;
  }

   /**
   * 类目编码
   * @return categoryCode
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "C100038432", value = "类目编码")

  public String getCategoryCode() {
    return categoryCode;
  }


  public void setCategoryCode(String categoryCode) {
    this.categoryCode = categoryCode;
  }


  public SearchOrderDetailDataServiceItems categoryIds(String categoryIds) {
    
    this.categoryIds = categoryIds;
    return this;
  }

   /**
   * 类目id
   * @return categoryIds
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "XS3120", value = "类目id")

  public String getCategoryIds() {
    return categoryIds;
  }


  public void setCategoryIds(String categoryIds) {
    this.categoryIds = categoryIds;
  }


  public SearchOrderDetailDataServiceItems channelType(String channelType) {
    
    this.channelType = channelType;
    return this;
  }

   /**
   * 渠道类型
   * @return channelType
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "MERCHANT_SELF_MANAGE_MINI_APP", value = "渠道类型")

  public String getChannelType() {
    return channelType;
  }


  public void setChannelType(String channelType) {
    this.channelType = channelType;
  }


  public SearchOrderDetailDataServiceItems desc(String desc) {
    
    this.desc = desc;
    return this;
  }

   /**
   * 描述信息
   * @return desc
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "描述信息", value = "描述信息")

  public String getDesc() {
    return desc;
  }


  public void setDesc(String desc) {
    this.desc = desc;
  }


  public SearchOrderDetailDataServiceItems img(String img) {
    
    this.img = img;
    return this;
  }

   /**
   * img地址
   * @return img
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "https://mdn.alipayobjects.com/openpt_appstore/afts/img/A*1o71SaApF5YAAAAAAAAAAAAAATcnAQ/original", value = "img地址")

  public String getImg() {
    return img;
  }


  public void setImg(String img) {
    this.img = img;
  }


  public SearchOrderDetailDataServiceItems keyWord(String keyWord) {
    
    this.keyWord = keyWord;
    return this;
  }

   /**
   * 关键词
   * @return keyWord
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "关键词", value = "关键词")

  public String getKeyWord() {
    return keyWord;
  }


  public void setKeyWord(String keyWord) {
    this.keyWord = keyWord;
  }


  public SearchOrderDetailDataServiceItems keyWordList(String keyWordList) {
    
    this.keyWordList = keyWordList;
    return this;
  }

   /**
   * 关键词列表
   * @return keyWordList
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "测试", value = "关键词列表")

  public String getKeyWordList() {
    return keyWordList;
  }


  public void setKeyWordList(String keyWordList) {
    this.keyWordList = keyWordList;
  }


  public SearchOrderDetailDataServiceItems logo(String logo) {
    
    this.logo = logo;
    return this;
  }

   /**
   * logo图片地址
   * @return logo
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "https://mdn.alipayobjects.com/openpt_appstore/afts/img/A*1o71SaApF5YAAAAAAAAAAAAAATcnAQ/original", value = "logo图片地址")

  public String getLogo() {
    return logo;
  }


  public void setLogo(String logo) {
    this.logo = logo;
  }


  public SearchOrderDetailDataServiceItems name(String name) {
    
    this.name = name;
    return this;
  }

   /**
   * 应用名称
   * @return name
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "应用名称", value = "应用名称")

  public String getName() {
    return name;
  }


  public void setName(String name) {
    this.name = name;
  }


  public SearchOrderDetailDataServiceItems parentServiceCode(String parentServiceCode) {
    
    this.parentServiceCode = parentServiceCode;
    return this;
  }

   /**
   * 服务编码
   * @return parentServiceCode
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "2019041721000201048200", value = "服务编码")

  public String getParentServiceCode() {
    return parentServiceCode;
  }


  public void setParentServiceCode(String parentServiceCode) {
    this.parentServiceCode = parentServiceCode;
  }


  public SearchOrderDetailDataServiceItems region(String region) {
    
    this.region = region;
    return this;
  }

   /**
   * 服务工单详情region
   * @return region
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "1", value = "服务工单详情region")

  public String getRegion() {
    return region;
  }


  public void setRegion(String region) {
    this.region = region;
  }


  public SearchOrderDetailDataServiceItems servSearchCatalogs(String servSearchCatalogs) {
    
    this.servSearchCatalogs = servSearchCatalogs;
    return this;
  }

   /**
   * serv_search_catalogs
   * @return servSearchCatalogs
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "C100038432", value = "serv_search_catalogs")

  public String getServSearchCatalogs() {
    return servSearchCatalogs;
  }


  public void setServSearchCatalogs(String servSearchCatalogs) {
    this.servSearchCatalogs = servSearchCatalogs;
  }


  public SearchOrderDetailDataServiceItems servSearchKeywords(String servSearchKeywords) {
    
    this.servSearchKeywords = servSearchKeywords;
    return this;
  }

   /**
   * 关键词
   * @return servSearchKeywords
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "关键词", value = "关键词")

  public String getServSearchKeywords() {
    return servSearchKeywords;
  }


  public void setServSearchKeywords(String servSearchKeywords) {
    this.servSearchKeywords = servSearchKeywords;
  }


  public SearchOrderDetailDataServiceItems serviceCode(String serviceCode) {
    
    this.serviceCode = serviceCode;
    return this;
  }

   /**
   * 2020112321000021082348
   * @return serviceCode
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "2019121121000102523089", value = "2020112321000021082348")

  public String getServiceCode() {
    return serviceCode;
  }


  public void setServiceCode(String serviceCode) {
    this.serviceCode = serviceCode;
  }


  public SearchOrderDetailDataServiceItems serviceName(String serviceName) {
    
    this.serviceName = serviceName;
    return this;
  }

   /**
   * 服务名称
   * @return serviceName
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "测试1", value = "服务名称")

  public String getServiceName() {
    return serviceName;
  }


  public void setServiceName(String serviceName) {
    this.serviceName = serviceName;
  }


  public SearchOrderDetailDataServiceItems serviceTimeEnd(String serviceTimeEnd) {
    
    this.serviceTimeEnd = serviceTimeEnd;
    return this;
  }

   /**
   * 服务结束时间
   * @return serviceTimeEnd
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "23:59:59", value = "服务结束时间")

  public String getServiceTimeEnd() {
    return serviceTimeEnd;
  }


  public void setServiceTimeEnd(String serviceTimeEnd) {
    this.serviceTimeEnd = serviceTimeEnd;
  }


  public SearchOrderDetailDataServiceItems serviceTimeStart(String serviceTimeStart) {
    
    this.serviceTimeStart = serviceTimeStart;
    return this;
  }

   /**
   * 服务开始时间
   * @return serviceTimeStart
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "00:00:00", value = "服务开始时间")

  public String getServiceTimeStart() {
    return serviceTimeStart;
  }


  public void setServiceTimeStart(String serviceTimeStart) {
    this.serviceTimeStart = serviceTimeStart;
  }


  public SearchOrderDetailDataServiceItems shortDesc(String shortDesc) {
    
    this.shortDesc = shortDesc;
    return this;
  }

   /**
   * 服务短描述
   * @return shortDesc
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "服务短描述", value = "服务短描述")

  public String getShortDesc() {
    return shortDesc;
  }


  public void setShortDesc(String shortDesc) {
    this.shortDesc = shortDesc;
  }


  public SearchOrderDetailDataServiceItems specCode(String specCode) {
    
    this.specCode = specCode;
    return this;
  }

   /**
   * 应用标识
   * @return specCode
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "SP_SEARCH_SERVICE", value = "应用标识")

  public String getSpecCode() {
    return specCode;
  }


  public void setSpecCode(String specCode) {
    this.specCode = specCode;
  }


  public SearchOrderDetailDataServiceItems templateId(String templateId) {
    
    this.templateId = templateId;
    return this;
  }

   /**
   * 模板id
   * @return templateId
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "WALLET-SEARCH@boxFunctionCommon", value = "模板id")

  public String getTemplateId() {
    return templateId;
  }


  public void setTemplateId(String templateId) {
    this.templateId = templateId;
  }

  /**
   * 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 SearchOrderDetailDataServiceItems instance itself
   */
  public SearchOrderDetailDataServiceItems 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;
    }
    SearchOrderDetailDataServiceItems searchOrderDetailDataServiceItems = (SearchOrderDetailDataServiceItems) o;
    return Objects.equals(this.areaCodes, searchOrderDetailDataServiceItems.areaCodes) &&
        Objects.equals(this.carrierCode, searchOrderDetailDataServiceItems.carrierCode) &&
        Objects.equals(this.carrierList, searchOrderDetailDataServiceItems.carrierList) &&
        Objects.equals(this.categoryAttributeValue, searchOrderDetailDataServiceItems.categoryAttributeValue) &&
        Objects.equals(this.categoryCode, searchOrderDetailDataServiceItems.categoryCode) &&
        Objects.equals(this.categoryIds, searchOrderDetailDataServiceItems.categoryIds) &&
        Objects.equals(this.channelType, searchOrderDetailDataServiceItems.channelType) &&
        Objects.equals(this.desc, searchOrderDetailDataServiceItems.desc) &&
        Objects.equals(this.img, searchOrderDetailDataServiceItems.img) &&
        Objects.equals(this.keyWord, searchOrderDetailDataServiceItems.keyWord) &&
        Objects.equals(this.keyWordList, searchOrderDetailDataServiceItems.keyWordList) &&
        Objects.equals(this.logo, searchOrderDetailDataServiceItems.logo) &&
        Objects.equals(this.name, searchOrderDetailDataServiceItems.name) &&
        Objects.equals(this.parentServiceCode, searchOrderDetailDataServiceItems.parentServiceCode) &&
        Objects.equals(this.region, searchOrderDetailDataServiceItems.region) &&
        Objects.equals(this.servSearchCatalogs, searchOrderDetailDataServiceItems.servSearchCatalogs) &&
        Objects.equals(this.servSearchKeywords, searchOrderDetailDataServiceItems.servSearchKeywords) &&
        Objects.equals(this.serviceCode, searchOrderDetailDataServiceItems.serviceCode) &&
        Objects.equals(this.serviceName, searchOrderDetailDataServiceItems.serviceName) &&
        Objects.equals(this.serviceTimeEnd, searchOrderDetailDataServiceItems.serviceTimeEnd) &&
        Objects.equals(this.serviceTimeStart, searchOrderDetailDataServiceItems.serviceTimeStart) &&
        Objects.equals(this.shortDesc, searchOrderDetailDataServiceItems.shortDesc) &&
        Objects.equals(this.specCode, searchOrderDetailDataServiceItems.specCode) &&
        Objects.equals(this.templateId, searchOrderDetailDataServiceItems.templateId)&&
        Objects.equals(this.additionalProperties, searchOrderDetailDataServiceItems.additionalProperties);
  }

  @Override
  public int hashCode() {
    return Objects.hash(areaCodes, carrierCode, carrierList, categoryAttributeValue, categoryCode, categoryIds, channelType, desc, img, keyWord, keyWordList, logo, name, parentServiceCode, region, servSearchCatalogs, servSearchKeywords, serviceCode, serviceName, serviceTimeEnd, serviceTimeStart, shortDesc, specCode, templateId, additionalProperties);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class SearchOrderDetailDataServiceItems {\n");
    sb.append("    areaCodes: ").append(toIndentedString(areaCodes)).append("\n");
    sb.append("    carrierCode: ").append(toIndentedString(carrierCode)).append("\n");
    sb.append("    carrierList: ").append(toIndentedString(carrierList)).append("\n");
    sb.append("    categoryAttributeValue: ").append(toIndentedString(categoryAttributeValue)).append("\n");
    sb.append("    categoryCode: ").append(toIndentedString(categoryCode)).append("\n");
    sb.append("    categoryIds: ").append(toIndentedString(categoryIds)).append("\n");
    sb.append("    channelType: ").append(toIndentedString(channelType)).append("\n");
    sb.append("    desc: ").append(toIndentedString(desc)).append("\n");
    sb.append("    img: ").append(toIndentedString(img)).append("\n");
    sb.append("    keyWord: ").append(toIndentedString(keyWord)).append("\n");
    sb.append("    keyWordList: ").append(toIndentedString(keyWordList)).append("\n");
    sb.append("    logo: ").append(toIndentedString(logo)).append("\n");
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    parentServiceCode: ").append(toIndentedString(parentServiceCode)).append("\n");
    sb.append("    region: ").append(toIndentedString(region)).append("\n");
    sb.append("    servSearchCatalogs: ").append(toIndentedString(servSearchCatalogs)).append("\n");
    sb.append("    servSearchKeywords: ").append(toIndentedString(servSearchKeywords)).append("\n");
    sb.append("    serviceCode: ").append(toIndentedString(serviceCode)).append("\n");
    sb.append("    serviceName: ").append(toIndentedString(serviceName)).append("\n");
    sb.append("    serviceTimeEnd: ").append(toIndentedString(serviceTimeEnd)).append("\n");
    sb.append("    serviceTimeStart: ").append(toIndentedString(serviceTimeStart)).append("\n");
    sb.append("    shortDesc: ").append(toIndentedString(shortDesc)).append("\n");
    sb.append("    specCode: ").append(toIndentedString(specCode)).append("\n");
    sb.append("    templateId: ").append(toIndentedString(templateId)).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("area_codes");
    openapiFields.add("carrier_code");
    openapiFields.add("carrier_list");
    openapiFields.add("category_attribute_value");
    openapiFields.add("category_code");
    openapiFields.add("category_ids");
    openapiFields.add("channel_type");
    openapiFields.add("desc");
    openapiFields.add("img");
    openapiFields.add("key_word");
    openapiFields.add("key_word_list");
    openapiFields.add("logo");
    openapiFields.add("name");
    openapiFields.add("parent_service_code");
    openapiFields.add("region");
    openapiFields.add("serv_search_catalogs");
    openapiFields.add("serv_search_keywords");
    openapiFields.add("service_code");
    openapiFields.add("service_name");
    openapiFields.add("service_time_end");
    openapiFields.add("service_time_start");
    openapiFields.add("short_desc");
    openapiFields.add("spec_code");
    openapiFields.add("template_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 SearchOrderDetailDataServiceItems
  */
  public static void validateJsonObject(JsonObject jsonObj) throws IOException {
      if (jsonObj == null) {
        if (SearchOrderDetailDataServiceItems.openapiRequiredFields.isEmpty()) {
          return;
        } else { // has required fields
          throw new IllegalArgumentException(String.format("The required field(s) %s in SearchOrderDetailDataServiceItems is not found in the empty JSON string", SearchOrderDetailDataServiceItems.openapiRequiredFields.toString()));
        }
      }
      if (jsonObj.get("area_codes") != null && !jsonObj.get("area_codes").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `area_codes` to be a primitive type in the JSON string but got `%s`", jsonObj.get("area_codes").toString()));
      }
      if (jsonObj.get("carrier_code") != null && !jsonObj.get("carrier_code").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `carrier_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carrier_code").toString()));
      }
      if (jsonObj.get("carrier_list") != null && !jsonObj.get("carrier_list").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `carrier_list` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carrier_list").toString()));
      }
      if (jsonObj.get("category_attribute_value") != null && !jsonObj.get("category_attribute_value").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `category_attribute_value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("category_attribute_value").toString()));
      }
      if (jsonObj.get("category_code") != null && !jsonObj.get("category_code").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `category_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("category_code").toString()));
      }
      if (jsonObj.get("category_ids") != null && !jsonObj.get("category_ids").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `category_ids` to be a primitive type in the JSON string but got `%s`", jsonObj.get("category_ids").toString()));
      }
      if (jsonObj.get("channel_type") != null && !jsonObj.get("channel_type").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `channel_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("channel_type").toString()));
      }
      if (jsonObj.get("desc") != null && !jsonObj.get("desc").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `desc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("desc").toString()));
      }
      if (jsonObj.get("img") != null && !jsonObj.get("img").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `img` to be a primitive type in the JSON string but got `%s`", jsonObj.get("img").toString()));
      }
      if (jsonObj.get("key_word") != null && !jsonObj.get("key_word").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `key_word` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key_word").toString()));
      }
      if (jsonObj.get("key_word_list") != null && !jsonObj.get("key_word_list").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `key_word_list` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key_word_list").toString()));
      }
      if (jsonObj.get("logo") != null && !jsonObj.get("logo").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `logo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logo").toString()));
      }
      if (jsonObj.get("name") != null && !jsonObj.get("name").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
      }
      if (jsonObj.get("parent_service_code") != null && !jsonObj.get("parent_service_code").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `parent_service_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("parent_service_code").toString()));
      }
      if (jsonObj.get("region") != null && !jsonObj.get("region").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `region` to be a primitive type in the JSON string but got `%s`", jsonObj.get("region").toString()));
      }
      if (jsonObj.get("serv_search_catalogs") != null && !jsonObj.get("serv_search_catalogs").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `serv_search_catalogs` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serv_search_catalogs").toString()));
      }
      if (jsonObj.get("serv_search_keywords") != null && !jsonObj.get("serv_search_keywords").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `serv_search_keywords` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serv_search_keywords").toString()));
      }
      if (jsonObj.get("service_code") != null && !jsonObj.get("service_code").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `service_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("service_code").toString()));
      }
      if (jsonObj.get("service_name") != null && !jsonObj.get("service_name").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `service_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("service_name").toString()));
      }
      if (jsonObj.get("service_time_end") != null && !jsonObj.get("service_time_end").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `service_time_end` to be a primitive type in the JSON string but got `%s`", jsonObj.get("service_time_end").toString()));
      }
      if (jsonObj.get("service_time_start") != null && !jsonObj.get("service_time_start").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `service_time_start` to be a primitive type in the JSON string but got `%s`", jsonObj.get("service_time_start").toString()));
      }
      if (jsonObj.get("short_desc") != null && !jsonObj.get("short_desc").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `short_desc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("short_desc").toString()));
      }
      if (jsonObj.get("spec_code") != null && !jsonObj.get("spec_code").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `spec_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("spec_code").toString()));
      }
      if (jsonObj.get("template_id") != null && !jsonObj.get("template_id").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `template_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("template_id").toString()));
      }
  }

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

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

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





© 2015 - 2024 Weber Informatics LLC | Privacy Policy