001
002package com.commercetools.api.models.order_edit;
003
004import java.time.*;
005import java.util.*;
006import java.util.function.Function;
007
008import javax.annotation.Nullable;
009import javax.validation.Valid;
010
011import com.commercetools.api.models.cart.ExternalTaxAmountDraft;
012import com.commercetools.api.models.order.StagedOrderUpdateAction;
013import com.fasterxml.jackson.annotation.*;
014import com.fasterxml.jackson.databind.annotation.*;
015
016import io.vrap.rmf.base.client.utils.Generated;
017
018/**
019 * StagedOrderSetShippingMethodTaxAmountAction
020 *
021 * <hr>
022 * Example to create an instance using the builder pattern
023 * <div class=code-example>
024 * <pre><code class='java'>
025 *     StagedOrderSetShippingMethodTaxAmountAction stagedOrderSetShippingMethodTaxAmountAction = StagedOrderSetShippingMethodTaxAmountAction.builder()
026 *             .build()
027 * </code></pre>
028 * </div>
029 */
030@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
031@JsonDeserialize(as = StagedOrderSetShippingMethodTaxAmountActionImpl.class)
032public interface StagedOrderSetShippingMethodTaxAmountAction extends StagedOrderUpdateAction {
033
034    /**
035     * discriminator value for StagedOrderSetShippingMethodTaxAmountAction
036     */
037    String SET_SHIPPING_METHOD_TAX_AMOUNT = "setShippingMethodTaxAmount";
038
039    /**
040     *  <p><code>key</code> of the ShippingMethod to update. This is required for Orders with <code>Multiple</code> ShippingMode.</p>
041     * @return shippingKey
042     */
043
044    @JsonProperty("shippingKey")
045    public String getShippingKey();
046
047    /**
048     *  <p>Cannot be used in LineItemDraft or CustomLineItemDraft.</p>
049     *  <p>Can only be set by these update actions:</p>
050     *  <ul>
051     *   <li>Set LineItem TaxAmount, Set CustomLineItem TaxAmount, or Set ShippingMethod TaxAmount on Carts</li>
052     *   <li>Set LineItem TaxAmount, Set CustomLineItem TaxAmount, or Set ShippingMethod TaxAmount on Order Edits</li>
053     *  </ul>
054     * @return externalTaxAmount
055     */
056    @Valid
057    @JsonProperty("externalTaxAmount")
058    public ExternalTaxAmountDraft getExternalTaxAmount();
059
060    /**
061     *  <p><code>key</code> of the ShippingMethod to update. This is required for Orders with <code>Multiple</code> ShippingMode.</p>
062     * @param shippingKey value to be set
063     */
064
065    public void setShippingKey(final String shippingKey);
066
067    /**
068     *  <p>Cannot be used in LineItemDraft or CustomLineItemDraft.</p>
069     *  <p>Can only be set by these update actions:</p>
070     *  <ul>
071     *   <li>Set LineItem TaxAmount, Set CustomLineItem TaxAmount, or Set ShippingMethod TaxAmount on Carts</li>
072     *   <li>Set LineItem TaxAmount, Set CustomLineItem TaxAmount, or Set ShippingMethod TaxAmount on Order Edits</li>
073     *  </ul>
074     * @param externalTaxAmount value to be set
075     */
076
077    public void setExternalTaxAmount(final ExternalTaxAmountDraft externalTaxAmount);
078
079    /**
080     * factory method
081     * @return instance of StagedOrderSetShippingMethodTaxAmountAction
082     */
083    public static StagedOrderSetShippingMethodTaxAmountAction of() {
084        return new StagedOrderSetShippingMethodTaxAmountActionImpl();
085    }
086
087    /**
088     * factory method to create a shallow copy StagedOrderSetShippingMethodTaxAmountAction
089     * @param template instance to be copied
090     * @return copy instance
091     */
092    public static StagedOrderSetShippingMethodTaxAmountAction of(
093            final StagedOrderSetShippingMethodTaxAmountAction template) {
094        StagedOrderSetShippingMethodTaxAmountActionImpl instance = new StagedOrderSetShippingMethodTaxAmountActionImpl();
095        instance.setShippingKey(template.getShippingKey());
096        instance.setExternalTaxAmount(template.getExternalTaxAmount());
097        return instance;
098    }
099
100    /**
101     * factory method to create a deep copy of StagedOrderSetShippingMethodTaxAmountAction
102     * @param template instance to be copied
103     * @return copy instance
104     */
105    @Nullable
106    public static StagedOrderSetShippingMethodTaxAmountAction deepCopy(
107            @Nullable final StagedOrderSetShippingMethodTaxAmountAction template) {
108        if (template == null) {
109            return null;
110        }
111        StagedOrderSetShippingMethodTaxAmountActionImpl instance = new StagedOrderSetShippingMethodTaxAmountActionImpl();
112        instance.setShippingKey(template.getShippingKey());
113        instance.setExternalTaxAmount(
114            com.commercetools.api.models.cart.ExternalTaxAmountDraft.deepCopy(template.getExternalTaxAmount()));
115        return instance;
116    }
117
118    /**
119     * builder factory method for StagedOrderSetShippingMethodTaxAmountAction
120     * @return builder
121     */
122    public static StagedOrderSetShippingMethodTaxAmountActionBuilder builder() {
123        return StagedOrderSetShippingMethodTaxAmountActionBuilder.of();
124    }
125
126    /**
127     * create builder for StagedOrderSetShippingMethodTaxAmountAction instance
128     * @param template instance with prefilled values for the builder
129     * @return builder
130     */
131    public static StagedOrderSetShippingMethodTaxAmountActionBuilder builder(
132            final StagedOrderSetShippingMethodTaxAmountAction template) {
133        return StagedOrderSetShippingMethodTaxAmountActionBuilder.of(template);
134    }
135
136    /**
137     * accessor map function
138     * @param <T> mapped type
139     * @param helper function to map the object
140     * @return mapped value
141     */
142    default <T> T withStagedOrderSetShippingMethodTaxAmountAction(
143            Function<StagedOrderSetShippingMethodTaxAmountAction, T> helper) {
144        return helper.apply(this);
145    }
146
147    /**
148     * gives a TypeReference for usage with Jackson DataBind
149     * @return TypeReference
150     */
151    public static com.fasterxml.jackson.core.type.TypeReference<StagedOrderSetShippingMethodTaxAmountAction> typeReference() {
152        return new com.fasterxml.jackson.core.type.TypeReference<StagedOrderSetShippingMethodTaxAmountAction>() {
153            @Override
154            public String toString() {
155                return "TypeReference<StagedOrderSetShippingMethodTaxAmountAction>";
156            }
157        };
158    }
159}