io.sphere.sdk.customergroups.commands.CustomerGroupDeleteCommand Maven / Gradle / Ivy
The newest version!
/*
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.customergroups.CustomerGroup.
To render this class the handlebars template 'commands/deleteCommandInterface.hbs' has been used.
*/
package io.sphere.sdk.customergroups.commands;
import io.sphere.sdk.commands.DeleteCommand;
import io.sphere.sdk.expansion.MetaModelReferenceExpansionDsl;
import io.sphere.sdk.models.Versioned;
import io.sphere.sdk.customergroups.CustomerGroup;
import io.sphere.sdk.customergroups.expansion.CustomerGroupExpansionModel;
import static io.sphere.sdk.client.SphereRequestUtils.urlEncode;
/**
Deletes a customer group.
{@include.example io.sphere.sdk.customergroups.commands.CustomerGroupDeleteCommandByIdIntegrationTest#execution() }
@see CustomerGroup
*/
public interface CustomerGroupDeleteCommand extends MetaModelReferenceExpansionDsl>, DeleteCommand {
/**
Creates a command object to delete a {@link CustomerGroup} by ID.
@param versioned the object to delete (so directly a {@link CustomerGroup}) or just the version/ID information of it
@return delete command
*/
static CustomerGroupDeleteCommand of(final Versioned versioned) {
return new CustomerGroupDeleteCommandImpl(versioned,false);
}
/**
Creates a command object to delete a {@link CustomerGroup} by its key.
@param key the key of the CustomerGroup to delete, see {@link CustomerGroup#getKey()}
@param version `the current version of the CustomerGroup, see {@link CustomerGroup#getVersion()}
@return delete command
*/
static CustomerGroupDeleteCommand ofKey(final String key, final Long version) {
final Versioned versioned = Versioned.of("key=" + urlEncode(key), version);//hack for simple reuse
return of(versioned);
}
}