001
002package com.commercetools.api.models.message;
003
004import java.time.*;
005import java.time.ZonedDateTime;
006import java.util.*;
007import java.util.function.Function;
008
009import javax.annotation.Nullable;
010
011import com.fasterxml.jackson.annotation.*;
012import com.fasterxml.jackson.databind.annotation.*;
013
014import io.vrap.rmf.base.client.utils.Generated;
015
016/**
017 *  <p>Generated after a successful Set Valid Until update action.</p>
018 *
019 * <hr>
020 * Example to create an instance using the builder pattern
021 * <div class=code-example>
022 * <pre><code class='java'>
023 *     StandalonePriceValidUntilSetMessage standalonePriceValidUntilSetMessage = StandalonePriceValidUntilSetMessage.builder()
024 *             .id("{id}")
025 *             .version(0.3)
026 *             .createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
027 *             .lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
028 *             .sequenceNumber(0.3)
029 *             .resource(resourceBuilder -> resourceBuilder)
030 *             .resourceVersion(0.3)
031 *             .build()
032 * </code></pre>
033 * </div>
034 */
035@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
036@JsonDeserialize(as = StandalonePriceValidUntilSetMessageImpl.class)
037public interface StandalonePriceValidUntilSetMessage extends Message {
038
039    /**
040     * discriminator value for StandalonePriceValidUntilSetMessage
041     */
042    String STANDALONE_PRICE_VALID_UNTIL_SET = "StandalonePriceValidUntilSet";
043
044    /**
045     *  <p>Value of StandalonePrice <code>validUntil</code> after the Set Valid Until update action.</p>
046     * @return validUntil
047     */
048
049    @JsonProperty("validUntil")
050    public ZonedDateTime getValidUntil();
051
052    /**
053     *  <p>Value of StandalonePrice <code>validUntil</code> before the Set Valid Until update action.</p>
054     * @return previousValidUntil
055     */
056
057    @JsonProperty("previousValidUntil")
058    public ZonedDateTime getPreviousValidUntil();
059
060    /**
061     *  <p>Value of StandalonePrice <code>validUntil</code> after the Set Valid Until update action.</p>
062     * @param validUntil value to be set
063     */
064
065    public void setValidUntil(final ZonedDateTime validUntil);
066
067    /**
068     *  <p>Value of StandalonePrice <code>validUntil</code> before the Set Valid Until update action.</p>
069     * @param previousValidUntil value to be set
070     */
071
072    public void setPreviousValidUntil(final ZonedDateTime previousValidUntil);
073
074    /**
075     * factory method
076     * @return instance of StandalonePriceValidUntilSetMessage
077     */
078    public static StandalonePriceValidUntilSetMessage of() {
079        return new StandalonePriceValidUntilSetMessageImpl();
080    }
081
082    /**
083     * factory method to create a shallow copy StandalonePriceValidUntilSetMessage
084     * @param template instance to be copied
085     * @return copy instance
086     */
087    public static StandalonePriceValidUntilSetMessage of(final StandalonePriceValidUntilSetMessage template) {
088        StandalonePriceValidUntilSetMessageImpl instance = new StandalonePriceValidUntilSetMessageImpl();
089        instance.setId(template.getId());
090        instance.setVersion(template.getVersion());
091        instance.setCreatedAt(template.getCreatedAt());
092        instance.setLastModifiedAt(template.getLastModifiedAt());
093        instance.setLastModifiedBy(template.getLastModifiedBy());
094        instance.setCreatedBy(template.getCreatedBy());
095        instance.setSequenceNumber(template.getSequenceNumber());
096        instance.setResource(template.getResource());
097        instance.setResourceVersion(template.getResourceVersion());
098        instance.setResourceUserProvidedIdentifiers(template.getResourceUserProvidedIdentifiers());
099        instance.setValidUntil(template.getValidUntil());
100        instance.setPreviousValidUntil(template.getPreviousValidUntil());
101        return instance;
102    }
103
104    /**
105     * factory method to create a deep copy of StandalonePriceValidUntilSetMessage
106     * @param template instance to be copied
107     * @return copy instance
108     */
109    @Nullable
110    public static StandalonePriceValidUntilSetMessage deepCopy(
111            @Nullable final StandalonePriceValidUntilSetMessage template) {
112        if (template == null) {
113            return null;
114        }
115        StandalonePriceValidUntilSetMessageImpl instance = new StandalonePriceValidUntilSetMessageImpl();
116        instance.setId(template.getId());
117        instance.setVersion(template.getVersion());
118        instance.setCreatedAt(template.getCreatedAt());
119        instance.setLastModifiedAt(template.getLastModifiedAt());
120        instance.setLastModifiedBy(
121            com.commercetools.api.models.common.LastModifiedBy.deepCopy(template.getLastModifiedBy()));
122        instance.setCreatedBy(com.commercetools.api.models.common.CreatedBy.deepCopy(template.getCreatedBy()));
123        instance.setSequenceNumber(template.getSequenceNumber());
124        instance.setResource(com.commercetools.api.models.common.Reference.deepCopy(template.getResource()));
125        instance.setResourceVersion(template.getResourceVersion());
126        instance.setResourceUserProvidedIdentifiers(com.commercetools.api.models.message.UserProvidedIdentifiers
127                .deepCopy(template.getResourceUserProvidedIdentifiers()));
128        instance.setValidUntil(template.getValidUntil());
129        instance.setPreviousValidUntil(template.getPreviousValidUntil());
130        return instance;
131    }
132
133    /**
134     * builder factory method for StandalonePriceValidUntilSetMessage
135     * @return builder
136     */
137    public static StandalonePriceValidUntilSetMessageBuilder builder() {
138        return StandalonePriceValidUntilSetMessageBuilder.of();
139    }
140
141    /**
142     * create builder for StandalonePriceValidUntilSetMessage instance
143     * @param template instance with prefilled values for the builder
144     * @return builder
145     */
146    public static StandalonePriceValidUntilSetMessageBuilder builder(
147            final StandalonePriceValidUntilSetMessage template) {
148        return StandalonePriceValidUntilSetMessageBuilder.of(template);
149    }
150
151    /**
152     * accessor map function
153     * @param <T> mapped type
154     * @param helper function to map the object
155     * @return mapped value
156     */
157    default <T> T withStandalonePriceValidUntilSetMessage(Function<StandalonePriceValidUntilSetMessage, T> helper) {
158        return helper.apply(this);
159    }
160
161    /**
162     * gives a TypeReference for usage with Jackson DataBind
163     * @return TypeReference
164     */
165    public static com.fasterxml.jackson.core.type.TypeReference<StandalonePriceValidUntilSetMessage> typeReference() {
166        return new com.fasterxml.jackson.core.type.TypeReference<StandalonePriceValidUntilSetMessage>() {
167            @Override
168            public String toString() {
169                return "TypeReference<StandalonePriceValidUntilSetMessage>";
170            }
171        };
172    }
173}