Skip to content

Commit

Permalink
TASK: Updating SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
Auto Mation committed Oct 13, 2022
1 parent c1e3f7d commit f310940
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ public interface Price extends com.commercetools.api.models.Customizable<Price>
@JsonProperty("id")
public String getId();

/**
* <p>User-defined identifier of the Price. It is unique per ProductVariant.</p>
*/

@JsonProperty("key")
public String getKey();

/**
* <p>Money value of this Price.</p>
*/
Expand Down Expand Up @@ -108,6 +115,8 @@ public interface Price extends com.commercetools.api.models.Customizable<Price>

public void setId(final String id);

public void setKey(final String key);

public void setValue(final TypedMoney value);

public void setCountry(final String country);
Expand Down Expand Up @@ -136,6 +145,7 @@ public static Price of() {
public static Price of(final Price template) {
PriceImpl instance = new PriceImpl();
instance.setId(template.getId());
instance.setKey(template.getKey());
instance.setValue(template.getValue());
instance.setCountry(template.getCountry());
instance.setCustomerGroup(template.getCustomerGroup());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ public class PriceBuilder implements Builder<Price> {

private String id;

@Nullable
private String key;

private com.commercetools.api.models.common.TypedMoney value;

@Nullable
Expand Down Expand Up @@ -62,6 +65,15 @@ public PriceBuilder id(final String id) {
return this;
}

/**
* <p>User-defined identifier of the Price. It is unique per ProductVariant.</p>
*/

public PriceBuilder key(@Nullable final String key) {
this.key = key;
return this;
}

/**
* <p>Money value of this Price.</p>
*/
Expand Down Expand Up @@ -245,6 +257,11 @@ public String getId() {
return this.id;
}

@Nullable
public String getKey() {
return this.key;
}

public com.commercetools.api.models.common.TypedMoney getValue() {
return this.value;
}
Expand Down Expand Up @@ -292,15 +309,15 @@ public com.commercetools.api.models.type.CustomFields getCustom() {
public Price build() {
Objects.requireNonNull(id, Price.class + ": id is missing");
Objects.requireNonNull(value, Price.class + ": value is missing");
return new PriceImpl(id, value, country, customerGroup, channel, validFrom, validUntil, discounted, tiers,
return new PriceImpl(id, key, value, country, customerGroup, channel, validFrom, validUntil, discounted, tiers,
custom);
}

/**
* builds Price without checking for non null required values
*/
public Price buildUnchecked() {
return new PriceImpl(id, value, country, customerGroup, channel, validFrom, validUntil, discounted, tiers,
return new PriceImpl(id, key, value, country, customerGroup, channel, validFrom, validUntil, discounted, tiers,
custom);
}

Expand All @@ -311,6 +328,7 @@ public static PriceBuilder of() {
public static PriceBuilder of(final Price template) {
PriceBuilder builder = new PriceBuilder();
builder.id = template.getId();
builder.key = template.getKey();
builder.value = template.getValue();
builder.country = template.getCountry();
builder.customerGroup = template.getCustomerGroup();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@
@JsonDeserialize(as = PriceDraftImpl.class)
public interface PriceDraft extends com.commercetools.api.models.CustomizableDraft<PriceDraft> {

/**
* <p>User-defined identifier for the Price. It must be unique per ProductVariant.</p>
*/

@JsonProperty("key")
public String getKey();

/**
* <p>Money value of this Price.</p>
*/
Expand Down Expand Up @@ -104,6 +111,8 @@ public interface PriceDraft extends com.commercetools.api.models.CustomizableDra
@JsonProperty("custom")
public CustomFieldsDraft getCustom();

public void setKey(final String key);

public void setValue(final Money value);

public void setCountry(final String country);
Expand Down Expand Up @@ -131,6 +140,7 @@ public static PriceDraft of() {

public static PriceDraft of(final PriceDraft template) {
PriceDraftImpl instance = new PriceDraftImpl();
instance.setKey(template.getKey());
instance.setValue(template.getValue());
instance.setCountry(template.getCountry());
instance.setCustomerGroup(template.getCustomerGroup());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
public class PriceDraftBuilder implements Builder<PriceDraft> {

@Nullable
private String key;

private com.commercetools.api.models.common.Money value;

@Nullable
Expand All @@ -50,6 +53,15 @@ public class PriceDraftBuilder implements Builder<PriceDraft> {
@Nullable
private com.commercetools.api.models.type.CustomFieldsDraft custom;

/**
* <p>User-defined identifier for the Price. It must be unique per ProductVariant.</p>
*/

public PriceDraftBuilder key(@Nullable final String key) {
this.key = key;
return this;
}

/**
* <p>Money value of this Price.</p>
*/
Expand Down Expand Up @@ -245,6 +257,11 @@ public PriceDraftBuilder custom(@Nullable final com.commercetools.api.models.typ
return this;
}

@Nullable
public String getKey() {
return this.key;
}

public com.commercetools.api.models.common.Money getValue() {
return this.value;
}
Expand Down Expand Up @@ -291,15 +308,15 @@ public com.commercetools.api.models.type.CustomFieldsDraft getCustom() {

public PriceDraft build() {
Objects.requireNonNull(value, PriceDraft.class + ": value is missing");
return new PriceDraftImpl(value, country, customerGroup, channel, validFrom, validUntil, discounted, tiers,
return new PriceDraftImpl(key, value, country, customerGroup, channel, validFrom, validUntil, discounted, tiers,
custom);
}

/**
* builds PriceDraft without checking for non null required values
*/
public PriceDraft buildUnchecked() {
return new PriceDraftImpl(value, country, customerGroup, channel, validFrom, validUntil, discounted, tiers,
return new PriceDraftImpl(key, value, country, customerGroup, channel, validFrom, validUntil, discounted, tiers,
custom);
}

Expand All @@ -309,6 +326,7 @@ public static PriceDraftBuilder of() {

public static PriceDraftBuilder of(final PriceDraft template) {
PriceDraftBuilder builder = new PriceDraftBuilder();
builder.key = template.getKey();
builder.value = template.getValue();
builder.country = template.getCountry();
builder.customerGroup = template.getCustomerGroup();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
public class PriceDraftImpl implements PriceDraft, ModelBase {

private String key;

private com.commercetools.api.models.common.Money value;

private String country;
Expand All @@ -39,7 +41,8 @@ public class PriceDraftImpl implements PriceDraft, ModelBase {
private com.commercetools.api.models.type.CustomFieldsDraft custom;

@JsonCreator
PriceDraftImpl(@JsonProperty("value") final com.commercetools.api.models.common.Money value,
PriceDraftImpl(@JsonProperty("key") final String key,
@JsonProperty("value") final com.commercetools.api.models.common.Money value,
@JsonProperty("country") final String country,
@JsonProperty("customerGroup") final com.commercetools.api.models.customer_group.CustomerGroupResourceIdentifier customerGroup,
@JsonProperty("channel") final com.commercetools.api.models.channel.ChannelResourceIdentifier channel,
Expand All @@ -48,6 +51,7 @@ public class PriceDraftImpl implements PriceDraft, ModelBase {
@JsonProperty("discounted") final com.commercetools.api.models.common.DiscountedPriceDraft discounted,
@JsonProperty("tiers") final java.util.List<com.commercetools.api.models.common.PriceTierDraft> tiers,
@JsonProperty("custom") final com.commercetools.api.models.type.CustomFieldsDraft custom) {
this.key = key;
this.value = value;
this.country = country;
this.customerGroup = customerGroup;
Expand All @@ -62,6 +66,14 @@ public class PriceDraftImpl implements PriceDraft, ModelBase {
public PriceDraftImpl() {
}

/**
* <p>User-defined identifier for the Price. It must be unique per ProductVariant.</p>
*/

public String getKey() {
return this.key;
}

/**
* <p>Money value of this Price.</p>
*/
Expand Down Expand Up @@ -140,6 +152,10 @@ public com.commercetools.api.models.type.CustomFieldsDraft getCustom() {
return this.custom;
}

public void setKey(final String key) {
this.key = key;
}

public void setValue(final com.commercetools.api.models.common.Money value) {
this.value = value;
}
Expand Down Expand Up @@ -191,7 +207,8 @@ public boolean equals(Object o) {

PriceDraftImpl that = (PriceDraftImpl) o;

return new EqualsBuilder().append(value, that.value)
return new EqualsBuilder().append(key, that.key)
.append(value, that.value)
.append(country, that.country)
.append(customerGroup, that.customerGroup)
.append(channel, that.channel)
Expand All @@ -205,7 +222,8 @@ public boolean equals(Object o) {

@Override
public int hashCode() {
return new HashCodeBuilder(17, 37).append(value)
return new HashCodeBuilder(17, 37).append(key)
.append(value)
.append(country)
.append(customerGroup)
.append(channel)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public class PriceImpl implements Price, ModelBase {

private String id;

private String key;

private com.commercetools.api.models.common.TypedMoney value;

private String country;
Expand All @@ -41,7 +43,7 @@ public class PriceImpl implements Price, ModelBase {
private com.commercetools.api.models.type.CustomFields custom;

@JsonCreator
PriceImpl(@JsonProperty("id") final String id,
PriceImpl(@JsonProperty("id") final String id, @JsonProperty("key") final String key,
@JsonProperty("value") final com.commercetools.api.models.common.TypedMoney value,
@JsonProperty("country") final String country,
@JsonProperty("customerGroup") final com.commercetools.api.models.customer_group.CustomerGroupReference customerGroup,
Expand All @@ -52,6 +54,7 @@ public class PriceImpl implements Price, ModelBase {
@JsonProperty("tiers") final java.util.List<com.commercetools.api.models.common.PriceTier> tiers,
@JsonProperty("custom") final com.commercetools.api.models.type.CustomFields custom) {
this.id = id;
this.key = key;
this.value = value;
this.country = country;
this.customerGroup = customerGroup;
Expand All @@ -74,6 +77,14 @@ public String getId() {
return this.id;
}

/**
* <p>User-defined identifier of the Price. It is unique per ProductVariant.</p>
*/

public String getKey() {
return this.key;
}

/**
* <p>Money value of this Price.</p>
*/
Expand Down Expand Up @@ -150,6 +161,10 @@ public void setId(final String id) {
this.id = id;
}

public void setKey(final String key) {
this.key = key;
}

public void setValue(final com.commercetools.api.models.common.TypedMoney value) {
this.value = value;
}
Expand Down Expand Up @@ -202,6 +217,7 @@ public boolean equals(Object o) {
PriceImpl that = (PriceImpl) o;

return new EqualsBuilder().append(id, that.id)
.append(key, that.key)
.append(value, that.value)
.append(country, that.country)
.append(customerGroup, that.customerGroup)
Expand All @@ -217,6 +233,7 @@ public boolean equals(Object o) {
@Override
public int hashCode() {
return new HashCodeBuilder(17, 37).append(id)
.append(key)
.append(value)
.append(country)
.append(customerGroup)
Expand Down

0 comments on commit f310940

Please sign in to comment.