com.kibocommerce.sdk.inventory.models.InventoryRequest 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 com.kibocommerce.sdk.inventory.models.ItemQuantity;
import com.kibocommerce.sdk.inventory.models.RequestLocation;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.time.OffsetDateTime;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
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;
/**
* Request for getting Inventory
*/
@ApiModel(description = "Request for getting Inventory")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class InventoryRequest implements Serializable {
private static final long serialVersionUID = 1L;
/**
* Inventory Request Type Enum
*/
@JsonAdapter(TypeEnum.Adapter.class)
public enum TypeEnum {
ALL("ALL"),
PARTIAL("PARTIAL"),
ANY("ANY"),
ALL_STORES("ALL_STORES");
private String value;
TypeEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static TypeEnum fromValue(String value) {
for (TypeEnum b : TypeEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter {
@Override
public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public TypeEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return TypeEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_TYPE = "type";
@SerializedName(SERIALIZED_NAME_TYPE)
private TypeEnum type;
public static final String SERIALIZED_NAME_ITEMS = "items";
@SerializedName(SERIALIZED_NAME_ITEMS)
private List items = new ArrayList<>();
public static final String SERIALIZED_NAME_REQUEST_LOCATION = "requestLocation";
@SerializedName(SERIALIZED_NAME_REQUEST_LOCATION)
private RequestLocation requestLocation;
public static final String SERIALIZED_NAME_LIMIT = "limit";
@SerializedName(SERIALIZED_NAME_LIMIT)
private Integer limit;
public static final String SERIALIZED_NAME_LOCATION_WHITELIST = "locationWhitelist";
@SerializedName(SERIALIZED_NAME_LOCATION_WHITELIST)
private List locationWhitelist = null;
public static final String SERIALIZED_NAME_LOCATION_PRIORITY_LIST = "locationPriorityList";
@SerializedName(SERIALIZED_NAME_LOCATION_PRIORITY_LIST)
private List locationPriorityList = null;
public static final String SERIALIZED_NAME_LOCATION_BLACKLIST = "locationBlacklist";
@SerializedName(SERIALIZED_NAME_LOCATION_BLACKLIST)
private List locationBlacklist = null;
public static final String SERIALIZED_NAME_IGNORE_SAFETY_STOCK = "ignoreSafetyStock";
@SerializedName(SERIALIZED_NAME_IGNORE_SAFETY_STOCK)
private Boolean ignoreSafetyStock;
public static final String SERIALIZED_NAME_INCLUDE_NEGATIVE_INVENTORY = "includeNegativeInventory";
@SerializedName(SERIALIZED_NAME_INCLUDE_NEGATIVE_INVENTORY)
private Boolean includeNegativeInventory;
public static final String SERIALIZED_NAME_DIRECT_SHIP = "directShip";
@SerializedName(SERIALIZED_NAME_DIRECT_SHIP)
private Boolean directShip;
public static final String SERIALIZED_NAME_TRANSFER_ENABLED = "transferEnabled";
@SerializedName(SERIALIZED_NAME_TRANSFER_ENABLED)
private Boolean transferEnabled;
public static final String SERIALIZED_NAME_PICKUP = "pickup";
@SerializedName(SERIALIZED_NAME_PICKUP)
private Boolean pickup;
public static final String SERIALIZED_NAME_INCLUDE_IN_AGGREGATE_EXPORT = "includeInAggregateExport";
@SerializedName(SERIALIZED_NAME_INCLUDE_IN_AGGREGATE_EXPORT)
private Boolean includeInAggregateExport;
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_EXCLUDE_BLOCKED_ASSIGNMENT = "excludeBlockedAssignment";
@SerializedName(SERIALIZED_NAME_EXCLUDE_BLOCKED_ASSIGNMENT)
private Boolean excludeBlockedAssignment;
public static final String SERIALIZED_NAME_INCLUDE_ATTRIBUTES = "includeAttributes";
@SerializedName(SERIALIZED_NAME_INCLUDE_ATTRIBUTES)
private Boolean includeAttributes;
public static final String SERIALIZED_NAME_INCLUDE_FUTURE_INVENTORY = "includeFutureInventory";
@SerializedName(SERIALIZED_NAME_INCLUDE_FUTURE_INVENTORY)
private Boolean includeFutureInventory;
public static final String SERIALIZED_NAME_INCLUDE_NEGATIVE_FUTURE_INVENTORY = "includeNegativeFutureInventory";
@SerializedName(SERIALIZED_NAME_INCLUDE_NEGATIVE_FUTURE_INVENTORY)
private Boolean includeNegativeFutureInventory;
public static final String SERIALIZED_NAME_DELIVERY_DATE_BEFORE = "deliveryDateBefore";
@SerializedName(SERIALIZED_NAME_DELIVERY_DATE_BEFORE)
private OffsetDateTime deliveryDateBefore = null;
public static final String SERIALIZED_NAME_DELIVERY_DATE_AFTER = "deliveryDateAfter";
@SerializedName(SERIALIZED_NAME_DELIVERY_DATE_AFTER)
private OffsetDateTime deliveryDateAfter = null;
/**
* What to sort the inventory results by. Only used for GetInventoryByLocation calls (locationCode must be set)
*/
@JsonAdapter(SortByEnumEnum.Adapter.class)
public enum SortByEnumEnum {
ON_HAND("ON_HAND"),
AVAILABLE("AVAILABLE"),
ALLOCATED("ALLOCATED"),
PART_NUMBER("PART_NUMBER"),
PRODUCT_ID("PRODUCT_ID");
private String value;
SortByEnumEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static SortByEnumEnum fromValue(String value) {
for (SortByEnumEnum b : SortByEnumEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter {
@Override
public void write(final JsonWriter jsonWriter, final SortByEnumEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public SortByEnumEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return SortByEnumEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_SORT_BY_ENUM = "sortByEnum";
@SerializedName(SERIALIZED_NAME_SORT_BY_ENUM)
private SortByEnumEnum sortByEnum;
public static final String SERIALIZED_NAME_SORT_DESCENDING = "sortDescending";
@SerializedName(SERIALIZED_NAME_SORT_DESCENDING)
private Boolean sortDescending;
public static final String SERIALIZED_NAME_FORCE_DEFAULTS_FOR_UNSPECIFIED_TAG_CATEGORIES = "forceDefaultsForUnspecifiedTagCategories";
@SerializedName(SERIALIZED_NAME_FORCE_DEFAULTS_FOR_UNSPECIFIED_TAG_CATEGORIES)
private Boolean forceDefaultsForUnspecifiedTagCategories;
public static final String SERIALIZED_NAME_TAGS = "tags";
@SerializedName(SERIALIZED_NAME_TAGS)
private Map tags = null;
public static final String SERIALIZED_NAME_LOCATION_CODE = "locationCode";
@SerializedName(SERIALIZED_NAME_LOCATION_CODE)
private String locationCode;
public static final String SERIALIZED_NAME_USER_I_D = "userID";
@SerializedName(SERIALIZED_NAME_USER_I_D)
private Integer userID;
public static final String SERIALIZED_NAME_PAGE_SIZE = "pageSize";
@SerializedName(SERIALIZED_NAME_PAGE_SIZE)
private Integer pageSize;
public static final String SERIALIZED_NAME_PAGE_NUM = "pageNum";
@SerializedName(SERIALIZED_NAME_PAGE_NUM)
private Integer pageNum;
public static final String SERIALIZED_NAME_SORT_BY = "sortBy";
@SerializedName(SERIALIZED_NAME_SORT_BY)
private String sortBy;
public InventoryRequest() {
}
public InventoryRequest type(TypeEnum type) {
this.type = type;
return this;
}
/**
* Inventory Request Type Enum
* @return type
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Inventory Request Type Enum")
public TypeEnum getType() {
return type;
}
public void setType(TypeEnum type) {
this.type = type;
}
public InventoryRequest items(List items) {
this.items = items;
return this;
}
public InventoryRequest addItemsItem(ItemQuantity itemsItem) {
this.items.add(itemsItem);
return this;
}
/**
* List of Items to search on
* @return items
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "List of Items to search on")
public List getItems() {
return items;
}
public void setItems(List items) {
this.items = items;
}
public InventoryRequest requestLocation(RequestLocation requestLocation) {
this.requestLocation = requestLocation;
return this;
}
/**
* Get requestLocation
* @return requestLocation
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public RequestLocation getRequestLocation() {
return requestLocation;
}
public void setRequestLocation(RequestLocation requestLocation) {
this.requestLocation = requestLocation;
}
public InventoryRequest limit(Integer limit) {
this.limit = limit;
return this;
}
/**
* The maximum number of results to return, defaults to 100 for most
* @return limit
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The maximum number of results to return, defaults to 100 for most")
public Integer getLimit() {
return limit;
}
public void setLimit(Integer limit) {
this.limit = limit;
}
public InventoryRequest locationWhitelist(List locationWhitelist) {
this.locationWhitelist = locationWhitelist;
return this;
}
public InventoryRequest addLocationWhitelistItem(String locationWhitelistItem) {
if (this.locationWhitelist == null) {
this.locationWhitelist = new ArrayList<>();
}
this.locationWhitelist.add(locationWhitelistItem);
return this;
}
/**
* List of location codes that are allowed to be included in results
* @return locationWhitelist
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "List of location codes that are allowed to be included in results")
public List getLocationWhitelist() {
return locationWhitelist;
}
public void setLocationWhitelist(List locationWhitelist) {
this.locationWhitelist = locationWhitelist;
}
public InventoryRequest locationPriorityList(List locationPriorityList) {
this.locationPriorityList = locationPriorityList;
return this;
}
public InventoryRequest addLocationPriorityListItem(String locationPriorityListItem) {
if (this.locationPriorityList == null) {
this.locationPriorityList = new ArrayList<>();
}
this.locationPriorityList.add(locationPriorityListItem);
return this;
}
/**
* List of location codes that should be returned before all others, preventing them from being excluded by limit
* @return locationPriorityList
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "List of location codes that should be returned before all others, preventing them from being excluded by limit")
public List getLocationPriorityList() {
return locationPriorityList;
}
public void setLocationPriorityList(List locationPriorityList) {
this.locationPriorityList = locationPriorityList;
}
public InventoryRequest locationBlacklist(List locationBlacklist) {
this.locationBlacklist = locationBlacklist;
return this;
}
public InventoryRequest addLocationBlacklistItem(String locationBlacklistItem) {
if (this.locationBlacklist == null) {
this.locationBlacklist = new ArrayList<>();
}
this.locationBlacklist.add(locationBlacklistItem);
return this;
}
/**
* List of location codes that are NOT allowed to be included in results
* @return locationBlacklist
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "List of location codes that are NOT allowed to be included in results")
public List getLocationBlacklist() {
return locationBlacklist;
}
public void setLocationBlacklist(List locationBlacklist) {
this.locationBlacklist = locationBlacklist;
}
public InventoryRequest ignoreSafetyStock(Boolean ignoreSafetyStock) {
this.ignoreSafetyStock = ignoreSafetyStock;
return this;
}
/**
* Whether to ignore the safety stock buffer put in place
* @return ignoreSafetyStock
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Whether to ignore the safety stock buffer put in place")
public Boolean getIgnoreSafetyStock() {
return ignoreSafetyStock;
}
public void setIgnoreSafetyStock(Boolean ignoreSafetyStock) {
this.ignoreSafetyStock = ignoreSafetyStock;
}
public InventoryRequest includeNegativeInventory(Boolean includeNegativeInventory) {
this.includeNegativeInventory = includeNegativeInventory;
return this;
}
/**
* Whether to allow items with negative inventory in the results
* @return includeNegativeInventory
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Whether to allow items with negative inventory in the results")
public Boolean getIncludeNegativeInventory() {
return includeNegativeInventory;
}
public void setIncludeNegativeInventory(Boolean includeNegativeInventory) {
this.includeNegativeInventory = includeNegativeInventory;
}
public InventoryRequest directShip(Boolean directShip) {
this.directShip = directShip;
return this;
}
/**
* Whether to limit results to locations that are shipping enabled
* @return directShip
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Whether to limit results to locations that are shipping enabled")
public Boolean getDirectShip() {
return directShip;
}
public void setDirectShip(Boolean directShip) {
this.directShip = directShip;
}
public InventoryRequest transferEnabled(Boolean transferEnabled) {
this.transferEnabled = transferEnabled;
return this;
}
/**
* Filter results by locations that have transfer enabled (true) or don't (false)
* @return transferEnabled
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Filter results by locations that have transfer enabled (true) or don't (false)")
public Boolean getTransferEnabled() {
return transferEnabled;
}
public void setTransferEnabled(Boolean transferEnabled) {
this.transferEnabled = transferEnabled;
}
public InventoryRequest pickup(Boolean pickup) {
this.pickup = pickup;
return this;
}
/**
* Filter results by locations that have finderbot enabled (true) or don't (false)
* @return pickup
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Filter results by locations that have finderbot enabled (true) or don't (false)")
public Boolean getPickup() {
return pickup;
}
public void setPickup(Boolean pickup) {
this.pickup = pickup;
}
public InventoryRequest includeInAggregateExport(Boolean includeInAggregateExport) {
this.includeInAggregateExport = includeInAggregateExport;
return this;
}
/**
* Filter results by locations that have aggregate export enabled (true) or don't (false)
* @return includeInAggregateExport
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Filter results by locations that have aggregate export enabled (true) or don't (false)")
public Boolean getIncludeInAggregateExport() {
return includeInAggregateExport;
}
public void setIncludeInAggregateExport(Boolean includeInAggregateExport) {
this.includeInAggregateExport = includeInAggregateExport;
}
public InventoryRequest includeInLocationExport(Boolean includeInLocationExport) {
this.includeInLocationExport = includeInLocationExport;
return this;
}
/**
* Filter results by locations that have physical storefronts (true) or don't (false)
* @return includeInLocationExport
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Filter results by locations that have physical storefronts (true) or don't (false)")
public Boolean getIncludeInLocationExport() {
return includeInLocationExport;
}
public void setIncludeInLocationExport(Boolean includeInLocationExport) {
this.includeInLocationExport = includeInLocationExport;
}
public InventoryRequest excludeBlockedAssignment(Boolean excludeBlockedAssignment) {
this.excludeBlockedAssignment = excludeBlockedAssignment;
return this;
}
/**
* Filter out results that are blocked from assignment (at the product/location level)
* @return excludeBlockedAssignment
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Filter out results that are blocked from assignment (at the product/location level) ")
public Boolean getExcludeBlockedAssignment() {
return excludeBlockedAssignment;
}
public void setExcludeBlockedAssignment(Boolean excludeBlockedAssignment) {
this.excludeBlockedAssignment = excludeBlockedAssignment;
}
public InventoryRequest includeAttributes(Boolean includeAttributes) {
this.includeAttributes = includeAttributes;
return this;
}
/**
* Flag to include attributes or not
* @return includeAttributes
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Flag to include attributes or not")
public Boolean getIncludeAttributes() {
return includeAttributes;
}
public void setIncludeAttributes(Boolean includeAttributes) {
this.includeAttributes = includeAttributes;
}
public InventoryRequest includeFutureInventory(Boolean includeFutureInventory) {
this.includeFutureInventory = includeFutureInventory;
return this;
}
/**
* If set to true, include future inventory in response (records that were set with a deliveryDate).
* @return includeFutureInventory
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "If set to true, include future inventory in response (records that were set with a deliveryDate).")
public Boolean getIncludeFutureInventory() {
return includeFutureInventory;
}
public void setIncludeFutureInventory(Boolean includeFutureInventory) {
this.includeFutureInventory = includeFutureInventory;
}
public InventoryRequest includeNegativeFutureInventory(Boolean includeNegativeFutureInventory) {
this.includeNegativeFutureInventory = includeNegativeFutureInventory;
return this;
}
/**
* Whether to allow items with negative future inventory in the results
* @return includeNegativeFutureInventory
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Whether to allow items with negative future inventory in the results")
public Boolean getIncludeNegativeFutureInventory() {
return includeNegativeFutureInventory;
}
public void setIncludeNegativeFutureInventory(Boolean includeNegativeFutureInventory) {
this.includeNegativeFutureInventory = includeNegativeFutureInventory;
}
public InventoryRequest deliveryDateBefore(OffsetDateTime deliveryDateBefore) {
this.deliveryDateBefore = deliveryDateBefore;
return this;
}
/**
* DateTime to filter for only future inventory with a delivery date before or equal to the given date
* @return deliveryDateBefore
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "DateTime to filter for only future inventory with a delivery date before or equal to the given date")
public OffsetDateTime getDeliveryDateBefore() {
return deliveryDateBefore;
}
public void setDeliveryDateBefore(OffsetDateTime deliveryDateBefore) {
this.deliveryDateBefore = deliveryDateBefore;
}
public InventoryRequest deliveryDateAfter(OffsetDateTime deliveryDateAfter) {
this.deliveryDateAfter = deliveryDateAfter;
return this;
}
/**
* DateTime to filter for only future inventory with a delivery date after or equal to the given date
* @return deliveryDateAfter
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "DateTime to filter for only future inventory with a delivery date after or equal to the given date")
public OffsetDateTime getDeliveryDateAfter() {
return deliveryDateAfter;
}
public void setDeliveryDateAfter(OffsetDateTime deliveryDateAfter) {
this.deliveryDateAfter = deliveryDateAfter;
}
public InventoryRequest sortByEnum(SortByEnumEnum sortByEnum) {
this.sortByEnum = sortByEnum;
return this;
}
/**
* What to sort the inventory results by. Only used for GetInventoryByLocation calls (locationCode must be set)
* @return sortByEnum
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "What to sort the inventory results by. Only used for GetInventoryByLocation calls (locationCode must be set)")
public SortByEnumEnum getSortByEnum() {
return sortByEnum;
}
public void setSortByEnum(SortByEnumEnum sortByEnum) {
this.sortByEnum = sortByEnum;
}
public InventoryRequest sortDescending(Boolean sortDescending) {
this.sortDescending = sortDescending;
return this;
}
/**
* Whether to sort by descending order or not. Must be used in conjunction with the sortByEnum value
* @return sortDescending
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Whether to sort by descending order or not. Must be used in conjunction with the sortByEnum value")
public Boolean getSortDescending() {
return sortDescending;
}
public void setSortDescending(Boolean sortDescending) {
this.sortDescending = sortDescending;
}
public InventoryRequest forceDefaultsForUnspecifiedTagCategories(Boolean forceDefaultsForUnspecifiedTagCategories) {
this.forceDefaultsForUnspecifiedTagCategories = forceDefaultsForUnspecifiedTagCategories;
return this;
}
/**
* Whether to force populate default tags onto the request if they are unspecified for any tag category
* @return forceDefaultsForUnspecifiedTagCategories
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Whether to force populate default tags onto the request if they are unspecified for any tag category")
public Boolean getForceDefaultsForUnspecifiedTagCategories() {
return forceDefaultsForUnspecifiedTagCategories;
}
public void setForceDefaultsForUnspecifiedTagCategories(Boolean forceDefaultsForUnspecifiedTagCategories) {
this.forceDefaultsForUnspecifiedTagCategories = forceDefaultsForUnspecifiedTagCategories;
}
public InventoryRequest tags(Map tags) {
this.tags = tags;
return this;
}
public InventoryRequest putTagsItem(String key, String tagsItem) {
if (this.tags == null) {
this.tags = new HashMap<>();
}
this.tags.put(key, tagsItem);
return this;
}
/**
* Associative Map of <String, String> for tagCategoryName => tagName
* @return tags
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Associative Map of for tagCategoryName => tagName")
public Map getTags() {
return tags;
}
public void setTags(Map tags) {
this.tags = tags;
}
public InventoryRequest 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 InventoryRequest userID(Integer userID) {
this.userID = userID;
return this;
}
/**
* user id
* @return userID
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "user id")
public Integer getUserID() {
return userID;
}
public void setUserID(Integer userID) {
this.userID = userID;
}
public InventoryRequest pageSize(Integer pageSize) {
this.pageSize = pageSize;
return this;
}
/**
* how many results to show per page
* @return pageSize
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "how many results to show per page")
public Integer getPageSize() {
return pageSize;
}
public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
}
public InventoryRequest pageNum(Integer pageNum) {
this.pageNum = pageNum;
return this;
}
/**
* which page to show
* @return pageNum
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "which page to show")
public Integer getPageNum() {
return pageNum;
}
public void setPageNum(Integer pageNum) {
this.pageNum = pageNum;
}
public InventoryRequest sortBy(String sortBy) {
this.sortBy = sortBy;
return this;
}
/**
* index to sort results by
* @return sortBy
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "index to sort results by")
public String getSortBy() {
return sortBy;
}
public void setSortBy(String sortBy) {
this.sortBy = sortBy;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
InventoryRequest inventoryRequest = (InventoryRequest) o;
return Objects.equals(this.type, inventoryRequest.type) &&
Objects.equals(this.items, inventoryRequest.items) &&
Objects.equals(this.requestLocation, inventoryRequest.requestLocation) &&
Objects.equals(this.limit, inventoryRequest.limit) &&
Objects.equals(this.locationWhitelist, inventoryRequest.locationWhitelist) &&
Objects.equals(this.locationPriorityList, inventoryRequest.locationPriorityList) &&
Objects.equals(this.locationBlacklist, inventoryRequest.locationBlacklist) &&
Objects.equals(this.ignoreSafetyStock, inventoryRequest.ignoreSafetyStock) &&
Objects.equals(this.includeNegativeInventory, inventoryRequest.includeNegativeInventory) &&
Objects.equals(this.directShip, inventoryRequest.directShip) &&
Objects.equals(this.transferEnabled, inventoryRequest.transferEnabled) &&
Objects.equals(this.pickup, inventoryRequest.pickup) &&
Objects.equals(this.includeInAggregateExport, inventoryRequest.includeInAggregateExport) &&
Objects.equals(this.includeInLocationExport, inventoryRequest.includeInLocationExport) &&
Objects.equals(this.excludeBlockedAssignment, inventoryRequest.excludeBlockedAssignment) &&
Objects.equals(this.includeAttributes, inventoryRequest.includeAttributes) &&
Objects.equals(this.includeFutureInventory, inventoryRequest.includeFutureInventory) &&
Objects.equals(this.includeNegativeFutureInventory, inventoryRequest.includeNegativeFutureInventory) &&
Objects.equals(this.deliveryDateBefore, inventoryRequest.deliveryDateBefore) &&
Objects.equals(this.deliveryDateAfter, inventoryRequest.deliveryDateAfter) &&
Objects.equals(this.sortByEnum, inventoryRequest.sortByEnum) &&
Objects.equals(this.sortDescending, inventoryRequest.sortDescending) &&
Objects.equals(this.forceDefaultsForUnspecifiedTagCategories, inventoryRequest.forceDefaultsForUnspecifiedTagCategories) &&
Objects.equals(this.tags, inventoryRequest.tags) &&
Objects.equals(this.locationCode, inventoryRequest.locationCode) &&
Objects.equals(this.userID, inventoryRequest.userID) &&
Objects.equals(this.pageSize, inventoryRequest.pageSize) &&
Objects.equals(this.pageNum, inventoryRequest.pageNum) &&
Objects.equals(this.sortBy, inventoryRequest.sortBy);
}
@Override
public int hashCode() {
return Objects.hash(type, items, requestLocation, limit, locationWhitelist, locationPriorityList, locationBlacklist, ignoreSafetyStock, includeNegativeInventory, directShip, transferEnabled, pickup, includeInAggregateExport, includeInLocationExport, excludeBlockedAssignment, includeAttributes, includeFutureInventory, includeNegativeFutureInventory, deliveryDateBefore, deliveryDateAfter, sortByEnum, sortDescending, forceDefaultsForUnspecifiedTagCategories, tags, locationCode, userID, pageSize, pageNum, sortBy);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class InventoryRequest {\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" items: ").append(toIndentedString(items)).append("\n");
sb.append(" requestLocation: ").append(toIndentedString(requestLocation)).append("\n");
sb.append(" limit: ").append(toIndentedString(limit)).append("\n");
sb.append(" locationWhitelist: ").append(toIndentedString(locationWhitelist)).append("\n");
sb.append(" locationPriorityList: ").append(toIndentedString(locationPriorityList)).append("\n");
sb.append(" locationBlacklist: ").append(toIndentedString(locationBlacklist)).append("\n");
sb.append(" ignoreSafetyStock: ").append(toIndentedString(ignoreSafetyStock)).append("\n");
sb.append(" includeNegativeInventory: ").append(toIndentedString(includeNegativeInventory)).append("\n");
sb.append(" directShip: ").append(toIndentedString(directShip)).append("\n");
sb.append(" transferEnabled: ").append(toIndentedString(transferEnabled)).append("\n");
sb.append(" pickup: ").append(toIndentedString(pickup)).append("\n");
sb.append(" includeInAggregateExport: ").append(toIndentedString(includeInAggregateExport)).append("\n");
sb.append(" includeInLocationExport: ").append(toIndentedString(includeInLocationExport)).append("\n");
sb.append(" excludeBlockedAssignment: ").append(toIndentedString(excludeBlockedAssignment)).append("\n");
sb.append(" includeAttributes: ").append(toIndentedString(includeAttributes)).append("\n");
sb.append(" includeFutureInventory: ").append(toIndentedString(includeFutureInventory)).append("\n");
sb.append(" includeNegativeFutureInventory: ").append(toIndentedString(includeNegativeFutureInventory)).append("\n");
sb.append(" deliveryDateBefore: ").append(toIndentedString(deliveryDateBefore)).append("\n");
sb.append(" deliveryDateAfter: ").append(toIndentedString(deliveryDateAfter)).append("\n");
sb.append(" sortByEnum: ").append(toIndentedString(sortByEnum)).append("\n");
sb.append(" sortDescending: ").append(toIndentedString(sortDescending)).append("\n");
sb.append(" forceDefaultsForUnspecifiedTagCategories: ").append(toIndentedString(forceDefaultsForUnspecifiedTagCategories)).append("\n");
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
sb.append(" locationCode: ").append(toIndentedString(locationCode)).append("\n");
sb.append(" userID: ").append(toIndentedString(userID)).append("\n");
sb.append(" pageSize: ").append(toIndentedString(pageSize)).append("\n");
sb.append(" pageNum: ").append(toIndentedString(pageNum)).append("\n");
sb.append(" sortBy: ").append(toIndentedString(sortBy)).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("type");
openapiFields.add("items");
openapiFields.add("requestLocation");
openapiFields.add("limit");
openapiFields.add("locationWhitelist");
openapiFields.add("locationPriorityList");
openapiFields.add("locationBlacklist");
openapiFields.add("ignoreSafetyStock");
openapiFields.add("includeNegativeInventory");
openapiFields.add("directShip");
openapiFields.add("transferEnabled");
openapiFields.add("pickup");
openapiFields.add("includeInAggregateExport");
openapiFields.add("includeInLocationExport");
openapiFields.add("excludeBlockedAssignment");
openapiFields.add("includeAttributes");
openapiFields.add("includeFutureInventory");
openapiFields.add("includeNegativeFutureInventory");
openapiFields.add("deliveryDateBefore");
openapiFields.add("deliveryDateAfter");
openapiFields.add("sortByEnum");
openapiFields.add("sortDescending");
openapiFields.add("forceDefaultsForUnspecifiedTagCategories");
openapiFields.add("tags");
openapiFields.add("locationCode");
openapiFields.add("userID");
openapiFields.add("pageSize");
openapiFields.add("pageNum");
openapiFields.add("sortBy");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet();
openapiRequiredFields.add("type");
openapiRequiredFields.add("items");
}
/**
* 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 InventoryRequest
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!InventoryRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in InventoryRequest is not found in the empty JSON string", InventoryRequest.openapiRequiredFields.toString()));
}
}
// Set> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
// for (Entry entry : entries) {
// if (!InventoryRequest.openapiFields.contains(entry.getKey())) {
// throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InventoryRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
// }
// }
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : InventoryRequest.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("type").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString()));
}
// ensure the json data is an array
if (!jsonObj.get("items").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `items` to be an array in the JSON string but got `%s`", jsonObj.get("items").toString()));
}
JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items");
// validate the required field `items` (array)
for (int i = 0; i < jsonArrayitems.size(); i++) {
ItemQuantity.validateJsonObject(jsonArrayitems.get(i).getAsJsonObject());
};
// validate the optional field `requestLocation`
if (jsonObj.get("requestLocation") != null && !jsonObj.get("requestLocation").isJsonNull()) {
RequestLocation.validateJsonObject(jsonObj.getAsJsonObject("requestLocation"));
}
// ensure the json data is an array
if (!jsonObj.get("locationWhitelist").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `locationWhitelist` to be an array in the JSON string but got `%s`", jsonObj.get("locationWhitelist").toString()));
}
// ensure the json data is an array
if (!jsonObj.get("locationPriorityList").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `locationPriorityList` to be an array in the JSON string but got `%s`", jsonObj.get("locationPriorityList").toString()));
}
// ensure the json data is an array
if (!jsonObj.get("locationBlacklist").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `locationBlacklist` to be an array in the JSON string but got `%s`", jsonObj.get("locationBlacklist").toString()));
}
if ((jsonObj.get("sortByEnum") != null && !jsonObj.get("sortByEnum").isJsonNull()) && !jsonObj.get("sortByEnum").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `sortByEnum` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sortByEnum").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("sortBy") != null && !jsonObj.get("sortBy").isJsonNull()) && !jsonObj.get("sortBy").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `sortBy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sortBy").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public TypeAdapter create(Gson gson, TypeToken type) {
if (!InventoryRequest.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'InventoryRequest' and its subtypes
}
final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(InventoryRequest.class));
return (TypeAdapter) new TypeAdapter() {
@Override
public void write(JsonWriter out, InventoryRequest value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public InventoryRequest read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of InventoryRequest given an JSON string
*
* @param jsonString JSON string
* @return An instance of InventoryRequest
* @throws IOException if the JSON string is invalid with respect to InventoryRequest
*/
public static InventoryRequest fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, InventoryRequest.class);
}
/**
* Convert an instance of InventoryRequest to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}