diff --git a/changes.md b/changes.md index 2103f996302..873e2c2a21f 100644 --- a/changes.md +++ b/changes.md @@ -36,8 +36,11 @@ - added property `inheritedStores` to type `Company` - added property `inheritedStores` to type `Division` - added property `discountTypeCombination` to type `Cart` +- added property `customerGroupAssignments` to type `Customer` +- added property `customerGroupAssignments` to type `CustomerDraft` - added property `discountTypeCombination` to type `StagedOrder` - added property `discountTypeCombination` to type `Order` +- added property `priceCustomerGroupAssignments` to type `ProductSearchProjectionParams` - added property `businessUnit` to type `ShoppingList` - added property `businessUnit` to type `ShoppingListDraft` @@ -51,6 +54,26 @@ +
+Added QueryParameter(s) + +- added query parameter `priceCustomerGroupAssignments` to method `get /{projectKey}/products` +- added query parameter `priceCustomerGroupAssignments` to method `post /{projectKey}/products` +- added query parameter `priceCustomerGroupAssignments` to method `get /{projectKey}/product-projections` +- added query parameter `priceCustomerGroupAssignments` to method `get /{projectKey}/products/key={key}` +- added query parameter `priceCustomerGroupAssignments` to method `post /{projectKey}/products/key={key}` +- added query parameter `priceCustomerGroupAssignments` to method `delete /{projectKey}/products/key={key}` +- added query parameter `priceCustomerGroupAssignments` to method `get /{projectKey}/products/{ID}` +- added query parameter `priceCustomerGroupAssignments` to method `post /{projectKey}/products/{ID}` +- added query parameter `priceCustomerGroupAssignments` to method `delete /{projectKey}/products/{ID}` +- added query parameter `priceCustomerGroupAssignments` to method `get /{projectKey}/product-projections/search` +- added query parameter `priceCustomerGroupAssignments` to method `get /{projectKey}/product-projections/key={key}` +- added query parameter `priceCustomerGroupAssignments` to method `get /{projectKey}/product-projections/{ID}` +- added query parameter `priceCustomerGroupAssignments` to method `get /{projectKey}/in-store/key={storeKey}/product-projections/key={key}` +- added query parameter `priceCustomerGroupAssignments` to method `get /{projectKey}/in-store/key={storeKey}/product-projections/{ID}` +
+ +
Added Type(s) @@ -58,9 +81,20 @@ - added type `BestDeal` - added type `DiscountTypeCombination` - added type `Stacking` +- added type `CustomerGroupAssignment` +- added type `CustomerGroupAssignmentDraft` +- added type `CustomerAddCustomerGroupAssignmentAction` +- added type `CustomerRemoveCustomerGroupAssignmentAction` +- added type `CustomerSetCustomerGroupAssignmentsAction` - added type `AssociateRoleNameSetMessage` +- added type `CustomerGroupAssignmentAddedMessage` +- added type `CustomerGroupAssignmentRemovedMessage` +- added type `CustomerGroupAssignmentsSetMessage` - added type `OrderBusinessUnitSetMessage` - added type `AssociateRoleNameSetMessagePayload` +- added type `CustomerGroupAssignmentAddedMessagePayload` +- added type `CustomerGroupAssignmentRemovedMessagePayload` +- added type `CustomerGroupAssignmentsSetMessagePayload` - added type `OrderBusinessUnitSetMessagePayload` - added type `StagedOrderSetBusinessUnitAction` - added type `OrderSetBusinessUnitAction` diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyProductProjectionsByIDTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyProductProjectionsByIDTest.php index 1c8d49871d1..dae83d10ec7 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyProductProjectionsByIDTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyProductProjectionsByIDTest.php @@ -143,6 +143,19 @@ function (ApiRequestBuilder $builder): RequestInterface { 'get', 'test_projectKey/in-store/key=test_storeKey/product-projections/test_ID?priceCustomerGroup=priceCustomerGroup', ], + 'ByProjectKeyInStoreKeyByStoreKeyProductProjectionsByIDGet_withPriceCustomerGroupAssignments' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->inStoreKeyWithStoreKeyValue('test_storeKey') + ->productProjections() + ->withId('test_ID') + ->get() + ->withPriceCustomerGroupAssignments('priceCustomerGroupAssignments'); + }, + 'get', + 'test_projectKey/in-store/key=test_storeKey/product-projections/test_ID?priceCustomerGroupAssignments=priceCustomerGroupAssignments', + ], 'ByProjectKeyInStoreKeyByStoreKeyProductProjectionsByIDGet_withPriceChannel' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyProductProjectionsKeyByKeyTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyProductProjectionsKeyByKeyTest.php index da03b5d2f2e..cfb73fb041f 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyProductProjectionsKeyByKeyTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyProductProjectionsKeyByKeyTest.php @@ -143,6 +143,19 @@ function (ApiRequestBuilder $builder): RequestInterface { 'get', 'test_projectKey/in-store/key=test_storeKey/product-projections/key=test_key?priceCustomerGroup=priceCustomerGroup', ], + 'ByProjectKeyInStoreKeyByStoreKeyProductProjectionsKeyByKeyGet_withPriceCustomerGroupAssignments' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->inStoreKeyWithStoreKeyValue('test_storeKey') + ->productProjections() + ->withKey('test_key') + ->get() + ->withPriceCustomerGroupAssignments('priceCustomerGroupAssignments'); + }, + 'get', + 'test_projectKey/in-store/key=test_storeKey/product-projections/key=test_key?priceCustomerGroupAssignments=priceCustomerGroupAssignments', + ], 'ByProjectKeyInStoreKeyByStoreKeyProductProjectionsKeyByKeyGet_withPriceChannel' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductProjectionsByIDTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductProjectionsByIDTest.php index 2e7bdb76a12..158f8652ce8 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductProjectionsByIDTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductProjectionsByIDTest.php @@ -139,6 +139,18 @@ function (ApiRequestBuilder $builder): RequestInterface { 'get', 'test_projectKey/product-projections/test_ID?priceCustomerGroup=priceCustomerGroup', ], + 'ByProjectKeyProductProjectionsByIDGet_withPriceCustomerGroupAssignments' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->productProjections() + ->withId('test_ID') + ->get() + ->withPriceCustomerGroupAssignments('priceCustomerGroupAssignments'); + }, + 'get', + 'test_projectKey/product-projections/test_ID?priceCustomerGroupAssignments=priceCustomerGroupAssignments', + ], 'ByProjectKeyProductProjectionsByIDGet_withPriceChannel' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductProjectionsKeyByKeyTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductProjectionsKeyByKeyTest.php index a84252acdf6..9016cdb0e52 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductProjectionsKeyByKeyTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductProjectionsKeyByKeyTest.php @@ -139,6 +139,18 @@ function (ApiRequestBuilder $builder): RequestInterface { 'get', 'test_projectKey/product-projections/key=test_key?priceCustomerGroup=priceCustomerGroup', ], + 'ByProjectKeyProductProjectionsKeyByKeyGet_withPriceCustomerGroupAssignments' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->productProjections() + ->withKey('test_key') + ->get() + ->withPriceCustomerGroupAssignments('priceCustomerGroupAssignments'); + }, + 'get', + 'test_projectKey/product-projections/key=test_key?priceCustomerGroupAssignments=priceCustomerGroupAssignments', + ], 'ByProjectKeyProductProjectionsKeyByKeyGet_withPriceChannel' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductProjectionsSearchTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductProjectionsSearchTest.php index d472ccf888a..1980c42195a 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductProjectionsSearchTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductProjectionsSearchTest.php @@ -294,6 +294,18 @@ function (ApiRequestBuilder $builder): RequestInterface { 'get', 'test_projectKey/product-projections/search?priceCustomerGroup=priceCustomerGroup', ], + 'ByProjectKeyProductProjectionsSearchGet_withPriceCustomerGroupAssignments' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->productProjections() + ->search() + ->get() + ->withPriceCustomerGroupAssignments('priceCustomerGroupAssignments'); + }, + 'get', + 'test_projectKey/product-projections/search?priceCustomerGroupAssignments=priceCustomerGroupAssignments', + ], 'ByProjectKeyProductProjectionsSearchGet_withPriceChannel' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductProjectionsTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductProjectionsTest.php index 323fc7427e5..41c416d7eac 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductProjectionsTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductProjectionsTest.php @@ -148,6 +148,17 @@ function (ApiRequestBuilder $builder): RequestInterface { 'get', 'test_projectKey/product-projections?priceCustomerGroup=priceCustomerGroup', ], + 'ByProjectKeyProductProjectionsGet_withPriceCustomerGroupAssignments' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->productProjections() + ->get() + ->withPriceCustomerGroupAssignments('priceCustomerGroupAssignments'); + }, + 'get', + 'test_projectKey/product-projections?priceCustomerGroupAssignments=priceCustomerGroupAssignments', + ], 'ByProjectKeyProductProjectionsGet_withPriceChannel' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductsByIDTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductsByIDTest.php index daadeb3fca0..1232a645555 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductsByIDTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductsByIDTest.php @@ -140,6 +140,18 @@ function (ApiRequestBuilder $builder): RequestInterface { 'get', 'test_projectKey/products/test_ID?priceCustomerGroup=priceCustomerGroup', ], + 'ByProjectKeyProductsByIDGet_withPriceCustomerGroupAssignments' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->products() + ->withId('test_ID') + ->get() + ->withPriceCustomerGroupAssignments('priceCustomerGroupAssignments'); + }, + 'get', + 'test_projectKey/products/test_ID?priceCustomerGroupAssignments=priceCustomerGroupAssignments', + ], 'ByProjectKeyProductsByIDGet_withPriceChannel' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder @@ -222,6 +234,18 @@ function (ApiRequestBuilder $builder): RequestInterface { 'post', 'test_projectKey/products/test_ID?priceCustomerGroup=priceCustomerGroup', ], + 'ByProjectKeyProductsByIDPost_withPriceCustomerGroupAssignments' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->products() + ->withId('test_ID') + ->post(null) + ->withPriceCustomerGroupAssignments('priceCustomerGroupAssignments'); + }, + 'post', + 'test_projectKey/products/test_ID?priceCustomerGroupAssignments=priceCustomerGroupAssignments', + ], 'ByProjectKeyProductsByIDPost_withPriceChannel' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder @@ -293,6 +317,18 @@ function (ApiRequestBuilder $builder): RequestInterface { 'delete', 'test_projectKey/products/test_ID?priceCustomerGroup=priceCustomerGroup', ], + 'ByProjectKeyProductsByIDDelete_withPriceCustomerGroupAssignments' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->products() + ->withId('test_ID') + ->delete() + ->withPriceCustomerGroupAssignments('priceCustomerGroupAssignments'); + }, + 'delete', + 'test_projectKey/products/test_ID?priceCustomerGroupAssignments=priceCustomerGroupAssignments', + ], 'ByProjectKeyProductsByIDDelete_withPriceChannel' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductsKeyByKeyTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductsKeyByKeyTest.php index 676e8b660a6..0484389b10d 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductsKeyByKeyTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductsKeyByKeyTest.php @@ -139,6 +139,18 @@ function (ApiRequestBuilder $builder): RequestInterface { 'get', 'test_projectKey/products/key=test_key?priceCustomerGroup=priceCustomerGroup', ], + 'ByProjectKeyProductsKeyByKeyGet_withPriceCustomerGroupAssignments' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->products() + ->withKey('test_key') + ->get() + ->withPriceCustomerGroupAssignments('priceCustomerGroupAssignments'); + }, + 'get', + 'test_projectKey/products/key=test_key?priceCustomerGroupAssignments=priceCustomerGroupAssignments', + ], 'ByProjectKeyProductsKeyByKeyGet_withPriceChannel' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder @@ -221,6 +233,18 @@ function (ApiRequestBuilder $builder): RequestInterface { 'post', 'test_projectKey/products/key=test_key?priceCustomerGroup=priceCustomerGroup', ], + 'ByProjectKeyProductsKeyByKeyPost_withPriceCustomerGroupAssignments' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->products() + ->withKey('test_key') + ->post(null) + ->withPriceCustomerGroupAssignments('priceCustomerGroupAssignments'); + }, + 'post', + 'test_projectKey/products/key=test_key?priceCustomerGroupAssignments=priceCustomerGroupAssignments', + ], 'ByProjectKeyProductsKeyByKeyPost_withPriceChannel' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder @@ -292,6 +316,18 @@ function (ApiRequestBuilder $builder): RequestInterface { 'delete', 'test_projectKey/products/key=test_key?priceCustomerGroup=priceCustomerGroup', ], + 'ByProjectKeyProductsKeyByKeyDelete_withPriceCustomerGroupAssignments' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->products() + ->withKey('test_key') + ->delete() + ->withPriceCustomerGroupAssignments('priceCustomerGroupAssignments'); + }, + 'delete', + 'test_projectKey/products/key=test_key?priceCustomerGroupAssignments=priceCustomerGroupAssignments', + ], 'ByProjectKeyProductsKeyByKeyDelete_withPriceChannel' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductsTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductsTest.php index 16922ba5bdc..d2b02b69f23 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductsTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductsTest.php @@ -148,6 +148,17 @@ function (ApiRequestBuilder $builder): RequestInterface { 'get', 'test_projectKey/products?priceCustomerGroup=priceCustomerGroup', ], + 'ByProjectKeyProductsGet_withPriceCustomerGroupAssignments' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->products() + ->get() + ->withPriceCustomerGroupAssignments('priceCustomerGroupAssignments'); + }, + 'get', + 'test_projectKey/products?priceCustomerGroupAssignments=priceCustomerGroupAssignments', + ], 'ByProjectKeyProductsGet_withPriceChannel' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder @@ -289,6 +300,17 @@ function (ApiRequestBuilder $builder): RequestInterface { 'post', 'test_projectKey/products?priceCustomerGroup=priceCustomerGroup', ], + 'ByProjectKeyProductsPost_withPriceCustomerGroupAssignments' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->products() + ->post(null) + ->withPriceCustomerGroupAssignments('priceCustomerGroupAssignments'); + }, + 'post', + 'test_projectKey/products?priceCustomerGroupAssignments=priceCustomerGroupAssignments', + ], 'ByProjectKeyProductsPost_withPriceChannel' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyProductProjectionsByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyProductProjectionsByIDGet.php index 9c30bf58cc2..16b39ec255c 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyProductProjectionsByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyProductProjectionsByIDGet.php @@ -183,6 +183,15 @@ public function withPriceCustomerGroup($priceCustomerGroup): ByProjectKeyInStore return $this->withQueryParam('priceCustomerGroup', $priceCustomerGroup); } + /** + * + * @psalm-param scalar|scalar[] $priceCustomerGroupAssignments + */ + public function withPriceCustomerGroupAssignments($priceCustomerGroupAssignments): ByProjectKeyInStoreKeyByStoreKeyProductProjectionsByIDGet + { + return $this->withQueryParam('priceCustomerGroupAssignments', $priceCustomerGroupAssignments); + } + /** * * @psalm-param scalar|scalar[] $priceChannel diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyProductProjectionsKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyProductProjectionsKeyByKeyGet.php index 7a8276cd2f3..33c51a2cc1e 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyProductProjectionsKeyByKeyGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyProductProjectionsKeyByKeyGet.php @@ -183,6 +183,15 @@ public function withPriceCustomerGroup($priceCustomerGroup): ByProjectKeyInStore return $this->withQueryParam('priceCustomerGroup', $priceCustomerGroup); } + /** + * + * @psalm-param scalar|scalar[] $priceCustomerGroupAssignments + */ + public function withPriceCustomerGroupAssignments($priceCustomerGroupAssignments): ByProjectKeyInStoreKeyByStoreKeyProductProjectionsKeyByKeyGet + { + return $this->withQueryParam('priceCustomerGroupAssignments', $priceCustomerGroupAssignments); + } + /** * * @psalm-param scalar|scalar[] $priceChannel diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsByIDGet.php index 33da406269c..cfd468ba443 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsByIDGet.php @@ -184,6 +184,15 @@ public function withPriceCustomerGroup($priceCustomerGroup): ByProjectKeyProduct return $this->withQueryParam('priceCustomerGroup', $priceCustomerGroup); } + /** + * + * @psalm-param scalar|scalar[] $priceCustomerGroupAssignments + */ + public function withPriceCustomerGroupAssignments($priceCustomerGroupAssignments): ByProjectKeyProductProjectionsByIDGet + { + return $this->withQueryParam('priceCustomerGroupAssignments', $priceCustomerGroupAssignments); + } + /** * * @psalm-param scalar|scalar[] $priceChannel diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsGet.php index b5a9017ae9e..05baf97b801 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsGet.php @@ -187,6 +187,15 @@ public function withPriceCustomerGroup($priceCustomerGroup): ByProjectKeyProduct return $this->withQueryParam('priceCustomerGroup', $priceCustomerGroup); } + /** + * + * @psalm-param scalar|scalar[] $priceCustomerGroupAssignments + */ + public function withPriceCustomerGroupAssignments($priceCustomerGroupAssignments): ByProjectKeyProductProjectionsGet + { + return $this->withQueryParam('priceCustomerGroupAssignments', $priceCustomerGroupAssignments); + } + /** * * @psalm-param scalar|scalar[] $priceChannel diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsKeyByKeyGet.php index f6816be66ee..3ffdff59e02 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsKeyByKeyGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsKeyByKeyGet.php @@ -184,6 +184,15 @@ public function withPriceCustomerGroup($priceCustomerGroup): ByProjectKeyProduct return $this->withQueryParam('priceCustomerGroup', $priceCustomerGroup); } + /** + * + * @psalm-param scalar|scalar[] $priceCustomerGroupAssignments + */ + public function withPriceCustomerGroupAssignments($priceCustomerGroupAssignments): ByProjectKeyProductProjectionsKeyByKeyGet + { + return $this->withQueryParam('priceCustomerGroupAssignments', $priceCustomerGroupAssignments); + } + /** * * @psalm-param scalar|scalar[] $priceChannel diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsSearchGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsSearchGet.php index 63131a48607..64231a2ea3f 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsSearchGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsSearchGet.php @@ -294,6 +294,15 @@ public function withPriceCustomerGroup($priceCustomerGroup): ByProjectKeyProduct return $this->withQueryParam('priceCustomerGroup', $priceCustomerGroup); } + /** + * + * @psalm-param scalar|scalar[] $priceCustomerGroupAssignments + */ + public function withPriceCustomerGroupAssignments($priceCustomerGroupAssignments): ByProjectKeyProductProjectionsSearchGet + { + return $this->withQueryParam('priceCustomerGroupAssignments', $priceCustomerGroupAssignments); + } + /** * * @psalm-param scalar|scalar[] $priceChannel diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsByIDDelete.php index 4e3a9525223..e48e443f25c 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsByIDDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsByIDDelete.php @@ -178,6 +178,15 @@ public function withPriceCustomerGroup($priceCustomerGroup): ByProjectKeyProduct return $this->withQueryParam('priceCustomerGroup', $priceCustomerGroup); } + /** + * + * @psalm-param scalar|scalar[] $priceCustomerGroupAssignments + */ + public function withPriceCustomerGroupAssignments($priceCustomerGroupAssignments): ByProjectKeyProductsByIDDelete + { + return $this->withQueryParam('priceCustomerGroupAssignments', $priceCustomerGroupAssignments); + } + /** * * @psalm-param scalar|scalar[] $priceChannel diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsByIDGet.php index 0843170efcf..e86c5b9f017 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsByIDGet.php @@ -172,6 +172,15 @@ public function withPriceCustomerGroup($priceCustomerGroup): ByProjectKeyProduct return $this->withQueryParam('priceCustomerGroup', $priceCustomerGroup); } + /** + * + * @psalm-param scalar|scalar[] $priceCustomerGroupAssignments + */ + public function withPriceCustomerGroupAssignments($priceCustomerGroupAssignments): ByProjectKeyProductsByIDGet + { + return $this->withQueryParam('priceCustomerGroupAssignments', $priceCustomerGroupAssignments); + } + /** * * @psalm-param scalar|scalar[] $priceChannel diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsByIDPost.php index 4524f613874..c2aadba3074 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsByIDPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsByIDPost.php @@ -177,6 +177,15 @@ public function withPriceCustomerGroup($priceCustomerGroup): ByProjectKeyProduct return $this->withQueryParam('priceCustomerGroup', $priceCustomerGroup); } + /** + * + * @psalm-param scalar|scalar[] $priceCustomerGroupAssignments + */ + public function withPriceCustomerGroupAssignments($priceCustomerGroupAssignments): ByProjectKeyProductsByIDPost + { + return $this->withQueryParam('priceCustomerGroupAssignments', $priceCustomerGroupAssignments); + } + /** * * @psalm-param scalar|scalar[] $priceChannel diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsGet.php index 592190c695b..9407d50f1fb 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsGet.php @@ -184,6 +184,15 @@ public function withPriceCustomerGroup($priceCustomerGroup): ByProjectKeyProduct return $this->withQueryParam('priceCustomerGroup', $priceCustomerGroup); } + /** + * + * @psalm-param scalar|scalar[] $priceCustomerGroupAssignments + */ + public function withPriceCustomerGroupAssignments($priceCustomerGroupAssignments): ByProjectKeyProductsGet + { + return $this->withQueryParam('priceCustomerGroupAssignments', $priceCustomerGroupAssignments); + } + /** * * @psalm-param scalar|scalar[] $priceChannel diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsKeyByKeyDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsKeyByKeyDelete.php index b894d022b87..a10bdd5c517 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsKeyByKeyDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsKeyByKeyDelete.php @@ -178,6 +178,15 @@ public function withPriceCustomerGroup($priceCustomerGroup): ByProjectKeyProduct return $this->withQueryParam('priceCustomerGroup', $priceCustomerGroup); } + /** + * + * @psalm-param scalar|scalar[] $priceCustomerGroupAssignments + */ + public function withPriceCustomerGroupAssignments($priceCustomerGroupAssignments): ByProjectKeyProductsKeyByKeyDelete + { + return $this->withQueryParam('priceCustomerGroupAssignments', $priceCustomerGroupAssignments); + } + /** * * @psalm-param scalar|scalar[] $priceChannel diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsKeyByKeyGet.php index 900aadc6ef2..bccbdbe71c5 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsKeyByKeyGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsKeyByKeyGet.php @@ -172,6 +172,15 @@ public function withPriceCustomerGroup($priceCustomerGroup): ByProjectKeyProduct return $this->withQueryParam('priceCustomerGroup', $priceCustomerGroup); } + /** + * + * @psalm-param scalar|scalar[] $priceCustomerGroupAssignments + */ + public function withPriceCustomerGroupAssignments($priceCustomerGroupAssignments): ByProjectKeyProductsKeyByKeyGet + { + return $this->withQueryParam('priceCustomerGroupAssignments', $priceCustomerGroupAssignments); + } + /** * * @psalm-param scalar|scalar[] $priceChannel diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsKeyByKeyPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsKeyByKeyPost.php index b983adf05e5..2d289e19d2f 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsKeyByKeyPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsKeyByKeyPost.php @@ -177,6 +177,15 @@ public function withPriceCustomerGroup($priceCustomerGroup): ByProjectKeyProduct return $this->withQueryParam('priceCustomerGroup', $priceCustomerGroup); } + /** + * + * @psalm-param scalar|scalar[] $priceCustomerGroupAssignments + */ + public function withPriceCustomerGroupAssignments($priceCustomerGroupAssignments): ByProjectKeyProductsKeyByKeyPost + { + return $this->withQueryParam('priceCustomerGroupAssignments', $priceCustomerGroupAssignments); + } + /** * * @psalm-param scalar|scalar[] $priceChannel diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsPost.php index cd6d122568d..1c07e653e9f 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsPost.php @@ -172,6 +172,15 @@ public function withPriceCustomerGroup($priceCustomerGroup): ByProjectKeyProduct return $this->withQueryParam('priceCustomerGroup', $priceCustomerGroup); } + /** + * + * @psalm-param scalar|scalar[] $priceCustomerGroupAssignments + */ + public function withPriceCustomerGroupAssignments($priceCustomerGroupAssignments): ByProjectKeyProductsPost + { + return $this->withQueryParam('priceCustomerGroupAssignments', $priceCustomerGroupAssignments); + } + /** * * @psalm-param scalar|scalar[] $priceChannel diff --git a/lib/commercetools-api/src/Client/Resource/PriceSelecting.php b/lib/commercetools-api/src/Client/Resource/PriceSelecting.php index 5f48d221e3d..4172be0e796 100644 --- a/lib/commercetools-api/src/Client/Resource/PriceSelecting.php +++ b/lib/commercetools-api/src/Client/Resource/PriceSelecting.php @@ -34,6 +34,12 @@ public function withPriceCountry(string $priceCountry); */ public function withPriceCustomerGroup(string $priceCustomerGroup); + /** + * @return ApiRequestInterface + * @psalm-return T + */ + public function withPriceCustomerGroupAssignments(string $priceCustomerGroupAssignments); + /** * @return ApiRequestInterface * @psalm-return T diff --git a/lib/commercetools-api/src/Models/Common/BaseResource.php b/lib/commercetools-api/src/Models/Common/BaseResource.php index b966964e5bd..fc499df0c40 100644 --- a/lib/commercetools-api/src/Models/Common/BaseResource.php +++ b/lib/commercetools-api/src/Models/Common/BaseResource.php @@ -107,6 +107,9 @@ use Commercetools\Api\Models\Message\CustomerEmailTokenCreatedMessage; use Commercetools\Api\Models\Message\CustomerEmailVerifiedMessage; use Commercetools\Api\Models\Message\CustomerFirstNameSetMessage; +use Commercetools\Api\Models\Message\CustomerGroupAssignmentAddedMessage; +use Commercetools\Api\Models\Message\CustomerGroupAssignmentRemovedMessage; +use Commercetools\Api\Models\Message\CustomerGroupAssignmentsSetMessage; use Commercetools\Api\Models\Message\CustomerGroupCustomFieldAddedMessage; use Commercetools\Api\Models\Message\CustomerGroupCustomFieldChangedMessage; use Commercetools\Api\Models\Message\CustomerGroupCustomFieldRemovedMessage; diff --git a/lib/commercetools-api/src/Models/Common/BaseResourceBuilder.php b/lib/commercetools-api/src/Models/Common/BaseResourceBuilder.php index 25be2c9be0b..f90d9c75ab1 100644 --- a/lib/commercetools-api/src/Models/Common/BaseResourceBuilder.php +++ b/lib/commercetools-api/src/Models/Common/BaseResourceBuilder.php @@ -206,6 +206,12 @@ use Commercetools\Api\Models\Message\CustomerEmailVerifiedMessageBuilder; use Commercetools\Api\Models\Message\CustomerFirstNameSetMessage; use Commercetools\Api\Models\Message\CustomerFirstNameSetMessageBuilder; +use Commercetools\Api\Models\Message\CustomerGroupAssignmentAddedMessage; +use Commercetools\Api\Models\Message\CustomerGroupAssignmentAddedMessageBuilder; +use Commercetools\Api\Models\Message\CustomerGroupAssignmentRemovedMessage; +use Commercetools\Api\Models\Message\CustomerGroupAssignmentRemovedMessageBuilder; +use Commercetools\Api\Models\Message\CustomerGroupAssignmentsSetMessage; +use Commercetools\Api\Models\Message\CustomerGroupAssignmentsSetMessageBuilder; use Commercetools\Api\Models\Message\CustomerGroupCustomFieldAddedMessage; use Commercetools\Api\Models\Message\CustomerGroupCustomFieldAddedMessageBuilder; use Commercetools\Api\Models\Message\CustomerGroupCustomFieldChangedMessage; diff --git a/lib/commercetools-api/src/Models/Common/BaseResourceModel.php b/lib/commercetools-api/src/Models/Common/BaseResourceModel.php index de54b6c11e2..e736aa14af5 100644 --- a/lib/commercetools-api/src/Models/Common/BaseResourceModel.php +++ b/lib/commercetools-api/src/Models/Common/BaseResourceModel.php @@ -206,6 +206,12 @@ use Commercetools\Api\Models\Message\CustomerEmailVerifiedMessageModel; use Commercetools\Api\Models\Message\CustomerFirstNameSetMessage; use Commercetools\Api\Models\Message\CustomerFirstNameSetMessageModel; +use Commercetools\Api\Models\Message\CustomerGroupAssignmentAddedMessage; +use Commercetools\Api\Models\Message\CustomerGroupAssignmentAddedMessageModel; +use Commercetools\Api\Models\Message\CustomerGroupAssignmentRemovedMessage; +use Commercetools\Api\Models\Message\CustomerGroupAssignmentRemovedMessageModel; +use Commercetools\Api\Models\Message\CustomerGroupAssignmentsSetMessage; +use Commercetools\Api\Models\Message\CustomerGroupAssignmentsSetMessageModel; use Commercetools\Api\Models\Message\CustomerGroupCustomFieldAddedMessage; use Commercetools\Api\Models\Message\CustomerGroupCustomFieldAddedMessageModel; use Commercetools\Api\Models\Message\CustomerGroupCustomFieldChangedMessage; diff --git a/lib/commercetools-api/src/Models/Customer/Customer.php b/lib/commercetools-api/src/Models/Customer/Customer.php index 697b1fa0efb..0f410d15cfc 100644 --- a/lib/commercetools-api/src/Models/Customer/Customer.php +++ b/lib/commercetools-api/src/Models/Customer/Customer.php @@ -47,6 +47,7 @@ interface Customer extends BaseResource public const FIELD_SALUTATION = 'salutation'; public const FIELD_STORES = 'stores'; public const FIELD_AUTHENTICATION_MODE = 'authenticationMode'; + public const FIELD_CUSTOMER_GROUP_ASSIGNMENTS = 'customerGroupAssignments'; /** *

Unique identifier of the Customer.

@@ -294,6 +295,14 @@ public function getStores(); */ public function getAuthenticationMode(); + /** + *

Customer Groups that the Customer belongs to.

+ * + + * @return null|CustomerGroupAssignmentCollection + */ + public function getCustomerGroupAssignments(); + /** * @param ?string $id */ @@ -443,4 +452,9 @@ public function setStores(?StoreKeyReferenceCollection $stores): void; * @param ?string $authenticationMode */ public function setAuthenticationMode(?string $authenticationMode): void; + + /** + * @param ?CustomerGroupAssignmentCollection $customerGroupAssignments + */ + public function setCustomerGroupAssignments(?CustomerGroupAssignmentCollection $customerGroupAssignments): void; } diff --git a/lib/commercetools-api/src/Models/Customer/CustomerAddCustomerGroupAssignmentAction.php b/lib/commercetools-api/src/Models/Customer/CustomerAddCustomerGroupAssignmentAction.php new file mode 100644 index 00000000000..53ca9859c45 --- /dev/null +++ b/lib/commercetools-api/src/Models/Customer/CustomerAddCustomerGroupAssignmentAction.php @@ -0,0 +1,30 @@ +Customer Group to assign the Customer to.

