001
002package com.commercetools.api.models.quote_request;
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.customer.CustomerResourceIdentifier;
013import com.fasterxml.jackson.annotation.*;
014import com.fasterxml.jackson.databind.annotation.*;
015
016import io.vrap.rmf.base.client.utils.Generated;
017
018/**
019 *  <p>Changes the owner of a Quote Request to a different Customer. Customer Group is not updated. This update action produces the Quote Request Customer Changed Message.</p>
020 *
021 * <hr>
022 * Example to create an instance using the builder pattern
023 * <div class=code-example>
024 * <pre><code class='java'>
025 *     QuoteRequestChangeCustomerAction quoteRequestChangeCustomerAction = QuoteRequestChangeCustomerAction.builder()
026 *             .customer(customerBuilder -> customerBuilder)
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 = QuoteRequestChangeCustomerActionImpl.class)
033public interface QuoteRequestChangeCustomerAction extends QuoteRequestUpdateAction {
034
035    /**
036     * discriminator value for QuoteRequestChangeCustomerAction
037     */
038    String CHANGE_CUSTOMER = "changeCustomer";
039
040    /**
041     *  <p>New Customer to own the Quote Request.</p>
042     * @return customer
043     */
044    @NotNull
045    @Valid
046    @JsonProperty("customer")
047    public CustomerResourceIdentifier getCustomer();
048
049    /**
050     *  <p>New Customer to own the Quote Request.</p>
051     * @param customer value to be set
052     */
053
054    public void setCustomer(final CustomerResourceIdentifier customer);
055
056    /**
057     * factory method
058     * @return instance of QuoteRequestChangeCustomerAction
059     */
060    public static QuoteRequestChangeCustomerAction of() {
061        return new QuoteRequestChangeCustomerActionImpl();
062    }
063
064    /**
065     * factory method to create a shallow copy QuoteRequestChangeCustomerAction
066     * @param template instance to be copied
067     * @return copy instance
068     */
069    public static QuoteRequestChangeCustomerAction of(final QuoteRequestChangeCustomerAction template) {
070        QuoteRequestChangeCustomerActionImpl instance = new QuoteRequestChangeCustomerActionImpl();
071        instance.setCustomer(template.getCustomer());
072        return instance;
073    }
074
075    /**
076     * factory method to create a deep copy of QuoteRequestChangeCustomerAction
077     * @param template instance to be copied
078     * @return copy instance
079     */
080    @Nullable
081    public static QuoteRequestChangeCustomerAction deepCopy(@Nullable final QuoteRequestChangeCustomerAction template) {
082        if (template == null) {
083            return null;
084        }
085        QuoteRequestChangeCustomerActionImpl instance = new QuoteRequestChangeCustomerActionImpl();
086        instance.setCustomer(
087            com.commercetools.api.models.customer.CustomerResourceIdentifier.deepCopy(template.getCustomer()));
088        return instance;
089    }
090
091    /**
092     * builder factory method for QuoteRequestChangeCustomerAction
093     * @return builder
094     */
095    public static QuoteRequestChangeCustomerActionBuilder builder() {
096        return QuoteRequestChangeCustomerActionBuilder.of();
097    }
098
099    /**
100     * create builder for QuoteRequestChangeCustomerAction instance
101     * @param template instance with prefilled values for the builder
102     * @return builder
103     */
104    public static QuoteRequestChangeCustomerActionBuilder builder(final QuoteRequestChangeCustomerAction template) {
105        return QuoteRequestChangeCustomerActionBuilder.of(template);
106    }
107
108    /**
109     * accessor map function
110     * @param <T> mapped type
111     * @param helper function to map the object
112     * @return mapped value
113     */
114    default <T> T withQuoteRequestChangeCustomerAction(Function<QuoteRequestChangeCustomerAction, T> helper) {
115        return helper.apply(this);
116    }
117
118    /**
119     * gives a TypeReference for usage with Jackson DataBind
120     * @return TypeReference
121     */
122    public static com.fasterxml.jackson.core.type.TypeReference<QuoteRequestChangeCustomerAction> typeReference() {
123        return new com.fasterxml.jackson.core.type.TypeReference<QuoteRequestChangeCustomerAction>() {
124            @Override
125            public String toString() {
126                return "TypeReference<QuoteRequestChangeCustomerAction>";
127            }
128        };
129    }
130}