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 *     ProductSetImageLabelAction productSetImageLabelAction = ProductSetImageLabelAction.builder()
024 *             .imageUrl("{imageUrl}")
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 = ProductSetImageLabelActionImpl.class)
031public interface ProductSetImageLabelAction extends ProductUpdateAction {
032
033    /**
034     * discriminator value for ProductSetImageLabelAction
035     */
036    String SET_IMAGE_LABEL = "setImageLabel";
037
038    /**
039     *  <p>The <code>sku</code> of the ProductVariant to update.</p>
040     * @return sku
041     */
042
043    @JsonProperty("sku")
044    public String getSku();
045
046    /**
047     *  <p>The <code>id</code> of the ProductVariant to update.</p>
048     * @return variantId
049     */
050
051    @JsonProperty("variantId")
052    public Long getVariantId();
053
054    /**
055     *  <p>The URL of the image to set the label.</p>
056     * @return imageUrl
057     */
058    @NotNull
059    @JsonProperty("imageUrl")
060    public String getImageUrl();
061
062    /**
063     *  <p>Value to set. If empty, any existing value will be removed.</p>
064     * @return label
065     */
066
067    @JsonProperty("label")
068    public String getLabel();
069
070    /**
071     *  <p>If <code>true</code>, only the staged image is updated. If <code>false</code>, both the current and staged image is updated.</p>
072     * @return staged
073     */
074
075    @JsonProperty("staged")
076    public Boolean getStaged();
077
078    /**
079     *  <p>The <code>sku</code> of the ProductVariant to update.</p>
080     * @param sku value to be set
081     */
082
083    public void setSku(final String sku);
084
085    /**
086     *  <p>The <code>id</code> of the ProductVariant to update.</p>
087     * @param variantId value to be set
088     */
089
090    public void setVariantId(final Long variantId);
091
092    /**
093     *  <p>The URL of the image to set the label.</p>
094     * @param imageUrl value to be set
095     */
096
097    public void setImageUrl(final String imageUrl);
098
099    /**
100     *  <p>Value to set. If empty, any existing value will be removed.</p>
101     * @param label value to be set
102     */
103
104    public void setLabel(final String label);
105
106    /**
107     *  <p>If <code>true</code>, only the staged image is updated. If <code>false</code>, both the current and staged image is updated.</p>
108     * @param staged value to be set
109     */
110
111    public void setStaged(final Boolean staged);
112
113    /**
114     * factory method
115     * @return instance of ProductSetImageLabelAction
116     */
117    public static ProductSetImageLabelAction of() {
118        return new ProductSetImageLabelActionImpl();
119    }
120
121    /**
122     * factory method to create a shallow copy ProductSetImageLabelAction
123     * @param template instance to be copied
124     * @return copy instance
125     */
126    public static ProductSetImageLabelAction of(final ProductSetImageLabelAction template) {
127        ProductSetImageLabelActionImpl instance = new ProductSetImageLabelActionImpl();
128        instance.setSku(template.getSku());
129        instance.setVariantId(template.getVariantId());
130        instance.setImageUrl(template.getImageUrl());
131        instance.setLabel(template.getLabel());
132        instance.setStaged(template.getStaged());
133        return instance;
134    }
135
136    /**
137     * factory method to create a deep copy of ProductSetImageLabelAction
138     * @param template instance to be copied
139     * @return copy instance
140     */
141    @Nullable
142    public static ProductSetImageLabelAction deepCopy(@Nullable final ProductSetImageLabelAction template) {
143        if (template == null) {
144            return null;
145        }
146        ProductSetImageLabelActionImpl instance = new ProductSetImageLabelActionImpl();
147        instance.setSku(template.getSku());
148        instance.setVariantId(template.getVariantId());
149        instance.setImageUrl(template.getImageUrl());
150        instance.setLabel(template.getLabel());
151        instance.setStaged(template.getStaged());
152        return instance;
153    }
154
155    /**
156     * builder factory method for ProductSetImageLabelAction
157     * @return builder
158     */
159    public static ProductSetImageLabelActionBuilder builder() {
160        return ProductSetImageLabelActionBuilder.of();
161    }
162
163    /**
164     * create builder for ProductSetImageLabelAction instance
165     * @param template instance with prefilled values for the builder
166     * @return builder
167     */
168    public static ProductSetImageLabelActionBuilder builder(final ProductSetImageLabelAction template) {
169        return ProductSetImageLabelActionBuilder.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 withProductSetImageLabelAction(Function<ProductSetImageLabelAction, T> helper) {
179        return helper.apply(this);
180    }
181
182    public static ProductSetImageLabelAction ofUnset(final Long variantId, final String imageUrl,
183            final Boolean staged) {
184        return ProductSetImageLabelActionBuilder.of().variantId(variantId).imageUrl(imageUrl).staged(staged).build();
185    }
186
187    public static ProductSetImageLabelAction ofUnsetStaged(final Long variantId, final String imageUrl) {
188        return ProductSetImageLabelActionBuilder.of().variantId(variantId).imageUrl(imageUrl).build();
189    }
190
191    /**
192     * gives a TypeReference for usage with Jackson DataBind
193     * @return TypeReference
194     */
195    public static com.fasterxml.jackson.core.type.TypeReference<ProductSetImageLabelAction> typeReference() {
196        return new com.fasterxml.jackson.core.type.TypeReference<ProductSetImageLabelAction>() {
197            @Override
198            public String toString() {
199                return "TypeReference<ProductSetImageLabelAction>";
200            }
201        };
202    }
203}