Interface OutOfStockError
- All Superinterfaces:
ErrorObject
Returned when some of the Line Items are out of stock at the time of placing an Order.
The error is returned as a failed response to:
- Create Order from Cart, Create Order in Store from Cart, Create Order from Quote, and Create Order by Import requests on Orders.
- Create Order from Cart, Create Order in Store from Cart, and Create Order from Quote requests on My Orders.
- Create Order from Cart in BusinessUnit and Create Order from Quote in BusinessUnit requests on Associate Orders.
Example to create an instance using the builder pattern
OutOfStockError outOfStockError = OutOfStockError.builder()
.message("{message}")
.plusLineItems(lineItemsBuilder -> lineItemsBuilder)
.plusSkus(skusBuilder -> skusBuilder)
.build()
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic OutOfStockErrorBuilderbuilder()builder factory method for OutOfStockErrorstatic OutOfStockErrorBuilderbuilder(OutOfStockError template) create builder for OutOfStockError instancecopyDeep()static OutOfStockErrordeepCopy(OutOfStockError template) factory method to create a deep copy of OutOfStockError@NotNull StringgetCode()Error identifier.Unique identifiers of the Line Items that are out of stock.@NotNull String"Some line items are out of stock at the time of placing the order: $itemSku."getSkus()SKUs of the Line Items that are out of stock.static OutOfStockErrorof()factory methodstatic OutOfStockErrorof(OutOfStockError template) factory method to create a shallow copy OutOfStockErrorvoidsetLineItems(String... lineItems) Unique identifiers of the Line Items that are out of stock.voidsetLineItems(List<String> lineItems) Unique identifiers of the Line Items that are out of stock.voidsetMessage(String message) "Some line items are out of stock at the time of placing the order: $itemSku."voidSKUs of the Line Items that are out of stock.voidSKUs of the Line Items that are out of stock.static com.fasterxml.jackson.core.type.TypeReference<OutOfStockError>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithOutOfStockError(Function<OutOfStockError, T> helper) accessor map functionMethods inherited from interface com.commercetools.api.models.error.ErrorObject
setValue, values, withErrorObject
-
Field Details
-
OUT_OF_STOCK
discriminator value for OutOfStockError- See Also:
-
-
Method Details
-
getCode
Description copied from interface:ErrorObjectError identifier.
- Specified by:
getCodein interfaceErrorObject- Returns:
- code
-
getMessage
"Some line items are out of stock at the time of placing the order: $itemSku."- Specified by:
getMessagein interfaceErrorObject- Returns:
- message
-
getLineItems
Unique identifiers of the Line Items that are out of stock.
- Returns:
- lineItems
-
getSkus
SKUs of the Line Items that are out of stock.
- Returns:
- skus
-
setMessage
"Some line items are out of stock at the time of placing the order: $itemSku."- Specified by:
setMessagein interfaceErrorObject- Parameters:
message- value to be set
-
setLineItems
Unique identifiers of the Line Items that are out of stock.
- Parameters:
lineItems- values to be set
-
setLineItems
Unique identifiers of the Line Items that are out of stock.
- Parameters:
lineItems- values to be set
-
setSkus
SKUs of the Line Items that are out of stock.
- Parameters:
skus- values to be set
-
setSkus
SKUs of the Line Items that are out of stock.
- Parameters:
skus- values to be set
-
of
factory method- Returns:
- instance of OutOfStockError
-
of
factory method to create a shallow copy OutOfStockError- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
OutOfStockError copyDeep()- Specified by:
copyDeepin interfaceErrorObject
-
deepCopy
factory method to create a deep copy of OutOfStockError- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for OutOfStockError- Returns:
- builder
-
builder
create builder for OutOfStockError instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withOutOfStockError
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
-