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

io.sphere.sdk.payments.commands.PaymentDeleteCommand 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.payments.Payment.
To render this class the handlebars template 'commands/deleteCommandInterface.hbs' has been used.
*/
package io.sphere.sdk.payments.commands;

import io.sphere.sdk.commands.DeleteCommand;
import io.sphere.sdk.expansion.MetaModelReferenceExpansionDsl;
import io.sphere.sdk.models.Versioned;
import io.sphere.sdk.payments.Payment;
import io.sphere.sdk.payments.expansion.PaymentExpansionModel;

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

/**
Command object to delete a {@link Payment}.

    
        {@include.example io.sphere.sdk.payments.commands.PaymentDeleteCommandIntegrationTest#execution() }
    

@see Payment
 */
public interface PaymentDeleteCommand extends MetaModelReferenceExpansionDsl>, DeleteCommand {

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

    
    /**
        Creates a command object to delete a {@link Payment} by ID.
        @param versioned the object to delete (so directly a {@link Payment}) or just the version/ID information of it
        @param eraseData  If set to {@literal true}, Composable Commerce guarantees that all personal data related to the particular object, including invisible data, is erased, in compliance with the GDPR.
        @return delete command
     */
    static PaymentDeleteCommand of(final Versioned versioned,final boolean eraseData) {
        return new PaymentDeleteCommandImpl(versioned,eraseData);
    }
   


    /**
        Creates a command object to delete a {@link Payment} by its key.
        @param key the key of the Payment to delete, see {@link Payment#getKey()}
        @param version `the current version of the Payment, see {@link Payment#getVersion()}
        @return delete command
    */
    static PaymentDeleteCommand 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 Payment} by its key.
        @param key the key of the Payment to delete, see {@link Payment#getKey()}
        @param version the current version of the Payment, see {@link Payment#getVersion()}
        @param eraseData  If set to {@literal true}, Composable Commerce guarantees that all personal data related to the particular object, including invisible data, is erased, in compliance with the GDPR.
        @return delete command
    */
    static PaymentDeleteCommand 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);
    }
   

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy