Interface ProductAddPriceAction
- All Superinterfaces:
ProductUpdateAction,ResourceUpdateAction<ProductUpdateAction>
Adds the given Price to the prices array of the ProductVariant. Either variantId or sku is required.
Example to create an instance using the builder pattern
ProductAddPriceAction productAddPriceAction = ProductAddPriceAction.builder()
.price(priceBuilder -> priceBuilder)
.build()
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic ProductAddPriceActionBuilderbuilder()builder factory method for ProductAddPriceActionstatic ProductAddPriceActionBuilderbuilder(ProductAddPriceAction template) create builder for ProductAddPriceAction instancecopyDeep()static ProductAddPriceActiondeepCopy(ProductAddPriceAction template) factory method to create a deep copy of ProductAddPriceAction@NotNull @Valid PriceDraftgetPrice()Embedded Price to add to the Product Variant.getSku()Theskuof the ProductVariant to update.Whether only stagedpricesare updated.Theidof the ProductVariant to update.static ProductAddPriceActionof()factory methodstatic ProductAddPriceActionof(ProductAddPriceAction template) factory method to create a shallow copy ProductAddPriceActionvoidsetPrice(PriceDraft price) Embedded Price to add to the Product Variant.voidTheskuof the ProductVariant to update.voidWhether only stagedpricesare updated.voidsetVariantId(Long variantId) Theidof the ProductVariant to update.static tools.jackson.core.type.TypeReference<ProductAddPriceAction>gives a TypeReference for usage with Jackson DataBinddefault <T> Taccessor map functionMethods inherited from interface com.commercetools.api.models.product.ProductUpdateAction
getAction, withProductUpdateActionMethods inherited from interface com.commercetools.api.models.ResourceUpdateAction
get
-
Field Details
-
ADD_PRICE
discriminator value for ProductAddPriceAction- See Also:
-
-
Method Details
-
getVariantId
Long getVariantId()The
idof the ProductVariant to update.- Returns:
- variantId
-
getSku
String getSku()The
skuof the ProductVariant to update.- Returns:
- sku
-
getPrice
Embedded Price to add to the Product Variant.
If the key of the Price is used by another Embedded Price on the ProductVariant, a DuplicatePriceKey error is returned.
If this Embedded Price has the same price scope as an existing Embedded Price on the ProductVariant, a DuplicatePriceScope error is returned.
If this Embedded Price has overlapping validity periods within the same price scope, an OverlappingPriceValidity error is returned. An Embedded Price without validity period does not conflict with an Embedded Price defined for a time period.
- Returns:
- price
-
getStaged
Boolean getStaged()Whether only staged
pricesare updated. Iffalse, both current and stagedpricesare updated.- Returns:
- staged
-
setVariantId
The
idof the ProductVariant to update.- Parameters:
variantId- value to be set
-
setSku
The
skuof the ProductVariant to update.- Parameters:
sku- value to be set
-
setPrice
Embedded Price to add to the Product Variant.
If the key of the Price is used by another Embedded Price on the ProductVariant, a DuplicatePriceKey error is returned.
If this Embedded Price has the same price scope as an existing Embedded Price on the ProductVariant, a DuplicatePriceScope error is returned.
If this Embedded Price has overlapping validity periods within the same price scope, an OverlappingPriceValidity error is returned. An Embedded Price without validity period does not conflict with an Embedded Price defined for a time period.
- Parameters:
price- value to be set
-
setStaged
Whether only staged
pricesare updated. Iffalse, both current and stagedpricesare updated.- Parameters:
staged- value to be set
-
of
factory method- Returns:
- instance of ProductAddPriceAction
-
of
factory method to create a shallow copy ProductAddPriceAction- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
ProductAddPriceAction copyDeep()- Specified by:
copyDeepin interfaceProductUpdateAction
-
deepCopy
factory method to create a deep copy of ProductAddPriceAction- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for ProductAddPriceAction- Returns:
- builder
-
builder
create builder for ProductAddPriceAction instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withProductAddPriceAction
accessor map function- Type Parameters:
T- mapped type- Parameters:
helper- function to map the object- Returns:
- mapped value
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-