001
002package com.commercetools.api.models.message;
003
004import java.time.*;
005import java.util.*;
006import java.util.function.Function;
007
008import javax.annotation.Nullable;
009import javax.validation.constraints.NotNull;
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 Delete StandalonePrice request.</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 *     StandalonePriceDeletedMessage standalonePriceDeletedMessage = StandalonePriceDeletedMessage.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 *             .sku("{sku}")
032 *             .build()
033 * </code></pre>
034 * </div>
035 */
036@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
037@JsonDeserialize(as = StandalonePriceDeletedMessageImpl.class)
038public interface StandalonePriceDeletedMessage extends Message {
039
040    /**
041     * discriminator value for StandalonePriceDeletedMessage
042     */
043    String STANDALONE_PRICE_DELETED = "StandalonePriceDeleted";
044
045    /**
046     *  <p>SKU of the ProductVariant to which the deleted Standalone Price was associated.</p>
047     * @return sku
048     */
049    @NotNull
050    @JsonProperty("sku")
051    public String getSku();
052
053    /**
054     *  <p>SKU of the ProductVariant to which the deleted Standalone Price was associated.</p>
055     * @param sku value to be set
056     */
057
058    public void setSku(final String sku);
059
060    /**
061     * factory method
062     * @return instance of StandalonePriceDeletedMessage
063     */
064    public static StandalonePriceDeletedMessage of() {
065        return new StandalonePriceDeletedMessageImpl();
066    }
067
068    /**
069     * factory method to create a shallow copy StandalonePriceDeletedMessage
070     * @param template instance to be copied
071     * @return copy instance
072     */
073    public static StandalonePriceDeletedMessage of(final StandalonePriceDeletedMessage template) {
074        StandalonePriceDeletedMessageImpl instance = new StandalonePriceDeletedMessageImpl();
075        instance.setId(template.getId());
076        instance.setVersion(template.getVersion());
077        instance.setCreatedAt(template.getCreatedAt());
078        instance.setLastModifiedAt(template.getLastModifiedAt());
079        instance.setLastModifiedBy(template.getLastModifiedBy());
080        instance.setCreatedBy(template.getCreatedBy());
081        instance.setSequenceNumber(template.getSequenceNumber());
082        instance.setResource(template.getResource());
083        instance.setResourceVersion(template.getResourceVersion());
084        instance.setResourceUserProvidedIdentifiers(template.getResourceUserProvidedIdentifiers());
085        instance.setSku(template.getSku());
086        return instance;
087    }
088
089    /**
090     * factory method to create a deep copy of StandalonePriceDeletedMessage
091     * @param template instance to be copied
092     * @return copy instance
093     */
094    @Nullable
095    public static StandalonePriceDeletedMessage deepCopy(@Nullable final StandalonePriceDeletedMessage template) {
096        if (template == null) {
097            return null;
098        }
099        StandalonePriceDeletedMessageImpl instance = new StandalonePriceDeletedMessageImpl();
100        instance.setId(template.getId());
101        instance.setVersion(template.getVersion());
102        instance.setCreatedAt(template.getCreatedAt());
103        instance.setLastModifiedAt(template.getLastModifiedAt());
104        instance.setLastModifiedBy(
105            com.commercetools.api.models.common.LastModifiedBy.deepCopy(template.getLastModifiedBy()));
106        instance.setCreatedBy(com.commercetools.api.models.common.CreatedBy.deepCopy(template.getCreatedBy()));
107        instance.setSequenceNumber(template.getSequenceNumber());
108        instance.setResource(com.commercetools.api.models.common.Reference.deepCopy(template.getResource()));
109        instance.setResourceVersion(template.getResourceVersion());
110        instance.setResourceUserProvidedIdentifiers(com.commercetools.api.models.message.UserProvidedIdentifiers
111                .deepCopy(template.getResourceUserProvidedIdentifiers()));
112        instance.setSku(template.getSku());
113        return instance;
114    }
115
116    /**
117     * builder factory method for StandalonePriceDeletedMessage
118     * @return builder
119     */
120    public static StandalonePriceDeletedMessageBuilder builder() {
121        return StandalonePriceDeletedMessageBuilder.of();
122    }
123
124    /**
125     * create builder for StandalonePriceDeletedMessage instance
126     * @param template instance with prefilled values for the builder
127     * @return builder
128     */
129    public static StandalonePriceDeletedMessageBuilder builder(final StandalonePriceDeletedMessage template) {
130        return StandalonePriceDeletedMessageBuilder.of(template);
131    }
132
133    /**
134     * accessor map function
135     * @param <T> mapped type
136     * @param helper function to map the object
137     * @return mapped value
138     */
139    default <T> T withStandalonePriceDeletedMessage(Function<StandalonePriceDeletedMessage, T> helper) {
140        return helper.apply(this);
141    }
142
143    /**
144     * gives a TypeReference for usage with Jackson DataBind
145     * @return TypeReference
146     */
147    public static com.fasterxml.jackson.core.type.TypeReference<StandalonePriceDeletedMessage> typeReference() {
148        return new com.fasterxml.jackson.core.type.TypeReference<StandalonePriceDeletedMessage>() {
149            @Override
150            public String toString() {
151                return "TypeReference<StandalonePriceDeletedMessage>";
152            }
153        };
154    }
155}