io.sphere.sdk.shippingmethods.commands.updateactions.RemoveShippingRate Maven / Gradle / Ivy
package io.sphere.sdk.shippingmethods.commands.updateactions;
import io.sphere.sdk.commands.UpdateActionImpl;
import io.sphere.sdk.models.Reference;
import io.sphere.sdk.models.Referenceable;
import io.sphere.sdk.shippingmethods.ShippingMethod;
import io.sphere.sdk.shippingmethods.ShippingRate;
import io.sphere.sdk.zones.Zone;
/**
* Removes a shipping rate.
*
* {@doc.gen intro}
*
* {@include.example io.sphere.sdk.shippingmethods.commands.ShippingMethodUpdateCommandTest#workingWithZones()}
*/
public class RemoveShippingRate extends UpdateActionImpl {
private final Reference zone;
private final ShippingRate shippingRate;
private RemoveShippingRate(final ShippingRate shippingRate, final Reference zone) {
super("removeShippingRate");
this.shippingRate = shippingRate;
this.zone = zone;
}
public ShippingRate getShippingRate() {
return shippingRate;
}
public Reference getZone() {
return zone;
}
public static RemoveShippingRate of(final ShippingRate shippingRate, final Referenceable zone) {
return new RemoveShippingRate(shippingRate, zone.toReference());
}
}