Interface GraphQLDiscountCodeNonApplicableError
- All Superinterfaces:
GraphQLErrorObject
- All Known Implementing Classes:
GraphQLDiscountCodeNonApplicableErrorImpl
Returned when the Cart contains a Discount Code with a DiscountCodeState other than MatchesCart
.
The error is returned as a failed response to:
- 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.
Example to create an instance using the builder pattern
GraphQLDiscountCodeNonApplicableError graphQLDiscountCodeNonApplicableError = GraphQLDiscountCodeNonApplicableError.builder()
.build()
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
discriminator value for GraphQLDiscountCodeNonApplicableError -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
builder factory method for GraphQLDiscountCodeNonApplicableErrorbuilder
(GraphQLDiscountCodeNonApplicableError template) create builder for GraphQLDiscountCodeNonApplicableError instancefactory method to create a deep copy of GraphQLDiscountCodeNonApplicableError@NotNull String
getCode()
Error identifier.Discount Code passed to the Cart.Unique identifier of the Discount Code."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
(GraphQLDiscountCodeNonApplicableError template) factory method to create a shallow copy GraphQLDiscountCodeNonApplicableErrorvoid
setDiscountCode
(String discountCode) Discount Code passed to the Cart.void
setDiscountCodeId
(String discountCodeId) Unique identifier of the Discount Code.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<GraphQLDiscountCodeNonApplicableError>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
accessor map functionMethods inherited from interface com.commercetools.api.models.error.GraphQLErrorObject
setValue, values, withGraphQLErrorObject
-
Field Details
-
DISCOUNT_CODE_NON_APPLICABLE
discriminator value for GraphQLDiscountCodeNonApplicableError- See Also:
-
-
Method Details
-
getCode
Description copied from interface:GraphQLErrorObject
Error identifier.
- Specified by:
getCode
in interfaceGraphQLErrorObject
- Returns:
- code
-
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
-
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 GraphQLDiscountCodeNonApplicableError
-
of
factory method to create a shallow copy GraphQLDiscountCodeNonApplicableError- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
@Nullable static GraphQLDiscountCodeNonApplicableError deepCopy(@Nullable GraphQLDiscountCodeNonApplicableError template) factory method to create a deep copy of GraphQLDiscountCodeNonApplicableError- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for GraphQLDiscountCodeNonApplicableError- Returns:
- builder
-
builder
static GraphQLDiscountCodeNonApplicableErrorBuilder builder(GraphQLDiscountCodeNonApplicableError template) create builder for GraphQLDiscountCodeNonApplicableError instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withGraphQLDiscountCodeNonApplicableError
default <T> T withGraphQLDiscountCodeNonApplicableError(Function<GraphQLDiscountCodeNonApplicableError, T> helper) 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<GraphQLDiscountCodeNonApplicableError> typeReference()gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-