001
002package com.commercetools.api.models.me;
003
004import java.time.*;
005import java.time.ZonedDateTime;
006import java.util.*;
007import java.util.function.Function;
008
009import javax.annotation.Nullable;
010import javax.validation.Valid;
011
012import com.commercetools.api.models.type.CustomFieldsDraft;
013import com.fasterxml.jackson.annotation.*;
014import com.fasterxml.jackson.databind.annotation.*;
015
016import io.vrap.rmf.base.client.utils.Generated;
017
018/**
019 * MyShoppingListAddLineItemAction
020 *
021 * <hr>
022 * Example to create an instance using the builder pattern
023 * <div class=code-example>
024 * <pre><code class='java'>
025 *     MyShoppingListAddLineItemAction myShoppingListAddLineItemAction = MyShoppingListAddLineItemAction.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 = MyShoppingListAddLineItemActionImpl.class)
032public interface MyShoppingListAddLineItemAction extends MyShoppingListUpdateAction,
033        com.commercetools.api.models.CustomizableDraft<MyShoppingListAddLineItemAction> {
034
035    /**
036     * discriminator value for MyShoppingListAddLineItemAction
037     */
038    String ADD_LINE_ITEM = "addLineItem";
039
040    /**
041     *  <p>User-defined identifier of the ShoppingListLineItem. Must be unique per ShoppingList.</p>
042     * @return key
043     */
044
045    @JsonProperty("key")
046    public String getKey();
047
048    /**
049     *  <p><code>sku</code> of the ProductVariant.</p>
050     * @return sku
051     */
052
053    @JsonProperty("sku")
054    public String getSku();
055
056    /**
057     *  <p>Unique identifier of a Product.</p>
058     * @return productId
059     */
060
061    @JsonProperty("productId")
062    public String getProductId();
063
064    /**
065     *  <p><code>id</code> of the ProductVariant. If not set, the ShoppingListLineItem refers to the Master Variant.</p>
066     * @return variantId
067     */
068
069    @JsonProperty("variantId")
070    public Long getVariantId();
071
072    /**
073     *  <p>Number of Products in the ShoppingListLineItem.</p>
074     * @return quantity
075     */
076
077    @JsonProperty("quantity")
078    public Long getQuantity();
079
080    /**
081     *  <p>Date and time the TextLineItem is added to the ShoppingList. If not set, the current date and time (UTC) is used.</p>
082     * @return addedAt
083     */
084
085    @JsonProperty("addedAt")
086    public ZonedDateTime getAddedAt();
087
088    /**
089     *  <p>Custom Fields defined for the ShoppingListLineItem.</p>
090     * @return custom
091     */
092    @Valid
093    @JsonProperty("custom")
094    public CustomFieldsDraft getCustom();
095
096    /**
097     *  <p>User-defined identifier of the ShoppingListLineItem. Must be unique per ShoppingList.</p>
098     * @param key value to be set
099     */
100
101    public void setKey(final String key);
102
103    /**
104     *  <p><code>sku</code> of the ProductVariant.</p>
105     * @param sku value to be set
106     */
107
108    public void setSku(final String sku);
109
110    /**
111     *  <p>Unique identifier of a Product.</p>
112     * @param productId value to be set
113     */
114
115    public void setProductId(final String productId);
116
117    /**
118     *  <p><code>id</code> of the ProductVariant. If not set, the ShoppingListLineItem refers to the Master Variant.</p>
119     * @param variantId value to be set
120     */
121
122    public void setVariantId(final Long variantId);
123
124    /**
125     *  <p>Number of Products in the ShoppingListLineItem.</p>
126     * @param quantity value to be set
127     */
128
129    public void setQuantity(final Long quantity);
130
131    /**
132     *  <p>Date and time the TextLineItem is added to the ShoppingList. If not set, the current date and time (UTC) is used.</p>
133     * @param addedAt value to be set
134     */
135
136    public void setAddedAt(final ZonedDateTime addedAt);
137
138    /**
139     *  <p>Custom Fields defined for the ShoppingListLineItem.</p>
140     * @param custom value to be set
141     */
142
143    public void setCustom(final CustomFieldsDraft custom);
144
145    /**
146     * factory method
147     * @return instance of MyShoppingListAddLineItemAction
148     */
149    public static MyShoppingListAddLineItemAction of() {
150        return new MyShoppingListAddLineItemActionImpl();
151    }
152
153    /**
154     * factory method to create a shallow copy MyShoppingListAddLineItemAction
155     * @param template instance to be copied
156     * @return copy instance
157     */
158    public static MyShoppingListAddLineItemAction of(final MyShoppingListAddLineItemAction template) {
159        MyShoppingListAddLineItemActionImpl instance = new MyShoppingListAddLineItemActionImpl();
160        instance.setKey(template.getKey());
161        instance.setSku(template.getSku());
162        instance.setProductId(template.getProductId());
163        instance.setVariantId(template.getVariantId());
164        instance.setQuantity(template.getQuantity());
165        instance.setAddedAt(template.getAddedAt());
166        instance.setCustom(template.getCustom());
167        return instance;
168    }
169
170    /**
171     * factory method to create a deep copy of MyShoppingListAddLineItemAction
172     * @param template instance to be copied
173     * @return copy instance
174     */
175    @Nullable
176    public static MyShoppingListAddLineItemAction deepCopy(@Nullable final MyShoppingListAddLineItemAction template) {
177        if (template == null) {
178            return null;
179        }
180        MyShoppingListAddLineItemActionImpl instance = new MyShoppingListAddLineItemActionImpl();
181        instance.setKey(template.getKey());
182        instance.setSku(template.getSku());
183        instance.setProductId(template.getProductId());
184        instance.setVariantId(template.getVariantId());
185        instance.setQuantity(template.getQuantity());
186        instance.setAddedAt(template.getAddedAt());
187        instance.setCustom(com.commercetools.api.models.type.CustomFieldsDraft.deepCopy(template.getCustom()));
188        return instance;
189    }
190
191    /**
192     * builder factory method for MyShoppingListAddLineItemAction
193     * @return builder
194     */
195    public static MyShoppingListAddLineItemActionBuilder builder() {
196        return MyShoppingListAddLineItemActionBuilder.of();
197    }
198
199    /**
200     * create builder for MyShoppingListAddLineItemAction instance
201     * @param template instance with prefilled values for the builder
202     * @return builder
203     */
204    public static MyShoppingListAddLineItemActionBuilder builder(final MyShoppingListAddLineItemAction template) {
205        return MyShoppingListAddLineItemActionBuilder.of(template);
206    }
207
208    /**
209     * accessor map function
210     * @param <T> mapped type
211     * @param helper function to map the object
212     * @return mapped value
213     */
214    default <T> T withMyShoppingListAddLineItemAction(Function<MyShoppingListAddLineItemAction, T> helper) {
215        return helper.apply(this);
216    }
217
218    /**
219     * gives a TypeReference for usage with Jackson DataBind
220     * @return TypeReference
221     */
222    public static com.fasterxml.jackson.core.type.TypeReference<MyShoppingListAddLineItemAction> typeReference() {
223        return new com.fasterxml.jackson.core.type.TypeReference<MyShoppingListAddLineItemAction>() {
224            @Override
225            public String toString() {
226                return "TypeReference<MyShoppingListAddLineItemAction>";
227            }
228        };
229    }
230}