public interface CartDeleteCommand extends MetaModelReferenceExpansionDsl<Cart,CartDeleteCommand,CartExpansionModel<Cart>>, DeleteCommand<Cart>
final CartDraft cartDraft = CartDraftBuilder.of(EUR).country(DE).build(); final Cart cart = client().executeBlocking(CartCreateCommand.of(cartDraft)); final String key = randomKey(); final Cart updatedCart = client().executeBlocking(CartUpdateCommand.of(cart, SetKey.of(key))); assertThat(updatedCart.getKey()).isEqualTo(key); client().executeBlocking(CartDeleteCommand.ofKey(key, updatedCart.getVersion())); final PagedQueryResult<Cart> queryResult = client().executeBlocking(CartQuery.of().withPredicates(cartQueryModel -> cartQueryModel.key().is(updatedCart.getKey()))); assertThat(queryResult.getResults()).isEmpty();
See the test code.
Cart
Modifier and Type | Method and Description |
---|---|
static CartDeleteCommand |
of(Versioned<Cart> versioned)
Creates a command object to delete a
Cart by ID. |
static CartDeleteCommand |
of(Versioned<Cart> versioned,
boolean eraseData)
Creates a command object to delete a
Cart by ID. |
static CartDeleteCommand |
ofId(String id,
Long version)
Creates a command object to delete a
Cart by its id. |
static CartDeleteCommand |
ofId(String id,
Long version,
boolean eraseData)
Creates a command object to delete a
Cart by its id. |
static CartDeleteCommand |
ofKey(String key,
Long version)
Creates a command object to delete a
Cart by its key. |
static CartDeleteCommand |
ofKey(String key,
Long version,
boolean eraseData)
Creates a command object to delete a
Cart by its key. |
plusExpansionPaths, withExpansionPaths
plusExpansionPaths, plusExpansionPaths, plusExpansionPaths, plusExpansionPaths, withExpansionPaths, withExpansionPaths, withExpansionPaths, withExpansionPaths
expansionPaths
canDeserialize, deserialize, httpRequestIntent
static CartDeleteCommand of(Versioned<Cart> versioned)
Cart
by ID.versioned
- the object to delete (so directly a Cart
) or just the version/ID information of itstatic CartDeleteCommand of(Versioned<Cart> versioned, boolean eraseData)
Cart
by ID.versioned
- the object to delete (so directly a Cart
) or just the version/ID information of iteraseData
- If set to true, Composable Commerce guarantees that all personal data related to the particular object, including invisible data, is erased, in compliance with the GDPR.static CartDeleteCommand ofKey(String key, Long version)
Cart
by its key.key
- the key of the Cart to delete, see Cart.getKey()
version
- `the current version of the Cart, see Resource.getVersion()
static CartDeleteCommand ofKey(String key, Long version, boolean eraseData)
Cart
by its key.key
- the key of the Cart to delete, see Cart.getKey()
version
- the current version of the Cart, see Resource.getVersion()
eraseData
- If set to true, Composable Commerce guarantees that all personal data related to the particular object, including invisible data, is erased, in compliance with the GDPR.static CartDeleteCommand ofId(String id, Long version)
Cart
by its id.id
- the id of the Cart to delete, see Resource.getId()
version
- `the current version of the Cart, see Resource.getVersion()
static CartDeleteCommand ofId(String id, Long version, boolean eraseData)
Cart
by its id.id
- the id of the Cart to delete, see Resource.getId()
version
- the current version of the Cart, see Resource.getVersion()
eraseData
- If set to true, Composable Commerce guarantees that all personal data related to the particular object, including invisible data, is erased, in compliance with the GDPR.