001
002package com.commercetools.api.models.store;
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.channel.ChannelResourceIdentifier;
013import com.fasterxml.jackson.annotation.*;
014import com.fasterxml.jackson.databind.annotation.*;
015
016import io.vrap.rmf.base.client.utils.Generated;
017
018/**
019 *  <p>This update action produces the StoreDistributionChannelsChanged 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 *     StoreRemoveDistributionChannelAction storeRemoveDistributionChannelAction = StoreRemoveDistributionChannelAction.builder()
026 *             .distributionChannel(distributionChannelBuilder -> distributionChannelBuilder)
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 = StoreRemoveDistributionChannelActionImpl.class)
033public interface StoreRemoveDistributionChannelAction extends StoreUpdateAction {
034
035    /**
036     * discriminator value for StoreRemoveDistributionChannelAction
037     */
038    String REMOVE_DISTRIBUTION_CHANNEL = "removeDistributionChannel";
039
040    /**
041     *  <p>Value to remove. ResourceIdentifier of a Channel with the <code>ProductDistribution</code> ChannelRoleEnum.</p>
042     * @return distributionChannel
043     */
044    @NotNull
045    @Valid
046    @JsonProperty("distributionChannel")
047    public ChannelResourceIdentifier getDistributionChannel();
048
049    /**
050     *  <p>Value to remove. ResourceIdentifier of a Channel with the <code>ProductDistribution</code> ChannelRoleEnum.</p>
051     * @param distributionChannel value to be set
052     */
053
054    public void setDistributionChannel(final ChannelResourceIdentifier distributionChannel);
055
056    /**
057     * factory method
058     * @return instance of StoreRemoveDistributionChannelAction
059     */
060    public static StoreRemoveDistributionChannelAction of() {
061        return new StoreRemoveDistributionChannelActionImpl();
062    }
063
064    /**
065     * factory method to create a shallow copy StoreRemoveDistributionChannelAction
066     * @param template instance to be copied
067     * @return copy instance
068     */
069    public static StoreRemoveDistributionChannelAction of(final StoreRemoveDistributionChannelAction template) {
070        StoreRemoveDistributionChannelActionImpl instance = new StoreRemoveDistributionChannelActionImpl();
071        instance.setDistributionChannel(template.getDistributionChannel());
072        return instance;
073    }
074
075    /**
076     * factory method to create a deep copy of StoreRemoveDistributionChannelAction
077     * @param template instance to be copied
078     * @return copy instance
079     */
080    @Nullable
081    public static StoreRemoveDistributionChannelAction deepCopy(
082            @Nullable final StoreRemoveDistributionChannelAction template) {
083        if (template == null) {
084            return null;
085        }
086        StoreRemoveDistributionChannelActionImpl instance = new StoreRemoveDistributionChannelActionImpl();
087        instance.setDistributionChannel(
088            com.commercetools.api.models.channel.ChannelResourceIdentifier.deepCopy(template.getDistributionChannel()));
089        return instance;
090    }
091
092    /**
093     * builder factory method for StoreRemoveDistributionChannelAction
094     * @return builder
095     */
096    public static StoreRemoveDistributionChannelActionBuilder builder() {
097        return StoreRemoveDistributionChannelActionBuilder.of();
098    }
099
100    /**
101     * create builder for StoreRemoveDistributionChannelAction instance
102     * @param template instance with prefilled values for the builder
103     * @return builder
104     */
105    public static StoreRemoveDistributionChannelActionBuilder builder(
106            final StoreRemoveDistributionChannelAction template) {
107        return StoreRemoveDistributionChannelActionBuilder.of(template);
108    }
109
110    /**
111     * accessor map function
112     * @param <T> mapped type
113     * @param helper function to map the object
114     * @return mapped value
115     */
116    default <T> T withStoreRemoveDistributionChannelAction(Function<StoreRemoveDistributionChannelAction, 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<StoreRemoveDistributionChannelAction> typeReference() {
125        return new com.fasterxml.jackson.core.type.TypeReference<StoreRemoveDistributionChannelAction>() {
126            @Override
127            public String toString() {
128                return "TypeReference<StoreRemoveDistributionChannelAction>";
129            }
130        };
131    }
132}