001
002package com.commercetools.api.models.order_edit;
003
004import java.util.*;
005import java.util.function.Function;
006
007import javax.annotation.Nullable;
008
009import io.vrap.rmf.base.client.Builder;
010import io.vrap.rmf.base.client.utils.Generated;
011
012/**
013 * StagedOrderSetShippingMethodTaxAmountActionBuilder
014 * <hr>
015 * Example to create an instance using the builder pattern
016 * <div class=code-example>
017 * <pre><code class='java'>
018 *     StagedOrderSetShippingMethodTaxAmountAction stagedOrderSetShippingMethodTaxAmountAction = StagedOrderSetShippingMethodTaxAmountAction.builder()
019 *             .build()
020 * </code></pre>
021 * </div>
022 */
023@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
024public class StagedOrderSetShippingMethodTaxAmountActionBuilder
025        implements Builder<StagedOrderSetShippingMethodTaxAmountAction> {
026
027    @Nullable
028    private String shippingKey;
029
030    @Nullable
031    private com.commercetools.api.models.cart.ExternalTaxAmountDraft externalTaxAmount;
032
033    /**
034     *  <p><code>key</code> of the ShippingMethod to update. This is required for Orders with <code>Multiple</code> ShippingMode.</p>
035     * @param shippingKey value to be set
036     * @return Builder
037     */
038
039    public StagedOrderSetShippingMethodTaxAmountActionBuilder shippingKey(@Nullable final String shippingKey) {
040        this.shippingKey = shippingKey;
041        return this;
042    }
043
044    /**
045     *  <p>Value to set. If empty, any existing value will be removed.</p>
046     * @param builder function to build the externalTaxAmount value
047     * @return Builder
048     */
049
050    public StagedOrderSetShippingMethodTaxAmountActionBuilder externalTaxAmount(
051            Function<com.commercetools.api.models.cart.ExternalTaxAmountDraftBuilder, com.commercetools.api.models.cart.ExternalTaxAmountDraftBuilder> builder) {
052        this.externalTaxAmount = builder.apply(com.commercetools.api.models.cart.ExternalTaxAmountDraftBuilder.of())
053                .build();
054        return this;
055    }
056
057    /**
058     *  <p>Value to set. If empty, any existing value will be removed.</p>
059     * @param builder function to build the externalTaxAmount value
060     * @return Builder
061     */
062
063    public StagedOrderSetShippingMethodTaxAmountActionBuilder withExternalTaxAmount(
064            Function<com.commercetools.api.models.cart.ExternalTaxAmountDraftBuilder, com.commercetools.api.models.cart.ExternalTaxAmountDraft> builder) {
065        this.externalTaxAmount = builder.apply(com.commercetools.api.models.cart.ExternalTaxAmountDraftBuilder.of());
066        return this;
067    }
068
069    /**
070     *  <p>Value to set. If empty, any existing value will be removed.</p>
071     * @param externalTaxAmount value to be set
072     * @return Builder
073     */
074
075    public StagedOrderSetShippingMethodTaxAmountActionBuilder externalTaxAmount(
076            @Nullable final com.commercetools.api.models.cart.ExternalTaxAmountDraft externalTaxAmount) {
077        this.externalTaxAmount = externalTaxAmount;
078        return this;
079    }
080
081    /**
082     *  <p><code>key</code> of the ShippingMethod to update. This is required for Orders with <code>Multiple</code> ShippingMode.</p>
083     * @return shippingKey
084     */
085
086    @Nullable
087    public String getShippingKey() {
088        return this.shippingKey;
089    }
090
091    /**
092     *  <p>Value to set. If empty, any existing value will be removed.</p>
093     * @return externalTaxAmount
094     */
095
096    @Nullable
097    public com.commercetools.api.models.cart.ExternalTaxAmountDraft getExternalTaxAmount() {
098        return this.externalTaxAmount;
099    }
100
101    /**
102     * builds StagedOrderSetShippingMethodTaxAmountAction with checking for non-null required values
103     * @return StagedOrderSetShippingMethodTaxAmountAction
104     */
105    public StagedOrderSetShippingMethodTaxAmountAction build() {
106        return new StagedOrderSetShippingMethodTaxAmountActionImpl(shippingKey, externalTaxAmount);
107    }
108
109    /**
110     * builds StagedOrderSetShippingMethodTaxAmountAction without checking for non-null required values
111     * @return StagedOrderSetShippingMethodTaxAmountAction
112     */
113    public StagedOrderSetShippingMethodTaxAmountAction buildUnchecked() {
114        return new StagedOrderSetShippingMethodTaxAmountActionImpl(shippingKey, externalTaxAmount);
115    }
116
117    /**
118     * factory method for an instance of StagedOrderSetShippingMethodTaxAmountActionBuilder
119     * @return builder
120     */
121    public static StagedOrderSetShippingMethodTaxAmountActionBuilder of() {
122        return new StagedOrderSetShippingMethodTaxAmountActionBuilder();
123    }
124
125    /**
126     * create builder for StagedOrderSetShippingMethodTaxAmountAction instance
127     * @param template instance with prefilled values for the builder
128     * @return builder
129     */
130    public static StagedOrderSetShippingMethodTaxAmountActionBuilder of(
131            final StagedOrderSetShippingMethodTaxAmountAction template) {
132        StagedOrderSetShippingMethodTaxAmountActionBuilder builder = new StagedOrderSetShippingMethodTaxAmountActionBuilder();
133        builder.shippingKey = template.getShippingKey();
134        builder.externalTaxAmount = template.getExternalTaxAmount();
135        return builder;
136    }
137
138}