io.sphere.sdk.carts.commands.CartDeleteCommand Maven / Gradle / Ivy
/*
This class has been generated by class io.sphere.sdk.annotations.processors.DeleteCommandEndpointAnnotationProcessor
induced by the annotation io.sphere.sdk.annotations.HasDeleteCommand.
in the source class io.sphere.sdk.carts.Cart.
To render this class the handlebars template 'commands/deleteCommandInterface.hbs' has been used.
*/
package io.sphere.sdk.carts.commands;
import io.sphere.sdk.commands.DeleteCommand;
import io.sphere.sdk.expansion.MetaModelReferenceExpansionDsl;
import io.sphere.sdk.models.Versioned;
import io.sphere.sdk.carts.Cart;
import io.sphere.sdk.carts.expansion.CartExpansionModel;
import static io.sphere.sdk.client.SphereRequestUtils.urlEncode;
/**
Deletes a cart
{@include.example io.sphere.sdk.carts.commands.CartDeleteCommandIntegrationTest#deleteCartByKey() }
@see Cart
*/
public interface CartDeleteCommand extends MetaModelReferenceExpansionDsl>, DeleteCommand {
/**
Creates a command object to delete a {@link Cart} by ID.
@param versioned the object to delete (so directly a {@link Cart}) or just the version/ID information of it
@return delete command
*/
static CartDeleteCommand of(final Versioned versioned) {
return new CartDeleteCommandImpl(versioned,false);
}
/**
Creates a command object to delete a {@link Cart} by ID.
@param versioned the object to delete (so directly a {@link Cart}) or just the version/ID information of it
@param eraseData If set to {@literal true}, the commercetools platform guarantees that all personal data related to the particular object, including invisible data, is erased, in compliance with the GDPR.
@return delete command
*/
static CartDeleteCommand of(final Versioned versioned,final boolean eraseData) {
return new CartDeleteCommandImpl(versioned,eraseData);
}
/**
Creates a command object to delete a {@link Cart} by its key.
@param key the key of the Cart to delete, see {@link Cart#getKey()}
@param version `the current version of the Cart, see {@link Cart#getVersion()}
@return delete command
*/
static CartDeleteCommand ofKey(final String key, final Long version) {
final Versioned versioned = Versioned.of("key=" + urlEncode(key), version);//hack for simple reuse
return of(versioned);
}
/**
Creates a command object to delete a {@link Cart} by its key.
@param key the key of the Cart to delete, see {@link Cart#getKey()}
@param version the current version of the Cart, see {@link Cart#getVersion()}
@param eraseData If set to {@literal true}, the commercetools platform guarantees that all personal data related to the particular object, including invisible data, is erased, in compliance with the GDPR.
@return delete command
*/
static CartDeleteCommand ofKey(final String key, final Long version, final boolean eraseData) {
final Versioned versioned = Versioned.of("key=" + urlEncode(key), version);//hack for simple reuse
return of(versioned, eraseData);
}
/**
Creates a command object to delete a {@link Cart} by its id.
@param id the id of the Cart to delete, see {@link Cart#getId()}
@param version `the current version of the Cart, see {@link Cart#getVersion()}
@return delete command
*/
static CartDeleteCommand ofId(final String id, final Long version) {
final Versioned versioned = Versioned.of("id=" + urlEncode(id), version);//hack for simple reuse
return of(versioned);
}
/**
Creates a command object to delete a {@link Cart} by its id.
@param id the id of the Cart to delete, see {@link Cart#getId()}
@param version the current version of the Cart, see {@link Cart#getVersion()}
@param eraseData If set to {@literal true}, the commercetools platform guarantees that all personal data related to the particular object, including invisible data, is erased, in compliance with the GDPR.
@return delete command
*/
static CartDeleteCommand ofId(final String id, final Long version, final boolean eraseData) {
final Versioned versioned = Versioned.of("id=" + urlEncode(id), version);//hack for simple reuse
return of(versioned, eraseData);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy