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 StoreSupplyChannelsChanged 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 *     StoreRemoveSupplyChannelAction storeRemoveSupplyChannelAction = StoreRemoveSupplyChannelAction.builder()
026 *             .supplyChannel(supplyChannelBuilder -> supplyChannelBuilder)
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 = StoreRemoveSupplyChannelActionImpl.class)
033public interface StoreRemoveSupplyChannelAction extends StoreUpdateAction {
034
035    /**
036     * discriminator value for StoreRemoveSupplyChannelAction
037     */
038    String REMOVE_SUPPLY_CHANNEL = "removeSupplyChannel";
039
040    /**
041     *  <p>Value to remove. ResourceIdentifier of a Channel with the <code>InventorySupply</code> ChannelRoleEnum.</p>
042     * @return supplyChannel
043     */
044    @NotNull
045    @Valid
046    @JsonProperty("supplyChannel")
047    public ChannelResourceIdentifier getSupplyChannel();
048
049    /**
050     *  <p>Value to remove. ResourceIdentifier of a Channel with the <code>InventorySupply</code> ChannelRoleEnum.</p>
051     * @param supplyChannel value to be set
052     */
053
054    public void setSupplyChannel(final ChannelResourceIdentifier supplyChannel);
055
056    /**
057     * factory method
058     * @return instance of StoreRemoveSupplyChannelAction
059     */
060    public static StoreRemoveSupplyChannelAction of() {
061        return new StoreRemoveSupplyChannelActionImpl();
062    }
063
064    /**
065     * factory method to create a shallow copy StoreRemoveSupplyChannelAction
066     * @param template instance to be copied
067     * @return copy instance
068     */
069    public static StoreRemoveSupplyChannelAction of(final StoreRemoveSupplyChannelAction template) {
070        StoreRemoveSupplyChannelActionImpl instance = new StoreRemoveSupplyChannelActionImpl();
071        instance.setSupplyChannel(template.getSupplyChannel());
072        return instance;
073    }
074
075    /**
076     * factory method to create a deep copy of StoreRemoveSupplyChannelAction
077     * @param template instance to be copied
078     * @return copy instance
079     */
080    @Nullable
081    public static StoreRemoveSupplyChannelAction deepCopy(@Nullable final StoreRemoveSupplyChannelAction template) {
082        if (template == null) {
083            return null;
084        }
085        StoreRemoveSupplyChannelActionImpl instance = new StoreRemoveSupplyChannelActionImpl();
086        instance.setSupplyChannel(
087            com.commercetools.api.models.channel.ChannelResourceIdentifier.deepCopy(template.getSupplyChannel()));
088        return instance;
089    }
090
091    /**
092     * builder factory method for StoreRemoveSupplyChannelAction
093     * @return builder
094     */
095    public static StoreRemoveSupplyChannelActionBuilder builder() {
096        return StoreRemoveSupplyChannelActionBuilder.of();
097    }
098
099    /**
100     * create builder for StoreRemoveSupplyChannelAction instance
101     * @param template instance with prefilled values for the builder
102     * @return builder
103     */
104    public static StoreRemoveSupplyChannelActionBuilder builder(final StoreRemoveSupplyChannelAction template) {
105        return StoreRemoveSupplyChannelActionBuilder.of(template);
106    }
107
108    /**
109     * accessor map function
110     * @param <T> mapped type
111     * @param helper function to map the object
112     * @return mapped value
113     */
114    default <T> T withStoreRemoveSupplyChannelAction(Function<StoreRemoveSupplyChannelAction, T> helper) {
115        return helper.apply(this);
116    }
117
118    /**
119     * gives a TypeReference for usage with Jackson DataBind
120     * @return TypeReference
121     */
122    public static com.fasterxml.jackson.core.type.TypeReference<StoreRemoveSupplyChannelAction> typeReference() {
123        return new com.fasterxml.jackson.core.type.TypeReference<StoreRemoveSupplyChannelAction>() {
124            @Override
125            public String toString() {
126                return "TypeReference<StoreRemoveSupplyChannelAction>";
127            }
128        };
129    }
130}