Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update generated SDKs #591

Merged
merged 1 commit into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,29 @@


<details>
<summary>Changed Property(s)</summary>
<summary>Required Property(s)</summary>

- :warning: changed property `includedDiscounts` of type `DiscountedLineItemPriceDraft` from type `DiscountedLineItemPortion[]` to `DiscountedLineItemPortionDraft[]`
- :warning: changed property `isOnStock` of type `ProductVariantAvailability` to be required
- changed property `priceMode` of type `CustomLineItemDraft` to be optional
- changed property `oldShipmentState` of type `OrderShipmentStateChangedMessage` to be optional
- changed property `oldOrderState` of type `OrderStateChangedMessage` to be optional
- changed property `oldShipmentState` of type `OrderShipmentStateChangedMessagePayload` to be optional
- changed property `oldOrderState` of type `OrderStateChangedMessagePayload` to be optional
</details>


<details>
<summary>Added Property(s)</summary>
<summary>Changed Property(s)</summary>

- added property `totalTax` to type `TaxedPriceDraft`
- :warning: changed property `includedDiscounts` of type `DiscountedLineItemPriceDraft` from type `DiscountedLineItemPortion[]` to `DiscountedLineItemPortionDraft[]`
</details>


<details>
<summary>Required Property(s)</summary>
<summary>Added Property(s)</summary>

- changed property `priceMode` of type `CustomLineItemDraft` to be optional
- changed property `oldShipmentState` of type `OrderShipmentStateChangedMessage` to be optional
- changed property `oldOrderState` of type `OrderStateChangedMessage` to be optional
- changed property `oldShipmentState` of type `OrderShipmentStateChangedMessagePayload` to be optional
- changed property `oldOrderState` of type `OrderStateChangedMessagePayload` to be optional
- added property `totalTax` to type `TaxedPriceDraft`
- added property `id` to type `ProductVariantAvailability`
- added property `version` to type `ProductVariantAvailability`
</details>

Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import javax.annotation.Nullable;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;

