001
002package com.commercetools.ml.models.image_search_config;
003
004import java.time.*;
005import java.util.*;
006import java.util.function.Function;
007import java.util.stream.Collectors;
008
009import javax.annotation.Nullable;
010import javax.validation.Valid;
011import javax.validation.constraints.NotNull;
012
013import com.fasterxml.jackson.annotation.*;
014import com.fasterxml.jackson.databind.annotation.*;
015
016import io.vrap.rmf.base.client.utils.Generated;
017
018/**
019 * ImageSearchConfigRequest
020 *
021 * <hr>
022 * Example to create an instance using the builder pattern
023 * <div class=code-example>
024 * <pre><code class='java'>
025 *     ImageSearchConfigRequest imageSearchConfigRequest = ImageSearchConfigRequest.builder()
026 *             .plusActions(actionsBuilder -> actionsBuilder)
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 = ImageSearchConfigRequestImpl.class)
033public interface ImageSearchConfigRequest {
034
035    /**
036     *  <p>The list of update actions to be performed on the project.</p>
037     * @return actions
038     */
039    @NotNull
040    @Valid
041    @JsonProperty("actions")
042    public List<ImageSearchConfigUpdateAction> getActions();
043
044    /**
045     *  <p>The list of update actions to be performed on the project.</p>
046     * @param actions values to be set
047     */
048
049    @JsonIgnore
050    public void setActions(final ImageSearchConfigUpdateAction... actions);
051
052    /**
053     *  <p>The list of update actions to be performed on the project.</p>
054     * @param actions values to be set
055     */
056
057    public void setActions(final List<ImageSearchConfigUpdateAction> actions);
058
059    /**
060     * factory method
061     * @return instance of ImageSearchConfigRequest
062     */
063    public static ImageSearchConfigRequest of() {
064        return new ImageSearchConfigRequestImpl();
065    }
066
067    /**
068     * factory method to create a shallow copy ImageSearchConfigRequest
069     * @param template instance to be copied
070     * @return copy instance
071     */
072    public static ImageSearchConfigRequest of(final ImageSearchConfigRequest template) {
073        ImageSearchConfigRequestImpl instance = new ImageSearchConfigRequestImpl();
074        instance.setActions(template.getActions());
075        return instance;
076    }
077
078    /**
079     * factory method to create a deep copy of ImageSearchConfigRequest
080     * @param template instance to be copied
081     * @return copy instance
082     */
083    @Nullable
084    public static ImageSearchConfigRequest deepCopy(@Nullable final ImageSearchConfigRequest template) {
085        if (template == null) {
086            return null;
087        }
088        ImageSearchConfigRequestImpl instance = new ImageSearchConfigRequestImpl();
089        instance.setActions(Optional.ofNullable(template.getActions())
090                .map(t -> t.stream()
091                        .map(com.commercetools.ml.models.image_search_config.ImageSearchConfigUpdateAction::deepCopy)
092                        .collect(Collectors.toList()))
093                .orElse(null));
094        return instance;
095    }
096
097    /**
098     * builder factory method for ImageSearchConfigRequest
099     * @return builder
100     */
101    public static ImageSearchConfigRequestBuilder builder() {
102        return ImageSearchConfigRequestBuilder.of();
103    }
104
105    /**
106     * create builder for ImageSearchConfigRequest instance
107     * @param template instance with prefilled values for the builder
108     * @return builder
109     */
110    public static ImageSearchConfigRequestBuilder builder(final ImageSearchConfigRequest template) {
111        return ImageSearchConfigRequestBuilder.of(template);
112    }
113
114    /**
115     * accessor map function
116     * @param <T> mapped type
117     * @param helper function to map the object
118     * @return mapped value
119     */
120    default <T> T withImageSearchConfigRequest(Function<ImageSearchConfigRequest, T> helper) {
121        return helper.apply(this);
122    }
123
124    /**
125     * gives a TypeReference for usage with Jackson DataBind
126     * @return TypeReference
127     */
128    public static com.fasterxml.jackson.core.type.TypeReference<ImageSearchConfigRequest> typeReference() {
129        return new com.fasterxml.jackson.core.type.TypeReference<ImageSearchConfigRequest>() {
130            @Override
131            public String toString() {
132                return "TypeReference<ImageSearchConfigRequest>";
133            }
134        };
135    }
136}