001
002package com.commercetools.api.models.customer;
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 * CustomerSetAddressCustomFieldAction
018 *
019 * <hr>
020 * Example to create an instance using the builder pattern
021 * <div class=code-example>
022 * <pre><code class='java'>
023 *     CustomerSetAddressCustomFieldAction customerSetAddressCustomFieldAction = CustomerSetAddressCustomFieldAction.builder()
024 *             .addressId("{addressId}")
025 *             .name("{name}")
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 = CustomerSetAddressCustomFieldActionImpl.class)
032public interface CustomerSetAddressCustomFieldAction extends CustomerUpdateAction {
033
034    /**
035     * discriminator value for CustomerSetAddressCustomFieldAction
036     */
037    String SET_ADDRESS_CUSTOM_FIELD = "setAddressCustomField";
038
039    /**
040     *  <p>User-defined unique identifier of the Address to be updated.</p>
041     * @return addressId
042     */
043    @NotNull
044    @JsonProperty("addressId")
045    public String getAddressId();
046
047    /**
048     *  <p>Name of the Custom Field.</p>
049     * @return name
050     */
051    @NotNull
052    @JsonProperty("name")
053    public String getName();
054
055    /**
056     *  <p>If <code>value</code> is absent or <code>null</code>, this field will be removed if it exists. If <code>value</code> is provided, it is set for the field defined by <code>name</code>. Trying to remove a field that does not exist will fail with an InvalidOperation error.</p>
057     * @return value
058     */
059
060    @JsonProperty("value")
061    public Object getValue();
062
063    /**
064     *  <p>User-defined unique identifier of the Address to be updated.</p>
065     * @param addressId value to be set
066     */
067
068    public void setAddressId(final String addressId);
069
070    /**
071     *  <p>Name of the Custom Field.</p>
072     * @param name value to be set
073     */
074
075    public void setName(final String name);
076
077    /**
078     *  <p>If <code>value</code> is absent or <code>null</code>, this field will be removed if it exists. If <code>value</code> is provided, it is set for the field defined by <code>name</code>. Trying to remove a field that does not exist will fail with an InvalidOperation error.</p>
079     * @param value value to be set
080     */
081
082    public void setValue(final Object value);
083
084    /**
085     * factory method
086     * @return instance of CustomerSetAddressCustomFieldAction
087     */
088    public static CustomerSetAddressCustomFieldAction of() {
089        return new CustomerSetAddressCustomFieldActionImpl();
090    }
091
092    /**
093     * factory method to create a shallow copy CustomerSetAddressCustomFieldAction
094     * @param template instance to be copied
095     * @return copy instance
096     */
097    public static CustomerSetAddressCustomFieldAction of(final CustomerSetAddressCustomFieldAction template) {
098        CustomerSetAddressCustomFieldActionImpl instance = new CustomerSetAddressCustomFieldActionImpl();
099        instance.setAddressId(template.getAddressId());
100        instance.setName(template.getName());
101        instance.setValue(template.getValue());
102        return instance;
103    }
104
105    /**
106     * factory method to create a deep copy of CustomerSetAddressCustomFieldAction
107     * @param template instance to be copied
108     * @return copy instance
109     */
110    @Nullable
111    public static CustomerSetAddressCustomFieldAction deepCopy(
112            @Nullable final CustomerSetAddressCustomFieldAction template) {
113        if (template == null) {
114            return null;
115        }
116        CustomerSetAddressCustomFieldActionImpl instance = new CustomerSetAddressCustomFieldActionImpl();
117        instance.setAddressId(template.getAddressId());
118        instance.setName(template.getName());
119        instance.setValue(template.getValue());
120        return instance;
121    }
122
123    /**
124     * builder factory method for CustomerSetAddressCustomFieldAction
125     * @return builder
126     */
127    public static CustomerSetAddressCustomFieldActionBuilder builder() {
128        return CustomerSetAddressCustomFieldActionBuilder.of();
129    }
130
131    /**
132     * create builder for CustomerSetAddressCustomFieldAction instance
133     * @param template instance with prefilled values for the builder
134     * @return builder
135     */
136    public static CustomerSetAddressCustomFieldActionBuilder builder(
137            final CustomerSetAddressCustomFieldAction template) {
138        return CustomerSetAddressCustomFieldActionBuilder.of(template);
139    }
140
141    /**
142     * accessor map function
143     * @param <T> mapped type
144     * @param helper function to map the object
145     * @return mapped value
146     */
147    default <T> T withCustomerSetAddressCustomFieldAction(Function<CustomerSetAddressCustomFieldAction, T> helper) {
148        return helper.apply(this);
149    }
150
151    public static CustomerSetAddressCustomFieldAction ofUnset(final String name) {
152        return CustomerSetAddressCustomFieldActionBuilder.of().name(name).build();
153    }
154
155    /**
156     * gives a TypeReference for usage with Jackson DataBind
157     * @return TypeReference
158     */
159    public static com.fasterxml.jackson.core.type.TypeReference<CustomerSetAddressCustomFieldAction> typeReference() {
160        return new com.fasterxml.jackson.core.type.TypeReference<CustomerSetAddressCustomFieldAction>() {
161            @Override
162            public String toString() {
163                return "TypeReference<CustomerSetAddressCustomFieldAction>";
164            }
165        };
166    }
167}