Class CartSetShippingMethodActionBuilder
- All Implemented Interfaces:
Builder<CartSetShippingMethodAction>
Example to create an instance using the builder pattern
CartSetShippingMethodAction cartSetShippingMethodAction = CartSetShippingMethodAction.builder()
.build()
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()builds CartSetShippingMethodAction with checking for non-null required valuesbuilds CartSetShippingMethodAction without checking for non-null required valuesestimatedDelivery(EstimatedDelivery estimatedDelivery) Estimated time window during which the shipment is expected to be delivered.Estimated time window during which the shipment is expected to be delivered.externalTaxRate(ExternalTaxRateDraft externalTaxRate) An external Tax Rate can be set if the Cart has theExternalTaxMode.An external Tax Rate can be set if the Cart has theExternalTaxMode.Estimated time window during which the shipment is expected to be delivered.An external Tax Rate can be set if the Cart has theExternalTaxMode.Value to set.of()factory method for an instance of CartSetShippingMethodActionBuilderof(CartSetShippingMethodAction template) create builder for CartSetShippingMethodAction instanceshippingMethod(ShippingMethodResourceIdentifier shippingMethod) Value to set.shippingMethod(Function<ShippingMethodResourceIdentifierBuilder, ShippingMethodResourceIdentifierBuilder> builder) Value to set.Estimated time window during which the shipment is expected to be delivered.An external Tax Rate can be set if the Cart has theExternalTaxMode.withShippingMethod(Function<ShippingMethodResourceIdentifierBuilder, ShippingMethodResourceIdentifier> builder) Value to set.
-
Constructor Details
-
CartSetShippingMethodActionBuilder
public CartSetShippingMethodActionBuilder()
-
-
Method Details
-
shippingMethod
public CartSetShippingMethodActionBuilder shippingMethod(Function<ShippingMethodResourceIdentifierBuilder, ShippingMethodResourceIdentifierBuilder> builder) Value to set. If omitted, any existing value is removed.
InvalidOperation error is returned in one of the following cases:
- If the referenced Shipping Method has a predicate that does not match the Cart.
- If the referenced Shipping Method is not active.
- If the referenced Shipping Method is associated with a Store that is different from the Cart's Store.
- If the referenced Shipping Method is associated with a Store and the Cart is not associated with any Store.
- Parameters:
builder- function to build the shippingMethod value- Returns:
- Builder
-
withShippingMethod
public CartSetShippingMethodActionBuilder withShippingMethod(Function<ShippingMethodResourceIdentifierBuilder, ShippingMethodResourceIdentifier> builder) Value to set. If omitted, any existing value is removed.
InvalidOperation error is returned in one of the following cases:
- If the referenced Shipping Method has a predicate that does not match the Cart.
- If the referenced Shipping Method is not active.
- If the referenced Shipping Method is associated with a Store that is different from the Cart's Store.
- If the referenced Shipping Method is associated with a Store and the Cart is not associated with any Store.
- Parameters:
builder- function to build the shippingMethod value- Returns:
- Builder
-
shippingMethod
public CartSetShippingMethodActionBuilder shippingMethod(@Nullable ShippingMethodResourceIdentifier shippingMethod) Value to set. If omitted, any existing value is removed.
InvalidOperation error is returned in one of the following cases:
- If the referenced Shipping Method has a predicate that does not match the Cart.
- If the referenced Shipping Method is not active.
- If the referenced Shipping Method is associated with a Store that is different from the Cart's Store.
- If the referenced Shipping Method is associated with a Store and the Cart is not associated with any Store.
- Parameters:
shippingMethod- value to be set- Returns:
- Builder
-
externalTaxRate
public CartSetShippingMethodActionBuilder externalTaxRate(Function<ExternalTaxRateDraftBuilder, ExternalTaxRateDraftBuilder> builder) An external Tax Rate can be set if the Cart has the
ExternalTaxMode.- Parameters:
builder- function to build the externalTaxRate value- Returns:
- Builder
-
withExternalTaxRate
public CartSetShippingMethodActionBuilder withExternalTaxRate(Function<ExternalTaxRateDraftBuilder, ExternalTaxRateDraft> builder) An external Tax Rate can be set if the Cart has the
ExternalTaxMode.- Parameters:
builder- function to build the externalTaxRate value- Returns:
- Builder
-
externalTaxRate
public CartSetShippingMethodActionBuilder externalTaxRate(@Nullable ExternalTaxRateDraft externalTaxRate) An external Tax Rate can be set if the Cart has the
ExternalTaxMode.- Parameters:
externalTaxRate- value to be set- Returns:
- Builder
-
estimatedDelivery
public CartSetShippingMethodActionBuilder estimatedDelivery(Function<EstimatedDeliveryBuilder, EstimatedDeliveryBuilder> builder) Estimated time window during which the shipment is expected to be delivered. If not set, any existing estimate on the Cart's ShippingInfo is cleared.
- Parameters:
builder- function to build the estimatedDelivery value- Returns:
- Builder
-
withEstimatedDelivery
public CartSetShippingMethodActionBuilder withEstimatedDelivery(Function<EstimatedDeliveryBuilder, EstimatedDelivery> builder) Estimated time window during which the shipment is expected to be delivered. If not set, any existing estimate on the Cart's ShippingInfo is cleared.
- Parameters:
builder- function to build the estimatedDelivery value- Returns:
- Builder
-
estimatedDelivery
public CartSetShippingMethodActionBuilder estimatedDelivery(@Nullable EstimatedDelivery estimatedDelivery) Estimated time window during which the shipment is expected to be delivered. If not set, any existing estimate on the Cart's ShippingInfo is cleared.
- Parameters:
estimatedDelivery- value to be set- Returns:
- Builder
-
getShippingMethod
Value to set. If omitted, any existing value is removed.
InvalidOperation error is returned in one of the following cases:
- If the referenced Shipping Method has a predicate that does not match the Cart.
- If the referenced Shipping Method is not active.
- If the referenced Shipping Method is associated with a Store that is different from the Cart's Store.
- If the referenced Shipping Method is associated with a Store and the Cart is not associated with any Store.
- Returns:
- shippingMethod
-
getExternalTaxRate
An external Tax Rate can be set if the Cart has the
ExternalTaxMode.- Returns:
- externalTaxRate
-
getEstimatedDelivery
Estimated time window during which the shipment is expected to be delivered. If not set, any existing estimate on the Cart's ShippingInfo is cleared.
- Returns:
- estimatedDelivery
-
build
builds CartSetShippingMethodAction with checking for non-null required values- Specified by:
buildin interfaceBuilder<CartSetShippingMethodAction>- Returns:
- CartSetShippingMethodAction
-
buildUnchecked
builds CartSetShippingMethodAction without checking for non-null required values- Returns:
- CartSetShippingMethodAction
-
of
factory method for an instance of CartSetShippingMethodActionBuilder- Returns:
- builder
-
of
create builder for CartSetShippingMethodAction instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-