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.Valid;
010import javax.validation.constraints.NotNull;
011
012import com.commercetools.api.models.type.CustomFields;
013import com.fasterxml.jackson.annotation.*;
014import com.fasterxml.jackson.databind.annotation.*;
015
016import io.vrap.rmf.base.client.utils.Generated;
017
018/**
019 *  <p>Generated after a successful Add InterfaceInteraction update action.</p>
020 *
021 * <hr>
022 * Example to create an instance using the builder pattern
023 * <div class=code-example>
024 * <pre><code class='java'>
025 *     PaymentInteractionAddedMessage paymentInteractionAddedMessage = PaymentInteractionAddedMessage.builder()
026 *             .id("{id}")
027 *             .version(0.3)
028 *             .createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
029 *             .lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
030 *             .sequenceNumber(0.3)
031 *             .resource(resourceBuilder -> resourceBuilder)
032 *             .resourceVersion(0.3)
033 *             .interaction(interactionBuilder -> interactionBuilder)
034 *             .build()
035 * </code></pre>
036 * </div>
037 */
038@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
039@JsonDeserialize(as = PaymentInteractionAddedMessageImpl.class)
040public interface PaymentInteractionAddedMessage extends Message {
041
042    /**
043     * discriminator value for PaymentInteractionAddedMessage
044     */
045    String PAYMENT_INTERACTION_ADDED = "PaymentInteractionAdded";
046
047    /**
048     *  <p>The interface interaction that was added to the Payment.</p>
049     * @return interaction
050     */
051    @NotNull
052    @Valid
053    @JsonProperty("interaction")
054    public CustomFields getInteraction();
055
056    /**
057     *  <p>The interface interaction that was added to the Payment.</p>
058     * @param interaction value to be set
059     */
060
061    public void setInteraction(final CustomFields interaction);
062
063    /**
064     * factory method
065     * @return instance of PaymentInteractionAddedMessage
066     */
067    public static PaymentInteractionAddedMessage of() {
068        return new PaymentInteractionAddedMessageImpl();
069    }
070
071    /**
072     * factory method to create a shallow copy PaymentInteractionAddedMessage
073     * @param template instance to be copied
074     * @return copy instance
075     */
076    public static PaymentInteractionAddedMessage of(final PaymentInteractionAddedMessage template) {
077        PaymentInteractionAddedMessageImpl instance = new PaymentInteractionAddedMessageImpl();
078        instance.setId(template.getId());
079        instance.setVersion(template.getVersion());
080        instance.setCreatedAt(template.getCreatedAt());
081        instance.setLastModifiedAt(template.getLastModifiedAt());
082        instance.setLastModifiedBy(template.getLastModifiedBy());
083        instance.setCreatedBy(template.getCreatedBy());
084        instance.setSequenceNumber(template.getSequenceNumber());
085        instance.setResource(template.getResource());
086        instance.setResourceVersion(template.getResourceVersion());
087        instance.setResourceUserProvidedIdentifiers(template.getResourceUserProvidedIdentifiers());
088        instance.setInteraction(template.getInteraction());
089        return instance;
090    }
091
092    /**
093     * factory method to create a deep copy of PaymentInteractionAddedMessage
094     * @param template instance to be copied
095     * @return copy instance
096     */
097    @Nullable
098    public static PaymentInteractionAddedMessage deepCopy(@Nullable final PaymentInteractionAddedMessage template) {
099        if (template == null) {
100            return null;
101        }
102        PaymentInteractionAddedMessageImpl instance = new PaymentInteractionAddedMessageImpl();
103        instance.setId(template.getId());
104        instance.setVersion(template.getVersion());
105        instance.setCreatedAt(template.getCreatedAt());
106        instance.setLastModifiedAt(template.getLastModifiedAt());
107        instance.setLastModifiedBy(
108            com.commercetools.api.models.common.LastModifiedBy.deepCopy(template.getLastModifiedBy()));
109        instance.setCreatedBy(com.commercetools.api.models.common.CreatedBy.deepCopy(template.getCreatedBy()));
110        instance.setSequenceNumber(template.getSequenceNumber());
111        instance.setResource(com.commercetools.api.models.common.Reference.deepCopy(template.getResource()));
112        instance.setResourceVersion(template.getResourceVersion());
113        instance.setResourceUserProvidedIdentifiers(com.commercetools.api.models.message.UserProvidedIdentifiers
114                .deepCopy(template.getResourceUserProvidedIdentifiers()));
115        instance.setInteraction(com.commercetools.api.models.type.CustomFields.deepCopy(template.getInteraction()));
116        return instance;
117    }
118
119    /**
120     * builder factory method for PaymentInteractionAddedMessage
121     * @return builder
122     */
123    public static PaymentInteractionAddedMessageBuilder builder() {
124        return PaymentInteractionAddedMessageBuilder.of();
125    }
126
127    /**
128     * create builder for PaymentInteractionAddedMessage instance
129     * @param template instance with prefilled values for the builder
130     * @return builder
131     */
132    public static PaymentInteractionAddedMessageBuilder builder(final PaymentInteractionAddedMessage template) {
133        return PaymentInteractionAddedMessageBuilder.of(template);
134    }
135
136    /**
137     * accessor map function
138     * @param <T> mapped type
139     * @param helper function to map the object
140     * @return mapped value
141     */
142    default <T> T withPaymentInteractionAddedMessage(Function<PaymentInteractionAddedMessage, T> helper) {
143        return helper.apply(this);
144    }
145
146    /**
147     * gives a TypeReference for usage with Jackson DataBind
148     * @return TypeReference
149     */
150    public static com.fasterxml.jackson.core.type.TypeReference<PaymentInteractionAddedMessage> typeReference() {
151        return new com.fasterxml.jackson.core.type.TypeReference<PaymentInteractionAddedMessage>() {
152            @Override
153            public String toString() {
154                return "TypeReference<PaymentInteractionAddedMessage>";
155            }
156        };
157    }
158}