001 002package com.commercetools.api.models.message; 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>Generated after a successful Add Distribution Channel, Remove Distribution Channel, or Set Distribution Channels update action.</p> 019 */ 020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 021public class StoreDistributionChannelsChangedMessageImpl implements StoreDistributionChannelsChangedMessage, ModelBase { 022 023 private String id; 024 025 private Long version; 026 027 private java.time.ZonedDateTime createdAt; 028 029 private java.time.ZonedDateTime lastModifiedAt; 030 031 private com.commercetools.api.models.common.LastModifiedBy lastModifiedBy; 032 033 private com.commercetools.api.models.common.CreatedBy createdBy; 034 035 private Long sequenceNumber; 036 037 private com.commercetools.api.models.common.Reference resource; 038 039 private Long resourceVersion; 040 041 private String type; 042 043 private com.commercetools.api.models.message.UserProvidedIdentifiers resourceUserProvidedIdentifiers; 044 045 private java.util.List<com.commercetools.api.models.channel.ChannelReference> addedDistributionChannels; 046 047 private java.util.List<com.commercetools.api.models.channel.ChannelReference> removedDistributionChannels; 048 049 /** 050 * create instance with all properties 051 */ 052 @JsonCreator 053 StoreDistributionChannelsChangedMessageImpl(@JsonProperty("id") final String id, 054 @JsonProperty("version") final Long version, 055 @JsonProperty("createdAt") final java.time.ZonedDateTime createdAt, 056 @JsonProperty("lastModifiedAt") final java.time.ZonedDateTime lastModifiedAt, 057 @JsonProperty("lastModifiedBy") final com.commercetools.api.models.common.LastModifiedBy lastModifiedBy, 058 @JsonProperty("createdBy") final com.commercetools.api.models.common.CreatedBy createdBy, 059 @JsonProperty("sequenceNumber") final Long sequenceNumber, 060 @JsonProperty("resource") final com.commercetools.api.models.common.Reference resource, 061 @JsonProperty("resourceVersion") final Long resourceVersion, 062 @JsonProperty("resourceUserProvidedIdentifiers") final com.commercetools.api.models.message.UserProvidedIdentifiers resourceUserProvidedIdentifiers, 063 @JsonProperty("addedDistributionChannels") final java.util.List<com.commercetools.api.models.channel.ChannelReference> addedDistributionChannels, 064 @JsonProperty("removedDistributionChannels") final java.util.List<com.commercetools.api.models.channel.ChannelReference> removedDistributionChannels) { 065 this.id = id; 066 this.version = version; 067 this.createdAt = createdAt; 068 this.lastModifiedAt = lastModifiedAt; 069 this.lastModifiedBy = lastModifiedBy; 070 this.createdBy = createdBy; 071 this.sequenceNumber = sequenceNumber; 072 this.resource = resource; 073 this.resourceVersion = resourceVersion; 074 this.resourceUserProvidedIdentifiers = resourceUserProvidedIdentifiers; 075 this.addedDistributionChannels = addedDistributionChannels; 076 this.removedDistributionChannels = removedDistributionChannels; 077 this.type = STORE_DISTRIBUTION_CHANNELS_CHANGED; 078 } 079 080 /** 081 * create empty instance 082 */ 083 public StoreDistributionChannelsChangedMessageImpl() { 084 this.type = STORE_DISTRIBUTION_CHANNELS_CHANGED; 085 } 086 087 /** 088 * <p>Unique identifier of the Message. Can be used to track which Messages have been processed.</p> 089 */ 090 091 public String getId() { 092 return this.id; 093 } 094 095 /** 096 * <p>Version of a resource. In case of Messages, this is always <code>1</code>.</p> 097 */ 098 099 public Long getVersion() { 100 return this.version; 101 } 102 103 /** 104 * <p>Date and time (UTC) the Message was generated.</p> 105 */ 106 107 public java.time.ZonedDateTime getCreatedAt() { 108 return this.createdAt; 109 } 110 111 /** 112 * <p>Value of <code>createdAt</code>.</p> 113 */ 114 115 public java.time.ZonedDateTime getLastModifiedAt() { 116 return this.lastModifiedAt; 117 } 118 119 /** 120 * <p>Value of <code>createdBy</code>.</p> 121 */ 122 123 public com.commercetools.api.models.common.LastModifiedBy getLastModifiedBy() { 124 return this.lastModifiedBy; 125 } 126 127 /** 128 * <p>Present on resources created after 1 February 2019 except for events not tracked.</p> 129 */ 130 131 public com.commercetools.api.models.common.CreatedBy getCreatedBy() { 132 return this.createdBy; 133 } 134 135 /** 136 * <p>Message number in relation to other Messages for a given resource. The <code>sequenceNumber</code> of the next Message for the resource is the successor of the <code>sequenceNumber</code> of the current Message. Meaning, the <code>sequenceNumber</code> of the next Message equals the <code>sequenceNumber</code> of the current Message + 1. <code>sequenceNumber</code> can be used to ensure that Messages are processed in the correct order for a particular resource.</p> 137 */ 138 139 public Long getSequenceNumber() { 140 return this.sequenceNumber; 141 } 142 143 /** 144 * <p>Reference to the resource on which the change or action was performed.</p> 145 */ 146 147 public com.commercetools.api.models.common.Reference getResource() { 148 return this.resource; 149 } 150 151 /** 152 * <p>Version of the resource on which the change or action was performed.</p> 153 */ 154 155 public Long getResourceVersion() { 156 return this.resourceVersion; 157 } 158 159 /** 160 * <p>Message Type of the Message.</p> 161 */ 162 163 public String getType() { 164 return this.type; 165 } 166 167 /** 168 * <p>User-provided identifiers of the resource, such as <code>key</code> or <code>externalId</code>. Only present if the resource has such identifiers.</p> 169 */ 170 171 public com.commercetools.api.models.message.UserProvidedIdentifiers getResourceUserProvidedIdentifiers() { 172 return this.resourceUserProvidedIdentifiers; 173 } 174 175 /** 176 * <p>Product distribution Channels that have been added to the Store.</p> 177 */ 178 179 public java.util.List<com.commercetools.api.models.channel.ChannelReference> getAddedDistributionChannels() { 180 return this.addedDistributionChannels; 181 } 182 183 /** 184 * <p>Product distribution Channels that have been removed from the Store.</p> 185 */ 186 187 public java.util.List<com.commercetools.api.models.channel.ChannelReference> getRemovedDistributionChannels() { 188 return this.removedDistributionChannels; 189 } 190 191 public void setId(final String id) { 192 this.id = id; 193 } 194 195 public void setVersion(final Long version) { 196 this.version = version; 197 } 198 199 public void setCreatedAt(final java.time.ZonedDateTime createdAt) { 200 this.createdAt = createdAt; 201 } 202 203 public void setLastModifiedAt(final java.time.ZonedDateTime lastModifiedAt) { 204 this.lastModifiedAt = lastModifiedAt; 205 } 206 207 public void setLastModifiedBy(final com.commercetools.api.models.common.LastModifiedBy lastModifiedBy) { 208 this.lastModifiedBy = lastModifiedBy; 209 } 210 211 public void setCreatedBy(final com.commercetools.api.models.common.CreatedBy createdBy) { 212 this.createdBy = createdBy; 213 } 214 215 public void setSequenceNumber(final Long sequenceNumber) { 216 this.sequenceNumber = sequenceNumber; 217 } 218 219 public void setResource(final com.commercetools.api.models.common.Reference resource) { 220 this.resource = resource; 221 } 222 223 public void setResourceVersion(final Long resourceVersion) { 224 this.resourceVersion = resourceVersion; 225 } 226 227 public void setResourceUserProvidedIdentifiers( 228 final com.commercetools.api.models.message.UserProvidedIdentifiers resourceUserProvidedIdentifiers) { 229 this.resourceUserProvidedIdentifiers = resourceUserProvidedIdentifiers; 230 } 231 232 public void setAddedDistributionChannels( 233 final com.commercetools.api.models.channel.ChannelReference... addedDistributionChannels) { 234 this.addedDistributionChannels = new ArrayList<>(Arrays.asList(addedDistributionChannels)); 235 } 236 237 public void setAddedDistributionChannels( 238 final java.util.List<com.commercetools.api.models.channel.ChannelReference> addedDistributionChannels) { 239 this.addedDistributionChannels = addedDistributionChannels; 240 } 241 242 public void setRemovedDistributionChannels( 243 final com.commercetools.api.models.channel.ChannelReference... removedDistributionChannels) { 244 this.removedDistributionChannels = new ArrayList<>(Arrays.asList(removedDistributionChannels)); 245 } 246 247 public void setRemovedDistributionChannels( 248 final java.util.List<com.commercetools.api.models.channel.ChannelReference> removedDistributionChannels) { 249 this.removedDistributionChannels = removedDistributionChannels; 250 } 251 252 @Override 253 public boolean equals(Object o) { 254 if (this == o) 255 return true; 256 257 if (o == null || getClass() != o.getClass()) 258 return false; 259 260 StoreDistributionChannelsChangedMessageImpl that = (StoreDistributionChannelsChangedMessageImpl) o; 261 262 return new EqualsBuilder().append(id, that.id) 263 .append(version, that.version) 264 .append(createdAt, that.createdAt) 265 .append(lastModifiedAt, that.lastModifiedAt) 266 .append(lastModifiedBy, that.lastModifiedBy) 267 .append(createdBy, that.createdBy) 268 .append(sequenceNumber, that.sequenceNumber) 269 .append(resource, that.resource) 270 .append(resourceVersion, that.resourceVersion) 271 .append(type, that.type) 272 .append(resourceUserProvidedIdentifiers, that.resourceUserProvidedIdentifiers) 273 .append(addedDistributionChannels, that.addedDistributionChannels) 274 .append(removedDistributionChannels, that.removedDistributionChannels) 275 .append(id, that.id) 276 .append(version, that.version) 277 .append(createdAt, that.createdAt) 278 .append(lastModifiedAt, that.lastModifiedAt) 279 .append(lastModifiedBy, that.lastModifiedBy) 280 .append(createdBy, that.createdBy) 281 .append(sequenceNumber, that.sequenceNumber) 282 .append(resource, that.resource) 283 .append(resourceVersion, that.resourceVersion) 284 .append(type, that.type) 285 .append(resourceUserProvidedIdentifiers, that.resourceUserProvidedIdentifiers) 286 .append(addedDistributionChannels, that.addedDistributionChannels) 287 .append(removedDistributionChannels, that.removedDistributionChannels) 288 .isEquals(); 289 } 290 291 @Override 292 public int hashCode() { 293 return new HashCodeBuilder(17, 37).append(id) 294 .append(version) 295 .append(createdAt) 296 .append(lastModifiedAt) 297 .append(lastModifiedBy) 298 .append(createdBy) 299 .append(sequenceNumber) 300 .append(resource) 301 .append(resourceVersion) 302 .append(type) 303 .append(resourceUserProvidedIdentifiers) 304 .append(addedDistributionChannels) 305 .append(removedDistributionChannels) 306 .toHashCode(); 307 } 308 309}