001 002package com.commercetools.api.models.product; 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>Either <code>variantId</code> or <code>sku</code> is required. The Asset to update must be specified using either <code>assetId</code> or <code>assetKey</code>.</p> 019 */ 020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 021public class ProductSetAssetDescriptionActionImpl implements ProductSetAssetDescriptionAction, ModelBase { 022 023 private String action; 024 025 private Long variantId; 026 027 private String sku; 028 029 private Boolean staged; 030 031 private String assetId; 032 033 private String assetKey; 034 035 private com.commercetools.api.models.common.LocalizedString description; 036 037 /** 038 * create instance with all properties 039 */ 040 @JsonCreator 041 ProductSetAssetDescriptionActionImpl(@JsonProperty("variantId") final Long variantId, 042 @JsonProperty("sku") final String sku, @JsonProperty("staged") final Boolean staged, 043 @JsonProperty("assetId") final String assetId, @JsonProperty("assetKey") final String assetKey, 044 @JsonProperty("description") final com.commercetools.api.models.common.LocalizedString description) { 045 this.variantId = variantId; 046 this.sku = sku; 047 this.staged = staged; 048 this.assetId = assetId; 049 this.assetKey = assetKey; 050 this.description = description; 051 this.action = SET_ASSET_DESCRIPTION; 052 } 053 054 /** 055 * create empty instance 056 */ 057 public ProductSetAssetDescriptionActionImpl() { 058 this.action = SET_ASSET_DESCRIPTION; 059 } 060 061 /** 062 * 063 */ 064 065 public String getAction() { 066 return this.action; 067 } 068 069 /** 070 * <p>The <code>id</code> of the ProductVariant to update.</p> 071 */ 072 073 public Long getVariantId() { 074 return this.variantId; 075 } 076 077 /** 078 * <p>The <code>sku</code> of the ProductVariant to update.</p> 079 */ 080 081 public String getSku() { 082 return this.sku; 083 } 084 085 /** 086 * <p>If <code>true</code>, only the staged Asset is updated. If <code>false</code>, both the current and staged Asset is updated.</p> 087 */ 088 089 public Boolean getStaged() { 090 return this.staged; 091 } 092 093 /** 094 * <p>The <code>id</code> of the Asset to update.</p> 095 */ 096 097 public String getAssetId() { 098 return this.assetId; 099 } 100 101 /** 102 * <p>The <code>key</code> of the Asset to update.</p> 103 */ 104 105 public String getAssetKey() { 106 return this.assetKey; 107 } 108 109 /** 110 * <p>Value to set. If empty, any existing value will be removed.</p> 111 */ 112 113 public com.commercetools.api.models.common.LocalizedString getDescription() { 114 return this.description; 115 } 116 117 public void setVariantId(final Long variantId) { 118 this.variantId = variantId; 119 } 120 121 public void setSku(final String sku) { 122 this.sku = sku; 123 } 124 125 public void setStaged(final Boolean staged) { 126 this.staged = staged; 127 } 128 129 public void setAssetId(final String assetId) { 130 this.assetId = assetId; 131 } 132 133 public void setAssetKey(final String assetKey) { 134 this.assetKey = assetKey; 135 } 136 137 public void setDescription(final com.commercetools.api.models.common.LocalizedString description) { 138 this.description = description; 139 } 140 141 @Override 142 public boolean equals(Object o) { 143 if (this == o) 144 return true; 145 146 if (o == null || getClass() != o.getClass()) 147 return false; 148 149 ProductSetAssetDescriptionActionImpl that = (ProductSetAssetDescriptionActionImpl) o; 150 151 return new EqualsBuilder().append(action, that.action) 152 .append(variantId, that.variantId) 153 .append(sku, that.sku) 154 .append(staged, that.staged) 155 .append(assetId, that.assetId) 156 .append(assetKey, that.assetKey) 157 .append(description, that.description) 158 .isEquals(); 159 } 160 161 @Override 162 public int hashCode() { 163 return new HashCodeBuilder(17, 37).append(action) 164 .append(variantId) 165 .append(sku) 166 .append(staged) 167 .append(assetId) 168 .append(assetKey) 169 .append(description) 170 .toHashCode(); 171 } 172 173}