001
002package com.commercetools.history.models.label;
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.history.models.common.Reference;
013import com.fasterxml.jackson.annotation.*;
014import com.fasterxml.jackson.databind.annotation.*;
015
016import io.vrap.rmf.base.client.utils.Generated;
017
018/**
019 * QuoteLabel
020 *
021 * <hr>
022 * Example to create an instance using the builder pattern
023 * <div class=code-example>
024 * <pre><code class='java'>
025 *     QuoteLabel quoteLabel = QuoteLabel.builder()
026 *             .key("{key}")
027 *             .customer(customerBuilder -> customerBuilder)
028 *             .stagedQuote(stagedQuoteBuilder -> stagedQuoteBuilder)
029 *             .quoteRequest(quoteRequestBuilder -> quoteRequestBuilder)
030 *             .build()
031 * </code></pre>
032 * </div>
033 */
034@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
035@JsonDeserialize(as = QuoteLabelImpl.class)
036public interface QuoteLabel extends Label {
037
038    /**
039     * discriminator value for QuoteLabel
040     */
041    String QUOTE_LABEL = "QuoteLabel";
042
043    /**
044     *
045     * @return type
046     */
047    @NotNull
048    @JsonProperty("type")
049    public String getType();
050
051    /**
052     *  <p>User-defined unique identifier of the Quote.</p>
053     * @return key
054     */
055    @NotNull
056    @JsonProperty("key")
057    public String getKey();
058
059    /**
060     *  <p>The Buyer who requested the Quote.</p>
061     * @return customer
062     */
063    @NotNull
064    @Valid
065    @JsonProperty("customer")
066    public Reference getCustomer();
067
068    /**
069     *  <p>Staged Quote related to the Quote.</p>
070     * @return stagedQuote
071     */
072    @NotNull
073    @Valid
074    @JsonProperty("stagedQuote")
075    public Reference getStagedQuote();
076
077    /**
078     *  <p>Quote Request related to the Quote.</p>
079     * @return quoteRequest
080     */
081    @NotNull
082    @Valid
083    @JsonProperty("quoteRequest")
084    public Reference getQuoteRequest();
085
086    /**
087     *  <p>User-defined unique identifier of the Quote.</p>
088     * @param key value to be set
089     */
090
091    public void setKey(final String key);
092
093    /**
094     *  <p>The Buyer who requested the Quote.</p>
095     * @param customer value to be set
096     */
097
098    public void setCustomer(final Reference customer);
099
100    /**
101     *  <p>Staged Quote related to the Quote.</p>
102     * @param stagedQuote value to be set
103     */
104
105    public void setStagedQuote(final Reference stagedQuote);
106
107    /**
108     *  <p>Quote Request related to the Quote.</p>
109     * @param quoteRequest value to be set
110     */
111
112    public void setQuoteRequest(final Reference quoteRequest);
113
114    /**
115     * factory method
116     * @return instance of QuoteLabel
117     */
118    public static QuoteLabel of() {
119        return new QuoteLabelImpl();
120    }
121
122    /**
123     * factory method to create a shallow copy QuoteLabel
124     * @param template instance to be copied
125     * @return copy instance
126     */
127    public static QuoteLabel of(final QuoteLabel template) {
128        QuoteLabelImpl instance = new QuoteLabelImpl();
129        instance.setKey(template.getKey());
130        instance.setCustomer(template.getCustomer());
131        instance.setStagedQuote(template.getStagedQuote());
132        instance.setQuoteRequest(template.getQuoteRequest());
133        return instance;
134    }
135
136    /**
137     * factory method to create a deep copy of QuoteLabel
138     * @param template instance to be copied
139     * @return copy instance
140     */
141    @Nullable
142    public static QuoteLabel deepCopy(@Nullable final QuoteLabel template) {
143        if (template == null) {
144            return null;
145        }
146        QuoteLabelImpl instance = new QuoteLabelImpl();
147        instance.setKey(template.getKey());
148        instance.setCustomer(com.commercetools.history.models.common.Reference.deepCopy(template.getCustomer()));
149        instance.setStagedQuote(com.commercetools.history.models.common.Reference.deepCopy(template.getStagedQuote()));
150        instance.setQuoteRequest(
151            com.commercetools.history.models.common.Reference.deepCopy(template.getQuoteRequest()));
152        return instance;
153    }
154
155    /**
156     * builder factory method for QuoteLabel
157     * @return builder
158     */
159    public static QuoteLabelBuilder builder() {
160        return QuoteLabelBuilder.of();
161    }
162
163    /**
164     * create builder for QuoteLabel instance
165     * @param template instance with prefilled values for the builder
166     * @return builder
167     */
168    public static QuoteLabelBuilder builder(final QuoteLabel template) {
169        return QuoteLabelBuilder.of(template);
170    }
171
172    /**
173     * accessor map function
174     * @param <T> mapped type
175     * @param helper function to map the object
176     * @return mapped value
177     */
178    default <T> T withQuoteLabel(Function<QuoteLabel, T> helper) {
179        return helper.apply(this);
180    }
181
182    /**
183     * gives a TypeReference for usage with Jackson DataBind
184     * @return TypeReference
185     */
186    public static com.fasterxml.jackson.core.type.TypeReference<QuoteLabel> typeReference() {
187        return new com.fasterxml.jackson.core.type.TypeReference<QuoteLabel>() {
188            @Override
189            public String toString() {
190                return "TypeReference<QuoteLabel>";
191            }
192        };
193    }
194}