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 @@
+ Unique identifier of the Customer. Customer Groups that the Customer belongs to.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';
/**
*
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|arrayUnique 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.
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 ?listReference 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|arrayReference to a Customer Group.
+ * + * + * @return null|CustomerGroupReference + */ + public function getCustomerGroup() + { + if (is_null($this->customerGroup)) { + /** @psalm-var stdClass|arrayCustomer Groups that the Customer belongs to.
+ * + * + * @return null|CustomerGroupAssignmentCollection + */ + public function getCustomerGroupAssignments() + { + if (is_null($this->customerGroupAssignments)) { + /** @psalm-var ?listCustomer 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|arrayCustomer 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 ?listUnique 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.
Date and time (UTC) the Message was generated.
+ * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *Value of createdAt.
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.
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.
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.
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.
IDs and references that last modified the Message.
+ * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|arrayIDs and references that created the Message.
+ * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|arrayMessage 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.
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|arrayVersion 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.
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|arrayCustomer 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|arrayUnique 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.
Date and time (UTC) the Message was generated.
+ * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *Value of createdAt.
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.
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.
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.
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.
IDs and references that last modified the Message.
+ * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|arrayIDs and references that created the Message.
+ * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|arrayMessage 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.
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|arrayVersion 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.
Customer Group removed during the Remove CustomerGroupAssignment update action.
+ * + * + * @return null|CustomerGroupAssignment + */ + public function getCustomerGroupAssignment() + { + if (is_null($this->customerGroupAssignment)) { + /** @psalm-var stdClass|arrayCustomer 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|arrayUnique 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.
Date and time (UTC) the Message was generated.
+ * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *Value of createdAt.
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.
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.
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.
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.
IDs and references that last modified the Message.
+ * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|arrayIDs and references that created the Message.
+ * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|arrayMessage 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.
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|arrayVersion 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.
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 ?listCustomer 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 ?listThe 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.
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.
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.
id of an existing Channel used for Product price selection. It can be used only in conjunction with the priceCurrency parameter.
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.
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.
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.
id of an existing Channel used for Product price selection. It can be used only in conjunction with the priceCurrency parameter.
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.
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.
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.
id of an existing Channel used for Product price selection. It can be used only in conjunction with the priceCurrency parameter.