All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.sphere.sdk.cartdiscounts.commands.CartDiscountDeleteCommand Maven / Gradle / Ivy

There is a newer version: 2.16.0
Show 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.cartdiscounts.CartDiscount.
To render this class the handlebars template 'commands/deleteCommandInterface.hbs' has been used.
*/
package io.sphere.sdk.cartdiscounts.commands;

import io.sphere.sdk.commands.DeleteCommand;
import io.sphere.sdk.expansion.MetaModelReferenceExpansionDsl;
import io.sphere.sdk.models.Versioned;
import io.sphere.sdk.cartdiscounts.CartDiscount;
import io.sphere.sdk.cartdiscounts.expansion.CartDiscountExpansionModel;

import static io.sphere.sdk.client.SphereRequestUtils.urlEncode;

/**
Deletes a {@link CartDiscount}.

@see CartDiscount
 */
public interface CartDiscountDeleteCommand extends MetaModelReferenceExpansionDsl>, DeleteCommand {

    /**
        Creates a command object to delete a {@link CartDiscount} by ID.
        @param versioned the object to delete (so directly a {@link CartDiscount}) or just the version/ID information of it
        @return delete command
     */
    static CartDiscountDeleteCommand of(final Versioned versioned) {
        return new CartDiscountDeleteCommandImpl(versioned,false);
    }

    


    /**
        Creates a command object to delete a {@link CartDiscount} by its key.
        @param key the key of the CartDiscount to delete, see {@link CartDiscount#getKey()}
        @param version `the current version of the CartDiscount, see {@link CartDiscount#getVersion()}
        @return delete command
    */
    static CartDiscountDeleteCommand 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 CartDiscount} by its id.
        @param id the id of the CartDiscount to delete, see {@link CartDiscount#getId()}
        @param version `the current version of the CartDiscount, see {@link CartDiscount#getVersion()}
        @return delete command
    */
    static CartDiscountDeleteCommand ofId(final String id, final Long version) {
        final Versioned versioned = Versioned.of("id=" + urlEncode(id), version);//hack for simple reuse
        return of(versioned);
    }

   

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy