001
002package com.commercetools.api.models.message;
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>Defines the configuration for the Messages Query feature for the Project.</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 *     MessagesConfigurationDraft messagesConfigurationDraft = MessagesConfigurationDraft.builder()
024 *             .enabled(true)
025 *             .deleteDaysAfterCreation(0.3)
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 = MessagesConfigurationDraftImpl.class)
032public interface MessagesConfigurationDraft extends io.vrap.rmf.base.client.Draft<MessagesConfigurationDraft> {
033
034    /**
035     *  <p>Setting to <code>true</code> activates the Messages Query feature.</p>
036     * @return enabled
037     */
038    @NotNull
039    @JsonProperty("enabled")
040    public Boolean getEnabled();
041
042    /**
043     *  <p>Specifies the number of days each Message should be available via the Messages Query API. For Messages older than the specified period, it is not guaranteed that they are still accessible via the API.</p>
044     * @return deleteDaysAfterCreation
045     */
046    @NotNull
047    @JsonProperty("deleteDaysAfterCreation")
048    public Integer getDeleteDaysAfterCreation();
049
050    /**
051     *  <p>Setting to <code>true</code> activates the Messages Query feature.</p>
052     * @param enabled value to be set
053     */
054
055    public void setEnabled(final Boolean enabled);
056
057    /**
058     *  <p>Specifies the number of days each Message should be available via the Messages Query API. For Messages older than the specified period, it is not guaranteed that they are still accessible via the API.</p>
059     * @param deleteDaysAfterCreation value to be set
060     */
061
062    public void setDeleteDaysAfterCreation(final Integer deleteDaysAfterCreation);
063
064    /**
065     * factory method
066     * @return instance of MessagesConfigurationDraft
067     */
068    public static MessagesConfigurationDraft of() {
069        return new MessagesConfigurationDraftImpl();
070    }
071
072    /**
073     * factory method to create a shallow copy MessagesConfigurationDraft
074     * @param template instance to be copied
075     * @return copy instance
076     */
077    public static MessagesConfigurationDraft of(final MessagesConfigurationDraft template) {
078        MessagesConfigurationDraftImpl instance = new MessagesConfigurationDraftImpl();
079        instance.setEnabled(template.getEnabled());
080        instance.setDeleteDaysAfterCreation(template.getDeleteDaysAfterCreation());
081        return instance;
082    }
083
084    /**
085     * factory method to create a deep copy of MessagesConfigurationDraft
086     * @param template instance to be copied
087     * @return copy instance
088     */
089    @Nullable
090    public static MessagesConfigurationDraft deepCopy(@Nullable final MessagesConfigurationDraft template) {
091        if (template == null) {
092            return null;
093        }
094        MessagesConfigurationDraftImpl instance = new MessagesConfigurationDraftImpl();
095        instance.setEnabled(template.getEnabled());
096        instance.setDeleteDaysAfterCreation(template.getDeleteDaysAfterCreation());
097        return instance;
098    }
099
100    /**
101     * builder factory method for MessagesConfigurationDraft
102     * @return builder
103     */
104    public static MessagesConfigurationDraftBuilder builder() {
105        return MessagesConfigurationDraftBuilder.of();
106    }
107
108    /**
109     * create builder for MessagesConfigurationDraft instance
110     * @param template instance with prefilled values for the builder
111     * @return builder
112     */
113    public static MessagesConfigurationDraftBuilder builder(final MessagesConfigurationDraft template) {
114        return MessagesConfigurationDraftBuilder.of(template);
115    }
116
117    /**
118     * accessor map function
119     * @param <T> mapped type
120     * @param helper function to map the object
121     * @return mapped value
122     */
123    default <T> T withMessagesConfigurationDraft(Function<MessagesConfigurationDraft, T> helper) {
124        return helper.apply(this);
125    }
126
127    /**
128     * gives a TypeReference for usage with Jackson DataBind
129     * @return TypeReference
130     */
131    public static com.fasterxml.jackson.core.type.TypeReference<MessagesConfigurationDraft> typeReference() {
132        return new com.fasterxml.jackson.core.type.TypeReference<MessagesConfigurationDraft>() {
133            @Override
134            public String toString() {
135                return "TypeReference<MessagesConfigurationDraft>";
136            }
137        };
138    }
139}