diff --git a/changes.md b/changes.md index e22a340c7b6..213f02a0373 100644 --- a/changes.md +++ b/changes.md @@ -114,6 +114,7 @@ - added property `priceCustomerGroupAssignments` to type `ProductSearchProjectionParams` - added property `businessUnit` to type `ShoppingList` - added property `businessUnit` to type `ShoppingListDraft` +- added property `published` to type `ShoppingListLineItem` - added property `events` to type `Subscription` - added property `events` to type `SubscriptionDraft` diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItem.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItem.php index c543eb24ed2..779f5391e33 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItem.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItem.php @@ -26,6 +26,7 @@ interface ShoppingListLineItem extends JsonObject public const FIELD_NAME = 'name'; public const FIELD_PRODUCT_ID = 'productId'; public const FIELD_PRODUCT_TYPE = 'productType'; + public const FIELD_PUBLISHED = 'published'; public const FIELD_QUANTITY = 'quantity'; public const FIELD_VARIANT_ID = 'variantId'; public const FIELD_VARIANT = 'variant'; @@ -97,6 +98,15 @@ public function getProductId(); */ public function getProductType(); + /** + *
Whether the related Product is published or not.
+ *This data is updated in an eventual consistent manner when the Product's published status changes.
+ * + + * @return null|bool + */ + public function getPublished(); + /** *Number of Products in the ShoppingListLineItem.
* @@ -171,6 +181,11 @@ public function setProductId(?string $productId): void; */ public function setProductType(?ProductTypeReference $productType): void; + /** + * @param ?bool $published + */ + public function setPublished(?bool $published): void; + /** * @param ?int $quantity */ diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemBuilder.php index 7eb691f377d..eeb89d4753a 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemBuilder.php @@ -77,6 +77,12 @@ final class ShoppingListLineItemBuilder implements Builder */ private $productType; + /** + + * @var ?bool + */ + private $published; + /** * @var ?int @@ -191,6 +197,18 @@ public function getProductType() return $this->productType instanceof ProductTypeReferenceBuilder ? $this->productType->build() : $this->productType; } + /** + *Whether the related Product is published or not.
+ *This data is updated in an eventual consistent manner when the Product's published status changes.
+ * + + * @return null|bool + */ + public function getPublished() + { + return $this->published; + } + /** *Number of Products in the ShoppingListLineItem.
* @@ -325,6 +343,17 @@ public function withProductType(?ProductTypeReference $productType) return $this; } + /** + * @param ?bool $published + * @return $this + */ + public function withPublished(?bool $published) + { + $this->published = $published; + + return $this; + } + /** * @param ?int $quantity * @return $this @@ -435,6 +464,7 @@ public function build(): ShoppingListLineItem $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name, $this->productId, $this->productType instanceof ProductTypeReferenceBuilder ? $this->productType->build() : $this->productType, + $this->published, $this->quantity, $this->variantId, $this->variant instanceof ProductVariantBuilder ? $this->variant->build() : $this->variant, diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemModel.php index e177f698b62..19917b1307a 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemModel.php @@ -76,6 +76,12 @@ final class ShoppingListLineItemModel extends JsonObjectModel implements Shoppin */ protected $productType; + /** + * + * @var ?bool + */ + protected $published; + /** * * @var ?int @@ -113,6 +119,7 @@ public function __construct( ?LocalizedString $name = null, ?string $productId = null, ?ProductTypeReference $productType = null, + ?bool $published = null, ?int $quantity = null, ?int $variantId = null, ?ProductVariant $variant = null, @@ -126,6 +133,7 @@ public function __construct( $this->name = $name; $this->productId = $productId; $this->productType = $productType; + $this->published = $published; $this->quantity = $quantity; $this->variantId = $variantId; $this->variant = $variant; @@ -305,6 +313,27 @@ public function getProductType() return $this->productType; } + /** + *Whether the related Product is published or not.
+ *This data is updated in an eventual consistent manner when the Product's published status changes.
+ * + * + * @return null|bool + */ + public function getPublished() + { + if (is_null($this->published)) { + /** @psalm-var ?bool $data */ + $data = $this->raw(self::FIELD_PUBLISHED); + if (is_null($data)) { + return null; + } + $this->published = (bool) $data; + } + + return $this->published; + } + /** *Number of Products in the ShoppingListLineItem.
* @@ -454,6 +483,14 @@ public function setProductType(?ProductTypeReference $productType): void $this->productType = $productType; } + /** + * @param ?bool $published + */ + public function setPublished(?bool $published): void + { + $this->published = $published; + } + /** * @param ?int $quantity */ diff --git a/references.txt b/references.txt index aa0ccde4c6a..56e219f4e48 100644 --- a/references.txt +++ b/references.txt @@ -404,3 +404,4 @@ f0288f95a5fe33fd2973df3f8290defb15129192 178cffb2a2cf988d054f8e346aae35f20a517e6b 761762c7caad45bc86b08db7021a033fff18ba90 b32dd9c6633745d71fb526473fed6cc60e1fab0a +dec65e707130185745930bde27ce78ae64ab29c1