public final class ProductAssetActionFactory extends AssetActionFactory<io.sphere.sdk.products.Product,io.sphere.sdk.products.ProductDraft>
syncOptions
Constructor and Description |
---|
ProductAssetActionFactory(java.lang.Integer variantId,
ProductSyncOptions syncOptions) |
Modifier and Type | Method and Description |
---|---|
io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.products.Product> |
buildAddAssetAction(io.sphere.sdk.models.AssetDraft assetDraft,
java.lang.Integer position)
Takes an asset draft and an asset position to build an AddAsset action of the type T.
|
java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.products.Product>> |
buildAssetActions(io.sphere.sdk.products.ProductDraft newResource,
io.sphere.sdk.models.Asset oldAsset,
io.sphere.sdk.models.AssetDraft newAssetDraft)
Takes a matching old asset and a new asset and computes the update actions needed to sync them.
|
io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.products.Product> |
buildChangeAssetOrderAction(java.util.List<java.lang.String> newAssetOrder)
Takes a list of asset ids to build a ChangeAssetOrder action of the type T.
|
io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.products.Product> |
buildRemoveAssetAction(java.lang.String assetKey)
Takes an asset key to build a RemoveAsset action of the type T.
|
public ProductAssetActionFactory(@Nonnull java.lang.Integer variantId, @Nonnull ProductSyncOptions syncOptions)
public java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.products.Product>> buildAssetActions(@Nonnull io.sphere.sdk.products.ProductDraft newResource, @Nonnull io.sphere.sdk.models.Asset oldAsset, @Nonnull io.sphere.sdk.models.AssetDraft newAssetDraft)
AssetActionFactory
buildAssetActions
in class AssetActionFactory<io.sphere.sdk.products.Product,io.sphere.sdk.products.ProductDraft>
newResource
- new mainresource draft, which contains the asset to update.oldAsset
- the old asset to compare.newAssetDraft
- the matching new asset draft.public io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.products.Product> buildRemoveAssetAction(@Nonnull java.lang.String assetKey)
AssetActionFactory
buildRemoveAssetAction
in class AssetActionFactory<io.sphere.sdk.products.Product,io.sphere.sdk.products.ProductDraft>
assetKey
- the key of the asset used un building the update action.public io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.products.Product> buildChangeAssetOrderAction(@Nonnull java.util.List<java.lang.String> newAssetOrder)
AssetActionFactory
buildChangeAssetOrderAction
in class AssetActionFactory<io.sphere.sdk.products.Product,io.sphere.sdk.products.ProductDraft>
newAssetOrder
- the new asset order needed to build the action.public io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.products.Product> buildAddAssetAction(@Nonnull io.sphere.sdk.models.AssetDraft assetDraft, @Nonnull java.lang.Integer position)
AssetActionFactory
buildAddAssetAction
in class AssetActionFactory<io.sphere.sdk.products.Product,io.sphere.sdk.products.ProductDraft>
assetDraft
- the new asset draft to create an Add asset action for.position
- the position to add the new asset to.