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 DiscountCodeImportBuilderbuilder()builder factory method for DiscountCodeImportstatic DiscountCodeImportBuilderbuilder(DiscountCodeImport template) create builder for DiscountCodeImport instancecopyDeep()static DiscountCodeImportdeepCopy(DiscountCodeImport template) factory method to create a deep copy of DiscountCodeImport@NotNull @Valid List<CartDiscountKeyReference>Maps toDiscountCode.cartDiscounts.Maps toDiscountCode.cartPredicate.@NotNull StringgetCode()Maps toDiscountCode.code.@Valid CustomMaps toDiscountCode.custom.@Valid LocalizedStringMaps toDiscountCode.description.Maps toDiscountCode.groups.@NotNull BooleanMaps toDiscountCode.isActive.@NotNull StringgetKey()User-defined unique identifier.Maps toDiscountCode.maxApplications.Maps toDiscountCode.maxApplicationsPerCustomer.@Valid LocalizedStringgetName()Maps toDiscountCode.name.Maps toDiscountCode.validFrom.Maps toDiscountCode.validUntil.static DiscountCodeImportof()factory methodstatic DiscountCodeImportof(DiscountCodeImport template) factory method to create a shallow copy DiscountCodeImportvoidsetCartDiscounts(CartDiscountKeyReference... cartDiscounts) Maps toDiscountCode.cartDiscounts.voidsetCartDiscounts(List<CartDiscountKeyReference> cartDiscounts) Maps toDiscountCode.cartDiscounts.voidsetCartPredicate(String cartPredicate) Maps toDiscountCode.cartPredicate.voidMaps toDiscountCode.code.voidMaps toDiscountCode.custom.voidsetDescription(LocalizedString description) Maps toDiscountCode.description.voidMaps toDiscountCode.groups.voidMaps toDiscountCode.groups.voidsetIsActive(Boolean isActive) Maps toDiscountCode.isActive.voidUser-defined unique identifier.voidsetMaxApplications(Long maxApplications) Maps toDiscountCode.maxApplications.voidsetMaxApplicationsPerCustomer(Long maxApplicationsPerCustomer) Maps toDiscountCode.maxApplicationsPerCustomer.voidsetName(LocalizedString name) Maps toDiscountCode.name.voidsetValidFrom(ZonedDateTime validFrom) Maps toDiscountCode.validFrom.voidsetValidUntil(ZonedDateTime validUntil) Maps toDiscountCode.validUntil.static com.fasterxml.jackson.core.type.TypeReference<DiscountCodeImport>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithDiscountCodeImport(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
keyexists, it is updated with the imported data.- Specified by:
getKeyin 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, thestateof the ImportOperation will be set tounresolveduntil 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
keyexists, it is updated with the imported data.- Specified by:
setKeyin 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, thestateof the ImportOperation will be set tounresolveduntil the referenced CartDiscounts are created.- Parameters:
cartDiscounts- values to be set
-
setCartDiscounts
Maps to
DiscountCode.cartDiscounts. If the referenced CartDiscounts do not exist, thestateof the ImportOperation will be set tounresolveduntil 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:
copyDeepin 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
-