Interface DiscountCodeImport
- All Superinterfaces:
ImportResource
Represents the data used to import a DiscountCode. Once imported, this data is persisted as a DiscountCode in the Project.
Example to create an instance using the builder pattern
DiscountCodeImport discountCodeImport = DiscountCodeImport.builder()
.key("{key}")
.code("{code}")
.plusCartDiscounts(cartDiscountsBuilder -> cartDiscountsBuilder)
.isActive(true)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic DiscountCodeImportBuilder
builder()
builder factory method for DiscountCodeImportstatic DiscountCodeImportBuilder
builder
(DiscountCodeImport template) create builder for DiscountCodeImport instancecopyDeep()
static DiscountCodeImport
deepCopy
(DiscountCodeImport template) factory method to create a deep copy of DiscountCodeImport@NotNull @Valid List<CartDiscountKeyReference>
Maps toDiscountCode.cartDiscounts
.Maps toDiscountCode.cartPredicate
.@NotNull String
getCode()
Maps toDiscountCode.code
.@Valid Custom
Maps toDiscountCode.custom
.@Valid LocalizedString
Maps toDiscountCode.description
.Maps toDiscountCode.groups
.@NotNull Boolean
Maps toDiscountCode.isActive
.@NotNull String
getKey()
User-defined unique identifier.Maps toDiscountCode.maxApplications
.Maps toDiscountCode.maxApplicationsPerCustomer
.@Valid LocalizedString
getName()
Maps toDiscountCode.name
.Maps toDiscountCode.validFrom
.Maps toDiscountCode.validUntil
.static DiscountCodeImport
of()
factory methodstatic DiscountCodeImport
of
(DiscountCodeImport template) factory method to create a shallow copy DiscountCodeImportvoid
setCartDiscounts
(CartDiscountKeyReference... cartDiscounts) Maps toDiscountCode.cartDiscounts
.void
setCartDiscounts
(List<CartDiscountKeyReference> cartDiscounts) Maps toDiscountCode.cartDiscounts
.void
setCartPredicate
(String cartPredicate) Maps toDiscountCode.cartPredicate
.void
Maps toDiscountCode.code
.void
Maps toDiscountCode.custom
.void
setDescription
(LocalizedString description) Maps toDiscountCode.description
.void
Maps toDiscountCode.groups
.void
Maps toDiscountCode.groups
.void
setIsActive
(Boolean isActive) Maps toDiscountCode.isActive
.void
User-defined unique identifier.void
setMaxApplications
(Long maxApplications) Maps toDiscountCode.maxApplications
.void
setMaxApplicationsPerCustomer
(Long maxApplicationsPerCustomer) Maps toDiscountCode.maxApplicationsPerCustomer
.void
setName
(LocalizedString name) Maps toDiscountCode.name
.void
setValidFrom
(ZonedDateTime validFrom) Maps toDiscountCode.validFrom
.void
setValidUntil
(ZonedDateTime validUntil) Maps toDiscountCode.validUntil
.static com.fasterxml.jackson.core.type.TypeReference<DiscountCodeImport>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withDiscountCodeImport
(Function<DiscountCodeImport, T> helper) accessor map functionMethods inherited from interface com.commercetools.importapi.models.common.ImportResource
withImportResource
-
Method Details
-
getKey
User-defined unique identifier. If a DiscountCode with this
key
exists, it is updated with the imported data.- Specified by:
getKey
in interfaceImportResource
- Returns:
- key
-
getName
Maps to
DiscountCode.name
.- Returns:
- name
-
getDescription
Maps to
DiscountCode.description
.- Returns:
- description
-
getCode
Maps to
DiscountCode.code
. This value cannot be updated. Attempting to update this value will result in an InvalidFieldsUpdate error.- Returns:
- code
-
getCartDiscounts
Maps to
DiscountCode.cartDiscounts
. If the referenced CartDiscounts do not exist, thestate
of the ImportOperation will be set tounresolved
until the referenced CartDiscounts are created.- Returns:
- cartDiscounts
-
getCartPredicate
String getCartPredicate()Maps to
DiscountCode.cartPredicate
.- Returns:
- cartPredicate
-
getIsActive
Maps to
DiscountCode.isActive
.- Returns:
- isActive
-
getMaxApplications
Long getMaxApplications()Maps to
DiscountCode.maxApplications
.- Returns:
- maxApplications
-
getMaxApplicationsPerCustomer
Long getMaxApplicationsPerCustomer()Maps to
DiscountCode.maxApplicationsPerCustomer
.- Returns:
- maxApplicationsPerCustomer
-
getGroups
Maps to
DiscountCode.groups
.- Returns:
- groups
-
getValidFrom
ZonedDateTime getValidFrom()Maps to
DiscountCode.validFrom
.- Returns:
- validFrom
-
getValidUntil
ZonedDateTime getValidUntil()Maps to
DiscountCode.validUntil
.- Returns:
- validUntil
-
getCustom
Maps to
DiscountCode.custom
.- Returns:
- custom
-
setKey
User-defined unique identifier. If a DiscountCode with this
key
exists, it is updated with the imported data.- Specified by:
setKey
in interfaceImportResource
- Parameters:
key
- value to be set
-
setName
Maps to
DiscountCode.name
.- Parameters:
name
- value to be set
-
setDescription
Maps to
DiscountCode.description
.- Parameters:
description
- value to be set
-
setCode
Maps to
DiscountCode.code
. This value cannot be updated. Attempting to update this value will result in an InvalidFieldsUpdate error.- Parameters:
code
- value to be set
-
setCartDiscounts
Maps to
DiscountCode.cartDiscounts
. If the referenced CartDiscounts do not exist, thestate
of the ImportOperation will be set tounresolved
until the referenced CartDiscounts are created.- Parameters:
cartDiscounts
- values to be set
-
setCartDiscounts
Maps to
DiscountCode.cartDiscounts
. If the referenced CartDiscounts do not exist, thestate
of the ImportOperation will be set tounresolved
until the referenced CartDiscounts are created.- Parameters:
cartDiscounts
- values to be set
-
setCartPredicate
Maps to
DiscountCode.cartPredicate
.- Parameters:
cartPredicate
- value to be set
-
setIsActive
Maps to
DiscountCode.isActive
.- Parameters:
isActive
- value to be set
-
setMaxApplications
Maps to
DiscountCode.maxApplications
.- Parameters:
maxApplications
- value to be set
-
setMaxApplicationsPerCustomer
Maps to
DiscountCode.maxApplicationsPerCustomer
.- Parameters:
maxApplicationsPerCustomer
- value to be set
-
setGroups
Maps to
DiscountCode.groups
.- Parameters:
groups
- values to be set
-
setGroups
Maps to
DiscountCode.groups
.- Parameters:
groups
- values to be set
-
setValidFrom
Maps to
DiscountCode.validFrom
.- Parameters:
validFrom
- value to be set
-
setValidUntil
Maps to
DiscountCode.validUntil
.- Parameters:
validUntil
- value to be set
-
setCustom
Maps to
DiscountCode.custom
.- Parameters:
custom
- value to be set
-
of
factory method- Returns:
- instance of DiscountCodeImport
-
of
factory method to create a shallow copy DiscountCodeImport- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
copyDeep
DiscountCodeImport copyDeep()- Specified by:
copyDeep
in interfaceImportResource
-
deepCopy
factory method to create a deep copy of DiscountCodeImport- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for DiscountCodeImport- Returns:
- builder
-
builder
create builder for DiscountCodeImport instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withDiscountCodeImport
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
-