001
002package com.commercetools.api.models.review;
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.commercetools.api.models.channel.ChannelResourceIdentifier;
012import com.commercetools.api.models.product.ProductResourceIdentifier;
013import com.fasterxml.jackson.annotation.*;
014import com.fasterxml.jackson.databind.annotation.*;
015
016import io.vrap.rmf.base.client.utils.Generated;
017
018/**
019 * ReviewSetTargetAction
020 *
021 * <hr>
022 * Example to create an instance using the builder pattern
023 * <div class=code-example>
024 * <pre><code class='java'>
025 *     ReviewSetTargetAction reviewSetTargetAction = ReviewSetTargetAction.builder()
026 *             .build()
027 * </code></pre>
028 * </div>
029 */
030@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
031@JsonDeserialize(as = ReviewSetTargetActionImpl.class)
032public interface ReviewSetTargetAction extends ReviewUpdateAction {
033
034    /**
035     * discriminator value for ReviewSetTargetAction
036     */
037    String SET_TARGET = "setTarget";
038
039    /**
040     *  <p>Value to set, specified as ProductResourceIdentifier or ChannelResourceIdentifier, respectively. If empty, any existing value will be removed.</p>
041     * @return target
042     */
043    @NotNull
044    @JsonProperty("target")
045    public Object getTarget();
046
047    /**
048     *  <p>Value to set, specified as ProductResourceIdentifier or ChannelResourceIdentifier, respectively. If empty, any existing value will be removed.</p>
049     * @param target value to be set
050     */
051
052    public void setTarget(final ProductResourceIdentifier target);
053
054    /**
055     *  <p>Value to set, specified as ProductResourceIdentifier or ChannelResourceIdentifier, respectively. If empty, any existing value will be removed.</p>
056     * @param target value to be set
057     */
058
059    public void setTarget(final ChannelResourceIdentifier target);
060
061    /**
062     *  <p>Value to set, specified as ProductResourceIdentifier or ChannelResourceIdentifier, respectively. If empty, any existing value will be removed.</p>
063     * @param target value to be set
064     */
065
066    public void setTarget(final Object target);
067
068    /**
069     * factory method
070     * @return instance of ReviewSetTargetAction
071     */
072    public static ReviewSetTargetAction of() {
073        return new ReviewSetTargetActionImpl();
074    }
075
076    /**
077     * factory method to create a shallow copy ReviewSetTargetAction
078     * @param template instance to be copied
079     * @return copy instance
080     */
081    public static ReviewSetTargetAction of(final ReviewSetTargetAction template) {
082        ReviewSetTargetActionImpl instance = new ReviewSetTargetActionImpl();
083        instance.setTarget(template.getTarget());
084        return instance;
085    }
086
087    /**
088     * factory method to create a deep copy of ReviewSetTargetAction
089     * @param template instance to be copied
090     * @return copy instance
091     */
092    @Nullable
093    public static ReviewSetTargetAction deepCopy(@Nullable final ReviewSetTargetAction template) {
094        if (template == null) {
095            return null;
096        }
097        ReviewSetTargetActionImpl instance = new ReviewSetTargetActionImpl();
098        instance.setTarget(template.getTarget());
099        return instance;
100    }
101
102    /**
103     * builder factory method for ReviewSetTargetAction
104     * @return builder
105     */
106    public static ReviewSetTargetActionBuilder builder() {
107        return ReviewSetTargetActionBuilder.of();
108    }
109
110    /**
111     * create builder for ReviewSetTargetAction instance
112     * @param template instance with prefilled values for the builder
113     * @return builder
114     */
115    public static ReviewSetTargetActionBuilder builder(final ReviewSetTargetAction template) {
116        return ReviewSetTargetActionBuilder.of(template);
117    }
118
119    /**
120     * accessor map function
121     * @param <T> mapped type
122     * @param helper function to map the object
123     * @return mapped value
124     */
125    default <T> T withReviewSetTargetAction(Function<ReviewSetTargetAction, T> helper) {
126        return helper.apply(this);
127    }
128
129    /**
130     * gives a TypeReference for usage with Jackson DataBind
131     * @return TypeReference
132     */
133    public static com.fasterxml.jackson.core.type.TypeReference<ReviewSetTargetAction> typeReference() {
134        return new com.fasterxml.jackson.core.type.TypeReference<ReviewSetTargetAction>() {
135            @Override
136            public String toString() {
137                return "TypeReference<ReviewSetTargetAction>";
138            }
139        };
140    }
141}