Interface ExtensionDraft
- All Superinterfaces:
Draft<ExtensionDraft>,WithKey
Example to create an instance using the builder pattern
ExtensionDraft extensionDraft = ExtensionDraft.builder()
.destination(destinationBuilder -> destinationBuilder)
.plusTriggers(triggersBuilder -> triggersBuilder)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic ExtensionDraftBuilderbuilder()builder factory method for ExtensionDraftstatic ExtensionDraftBuilderbuilder(ExtensionDraft template) create builder for ExtensionDraft instancecopyDeep()static ExtensionDraftdeepCopy(ExtensionDraft template) factory method to create a deep copy of ExtensionDraftConfigures additional information included in the payload sent to the API Extension.@Valid List<ExtensionResourceIdentifier>Extensions that must complete before this Extension is called, identified byidorkey.@NotNull @Valid ExtensionDestinationDefines where the Extension can be reached.Expansion paths used for reference expansion of the payload.getKey()User-defined unique identifier for the Extension.Maximum time (in milliseconds) the Extension can respond within.@NotNull @Valid List<ExtensionTrigger>Describes what triggers the Extension.static ExtensionDraftof()factory methodstatic ExtensionDraftof(ExtensionDraft template) factory method to create a shallow copy ExtensionDraftvoidsetAdditionalContext(ExtensionAdditionalContextDraft additionalContext) Configures additional information included in the payload sent to the API Extension.voidsetDependencies(ExtensionResourceIdentifier... dependencies) Extensions that must complete before this Extension is called, identified byidorkey.voidsetDependencies(List<ExtensionResourceIdentifier> dependencies) Extensions that must complete before this Extension is called, identified byidorkey.voidsetDestination(ExtensionDestination destination) Defines where the Extension can be reached.voidsetExpansionPaths(String... expansionPaths) Expansion paths used for reference expansion of the payload.voidsetExpansionPaths(List<String> expansionPaths) Expansion paths used for reference expansion of the payload.voidUser-defined unique identifier for the Extension.voidsetTimeoutInMs(Integer timeoutInMs) Maximum time (in milliseconds) the Extension can respond within.voidsetTriggers(ExtensionTrigger... triggers) Describes what triggers the Extension.voidsetTriggers(List<ExtensionTrigger> triggers) Describes what triggers the Extension.static com.fasterxml.jackson.core.type.TypeReference<ExtensionDraft>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithExtensionDraft(Function<ExtensionDraft, T> helper) accessor map function
-
Method Details
-
getKey
String getKey()User-defined unique identifier for the Extension.
-
getDestination
Defines where the Extension can be reached.
- Returns:
- destination
-
getTriggers
Describes what triggers the Extension.
- Returns:
- triggers
-
getTimeoutInMs
Integer getTimeoutInMs()Maximum time (in milliseconds) the Extension can respond within. If no timeout is provided, the default value is used for all types of Extensions. We recommend keeping the timeout as low as possible to avoid performance issues.
The limit of 10000 ms (10 seconds) can be increased per Project after we review the performance impact. Please contact the commercetools support team and provide the Region, Project key, and use case.
- Returns:
- timeoutInMs
-
getDependencies
Extensions that must complete before this Extension is called, identified by
idorkey. Maximum 5 entries. If omitted, the Extension has no dependencies and may run concurrently with other independent Extensions.- Returns:
- dependencies
-
getExpansionPaths
Expansion paths used for reference expansion of the payload.
Be aware of the limits of this feature and its performance impact.
- Returns:
- expansionPaths
-
getAdditionalContext
Configures additional information included in the payload sent to the API Extension.
- Returns:
- additionalContext
-
setKey
User-defined unique identifier for the Extension.
- Parameters:
key- value to be set
-
setDestination
Defines where the Extension can be reached.
- Parameters:
destination- value to be set
-
setTriggers
Describes what triggers the Extension.
- Parameters:
triggers- values to be set
-
setTriggers
Describes what triggers the Extension.
- Parameters:
triggers- values to be set
-
setTimeoutInMs
Maximum time (in milliseconds) the Extension can respond within. If no timeout is provided, the default value is used for all types of Extensions. We recommend keeping the timeout as low as possible to avoid performance issues.
The limit of 10000 ms (10 seconds) can be increased per Project after we review the performance impact. Please contact the commercetools support team and provide the Region, Project key, and use case.
- Parameters:
timeoutInMs- value to be set
-
setDependencies
Extensions that must complete before this Extension is called, identified by
idorkey. Maximum 5 entries. If omitted, the Extension has no dependencies and may run concurrently with other independent Extensions.- Parameters:
dependencies- values to be set
-
setDependencies
Extensions that must complete before this Extension is called, identified by
idorkey. Maximum 5 entries. If omitted, the Extension has no dependencies and may run concurrently with other independent Extensions.- Parameters:
dependencies- values to be set
-
setExpansionPaths
Expansion paths used for reference expansion of the payload.
Be aware of the limits of this feature and its performance impact.
- Parameters:
expansionPaths- values to be set
-
setExpansionPaths
Expansion paths used for reference expansion of the payload.
Be aware of the limits of this feature and its performance impact.
- Parameters:
expansionPaths- values to be set
-
setAdditionalContext
Configures additional information included in the payload sent to the API Extension.
- Parameters:
additionalContext- value to be set
-
of
factory method- Returns:
- instance of ExtensionDraft
-
of
factory method to create a shallow copy ExtensionDraft- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
ExtensionDraft copyDeep() -
deepCopy
factory method to create a deep copy of ExtensionDraft- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for ExtensionDraft- Returns:
- builder
-
builder
create builder for ExtensionDraft instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withExtensionDraft
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
-