io.sphere.sdk.zones.commands.ZoneDeleteCommand 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.zones.Zone.
To render this class the handlebars template 'commands/deleteCommandInterface.hbs' has been used.
*/
package io.sphere.sdk.zones.commands;
import io.sphere.sdk.commands.DeleteCommand;
import io.sphere.sdk.expansion.MetaModelReferenceExpansionDsl;
import io.sphere.sdk.models.Versioned;
import io.sphere.sdk.zones.Zone;
import io.sphere.sdk.zones.expansion.ZoneExpansionModel;
import static io.sphere.sdk.client.SphereRequestUtils.urlEncode;
/**
Command object to delete a {@link Zone}.
@see Zone
*/
public interface ZoneDeleteCommand extends MetaModelReferenceExpansionDsl>, DeleteCommand {
/**
Creates a command object to delete a {@link Zone} by ID.
@param versioned the object to delete (so directly a {@link Zone}) or just the version/ID information of it
@return delete command
*/
static ZoneDeleteCommand of(final Versioned versioned) {
return new ZoneDeleteCommandImpl(versioned,false);
}
/**
Creates a command object to delete a {@link Zone} by its key.
@param key the key of the Zone to delete, see {@link Zone#getKey()}
@param version `the current version of the Zone, see {@link Zone#getVersion()}
@return delete command
*/
static ZoneDeleteCommand 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 Zone} by its id.
@param id the id of the Zone to delete, see {@link Zone#getId()}
@param version `the current version of the Zone, see {@link Zone#getVersion()}
@return delete command
*/
static ZoneDeleteCommand ofId(final String id, final Long version) {
final Versioned versioned = Versioned.of("id=" + urlEncode(id), version);//hack for simple reuse
return of(versioned);
}
}