001
002package com.commercetools.api.models.business_unit;
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.store.StoreResourceIdentifier;
013import com.fasterxml.jackson.annotation.*;
014import com.fasterxml.jackson.databind.annotation.*;
015
016import io.vrap.rmf.base.client.utils.Generated;
017
018/**
019 *  <p>Removes a Store from the Business Unit. Newly created Carts and Orders can no longer reference the removed Store for the Business Unit. We recommend cleaning up unordered Carts that still have the Store assigned after calling this update action since those cannot be converted to Orders. Orders created before the Store was removed remain unchanged. Generates a BusinessUnitStoreRemoved Message. Only applicable when <code>storeMode</code> is <code>Explicit</code>.</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 *     BusinessUnitRemoveStoreAction businessUnitRemoveStoreAction = BusinessUnitRemoveStoreAction.builder()
026 *             .store(storeBuilder -> storeBuilder)
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 = BusinessUnitRemoveStoreActionImpl.class)
033public interface BusinessUnitRemoveStoreAction extends BusinessUnitUpdateAction {
034
035    /**
036     * discriminator value for BusinessUnitRemoveStoreAction
037     */
038    String REMOVE_STORE = "removeStore";
039
040    /**
041     *  <p>Store to remove.</p>
042     * @return store
043     */
044    @NotNull
045    @Valid
046    @JsonProperty("store")
047    public StoreResourceIdentifier getStore();
048
049    /**
050     *  <p>Store to remove.</p>
051     * @param store value to be set
052     */
053
054    public void setStore(final StoreResourceIdentifier store);
055
056    /**
057     * factory method
058     * @return instance of BusinessUnitRemoveStoreAction
059     */
060    public static BusinessUnitRemoveStoreAction of() {
061        return new BusinessUnitRemoveStoreActionImpl();
062    }
063
064    /**
065     * factory method to create a shallow copy BusinessUnitRemoveStoreAction
066     * @param template instance to be copied
067     * @return copy instance
068     */
069    public static BusinessUnitRemoveStoreAction of(final BusinessUnitRemoveStoreAction template) {
070        BusinessUnitRemoveStoreActionImpl instance = new BusinessUnitRemoveStoreActionImpl();
071        instance.setStore(template.getStore());
072        return instance;
073    }
074
075    /**
076     * factory method to create a deep copy of BusinessUnitRemoveStoreAction
077     * @param template instance to be copied
078     * @return copy instance
079     */
080    @Nullable
081    public static BusinessUnitRemoveStoreAction deepCopy(@Nullable final BusinessUnitRemoveStoreAction template) {
082        if (template == null) {
083            return null;
084        }
085        BusinessUnitRemoveStoreActionImpl instance = new BusinessUnitRemoveStoreActionImpl();
086        instance.setStore(com.commercetools.api.models.store.StoreResourceIdentifier.deepCopy(template.getStore()));
087        return instance;
088    }
089
090    /**
091     * builder factory method for BusinessUnitRemoveStoreAction
092     * @return builder
093     */
094    public static BusinessUnitRemoveStoreActionBuilder builder() {
095        return BusinessUnitRemoveStoreActionBuilder.of();
096    }
097
098    /**
099     * create builder for BusinessUnitRemoveStoreAction instance
100     * @param template instance with prefilled values for the builder
101     * @return builder
102     */
103    public static BusinessUnitRemoveStoreActionBuilder builder(final BusinessUnitRemoveStoreAction template) {
104        return BusinessUnitRemoveStoreActionBuilder.of(template);
105    }
106
107    /**
108     * accessor map function
109     * @param <T> mapped type
110     * @param helper function to map the object
111     * @return mapped value
112     */
113    default <T> T withBusinessUnitRemoveStoreAction(Function<BusinessUnitRemoveStoreAction, T> helper) {
114        return helper.apply(this);
115    }
116
117    /**
118     * gives a TypeReference for usage with Jackson DataBind
119     * @return TypeReference
120     */
121    public static com.fasterxml.jackson.core.type.TypeReference<BusinessUnitRemoveStoreAction> typeReference() {
122        return new com.fasterxml.jackson.core.type.TypeReference<BusinessUnitRemoveStoreAction>() {
123            @Override
124            public String toString() {
125                return "TypeReference<BusinessUnitRemoveStoreAction>";
126            }
127        };
128    }
129}