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.common.BaseAddress;
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 * StagedOrderSetBillingAddressAction
020 *
021 * <hr>
022 * Example to create an instance using the builder pattern
023 * <div class=code-example>
024 * <pre><code class='java'>
025 *     StagedOrderSetBillingAddressAction stagedOrderSetBillingAddressAction = StagedOrderSetBillingAddressAction.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 = StagedOrderSetBillingAddressActionImpl.class)
032public interface StagedOrderSetBillingAddressAction extends StagedOrderUpdateAction {
033
034    /**
035     * discriminator value for StagedOrderSetBillingAddressAction
036     */
037    String SET_BILLING_ADDRESS = "setBillingAddress";
038
039    /**
040     *  <p>Polymorphic base type that represents a postal address and contact details. Depending on the read or write action, it can be either Address or AddressDraft that only differ in the data type for the optional <code>custom</code> field.</p>
041     * @return address
042     */
043    @Valid
044    @JsonProperty("address")
045    public BaseAddress getAddress();
046
047    /**
048     *  <p>Polymorphic base type that represents a postal address and contact details. Depending on the read or write action, it can be either Address or AddressDraft that only differ in the data type for the optional <code>custom</code> field.</p>
049     * @param address value to be set
050     */
051
052    public void setAddress(final BaseAddress address);
053
054    /**
055     * factory method
056     * @return instance of StagedOrderSetBillingAddressAction
057     */
058    public static StagedOrderSetBillingAddressAction of() {
059        return new StagedOrderSetBillingAddressActionImpl();
060    }
061
062    /**
063     * factory method to create a shallow copy StagedOrderSetBillingAddressAction
064     * @param template instance to be copied
065     * @return copy instance
066     */
067    public static StagedOrderSetBillingAddressAction of(final StagedOrderSetBillingAddressAction template) {
068        StagedOrderSetBillingAddressActionImpl instance = new StagedOrderSetBillingAddressActionImpl();
069        instance.setAddress(template.getAddress());
070        return instance;
071    }
072
073    /**
074     * factory method to create a deep copy of StagedOrderSetBillingAddressAction
075     * @param template instance to be copied
076     * @return copy instance
077     */
078    @Nullable
079    public static StagedOrderSetBillingAddressAction deepCopy(
080            @Nullable final StagedOrderSetBillingAddressAction template) {
081        if (template == null) {
082            return null;
083        }
084        StagedOrderSetBillingAddressActionImpl instance = new StagedOrderSetBillingAddressActionImpl();
085        instance.setAddress(com.commercetools.api.models.common.BaseAddress.deepCopy(template.getAddress()));
086        return instance;
087    }
088
089    /**
090     * builder factory method for StagedOrderSetBillingAddressAction
091     * @return builder
092     */
093    public static StagedOrderSetBillingAddressActionBuilder builder() {
094        return StagedOrderSetBillingAddressActionBuilder.of();
095    }
096
097    /**
098     * create builder for StagedOrderSetBillingAddressAction instance
099     * @param template instance with prefilled values for the builder
100     * @return builder
101     */
102    public static StagedOrderSetBillingAddressActionBuilder builder(final StagedOrderSetBillingAddressAction template) {
103        return StagedOrderSetBillingAddressActionBuilder.of(template);
104    }
105
106    /**
107     * accessor map function
108     * @param <T> mapped type
109     * @param helper function to map the object
110     * @return mapped value
111     */
112    default <T> T withStagedOrderSetBillingAddressAction(Function<StagedOrderSetBillingAddressAction, T> helper) {
113        return helper.apply(this);
114    }
115
116    /**
117     * gives a TypeReference for usage with Jackson DataBind
118     * @return TypeReference
119     */
120    public static com.fasterxml.jackson.core.type.TypeReference<StagedOrderSetBillingAddressAction> typeReference() {
121        return new com.fasterxml.jackson.core.type.TypeReference<StagedOrderSetBillingAddressAction>() {
122            @Override
123            public String toString() {
124                return "TypeReference<StagedOrderSetBillingAddressAction>";
125            }
126        };
127    }
128}