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.Valid;
010import javax.validation.constraints.NotNull;
011
012import com.commercetools.api.models.common.PriceTier;
013import com.fasterxml.jackson.annotation.*;
014import com.fasterxml.jackson.databind.annotation.*;
015
016import io.vrap.rmf.base.client.utils.Generated;
017
018/**
019 *  <p>Generated after a successful Remove Price Tier update action</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 *     StandalonePriceTierRemovedMessagePayload standalonePriceTierRemovedMessagePayload = StandalonePriceTierRemovedMessagePayload.builder()
026 *             .removedTier(removedTierBuilder -> removedTierBuilder)
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 = StandalonePriceTierRemovedMessagePayloadImpl.class)
033public interface StandalonePriceTierRemovedMessagePayload extends MessagePayload {
034
035    /**
036     * discriminator value for StandalonePriceTierRemovedMessagePayload
037     */
038    String STANDALONE_PRICE_TIER_REMOVED = "StandalonePriceTierRemoved";
039
040    /**
041     *  <p>The Price Tier that has been removed from the array field <code>tiers</code> for the StandalonePrice.</p>
042     * @return removedTier
043     */
044    @NotNull
045    @Valid
046    @JsonProperty("removedTier")
047    public PriceTier getRemovedTier();
048
049    /**
050     *  <p>The Price Tier that has been removed from the array field <code>tiers</code> for the StandalonePrice.</p>
051     * @param removedTier value to be set
052     */
053
054    public void setRemovedTier(final PriceTier removedTier);
055
056    /**
057     * factory method
058     * @return instance of StandalonePriceTierRemovedMessagePayload
059     */
060    public static StandalonePriceTierRemovedMessagePayload of() {
061        return new StandalonePriceTierRemovedMessagePayloadImpl();
062    }
063
064    /**
065     * factory method to create a shallow copy StandalonePriceTierRemovedMessagePayload
066     * @param template instance to be copied
067     * @return copy instance
068     */
069    public static StandalonePriceTierRemovedMessagePayload of(final StandalonePriceTierRemovedMessagePayload template) {
070        StandalonePriceTierRemovedMessagePayloadImpl instance = new StandalonePriceTierRemovedMessagePayloadImpl();
071        instance.setRemovedTier(template.getRemovedTier());
072        return instance;
073    }
074
075    /**
076     * factory method to create a deep copy of StandalonePriceTierRemovedMessagePayload
077     * @param template instance to be copied
078     * @return copy instance
079     */
080    @Nullable
081    public static StandalonePriceTierRemovedMessagePayload deepCopy(
082            @Nullable final StandalonePriceTierRemovedMessagePayload template) {
083        if (template == null) {
084            return null;
085        }
086        StandalonePriceTierRemovedMessagePayloadImpl instance = new StandalonePriceTierRemovedMessagePayloadImpl();
087        instance.setRemovedTier(com.commercetools.api.models.common.PriceTier.deepCopy(template.getRemovedTier()));
088        return instance;
089    }
090
091    /**
092     * builder factory method for StandalonePriceTierRemovedMessagePayload
093     * @return builder
094     */
095    public static StandalonePriceTierRemovedMessagePayloadBuilder builder() {
096        return StandalonePriceTierRemovedMessagePayloadBuilder.of();
097    }
098
099    /**
100     * create builder for StandalonePriceTierRemovedMessagePayload instance
101     * @param template instance with prefilled values for the builder
102     * @return builder
103     */
104    public static StandalonePriceTierRemovedMessagePayloadBuilder builder(
105            final StandalonePriceTierRemovedMessagePayload template) {
106        return StandalonePriceTierRemovedMessagePayloadBuilder.of(template);
107    }
108
109    /**
110     * accessor map function
111     * @param <T> mapped type
112     * @param helper function to map the object
113     * @return mapped value
114     */
115    default <T> T withStandalonePriceTierRemovedMessagePayload(
116            Function<StandalonePriceTierRemovedMessagePayload, T> helper) {
117        return helper.apply(this);
118    }
119
120    /**
121     * gives a TypeReference for usage with Jackson DataBind
122     * @return TypeReference
123     */
124    public static com.fasterxml.jackson.core.type.TypeReference<StandalonePriceTierRemovedMessagePayload> typeReference() {
125        return new com.fasterxml.jackson.core.type.TypeReference<StandalonePriceTierRemovedMessagePayload>() {
126            @Override
127            public String toString() {
128                return "TypeReference<StandalonePriceTierRemovedMessagePayload>";
129            }
130        };
131    }
132}