Interface DiscountCodeNonApplicableError
- All Superinterfaces:
ErrorObject
Returned when the Cart contains a Discount Code with a DiscountCodeState other than MatchesCart
.
The error is returned as a failed response to:
- Create Cart and Create Cart in Store requests and Add DiscountCode update action on Carts.
- Create Cart and Create Cart in Store requests and Add DiscountCode update action on My Carts.
- Create Cart in BusinessUnit request on Associate Carts.
- Create Order from Cart and Create Order in Store from Cart requests on Orders.
- Create Order from Cart and Create Order in Store from Cart requests on My Orders.
- Add DiscountCode update action on Order Edits.
- Create Order from Cart in BusinessUnit request on Associate Orders.
Example to create an instance using the builder pattern
DiscountCodeNonApplicableError discountCodeNonApplicableError = DiscountCodeNonApplicableError.builder()
.message("{message}")
.build()
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
discriminator value for DiscountCodeNonApplicableError -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
builder factory method for DiscountCodeNonApplicableErrorbuilder
(DiscountCodeNonApplicableError template) create builder for DiscountCodeNonApplicableError instancedeepCopy
(DiscountCodeNonApplicableError template) factory method to create a deep copy of DiscountCodeNonApplicableError@NotNull String
getCode()
Error identifier.Discount Code passed to the Cart.Unique identifier of the Discount Code.@NotNull String
"The discountCode $discountCodeId cannot be applied to the cart."
"DoesNotExist"
or"TimeRangeNonApplicable"
Date and time (UTC) from which the Discount Code is valid.Date and time (UTC) the Discount Code validity check was last performed.Date and time (UTC) until which the Discount Code is valid.of()
factory methodof
(DiscountCodeNonApplicableError template) factory method to create a shallow copy DiscountCodeNonApplicableErrorvoid
setDiscountCode
(String discountCode) Discount Code passed to the Cart.void
setDiscountCodeId
(String discountCodeId) Unique identifier of the Discount Code.void
setMessage
(String message) "The discountCode $discountCodeId cannot be applied to the cart."
void
"DoesNotExist"
or"TimeRangeNonApplicable"
void
setValidFrom
(ZonedDateTime validFrom) Date and time (UTC) from which the Discount Code is valid.void
setValidityCheckTime
(ZonedDateTime validityCheckTime) Date and time (UTC) the Discount Code validity check was last performed.void
setValidUntil
(ZonedDateTime validUntil) Date and time (UTC) until which the Discount Code is valid.static com.fasterxml.jackson.core.type.TypeReference<DiscountCodeNonApplicableError>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
accessor map functionMethods inherited from interface com.commercetools.api.models.error.ErrorObject
setValue, values, withErrorObject
-
Field Details
-
DISCOUNT_CODE_NON_APPLICABLE
discriminator value for DiscountCodeNonApplicableError- See Also:
-
-
Method Details
-
getCode
Description copied from interface:ErrorObject
Error identifier.
- Specified by:
getCode
in interfaceErrorObject
- Returns:
- code
-
getMessage
"The discountCode $discountCodeId cannot be applied to the cart."
- Specified by:
getMessage
in interfaceErrorObject
- Returns:
- message
-
getDiscountCode
String getDiscountCode()Discount Code passed to the Cart.
- Returns:
- discountCode
-
getReason
String getReason()"DoesNotExist"
or"TimeRangeNonApplicable"
- Returns:
- reason
-
getDiscountCodeId
String getDiscountCodeId()Unique identifier of the Discount Code.
- Returns:
- discountCodeId
-
getValidFrom
ZonedDateTime getValidFrom()Date and time (UTC) from which the Discount Code is valid.
- Returns:
- validFrom
-
getValidUntil
ZonedDateTime getValidUntil()Date and time (UTC) until which the Discount Code is valid.
- Returns:
- validUntil
-
getValidityCheckTime
ZonedDateTime getValidityCheckTime()Date and time (UTC) the Discount Code validity check was last performed.
- Returns:
- validityCheckTime
-
setMessage
"The discountCode $discountCodeId cannot be applied to the cart."
- Specified by:
setMessage
in interfaceErrorObject
- Parameters:
message
- value to be set
-
setDiscountCode
Discount Code passed to the Cart.
- Parameters:
discountCode
- value to be set
-
setReason
"DoesNotExist"
or"TimeRangeNonApplicable"
- Parameters:
reason
- value to be set
-
setDiscountCodeId
Unique identifier of the Discount Code.
- Parameters:
discountCodeId
- value to be set
-
setValidFrom
Date and time (UTC) from which the Discount Code is valid.
- Parameters:
validFrom
- value to be set
-
setValidUntil
Date and time (UTC) until which the Discount Code is valid.
- Parameters:
validUntil
- value to be set
-
setValidityCheckTime
Date and time (UTC) the Discount Code validity check was last performed.
- Parameters:
validityCheckTime
- value to be set
-
of
factory method- Returns:
- instance of DiscountCodeNonApplicableError
-
of
factory method to create a shallow copy DiscountCodeNonApplicableError- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
@Nullable static DiscountCodeNonApplicableError deepCopy(@Nullable DiscountCodeNonApplicableError template) factory method to create a deep copy of DiscountCodeNonApplicableError- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for DiscountCodeNonApplicableError- Returns:
- builder
-
builder
create builder for DiscountCodeNonApplicableError instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withDiscountCodeNonApplicableError
accessor map function- Type Parameters:
T
- mapped type- Parameters:
helper
- function to map the object- Returns:
- mapped value
-
typeReference
static com.fasterxml.jackson.core.type.TypeReference<DiscountCodeNonApplicableError> typeReference()gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-