001
002package com.commercetools.api.models.cart;
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>Input used to select a ShippingRatePriceTier. If no matching tier can be found, or the input is not set, the default price for the shipping rate is used.</p>
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class CartSetShippingRateInputActionImpl implements CartSetShippingRateInputAction, ModelBase {
022
023    private String action;
024
025    private com.commercetools.api.models.cart.ShippingRateInputDraft shippingRateInput;
026
027    /**
028     * create instance with all properties
029     */
030    @JsonCreator
031    CartSetShippingRateInputActionImpl(
032            @JsonProperty("shippingRateInput") final com.commercetools.api.models.cart.ShippingRateInputDraft shippingRateInput) {
033        this.shippingRateInput = shippingRateInput;
034        this.action = SET_SHIPPING_RATE_INPUT;
035    }
036
037    /**
038     * create empty instance
039     */
040    public CartSetShippingRateInputActionImpl() {
041        this.action = SET_SHIPPING_RATE_INPUT;
042    }
043
044    /**
045     *
046     */
047
048    public String getAction() {
049        return this.action;
050    }
051
052    /**
053     *  <p>The data type of this field depends on the <code>shippingRateInputType.type</code> configured in the Project:</p>
054     *  <ul>
055     *   <li>If <code>CartClassification</code>, it must be ClassificationShippingRateInputDraft.</li>
056     *   <li>If <code>CartScore</code>, it must be ScoreShippingRateInputDraft.</li>
057     *   <li>If <code>CartValue</code>, it cannot be set.</li>
058     *  </ul>
059     */
060
061    public com.commercetools.api.models.cart.ShippingRateInputDraft getShippingRateInput() {
062        return this.shippingRateInput;
063    }
064
065    public void setShippingRateInput(final com.commercetools.api.models.cart.ShippingRateInputDraft shippingRateInput) {
066        this.shippingRateInput = shippingRateInput;
067    }
068
069    @Override
070    public boolean equals(Object o) {
071        if (this == o)
072            return true;
073
074        if (o == null || getClass() != o.getClass())
075            return false;
076
077        CartSetShippingRateInputActionImpl that = (CartSetShippingRateInputActionImpl) o;
078
079        return new EqualsBuilder().append(action, that.action)
080                .append(shippingRateInput, that.shippingRateInput)
081                .isEquals();
082    }
083
084    @Override
085    public int hashCode() {
086        return new HashCodeBuilder(17, 37).append(action).append(shippingRateInput).toHashCode();
087    }
088
089}