001
002package com.commercetools.api.models.store;
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 update action produces the StoreDistributionChannelsChanged Message. It has no effect if a given distribution channel is already present in a Store.</p>
019 *  <p>Adding a Channel without the <code>ProductDistribution</code> ChannelRoleEnum returns a MissingRoleOnChannel error.</p>
020 */
021@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
022public class StoreAddDistributionChannelActionImpl implements StoreAddDistributionChannelAction, ModelBase {
023
024    private String action;
025
026    private com.commercetools.api.models.channel.ChannelResourceIdentifier distributionChannel;
027
028    /**
029     * create instance with all properties
030     */
031    @JsonCreator
032    StoreAddDistributionChannelActionImpl(
033            @JsonProperty("distributionChannel") final com.commercetools.api.models.channel.ChannelResourceIdentifier distributionChannel) {
034        this.distributionChannel = distributionChannel;
035        this.action = ADD_DISTRIBUTION_CHANNEL;
036    }
037
038    /**
039     * create empty instance
040     */
041    public StoreAddDistributionChannelActionImpl() {
042        this.action = ADD_DISTRIBUTION_CHANNEL;
043    }
044
045    /**
046     *
047     */
048
049    public String getAction() {
050        return this.action;
051    }
052
053    /**
054     *  <p>Value to append.</p>
055     */
056
057    public com.commercetools.api.models.channel.ChannelResourceIdentifier getDistributionChannel() {
058        return this.distributionChannel;
059    }
060
061    public void setDistributionChannel(
062            final com.commercetools.api.models.channel.ChannelResourceIdentifier distributionChannel) {
063        this.distributionChannel = distributionChannel;
064    }
065
066    @Override
067    public boolean equals(Object o) {
068        if (this == o)
069            return true;
070
071        if (o == null || getClass() != o.getClass())
072            return false;
073
074        StoreAddDistributionChannelActionImpl that = (StoreAddDistributionChannelActionImpl) o;
075
076        return new EqualsBuilder().append(action, that.action)
077                .append(distributionChannel, that.distributionChannel)
078                .append(action, that.action)
079                .append(distributionChannel, that.distributionChannel)
080                .isEquals();
081    }
082
083    @Override
084    public int hashCode() {
085        return new HashCodeBuilder(17, 37).append(action).append(distributionChannel).toHashCode();
086    }
087
088}