import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.databind.annotation.*;
Expand All @@ -21,6 +22,7 @@
* <div class=code-example>
* <pre><code class='java'>
* ProductVariantAvailability productVariantAvailability = ProductVariantAvailability.builder()
* .isOnStock(true)
* .build()
* </code></pre>
* </div>
Expand All @@ -41,7 +43,7 @@ public interface ProductVariantAvailability {
* <p>Indicates whether a Product Variant is in stock.</p>
* @return isOnStock
*/

@NotNull
@JsonProperty("isOnStock")
public Boolean getIsOnStock();

Expand All @@ -61,6 +63,22 @@ public interface ProductVariantAvailability {
@JsonProperty("availableQuantity")
public Long getAvailableQuantity();

/**
* <p>Unique identifier of the InventoryEntry.</p>
* @return id
*/

@JsonProperty("id")
public String getId();

/**
* <p>Current version of the InventoryEntry.</p>
* @return version
*/

@JsonProperty("version")
public Long getVersion();

/**
* <p>For each InventoryEntry with a supply Channel, an entry is added to <code>channels</code>.</p>
* @param channels value to be set
Expand Down Expand Up @@ -89,6 +107,20 @@ public interface ProductVariantAvailability {

public void setAvailableQuantity(final Long availableQuantity);

/**
* <p>Unique identifier of the InventoryEntry.</p>
* @param id value to be set
*/

public void setId(final String id);

/**
* <p>Current version of the InventoryEntry.</p>
* @param version value to be set
*/

public void setVersion(final Long version);

/**
* factory method
* @return instance of ProductVariantAvailability
Expand All @@ -108,6 +140,8 @@ public static ProductVariantAvailability of(final ProductVariantAvailability tem
instance.setIsOnStock(template.getIsOnStock());
instance.setRestockableInDays(template.getRestockableInDays());
instance.setAvailableQuantity(template.getAvailableQuantity());
instance.setId(template.getId());
instance.setVersion(template.getVersion());
return instance;
}

Expand All @@ -127,6 +161,8 @@ public static ProductVariantAvailability deepCopy(@Nullable final ProductVariant
instance.setIsOnStock(template.getIsOnStock());
instance.setRestockableInDays(template.getRestockableInDays());
instance.setAvailableQuantity(template.getAvailableQuantity());
instance.setId(template.getId());
instance.setVersion(template.getVersion());
return instance;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* <div class=code-example>
* <pre><code class='java'>
* ProductVariantAvailability productVariantAvailability = ProductVariantAvailability.builder()
* .isOnStock(true)
* .build()
* </code></pre>
* </div>
Expand All @@ -26,7 +27,6 @@ public class ProductVariantAvailabilityBuilder implements Builder<ProductVariant
@Nullable
private com.commercetools.api.models.product.ProductVariantChannelAvailabilityMap channels;

@Nullable
private Boolean isOnStock;

@Nullable
Expand All @@ -35,6 +35,12 @@ public class ProductVariantAvailabilityBuilder implements Builder<ProductVariant
@Nullable
private Long availableQuantity;

@Nullable
private String id;

@Nullable
private Long version;

/**
* <p>For each InventoryEntry with a supply Channel, an entry is added to <code>channels</code>.</p>
* @param builder function to build the channels value
Expand Down Expand Up @@ -80,7 +86,7 @@ public ProductVariantAvailabilityBuilder channels(
* @return Builder
*/

public ProductVariantAvailabilityBuilder isOnStock(@Nullable final Boolean isOnStock) {
public ProductVariantAvailabilityBuilder isOnStock(final Boolean isOnStock) {
this.isOnStock = isOnStock;
return this;
}
Expand All @@ -107,6 +113,28 @@ public ProductVariantAvailabilityBuilder availableQuantity(@Nullable final Long
return this;
}

/**
* <p>Unique identifier of the InventoryEntry.</p>
* @param id value to be set
* @return Builder
*/

public ProductVariantAvailabilityBuilder id(@Nullable final String id) {
this.id = id;
return this;
}

/**
* <p>Current version of the InventoryEntry.</p>
* @param version value to be set
* @return Builder
*/

public ProductVariantAvailabilityBuilder version(@Nullable final Long version) {
this.version = version;
return this;
}

/**
* <p>For each InventoryEntry with a supply Channel, an entry is added to <code>channels</code>.</p>
* @return channels
Expand All @@ -122,7 +150,6 @@ public com.commercetools.api.models.product.ProductVariantChannelAvailabilityMap
* @return isOnStock
*/

@Nullable
public Boolean getIsOnStock() {
return this.isOnStock;
}
Expand All @@ -147,20 +174,43 @@ public Long getAvailableQuantity() {
return this.availableQuantity;
}

/**
* <p>Unique identifier of the InventoryEntry.</p>
* @return id
*/

@Nullable
public String getId() {
return this.id;
}

/**
* <p>Current version of the InventoryEntry.</p>
* @return version
*/

@Nullable
public Long getVersion() {
return this.version;
}

/**
* builds ProductVariantAvailability with checking for non-null required values
* @return ProductVariantAvailability
*/
public ProductVariantAvailability build() {
return new ProductVariantAvailabilityImpl(channels, isOnStock, restockableInDays, availableQuantity);
Objects.requireNonNull(isOnStock, ProductVariantAvailability.class + ": isOnStock is missing");
return new ProductVariantAvailabilityImpl(channels, isOnStock, restockableInDays, availableQuantity, id,
version);
}

/**
* builds ProductVariantAvailability without checking for non-null required values
* @return ProductVariantAvailability
*/
public ProductVariantAvailability buildUnchecked() {
return new ProductVariantAvailabilityImpl(channels, isOnStock, restockableInDays, availableQuantity);
return new ProductVariantAvailabilityImpl(channels, isOnStock, restockableInDays, availableQuantity, id,
version);
}

/**
Expand All @@ -182,6 +232,8 @@ public static ProductVariantAvailabilityBuilder of(final ProductVariantAvailabil
builder.isOnStock = template.getIsOnStock();
builder.restockableInDays = template.getRestockableInDays();
builder.availableQuantity = template.getAvailableQuantity();
builder.id = template.getId();
builder.version = template.getVersion();
return builder;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ public class ProductVariantAvailabilityImpl implements ProductVariantAvailabilit

private Long availableQuantity;

private String id;

private Long version;

/**
* create instance with all properties
*/
Expand All @@ -38,11 +42,14 @@ public class ProductVariantAvailabilityImpl implements ProductVariantAvailabilit
@JsonProperty("channels") final com.commercetools.api.models.product.ProductVariantChannelAvailabilityMap channels,
@JsonProperty("isOnStock") final Boolean isOnStock,
@JsonProperty("restockableInDays") final Long restockableInDays,
@JsonProperty("availableQuantity") final Long availableQuantity) {
@JsonProperty("availableQuantity") final Long availableQuantity, @JsonProperty("id") final String id,
@JsonProperty("version") final Long version) {
this.channels = channels;
this.isOnStock = isOnStock;
this.restockableInDays = restockableInDays;
this.availableQuantity = availableQuantity;
this.id = id;
this.version = version;
}

/**
Expand Down Expand Up @@ -83,6 +90,22 @@ public Long getAvailableQuantity() {
return this.availableQuantity;
}

/**
* <p>Unique identifier of the InventoryEntry.</p>
*/

public String getId() {
return this.id;
}

/**
* <p>Current version of the InventoryEntry.</p>
*/

public Long getVersion() {
return this.version;
}

public void setChannels(final com.commercetools.api.models.product.ProductVariantChannelAvailabilityMap channels) {
this.channels = channels;
}
Expand All @@ -99,6 +122,14 @@ public void setAvailableQuantity(final Long availableQuantity) {
this.availableQuantity = availableQuantity;
}

public void setId(final String id) {
this.id = id;
}

public void setVersion(final Long version) {
this.version = version;
}

@Override
public boolean equals(Object o) {
if (this == o)
Expand All @@ -113,10 +144,14 @@ public boolean equals(Object o) {
.append(isOnStock, that.isOnStock)
.append(restockableInDays, that.restockableInDays)
.append(availableQuantity, that.availableQuantity)
.append(id, that.id)
.append(version, that.version)
.append(channels, that.channels)
.append(isOnStock, that.isOnStock)
.append(restockableInDays, that.restockableInDays)
.append(availableQuantity, that.availableQuantity)
.append(id, that.id)
.append(version, that.version)
.isEquals();
}

Expand All @@ -126,6 +161,8 @@ public int hashCode() {
.append(isOnStock)
.append(restockableInDays)
.append(availableQuantity)
.append(id)
.append(version)
.toHashCode();
}

Expand All @@ -135,6 +172,8 @@ public String toString() {
.append("isOnStock", isOnStock)
.append("restockableInDays", restockableInDays)
.append("availableQuantity", availableQuantity)
.append("id", id)
.append("version", version)
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,15 @@
p -> new CombinationQueryPredicate<>(p, ProductVariantAvailabilityQueryBuilderDsl::of));
}

public StringComparisonPredicateBuilder<ProductVariantAvailabilityQueryBuilderDsl> id() {
return new StringComparisonPredicateBuilder<>(BinaryQueryPredicate.of().left(new ConstantQueryPredicate("id")),
p -> new CombinationQueryPredicate<>(p, ProductVariantAvailabilityQueryBuilderDsl::of));

Check warning on line 46 in commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/product/ProductVariantAvailabilityQueryBuilderDsl.java

View check run for this annotation

Codecov / codecov/patch

commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/product/ProductVariantAvailabilityQueryBuilderDsl.java#L45-L46

Added lines #L45 - L46 were not covered by tests
}

public LongComparisonPredicateBuilder<ProductVariantAvailabilityQueryBuilderDsl> version() {
return new LongComparisonPredicateBuilder<>(
BinaryQueryPredicate.of().left(new ConstantQueryPredicate("version")),
p -> new CombinationQueryPredicate<>(p, ProductVariantAvailabilityQueryBuilderDsl::of));

Check warning on line 52 in commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/product/ProductVariantAvailabilityQueryBuilderDsl.java

View check run for this annotation

Codecov / codecov/patch

commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/product/ProductVariantAvailabilityQueryBuilderDsl.java#L50-L52

Added lines #L50 - L52 were not covered by tests
}

}
Loading
Loading