Interface OverlappingPriceValidityError
- All Superinterfaces:
ErrorObject
Returned when a given Price validity period conflicts with an existing one. Every Price of a Product Variant with the same combination of currency, country, Customer Group, and Channel must have non-overlapping validity periods (validFrom and validUntil).
The error is returned as a failed response to the Create Product or Update Product request.
Example to create an instance using the builder pattern
OverlappingPriceValidityError overlappingPriceValidityError = OverlappingPriceValidityError.builder()
.message("{message}")
.conflictingPrice("{conflictingPrice}")
.currency("{currency}")
.build()
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringdiscriminator value for OverlappingPriceValidityError -
Method Summary
Modifier and TypeMethodDescriptionbuilder()builder factory method for OverlappingPriceValidityErrorbuilder(OverlappingPriceValidityError template) create builder for OverlappingPriceValidityError instancecopyDeep()deepCopy(OverlappingPriceValidityError template) factory method to create a deep copy of OverlappingPriceValidityError@Valid ChannelResourceIdentifierChannel for which the Price is valid.@NotNull StringgetCode()Error identifier.@NotNull StringUnique identifier of the conflicting Embedded Price.Date and time (UTC) from which the conflicting Embedded Price is valid.Date and time (UTC) until which the conflicting Embedded Price is valid.Country code of the Price.@NotNull StringCurrency code of the Price.CustomerGroup for which the Price is valid.@NotNull String"Two prices have overlapping validity periods."Date and time (UTC) from which the Embedded Price is valid.Date and time (UTC) until which the Embedded Price is valid.of()factory methodof(OverlappingPriceValidityError template) factory method to create a shallow copy OverlappingPriceValidityErrorvoidsetChannel(ChannelResourceIdentifier channel) Channel for which the Price is valid.voidsetConflictingPrice(String conflictingPrice) Unique identifier of the conflicting Embedded Price.voidsetConflictingValidFrom(ZonedDateTime conflictingValidFrom) Date and time (UTC) from which the conflicting Embedded Price is valid.voidsetConflictingValidUntil(ZonedDateTime conflictingValidUntil) Date and time (UTC) until which the conflicting Embedded Price is valid.voidsetCountry(String country) Country code of the Price.voidsetCurrency(String currency) Currency code of the Price.voidsetCustomerGroup(CustomerGroupResourceIdentifier customerGroup) CustomerGroup for which the Price is valid.voidsetMessage(String message) "Two prices have overlapping validity periods."voidsetValidFrom(ZonedDateTime validFrom) Date and time (UTC) from which the Embedded Price is valid.voidsetValidUntil(ZonedDateTime validUntil) Date and time (UTC) until which the Embedded Price is valid.static tools.jackson.core.type.TypeReference<OverlappingPriceValidityError>gives a TypeReference for usage with Jackson DataBinddefault <T> Taccessor map functionMethods inherited from interface com.commercetools.api.models.error.ErrorObject
setValue, values, withErrorObject
-
Field Details
-
OVERLAPPING_PRICE_VALIDITY
discriminator value for OverlappingPriceValidityError- See Also:
-
-
Method Details
-
getCode
Description copied from interface:ErrorObjectError identifier.
- Specified by:
getCodein interfaceErrorObject- Returns:
- code
-
getMessage
"Two prices have overlapping validity periods."- Specified by:
getMessagein interfaceErrorObject- Returns:
- message
-
getConflictingPrice
Unique identifier of the conflicting Embedded Price.
- Returns:
- conflictingPrice
-
getCurrency
Currency code of the Price.
- Returns:
- currency
-
getCountry
String getCountry()Country code of the Price.
- Returns:
- country
-
getCustomerGroup
CustomerGroup for which the Price is valid.
- Returns:
- customerGroup
-
getChannel
Channel for which the Price is valid.
- Returns:
- channel
-
getValidFrom
ZonedDateTime getValidFrom()Date and time (UTC) from which the Embedded Price is valid.
- Returns:
- validFrom
-
getValidUntil
ZonedDateTime getValidUntil()Date and time (UTC) until which the Embedded Price is valid.
- Returns:
- validUntil
-
getConflictingValidFrom
ZonedDateTime getConflictingValidFrom()Date and time (UTC) from which the conflicting Embedded Price is valid.
- Returns:
- conflictingValidFrom
-
getConflictingValidUntil
ZonedDateTime getConflictingValidUntil()Date and time (UTC) until which the conflicting Embedded Price is valid.
- Returns:
- conflictingValidUntil
-
setMessage
"Two prices have overlapping validity periods."- Specified by:
setMessagein interfaceErrorObject- Parameters:
message- value to be set
-
setConflictingPrice
Unique identifier of the conflicting Embedded Price.
- Parameters:
conflictingPrice- value to be set
-
setCurrency
Currency code of the Price.
- Parameters:
currency- value to be set
-
setCountry
Country code of the Price.
- Parameters:
country- value to be set
-
setCustomerGroup
CustomerGroup for which the Price is valid.
- Parameters:
customerGroup- value to be set
-
setChannel
Channel for which the Price is valid.
- Parameters:
channel- value to be set
-
setValidFrom
Date and time (UTC) from which the Embedded Price is valid.
- Parameters:
validFrom- value to be set
-
setValidUntil
Date and time (UTC) until which the Embedded Price is valid.
- Parameters:
validUntil- value to be set
-
setConflictingValidFrom
Date and time (UTC) from which the conflicting Embedded Price is valid.
- Parameters:
conflictingValidFrom- value to be set
-
setConflictingValidUntil
Date and time (UTC) until which the conflicting Embedded Price is valid.
- Parameters:
conflictingValidUntil- value to be set
-
of
factory method- Returns:
- instance of OverlappingPriceValidityError
-
of
factory method to create a shallow copy OverlappingPriceValidityError- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
OverlappingPriceValidityError copyDeep()- Specified by:
copyDeepin interfaceErrorObject
-
deepCopy
@Nullable static OverlappingPriceValidityError deepCopy(@Nullable OverlappingPriceValidityError template) factory method to create a deep copy of OverlappingPriceValidityError- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for OverlappingPriceValidityError- Returns:
- builder
-
builder
create builder for OverlappingPriceValidityError instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withOverlappingPriceValidityError
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
-