Class AssetCustomActionBuilder
- java.lang.Object
-
- com.commercetools.sync.categories.helpers.AssetCustomActionBuilder
-
- All Implemented Interfaces:
GenericCustomActionBuilder<com.commercetools.api.models.category.CategoryUpdateAction>
public class AssetCustomActionBuilder extends java.lang.Object implements GenericCustomActionBuilder<com.commercetools.api.models.category.CategoryUpdateAction>
-
-
Constructor Summary
Constructors Constructor Description AssetCustomActionBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.commercetools.api.models.category.CategoryUpdateActionbuildRemoveCustomTypeAction(java.lang.Long variantId, java.lang.String assetKey)Creates a CTP "setCustomType" update action on the given resourceTthat removes the custom type set on the given resourceT.com.commercetools.api.models.category.CategoryUpdateActionbuildSetCustomFieldAction(java.lang.Long variantId, java.lang.String assetKey, java.lang.String customFieldName, java.lang.Object customFieldValue)Creates a CTP "setCustomField" update action on the given resourceTthat updates a custom field withcustomFieldNameand acustomFieldValueon the given resourceT.com.commercetools.api.models.category.CategoryUpdateActionbuildSetCustomTypeAction(java.lang.Long variantId, java.lang.String assetKey, java.lang.String customTypeId, java.util.Map<java.lang.String,java.lang.Object> customFieldsJsonMap)Creates a CTP "setCustomType" update action on the given resourceT.
-
-
-
Method Detail
-
buildRemoveCustomTypeAction
@Nonnull public com.commercetools.api.models.category.CategoryUpdateAction buildRemoveCustomTypeAction(@Nullable java.lang.Long variantId, @Nullable java.lang.String assetKey)Description copied from interface:GenericCustomActionBuilderCreates a CTP "setCustomType" update action on the given resourceTthat removes the custom type set on the given resourceT. If the resource that has the custom fields is a secondary resource (e.g. price or asset) and not a primary resource (e.g Category, Product, Channel, etc..), thevariantIdand theobjectIdwill be used to identify this secondary resource within its container.- Specified by:
buildRemoveCustomTypeActionin interfaceGenericCustomActionBuilder<com.commercetools.api.models.category.CategoryUpdateAction>- Parameters:
variantId- an optional field which could be used to identify the variant that holds the a resource (e.g. asset) which has the custom fields.assetKey- an optional field which could be used to identify the id of the resource (e.g. asset, price, etc..) which has the custom fields.- Returns:
- a setCustomType update action that removes the custom type from the resource it's requested on.
-
buildSetCustomTypeAction
@Nonnull public com.commercetools.api.models.category.CategoryUpdateAction buildSetCustomTypeAction(@Nullable java.lang.Long variantId, @Nullable java.lang.String assetKey, @Nonnull java.lang.String customTypeId, @Nullable java.util.Map<java.lang.String,java.lang.Object> customFieldsJsonMap)Description copied from interface:GenericCustomActionBuilderCreates a CTP "setCustomType" update action on the given resourceT. If the resource that has the custom fields is a secondary resource (e.g. Price or asset) and not a primary resource (e.g Category, Product, Channel, etc..), thevariantIdand theobjectIdwill be used to identify this secondary resource within its container.- Specified by:
buildSetCustomTypeActionin interfaceGenericCustomActionBuilder<com.commercetools.api.models.category.CategoryUpdateAction>- Parameters:
variantId- an optional field which could be used to identify the variant that holds the a resource (e.g. asset) which has the custom fields.assetKey- an optional field which could be used to identify the id of the resource (e.g. asset, price, etc..) which has the custom fields.customTypeId- the id of the new custom type.customFieldsJsonMap- the custom fields map of JSON values.- Returns:
- a setCustomType update action of the type of the resource it's requested on.
-
buildSetCustomFieldAction
@Nonnull public com.commercetools.api.models.category.CategoryUpdateAction buildSetCustomFieldAction(@Nullable java.lang.Long variantId, @Nullable java.lang.String assetKey, @Nullable java.lang.String customFieldName, @Nullable java.lang.Object customFieldValue)Description copied from interface:GenericCustomActionBuilderCreates a CTP "setCustomField" update action on the given resourceTthat updates a custom field withcustomFieldNameand acustomFieldValueon the given resourceT. If the resource that has the custom fields is a secondary resource (e.g. Price or asset) and not a primary resource (e.g Category, Product, Channel, etc..), thevariantIdand theobjectIdwill be used to identify this secondary resource within its container.- Specified by:
buildSetCustomFieldActionin interfaceGenericCustomActionBuilder<com.commercetools.api.models.category.CategoryUpdateAction>- Parameters:
variantId- an optional field which could be used to identify the variant that holds the a resource (e.g. asset) which has the custom fields.assetKey- an optional field which could be used to identify the id of the resource (e.g. asset, price, etc..) which has the custom fields.customFieldName- the name of the custom field to update.customFieldValue- the new JSON value of the custom field.- Returns:
- a setCustomField update action on the provided field name, with the provided value on the resource it's requested on.
-
-