001
002package com.commercetools.api.models.order;
003
004import java.time.*;
005import java.util.*;
006import java.util.function.Function;
007
008import javax.annotation.Nullable;
009import javax.validation.Valid;
010import javax.validation.constraints.NotNull;
011
012import com.commercetools.api.models.cart.ItemShippingDetailsDraft;
013import com.fasterxml.jackson.annotation.*;
014import com.fasterxml.jackson.databind.annotation.*;
015
016import io.vrap.rmf.base.client.utils.Generated;
017
018/**
019 * OrderSetCustomLineItemShippingDetailsAction
020 *
021 * <hr>
022 * Example to create an instance using the builder pattern
023 * <div class=code-example>
024 * <pre><code class='java'>
025 *     OrderSetCustomLineItemShippingDetailsAction orderSetCustomLineItemShippingDetailsAction = OrderSetCustomLineItemShippingDetailsAction.builder()
026 *             .customLineItemId("{customLineItemId}")
027 *             .build()
028 * </code></pre>
029 * </div>
030 */
031@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
032@JsonDeserialize(as = OrderSetCustomLineItemShippingDetailsActionImpl.class)
033public interface OrderSetCustomLineItemShippingDetailsAction extends OrderUpdateAction {
034
035    /**
036     * discriminator value for OrderSetCustomLineItemShippingDetailsAction
037     */
038    String SET_CUSTOM_LINE_ITEM_SHIPPING_DETAILS = "setCustomLineItemShippingDetails";
039
040    /**
041     *
042     * @return customLineItemId
043     */
044    @NotNull
045    @JsonProperty("customLineItemId")
046    public String getCustomLineItemId();
047
048    /**
049     *  <p>For order creation and updates, the sum of the <code>targets</code> must match the quantity of the Line Items or Custom Line Items.</p>
050     * @return shippingDetails
051     */
052    @Valid
053    @JsonProperty("shippingDetails")
054    public ItemShippingDetailsDraft getShippingDetails();
055
056    /**
057     * set customLineItemId
058     * @param customLineItemId value to be set
059     */
060
061    public void setCustomLineItemId(final String customLineItemId);
062
063    /**
064     *  <p>For order creation and updates, the sum of the <code>targets</code> must match the quantity of the Line Items or Custom Line Items.</p>
065     * @param shippingDetails value to be set
066     */
067
068    public void setShippingDetails(final ItemShippingDetailsDraft shippingDetails);
069
070    /**
071     * factory method
072     * @return instance of OrderSetCustomLineItemShippingDetailsAction
073     */
074    public static OrderSetCustomLineItemShippingDetailsAction of() {
075        return new OrderSetCustomLineItemShippingDetailsActionImpl();
076    }
077
078    /**
079     * factory method to create a shallow copy OrderSetCustomLineItemShippingDetailsAction
080     * @param template instance to be copied
081     * @return copy instance
082     */
083    public static OrderSetCustomLineItemShippingDetailsAction of(
084            final OrderSetCustomLineItemShippingDetailsAction template) {
085        OrderSetCustomLineItemShippingDetailsActionImpl instance = new OrderSetCustomLineItemShippingDetailsActionImpl();
086        instance.setCustomLineItemId(template.getCustomLineItemId());
087        instance.setShippingDetails(template.getShippingDetails());
088        return instance;
089    }
090
091    /**
092     * factory method to create a deep copy of OrderSetCustomLineItemShippingDetailsAction
093     * @param template instance to be copied
094     * @return copy instance
095     */
096    @Nullable
097    public static OrderSetCustomLineItemShippingDetailsAction deepCopy(
098            @Nullable final OrderSetCustomLineItemShippingDetailsAction template) {
099        if (template == null) {
100            return null;
101        }
102        OrderSetCustomLineItemShippingDetailsActionImpl instance = new OrderSetCustomLineItemShippingDetailsActionImpl();
103        instance.setCustomLineItemId(template.getCustomLineItemId());
104        instance.setShippingDetails(
105            com.commercetools.api.models.cart.ItemShippingDetailsDraft.deepCopy(template.getShippingDetails()));
106        return instance;
107    }
108
109    /**
110     * builder factory method for OrderSetCustomLineItemShippingDetailsAction
111     * @return builder
112     */
113    public static OrderSetCustomLineItemShippingDetailsActionBuilder builder() {
114        return OrderSetCustomLineItemShippingDetailsActionBuilder.of();
115    }
116
117    /**
118     * create builder for OrderSetCustomLineItemShippingDetailsAction instance
119     * @param template instance with prefilled values for the builder
120     * @return builder
121     */
122    public static OrderSetCustomLineItemShippingDetailsActionBuilder builder(
123            final OrderSetCustomLineItemShippingDetailsAction template) {
124        return OrderSetCustomLineItemShippingDetailsActionBuilder.of(template);
125    }
126
127    /**
128     * accessor map function
129     * @param <T> mapped type
130     * @param helper function to map the object
131     * @return mapped value
132     */
133    default <T> T withOrderSetCustomLineItemShippingDetailsAction(
134            Function<OrderSetCustomLineItemShippingDetailsAction, T> helper) {
135        return helper.apply(this);
136    }
137
138    /**
139     * gives a TypeReference for usage with Jackson DataBind
140     * @return TypeReference
141     */
142    public static com.fasterxml.jackson.core.type.TypeReference<OrderSetCustomLineItemShippingDetailsAction> typeReference() {
143        return new com.fasterxml.jackson.core.type.TypeReference<OrderSetCustomLineItemShippingDetailsAction>() {
144            @Override
145            public String toString() {
146                return "TypeReference<OrderSetCustomLineItemShippingDetailsAction>";
147            }
148        };
149    }
150}