001
002package com.commercetools.api.models.product_type;
003
004import java.time.*;
005import java.util.*;
006import java.util.function.Function;
007
008import javax.annotation.Nullable;
009import javax.validation.Valid;
010import javax.validation.constraints.NotNull;
011
012import com.fasterxml.jackson.annotation.*;
013import com.fasterxml.jackson.databind.annotation.*;
014
015import io.vrap.rmf.base.client.utils.Generated;
016
017/**
018 *  <p>Adds an enum to the values of AttributeEnumType AttributeDefinition, or AttributeSetType of AttributeEnumType AttributeDefinition.</p>
019 *
020 * <hr>
021 * Example to create an instance using the builder pattern
022 * <div class=code-example>
023 * <pre><code class='java'>
024 *     ProductTypeAddPlainEnumValueAction productTypeAddPlainEnumValueAction = ProductTypeAddPlainEnumValueAction.builder()
025 *             .attributeName("{attributeName}")
026 *             .value(valueBuilder -> valueBuilder)
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 = ProductTypeAddPlainEnumValueActionImpl.class)
033public interface ProductTypeAddPlainEnumValueAction extends ProductTypeUpdateAction {
034
035    /**
036     * discriminator value for ProductTypeAddPlainEnumValueAction
037     */
038    String ADD_PLAIN_ENUM_VALUE = "addPlainEnumValue";
039
040    /**
041     *  <p>Name of the AttributeDefinition to update.</p>
042     * @return attributeName
043     */
044    @NotNull
045    @JsonProperty("attributeName")
046    public String getAttributeName();
047
048    /**
049     *  <p>Value to append to the array.</p>
050     * @return value
051     */
052    @NotNull
053    @Valid
054    @JsonProperty("value")
055    public AttributePlainEnumValue getValue();
056
057    /**
058     *  <p>Name of the AttributeDefinition to update.</p>
059     * @param attributeName value to be set
060     */
061
062    public void setAttributeName(final String attributeName);
063
064    /**
065     *  <p>Value to append to the array.</p>
066     * @param value value to be set
067     */
068
069    public void setValue(final AttributePlainEnumValue value);
070
071    /**
072     * factory method
073     * @return instance of ProductTypeAddPlainEnumValueAction
074     */
075    public static ProductTypeAddPlainEnumValueAction of() {
076        return new ProductTypeAddPlainEnumValueActionImpl();
077    }
078
079    /**
080     * factory method to create a shallow copy ProductTypeAddPlainEnumValueAction
081     * @param template instance to be copied
082     * @return copy instance
083     */
084    public static ProductTypeAddPlainEnumValueAction of(final ProductTypeAddPlainEnumValueAction template) {
085        ProductTypeAddPlainEnumValueActionImpl instance = new ProductTypeAddPlainEnumValueActionImpl();
086        instance.setAttributeName(template.getAttributeName());
087        instance.setValue(template.getValue());
088        return instance;
089    }
090
091    /**
092     * factory method to create a deep copy of ProductTypeAddPlainEnumValueAction
093     * @param template instance to be copied
094     * @return copy instance
095     */
096    @Nullable
097    public static ProductTypeAddPlainEnumValueAction deepCopy(
098            @Nullable final ProductTypeAddPlainEnumValueAction template) {
099        if (template == null) {
100            return null;
101        }
102        ProductTypeAddPlainEnumValueActionImpl instance = new ProductTypeAddPlainEnumValueActionImpl();
103        instance.setAttributeName(template.getAttributeName());
104        instance.setValue(
105            com.commercetools.api.models.product_type.AttributePlainEnumValue.deepCopy(template.getValue()));
106        return instance;
107    }
108
109    /**
110     * builder factory method for ProductTypeAddPlainEnumValueAction
111     * @return builder
112     */
113    public static ProductTypeAddPlainEnumValueActionBuilder builder() {
114        return ProductTypeAddPlainEnumValueActionBuilder.of();
115    }
116
117    /**
118     * create builder for ProductTypeAddPlainEnumValueAction instance
119     * @param template instance with prefilled values for the builder
120     * @return builder
121     */
122    public static ProductTypeAddPlainEnumValueActionBuilder builder(final ProductTypeAddPlainEnumValueAction template) {
123        return ProductTypeAddPlainEnumValueActionBuilder.of(template);
124    }
125
126    /**
127     * accessor map function
128     * @param <T> mapped type
129     * @param helper function to map the object
130     * @return mapped value
131     */
132    default <T> T withProductTypeAddPlainEnumValueAction(Function<ProductTypeAddPlainEnumValueAction, T> helper) {
133        return helper.apply(this);
134    }
135
136    /**
137     * gives a TypeReference for usage with Jackson DataBind
138     * @return TypeReference
139     */
140    public static com.fasterxml.jackson.core.type.TypeReference<ProductTypeAddPlainEnumValueAction> typeReference() {
141        return new com.fasterxml.jackson.core.type.TypeReference<ProductTypeAddPlainEnumValueAction>() {
142            @Override
143            public String toString() {
144                return "TypeReference<ProductTypeAddPlainEnumValueAction>";
145            }
146        };
147    }
148}