+ * + + * @return null|CustomerGroupAssignmentDraft + */ + public function getCustomerGroupAssignment(); + + /** + * @param ?CustomerGroupAssignmentDraft $customerGroupAssignment + */ + public function setCustomerGroupAssignment(?CustomerGroupAssignmentDraft $customerGroupAssignment): void; +} diff --git a/lib/commercetools-api/src/Models/Customer/CustomerAddCustomerGroupAssignmentActionBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerAddCustomerGroupAssignmentActionBuilder.php new file mode 100644 index 00000000000..93aac181281 --- /dev/null +++ b/lib/commercetools-api/src/Models/Customer/CustomerAddCustomerGroupAssignmentActionBuilder.php @@ -0,0 +1,73 @@ + + */ +final class CustomerAddCustomerGroupAssignmentActionBuilder implements Builder +{ + /** + + * @var null|CustomerGroupAssignmentDraft|CustomerGroupAssignmentDraftBuilder + */ + private $customerGroupAssignment; + + /** + *

Customer Group to assign the Customer to.

+ * + + * @return null|CustomerGroupAssignmentDraft + */ + public function getCustomerGroupAssignment() + { + return $this->customerGroupAssignment instanceof CustomerGroupAssignmentDraftBuilder ? $this->customerGroupAssignment->build() : $this->customerGroupAssignment; + } + + /** + * @param ?CustomerGroupAssignmentDraft $customerGroupAssignment + * @return $this + */ + public function withCustomerGroupAssignment(?CustomerGroupAssignmentDraft $customerGroupAssignment) + { + $this->customerGroupAssignment = $customerGroupAssignment; + + return $this; + } + + /** + * @deprecated use withCustomerGroupAssignment() instead + * @return $this + */ + public function withCustomerGroupAssignmentBuilder(?CustomerGroupAssignmentDraftBuilder $customerGroupAssignment) + { + $this->customerGroupAssignment = $customerGroupAssignment; + + return $this; + } + + public function build(): CustomerAddCustomerGroupAssignmentAction + { + return new CustomerAddCustomerGroupAssignmentActionModel( + $this->customerGroupAssignment instanceof CustomerGroupAssignmentDraftBuilder ? $this->customerGroupAssignment->build() : $this->customerGroupAssignment + ); + } + + public static function of(): CustomerAddCustomerGroupAssignmentActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Customer/CustomerAddCustomerGroupAssignmentActionCollection.php b/lib/commercetools-api/src/Models/Customer/CustomerAddCustomerGroupAssignmentActionCollection.php new file mode 100644 index 00000000000..c5929824db8 --- /dev/null +++ b/lib/commercetools-api/src/Models/Customer/CustomerAddCustomerGroupAssignmentActionCollection.php @@ -0,0 +1,56 @@ + + * @method CustomerAddCustomerGroupAssignmentAction current() + * @method CustomerAddCustomerGroupAssignmentAction end() + * @method CustomerAddCustomerGroupAssignmentAction at($offset) + */ +class CustomerAddCustomerGroupAssignmentActionCollection extends CustomerUpdateActionCollection +{ + /** + * @psalm-assert CustomerAddCustomerGroupAssignmentAction $value + * @psalm-param CustomerAddCustomerGroupAssignmentAction|stdClass $value + * @throws InvalidArgumentException + * + * @return CustomerAddCustomerGroupAssignmentActionCollection + */ + public function add($value) + { + if (!$value instanceof CustomerAddCustomerGroupAssignmentAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CustomerAddCustomerGroupAssignmentAction + */ + protected function mapper() + { + return function (?int $index): ?CustomerAddCustomerGroupAssignmentAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CustomerAddCustomerGroupAssignmentAction $data */ + $data = CustomerAddCustomerGroupAssignmentActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Customer/CustomerAddCustomerGroupAssignmentActionModel.php b/lib/commercetools-api/src/Models/Customer/CustomerAddCustomerGroupAssignmentActionModel.php new file mode 100644 index 00000000000..ecb4d849c74 --- /dev/null +++ b/lib/commercetools-api/src/Models/Customer/CustomerAddCustomerGroupAssignmentActionModel.php @@ -0,0 +1,94 @@ +customerGroupAssignment = $customerGroupAssignment; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

Customer Group to assign the Customer to.

+ * + * + * @return null|CustomerGroupAssignmentDraft + */ + public function getCustomerGroupAssignment() + { + if (is_null($this->customerGroupAssignment)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOMER_GROUP_ASSIGNMENT); + if (is_null($data)) { + return null; + } + + $this->customerGroupAssignment = CustomerGroupAssignmentDraftModel::of($data); + } + + return $this->customerGroupAssignment; + } + + + /** + * @param ?CustomerGroupAssignmentDraft $customerGroupAssignment + */ + public function setCustomerGroupAssignment(?CustomerGroupAssignmentDraft $customerGroupAssignment): void + { + $this->customerGroupAssignment = $customerGroupAssignment; + } +} diff --git a/lib/commercetools-api/src/Models/Customer/CustomerBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerBuilder.php index 2700f97d67a..cebabe05190 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerBuilder.php @@ -213,6 +213,12 @@ final class CustomerBuilder implements Builder */ private $authenticationMode; + /** + + * @var ?CustomerGroupAssignmentCollection + */ + private $customerGroupAssignments; + /** *

Unique identifier of the Customer.

* @@ -549,6 +555,17 @@ public function getAuthenticationMode() return $this->authenticationMode; } + /** + *

Customer Groups that the Customer belongs to.

+ * + + * @return null|CustomerGroupAssignmentCollection + */ + public function getCustomerGroupAssignments() + { + return $this->customerGroupAssignments; + } + /** * @param ?string $id * @return $this @@ -879,6 +896,17 @@ public function withAuthenticationMode(?string $authenticationMode) return $this; } + /** + * @param ?CustomerGroupAssignmentCollection $customerGroupAssignments + * @return $this + */ + public function withCustomerGroupAssignments(?CustomerGroupAssignmentCollection $customerGroupAssignments) + { + $this->customerGroupAssignments = $customerGroupAssignments; + + return $this; + } + /** * @deprecated use withLastModifiedBy() instead * @return $this @@ -955,7 +983,8 @@ public function build(): Customer $this->locale, $this->salutation, $this->stores, - $this->authenticationMode + $this->authenticationMode, + $this->customerGroupAssignments ); } diff --git a/lib/commercetools-api/src/Models/Customer/CustomerDraft.php b/lib/commercetools-api/src/Models/Customer/CustomerDraft.php index 84afee48efb..024f2dcb5e6 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerDraft.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerDraft.php @@ -46,6 +46,7 @@ interface CustomerDraft extends JsonObject public const FIELD_SALUTATION = 'salutation'; public const FIELD_STORES = 'stores'; public const FIELD_AUTHENTICATION_MODE = 'authenticationMode'; + public const FIELD_CUSTOMER_GROUP_ASSIGNMENTS = 'customerGroupAssignments'; /** *

User-defined unique identifier for the Customer. @@ -282,6 +283,14 @@ public function getStores(); */ public function getAuthenticationMode(); + /** + *

Customer Groups to assign the Customer to.

+ * + + * @return null|CustomerGroupAssignmentDraftCollection + */ + public function getCustomerGroupAssignments(); + /** * @param ?string $key */ @@ -416,4 +425,9 @@ public function setStores(?StoreResourceIdentifierCollection $stores): void; * @param ?string $authenticationMode */ public function setAuthenticationMode(?string $authenticationMode): void; + + /** + * @param ?CustomerGroupAssignmentDraftCollection $customerGroupAssignments + */ + public function setCustomerGroupAssignments(?CustomerGroupAssignmentDraftCollection $customerGroupAssignments): void; } diff --git a/lib/commercetools-api/src/Models/Customer/CustomerDraftBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerDraftBuilder.php index db42dbea3ae..8215a95b482 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerDraftBuilder.php @@ -191,6 +191,12 @@ final class CustomerDraftBuilder implements Builder */ private $authenticationMode; + /** + + * @var ?CustomerGroupAssignmentDraftCollection + */ + private $customerGroupAssignments; + /** *

User-defined unique identifier for the Customer. * The key field is preferred over customerNumber as it is mutable and provides more flexibility.

@@ -507,6 +513,17 @@ public function getAuthenticationMode() return $this->authenticationMode; } + /** + *

Customer Groups to assign the Customer to.

+ * + + * @return null|CustomerGroupAssignmentDraftCollection + */ + public function getCustomerGroupAssignments() + { + return $this->customerGroupAssignments; + } + /** * @param ?string $key * @return $this @@ -804,6 +821,17 @@ public function withAuthenticationMode(?string $authenticationMode) return $this; } + /** + * @param ?CustomerGroupAssignmentDraftCollection $customerGroupAssignments + * @return $this + */ + public function withCustomerGroupAssignments(?CustomerGroupAssignmentDraftCollection $customerGroupAssignments) + { + $this->customerGroupAssignments = $customerGroupAssignments; + + return $this; + } + /** * @deprecated use withAnonymousCart() instead * @return $this @@ -866,7 +894,8 @@ public function build(): CustomerDraft $this->locale, $this->salutation, $this->stores, - $this->authenticationMode + $this->authenticationMode, + $this->customerGroupAssignments ); } diff --git a/lib/commercetools-api/src/Models/Customer/CustomerDraftModel.php b/lib/commercetools-api/src/Models/Customer/CustomerDraftModel.php index 96a838aa006..a1a5aca1c2a 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerDraftModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerDraftModel.php @@ -190,6 +190,12 @@ final class CustomerDraftModel extends JsonObjectModel implements CustomerDraft */ protected $authenticationMode; + /** + * + * @var ?CustomerGroupAssignmentDraftCollection + */ + protected $customerGroupAssignments; + /** * @psalm-suppress MissingParamType @@ -221,7 +227,8 @@ public function __construct( ?string $locale = null, ?string $salutation = null, ?StoreResourceIdentifierCollection $stores = null, - ?string $authenticationMode = null + ?string $authenticationMode = null, + ?CustomerGroupAssignmentDraftCollection $customerGroupAssignments = null ) { $this->key = $key; $this->customerNumber = $customerNumber; @@ -250,6 +257,7 @@ public function __construct( $this->salutation = $salutation; $this->stores = $stores; $this->authenticationMode = $authenticationMode; + $this->customerGroupAssignments = $customerGroupAssignments; } /** @@ -818,6 +826,26 @@ public function getAuthenticationMode() return $this->authenticationMode; } + /** + *

Customer Groups to assign the Customer to.

+ * + * + * @return null|CustomerGroupAssignmentDraftCollection + */ + public function getCustomerGroupAssignments() + { + if (is_null($this->customerGroupAssignments)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_CUSTOMER_GROUP_ASSIGNMENTS); + if (is_null($data)) { + return null; + } + $this->customerGroupAssignments = CustomerGroupAssignmentDraftCollection::fromArray($data); + } + + return $this->customerGroupAssignments; + } + /** * @param ?string $key @@ -1035,6 +1063,14 @@ public function setAuthenticationMode(?string $authenticationMode): void $this->authenticationMode = $authenticationMode; } + /** + * @param ?CustomerGroupAssignmentDraftCollection $customerGroupAssignments + */ + public function setCustomerGroupAssignments(?CustomerGroupAssignmentDraftCollection $customerGroupAssignments): void + { + $this->customerGroupAssignments = $customerGroupAssignments; + } + #[\ReturnTypeWillChange] public function jsonSerialize() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerGroupAssignment.php b/lib/commercetools-api/src/Models/Customer/CustomerGroupAssignment.php new file mode 100644 index 00000000000..45866761f58 --- /dev/null +++ b/lib/commercetools-api/src/Models/Customer/CustomerGroupAssignment.php @@ -0,0 +1,31 @@ +Reference to a Customer Group.

+ * + + * @return null|CustomerGroupReference + */ + public function getCustomerGroup(); + + /** + * @param ?CustomerGroupReference $customerGroup + */ + public function setCustomerGroup(?CustomerGroupReference $customerGroup): void; +} diff --git a/lib/commercetools-api/src/Models/Customer/CustomerGroupAssignmentBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerGroupAssignmentBuilder.php new file mode 100644 index 00000000000..fa2e9cc6f32 --- /dev/null +++ b/lib/commercetools-api/src/Models/Customer/CustomerGroupAssignmentBuilder.php @@ -0,0 +1,75 @@ + + */ +final class CustomerGroupAssignmentBuilder implements Builder +{ + /** + + * @var null|CustomerGroupReference|CustomerGroupReferenceBuilder + */ + private $customerGroup; + + /** + *

Reference to a Customer Group.

+ * + + * @return null|CustomerGroupReference + */ + public function getCustomerGroup() + { + return $this->customerGroup instanceof CustomerGroupReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup; + } + + /** + * @param ?CustomerGroupReference $customerGroup + * @return $this + */ + public function withCustomerGroup(?CustomerGroupReference $customerGroup) + { + $this->customerGroup = $customerGroup; + + return $this; + } + + /** + * @deprecated use withCustomerGroup() instead + * @return $this + */ + public function withCustomerGroupBuilder(?CustomerGroupReferenceBuilder $customerGroup) + { + $this->customerGroup = $customerGroup; + + return $this; + } + + public function build(): CustomerGroupAssignment + { + return new CustomerGroupAssignmentModel( + $this->customerGroup instanceof CustomerGroupReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup + ); + } + + public static function of(): CustomerGroupAssignmentBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Customer/CustomerGroupAssignmentCollection.php b/lib/commercetools-api/src/Models/Customer/CustomerGroupAssignmentCollection.php new file mode 100644 index 00000000000..ec083c12570 --- /dev/null +++ b/lib/commercetools-api/src/Models/Customer/CustomerGroupAssignmentCollection.php @@ -0,0 +1,56 @@ + + * @method CustomerGroupAssignment current() + * @method CustomerGroupAssignment end() + * @method CustomerGroupAssignment at($offset) + */ +class CustomerGroupAssignmentCollection extends MapperSequence +{ + /** + * @psalm-assert CustomerGroupAssignment $value + * @psalm-param CustomerGroupAssignment|stdClass $value + * @throws InvalidArgumentException + * + * @return CustomerGroupAssignmentCollection + */ + public function add($value) + { + if (!$value instanceof CustomerGroupAssignment) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CustomerGroupAssignment + */ + protected function mapper() + { + return function (?int $index): ?CustomerGroupAssignment { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CustomerGroupAssignment $data */ + $data = CustomerGroupAssignmentModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Customer/CustomerGroupAssignmentDraft.php b/lib/commercetools-api/src/Models/Customer/CustomerGroupAssignmentDraft.php new file mode 100644 index 00000000000..d9fff9ced6e --- /dev/null +++ b/lib/commercetools-api/src/Models/Customer/CustomerGroupAssignmentDraft.php @@ -0,0 +1,31 @@ +ResourceIdentifier of a Customer Group.

+ * + + * @return null|CustomerGroupResourceIdentifier + */ + public function getCustomerGroup(); + + /** + * @param ?CustomerGroupResourceIdentifier $customerGroup + */ + public function setCustomerGroup(?CustomerGroupResourceIdentifier $customerGroup): void; +} diff --git a/lib/commercetools-api/src/Models/Customer/CustomerGroupAssignmentDraftBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerGroupAssignmentDraftBuilder.php new file mode 100644 index 00000000000..143a66cf803 --- /dev/null +++ b/lib/commercetools-api/src/Models/Customer/CustomerGroupAssignmentDraftBuilder.php @@ -0,0 +1,75 @@ + + */ +final class CustomerGroupAssignmentDraftBuilder implements Builder +{ + /** + + * @var null|CustomerGroupResourceIdentifier|CustomerGroupResourceIdentifierBuilder + */ + private $customerGroup; + + /** + *

ResourceIdentifier of a Customer Group.

+ * + + * @return null|CustomerGroupResourceIdentifier + */ + public function getCustomerGroup() + { + return $this->customerGroup instanceof CustomerGroupResourceIdentifierBuilder ? $this->customerGroup->build() : $this->customerGroup; + } + + /** + * @param ?CustomerGroupResourceIdentifier $customerGroup + * @return $this + */ + public function withCustomerGroup(?CustomerGroupResourceIdentifier $customerGroup) + { + $this->customerGroup = $customerGroup; + + return $this; + } + + /** + * @deprecated use withCustomerGroup() instead + * @return $this + */ + public function withCustomerGroupBuilder(?CustomerGroupResourceIdentifierBuilder $customerGroup) + { + $this->customerGroup = $customerGroup; + + return $this; + } + + public function build(): CustomerGroupAssignmentDraft + { + return new CustomerGroupAssignmentDraftModel( + $this->customerGroup instanceof CustomerGroupResourceIdentifierBuilder ? $this->customerGroup->build() : $this->customerGroup + ); + } + + public static function of(): CustomerGroupAssignmentDraftBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Customer/CustomerGroupAssignmentDraftCollection.php b/lib/commercetools-api/src/Models/Customer/CustomerGroupAssignmentDraftCollection.php new file mode 100644 index 00000000000..8afd03d8505 --- /dev/null +++ b/lib/commercetools-api/src/Models/Customer/CustomerGroupAssignmentDraftCollection.php @@ -0,0 +1,56 @@ + + * @method CustomerGroupAssignmentDraft current() + * @method CustomerGroupAssignmentDraft end() + * @method CustomerGroupAssignmentDraft at($offset) + */ +class CustomerGroupAssignmentDraftCollection extends MapperSequence +{ + /** + * @psalm-assert CustomerGroupAssignmentDraft $value + * @psalm-param CustomerGroupAssignmentDraft|stdClass $value + * @throws InvalidArgumentException + * + * @return CustomerGroupAssignmentDraftCollection + */ + public function add($value) + { + if (!$value instanceof CustomerGroupAssignmentDraft) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CustomerGroupAssignmentDraft + */ + protected function mapper() + { + return function (?int $index): ?CustomerGroupAssignmentDraft { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CustomerGroupAssignmentDraft $data */ + $data = CustomerGroupAssignmentDraftModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Customer/CustomerGroupAssignmentDraftModel.php b/lib/commercetools-api/src/Models/Customer/CustomerGroupAssignmentDraftModel.php new file mode 100644 index 00000000000..6d59ef32842 --- /dev/null +++ b/lib/commercetools-api/src/Models/Customer/CustomerGroupAssignmentDraftModel.php @@ -0,0 +1,69 @@ +customerGroup = $customerGroup; + } + + /** + *

ResourceIdentifier of a Customer Group.

+ * + * + * @return null|CustomerGroupResourceIdentifier + */ + public function getCustomerGroup() + { + if (is_null($this->customerGroup)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOMER_GROUP); + if (is_null($data)) { + return null; + } + + $this->customerGroup = CustomerGroupResourceIdentifierModel::of($data); + } + + return $this->customerGroup; + } + + + /** + * @param ?CustomerGroupResourceIdentifier $customerGroup + */ + public function setCustomerGroup(?CustomerGroupResourceIdentifier $customerGroup): void + { + $this->customerGroup = $customerGroup; + } +} diff --git a/lib/commercetools-api/src/Models/Customer/CustomerGroupAssignmentModel.php b/lib/commercetools-api/src/Models/Customer/CustomerGroupAssignmentModel.php new file mode 100644 index 00000000000..20bf6865a7f --- /dev/null +++ b/lib/commercetools-api/src/Models/Customer/CustomerGroupAssignmentModel.php @@ -0,0 +1,69 @@ +customerGroup = $customerGroup; + } + + /** + *

Reference to a Customer Group.

+ * + * + * @return null|CustomerGroupReference + */ + public function getCustomerGroup() + { + if (is_null($this->customerGroup)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOMER_GROUP); + if (is_null($data)) { + return null; + } + + $this->customerGroup = CustomerGroupReferenceModel::of($data); + } + + return $this->customerGroup; + } + + + /** + * @param ?CustomerGroupReference $customerGroup + */ + public function setCustomerGroup(?CustomerGroupReference $customerGroup): void + { + $this->customerGroup = $customerGroup; + } +} diff --git a/lib/commercetools-api/src/Models/Customer/CustomerModel.php b/lib/commercetools-api/src/Models/Customer/CustomerModel.php index f8dc90c161b..4c82fc9a3ac 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerModel.php @@ -212,6 +212,12 @@ final class CustomerModel extends JsonObjectModel implements Customer */ protected $authenticationMode; + /** + * + * @var ?CustomerGroupAssignmentCollection + */ + protected $customerGroupAssignments; + /** * @psalm-suppress MissingParamType @@ -246,7 +252,8 @@ public function __construct( ?string $locale = null, ?string $salutation = null, ?StoreKeyReferenceCollection $stores = null, - ?string $authenticationMode = null + ?string $authenticationMode = null, + ?CustomerGroupAssignmentCollection $customerGroupAssignments = null ) { $this->id = $id; $this->version = $version; @@ -278,6 +285,7 @@ public function __construct( $this->salutation = $salutation; $this->stores = $stores; $this->authenticationMode = $authenticationMode; + $this->customerGroupAssignments = $customerGroupAssignments; } /** @@ -902,6 +910,26 @@ public function getAuthenticationMode() return $this->authenticationMode; } + /** + *

Customer Groups that the Customer belongs to.

+ * + * + * @return null|CustomerGroupAssignmentCollection + */ + public function getCustomerGroupAssignments() + { + if (is_null($this->customerGroupAssignments)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_CUSTOMER_GROUP_ASSIGNMENTS); + if (is_null($data)) { + return null; + } + $this->customerGroupAssignments = CustomerGroupAssignmentCollection::fromArray($data); + } + + return $this->customerGroupAssignments; + } + /** * @param ?string $id @@ -1143,6 +1171,14 @@ public function setAuthenticationMode(?string $authenticationMode): void $this->authenticationMode = $authenticationMode; } + /** + * @param ?CustomerGroupAssignmentCollection $customerGroupAssignments + */ + public function setCustomerGroupAssignments(?CustomerGroupAssignmentCollection $customerGroupAssignments): void + { + $this->customerGroupAssignments = $customerGroupAssignments; + } + #[\ReturnTypeWillChange] public function jsonSerialize() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerRemoveCustomerGroupAssignmentAction.php b/lib/commercetools-api/src/Models/Customer/CustomerRemoveCustomerGroupAssignmentAction.php new file mode 100644 index 00000000000..10d33ae59da --- /dev/null +++ b/lib/commercetools-api/src/Models/Customer/CustomerRemoveCustomerGroupAssignmentAction.php @@ -0,0 +1,31 @@ +Customer Group to unassign the Customer from.

+ * + + * @return null|CustomerGroupResourceIdentifier + */ + public function getCustomerGroup(); + + /** + * @param ?CustomerGroupResourceIdentifier $customerGroup + */ + public function setCustomerGroup(?CustomerGroupResourceIdentifier $customerGroup): void; +} diff --git a/lib/commercetools-api/src/Models/Customer/CustomerRemoveCustomerGroupAssignmentActionBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerRemoveCustomerGroupAssignmentActionBuilder.php new file mode 100644 index 00000000000..09f6249e98a --- /dev/null +++ b/lib/commercetools-api/src/Models/Customer/CustomerRemoveCustomerGroupAssignmentActionBuilder.php @@ -0,0 +1,75 @@ + + */ +final class CustomerRemoveCustomerGroupAssignmentActionBuilder implements Builder +{ + /** + + * @var null|CustomerGroupResourceIdentifier|CustomerGroupResourceIdentifierBuilder + */ + private $customerGroup; + + /** + *

Customer Group to unassign the Customer from.

+ * + + * @return null|CustomerGroupResourceIdentifier + */ + public function getCustomerGroup() + { + return $this->customerGroup instanceof CustomerGroupResourceIdentifierBuilder ? $this->customerGroup->build() : $this->customerGroup; + } + + /** + * @param ?CustomerGroupResourceIdentifier $customerGroup + * @return $this + */ + public function withCustomerGroup(?CustomerGroupResourceIdentifier $customerGroup) + { + $this->customerGroup = $customerGroup; + + return $this; + } + + /** + * @deprecated use withCustomerGroup() instead + * @return $this + */ + public function withCustomerGroupBuilder(?CustomerGroupResourceIdentifierBuilder $customerGroup) + { + $this->customerGroup = $customerGroup; + + return $this; + } + + public function build(): CustomerRemoveCustomerGroupAssignmentAction + { + return new CustomerRemoveCustomerGroupAssignmentActionModel( + $this->customerGroup instanceof CustomerGroupResourceIdentifierBuilder ? $this->customerGroup->build() : $this->customerGroup + ); + } + + public static function of(): CustomerRemoveCustomerGroupAssignmentActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Customer/CustomerRemoveCustomerGroupAssignmentActionCollection.php b/lib/commercetools-api/src/Models/Customer/CustomerRemoveCustomerGroupAssignmentActionCollection.php new file mode 100644 index 00000000000..dd49be9042c --- /dev/null +++ b/lib/commercetools-api/src/Models/Customer/CustomerRemoveCustomerGroupAssignmentActionCollection.php @@ -0,0 +1,56 @@ + + * @method CustomerRemoveCustomerGroupAssignmentAction current() + * @method CustomerRemoveCustomerGroupAssignmentAction end() + * @method CustomerRemoveCustomerGroupAssignmentAction at($offset) + */ +class CustomerRemoveCustomerGroupAssignmentActionCollection extends CustomerUpdateActionCollection +{ + /** + * @psalm-assert CustomerRemoveCustomerGroupAssignmentAction $value + * @psalm-param CustomerRemoveCustomerGroupAssignmentAction|stdClass $value + * @throws InvalidArgumentException + * + * @return CustomerRemoveCustomerGroupAssignmentActionCollection + */ + public function add($value) + { + if (!$value instanceof CustomerRemoveCustomerGroupAssignmentAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CustomerRemoveCustomerGroupAssignmentAction + */ + protected function mapper() + { + return function (?int $index): ?CustomerRemoveCustomerGroupAssignmentAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CustomerRemoveCustomerGroupAssignmentAction $data */ + $data = CustomerRemoveCustomerGroupAssignmentActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Customer/CustomerRemoveCustomerGroupAssignmentActionModel.php b/lib/commercetools-api/src/Models/Customer/CustomerRemoveCustomerGroupAssignmentActionModel.php new file mode 100644 index 00000000000..09e0e984fdc --- /dev/null +++ b/lib/commercetools-api/src/Models/Customer/CustomerRemoveCustomerGroupAssignmentActionModel.php @@ -0,0 +1,96 @@ +customerGroup = $customerGroup; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

Customer Group to unassign the Customer from.

+ * + * + * @return null|CustomerGroupResourceIdentifier + */ + public function getCustomerGroup() + { + if (is_null($this->customerGroup)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOMER_GROUP); + if (is_null($data)) { + return null; + } + + $this->customerGroup = CustomerGroupResourceIdentifierModel::of($data); + } + + return $this->customerGroup; + } + + + /** + * @param ?CustomerGroupResourceIdentifier $customerGroup + */ + public function setCustomerGroup(?CustomerGroupResourceIdentifier $customerGroup): void + { + $this->customerGroup = $customerGroup; + } +} diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetCustomerGroupAssignmentsAction.php b/lib/commercetools-api/src/Models/Customer/CustomerSetCustomerGroupAssignmentsAction.php new file mode 100644 index 00000000000..d7064ec4c61 --- /dev/null +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetCustomerGroupAssignmentsAction.php @@ -0,0 +1,30 @@ +Customer Groups to assign the Customer to.

+ * + + * @return null|CustomerGroupAssignmentDraftCollection + */ + public function getCustomerGroupAssignments(); + + /** + * @param ?CustomerGroupAssignmentDraftCollection $customerGroupAssignments + */ + public function setCustomerGroupAssignments(?CustomerGroupAssignmentDraftCollection $customerGroupAssignments): void; +} diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetCustomerGroupAssignmentsActionBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerSetCustomerGroupAssignmentsActionBuilder.php new file mode 100644 index 00000000000..a74f7d5dcaf --- /dev/null +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetCustomerGroupAssignmentsActionBuilder.php @@ -0,0 +1,63 @@ + + */ +final class CustomerSetCustomerGroupAssignmentsActionBuilder implements Builder +{ + /** + + * @var ?CustomerGroupAssignmentDraftCollection + */ + private $customerGroupAssignments; + + /** + *

Customer Groups to assign the Customer to.

+ * + + * @return null|CustomerGroupAssignmentDraftCollection + */ + public function getCustomerGroupAssignments() + { + return $this->customerGroupAssignments; + } + + /** + * @param ?CustomerGroupAssignmentDraftCollection $customerGroupAssignments + * @return $this + */ + public function withCustomerGroupAssignments(?CustomerGroupAssignmentDraftCollection $customerGroupAssignments) + { + $this->customerGroupAssignments = $customerGroupAssignments; + + return $this; + } + + + public function build(): CustomerSetCustomerGroupAssignmentsAction + { + return new CustomerSetCustomerGroupAssignmentsActionModel( + $this->customerGroupAssignments + ); + } + + public static function of(): CustomerSetCustomerGroupAssignmentsActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetCustomerGroupAssignmentsActionCollection.php b/lib/commercetools-api/src/Models/Customer/CustomerSetCustomerGroupAssignmentsActionCollection.php new file mode 100644 index 00000000000..ce66b60b065 --- /dev/null +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetCustomerGroupAssignmentsActionCollection.php @@ -0,0 +1,56 @@ + + * @method CustomerSetCustomerGroupAssignmentsAction current() + * @method CustomerSetCustomerGroupAssignmentsAction end() + * @method CustomerSetCustomerGroupAssignmentsAction at($offset) + */ +class CustomerSetCustomerGroupAssignmentsActionCollection extends CustomerUpdateActionCollection +{ + /** + * @psalm-assert CustomerSetCustomerGroupAssignmentsAction $value + * @psalm-param CustomerSetCustomerGroupAssignmentsAction|stdClass $value + * @throws InvalidArgumentException + * + * @return CustomerSetCustomerGroupAssignmentsActionCollection + */ + public function add($value) + { + if (!$value instanceof CustomerSetCustomerGroupAssignmentsAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CustomerSetCustomerGroupAssignmentsAction + */ + protected function mapper() + { + return function (?int $index): ?CustomerSetCustomerGroupAssignmentsAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CustomerSetCustomerGroupAssignmentsAction $data */ + $data = CustomerSetCustomerGroupAssignmentsActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetCustomerGroupAssignmentsActionModel.php b/lib/commercetools-api/src/Models/Customer/CustomerSetCustomerGroupAssignmentsActionModel.php new file mode 100644 index 00000000000..3a71dcfdbd0 --- /dev/null +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetCustomerGroupAssignmentsActionModel.php @@ -0,0 +1,93 @@ +customerGroupAssignments = $customerGroupAssignments; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

Customer Groups to assign the Customer to.

+ * + * + * @return null|CustomerGroupAssignmentDraftCollection + */ + public function getCustomerGroupAssignments() + { + if (is_null($this->customerGroupAssignments)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_CUSTOMER_GROUP_ASSIGNMENTS); + if (is_null($data)) { + return null; + } + $this->customerGroupAssignments = CustomerGroupAssignmentDraftCollection::fromArray($data); + } + + return $this->customerGroupAssignments; + } + + + /** + * @param ?CustomerGroupAssignmentDraftCollection $customerGroupAssignments + */ + public function setCustomerGroupAssignments(?CustomerGroupAssignmentDraftCollection $customerGroupAssignments): void + { + $this->customerGroupAssignments = $customerGroupAssignments; + } +} diff --git a/lib/commercetools-api/src/Models/Customer/CustomerUpdateActionModel.php b/lib/commercetools-api/src/Models/Customer/CustomerUpdateActionModel.php index dd9ed9ee2c8..89981201301 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerUpdateActionModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerUpdateActionModel.php @@ -33,12 +33,14 @@ final class CustomerUpdateActionModel extends JsonObjectModel implements Custome private static $discriminatorClasses = [ 'addAddress' => CustomerAddAddressActionModel::class, 'addBillingAddressId' => CustomerAddBillingAddressIdActionModel::class, + 'addCustomerGroupAssignment' => CustomerAddCustomerGroupAssignmentActionModel::class, 'addShippingAddressId' => CustomerAddShippingAddressIdActionModel::class, 'addStore' => CustomerAddStoreActionModel::class, 'changeAddress' => CustomerChangeAddressActionModel::class, 'changeEmail' => CustomerChangeEmailActionModel::class, 'removeAddress' => CustomerRemoveAddressActionModel::class, 'removeBillingAddressId' => CustomerRemoveBillingAddressIdActionModel::class, + 'removeCustomerGroupAssignment' => CustomerRemoveCustomerGroupAssignmentActionModel::class, 'removeShippingAddressId' => CustomerRemoveShippingAddressIdActionModel::class, 'removeStore' => CustomerRemoveStoreActionModel::class, 'setAddressCustomField' => CustomerSetAddressCustomFieldActionModel::class, @@ -48,6 +50,7 @@ final class CustomerUpdateActionModel extends JsonObjectModel implements Custome 'setCustomField' => CustomerSetCustomFieldActionModel::class, 'setCustomType' => CustomerSetCustomTypeActionModel::class, 'setCustomerGroup' => CustomerSetCustomerGroupActionModel::class, + 'setCustomerGroupAssignments' => CustomerSetCustomerGroupAssignmentsActionModel::class, 'setCustomerNumber' => CustomerSetCustomerNumberActionModel::class, 'setDateOfBirth' => CustomerSetDateOfBirthActionModel::class, 'setDefaultBillingAddress' => CustomerSetDefaultBillingAddressActionModel::class, diff --git a/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentAddedMessage.php b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentAddedMessage.php new file mode 100644 index 00000000000..10aa52f90b9 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentAddedMessage.php @@ -0,0 +1,31 @@ +Customer Group assigned to the Customer during the Add CustomerGroupAssignment update action.

+ * + + * @return null|CustomerGroupAssignment + */ + public function getCustomerGroupAssignment(); + + /** + * @param ?CustomerGroupAssignment $customerGroupAssignment + */ + public function setCustomerGroupAssignment(?CustomerGroupAssignment $customerGroupAssignment): void; +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentAddedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentAddedMessageBuilder.php new file mode 100644 index 00000000000..15ac1f99db0 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentAddedMessageBuilder.php @@ -0,0 +1,417 @@ + + */ +final class CustomerGroupAssignmentAddedMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var null|CustomerGroupAssignment|CustomerGroupAssignmentBuilder + */ + private $customerGroupAssignment; + + /** + *

Unique identifier of the Message. Can be used to track which Messages have been processed.

+ * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

Version of a resource. In case of Messages, this is always 1.

+ * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

Value of createdAt.

+ * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

IDs and references that last modified the Message.

+ * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

IDs and references that created the Message.

+ * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

+ * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

Reference to the resource on which the change or action was performed.

+ * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

Version of the resource on which the change or action was performed.

+ * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

Customer Group assigned to the Customer during the Add CustomerGroupAssignment update action.

+ * + + * @return null|CustomerGroupAssignment + */ + public function getCustomerGroupAssignment() + { + return $this->customerGroupAssignment instanceof CustomerGroupAssignmentBuilder ? $this->customerGroupAssignment->build() : $this->customerGroupAssignment; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?CustomerGroupAssignment $customerGroupAssignment + * @return $this + */ + public function withCustomerGroupAssignment(?CustomerGroupAssignment $customerGroupAssignment) + { + $this->customerGroupAssignment = $customerGroupAssignment; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @deprecated use withCustomerGroupAssignment() instead + * @return $this + */ + public function withCustomerGroupAssignmentBuilder(?CustomerGroupAssignmentBuilder $customerGroupAssignment) + { + $this->customerGroupAssignment = $customerGroupAssignment; + + return $this; + } + + public function build(): CustomerGroupAssignmentAddedMessage + { + return new CustomerGroupAssignmentAddedMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->customerGroupAssignment instanceof CustomerGroupAssignmentBuilder ? $this->customerGroupAssignment->build() : $this->customerGroupAssignment + ); + } + + public static function of(): CustomerGroupAssignmentAddedMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentAddedMessageCollection.php b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentAddedMessageCollection.php new file mode 100644 index 00000000000..5a8899bbb9d --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentAddedMessageCollection.php @@ -0,0 +1,56 @@ + + * @method CustomerGroupAssignmentAddedMessage current() + * @method CustomerGroupAssignmentAddedMessage end() + * @method CustomerGroupAssignmentAddedMessage at($offset) + */ +class CustomerGroupAssignmentAddedMessageCollection extends MessageCollection +{ + /** + * @psalm-assert CustomerGroupAssignmentAddedMessage $value + * @psalm-param CustomerGroupAssignmentAddedMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return CustomerGroupAssignmentAddedMessageCollection + */ + public function add($value) + { + if (!$value instanceof CustomerGroupAssignmentAddedMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CustomerGroupAssignmentAddedMessage + */ + protected function mapper() + { + return function (?int $index): ?CustomerGroupAssignmentAddedMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CustomerGroupAssignmentAddedMessage $data */ + $data = CustomerGroupAssignmentAddedMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentAddedMessageModel.php b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentAddedMessageModel.php new file mode 100644 index 00000000000..80f96372c8a --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentAddedMessageModel.php @@ -0,0 +1,493 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->customerGroupAssignment = $customerGroupAssignment; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

Unique identifier of the Message. Can be used to track which Messages have been processed.

+ * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

Version of a resource. In case of Messages, this is always 1.

+ * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

Value of createdAt.

+ * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

IDs and references that last modified the Message.

+ * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

IDs and references that created the Message.

+ * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

+ * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

Reference to the resource on which the change or action was performed.

+ * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

Version of the resource on which the change or action was performed.

+ * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

Message Type of the Message.

+ * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

Customer Group assigned to the Customer during the Add CustomerGroupAssignment update action.

+ * + * + * @return null|CustomerGroupAssignment + */ + public function getCustomerGroupAssignment() + { + if (is_null($this->customerGroupAssignment)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOMER_GROUP_ASSIGNMENT); + if (is_null($data)) { + return null; + } + + $this->customerGroupAssignment = CustomerGroupAssignmentModel::of($data); + } + + return $this->customerGroupAssignment; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?CustomerGroupAssignment $customerGroupAssignment + */ + public function setCustomerGroupAssignment(?CustomerGroupAssignment $customerGroupAssignment): void + { + $this->customerGroupAssignment = $customerGroupAssignment; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentAddedMessagePayload.php b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentAddedMessagePayload.php new file mode 100644 index 00000000000..a2568303453 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentAddedMessagePayload.php @@ -0,0 +1,31 @@ +Customer Group assigned to the Customer during the Add CustomerGroupAssignment update action.

+ * + + * @return null|CustomerGroupAssignment + */ + public function getCustomerGroupAssignment(); + + /** + * @param ?CustomerGroupAssignment $customerGroupAssignment + */ + public function setCustomerGroupAssignment(?CustomerGroupAssignment $customerGroupAssignment): void; +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentAddedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentAddedMessagePayloadBuilder.php new file mode 100644 index 00000000000..a8d7b1c1a77 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentAddedMessagePayloadBuilder.php @@ -0,0 +1,75 @@ + + */ +final class CustomerGroupAssignmentAddedMessagePayloadBuilder implements Builder +{ + /** + + * @var null|CustomerGroupAssignment|CustomerGroupAssignmentBuilder + */ + private $customerGroupAssignment; + + /** + *

Customer Group assigned to the Customer during the Add CustomerGroupAssignment update action.

+ * + + * @return null|CustomerGroupAssignment + */ + public function getCustomerGroupAssignment() + { + return $this->customerGroupAssignment instanceof CustomerGroupAssignmentBuilder ? $this->customerGroupAssignment->build() : $this->customerGroupAssignment; + } + + /** + * @param ?CustomerGroupAssignment $customerGroupAssignment + * @return $this + */ + public function withCustomerGroupAssignment(?CustomerGroupAssignment $customerGroupAssignment) + { + $this->customerGroupAssignment = $customerGroupAssignment; + + return $this; + } + + /** + * @deprecated use withCustomerGroupAssignment() instead + * @return $this + */ + public function withCustomerGroupAssignmentBuilder(?CustomerGroupAssignmentBuilder $customerGroupAssignment) + { + $this->customerGroupAssignment = $customerGroupAssignment; + + return $this; + } + + public function build(): CustomerGroupAssignmentAddedMessagePayload + { + return new CustomerGroupAssignmentAddedMessagePayloadModel( + $this->customerGroupAssignment instanceof CustomerGroupAssignmentBuilder ? $this->customerGroupAssignment->build() : $this->customerGroupAssignment + ); + } + + public static function of(): CustomerGroupAssignmentAddedMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentAddedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentAddedMessagePayloadCollection.php new file mode 100644 index 00000000000..ce6ab91e8c5 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentAddedMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method CustomerGroupAssignmentAddedMessagePayload current() + * @method CustomerGroupAssignmentAddedMessagePayload end() + * @method CustomerGroupAssignmentAddedMessagePayload at($offset) + */ +class CustomerGroupAssignmentAddedMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert CustomerGroupAssignmentAddedMessagePayload $value + * @psalm-param CustomerGroupAssignmentAddedMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return CustomerGroupAssignmentAddedMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof CustomerGroupAssignmentAddedMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CustomerGroupAssignmentAddedMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?CustomerGroupAssignmentAddedMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CustomerGroupAssignmentAddedMessagePayload $data */ + $data = CustomerGroupAssignmentAddedMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentAddedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentAddedMessagePayloadModel.php new file mode 100644 index 00000000000..9a2b7e80da6 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentAddedMessagePayloadModel.php @@ -0,0 +1,96 @@ +customerGroupAssignment = $customerGroupAssignment; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

Customer Group assigned to the Customer during the Add CustomerGroupAssignment update action.

+ * + * + * @return null|CustomerGroupAssignment + */ + public function getCustomerGroupAssignment() + { + if (is_null($this->customerGroupAssignment)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOMER_GROUP_ASSIGNMENT); + if (is_null($data)) { + return null; + } + + $this->customerGroupAssignment = CustomerGroupAssignmentModel::of($data); + } + + return $this->customerGroupAssignment; + } + + + /** + * @param ?CustomerGroupAssignment $customerGroupAssignment + */ + public function setCustomerGroupAssignment(?CustomerGroupAssignment $customerGroupAssignment): void + { + $this->customerGroupAssignment = $customerGroupAssignment; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentRemovedMessage.php b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentRemovedMessage.php new file mode 100644 index 00000000000..e1b0ef729e2 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentRemovedMessage.php @@ -0,0 +1,31 @@ +Customer Group removed during the Remove CustomerGroupAssignment update action.

+ * + + * @return null|CustomerGroupAssignment + */ + public function getCustomerGroupAssignment(); + + /** + * @param ?CustomerGroupAssignment $customerGroupAssignment + */ + public function setCustomerGroupAssignment(?CustomerGroupAssignment $customerGroupAssignment): void; +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentRemovedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentRemovedMessageBuilder.php new file mode 100644 index 00000000000..a82caed9885 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentRemovedMessageBuilder.php @@ -0,0 +1,417 @@ + + */ +final class CustomerGroupAssignmentRemovedMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var null|CustomerGroupAssignment|CustomerGroupAssignmentBuilder + */ + private $customerGroupAssignment; + + /** + *

Unique identifier of the Message. Can be used to track which Messages have been processed.

+ * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

Version of a resource. In case of Messages, this is always 1.

+ * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

Value of createdAt.

+ * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

IDs and references that last modified the Message.

+ * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

IDs and references that created the Message.

+ * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

+ * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

Reference to the resource on which the change or action was performed.

+ * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

Version of the resource on which the change or action was performed.

+ * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

Customer Group removed during the Remove CustomerGroupAssignment update action.

+ * + + * @return null|CustomerGroupAssignment + */ + public function getCustomerGroupAssignment() + { + return $this->customerGroupAssignment instanceof CustomerGroupAssignmentBuilder ? $this->customerGroupAssignment->build() : $this->customerGroupAssignment; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?CustomerGroupAssignment $customerGroupAssignment + * @return $this + */ + public function withCustomerGroupAssignment(?CustomerGroupAssignment $customerGroupAssignment) + { + $this->customerGroupAssignment = $customerGroupAssignment; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @deprecated use withCustomerGroupAssignment() instead + * @return $this + */ + public function withCustomerGroupAssignmentBuilder(?CustomerGroupAssignmentBuilder $customerGroupAssignment) + { + $this->customerGroupAssignment = $customerGroupAssignment; + + return $this; + } + + public function build(): CustomerGroupAssignmentRemovedMessage + { + return new CustomerGroupAssignmentRemovedMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->customerGroupAssignment instanceof CustomerGroupAssignmentBuilder ? $this->customerGroupAssignment->build() : $this->customerGroupAssignment + ); + } + + public static function of(): CustomerGroupAssignmentRemovedMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentRemovedMessageCollection.php b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentRemovedMessageCollection.php new file mode 100644 index 00000000000..5d5010fb8ca --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentRemovedMessageCollection.php @@ -0,0 +1,56 @@ + + * @method CustomerGroupAssignmentRemovedMessage current() + * @method CustomerGroupAssignmentRemovedMessage end() + * @method CustomerGroupAssignmentRemovedMessage at($offset) + */ +class CustomerGroupAssignmentRemovedMessageCollection extends MessageCollection +{ + /** + * @psalm-assert CustomerGroupAssignmentRemovedMessage $value + * @psalm-param CustomerGroupAssignmentRemovedMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return CustomerGroupAssignmentRemovedMessageCollection + */ + public function add($value) + { + if (!$value instanceof CustomerGroupAssignmentRemovedMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CustomerGroupAssignmentRemovedMessage + */ + protected function mapper() + { + return function (?int $index): ?CustomerGroupAssignmentRemovedMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CustomerGroupAssignmentRemovedMessage $data */ + $data = CustomerGroupAssignmentRemovedMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentRemovedMessageModel.php b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentRemovedMessageModel.php new file mode 100644 index 00000000000..266516592d1 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentRemovedMessageModel.php @@ -0,0 +1,493 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->customerGroupAssignment = $customerGroupAssignment; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

Unique identifier of the Message. Can be used to track which Messages have been processed.

+ * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

Version of a resource. In case of Messages, this is always 1.

+ * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

Value of createdAt.

+ * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

IDs and references that last modified the Message.

+ * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

IDs and references that created the Message.

+ * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

+ * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

Reference to the resource on which the change or action was performed.

+ * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

Version of the resource on which the change or action was performed.

+ * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

Message Type of the Message.

+ * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

Customer Group removed during the Remove CustomerGroupAssignment update action.

+ * + * + * @return null|CustomerGroupAssignment + */ + public function getCustomerGroupAssignment() + { + if (is_null($this->customerGroupAssignment)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOMER_GROUP_ASSIGNMENT); + if (is_null($data)) { + return null; + } + + $this->customerGroupAssignment = CustomerGroupAssignmentModel::of($data); + } + + return $this->customerGroupAssignment; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?CustomerGroupAssignment $customerGroupAssignment + */ + public function setCustomerGroupAssignment(?CustomerGroupAssignment $customerGroupAssignment): void + { + $this->customerGroupAssignment = $customerGroupAssignment; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentRemovedMessagePayload.php b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentRemovedMessagePayload.php new file mode 100644 index 00000000000..1d1953b72c4 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentRemovedMessagePayload.php @@ -0,0 +1,31 @@ +Customer Group removed during the Remove CustomerGroupAssignment update action.

+ * + + * @return null|CustomerGroupAssignment + */ + public function getCustomerGroupAssignment(); + + /** + * @param ?CustomerGroupAssignment $customerGroupAssignment + */ + public function setCustomerGroupAssignment(?CustomerGroupAssignment $customerGroupAssignment): void; +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentRemovedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentRemovedMessagePayloadBuilder.php new file mode 100644 index 00000000000..07b10523ce2 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentRemovedMessagePayloadBuilder.php @@ -0,0 +1,75 @@ + + */ +final class CustomerGroupAssignmentRemovedMessagePayloadBuilder implements Builder +{ + /** + + * @var null|CustomerGroupAssignment|CustomerGroupAssignmentBuilder + */ + private $customerGroupAssignment; + + /** + *

Customer Group removed during the Remove CustomerGroupAssignment update action.

+ * + + * @return null|CustomerGroupAssignment + */ + public function getCustomerGroupAssignment() + { + return $this->customerGroupAssignment instanceof CustomerGroupAssignmentBuilder ? $this->customerGroupAssignment->build() : $this->customerGroupAssignment; + } + + /** + * @param ?CustomerGroupAssignment $customerGroupAssignment + * @return $this + */ + public function withCustomerGroupAssignment(?CustomerGroupAssignment $customerGroupAssignment) + { + $this->customerGroupAssignment = $customerGroupAssignment; + + return $this; + } + + /** + * @deprecated use withCustomerGroupAssignment() instead + * @return $this + */ + public function withCustomerGroupAssignmentBuilder(?CustomerGroupAssignmentBuilder $customerGroupAssignment) + { + $this->customerGroupAssignment = $customerGroupAssignment; + + return $this; + } + + public function build(): CustomerGroupAssignmentRemovedMessagePayload + { + return new CustomerGroupAssignmentRemovedMessagePayloadModel( + $this->customerGroupAssignment instanceof CustomerGroupAssignmentBuilder ? $this->customerGroupAssignment->build() : $this->customerGroupAssignment + ); + } + + public static function of(): CustomerGroupAssignmentRemovedMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentRemovedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentRemovedMessagePayloadCollection.php new file mode 100644 index 00000000000..8ff59c916a7 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentRemovedMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method CustomerGroupAssignmentRemovedMessagePayload current() + * @method CustomerGroupAssignmentRemovedMessagePayload end() + * @method CustomerGroupAssignmentRemovedMessagePayload at($offset) + */ +class CustomerGroupAssignmentRemovedMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert CustomerGroupAssignmentRemovedMessagePayload $value + * @psalm-param CustomerGroupAssignmentRemovedMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return CustomerGroupAssignmentRemovedMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof CustomerGroupAssignmentRemovedMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CustomerGroupAssignmentRemovedMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?CustomerGroupAssignmentRemovedMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CustomerGroupAssignmentRemovedMessagePayload $data */ + $data = CustomerGroupAssignmentRemovedMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentRemovedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentRemovedMessagePayloadModel.php new file mode 100644 index 00000000000..97e66abbe9f --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentRemovedMessagePayloadModel.php @@ -0,0 +1,96 @@ +customerGroupAssignment = $customerGroupAssignment; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

Customer Group removed during the Remove CustomerGroupAssignment update action.

+ * + * + * @return null|CustomerGroupAssignment + */ + public function getCustomerGroupAssignment() + { + if (is_null($this->customerGroupAssignment)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOMER_GROUP_ASSIGNMENT); + if (is_null($data)) { + return null; + } + + $this->customerGroupAssignment = CustomerGroupAssignmentModel::of($data); + } + + return $this->customerGroupAssignment; + } + + + /** + * @param ?CustomerGroupAssignment $customerGroupAssignment + */ + public function setCustomerGroupAssignment(?CustomerGroupAssignment $customerGroupAssignment): void + { + $this->customerGroupAssignment = $customerGroupAssignment; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentsSetMessage.php b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentsSetMessage.php new file mode 100644 index 00000000000..5cc0e27ba7f --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentsSetMessage.php @@ -0,0 +1,31 @@ +Customer Groups assigned to the Customer during the Set CustomerGroupAssignments update action.

+ * + + * @return null|CustomerGroupAssignmentCollection + */ + public function getCustomerGroupAssignments(); + + /** + * @param ?CustomerGroupAssignmentCollection $customerGroupAssignments + */ + public function setCustomerGroupAssignments(?CustomerGroupAssignmentCollection $customerGroupAssignments): void; +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentsSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentsSetMessageBuilder.php new file mode 100644 index 00000000000..afb9f01c467 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentsSetMessageBuilder.php @@ -0,0 +1,405 @@ + + */ +final class CustomerGroupAssignmentsSetMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var ?CustomerGroupAssignmentCollection + */ + private $customerGroupAssignments; + + /** + *

Unique identifier of the Message. Can be used to track which Messages have been processed.

+ * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

Version of a resource. In case of Messages, this is always 1.

+ * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

Value of createdAt.

+ * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

IDs and references that last modified the Message.

+ * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

IDs and references that created the Message.

+ * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

+ * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

Reference to the resource on which the change or action was performed.

+ * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

Version of the resource on which the change or action was performed.

+ * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

Customer Groups assigned to the Customer during the Set CustomerGroupAssignments update action.

+ * + + * @return null|CustomerGroupAssignmentCollection + */ + public function getCustomerGroupAssignments() + { + return $this->customerGroupAssignments; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?CustomerGroupAssignmentCollection $customerGroupAssignments + * @return $this + */ + public function withCustomerGroupAssignments(?CustomerGroupAssignmentCollection $customerGroupAssignments) + { + $this->customerGroupAssignments = $customerGroupAssignments; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + public function build(): CustomerGroupAssignmentsSetMessage + { + return new CustomerGroupAssignmentsSetMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->customerGroupAssignments + ); + } + + public static function of(): CustomerGroupAssignmentsSetMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentsSetMessageCollection.php b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentsSetMessageCollection.php new file mode 100644 index 00000000000..b2d140a2413 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentsSetMessageCollection.php @@ -0,0 +1,56 @@ + + * @method CustomerGroupAssignmentsSetMessage current() + * @method CustomerGroupAssignmentsSetMessage end() + * @method CustomerGroupAssignmentsSetMessage at($offset) + */ +class CustomerGroupAssignmentsSetMessageCollection extends MessageCollection +{ + /** + * @psalm-assert CustomerGroupAssignmentsSetMessage $value + * @psalm-param CustomerGroupAssignmentsSetMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return CustomerGroupAssignmentsSetMessageCollection + */ + public function add($value) + { + if (!$value instanceof CustomerGroupAssignmentsSetMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CustomerGroupAssignmentsSetMessage + */ + protected function mapper() + { + return function (?int $index): ?CustomerGroupAssignmentsSetMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CustomerGroupAssignmentsSetMessage $data */ + $data = CustomerGroupAssignmentsSetMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentsSetMessageModel.php b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentsSetMessageModel.php new file mode 100644 index 00000000000..9f06f46b589 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentsSetMessageModel.php @@ -0,0 +1,491 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->customerGroupAssignments = $customerGroupAssignments; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

Unique identifier of the Message. Can be used to track which Messages have been processed.

+ * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

Version of a resource. In case of Messages, this is always 1.

+ * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

Value of createdAt.

+ * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

IDs and references that last modified the Message.

+ * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

IDs and references that created the Message.

+ * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

+ * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

Reference to the resource on which the change or action was performed.

+ * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

Version of the resource on which the change or action was performed.

+ * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

Message Type of the Message.

+ * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

Customer Groups assigned to the Customer during the Set CustomerGroupAssignments update action.

+ * + * + * @return null|CustomerGroupAssignmentCollection + */ + public function getCustomerGroupAssignments() + { + if (is_null($this->customerGroupAssignments)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_CUSTOMER_GROUP_ASSIGNMENTS); + if (is_null($data)) { + return null; + } + $this->customerGroupAssignments = CustomerGroupAssignmentCollection::fromArray($data); + } + + return $this->customerGroupAssignments; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?CustomerGroupAssignmentCollection $customerGroupAssignments + */ + public function setCustomerGroupAssignments(?CustomerGroupAssignmentCollection $customerGroupAssignments): void + { + $this->customerGroupAssignments = $customerGroupAssignments; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentsSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentsSetMessagePayload.php new file mode 100644 index 00000000000..ea43f67912e --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentsSetMessagePayload.php @@ -0,0 +1,31 @@ +Customer Groups assigned to the Customer during the Set CustomerGroupAssignments update action.

+ * + + * @return null|CustomerGroupAssignmentCollection + */ + public function getCustomerGroupAssignments(); + + /** + * @param ?CustomerGroupAssignmentCollection $customerGroupAssignments + */ + public function setCustomerGroupAssignments(?CustomerGroupAssignmentCollection $customerGroupAssignments): void; +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentsSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentsSetMessagePayloadBuilder.php new file mode 100644 index 00000000000..8424fb4c508 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentsSetMessagePayloadBuilder.php @@ -0,0 +1,64 @@ + + */ +final class CustomerGroupAssignmentsSetMessagePayloadBuilder implements Builder +{ + /** + + * @var ?CustomerGroupAssignmentCollection + */ + private $customerGroupAssignments; + + /** + *

Customer Groups assigned to the Customer during the Set CustomerGroupAssignments update action.

+ * + + * @return null|CustomerGroupAssignmentCollection + */ + public function getCustomerGroupAssignments() + { + return $this->customerGroupAssignments; + } + + /** + * @param ?CustomerGroupAssignmentCollection $customerGroupAssignments + * @return $this + */ + public function withCustomerGroupAssignments(?CustomerGroupAssignmentCollection $customerGroupAssignments) + { + $this->customerGroupAssignments = $customerGroupAssignments; + + return $this; + } + + + public function build(): CustomerGroupAssignmentsSetMessagePayload + { + return new CustomerGroupAssignmentsSetMessagePayloadModel( + $this->customerGroupAssignments + ); + } + + public static function of(): CustomerGroupAssignmentsSetMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentsSetMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentsSetMessagePayloadCollection.php new file mode 100644 index 00000000000..30399003350 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentsSetMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method CustomerGroupAssignmentsSetMessagePayload current() + * @method CustomerGroupAssignmentsSetMessagePayload end() + * @method CustomerGroupAssignmentsSetMessagePayload at($offset) + */ +class CustomerGroupAssignmentsSetMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert CustomerGroupAssignmentsSetMessagePayload $value + * @psalm-param CustomerGroupAssignmentsSetMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return CustomerGroupAssignmentsSetMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof CustomerGroupAssignmentsSetMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CustomerGroupAssignmentsSetMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?CustomerGroupAssignmentsSetMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CustomerGroupAssignmentsSetMessagePayload $data */ + $data = CustomerGroupAssignmentsSetMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentsSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentsSetMessagePayloadModel.php new file mode 100644 index 00000000000..ffb70f89ba5 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerGroupAssignmentsSetMessagePayloadModel.php @@ -0,0 +1,94 @@ +customerGroupAssignments = $customerGroupAssignments; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

Customer Groups assigned to the Customer during the Set CustomerGroupAssignments update action.

+ * + * + * @return null|CustomerGroupAssignmentCollection + */ + public function getCustomerGroupAssignments() + { + if (is_null($this->customerGroupAssignments)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_CUSTOMER_GROUP_ASSIGNMENTS); + if (is_null($data)) { + return null; + } + $this->customerGroupAssignments = CustomerGroupAssignmentCollection::fromArray($data); + } + + return $this->customerGroupAssignments; + } + + + /** + * @param ?CustomerGroupAssignmentCollection $customerGroupAssignments + */ + public function setCustomerGroupAssignments(?CustomerGroupAssignmentCollection $customerGroupAssignments): void + { + $this->customerGroupAssignments = $customerGroupAssignments; + } +} diff --git a/lib/commercetools-api/src/Models/Message/MessageModel.php b/lib/commercetools-api/src/Models/Message/MessageModel.php index 1cda68e6c87..41fca43f3ad 100644 --- a/lib/commercetools-api/src/Models/Message/MessageModel.php +++ b/lib/commercetools-api/src/Models/Message/MessageModel.php @@ -183,6 +183,9 @@ final class MessageModel extends JsonObjectModel implements Message 'CustomerEmailTokenCreated' => CustomerEmailTokenCreatedMessageModel::class, 'CustomerEmailVerified' => CustomerEmailVerifiedMessageModel::class, 'CustomerFirstNameSet' => CustomerFirstNameSetMessageModel::class, + 'CustomerGroupAssignmentAdded' => CustomerGroupAssignmentAddedMessageModel::class, + 'CustomerGroupAssignmentRemoved' => CustomerGroupAssignmentRemovedMessageModel::class, + 'CustomerGroupAssignmentsSet' => CustomerGroupAssignmentsSetMessageModel::class, 'CustomerGroupCustomFieldAdded' => CustomerGroupCustomFieldAddedMessageModel::class, 'CustomerGroupCustomFieldChanged' => CustomerGroupCustomFieldChangedMessageModel::class, 'CustomerGroupCustomFieldRemoved' => CustomerGroupCustomFieldRemovedMessageModel::class, diff --git a/lib/commercetools-api/src/Models/Message/MessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/MessagePayloadModel.php index c3a022178e4..0a89d7da8ac 100644 --- a/lib/commercetools-api/src/Models/Message/MessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/MessagePayloadModel.php @@ -114,6 +114,9 @@ final class MessagePayloadModel extends JsonObjectModel implements MessagePayloa 'CustomerEmailTokenCreated' => CustomerEmailTokenCreatedMessagePayloadModel::class, 'CustomerEmailVerified' => CustomerEmailVerifiedMessagePayloadModel::class, 'CustomerFirstNameSet' => CustomerFirstNameSetMessagePayloadModel::class, + 'CustomerGroupAssignmentAdded' => CustomerGroupAssignmentAddedMessagePayloadModel::class, + 'CustomerGroupAssignmentRemoved' => CustomerGroupAssignmentRemovedMessagePayloadModel::class, + 'CustomerGroupAssignmentsSet' => CustomerGroupAssignmentsSetMessagePayloadModel::class, 'CustomerGroupCustomFieldAdded' => CustomerGroupCustomFieldAddedMessagePayloadModel::class, 'CustomerGroupCustomFieldChanged' => CustomerGroupCustomFieldChangedMessagePayloadModel::class, 'CustomerGroupCustomFieldRemoved' => CustomerGroupCustomFieldRemovedMessagePayloadModel::class, diff --git a/lib/commercetools-api/src/Models/ProductSearch/ProductSearchProjectionParams.php b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchProjectionParams.php index 022d3583673..db71eddc6cf 100644 --- a/lib/commercetools-api/src/Models/ProductSearch/ProductSearchProjectionParams.php +++ b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchProjectionParams.php @@ -18,6 +18,7 @@ interface ProductSearchProjectionParams extends JsonObject public const FIELD_PRICE_CURRENCY = 'priceCurrency'; public const FIELD_PRICE_COUNTRY = 'priceCountry'; public const FIELD_PRICE_CUSTOMER_GROUP = 'priceCustomerGroup'; + public const FIELD_PRICE_CUSTOMER_GROUP_ASSIGNMENTS = 'priceCustomerGroupAssignments'; public const FIELD_PRICE_CHANNEL = 'priceChannel'; public const FIELD_LOCALE_PROJECTION = 'localeProjection'; public const FIELD_STORE_PROJECTION = 'storeProjection'; @@ -48,7 +49,7 @@ public function getStaged(); public function getPriceCurrency(); /** - *

The country used for Product price selection. Can only be used in conjunction with the priceCurrency parameter.

+ *

The country used for Product price selection. It can be used only in conjunction with the priceCurrency parameter.

* * @return null|string @@ -56,7 +57,7 @@ public function getPriceCurrency(); public function getPriceCountry(); /** - *

id of an existing CustomerGroup used for Product price selection. Can only be used in conjunction with the priceCurrency parameter.

+ *

id of an existing CustomerGroup used for Product price selection. It can be used only in conjunction with the priceCurrency parameter.

* * @return null|string @@ -64,7 +65,15 @@ public function getPriceCountry(); public function getPriceCustomerGroup(); /** - *

id of an existing Channel used for Product price selection. Can only be used in conjunction with the priceCurrency parameter.

+ *

IDs of existing CustomerGroups used for Product price selection, when using multiple Customer Groups. It can be used only in conjunction with the priceCurrency parameter.

+ * + + * @return null|array + */ + public function getPriceCustomerGroupAssignments(); + + /** + *

id of an existing Channel used for Product price selection. It can be used only in conjunction with the priceCurrency parameter.

* * @return null|string @@ -117,6 +126,11 @@ public function setPriceCountry(?string $priceCountry): void; */ public function setPriceCustomerGroup(?string $priceCustomerGroup): void; + /** + * @param ?array $priceCustomerGroupAssignments + */ + public function setPriceCustomerGroupAssignments(?array $priceCustomerGroupAssignments): void; + /** * @param ?string $priceChannel */ diff --git a/lib/commercetools-api/src/Models/ProductSearch/ProductSearchProjectionParamsBuilder.php b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchProjectionParamsBuilder.php index 2f7bed9feb1..33bf7e124d0 100644 --- a/lib/commercetools-api/src/Models/ProductSearch/ProductSearchProjectionParamsBuilder.php +++ b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchProjectionParamsBuilder.php @@ -50,6 +50,12 @@ final class ProductSearchProjectionParamsBuilder implements Builder */ private $priceCustomerGroup; + /** + + * @var ?array + */ + private $priceCustomerGroupAssignments; + /** * @var ?string @@ -103,7 +109,7 @@ public function getPriceCurrency() } /** - *

The country used for Product price selection. Can only be used in conjunction with the priceCurrency parameter.

+ *

The country used for Product price selection. It can be used only in conjunction with the priceCurrency parameter.

* * @return null|string @@ -114,7 +120,7 @@ public function getPriceCountry() } /** - *

id of an existing CustomerGroup used for Product price selection. Can only be used in conjunction with the priceCurrency parameter.

+ *

id of an existing CustomerGroup used for Product price selection. It can be used only in conjunction with the priceCurrency parameter.

* * @return null|string @@ -125,7 +131,18 @@ public function getPriceCustomerGroup() } /** - *

id of an existing Channel used for Product price selection. Can only be used in conjunction with the priceCurrency parameter.

+ *

IDs of existing CustomerGroups used for Product price selection, when using multiple Customer Groups. It can be used only in conjunction with the priceCurrency parameter.

+ * + + * @return null|array + */ + public function getPriceCustomerGroupAssignments() + { + return $this->priceCustomerGroupAssignments; + } + + /** + *

id of an existing Channel used for Product price selection. It can be used only in conjunction with the priceCurrency parameter.

* * @return null|string @@ -217,6 +234,17 @@ public function withPriceCustomerGroup(?string $priceCustomerGroup) return $this; } + /** + * @param ?array $priceCustomerGroupAssignments + * @return $this + */ + public function withPriceCustomerGroupAssignments(?array $priceCustomerGroupAssignments) + { + $this->priceCustomerGroupAssignments = $priceCustomerGroupAssignments; + + return $this; + } + /** * @param ?string $priceChannel * @return $this @@ -259,6 +287,7 @@ public function build(): ProductSearchProjectionParams $this->priceCurrency, $this->priceCountry, $this->priceCustomerGroup, + $this->priceCustomerGroupAssignments, $this->priceChannel, $this->localeProjection, $this->storeProjection diff --git a/lib/commercetools-api/src/Models/ProductSearch/ProductSearchProjectionParamsModel.php b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchProjectionParamsModel.php index 10932cc640f..19ce34113ef 100644 --- a/lib/commercetools-api/src/Models/ProductSearch/ProductSearchProjectionParamsModel.php +++ b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchProjectionParamsModel.php @@ -49,6 +49,12 @@ final class ProductSearchProjectionParamsModel extends JsonObjectModel implement */ protected $priceCustomerGroup; + /** + * + * @var ?array + */ + protected $priceCustomerGroupAssignments; + /** * * @var ?string @@ -77,6 +83,7 @@ public function __construct( ?string $priceCurrency = null, ?string $priceCountry = null, ?string $priceCustomerGroup = null, + ?array $priceCustomerGroupAssignments = null, ?string $priceChannel = null, ?array $localeProjection = null, ?string $storeProjection = null @@ -86,6 +93,7 @@ public function __construct( $this->priceCurrency = $priceCurrency; $this->priceCountry = $priceCountry; $this->priceCustomerGroup = $priceCustomerGroup; + $this->priceCustomerGroupAssignments = $priceCustomerGroupAssignments; $this->priceChannel = $priceChannel; $this->localeProjection = $localeProjection; $this->storeProjection = $storeProjection; @@ -153,7 +161,7 @@ public function getPriceCurrency() } /** - *

The country used for Product price selection. Can only be used in conjunction with the priceCurrency parameter.

+ *

The country used for Product price selection. It can be used only in conjunction with the priceCurrency parameter.

* * * @return null|string @@ -173,7 +181,7 @@ public function getPriceCountry() } /** - *

id of an existing CustomerGroup used for Product price selection. Can only be used in conjunction with the priceCurrency parameter.

+ *

id of an existing CustomerGroup used for Product price selection. It can be used only in conjunction with the priceCurrency parameter.

* * * @return null|string @@ -193,7 +201,27 @@ public function getPriceCustomerGroup() } /** - *

id of an existing Channel used for Product price selection. Can only be used in conjunction with the priceCurrency parameter.

+ *

IDs of existing CustomerGroups used for Product price selection, when using multiple Customer Groups. It can be used only in conjunction with the priceCurrency parameter.

+ * + * + * @return null|array + */ + public function getPriceCustomerGroupAssignments() + { + if (is_null($this->priceCustomerGroupAssignments)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_PRICE_CUSTOMER_GROUP_ASSIGNMENTS); + if (is_null($data)) { + return null; + } + $this->priceCustomerGroupAssignments = $data; + } + + return $this->priceCustomerGroupAssignments; + } + + /** + *

id of an existing Channel used for Product price selection. It can be used only in conjunction with the priceCurrency parameter.

* * * @return null|string @@ -298,6 +326,14 @@ public function setPriceCustomerGroup(?string $priceCustomerGroup): void $this->priceCustomerGroup = $priceCustomerGroup; } + /** + * @param ?array $priceCustomerGroupAssignments + */ + public function setPriceCustomerGroupAssignments(?array $priceCustomerGroupAssignments): void + { + $this->priceCustomerGroupAssignments = $priceCustomerGroupAssignments; + } + /** * @param ?string $priceChannel */ diff --git a/references.txt b/references.txt index b67a5171bab..e0c2483bdff 100644 --- a/references.txt +++ b/references.txt @@ -377,3 +377,4 @@ d6a0c240644648d19c9880bc8eb48f961165dfec a4fe92e28e967d91ddaad6750b6434a65949b840 7682e166db2a6b16fdafcbbdbf04bfd470b20c6d 83cd8adc6f390f5621bc908ec4482f74baabdba0 +ffa8644c871728467258443ffb54707031865c44