001
002package com.commercetools.api.models.me;
003
004import java.time.*;
005import java.util.*;
006import java.util.function.Function;
007
008import javax.annotation.Nullable;
009
010import com.fasterxml.jackson.annotation.*;
011import com.fasterxml.jackson.databind.annotation.*;
012
013import io.vrap.rmf.base.client.utils.Generated;
014
015/**
016 *  <p>Adds an address from the <code>addresses</code> array to <code>shippingAddressIds</code>. Either <code>addressId</code> or <code>addressKey</code> is required.</p>
017 *
018 * <hr>
019 * Example to create an instance using the builder pattern
020 * <div class=code-example>
021 * <pre><code class='java'>
022 *     MyCustomerAddShippingAddressIdAction myCustomerAddShippingAddressIdAction = MyCustomerAddShippingAddressIdAction.builder()
023 *             .build()
024 * </code></pre>
025 * </div>
026 */
027@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
028@JsonDeserialize(as = MyCustomerAddShippingAddressIdActionImpl.class)
029public interface MyCustomerAddShippingAddressIdAction extends MyCustomerUpdateAction {
030
031    /**
032     * discriminator value for MyCustomerAddShippingAddressIdAction
033     */
034    String ADD_SHIPPING_ADDRESS_ID = "addShippingAddressId";
035
036    /**
037     *  <p><code>id</code> of the Address to become a shipping address.</p>
038     * @return addressId
039     */
040
041    @JsonProperty("addressId")
042    public String getAddressId();
043
044    /**
045     *  <p><code>key</code> of the Address to become a shipping address.</p>
046     * @return addressKey
047     */
048
049    @JsonProperty("addressKey")
050    public String getAddressKey();
051
052    /**
053     *  <p><code>id</code> of the Address to become a shipping address.</p>
054     * @param addressId value to be set
055     */
056
057    public void setAddressId(final String addressId);
058
059    /**
060     *  <p><code>key</code> of the Address to become a shipping address.</p>
061     * @param addressKey value to be set
062     */
063
064    public void setAddressKey(final String addressKey);
065
066    /**
067     * factory method
068     * @return instance of MyCustomerAddShippingAddressIdAction
069     */
070    public static MyCustomerAddShippingAddressIdAction of() {
071        return new MyCustomerAddShippingAddressIdActionImpl();
072    }
073
074    /**
075     * factory method to create a shallow copy MyCustomerAddShippingAddressIdAction
076     * @param template instance to be copied
077     * @return copy instance
078     */
079    public static MyCustomerAddShippingAddressIdAction of(final MyCustomerAddShippingAddressIdAction template) {
080        MyCustomerAddShippingAddressIdActionImpl instance = new MyCustomerAddShippingAddressIdActionImpl();
081        instance.setAddressId(template.getAddressId());
082        instance.setAddressKey(template.getAddressKey());
083        return instance;
084    }
085
086    /**
087     * factory method to create a deep copy of MyCustomerAddShippingAddressIdAction
088     * @param template instance to be copied
089     * @return copy instance
090     */
091    @Nullable
092    public static MyCustomerAddShippingAddressIdAction deepCopy(
093            @Nullable final MyCustomerAddShippingAddressIdAction template) {
094        if (template == null) {
095            return null;
096        }
097        MyCustomerAddShippingAddressIdActionImpl instance = new MyCustomerAddShippingAddressIdActionImpl();
098        instance.setAddressId(template.getAddressId());
099        instance.setAddressKey(template.getAddressKey());
100        return instance;
101    }
102
103    /**
104     * builder factory method for MyCustomerAddShippingAddressIdAction
105     * @return builder
106     */
107    public static MyCustomerAddShippingAddressIdActionBuilder builder() {
108        return MyCustomerAddShippingAddressIdActionBuilder.of();
109    }
110
111    /**
112     * create builder for MyCustomerAddShippingAddressIdAction instance
113     * @param template instance with prefilled values for the builder
114     * @return builder
115     */
116    public static MyCustomerAddShippingAddressIdActionBuilder builder(
117            final MyCustomerAddShippingAddressIdAction template) {
118        return MyCustomerAddShippingAddressIdActionBuilder.of(template);
119    }
120
121    /**
122     * accessor map function
123     * @param <T> mapped type
124     * @param helper function to map the object
125     * @return mapped value
126     */
127    default <T> T withMyCustomerAddShippingAddressIdAction(Function<MyCustomerAddShippingAddressIdAction, T> helper) {
128        return helper.apply(this);
129    }
130
131    /**
132     * gives a TypeReference for usage with Jackson DataBind
133     * @return TypeReference
134     */
135    public static com.fasterxml.jackson.core.type.TypeReference<MyCustomerAddShippingAddressIdAction> typeReference() {
136        return new com.fasterxml.jackson.core.type.TypeReference<MyCustomerAddShippingAddressIdAction>() {
137            @Override
138            public String toString() {
139                return "TypeReference<MyCustomerAddShippingAddressIdAction>";
140            }
141        };
142    }
143}