Skip to content

Commit b145bde

Browse files
Merge pull request #365 from commercetools/gen-sdk-updates
Update generated SDKs
2 parents b853e96 + 83acc87 commit b145bde

File tree

5 files changed

+84
-0
lines changed

5 files changed

+84
-0
lines changed

changes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@
114114
- added property `priceCustomerGroupAssignments` to type `ProductSearchProjectionParams`
115115
- added property `businessUnit` to type `ShoppingList`
116116
- added property `businessUnit` to type `ShoppingListDraft`
117+
- added property `published` to type `ShoppingListLineItem`
117118
- added property `events` to type `Subscription`
118119
- added property `events` to type `SubscriptionDraft`
119120
</details>

lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItem.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ interface ShoppingListLineItem extends JsonObject
2626
public const FIELD_NAME = 'name';
2727
public const FIELD_PRODUCT_ID = 'productId';
2828
public const FIELD_PRODUCT_TYPE = 'productType';
29+
public const FIELD_PUBLISHED = 'published';
2930
public const FIELD_QUANTITY = 'quantity';
3031
public const FIELD_VARIANT_ID = 'variantId';
3132
public const FIELD_VARIANT = 'variant';
@@ -97,6 +98,15 @@ public function getProductId();
9798
*/
9899
public function getProductType();
99100

101+
/**
102+
* <p>Whether the related <a href="ctp:api:type:Product">Product</a> is published or not.</p>
103+
* <p>This data is updated in an <a href="/general-concepts#eventual-consistency">eventual consistent manner</a> when the Product's published status changes.</p>
104+
*
105+
106+
* @return null|bool
107+
*/
108+
public function getPublished();
109+
100110
/**
101111
* <p>Number of Products in the ShoppingListLineItem.</p>
102112
*
@@ -171,6 +181,11 @@ public function setProductId(?string $productId): void;
171181
*/
172182
public function setProductType(?ProductTypeReference $productType): void;
173183

184+
/**
185+
* @param ?bool $published
186+
*/
187+
public function setPublished(?bool $published): void;
188+
174189
/**
175190
* @param ?int $quantity
176191
*/

lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemBuilder.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ final class ShoppingListLineItemBuilder implements Builder
7777
*/
7878
private $productType;
7979

80+
/**
81+
82+
* @var ?bool
83+
*/
84+
private $published;
85+
8086
/**
8187
8288
* @var ?int
@@ -191,6 +197,18 @@ public function getProductType()
191197
return $this->productType instanceof ProductTypeReferenceBuilder ? $this->productType->build() : $this->productType;
192198
}
193199

200+
/**
201+
* <p>Whether the related <a href="ctp:api:type:Product">Product</a> is published or not.</p>
202+
* <p>This data is updated in an <a href="/general-concepts#eventual-consistency">eventual consistent manner</a> when the Product's published status changes.</p>
203+
*
204+
205+
* @return null|bool
206+
*/
207+
public function getPublished()
208+
{
209+
return $this->published;
210+
}
211+
194212
/**
195213
* <p>Number of Products in the ShoppingListLineItem.</p>
196214
*
@@ -325,6 +343,17 @@ public function withProductType(?ProductTypeReference $productType)
325343
return $this;
326344
}
327345

346+
/**
347+
* @param ?bool $published
348+
* @return $this
349+
*/
350+
public function withPublished(?bool $published)
351+
{
352+
$this->published = $published;
353+
354+
return $this;
355+
}
356+
328357
/**
329358
* @param ?int $quantity
330359
* @return $this
@@ -435,6 +464,7 @@ public function build(): ShoppingListLineItem
435464
$this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name,
436465
$this->productId,
437466
$this->productType instanceof ProductTypeReferenceBuilder ? $this->productType->build() : $this->productType,
467+
$this->published,
438468
$this->quantity,
439469
$this->variantId,
440470
$this->variant instanceof ProductVariantBuilder ? $this->variant->build() : $this->variant,

lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemModel.php

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ final class ShoppingListLineItemModel extends JsonObjectModel implements Shoppin
7676
*/
7777
protected $productType;
7878

79+
/**
80+
*
81+
* @var ?bool
82+
*/
83+
protected $published;
84+
7985
/**
8086
*
8187
* @var ?int
@@ -113,6 +119,7 @@ public function __construct(
113119
?LocalizedString $name = null,
114120
?string $productId = null,
115121
?ProductTypeReference $productType = null,
122+
?bool $published = null,
116123
?int $quantity = null,
117124
?int $variantId = null,
118125
?ProductVariant $variant = null,
@@ -126,6 +133,7 @@ public function __construct(
126133
$this->name = $name;
127134
$this->productId = $productId;
128135
$this->productType = $productType;
136+
$this->published = $published;
129137
$this->quantity = $quantity;
130138
$this->variantId = $variantId;
131139
$this->variant = $variant;
@@ -305,6 +313,27 @@ public function getProductType()
305313
return $this->productType;
306314
}
307315

316+
/**
317+
* <p>Whether the related <a href="ctp:api:type:Product">Product</a> is published or not.</p>
318+
* <p>This data is updated in an <a href="/general-concepts#eventual-consistency">eventual consistent manner</a> when the Product's published status changes.</p>
319+
*
320+
*
321+
* @return null|bool
322+
*/
323+
public function getPublished()
324+
{
325+
if (is_null($this->published)) {
326+
/** @psalm-var ?bool $data */
327+
$data = $this->raw(self::FIELD_PUBLISHED);
328+
if (is_null($data)) {
329+
return null;
330+
}
331+
$this->published = (bool) $data;
332+
}
333+
334+
return $this->published;
335+
}
336+
308337
/**
309338
* <p>Number of Products in the ShoppingListLineItem.</p>
310339
*
@@ -454,6 +483,14 @@ public function setProductType(?ProductTypeReference $productType): void
454483
$this->productType = $productType;
455484
}
456485

486+
/**
487+
* @param ?bool $published
488+
*/
489+
public function setPublished(?bool $published): void
490+
{
491+
$this->published = $published;
492+
}
493+
457494
/**
458495
* @param ?int $quantity
459496
*/

references.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,3 +404,4 @@ f0288f95a5fe33fd2973df3f8290defb15129192
404404
178cffb2a2cf988d054f8e346aae35f20a517e6b
405405
761762c7caad45bc86b08db7021a033fff18ba90
406406
b32dd9c6633745d71fb526473fed6cc60e1fab0a
407+
dec65e707130185745930bde27ce78ae64ab29c1

0 commit comments

Comments
 (0)