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 *  <p>Changing the email of the Customer produces the CustomerEmailChanged Message.</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 *     CustomerChangeEmailAction customerChangeEmailAction = CustomerChangeEmailAction.builder()
024 *             .email("{email}")
025 *             .build()
026 * </code></pre>
027 * </div>
028 */
029@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
030@JsonDeserialize(as = CustomerChangeEmailActionImpl.class)
031public interface CustomerChangeEmailAction extends CustomerUpdateAction {
032
033    /**
034     * discriminator value for CustomerChangeEmailAction
035     */
036    String CHANGE_EMAIL = "changeEmail";
037
038    /**
039     *  <p>Value to set.</p>
040     * @return email
041     */
042    @NotNull
043    @JsonProperty("email")
044    public String getEmail();
045
046    /**
047     *  <p>Value to set.</p>
048     * @param email value to be set
049     */
050
051    public void setEmail(final String email);
052
053    /**
054     * factory method
055     * @return instance of CustomerChangeEmailAction
056     */
057    public static CustomerChangeEmailAction of() {
058        return new CustomerChangeEmailActionImpl();
059    }
060
061    /**
062     * factory method to create a shallow copy CustomerChangeEmailAction
063     * @param template instance to be copied
064     * @return copy instance
065     */
066    public static CustomerChangeEmailAction of(final CustomerChangeEmailAction template) {
067        CustomerChangeEmailActionImpl instance = new CustomerChangeEmailActionImpl();
068        instance.setEmail(template.getEmail());
069        return instance;
070    }
071
072    /**
073     * factory method to create a deep copy of CustomerChangeEmailAction
074     * @param template instance to be copied
075     * @return copy instance
076     */
077    @Nullable
078    public static CustomerChangeEmailAction deepCopy(@Nullable final CustomerChangeEmailAction template) {
079        if (template == null) {
080            return null;
081        }
082        CustomerChangeEmailActionImpl instance = new CustomerChangeEmailActionImpl();
083        instance.setEmail(template.getEmail());
084        return instance;
085    }
086
087    /**
088     * builder factory method for CustomerChangeEmailAction
089     * @return builder
090     */
091    public static CustomerChangeEmailActionBuilder builder() {
092        return CustomerChangeEmailActionBuilder.of();
093    }
094
095    /**
096     * create builder for CustomerChangeEmailAction instance
097     * @param template instance with prefilled values for the builder
098     * @return builder
099     */
100    public static CustomerChangeEmailActionBuilder builder(final CustomerChangeEmailAction template) {
101        return CustomerChangeEmailActionBuilder.of(template);
102    }
103
104    /**
105     * accessor map function
106     * @param <T> mapped type
107     * @param helper function to map the object
108     * @return mapped value
109     */
110    default <T> T withCustomerChangeEmailAction(Function<CustomerChangeEmailAction, T> helper) {
111        return helper.apply(this);
112    }
113
114    /**
115     * gives a TypeReference for usage with Jackson DataBind
116     * @return TypeReference
117     */
118    public static com.fasterxml.jackson.core.type.TypeReference<CustomerChangeEmailAction> typeReference() {
119        return new com.fasterxml.jackson.core.type.TypeReference<CustomerChangeEmailAction>() {
120            @Override
121            public String toString() {
122                return "TypeReference<CustomerChangeEmailAction>";
123            }
124        };
125    }
126}