com.adobe.cq.commerce.magento.graphql.BundleProduct Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of magento-graphql Show documentation
Show all versions of magento-graphql Show documentation
AEM bundle for the Magento GraphQL data models and query builders
/*******************************************************************************
*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*
******************************************************************************/
package com.adobe.cq.commerce.magento.graphql;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.shopify.graphql.support.AbstractResponse;
import com.shopify.graphql.support.SchemaViolationError;
/**
* BundleProduct defines basic features of a bundle product and contains multiple BundleItems.
*/
public class BundleProduct extends AbstractResponse implements CustomizableProductInterface, PhysicalProductInterface, ProductInterface {
public BundleProduct() {
}
public BundleProduct(JsonObject fields) throws SchemaViolationError {
for (Map.Entry field : fields.entrySet()) {
String key = field.getKey();
String fieldName = getFieldName(key);
switch (fieldName) {
case "attribute_set_id": {
Integer optional1 = null;
if (!field.getValue().isJsonNull()) {
optional1 = jsonAsInteger(field.getValue(), key);
}
responseData.put(key, optional1);
break;
}
case "canonical_url": {
String optional1 = null;
if (!field.getValue().isJsonNull()) {
optional1 = jsonAsString(field.getValue(), key);
}
responseData.put(key, optional1);
break;
}
case "categories": {
List optional1 = null;
if (!field.getValue().isJsonNull()) {
List list1 = new ArrayList<>();
for (JsonElement element1 : jsonAsArray(field.getValue(), key)) {
CategoryInterface optional2 = null;
if (!element1.isJsonNull()) {
optional2 = UnknownCategoryInterface.create(jsonAsObject(element1, key));
}
list1.add(optional2);
}
optional1 = list1;
}
responseData.put(key, optional1);
break;
}
case "color": {
Integer optional1 = null;
if (!field.getValue().isJsonNull()) {
optional1 = jsonAsInteger(field.getValue(), key);
}
responseData.put(key, optional1);
break;
}
case "country_of_manufacture": {
String optional1 = null;
if (!field.getValue().isJsonNull()) {
optional1 = jsonAsString(field.getValue(), key);
}
responseData.put(key, optional1);
break;
}
case "created_at": {
String optional1 = null;
if (!field.getValue().isJsonNull()) {
optional1 = jsonAsString(field.getValue(), key);
}
responseData.put(key, optional1);
break;
}
case "crosssell_products": {
List optional1 = null;
if (!field.getValue().isJsonNull()) {
List list1 = new ArrayList<>();
for (JsonElement element1 : jsonAsArray(field.getValue(), key)) {
ProductInterface optional2 = null;
if (!element1.isJsonNull()) {
optional2 = UnknownProductInterface.create(jsonAsObject(element1, key));
}
list1.add(optional2);
}
optional1 = list1;
}
responseData.put(key, optional1);
break;
}
case "description": {
ComplexTextValue optional1 = null;
if (!field.getValue().isJsonNull()) {
optional1 = new ComplexTextValue(jsonAsObject(field.getValue(), key));
}
responseData.put(key, optional1);
break;
}
case "dynamic_price": {
Boolean optional1 = null;
if (!field.getValue().isJsonNull()) {
optional1 = jsonAsBoolean(field.getValue(), key);
}
responseData.put(key, optional1);
break;
}
case "dynamic_sku": {
Boolean optional1 = null;
if (!field.getValue().isJsonNull()) {
optional1 = jsonAsBoolean(field.getValue(), key);
}
responseData.put(key, optional1);
break;
}
case "dynamic_weight": {
Boolean optional1 = null;
if (!field.getValue().isJsonNull()) {
optional1 = jsonAsBoolean(field.getValue(), key);
}
responseData.put(key, optional1);
break;
}
case "gift_message_available": {
String optional1 = null;
if (!field.getValue().isJsonNull()) {
optional1 = jsonAsString(field.getValue(), key);
}
responseData.put(key, optional1);
break;
}
case "id": {
Integer optional1 = null;
if (!field.getValue().isJsonNull()) {
optional1 = jsonAsInteger(field.getValue(), key);
}
responseData.put(key, optional1);
break;
}
case "image": {
ProductImage optional1 = null;
if (!field.getValue().isJsonNull()) {
optional1 = new ProductImage(jsonAsObject(field.getValue(), key));
}
responseData.put(key, optional1);
break;
}
case "items": {
List optional1 = null;
if (!field.getValue().isJsonNull()) {
List list1 = new ArrayList<>();
for (JsonElement element1 : jsonAsArray(field.getValue(), key)) {
BundleItem optional2 = null;
if (!element1.isJsonNull()) {
optional2 = new BundleItem(jsonAsObject(element1, key));
}
list1.add(optional2);
}
optional1 = list1;
}
responseData.put(key, optional1);
break;
}
case "manufacturer": {
Integer optional1 = null;
if (!field.getValue().isJsonNull()) {
optional1 = jsonAsInteger(field.getValue(), key);
}
responseData.put(key, optional1);
break;
}
case "media_gallery": {
List optional1 = null;
if (!field.getValue().isJsonNull()) {
List list1 = new ArrayList<>();
for (JsonElement element1 : jsonAsArray(field.getValue(), key)) {
MediaGalleryInterface optional2 = null;
if (!element1.isJsonNull()) {
optional2 = UnknownMediaGalleryInterface.create(jsonAsObject(element1, key));
}
list1.add(optional2);
}
optional1 = list1;
}
responseData.put(key, optional1);
break;
}
case "media_gallery_entries": {
List optional1 = null;
if (!field.getValue().isJsonNull()) {
List list1 = new ArrayList<>();
for (JsonElement element1 : jsonAsArray(field.getValue(), key)) {
MediaGalleryEntry optional2 = null;
if (!element1.isJsonNull()) {
optional2 = new MediaGalleryEntry(jsonAsObject(element1, key));
}
list1.add(optional2);
}
optional1 = list1;
}
responseData.put(key, optional1);
break;
}
case "meta_description": {
String optional1 = null;
if (!field.getValue().isJsonNull()) {
optional1 = jsonAsString(field.getValue(), key);
}
responseData.put(key, optional1);
break;
}
case "meta_keyword": {
String optional1 = null;
if (!field.getValue().isJsonNull()) {
optional1 = jsonAsString(field.getValue(), key);
}
responseData.put(key, optional1);
break;
}
case "meta_title": {
String optional1 = null;
if (!field.getValue().isJsonNull()) {
optional1 = jsonAsString(field.getValue(), key);
}
responseData.put(key, optional1);
break;
}
case "name": {
String optional1 = null;
if (!field.getValue().isJsonNull()) {
optional1 = jsonAsString(field.getValue(), key);
}
responseData.put(key, optional1);
break;
}
case "new_from_date": {
String optional1 = null;
if (!field.getValue().isJsonNull()) {
optional1 = jsonAsString(field.getValue(), key);
}
responseData.put(key, optional1);
break;
}
case "new_to_date": {
String optional1 = null;
if (!field.getValue().isJsonNull()) {
optional1 = jsonAsString(field.getValue(), key);
}
responseData.put(key, optional1);
break;
}
case "only_x_left_in_stock": {
Double optional1 = null;
if (!field.getValue().isJsonNull()) {
optional1 = jsonAsDouble(field.getValue(), key);
}
responseData.put(key, optional1);
break;
}
case "options": {
List optional1 = null;
if (!field.getValue().isJsonNull()) {
List list1 = new ArrayList<>();
for (JsonElement element1 : jsonAsArray(field.getValue(), key)) {
CustomizableOptionInterface optional2 = null;
if (!element1.isJsonNull()) {
optional2 = UnknownCustomizableOptionInterface.create(jsonAsObject(element1, key));
}
list1.add(optional2);
}
optional1 = list1;
}
responseData.put(key, optional1);
break;
}
case "options_container": {
String optional1 = null;
if (!field.getValue().isJsonNull()) {
optional1 = jsonAsString(field.getValue(), key);
}
responseData.put(key, optional1);
break;
}
case "price": {
ProductPrices optional1 = null;
if (!field.getValue().isJsonNull()) {
optional1 = new ProductPrices(jsonAsObject(field.getValue(), key));
}
responseData.put(key, optional1);
break;
}
case "price_range": {
responseData.put(key, new PriceRange(jsonAsObject(field.getValue(), key)));
break;
}
case "price_tiers": {
List optional1 = null;
if (!field.getValue().isJsonNull()) {
List list1 = new ArrayList<>();
for (JsonElement element1 : jsonAsArray(field.getValue(), key)) {
TierPrice optional2 = null;
if (!element1.isJsonNull()) {
optional2 = new TierPrice(jsonAsObject(element1, key));
}
list1.add(optional2);
}
optional1 = list1;
}
responseData.put(key, optional1);
break;
}
case "price_view": {
PriceViewEnum optional1 = null;
if (!field.getValue().isJsonNull()) {
optional1 = PriceViewEnum.fromGraphQl(jsonAsString(field.getValue(), key));
}
responseData.put(key, optional1);
break;
}
case "product_links": {
List optional1 = null;
if (!field.getValue().isJsonNull()) {
List list1 = new ArrayList<>();
for (JsonElement element1 : jsonAsArray(field.getValue(), key)) {
ProductLinksInterface optional2 = null;
if (!element1.isJsonNull()) {
optional2 = UnknownProductLinksInterface.create(jsonAsObject(element1, key));
}
list1.add(optional2);
}
optional1 = list1;
}
responseData.put(key, optional1);
break;
}
case "related_products": {
List optional1 = null;
if (!field.getValue().isJsonNull()) {
List list1 = new ArrayList<>();
for (JsonElement element1 : jsonAsArray(field.getValue(), key)) {
ProductInterface optional2 = null;
if (!element1.isJsonNull()) {
optional2 = UnknownProductInterface.create(jsonAsObject(element1, key));
}
list1.add(optional2);
}
optional1 = list1;
}
responseData.put(key, optional1);
break;
}
case "ship_bundle_items": {
ShipBundleItemsEnum optional1 = null;
if (!field.getValue().isJsonNull()) {
optional1 = ShipBundleItemsEnum.fromGraphQl(jsonAsString(field.getValue(), key));
}
responseData.put(key, optional1);
break;
}
case "short_description": {
ComplexTextValue optional1 = null;
if (!field.getValue().isJsonNull()) {
optional1 = new ComplexTextValue(jsonAsObject(field.getValue(), key));
}
responseData.put(key, optional1);
break;
}
case "sku": {
String optional1 = null;
if (!field.getValue().isJsonNull()) {
optional1 = jsonAsString(field.getValue(), key);
}
responseData.put(key, optional1);
break;
}
case "small_image": {
ProductImage optional1 = null;
if (!field.getValue().isJsonNull()) {
optional1 = new ProductImage(jsonAsObject(field.getValue(), key));
}
responseData.put(key, optional1);
break;
}
case "special_from_date": {
String optional1 = null;
if (!field.getValue().isJsonNull()) {
optional1 = jsonAsString(field.getValue(), key);
}
responseData.put(key, optional1);
break;
}
case "special_price": {
Double optional1 = null;
if (!field.getValue().isJsonNull()) {
optional1 = jsonAsDouble(field.getValue(), key);
}
responseData.put(key, optional1);
break;
}
case "special_to_date": {
String optional1 = null;
if (!field.getValue().isJsonNull()) {
optional1 = jsonAsString(field.getValue(), key);
}
responseData.put(key, optional1);
break;
}
case "stock_status": {
ProductStockStatus optional1 = null;
if (!field.getValue().isJsonNull()) {
optional1 = ProductStockStatus.fromGraphQl(jsonAsString(field.getValue(), key));
}
responseData.put(key, optional1);
break;
}
case "swatch_image": {
String optional1 = null;
if (!field.getValue().isJsonNull()) {
optional1 = jsonAsString(field.getValue(), key);
}
responseData.put(key, optional1);
break;
}
case "thumbnail": {
ProductImage optional1 = null;
if (!field.getValue().isJsonNull()) {
optional1 = new ProductImage(jsonAsObject(field.getValue(), key));
}
responseData.put(key, optional1);
break;
}
case "tier_price": {
Double optional1 = null;
if (!field.getValue().isJsonNull()) {
optional1 = jsonAsDouble(field.getValue(), key);
}
responseData.put(key, optional1);
break;
}
case "tier_prices": {
List optional1 = null;
if (!field.getValue().isJsonNull()) {
List list1 = new ArrayList<>();
for (JsonElement element1 : jsonAsArray(field.getValue(), key)) {
ProductTierPrices optional2 = null;
if (!element1.isJsonNull()) {
optional2 = new ProductTierPrices(jsonAsObject(element1, key));
}
list1.add(optional2);
}
optional1 = list1;
}
responseData.put(key, optional1);
break;
}
case "type_id": {
String optional1 = null;
if (!field.getValue().isJsonNull()) {
optional1 = jsonAsString(field.getValue(), key);
}
responseData.put(key, optional1);
break;
}
case "updated_at": {
String optional1 = null;
if (!field.getValue().isJsonNull()) {
optional1 = jsonAsString(field.getValue(), key);
}
responseData.put(key, optional1);
break;
}
case "upsell_products": {
List optional1 = null;
if (!field.getValue().isJsonNull()) {
List list1 = new ArrayList<>();
for (JsonElement element1 : jsonAsArray(field.getValue(), key)) {
ProductInterface optional2 = null;
if (!element1.isJsonNull()) {
optional2 = UnknownProductInterface.create(jsonAsObject(element1, key));
}
list1.add(optional2);
}
optional1 = list1;
}
responseData.put(key, optional1);
break;
}
case "url_key": {
String optional1 = null;
if (!field.getValue().isJsonNull()) {
optional1 = jsonAsString(field.getValue(), key);
}
responseData.put(key, optional1);
break;
}
case "url_path": {
String optional1 = null;
if (!field.getValue().isJsonNull()) {
optional1 = jsonAsString(field.getValue(), key);
}
responseData.put(key, optional1);
break;
}
case "url_rewrites": {
List optional1 = null;
if (!field.getValue().isJsonNull()) {
List list1 = new ArrayList<>();
for (JsonElement element1 : jsonAsArray(field.getValue(), key)) {
UrlRewrite optional2 = null;
if (!element1.isJsonNull()) {
optional2 = new UrlRewrite(jsonAsObject(element1, key));
}
list1.add(optional2);
}
optional1 = list1;
}
responseData.put(key, optional1);
break;
}
case "url_suffix": {
String optional1 = null;
if (!field.getValue().isJsonNull()) {
optional1 = jsonAsString(field.getValue(), key);
}
responseData.put(key, optional1);
break;
}
case "websites": {
List optional1 = null;
if (!field.getValue().isJsonNull()) {
List list1 = new ArrayList<>();
for (JsonElement element1 : jsonAsArray(field.getValue(), key)) {
Website optional2 = null;
if (!element1.isJsonNull()) {
optional2 = new Website(jsonAsObject(element1, key));
}
list1.add(optional2);
}
optional1 = list1;
}
responseData.put(key, optional1);
break;
}
case "weight": {
Double optional1 = null;
if (!field.getValue().isJsonNull()) {
optional1 = jsonAsDouble(field.getValue(), key);
}
responseData.put(key, optional1);
break;
}
case "__typename": {
responseData.put(key, jsonAsString(field.getValue(), key));
break;
}
default: {
readCustomField(fieldName, field.getValue());
}
}
}
}
public String getGraphQlTypeName() {
return "BundleProduct";
}
/**
* The attribute set assigned to the product.
*/
public Integer getAttributeSetId() {
return (Integer) get("attribute_set_id");
}
public BundleProduct setAttributeSetId(Integer arg) {
optimisticData.put(getKey("attribute_set_id"), arg);
return this;
}
/**
* Relative canonical URL. This value is returned only if the system setting 'Use Canonical Link Meta
* Tag For Products' is enabled
*/
public String getCanonicalUrl() {
return (String) get("canonical_url");
}
public BundleProduct setCanonicalUrl(String arg) {
optimisticData.put(getKey("canonical_url"), arg);
return this;
}
/**
* The categories assigned to a product.
*/
public List getCategories() {
return (List) get("categories");
}
public BundleProduct setCategories(List arg) {
optimisticData.put(getKey("categories"), arg);
return this;
}
public Integer getColor() {
return (Integer) get("color");
}
public BundleProduct setColor(Integer arg) {
optimisticData.put(getKey("color"), arg);
return this;
}
/**
* The product's country of origin.
*/
public String getCountryOfManufacture() {
return (String) get("country_of_manufacture");
}
public BundleProduct setCountryOfManufacture(String arg) {
optimisticData.put(getKey("country_of_manufacture"), arg);
return this;
}
/**
* Timestamp indicating when the product was created.
*/
public String getCreatedAt() {
return (String) get("created_at");
}
public BundleProduct setCreatedAt(String arg) {
optimisticData.put(getKey("created_at"), arg);
return this;
}
/**
* Crosssell Products
*/
public List getCrosssellProducts() {
return (List) get("crosssell_products");
}
public BundleProduct setCrosssellProducts(List arg) {
optimisticData.put(getKey("crosssell_products"), arg);
return this;
}
/**
* Detailed information about the product. The value can include simple HTML tags.
*/
public ComplexTextValue getDescription() {
return (ComplexTextValue) get("description");
}
public BundleProduct setDescription(ComplexTextValue arg) {
optimisticData.put(getKey("description"), arg);
return this;
}
/**
* Indicates whether the bundle product has a dynamic price.
*/
public Boolean getDynamicPrice() {
return (Boolean) get("dynamic_price");
}
public BundleProduct setDynamicPrice(Boolean arg) {
optimisticData.put(getKey("dynamic_price"), arg);
return this;
}
/**
* Indicates whether the bundle product has a dynamic SK.
*/
public Boolean getDynamicSku() {
return (Boolean) get("dynamic_sku");
}
public BundleProduct setDynamicSku(Boolean arg) {
optimisticData.put(getKey("dynamic_sku"), arg);
return this;
}
/**
* Indicates whether the bundle product has a dynamically calculated weight.
*/
public Boolean getDynamicWeight() {
return (Boolean) get("dynamic_weight");
}
public BundleProduct setDynamicWeight(Boolean arg) {
optimisticData.put(getKey("dynamic_weight"), arg);
return this;
}
/**
* Indicates whether a gift message is available.
*/
public String getGiftMessageAvailable() {
return (String) get("gift_message_available");
}
public BundleProduct setGiftMessageAvailable(String arg) {
optimisticData.put(getKey("gift_message_available"), arg);
return this;
}
/**
* The ID number assigned to the product.
*/
public Integer getId() {
return (Integer) get("id");
}
public BundleProduct setId(Integer arg) {
optimisticData.put(getKey("id"), arg);
return this;
}
/**
* The relative path to the main image on the product page.
*/
public ProductImage getImage() {
return (ProductImage) get("image");
}
public BundleProduct setImage(ProductImage arg) {
optimisticData.put(getKey("image"), arg);
return this;
}
/**
* An array containing information about individual bundle items.
*/
public List getItems() {
return (List) get("items");
}
public BundleProduct setItems(List arg) {
optimisticData.put(getKey("items"), arg);
return this;
}
/**
* A number representing the product's manufacturer.
*/
public Integer getManufacturer() {
return (Integer) get("manufacturer");
}
public BundleProduct setManufacturer(Integer arg) {
optimisticData.put(getKey("manufacturer"), arg);
return this;
}
/**
* An array of Media Gallery objects.
*/
public List getMediaGallery() {
return (List) get("media_gallery");
}
public BundleProduct setMediaGallery(List arg) {
optimisticData.put(getKey("media_gallery"), arg);
return this;
}
/**
* An array of MediaGalleryEntry objects.
*
* @deprecated Use product's `media_gallery` instead
*/
@Deprecated
public List getMediaGalleryEntries() {
return (List) get("media_gallery_entries");
}
public BundleProduct setMediaGalleryEntries(List arg) {
optimisticData.put(getKey("media_gallery_entries"), arg);
return this;
}
/**
* A brief overview of the product for search results listings, maximum 255 characters.
*/
public String getMetaDescription() {
return (String) get("meta_description");
}
public BundleProduct setMetaDescription(String arg) {
optimisticData.put(getKey("meta_description"), arg);
return this;
}
/**
* A comma-separated list of keywords that are visible only to search engines.
*/
public String getMetaKeyword() {
return (String) get("meta_keyword");
}
public BundleProduct setMetaKeyword(String arg) {
optimisticData.put(getKey("meta_keyword"), arg);
return this;
}
/**
* A string that is displayed in the title bar and tab of the browser and in search results lists.
*/
public String getMetaTitle() {
return (String) get("meta_title");
}
public BundleProduct setMetaTitle(String arg) {
optimisticData.put(getKey("meta_title"), arg);
return this;
}
/**
* The product name. Customers use this name to identify the product.
*/
public String getName() {
return (String) get("name");
}
public BundleProduct setName(String arg) {
optimisticData.put(getKey("name"), arg);
return this;
}
/**
* The beginning date for new product listings, and determines if the product is featured as a new
* product.
*/
public String getNewFromDate() {
return (String) get("new_from_date");
}
public BundleProduct setNewFromDate(String arg) {
optimisticData.put(getKey("new_from_date"), arg);
return this;
}
/**
* The end date for new product listings.
*/
public String getNewToDate() {
return (String) get("new_to_date");
}
public BundleProduct setNewToDate(String arg) {
optimisticData.put(getKey("new_to_date"), arg);
return this;
}
/**
* Product stock only x left count
*/
public Double getOnlyXLeftInStock() {
return (Double) get("only_x_left_in_stock");
}
public BundleProduct setOnlyXLeftInStock(Double arg) {
optimisticData.put(getKey("only_x_left_in_stock"), arg);
return this;
}
/**
* An array of options for a customizable product.
*/
public List getOptions() {
return (List) get("options");
}
public BundleProduct setOptions(List arg) {
optimisticData.put(getKey("options"), arg);
return this;
}
/**
* If the product has multiple options, determines where they appear on the product page.
*/
public String getOptionsContainer() {
return (String) get("options_container");
}
public BundleProduct setOptionsContainer(String arg) {
optimisticData.put(getKey("options_container"), arg);
return this;
}
/**
* A ProductPrices object, indicating the price of an item.
*
* @deprecated Use price_range for product price information.
*/
@Deprecated
public ProductPrices getPrice() {
return (ProductPrices) get("price");
}
public BundleProduct setPrice(ProductPrices arg) {
optimisticData.put(getKey("price"), arg);
return this;
}
/**
* A PriceRange object, indicating the range of prices for the product
*/
public PriceRange getPriceRange() {
return (PriceRange) get("price_range");
}
public BundleProduct setPriceRange(PriceRange arg) {
optimisticData.put(getKey("price_range"), arg);
return this;
}
/**
* An array of TierPrice objects.
*/
public List getPriceTiers() {
return (List) get("price_tiers");
}
public BundleProduct setPriceTiers(List arg) {
optimisticData.put(getKey("price_tiers"), arg);
return this;
}
/**
* One of PRICE_RANGE or AS_LOW_AS.
*/
public PriceViewEnum getPriceView() {
return (PriceViewEnum) get("price_view");
}
public BundleProduct setPriceView(PriceViewEnum arg) {
optimisticData.put(getKey("price_view"), arg);
return this;
}
/**
* An array of ProductLinks objects.
*/
public List getProductLinks() {
return (List) get("product_links");
}
public BundleProduct setProductLinks(List arg) {
optimisticData.put(getKey("product_links"), arg);
return this;
}
/**
* Related Products
*/
public List getRelatedProducts() {
return (List) get("related_products");
}
public BundleProduct setRelatedProducts(List arg) {
optimisticData.put(getKey("related_products"), arg);
return this;
}
/**
* Indicates whether to ship bundle items together or individually.
*/
public ShipBundleItemsEnum getShipBundleItems() {
return (ShipBundleItemsEnum) get("ship_bundle_items");
}
public BundleProduct setShipBundleItems(ShipBundleItemsEnum arg) {
optimisticData.put(getKey("ship_bundle_items"), arg);
return this;
}
/**
* A short description of the product. Its use depends on the theme.
*/
public ComplexTextValue getShortDescription() {
return (ComplexTextValue) get("short_description");
}
public BundleProduct setShortDescription(ComplexTextValue arg) {
optimisticData.put(getKey("short_description"), arg);
return this;
}
/**
* A number or code assigned to a product to identify the product, options, price, and manufacturer.
*/
public String getSku() {
return (String) get("sku");
}
public BundleProduct setSku(String arg) {
optimisticData.put(getKey("sku"), arg);
return this;
}
/**
* The relative path to the small image, which is used on catalog pages.
*/
public ProductImage getSmallImage() {
return (ProductImage) get("small_image");
}
public BundleProduct setSmallImage(ProductImage arg) {
optimisticData.put(getKey("small_image"), arg);
return this;
}
/**
* The beginning date that a product has a special price.
*/
public String getSpecialFromDate() {
return (String) get("special_from_date");
}
public BundleProduct setSpecialFromDate(String arg) {
optimisticData.put(getKey("special_from_date"), arg);
return this;
}
/**
* The discounted price of the product.
*/
public Double getSpecialPrice() {
return (Double) get("special_price");
}
public BundleProduct setSpecialPrice(Double arg) {
optimisticData.put(getKey("special_price"), arg);
return this;
}
/**
* The end date that a product has a special price.
*/
public String getSpecialToDate() {
return (String) get("special_to_date");
}
public BundleProduct setSpecialToDate(String arg) {
optimisticData.put(getKey("special_to_date"), arg);
return this;
}
/**
* Stock status of the product
*/
public ProductStockStatus getStockStatus() {
return (ProductStockStatus) get("stock_status");
}
public BundleProduct setStockStatus(ProductStockStatus arg) {
optimisticData.put(getKey("stock_status"), arg);
return this;
}
/**
* The file name of a swatch image
*/
public String getSwatchImage() {
return (String) get("swatch_image");
}
public BundleProduct setSwatchImage(String arg) {
optimisticData.put(getKey("swatch_image"), arg);
return this;
}
/**
* The relative path to the product's thumbnail image.
*/
public ProductImage getThumbnail() {
return (ProductImage) get("thumbnail");
}
public BundleProduct setThumbnail(ProductImage arg) {
optimisticData.put(getKey("thumbnail"), arg);
return this;
}
/**
* The price when tier pricing is in effect and the items purchased threshold has been reached.
*
* @deprecated Use price_tiers for product tier price information.
*/
@Deprecated
public Double getTierPrice() {
return (Double) get("tier_price");
}
public BundleProduct setTierPrice(Double arg) {
optimisticData.put(getKey("tier_price"), arg);
return this;
}
/**
* An array of ProductTierPrices objects.
*
* @deprecated Use price_tiers for product tier price information.
*/
@Deprecated
public List getTierPrices() {
return (List) get("tier_prices");
}
public BundleProduct setTierPrices(List arg) {
optimisticData.put(getKey("tier_prices"), arg);
return this;
}
/**
* One of simple, virtual, bundle, downloadable, grouped, or configurable.
*
* @deprecated Use __typename instead.
*/
@Deprecated
public String getTypeId() {
return (String) get("type_id");
}
public BundleProduct setTypeId(String arg) {
optimisticData.put(getKey("type_id"), arg);
return this;
}
/**
* Timestamp indicating when the product was updated.
*/
public String getUpdatedAt() {
return (String) get("updated_at");
}
public BundleProduct setUpdatedAt(String arg) {
optimisticData.put(getKey("updated_at"), arg);
return this;
}
/**
* Upsell Products
*/
public List getUpsellProducts() {
return (List) get("upsell_products");
}
public BundleProduct setUpsellProducts(List arg) {
optimisticData.put(getKey("upsell_products"), arg);
return this;
}
/**
* The part of the URL that identifies the product
*/
public String getUrlKey() {
return (String) get("url_key");
}
public BundleProduct setUrlKey(String arg) {
optimisticData.put(getKey("url_key"), arg);
return this;
}
/**
* @deprecated Use product's `canonical_url` or url rewrites instead
*/
@Deprecated
public String getUrlPath() {
return (String) get("url_path");
}
public BundleProduct setUrlPath(String arg) {
optimisticData.put(getKey("url_path"), arg);
return this;
}
/**
* URL rewrites list
*/
public List getUrlRewrites() {
return (List) get("url_rewrites");
}
public BundleProduct setUrlRewrites(List arg) {
optimisticData.put(getKey("url_rewrites"), arg);
return this;
}
/**
* The part of the product URL that is appended after the url key
*/
public String getUrlSuffix() {
return (String) get("url_suffix");
}
public BundleProduct setUrlSuffix(String arg) {
optimisticData.put(getKey("url_suffix"), arg);
return this;
}
/**
* An array of websites in which the product is available.
*
* @deprecated The field should not be used on the storefront.
*/
@Deprecated
public List getWebsites() {
return (List) get("websites");
}
public BundleProduct setWebsites(List arg) {
optimisticData.put(getKey("websites"), arg);
return this;
}
/**
* The weight of the item, in units defined by the store.
*/
public Double getWeight() {
return (Double) get("weight");
}
public BundleProduct setWeight(Double arg) {
optimisticData.put(getKey("weight"), arg);
return this;
}
public boolean unwrapsToObject(String key) {
switch (getFieldName(key)) {
case "attribute_set_id": return false;
case "canonical_url": return false;
case "categories": return false;
case "color": return false;
case "country_of_manufacture": return false;
case "created_at": return false;
case "crosssell_products": return false;
case "description": return true;
case "dynamic_price": return false;
case "dynamic_sku": return false;
case "dynamic_weight": return false;
case "gift_message_available": return false;
case "id": return false;
case "image": return true;
case "items": return true;
case "manufacturer": return false;
case "media_gallery": return false;
case "media_gallery_entries": return true;
case "meta_description": return false;
case "meta_keyword": return false;
case "meta_title": return false;
case "name": return false;
case "new_from_date": return false;
case "new_to_date": return false;
case "only_x_left_in_stock": return false;
case "options": return false;
case "options_container": return false;
case "price": return true;
case "price_range": return true;
case "price_tiers": return true;
case "price_view": return false;
case "product_links": return false;
case "related_products": return false;
case "ship_bundle_items": return false;
case "short_description": return true;
case "sku": return false;
case "small_image": return true;
case "special_from_date": return false;
case "special_price": return false;
case "special_to_date": return false;
case "stock_status": return false;
case "swatch_image": return false;
case "thumbnail": return true;
case "tier_price": return false;
case "tier_prices": return true;
case "type_id": return false;
case "updated_at": return false;
case "upsell_products": return false;
case "url_key": return false;
case "url_path": return false;
case "url_rewrites": return true;
case "url_suffix": return false;
case "websites": return true;
case "weight": return false;
default: return false;
}
}
}