001
002package com.commercetools.api.models.subscription;
003
004import java.time.*;
005import java.util.*;
006
007import com.fasterxml.jackson.annotation.JsonCreator;
008import com.fasterxml.jackson.annotation.JsonProperty;
009import com.fasterxml.jackson.databind.annotation.*;
010
011import io.vrap.rmf.base.client.ModelBase;
012import io.vrap.rmf.base.client.utils.Generated;
013
014import org.apache.commons.lang3.builder.EqualsBuilder;
015import org.apache.commons.lang3.builder.HashCodeBuilder;
016
017/**
018 *  <p>This payload is sent for a MessageSubscription.</p>
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class MessageDeliveryPayloadImpl implements MessageDeliveryPayload, ModelBase {
022
023    private String projectKey;
024
025    private String notificationType;
026
027    private com.commercetools.api.models.common.Reference resource;
028
029    private com.commercetools.api.models.message.UserProvidedIdentifiers resourceUserProvidedIdentifiers;
030
031    private String id;
032
033    private Long version;
034
035    private java.time.ZonedDateTime createdAt;
036
037    private java.time.ZonedDateTime lastModifiedAt;
038
039    private Long sequenceNumber;
040
041    private Long resourceVersion;
042
043    private com.commercetools.api.models.subscription.PayloadNotIncluded payloadNotIncluded;
044
045    /**
046     * create instance with all properties
047     */
048    @JsonCreator
049    MessageDeliveryPayloadImpl(@JsonProperty("projectKey") final String projectKey,
050            @JsonProperty("resource") final com.commercetools.api.models.common.Reference resource,
051            @JsonProperty("resourceUserProvidedIdentifiers") final com.commercetools.api.models.message.UserProvidedIdentifiers resourceUserProvidedIdentifiers,
052            @JsonProperty("id") final String id, @JsonProperty("version") final Long version,
053            @JsonProperty("createdAt") final java.time.ZonedDateTime createdAt,
054            @JsonProperty("lastModifiedAt") final java.time.ZonedDateTime lastModifiedAt,
055            @JsonProperty("sequenceNumber") final Long sequenceNumber,
056            @JsonProperty("resourceVersion") final Long resourceVersion,
057            @JsonProperty("payloadNotIncluded") final com.commercetools.api.models.subscription.PayloadNotIncluded payloadNotIncluded) {
058        this.projectKey = projectKey;
059        this.resource = resource;
060        this.resourceUserProvidedIdentifiers = resourceUserProvidedIdentifiers;
061        this.id = id;
062        this.version = version;
063        this.createdAt = createdAt;
064        this.lastModifiedAt = lastModifiedAt;
065        this.sequenceNumber = sequenceNumber;
066        this.resourceVersion = resourceVersion;
067        this.payloadNotIncluded = payloadNotIncluded;
068        this.notificationType = MESSAGE;
069    }
070
071    /**
072     * create empty instance
073     */
074    public MessageDeliveryPayloadImpl() {
075        this.notificationType = MESSAGE;
076    }
077
078    /**
079     *  <p><code>key</code> of the Project. Useful in message processing if the Destination receives events from multiple Projects.</p>
080     */
081
082    public String getProjectKey() {
083        return this.projectKey;
084    }
085
086    /**
087     *  <p>Identifies the payload.</p>
088     */
089
090    public String getNotificationType() {
091        return this.notificationType;
092    }
093
094    /**
095     *  <p>Reference to the resource that triggered the message.</p>
096     */
097
098    public com.commercetools.api.models.common.Reference getResource() {
099        return this.resource;
100    }
101
102    /**
103     *  <p>User-defined unique identifiers of the resource.</p>
104     */
105
106    public com.commercetools.api.models.message.UserProvidedIdentifiers getResourceUserProvidedIdentifiers() {
107        return this.resourceUserProvidedIdentifiers;
108    }
109
110    /**
111     *  <p>Unique ID of the message.</p>
112     */
113
114    public String getId() {
115        return this.id;
116    }
117
118    /**
119     *  <p>Last seen version of the resource.</p>
120     */
121
122    public Long getVersion() {
123        return this.version;
124    }
125
126    /**
127     *  <p>Date and time (UTC) the resource was initially created.</p>
128     */
129
130    public java.time.ZonedDateTime getCreatedAt() {
131        return this.createdAt;
132    }
133
134    /**
135     *  <p>Date and time (UTC) the resource was last modified.</p>
136     */
137
138    public java.time.ZonedDateTime getLastModifiedAt() {
139        return this.lastModifiedAt;
140    }
141
142    /**
143     *  <p>Used to ensure all messages of the resource are processed in correct order. The <code>sequenceNumber</code> of the next message of the resource is a successor of the <code>sequenceNumber</code> of the current message.</p>
144     */
145
146    public Long getSequenceNumber() {
147        return this.sequenceNumber;
148    }
149
150    /**
151     *  <p>Version of the resource on which the change was performed.</p>
152     */
153
154    public Long getResourceVersion() {
155        return this.resourceVersion;
156    }
157
158    /**
159     *  <p>If the payload does not fit into the size limit or its format is not accepted by the messaging service, the <code>payloadNotIncluded</code> field is present.</p>
160     */
161
162    public com.commercetools.api.models.subscription.PayloadNotIncluded getPayloadNotIncluded() {
163        return this.payloadNotIncluded;
164    }
165
166    public void setProjectKey(final String projectKey) {
167        this.projectKey = projectKey;
168    }
169
170    public void setResource(final com.commercetools.api.models.common.Reference resource) {
171        this.resource = resource;
172    }
173
174    public void setResourceUserProvidedIdentifiers(
175            final com.commercetools.api.models.message.UserProvidedIdentifiers resourceUserProvidedIdentifiers) {
176        this.resourceUserProvidedIdentifiers = resourceUserProvidedIdentifiers;
177    }
178
179    public void setId(final String id) {
180        this.id = id;
181    }
182
183    public void setVersion(final Long version) {
184        this.version = version;
185    }
186
187    public void setCreatedAt(final java.time.ZonedDateTime createdAt) {
188        this.createdAt = createdAt;
189    }
190
191    public void setLastModifiedAt(final java.time.ZonedDateTime lastModifiedAt) {
192        this.lastModifiedAt = lastModifiedAt;
193    }
194
195    public void setSequenceNumber(final Long sequenceNumber) {
196        this.sequenceNumber = sequenceNumber;
197    }
198
199    public void setResourceVersion(final Long resourceVersion) {
200        this.resourceVersion = resourceVersion;
201    }
202
203    public void setPayloadNotIncluded(
204            final com.commercetools.api.models.subscription.PayloadNotIncluded payloadNotIncluded) {
205        this.payloadNotIncluded = payloadNotIncluded;
206    }
207
208    @Override
209    public boolean equals(Object o) {
210        if (this == o)
211            return true;
212
213        if (o == null || getClass() != o.getClass())
214            return false;
215
216        MessageDeliveryPayloadImpl that = (MessageDeliveryPayloadImpl) o;
217
218        return new EqualsBuilder().append(projectKey, that.projectKey)
219                .append(notificationType, that.notificationType)
220                .append(resource, that.resource)
221                .append(resourceUserProvidedIdentifiers, that.resourceUserProvidedIdentifiers)
222                .append(id, that.id)
223                .append(version, that.version)
224                .append(createdAt, that.createdAt)
225                .append(lastModifiedAt, that.lastModifiedAt)
226                .append(sequenceNumber, that.sequenceNumber)
227                .append(resourceVersion, that.resourceVersion)
228                .append(payloadNotIncluded, that.payloadNotIncluded)
229                .isEquals();
230    }
231
232    @Override
233    public int hashCode() {
234        return new HashCodeBuilder(17, 37).append(projectKey)
235                .append(notificationType)
236                .append(resource)
237                .append(resourceUserProvidedIdentifiers)
238                .append(id)
239                .append(version)
240                .append(createdAt)
241                .append(lastModifiedAt)
242                .append(sequenceNumber)
243                .append(resourceVersion)
244                .append(payloadNotIncluded)
245                .toHashCode();
246    }
247
248}