001
002package com.commercetools.api.models.product;
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>Either <code>variantId</code> or <code>sku</code> is required.</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 *     ProductSetAssetKeyAction productSetAssetKeyAction = ProductSetAssetKeyAction.builder()
024 *             .assetId("{assetId}")
025 *             .build()
026 * </code></pre>
027 * </div>
028 */
029@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
030@JsonDeserialize(as = ProductSetAssetKeyActionImpl.class)
031public interface ProductSetAssetKeyAction extends ProductUpdateAction {
032
033    /**
034     * discriminator value for ProductSetAssetKeyAction
035     */
036    String SET_ASSET_KEY = "setAssetKey";
037
038    /**
039     *  <p>The <code>id</code> of the ProductVariant to update.</p>
040     * @return variantId
041     */
042
043    @JsonProperty("variantId")
044    public Long getVariantId();
045
046    /**
047     *  <p>The <code>sku</code> of the ProductVariant to update.</p>
048     * @return sku
049     */
050
051    @JsonProperty("sku")
052    public String getSku();
053
054    /**
055     *  <p>If <code>true</code>, only the staged Asset is updated. If <code>false</code>, both the current and staged Asset is updated.</p>
056     * @return staged
057     */
058
059    @JsonProperty("staged")
060    public Boolean getStaged();
061
062    /**
063     *  <p>The <code>id</code> of the Asset to update.</p>
064     * @return assetId
065     */
066    @NotNull
067    @JsonProperty("assetId")
068    public String getAssetId();
069
070    /**
071     *  <p>Value to set. If empty, any existing value will be removed.</p>
072     * @return assetKey
073     */
074
075    @JsonProperty("assetKey")
076    public String getAssetKey();
077
078    /**
079     *  <p>The <code>id</code> of the ProductVariant to update.</p>
080     * @param variantId value to be set
081     */
082
083    public void setVariantId(final Long variantId);
084
085    /**
086     *  <p>The <code>sku</code> of the ProductVariant to update.</p>
087     * @param sku value to be set
088     */
089
090    public void setSku(final String sku);
091
092    /**
093     *  <p>If <code>true</code>, only the staged Asset is updated. If <code>false</code>, both the current and staged Asset is updated.</p>
094     * @param staged value to be set
095     */
096
097    public void setStaged(final Boolean staged);
098
099    /**
100     *  <p>The <code>id</code> of the Asset to update.</p>
101     * @param assetId value to be set
102     */
103
104    public void setAssetId(final String assetId);
105
106    /**
107     *  <p>Value to set. If empty, any existing value will be removed.</p>
108     * @param assetKey value to be set
109     */
110
111    public void setAssetKey(final String assetKey);
112
113    /**
114     * factory method
115     * @return instance of ProductSetAssetKeyAction
116     */
117    public static ProductSetAssetKeyAction of() {
118        return new ProductSetAssetKeyActionImpl();
119    }
120
121    /**
122     * factory method to create a shallow copy ProductSetAssetKeyAction
123     * @param template instance to be copied
124     * @return copy instance
125     */
126    public static ProductSetAssetKeyAction of(final ProductSetAssetKeyAction template) {
127        ProductSetAssetKeyActionImpl instance = new ProductSetAssetKeyActionImpl();
128        instance.setVariantId(template.getVariantId());
129        instance.setSku(template.getSku());
130        instance.setStaged(template.getStaged());
131        instance.setAssetId(template.getAssetId());
132        instance.setAssetKey(template.getAssetKey());
133        return instance;
134    }
135
136    /**
137     * factory method to create a deep copy of ProductSetAssetKeyAction
138     * @param template instance to be copied
139     * @return copy instance
140     */
141    @Nullable
142    public static ProductSetAssetKeyAction deepCopy(@Nullable final ProductSetAssetKeyAction template) {
143        if (template == null) {
144            return null;
145        }
146        ProductSetAssetKeyActionImpl instance = new ProductSetAssetKeyActionImpl();
147        instance.setVariantId(template.getVariantId());
148        instance.setSku(template.getSku());
149        instance.setStaged(template.getStaged());
150        instance.setAssetId(template.getAssetId());
151        instance.setAssetKey(template.getAssetKey());
152        return instance;
153    }
154
155    /**
156     * builder factory method for ProductSetAssetKeyAction
157     * @return builder
158     */
159    public static ProductSetAssetKeyActionBuilder builder() {
160        return ProductSetAssetKeyActionBuilder.of();
161    }
162
163    /**
164     * create builder for ProductSetAssetKeyAction instance
165     * @param template instance with prefilled values for the builder
166     * @return builder
167     */
168    public static ProductSetAssetKeyActionBuilder builder(final ProductSetAssetKeyAction template) {
169        return ProductSetAssetKeyActionBuilder.of(template);
170    }
171
172    /**
173     * accessor map function
174     * @param <T> mapped type
175     * @param helper function to map the object
176     * @return mapped value
177     */
178    default <T> T withProductSetAssetKeyAction(Function<ProductSetAssetKeyAction, T> helper) {
179        return helper.apply(this);
180    }
181
182    /**
183     * gives a TypeReference for usage with Jackson DataBind
184     * @return TypeReference
185     */
186    public static com.fasterxml.jackson.core.type.TypeReference<ProductSetAssetKeyAction> typeReference() {
187        return new com.fasterxml.jackson.core.type.TypeReference<ProductSetAssetKeyAction>() {
188            @Override
189            public String toString() {
190                return "TypeReference<ProductSetAssetKeyAction>";
191            }
192        };
193    }
194}