diff --git a/changes.md b/changes.md
index fcde1c31f59..e3e21373500 100644
--- a/changes.md
+++ b/changes.md
@@ -217,6 +217,7 @@
- added type `RecurringOrderCustomFieldRemovedMessage`
- added type `RecurringOrderCustomTypeRemovedMessage`
- added type `RecurringOrderCustomTypeSetMessage`
+- added type `RecurringOrderDeletedMessage`
- added type `RecurringOrderKeySetMessage`
- added type `RecurringOrderScheduleSetMessage`
- added type `RecurringOrderStartsAtSetMessage`
@@ -265,6 +266,7 @@
- added type `RecurringOrderCustomFieldRemovedMessagePayload`
- added type `RecurringOrderCustomTypeRemovedMessagePayload`
- added type `RecurringOrderCustomTypeSetMessagePayload`
+- added type `RecurringOrderDeletedMessagePayload`
- added type `RecurringOrderKeySetMessagePayload`
- added type `RecurringOrderScheduleSetMessagePayload`
- added type `RecurringOrderStartsAtSetMessagePayload`
@@ -466,9 +468,11 @@
- added method `$apiRoot->withProjectKey()->recurringOrders()->withId()->get()`
- added method `$apiRoot->withProjectKey()->recurringOrders()->withId()->head()`
- added method `$apiRoot->withProjectKey()->recurringOrders()->withId()->post()`
+- added method `$apiRoot->withProjectKey()->recurringOrders()->withId()->delete()`
- added method `$apiRoot->withProjectKey()->recurringOrders()->withKey()->get()`
- added method `$apiRoot->withProjectKey()->recurringOrders()->withKey()->head()`
- added method `$apiRoot->withProjectKey()->recurringOrders()->withKey()->post()`
+- added method `$apiRoot->withProjectKey()->recurringOrders()->withKey()->delete()`
- added method `$apiRoot->withProjectKey()->recurrencePolicies()->withKey()->get()`
- added method `$apiRoot->withProjectKey()->recurrencePolicies()->withKey()->head()`
- added method `$apiRoot->withProjectKey()->recurrencePolicies()->withKey()->post()`
diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyRecurringOrdersByIDTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyRecurringOrdersByIDTest.php
index feba0183a8f..ba1594d7e55 100644
--- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyRecurringOrdersByIDTest.php
+++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyRecurringOrdersByIDTest.php
@@ -24,6 +24,7 @@
* @covers \Commercetools\Api\Client\Resource\ByProjectKeyRecurringOrdersByIDGet
* @covers \Commercetools\Api\Client\Resource\ByProjectKeyRecurringOrdersByIDHead
* @covers \Commercetools\Api\Client\Resource\ByProjectKeyRecurringOrdersByIDPost
+ * @covers \Commercetools\Api\Client\Resource\ByProjectKeyRecurringOrdersByIDDelete
* @covers \Commercetools\Api\Client\Resource\ResourceByProjectKeyRecurringOrdersByID
*/
class ResourceByProjectKeyRecurringOrdersByIDTest extends TestCase
@@ -148,6 +149,53 @@ function (ApiRequestBuilder $builder): RequestInterface {
},
'post',
'test_projectKey/recurring-orders/test_ID',
+ ],
+ 'ByProjectKeyRecurringOrdersByIDDelete_withDataErasure' => [
+ function (ApiRequestBuilder $builder): RequestInterface {
+ return $builder
+ ->withProjectKey('test_projectKey')
+ ->recurringOrders()
+ ->withId('test_ID')
+ ->delete()
+ ->withDataErasure('dataErasure');
+ },
+ 'delete',
+ 'test_projectKey/recurring-orders/test_ID?dataErasure=dataErasure',
+ ],
+ 'ByProjectKeyRecurringOrdersByIDDelete_withVersion' => [
+ function (ApiRequestBuilder $builder): RequestInterface {
+ return $builder
+ ->withProjectKey('test_projectKey')
+ ->recurringOrders()
+ ->withId('test_ID')
+ ->delete()
+ ->withVersion('version');
+ },
+ 'delete',
+ 'test_projectKey/recurring-orders/test_ID?version=version',
+ ],
+ 'ByProjectKeyRecurringOrdersByIDDelete_withExpand' => [
+ function (ApiRequestBuilder $builder): RequestInterface {
+ return $builder
+ ->withProjectKey('test_projectKey')
+ ->recurringOrders()
+ ->withId('test_ID')
+ ->delete()
+ ->withExpand('expand');
+ },
+ 'delete',
+ 'test_projectKey/recurring-orders/test_ID?expand=expand',
+ ],
+ 'ByProjectKeyRecurringOrdersByIDDelete' => [
+ function (ApiRequestBuilder $builder): RequestInterface {
+ return $builder
+ ->withProjectKey("test_projectKey")
+ ->recurringOrders()
+ ->withId("test_ID")
+ ->delete();
+ },
+ 'delete',
+ 'test_projectKey/recurring-orders/test_ID',
]
];
}
@@ -187,6 +235,15 @@ function (ApiRequestBuilder $builder): RequestInterface {
->withId("ID")
->post(null);
}
+ ],
+ 'ByProjectKeyRecurringOrdersByIDDelete' => [
+ function (ApiRequestBuilder $builder): RequestInterface {
+ return $builder
+ ->withProjectKey("projectKey")
+ ->recurringOrders()
+ ->withId("ID")
+ ->delete();
+ }
]
];
}
@@ -473,6 +530,106 @@ function (ApiRequestBuilder $builder): RequestInterface {
->post(null);
},
599
+ ],
+ 'ByProjectKeyRecurringOrdersByIDDelete_200' => [
+ function (ApiRequestBuilder $builder): RequestInterface {
+ return $builder
+ ->withProjectKey("projectKey")
+ ->recurringOrders()
+ ->withId("ID")
+ ->delete();
+ },
+ 200
+ ],
+ 'ByProjectKeyRecurringOrdersByIDDelete_409' => [
+ function (ApiRequestBuilder $builder): RequestInterface {
+ return $builder
+ ->withProjectKey("projectKey")
+ ->recurringOrders()
+ ->withId("ID")
+ ->delete();
+ },
+ 409
+ ],
+ 'ByProjectKeyRecurringOrdersByIDDelete_400' => [
+ function (ApiRequestBuilder $builder): RequestInterface {
+ return $builder
+ ->withProjectKey("projectKey")
+ ->recurringOrders()
+ ->withId("ID")
+ ->delete();
+ },
+ 400
+ ],
+ 'ByProjectKeyRecurringOrdersByIDDelete_401' => [
+ function (ApiRequestBuilder $builder): RequestInterface {
+ return $builder
+ ->withProjectKey("projectKey")
+ ->recurringOrders()
+ ->withId("ID")
+ ->delete();
+ },
+ 401
+ ],
+ 'ByProjectKeyRecurringOrdersByIDDelete_403' => [
+ function (ApiRequestBuilder $builder): RequestInterface {
+ return $builder
+ ->withProjectKey("projectKey")
+ ->recurringOrders()
+ ->withId("ID")
+ ->delete();
+ },
+ 403
+ ],
+ 'ByProjectKeyRecurringOrdersByIDDelete_404' => [
+ function (ApiRequestBuilder $builder): RequestInterface {
+ return $builder
+ ->withProjectKey("projectKey")
+ ->recurringOrders()
+ ->withId("ID")
+ ->delete();
+ },
+ 404
+ ],
+ 'ByProjectKeyRecurringOrdersByIDDelete_500' => [
+ function (ApiRequestBuilder $builder): RequestInterface {
+ return $builder
+ ->withProjectKey("projectKey")
+ ->recurringOrders()
+ ->withId("ID")
+ ->delete();
+ },
+ 500
+ ],
+ 'ByProjectKeyRecurringOrdersByIDDelete_502' => [
+ function (ApiRequestBuilder $builder): RequestInterface {
+ return $builder
+ ->withProjectKey("projectKey")
+ ->recurringOrders()
+ ->withId("ID")
+ ->delete();
+ },
+ 502
+ ],
+ 'ByProjectKeyRecurringOrdersByIDDelete_503' => [
+ function (ApiRequestBuilder $builder): RequestInterface {
+ return $builder
+ ->withProjectKey("projectKey")
+ ->recurringOrders()
+ ->withId("ID")
+ ->delete();
+ },
+ 503
+ ],
+ 'ByProjectKeyRecurringOrdersByIDDelete_599' => [
+ function (ApiRequestBuilder $builder): RequestInterface {
+ return $builder
+ ->withProjectKey("projectKey")
+ ->recurringOrders()
+ ->withId("ID")
+ ->delete();
+ },
+ 599
]
];
}
diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyRecurringOrdersKeyByKeyTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyRecurringOrdersKeyByKeyTest.php
index 488bd9b7bfa..528d1170021 100644
--- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyRecurringOrdersKeyByKeyTest.php
+++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyRecurringOrdersKeyByKeyTest.php
@@ -24,6 +24,7 @@
* @covers \Commercetools\Api\Client\Resource\ByProjectKeyRecurringOrdersKeyByKeyGet
* @covers \Commercetools\Api\Client\Resource\ByProjectKeyRecurringOrdersKeyByKeyHead
* @covers \Commercetools\Api\Client\Resource\ByProjectKeyRecurringOrdersKeyByKeyPost
+ * @covers \Commercetools\Api\Client\Resource\ByProjectKeyRecurringOrdersKeyByKeyDelete
* @covers \Commercetools\Api\Client\Resource\ResourceByProjectKeyRecurringOrdersKeyByKey
*/
class ResourceByProjectKeyRecurringOrdersKeyByKeyTest extends TestCase
@@ -148,6 +149,53 @@ function (ApiRequestBuilder $builder): RequestInterface {
},
'post',
'test_projectKey/recurring-orders/key=test_key',
+ ],
+ 'ByProjectKeyRecurringOrdersKeyByKeyDelete_withDataErasure' => [
+ function (ApiRequestBuilder $builder): RequestInterface {
+ return $builder
+ ->withProjectKey('test_projectKey')
+ ->recurringOrders()
+ ->withKey('test_key')
+ ->delete()
+ ->withDataErasure('dataErasure');
+ },
+ 'delete',
+ 'test_projectKey/recurring-orders/key=test_key?dataErasure=dataErasure',
+ ],
+ 'ByProjectKeyRecurringOrdersKeyByKeyDelete_withVersion' => [
+ function (ApiRequestBuilder $builder): RequestInterface {
+ return $builder
+ ->withProjectKey('test_projectKey')
+ ->recurringOrders()
+ ->withKey('test_key')
+ ->delete()
+ ->withVersion('version');
+ },
+ 'delete',
+ 'test_projectKey/recurring-orders/key=test_key?version=version',
+ ],
+ 'ByProjectKeyRecurringOrdersKeyByKeyDelete_withExpand' => [
+ function (ApiRequestBuilder $builder): RequestInterface {
+ return $builder
+ ->withProjectKey('test_projectKey')
+ ->recurringOrders()
+ ->withKey('test_key')
+ ->delete()
+ ->withExpand('expand');
+ },
+ 'delete',
+ 'test_projectKey/recurring-orders/key=test_key?expand=expand',
+ ],
+ 'ByProjectKeyRecurringOrdersKeyByKeyDelete' => [
+ function (ApiRequestBuilder $builder): RequestInterface {
+ return $builder
+ ->withProjectKey("test_projectKey")
+ ->recurringOrders()
+ ->withKey("test_key")
+ ->delete();
+ },
+ 'delete',
+ 'test_projectKey/recurring-orders/key=test_key',
]
];
}
@@ -187,6 +235,15 @@ function (ApiRequestBuilder $builder): RequestInterface {
->withKey("key")
->post(null);
}
+ ],
+ 'ByProjectKeyRecurringOrdersKeyByKeyDelete' => [
+ function (ApiRequestBuilder $builder): RequestInterface {
+ return $builder
+ ->withProjectKey("projectKey")
+ ->recurringOrders()
+ ->withKey("key")
+ ->delete();
+ }
]
];
}
@@ -473,6 +530,106 @@ function (ApiRequestBuilder $builder): RequestInterface {
->post(null);
},
599
+ ],
+ 'ByProjectKeyRecurringOrdersKeyByKeyDelete_200' => [
+ function (ApiRequestBuilder $builder): RequestInterface {
+ return $builder
+ ->withProjectKey("projectKey")
+ ->recurringOrders()
+ ->withKey("key")
+ ->delete();
+ },
+ 200
+ ],
+ 'ByProjectKeyRecurringOrdersKeyByKeyDelete_409' => [
+ function (ApiRequestBuilder $builder): RequestInterface {
+ return $builder
+ ->withProjectKey("projectKey")
+ ->recurringOrders()
+ ->withKey("key")
+ ->delete();
+ },
+ 409
+ ],
+ 'ByProjectKeyRecurringOrdersKeyByKeyDelete_400' => [
+ function (ApiRequestBuilder $builder): RequestInterface {
+ return $builder
+ ->withProjectKey("projectKey")
+ ->recurringOrders()
+ ->withKey("key")
+ ->delete();
+ },
+ 400
+ ],
+ 'ByProjectKeyRecurringOrdersKeyByKeyDelete_401' => [
+ function (ApiRequestBuilder $builder): RequestInterface {
+ return $builder
+ ->withProjectKey("projectKey")
+ ->recurringOrders()
+ ->withKey("key")
+ ->delete();
+ },
+ 401
+ ],
+ 'ByProjectKeyRecurringOrdersKeyByKeyDelete_403' => [
+ function (ApiRequestBuilder $builder): RequestInterface {
+ return $builder
+ ->withProjectKey("projectKey")
+ ->recurringOrders()
+ ->withKey("key")
+ ->delete();
+ },
+ 403
+ ],
+ 'ByProjectKeyRecurringOrdersKeyByKeyDelete_404' => [
+ function (ApiRequestBuilder $builder): RequestInterface {
+ return $builder
+ ->withProjectKey("projectKey")
+ ->recurringOrders()
+ ->withKey("key")
+ ->delete();
+ },
+ 404
+ ],
+ 'ByProjectKeyRecurringOrdersKeyByKeyDelete_500' => [
+ function (ApiRequestBuilder $builder): RequestInterface {
+ return $builder
+ ->withProjectKey("projectKey")
+ ->recurringOrders()
+ ->withKey("key")
+ ->delete();
+ },
+ 500
+ ],
+ 'ByProjectKeyRecurringOrdersKeyByKeyDelete_502' => [
+ function (ApiRequestBuilder $builder): RequestInterface {
+ return $builder
+ ->withProjectKey("projectKey")
+ ->recurringOrders()
+ ->withKey("key")
+ ->delete();
+ },
+ 502
+ ],
+ 'ByProjectKeyRecurringOrdersKeyByKeyDelete_503' => [
+ function (ApiRequestBuilder $builder): RequestInterface {
+ return $builder
+ ->withProjectKey("projectKey")
+ ->recurringOrders()
+ ->withKey("key")
+ ->delete();
+ },
+ 503
+ ],
+ 'ByProjectKeyRecurringOrdersKeyByKeyDelete_599' => [
+ function (ApiRequestBuilder $builder): RequestInterface {
+ return $builder
+ ->withProjectKey("projectKey")
+ ->recurringOrders()
+ ->withKey("key")
+ ->delete();
+ },
+ 599
]
];
}
diff --git a/lib/commercetools-api/docs/RequestBuilder.md b/lib/commercetools-api/docs/RequestBuilder.md
index 5915aefc759..028257d8d41 100644
--- a/lib/commercetools-api/docs/RequestBuilder.md
+++ b/lib/commercetools-api/docs/RequestBuilder.md
@@ -10923,6 +10923,22 @@ $request = $builder
->withId("ID")
->post(null);
```
+## `withProjectKey("projectKey")->recurringOrders()->withId("ID")->delete()`
+
+Deletes a Recurring Order in the Project.
+
+
+### Example
+```php
+use Commercetools\Api\Client\ApiRequestBuilder;
+
+$builder = new ApiRequestBuilder();
+$request = $builder
+ ->withProjectKey("projectKey")
+ ->recurringOrders()
+ ->withId("ID")
+ ->delete();
+```
## `withProjectKey("projectKey")->recurringOrders()->withKey("key")->get()`
Retrieves a Recurring Order with the provided `key`.
@@ -10971,6 +10987,22 @@ $request = $builder
->withKey("key")
->post(null);
```
+## `withProjectKey("projectKey")->recurringOrders()->withKey("key")->delete()`
+
+Deletes a Recurring Order in the Project.
+
+
+### Example
+```php
+use Commercetools\Api\Client\ApiRequestBuilder;
+
+$builder = new ApiRequestBuilder();
+$request = $builder
+ ->withProjectKey("projectKey")
+ ->recurringOrders()
+ ->withKey("key")
+ ->delete();
+```
## `withProjectKey("projectKey")->reviews()->get()`
null
diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyRecurringOrdersByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyRecurringOrdersByIDDelete.php
new file mode 100644
index 00000000000..c9543925b2f
--- /dev/null
+++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyRecurringOrdersByIDDelete.php
@@ -0,0 +1,180 @@
+
+ * @template-implements Versioned
Unique identifier of the Message. Can be used to track which Messages have been processed.
+ * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *Version of a resource. In case of Messages, this is always 1.
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.
RecurringOrder that was deleted.
+ * + + * @return null|RecurringOrder + */ + public function getRecurringOrder() + { + return $this->recurringOrder instanceof RecurringOrderBuilder ? $this->recurringOrder->build() : $this->recurringOrder; + } + + /** + * @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 ?RecurringOrder $recurringOrder + * @return $this + */ + public function withRecurringOrder(?RecurringOrder $recurringOrder) + { + $this->recurringOrder = $recurringOrder; + + 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 withRecurringOrder() instead + * @return $this + */ + public function withRecurringOrderBuilder(?RecurringOrderBuilder $recurringOrder) + { + $this->recurringOrder = $recurringOrder; + + return $this; + } + + public function build(): RecurringOrderDeletedMessage + { + return new RecurringOrderDeletedMessageModel( + $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->recurringOrder instanceof RecurringOrderBuilder ? $this->recurringOrder->build() : $this->recurringOrder + ); + } + + public static function of(): RecurringOrderDeletedMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/RecurringOrderDeletedMessageCollection.php b/lib/commercetools-api/src/Models/Message/RecurringOrderDeletedMessageCollection.php new file mode 100644 index 00000000000..a25a33afb2d --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/RecurringOrderDeletedMessageCollection.php @@ -0,0 +1,56 @@ + + * @method RecurringOrderDeletedMessage current() + * @method RecurringOrderDeletedMessage end() + * @method RecurringOrderDeletedMessage at($offset) + */ +class RecurringOrderDeletedMessageCollection extends MessageCollection +{ + /** + * @psalm-assert RecurringOrderDeletedMessage $value + * @psalm-param RecurringOrderDeletedMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return RecurringOrderDeletedMessageCollection + */ + public function add($value) + { + if (!$value instanceof RecurringOrderDeletedMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?RecurringOrderDeletedMessage + */ + protected function mapper() + { + return function (?int $index): ?RecurringOrderDeletedMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var RecurringOrderDeletedMessage $data */ + $data = RecurringOrderDeletedMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/RecurringOrderDeletedMessageModel.php b/lib/commercetools-api/src/Models/Message/RecurringOrderDeletedMessageModel.php new file mode 100644 index 00000000000..39503de2220 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/RecurringOrderDeletedMessageModel.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->recurringOrder = $recurringOrder; + $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.
RecurringOrder that was deleted.
+ * + * + * @return null|RecurringOrder + */ + public function getRecurringOrder() + { + if (is_null($this->recurringOrder)) { + /** @psalm-var stdClass|arrayRecurringOrder that was deleted.
+ * + + * @return null|RecurringOrder + */ + public function getRecurringOrder() + { + return $this->recurringOrder instanceof RecurringOrderBuilder ? $this->recurringOrder->build() : $this->recurringOrder; + } + + /** + * @param ?RecurringOrder $recurringOrder + * @return $this + */ + public function withRecurringOrder(?RecurringOrder $recurringOrder) + { + $this->recurringOrder = $recurringOrder; + + return $this; + } + + /** + * @deprecated use withRecurringOrder() instead + * @return $this + */ + public function withRecurringOrderBuilder(?RecurringOrderBuilder $recurringOrder) + { + $this->recurringOrder = $recurringOrder; + + return $this; + } + + public function build(): RecurringOrderDeletedMessagePayload + { + return new RecurringOrderDeletedMessagePayloadModel( + $this->recurringOrder instanceof RecurringOrderBuilder ? $this->recurringOrder->build() : $this->recurringOrder + ); + } + + public static function of(): RecurringOrderDeletedMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/RecurringOrderDeletedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/RecurringOrderDeletedMessagePayloadCollection.php new file mode 100644 index 00000000000..b482a0f062c --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/RecurringOrderDeletedMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method RecurringOrderDeletedMessagePayload current() + * @method RecurringOrderDeletedMessagePayload end() + * @method RecurringOrderDeletedMessagePayload at($offset) + */ +class RecurringOrderDeletedMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert RecurringOrderDeletedMessagePayload $value + * @psalm-param RecurringOrderDeletedMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return RecurringOrderDeletedMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof RecurringOrderDeletedMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?RecurringOrderDeletedMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?RecurringOrderDeletedMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var RecurringOrderDeletedMessagePayload $data */ + $data = RecurringOrderDeletedMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/RecurringOrderDeletedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/RecurringOrderDeletedMessagePayloadModel.php new file mode 100644 index 00000000000..7b8e283e12d --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/RecurringOrderDeletedMessagePayloadModel.php @@ -0,0 +1,96 @@ +recurringOrder = $recurringOrder; + $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; + } + + /** + *RecurringOrder that was deleted.
+ * + * + * @return null|RecurringOrder + */ + public function getRecurringOrder() + { + if (is_null($this->recurringOrder)) { + /** @psalm-var stdClass|array