diff --git a/changes.md b/changes.md index 62654bcc481..8c05702955e 100644 --- a/changes.md +++ b/changes.md @@ -238,6 +238,7 @@ - added property `inheritedStores` to type `BusinessUnit` - added property `inheritedStores` to type `Company` - added property `inheritedStores` to type `Division` +- added property `makeInheritedAssociatesExplicit` to type `BusinessUnitChangeAssociateModeAction` - added property `discountGroup` to type `CartDiscount` - added property `discountGroup` to type `CartDiscountDraft` - added property `priceRoundingMode` to type `Cart` diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeAssociateModeAction.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeAssociateModeAction.php index 48dfb9305ca..33e62849102 100644 --- a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeAssociateModeAction.php +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeAssociateModeAction.php @@ -14,6 +14,7 @@ interface BusinessUnitChangeAssociateModeAction extends BusinessUnitUpdateAction { public const FIELD_ASSOCIATE_MODE = 'associateMode'; + public const FIELD_MAKE_INHERITED_ASSOCIATES_EXPLICIT = 'makeInheritedAssociatesExplicit'; /** *

The new value for associateMode.

@@ -23,8 +24,21 @@ interface BusinessUnitChangeAssociateModeAction extends BusinessUnitUpdateAction */ public function getAssociateMode(); + /** + *

If set to true during a change to associateMode="Explicit", all inherited Associates will be converted to explicit Associates.

+ * + + * @return null|bool + */ + public function getMakeInheritedAssociatesExplicit(); + /** * @param ?string $associateMode */ public function setAssociateMode(?string $associateMode): void; + + /** + * @param ?bool $makeInheritedAssociatesExplicit + */ + public function setMakeInheritedAssociatesExplicit(?bool $makeInheritedAssociatesExplicit): void; } diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeAssociateModeActionBuilder.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeAssociateModeActionBuilder.php index 948578cedbc..a7c1005d58a 100644 --- a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeAssociateModeActionBuilder.php +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeAssociateModeActionBuilder.php @@ -26,6 +26,12 @@ final class BusinessUnitChangeAssociateModeActionBuilder implements Builder */ private $associateMode; + /** + + * @var ?bool + */ + private $makeInheritedAssociatesExplicit; + /** *

The new value for associateMode.

* @@ -37,6 +43,17 @@ public function getAssociateMode() return $this->associateMode; } + /** + *

If set to true during a change to associateMode="Explicit", all inherited Associates will be converted to explicit Associates.

+ * + + * @return null|bool + */ + public function getMakeInheritedAssociatesExplicit() + { + return $this->makeInheritedAssociatesExplicit; + } + /** * @param ?string $associateMode * @return $this @@ -48,11 +65,23 @@ public function withAssociateMode(?string $associateMode) return $this; } + /** + * @param ?bool $makeInheritedAssociatesExplicit + * @return $this + */ + public function withMakeInheritedAssociatesExplicit(?bool $makeInheritedAssociatesExplicit) + { + $this->makeInheritedAssociatesExplicit = $makeInheritedAssociatesExplicit; + + return $this; + } + public function build(): BusinessUnitChangeAssociateModeAction { return new BusinessUnitChangeAssociateModeActionModel( - $this->associateMode + $this->associateMode, + $this->makeInheritedAssociatesExplicit ); } diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeAssociateModeActionModel.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeAssociateModeActionModel.php index 626ee2b64bb..46497cd1506 100644 --- a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeAssociateModeActionModel.php +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeAssociateModeActionModel.php @@ -32,15 +32,23 @@ final class BusinessUnitChangeAssociateModeActionModel extends JsonObjectModel i */ protected $associateMode; + /** + * + * @var ?bool + */ + protected $makeInheritedAssociatesExplicit; + /** * @psalm-suppress MissingParamType */ public function __construct( ?string $associateMode = null, + ?bool $makeInheritedAssociatesExplicit = null, ?string $action = null ) { $this->associateMode = $associateMode; + $this->makeInheritedAssociatesExplicit = $makeInheritedAssociatesExplicit; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -82,6 +90,26 @@ public function getAssociateMode() return $this->associateMode; } + /** + *

If set to true during a change to associateMode="Explicit", all inherited Associates will be converted to explicit Associates.

+ * + * + * @return null|bool + */ + public function getMakeInheritedAssociatesExplicit() + { + if (is_null($this->makeInheritedAssociatesExplicit)) { + /** @psalm-var ?bool $data */ + $data = $this->raw(self::FIELD_MAKE_INHERITED_ASSOCIATES_EXPLICIT); + if (is_null($data)) { + return null; + } + $this->makeInheritedAssociatesExplicit = (bool) $data; + } + + return $this->makeInheritedAssociatesExplicit; + } + /** * @param ?string $associateMode @@ -90,4 +118,12 @@ public function setAssociateMode(?string $associateMode): void { $this->associateMode = $associateMode; } + + /** + * @param ?bool $makeInheritedAssociatesExplicit + */ + public function setMakeInheritedAssociatesExplicit(?bool $makeInheritedAssociatesExplicit): void + { + $this->makeInheritedAssociatesExplicit = $makeInheritedAssociatesExplicit; + } } diff --git a/references.txt b/references.txt index 37f41ea091b..5d34ad92204 100644 --- a/references.txt +++ b/references.txt @@ -445,3 +445,4 @@ c388d876a51d22b2b8a73249fe4694b297db6cd5 62b5cf36742b61ed6fb52a93f1c241070a87e6fb bb49fa04d50e4e0267846c7d805ae8ebc254bdea bb49fa04d50e4e0267846c7d805ae8ebc254bdea +619fb89cb6ac5d2a1d5f1b7d2f51a51e13e7ace9