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

com.kibocommerce.sdk.inventory.models.LocationResponseAllOf Maven / Gradle / Ivy

The newest version!
/*
 * Inventory
 * Swagger JSON for inventory apis
 *
 * The version of the OpenAPI document: 1.0.0
 * 
 *
 * 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.kibocommerce.sdk.inventory.models;

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 java.io.Serializable;

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.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

import com.kibocommerce.sdk.common.JSON;

/**
 * LocationResponseAllOf
 */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class LocationResponseAllOf implements Serializable {
  private static final long serialVersionUID = 1L;

  public static final String SERIALIZED_NAME_LOCATION_I_D = "locationID";
  @SerializedName(SERIALIZED_NAME_LOCATION_I_D)
  private Integer locationID;

  public static final String SERIALIZED_NAME_TENANT_I_D = "tenantID";
  @SerializedName(SERIALIZED_NAME_TENANT_I_D)
  private Integer tenantID;

  public static final String SERIALIZED_NAME_LOCATION_CODE = "locationCode";
  @SerializedName(SERIALIZED_NAME_LOCATION_CODE)
  private String locationCode;

  public static final String SERIALIZED_NAME_EXPRESS = "express";
  @SerializedName(SERIALIZED_NAME_EXPRESS)
  private Boolean express;

  public static final String SERIALIZED_NAME_INCLUDE_IN_LOCATION_EXPORT = "includeInLocationExport";
  @SerializedName(SERIALIZED_NAME_INCLUDE_IN_LOCATION_EXPORT)
  private Boolean includeInLocationExport;

  public static final String SERIALIZED_NAME_INCLUDE_IN_AGGREGATE = "includeInAggregate";
  @SerializedName(SERIALIZED_NAME_INCLUDE_IN_AGGREGATE)
  private Boolean includeInAggregate;

  public static final String SERIALIZED_NAME_ACTIVE = "active";
  @SerializedName(SERIALIZED_NAME_ACTIVE)
  private Boolean active;

  public static final String SERIALIZED_NAME_DIRECT_SHIP = "directShip";
  @SerializedName(SERIALIZED_NAME_DIRECT_SHIP)
  private Boolean directShip;

  public static final String SERIALIZED_NAME_PICKUP = "pickup";
  @SerializedName(SERIALIZED_NAME_PICKUP)
  private Boolean pickup;

  public static final String SERIALIZED_NAME_TRANSFER_ENABLED = "transferEnabled";
  @SerializedName(SERIALIZED_NAME_TRANSFER_ENABLED)
  private Boolean transferEnabled;

  public static final String SERIALIZED_NAME_POSTAL_CODE = "postalCode";
  @SerializedName(SERIALIZED_NAME_POSTAL_CODE)
  private String postalCode;

  public static final String SERIALIZED_NAME_COUNTRY_CODE = "countryCode";
  @SerializedName(SERIALIZED_NAME_COUNTRY_CODE)
  private String countryCode;

  public static final String SERIALIZED_NAME_LATITUDE = "latitude";
  @SerializedName(SERIALIZED_NAME_LATITUDE)
  private Float latitude = null;

  public static final String SERIALIZED_NAME_LONGITUDE = "longitude";
  @SerializedName(SERIALIZED_NAME_LONGITUDE)
  private Float longitude = null;

  public static final String SERIALIZED_NAME_LOCATION_NAME = "locationName";
  @SerializedName(SERIALIZED_NAME_LOCATION_NAME)
  private String locationName;

  public static final String SERIALIZED_NAME_WMS_ENABLED = "wmsEnabled";
  @SerializedName(SERIALIZED_NAME_WMS_ENABLED)
  private Boolean wmsEnabled;

  public LocationResponseAllOf() {
  }

  public LocationResponseAllOf locationID(Integer locationID) {
    
    this.locationID = locationID;
    return this;
  }

   /**
   * Internal Location ID
   * @return locationID
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Internal Location ID")

  public Integer getLocationID() {
    return locationID;
  }


  public void setLocationID(Integer locationID) {
    this.locationID = locationID;
  }


  public LocationResponseAllOf tenantID(Integer tenantID) {
    
    this.tenantID = tenantID;
    return this;
  }

   /**
   * Tenant ID
   * @return tenantID
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Tenant ID")

  public Integer getTenantID() {
    return tenantID;
  }


  public void setTenantID(Integer tenantID) {
    this.tenantID = tenantID;
  }


  public LocationResponseAllOf locationCode(String locationCode) {
    
    this.locationCode = locationCode;
    return this;
  }

   /**
   * Location Code
   * @return locationCode
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Location Code")

  public String getLocationCode() {
    return locationCode;
  }


  public void setLocationCode(String locationCode) {
    this.locationCode = locationCode;
  }


  public LocationResponseAllOf express(Boolean express) {
    
    this.express = express;
    return this;
  }

   /**
   * Flag for whether the location is express enabled or not
   * @return express
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Flag for whether the location is express enabled or not")

  public Boolean getExpress() {
    return express;
  }


  public void setExpress(Boolean express) {
    this.express = express;
  }


  public LocationResponseAllOf includeInLocationExport(Boolean includeInLocationExport) {
    
    this.includeInLocationExport = includeInLocationExport;
    return this;
  }

   /**
   * Flag for whether the location is to be included in location exports
   * @return includeInLocationExport
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Flag for whether the location is to be included in location exports")

  public Boolean getIncludeInLocationExport() {
    return includeInLocationExport;
  }


  public void setIncludeInLocationExport(Boolean includeInLocationExport) {
    this.includeInLocationExport = includeInLocationExport;
  }


  public LocationResponseAllOf includeInAggregate(Boolean includeInAggregate) {
    
    this.includeInAggregate = includeInAggregate;
    return this;
  }

   /**
   * Flag for whether the location is to be included in aggregate exports
   * @return includeInAggregate
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Flag for whether the location is to be included in aggregate exports")

  public Boolean getIncludeInAggregate() {
    return includeInAggregate;
  }


  public void setIncludeInAggregate(Boolean includeInAggregate) {
    this.includeInAggregate = includeInAggregate;
  }


  public LocationResponseAllOf active(Boolean active) {
    
    this.active = active;
    return this;
  }

   /**
   * Flag for whether the location is active
   * @return active
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Flag for whether the location is active")

  public Boolean getActive() {
    return active;
  }


  public void setActive(Boolean active) {
    this.active = active;
  }


  public LocationResponseAllOf directShip(Boolean directShip) {
    
    this.directShip = directShip;
    return this;
  }

   /**
   * Flag for whether the location allows Direct Ship (STH) orders
   * @return directShip
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Flag for whether the location allows Direct Ship (STH) orders")

  public Boolean getDirectShip() {
    return directShip;
  }


  public void setDirectShip(Boolean directShip) {
    this.directShip = directShip;
  }


  public LocationResponseAllOf pickup(Boolean pickup) {
    
    this.pickup = pickup;
    return this;
  }

   /**
   * Flag for whether the location allows Pickup (BOPIS) orders
   * @return pickup
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Flag for whether the location allows Pickup (BOPIS) orders")

  public Boolean getPickup() {
    return pickup;
  }


  public void setPickup(Boolean pickup) {
    this.pickup = pickup;
  }


  public LocationResponseAllOf transferEnabled(Boolean transferEnabled) {
    
    this.transferEnabled = transferEnabled;
    return this;
  }

   /**
   * Flag for whether the location allows Transfer orders
   * @return transferEnabled
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Flag for whether the location allows Transfer orders")

  public Boolean getTransferEnabled() {
    return transferEnabled;
  }


  public void setTransferEnabled(Boolean transferEnabled) {
    this.transferEnabled = transferEnabled;
  }


  public LocationResponseAllOf postalCode(String postalCode) {
    
    this.postalCode = postalCode;
    return this;
  }

   /**
   * Postal Code
   * @return postalCode
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Postal Code")

  public String getPostalCode() {
    return postalCode;
  }


  public void setPostalCode(String postalCode) {
    this.postalCode = postalCode;
  }


  public LocationResponseAllOf countryCode(String countryCode) {
    
    this.countryCode = countryCode;
    return this;
  }

   /**
   * Country Code
   * @return countryCode
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Country Code")

  public String getCountryCode() {
    return countryCode;
  }


  public void setCountryCode(String countryCode) {
    this.countryCode = countryCode;
  }


  public LocationResponseAllOf latitude(Float latitude) {
    
    this.latitude = latitude;
    return this;
  }

   /**
   * Latitude
   * @return latitude
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Latitude")

  public Float getLatitude() {
    return latitude;
  }


  public void setLatitude(Float latitude) {
    this.latitude = latitude;
  }


  public LocationResponseAllOf longitude(Float longitude) {
    
    this.longitude = longitude;
    return this;
  }

   /**
   * Longitude
   * @return longitude
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Longitude")

  public Float getLongitude() {
    return longitude;
  }


  public void setLongitude(Float longitude) {
    this.longitude = longitude;
  }


  public LocationResponseAllOf locationName(String locationName) {
    
    this.locationName = locationName;
    return this;
  }

   /**
   * Location Name
   * @return locationName
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Location Name")

  public String getLocationName() {
    return locationName;
  }


  public void setLocationName(String locationName) {
    this.locationName = locationName;
  }


  public LocationResponseAllOf wmsEnabled(Boolean wmsEnabled) {
    
    this.wmsEnabled = wmsEnabled;
    return this;
  }

   /**
   * Flag for whether the location is WMS Enabled
   * @return wmsEnabled
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Flag for whether the location is WMS Enabled")

  public Boolean getWmsEnabled() {
    return wmsEnabled;
  }


  public void setWmsEnabled(Boolean wmsEnabled) {
    this.wmsEnabled = wmsEnabled;
  }



  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    LocationResponseAllOf locationResponseAllOf = (LocationResponseAllOf) o;
    return Objects.equals(this.locationID, locationResponseAllOf.locationID) &&
        Objects.equals(this.tenantID, locationResponseAllOf.tenantID) &&
        Objects.equals(this.locationCode, locationResponseAllOf.locationCode) &&
        Objects.equals(this.express, locationResponseAllOf.express) &&
        Objects.equals(this.includeInLocationExport, locationResponseAllOf.includeInLocationExport) &&
        Objects.equals(this.includeInAggregate, locationResponseAllOf.includeInAggregate) &&
        Objects.equals(this.active, locationResponseAllOf.active) &&
        Objects.equals(this.directShip, locationResponseAllOf.directShip) &&
        Objects.equals(this.pickup, locationResponseAllOf.pickup) &&
        Objects.equals(this.transferEnabled, locationResponseAllOf.transferEnabled) &&
        Objects.equals(this.postalCode, locationResponseAllOf.postalCode) &&
        Objects.equals(this.countryCode, locationResponseAllOf.countryCode) &&
        Objects.equals(this.latitude, locationResponseAllOf.latitude) &&
        Objects.equals(this.longitude, locationResponseAllOf.longitude) &&
        Objects.equals(this.locationName, locationResponseAllOf.locationName) &&
        Objects.equals(this.wmsEnabled, locationResponseAllOf.wmsEnabled);
  }

  @Override
  public int hashCode() {
    return Objects.hash(locationID, tenantID, locationCode, express, includeInLocationExport, includeInAggregate, active, directShip, pickup, transferEnabled, postalCode, countryCode, latitude, longitude, locationName, wmsEnabled);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class LocationResponseAllOf {\n");
    sb.append("    locationID: ").append(toIndentedString(locationID)).append("\n");
    sb.append("    tenantID: ").append(toIndentedString(tenantID)).append("\n");
    sb.append("    locationCode: ").append(toIndentedString(locationCode)).append("\n");
    sb.append("    express: ").append(toIndentedString(express)).append("\n");
    sb.append("    includeInLocationExport: ").append(toIndentedString(includeInLocationExport)).append("\n");
    sb.append("    includeInAggregate: ").append(toIndentedString(includeInAggregate)).append("\n");
    sb.append("    active: ").append(toIndentedString(active)).append("\n");
    sb.append("    directShip: ").append(toIndentedString(directShip)).append("\n");
    sb.append("    pickup: ").append(toIndentedString(pickup)).append("\n");
    sb.append("    transferEnabled: ").append(toIndentedString(transferEnabled)).append("\n");
    sb.append("    postalCode: ").append(toIndentedString(postalCode)).append("\n");
    sb.append("    countryCode: ").append(toIndentedString(countryCode)).append("\n");
    sb.append("    latitude: ").append(toIndentedString(latitude)).append("\n");
    sb.append("    longitude: ").append(toIndentedString(longitude)).append("\n");
    sb.append("    locationName: ").append(toIndentedString(locationName)).append("\n");
    sb.append("    wmsEnabled: ").append(toIndentedString(wmsEnabled)).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("locationID");
    openapiFields.add("tenantID");
    openapiFields.add("locationCode");
    openapiFields.add("express");
    openapiFields.add("includeInLocationExport");
    openapiFields.add("includeInAggregate");
    openapiFields.add("active");
    openapiFields.add("directShip");
    openapiFields.add("pickup");
    openapiFields.add("transferEnabled");
    openapiFields.add("postalCode");
    openapiFields.add("countryCode");
    openapiFields.add("latitude");
    openapiFields.add("longitude");
    openapiFields.add("locationName");
    openapiFields.add("wmsEnabled");

    // 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 LocationResponseAllOf
  */
  public static void validateJsonObject(JsonObject jsonObj) throws IOException {
      if (jsonObj == null) {
        if (!LocationResponseAllOf.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
          throw new IllegalArgumentException(String.format("The required field(s) %s in LocationResponseAllOf is not found in the empty JSON string", LocationResponseAllOf.openapiRequiredFields.toString()));
        }
      }

      // Set> entries = jsonObj.entrySet();
      // check to see if the JSON string contains additional fields
      // for (Entry entry : entries) {
      //  if (!LocationResponseAllOf.openapiFields.contains(entry.getKey())) {
      //    throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `LocationResponseAllOf` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
      //    }
      //  }
      
      if ((jsonObj.get("locationCode") != null && !jsonObj.get("locationCode").isJsonNull()) && !jsonObj.get("locationCode").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `locationCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("locationCode").toString()));
      }
      if ((jsonObj.get("postalCode") != null && !jsonObj.get("postalCode").isJsonNull()) && !jsonObj.get("postalCode").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `postalCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("postalCode").toString()));
      }
      if ((jsonObj.get("countryCode") != null && !jsonObj.get("countryCode").isJsonNull()) && !jsonObj.get("countryCode").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `countryCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("countryCode").toString()));
      }
      if ((jsonObj.get("locationName") != null && !jsonObj.get("locationName").isJsonNull()) && !jsonObj.get("locationName").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `locationName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("locationName").toString()));
      }
  }

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

       return (TypeAdapter) new TypeAdapter() {
           @Override
           public void write(JsonWriter out, LocationResponseAllOf value) throws IOException {
             JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
             elementAdapter.write(out, obj);
           }

           @Override
           public LocationResponseAllOf read(JsonReader in) throws IOException {
             JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
             validateJsonObject(jsonObj);
             return thisAdapter.fromJsonTree(jsonObj);
           }

       }.nullSafe();
    }
  }

 /**
  * Create an instance of LocationResponseAllOf given an JSON string
  *
  * @param jsonString JSON string
  * @return An instance of LocationResponseAllOf
  * @throws IOException if the JSON string is invalid with respect to LocationResponseAllOf
  */
  public static LocationResponseAllOf fromJson(String jsonString) throws IOException {
    return JSON.getGson().fromJson(jsonString, LocationResponseAllOf.class);
  }

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





© 2015 - 2024 Weber Informatics LLC | Privacy Policy