001
002package com.commercetools.ml.models.image_search_config;
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 * ImageSearchConfigUpdateAction
018 *
019 * <hr>
020 * Example to create a subtype instance using the builder pattern
021 * <div class=code-example>
022 * <pre><code class='java'>
023 *     ImageSearchConfigUpdateAction imageSearchConfigUpdateAction = ImageSearchConfigUpdateAction.changeStatusBuilder()
024 *             status(ImageSearchConfigStatus.ON)
025 *             .build()
026 * </code></pre>
027 * </div>
028 */
029@JsonSubTypes({
030        @JsonSubTypes.Type(value = com.commercetools.ml.models.image_search_config.ChangeStatusUpdateActionImpl.class, name = ChangeStatusUpdateAction.CHANGE_STATUS) })
031@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "action", defaultImpl = ImageSearchConfigUpdateActionImpl.class, visible = true)
032@JsonDeserialize(as = ImageSearchConfigUpdateActionImpl.class)
033@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
034public interface ImageSearchConfigUpdateAction {
035
036    /**
037     *
038     * @return action
039     */
040    @NotNull
041    @JsonProperty("action")
042    public String getAction();
043
044    /**
045     * factory method to create a deep copy of ImageSearchConfigUpdateAction
046     * @param template instance to be copied
047     * @return copy instance
048     */
049    @Nullable
050    public static ImageSearchConfigUpdateAction deepCopy(@Nullable final ImageSearchConfigUpdateAction template) {
051        if (template == null) {
052            return null;
053        }
054        if (template instanceof com.commercetools.ml.models.image_search_config.ChangeStatusUpdateAction) {
055            return com.commercetools.ml.models.image_search_config.ChangeStatusUpdateAction
056                    .deepCopy((com.commercetools.ml.models.image_search_config.ChangeStatusUpdateAction) template);
057        }
058        ImageSearchConfigUpdateActionImpl instance = new ImageSearchConfigUpdateActionImpl();
059        return instance;
060    }
061
062    /**
063     * builder for changeStatus subtype
064     * @return builder
065     */
066    public static com.commercetools.ml.models.image_search_config.ChangeStatusUpdateActionBuilder changeStatusBuilder() {
067        return com.commercetools.ml.models.image_search_config.ChangeStatusUpdateActionBuilder.of();
068    }
069
070    /**
071     * accessor map function
072     * @param <T> mapped type
073     * @param helper function to map the object
074     * @return mapped value
075     */
076    default <T> T withImageSearchConfigUpdateAction(Function<ImageSearchConfigUpdateAction, T> helper) {
077        return helper.apply(this);
078    }
079
080    /**
081     * gives a TypeReference for usage with Jackson DataBind
082     * @return TypeReference
083     */
084    public static com.fasterxml.jackson.core.type.TypeReference<ImageSearchConfigUpdateAction> typeReference() {
085        return new com.fasterxml.jackson.core.type.TypeReference<ImageSearchConfigUpdateAction>() {
086            @Override
087            public String toString() {
088                return "TypeReference<ImageSearchConfigUpdateAction>";
089            }
090        };
091    }
092}