001
002package com.commercetools.api.models.payment;
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.commercetools.api.models.type.FieldContainer;
013import com.commercetools.api.models.type.TypeResourceIdentifier;
014import com.fasterxml.jackson.annotation.*;
015import com.fasterxml.jackson.databind.annotation.*;
016
017import io.vrap.rmf.base.client.utils.Generated;
018
019/**
020 *  <p>Adding a Payment interaction generates the PaymentInteractionAdded Message.</p>
021 *
022 * <hr>
023 * Example to create an instance using the builder pattern
024 * <div class=code-example>
025 * <pre><code class='java'>
026 *     PaymentAddInterfaceInteractionAction paymentAddInterfaceInteractionAction = PaymentAddInterfaceInteractionAction.builder()
027 *             .type(typeBuilder -> typeBuilder)
028 *             .build()
029 * </code></pre>
030 * </div>
031 */
032@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
033@JsonDeserialize(as = PaymentAddInterfaceInteractionActionImpl.class)
034public interface PaymentAddInterfaceInteractionAction extends PaymentUpdateAction {
035
036    /**
037     * discriminator value for PaymentAddInterfaceInteractionAction
038     */
039    String ADD_INTERFACE_INTERACTION = "addInterfaceInteraction";
040
041    /**
042     *  <p>ResourceIdentifier of a Type.</p>
043     * @return type
044     */
045    @NotNull
046    @Valid
047    @JsonProperty("type")
048    public TypeResourceIdentifier getType();
049
050    /**
051     *  <p>Custom Fields as per FieldDefinitions of the Type.</p>
052     * @return fields
053     */
054    @Valid
055    @JsonProperty("fields")
056    public FieldContainer getFields();
057
058    /**
059     *  <p>ResourceIdentifier of a Type.</p>
060     * @param type value to be set
061     */
062
063    public void setType(final TypeResourceIdentifier type);
064
065    /**
066     *  <p>Custom Fields as per FieldDefinitions of the Type.</p>
067     * @param fields value to be set
068     */
069
070    public void setFields(final FieldContainer fields);
071
072    /**
073     * factory method
074     * @return instance of PaymentAddInterfaceInteractionAction
075     */
076    public static PaymentAddInterfaceInteractionAction of() {
077        return new PaymentAddInterfaceInteractionActionImpl();
078    }
079
080    /**
081     * factory method to create a shallow copy PaymentAddInterfaceInteractionAction
082     * @param template instance to be copied
083     * @return copy instance
084     */
085    public static PaymentAddInterfaceInteractionAction of(final PaymentAddInterfaceInteractionAction template) {
086        PaymentAddInterfaceInteractionActionImpl instance = new PaymentAddInterfaceInteractionActionImpl();
087        instance.setType(template.getType());
088        instance.setFields(template.getFields());
089        return instance;
090    }
091
092    /**
093     * factory method to create a deep copy of PaymentAddInterfaceInteractionAction
094     * @param template instance to be copied
095     * @return copy instance
096     */
097    @Nullable
098    public static PaymentAddInterfaceInteractionAction deepCopy(
099            @Nullable final PaymentAddInterfaceInteractionAction template) {
100        if (template == null) {
101            return null;
102        }
103        PaymentAddInterfaceInteractionActionImpl instance = new PaymentAddInterfaceInteractionActionImpl();
104        instance.setType(com.commercetools.api.models.type.TypeResourceIdentifier.deepCopy(template.getType()));
105        instance.setFields(com.commercetools.api.models.type.FieldContainer.deepCopy(template.getFields()));
106        return instance;
107    }
108
109    /**
110     * builder factory method for PaymentAddInterfaceInteractionAction
111     * @return builder
112     */
113    public static PaymentAddInterfaceInteractionActionBuilder builder() {
114        return PaymentAddInterfaceInteractionActionBuilder.of();
115    }
116
117    /**
118     * create builder for PaymentAddInterfaceInteractionAction instance
119     * @param template instance with prefilled values for the builder
120     * @return builder
121     */
122    public static PaymentAddInterfaceInteractionActionBuilder builder(
123            final PaymentAddInterfaceInteractionAction template) {
124        return PaymentAddInterfaceInteractionActionBuilder.of(template);
125    }
126
127    /**
128     * accessor map function
129     * @param <T> mapped type
130     * @param helper function to map the object
131     * @return mapped value
132     */
133    default <T> T withPaymentAddInterfaceInteractionAction(Function<PaymentAddInterfaceInteractionAction, T> helper) {
134        return helper.apply(this);
135    }
136
137    /**
138     * gives a TypeReference for usage with Jackson DataBind
139     * @return TypeReference
140     */
141    public static com.fasterxml.jackson.core.type.TypeReference<PaymentAddInterfaceInteractionAction> typeReference() {
142        return new com.fasterxml.jackson.core.type.TypeReference<PaymentAddInterfaceInteractionAction>() {
143            @Override
144            public String toString() {
145                return "TypeReference<PaymentAddInterfaceInteractionAction>";
146            }
147        };
148    }
149}