diff --git a/changes.md b/changes.md
index 9fb4eebee89..d0036a71175 100644
--- a/changes.md
+++ b/changes.md
@@ -14,18 +14,29 @@
- added type `CustomerRemoveCustomerGroupAssignmentAction`
- added type `CustomerSetCustomerGroupAssignmentsAction`
- added type `BaseEvent`
+- added type `CheckoutOrderCreationFailedEvent`
+- added type `CheckoutPaymentAuthorizationCancelledEvent`
+- added type `CheckoutPaymentAuthorizationFailedEvent`
+- added type `CheckoutPaymentAuthorizedEvent`
+- added type `CheckoutPaymentCancelAuthorizationFailedEvent`
+- added type `CheckoutPaymentChargeFailedEvent`
+- added type `CheckoutPaymentChargedEvent`
+- added type `CheckoutPaymentRefundFailedEvent`
+- added type `CheckoutPaymentRefundedEvent`
- added type `Event`
- added type `ImportContainerCreatedEvent`
-- added type `ImportContainerCreatedEventData`
- added type `ImportContainerDeletedEvent`
-- added type `ImportContainerDeletedEventData`
- added type `ImportOperationRejectedEvent`
-- added type `ImportOperationRejectedEventData`
- added type `ImportUnresolvedEvent`
-- added type `ImportUnresolvedEventData`
- added type `ImportValidationFailedEvent`
-- added type `ImportValidationFailedEventData`
- added type `ImportWaitForMasterVariantEvent`
+- added type `CheckoutMessageOrderPayloadBaseData`
+- added type `CheckoutMessagePaymentsPayloadBaseData`
+- added type `ImportContainerCreatedEventData`
+- added type `ImportContainerDeletedEventData`
+- added type `ImportOperationRejectedEventData`
+- added type `ImportUnresolvedEventData`
+- added type `ImportValidationFailedEventData`
- added type `ImportWaitForMasterVariantEventData`
- added type `AssociateRoleNameSetMessage`
- added type `BusinessUnitTopLevelUnitSetMessage`
diff --git a/lib/commercetools-api/src/Models/Event/CheckoutMessageOrderPayloadBaseData.php b/lib/commercetools-api/src/Models/Event/CheckoutMessageOrderPayloadBaseData.php
new file mode 100644
index 00000000000..5de1f8ddb7f
--- /dev/null
+++ b/lib/commercetools-api/src/Models/Event/CheckoutMessageOrderPayloadBaseData.php
@@ -0,0 +1,75 @@
+key of the Project where the order would belong to.
The Cart on which the change or action was performed.
+ * + + * @return null|CartReference + */ + public function getCart(); + + /** + *The Payments on which the change or action was performed.
+ * + + * @return null|PaymentReferenceCollection + */ + public function getPayments(); + + /** + *Errors associated with the order event.
+ * + + * @return null|ErrorObjectCollection + */ + public function getErrors(); + + /** + * @param ?string $projectKey + */ + public function setProjectKey(?string $projectKey): void; + + /** + * @param ?CartReference $cart + */ + public function setCart(?CartReference $cart): void; + + /** + * @param ?PaymentReferenceCollection $payments + */ + public function setPayments(?PaymentReferenceCollection $payments): void; + + /** + * @param ?ErrorObjectCollection $errors + */ + public function setErrors(?ErrorObjectCollection $errors): void; +} diff --git a/lib/commercetools-api/src/Models/Event/CheckoutMessageOrderPayloadBaseDataBuilder.php b/lib/commercetools-api/src/Models/Event/CheckoutMessageOrderPayloadBaseDataBuilder.php new file mode 100644 index 00000000000..74be7fbf654 --- /dev/null +++ b/lib/commercetools-api/src/Models/Event/CheckoutMessageOrderPayloadBaseDataBuilder.php @@ -0,0 +1,164 @@ + + */ +final class CheckoutMessageOrderPayloadBaseDataBuilder implements Builder +{ + /** + + * @var ?string + */ + private $projectKey; + + /** + + * @var null|CartReference|CartReferenceBuilder + */ + private $cart; + + /** + + * @var ?PaymentReferenceCollection + */ + private $payments; + + /** + + * @var ?ErrorObjectCollection + */ + private $errors; + + /** + *key of the Project where the order would belong to.
The Cart on which the change or action was performed.
+ * + + * @return null|CartReference + */ + public function getCart() + { + return $this->cart instanceof CartReferenceBuilder ? $this->cart->build() : $this->cart; + } + + /** + *The Payments on which the change or action was performed.
+ * + + * @return null|PaymentReferenceCollection + */ + public function getPayments() + { + return $this->payments; + } + + /** + *Errors associated with the order event.
+ * + + * @return null|ErrorObjectCollection + */ + public function getErrors() + { + return $this->errors; + } + + /** + * @param ?string $projectKey + * @return $this + */ + public function withProjectKey(?string $projectKey) + { + $this->projectKey = $projectKey; + + return $this; + } + + /** + * @param ?CartReference $cart + * @return $this + */ + public function withCart(?CartReference $cart) + { + $this->cart = $cart; + + return $this; + } + + /** + * @param ?PaymentReferenceCollection $payments + * @return $this + */ + public function withPayments(?PaymentReferenceCollection $payments) + { + $this->payments = $payments; + + return $this; + } + + /** + * @param ?ErrorObjectCollection $errors + * @return $this + */ + public function withErrors(?ErrorObjectCollection $errors) + { + $this->errors = $errors; + + return $this; + } + + /** + * @deprecated use withCart() instead + * @return $this + */ + public function withCartBuilder(?CartReferenceBuilder $cart) + { + $this->cart = $cart; + + return $this; + } + + public function build(): CheckoutMessageOrderPayloadBaseData + { + return new CheckoutMessageOrderPayloadBaseDataModel( + $this->projectKey, + $this->cart instanceof CartReferenceBuilder ? $this->cart->build() : $this->cart, + $this->payments, + $this->errors + ); + } + + public static function of(): CheckoutMessageOrderPayloadBaseDataBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Event/CheckoutMessageOrderPayloadBaseDataCollection.php b/lib/commercetools-api/src/Models/Event/CheckoutMessageOrderPayloadBaseDataCollection.php new file mode 100644 index 00000000000..cddd15d26de --- /dev/null +++ b/lib/commercetools-api/src/Models/Event/CheckoutMessageOrderPayloadBaseDataCollection.php @@ -0,0 +1,56 @@ + + * @method CheckoutMessageOrderPayloadBaseData current() + * @method CheckoutMessageOrderPayloadBaseData end() + * @method CheckoutMessageOrderPayloadBaseData at($offset) + */ +class CheckoutMessageOrderPayloadBaseDataCollection extends MapperSequence +{ + /** + * @psalm-assert CheckoutMessageOrderPayloadBaseData $value + * @psalm-param CheckoutMessageOrderPayloadBaseData|stdClass $value + * @throws InvalidArgumentException + * + * @return CheckoutMessageOrderPayloadBaseDataCollection + */ + public function add($value) + { + if (!$value instanceof CheckoutMessageOrderPayloadBaseData) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CheckoutMessageOrderPayloadBaseData + */ + protected function mapper() + { + return function (?int $index): ?CheckoutMessageOrderPayloadBaseData { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CheckoutMessageOrderPayloadBaseData $data */ + $data = CheckoutMessageOrderPayloadBaseDataModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Event/CheckoutMessageOrderPayloadBaseDataModel.php b/lib/commercetools-api/src/Models/Event/CheckoutMessageOrderPayloadBaseDataModel.php new file mode 100644 index 00000000000..b6f2704d443 --- /dev/null +++ b/lib/commercetools-api/src/Models/Event/CheckoutMessageOrderPayloadBaseDataModel.php @@ -0,0 +1,179 @@ +projectKey = $projectKey; + $this->cart = $cart; + $this->payments = $payments; + $this->errors = $errors; + } + + /** + *key of the Project where the order would belong to.
The Cart on which the change or action was performed.
+ * + * + * @return null|CartReference + */ + public function getCart() + { + if (is_null($this->cart)) { + /** @psalm-var stdClass|arrayThe Payments on which the change or action was performed.
+ * + * + * @return null|PaymentReferenceCollection + */ + public function getPayments() + { + if (is_null($this->payments)) { + /** @psalm-var ?listErrors associated with the order event.
+ * + * + * @return null|ErrorObjectCollection + */ + public function getErrors() + { + if (is_null($this->errors)) { + /** @psalm-var ?listkey of the Project where the payment was made.
+ *
+
+ * @return null|string
+ */
+ public function getProjectKey();
+
+ /**
+ * The Payment on which the change or action was performed.
+ * + + * @return null|PaymentReference + */ + public function getPayment(); + + /** + *id of the Transaction.
The Cart on which the change or action was performed.
+ * + + * @return null|CartReference + */ + public function getCart(); + + /** + *The Order on which the change or action was performed.
+ * + + * @return null|OrderReference + */ + public function getOrder(); + + /** + * @param ?string $projectKey + */ + public function setProjectKey(?string $projectKey): void; + + /** + * @param ?PaymentReference $payment + */ + public function setPayment(?PaymentReference $payment): void; + + /** + * @param ?string $transactionId + */ + public function setTransactionId(?string $transactionId): void; + + /** + * @param ?CartReference $cart + */ + public function setCart(?CartReference $cart): void; + + /** + * @param ?OrderReference $order + */ + public function setOrder(?OrderReference $order): void; +} diff --git a/lib/commercetools-api/src/Models/Event/CheckoutMessagePaymentsPayloadBaseDataBuilder.php b/lib/commercetools-api/src/Models/Event/CheckoutMessagePaymentsPayloadBaseDataBuilder.php new file mode 100644 index 00000000000..05942400662 --- /dev/null +++ b/lib/commercetools-api/src/Models/Event/CheckoutMessagePaymentsPayloadBaseDataBuilder.php @@ -0,0 +1,217 @@ + + */ +final class CheckoutMessagePaymentsPayloadBaseDataBuilder implements Builder +{ + /** + + * @var ?string + */ + private $projectKey; + + /** + + * @var null|PaymentReference|PaymentReferenceBuilder + */ + private $payment; + + /** + + * @var ?string + */ + private $transactionId; + + /** + + * @var null|CartReference|CartReferenceBuilder + */ + private $cart; + + /** + + * @var null|OrderReference|OrderReferenceBuilder + */ + private $order; + + /** + *key of the Project where the payment was made.
The Payment on which the change or action was performed.
+ * + + * @return null|PaymentReference + */ + public function getPayment() + { + return $this->payment instanceof PaymentReferenceBuilder ? $this->payment->build() : $this->payment; + } + + /** + *id of the Transaction.
The Cart on which the change or action was performed.
+ * + + * @return null|CartReference + */ + public function getCart() + { + return $this->cart instanceof CartReferenceBuilder ? $this->cart->build() : $this->cart; + } + + /** + *The Order on which the change or action was performed.
+ * + + * @return null|OrderReference + */ + public function getOrder() + { + return $this->order instanceof OrderReferenceBuilder ? $this->order->build() : $this->order; + } + + /** + * @param ?string $projectKey + * @return $this + */ + public function withProjectKey(?string $projectKey) + { + $this->projectKey = $projectKey; + + return $this; + } + + /** + * @param ?PaymentReference $payment + * @return $this + */ + public function withPayment(?PaymentReference $payment) + { + $this->payment = $payment; + + return $this; + } + + /** + * @param ?string $transactionId + * @return $this + */ + public function withTransactionId(?string $transactionId) + { + $this->transactionId = $transactionId; + + return $this; + } + + /** + * @param ?CartReference $cart + * @return $this + */ + public function withCart(?CartReference $cart) + { + $this->cart = $cart; + + return $this; + } + + /** + * @param ?OrderReference $order + * @return $this + */ + public function withOrder(?OrderReference $order) + { + $this->order = $order; + + return $this; + } + + /** + * @deprecated use withPayment() instead + * @return $this + */ + public function withPaymentBuilder(?PaymentReferenceBuilder $payment) + { + $this->payment = $payment; + + return $this; + } + + /** + * @deprecated use withCart() instead + * @return $this + */ + public function withCartBuilder(?CartReferenceBuilder $cart) + { + $this->cart = $cart; + + return $this; + } + + /** + * @deprecated use withOrder() instead + * @return $this + */ + public function withOrderBuilder(?OrderReferenceBuilder $order) + { + $this->order = $order; + + return $this; + } + + public function build(): CheckoutMessagePaymentsPayloadBaseData + { + return new CheckoutMessagePaymentsPayloadBaseDataModel( + $this->projectKey, + $this->payment instanceof PaymentReferenceBuilder ? $this->payment->build() : $this->payment, + $this->transactionId, + $this->cart instanceof CartReferenceBuilder ? $this->cart->build() : $this->cart, + $this->order instanceof OrderReferenceBuilder ? $this->order->build() : $this->order + ); + } + + public static function of(): CheckoutMessagePaymentsPayloadBaseDataBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Event/CheckoutMessagePaymentsPayloadBaseDataCollection.php b/lib/commercetools-api/src/Models/Event/CheckoutMessagePaymentsPayloadBaseDataCollection.php new file mode 100644 index 00000000000..19c356dd955 --- /dev/null +++ b/lib/commercetools-api/src/Models/Event/CheckoutMessagePaymentsPayloadBaseDataCollection.php @@ -0,0 +1,56 @@ + + * @method CheckoutMessagePaymentsPayloadBaseData current() + * @method CheckoutMessagePaymentsPayloadBaseData end() + * @method CheckoutMessagePaymentsPayloadBaseData at($offset) + */ +class CheckoutMessagePaymentsPayloadBaseDataCollection extends MapperSequence +{ + /** + * @psalm-assert CheckoutMessagePaymentsPayloadBaseData $value + * @psalm-param CheckoutMessagePaymentsPayloadBaseData|stdClass $value + * @throws InvalidArgumentException + * + * @return CheckoutMessagePaymentsPayloadBaseDataCollection + */ + public function add($value) + { + if (!$value instanceof CheckoutMessagePaymentsPayloadBaseData) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CheckoutMessagePaymentsPayloadBaseData + */ + protected function mapper() + { + return function (?int $index): ?CheckoutMessagePaymentsPayloadBaseData { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CheckoutMessagePaymentsPayloadBaseData $data */ + $data = CheckoutMessagePaymentsPayloadBaseDataModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Event/CheckoutMessagePaymentsPayloadBaseDataModel.php b/lib/commercetools-api/src/Models/Event/CheckoutMessagePaymentsPayloadBaseDataModel.php new file mode 100644 index 00000000000..ce70fdf032c --- /dev/null +++ b/lib/commercetools-api/src/Models/Event/CheckoutMessagePaymentsPayloadBaseDataModel.php @@ -0,0 +1,219 @@ +projectKey = $projectKey; + $this->payment = $payment; + $this->transactionId = $transactionId; + $this->cart = $cart; + $this->order = $order; + } + + /** + *key of the Project where the payment was made.
The Payment on which the change or action was performed.
+ * + * + * @return null|PaymentReference + */ + public function getPayment() + { + if (is_null($this->payment)) { + /** @psalm-var stdClass|arrayid of the Transaction.
The Cart on which the change or action was performed.
+ * + * + * @return null|CartReference + */ + public function getCart() + { + if (is_null($this->cart)) { + /** @psalm-var stdClass|arrayThe Order on which the change or action was performed.
+ * + * + * @return null|OrderReference + */ + public function getOrder() + { + if (is_null($this->order)) { + /** @psalm-var stdClass|arrayUnique identifier of the Event.
+ * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + + * @return null|string + */ + public function getNotificationType() + { + return $this->notificationType; + } + + /** + + * @return null|string + */ + public function getResourceType() + { + return $this->resourceType; + } + + /** + *Date and time (UTC) the Event was generated.
+ * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *An object containing details of the order which could not be created.
+ * + + * @return null|CheckoutMessageOrderPayloadBaseData + */ + public function getData() + { + return $this->data instanceof CheckoutMessageOrderPayloadBaseDataBuilder ? $this->data->build() : $this->data; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?string $notificationType + * @return $this + */ + public function withNotificationType(?string $notificationType) + { + $this->notificationType = $notificationType; + + return $this; + } + + /** + * @param ?string $resourceType + * @return $this + */ + public function withResourceType(?string $resourceType) + { + $this->resourceType = $resourceType; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?CheckoutMessageOrderPayloadBaseData $data + * @return $this + */ + public function withData(?CheckoutMessageOrderPayloadBaseData $data) + { + $this->data = $data; + + return $this; + } + + /** + * @deprecated use withData() instead + * @return $this + */ + public function withDataBuilder(?CheckoutMessageOrderPayloadBaseDataBuilder $data) + { + $this->data = $data; + + return $this; + } + + public function build(): CheckoutOrderCreationFailedEvent + { + return new CheckoutOrderCreationFailedEventModel( + $this->id, + $this->notificationType, + $this->resourceType, + $this->createdAt, + $this->data instanceof CheckoutMessageOrderPayloadBaseDataBuilder ? $this->data->build() : $this->data + ); + } + + public static function of(): CheckoutOrderCreationFailedEventBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Event/CheckoutOrderCreationFailedEventCollection.php b/lib/commercetools-api/src/Models/Event/CheckoutOrderCreationFailedEventCollection.php new file mode 100644 index 00000000000..b31e2cba450 --- /dev/null +++ b/lib/commercetools-api/src/Models/Event/CheckoutOrderCreationFailedEventCollection.php @@ -0,0 +1,56 @@ + + * @method CheckoutOrderCreationFailedEvent current() + * @method CheckoutOrderCreationFailedEvent end() + * @method CheckoutOrderCreationFailedEvent at($offset) + */ +class CheckoutOrderCreationFailedEventCollection extends EventCollection +{ + /** + * @psalm-assert CheckoutOrderCreationFailedEvent $value + * @psalm-param CheckoutOrderCreationFailedEvent|stdClass $value + * @throws InvalidArgumentException + * + * @return CheckoutOrderCreationFailedEventCollection + */ + public function add($value) + { + if (!$value instanceof CheckoutOrderCreationFailedEvent) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CheckoutOrderCreationFailedEvent + */ + protected function mapper() + { + return function (?int $index): ?CheckoutOrderCreationFailedEvent { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CheckoutOrderCreationFailedEvent $data */ + $data = CheckoutOrderCreationFailedEventModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Event/CheckoutOrderCreationFailedEventModel.php b/lib/commercetools-api/src/Models/Event/CheckoutOrderCreationFailedEventModel.php new file mode 100644 index 00000000000..332ae5fcbad --- /dev/null +++ b/lib/commercetools-api/src/Models/Event/CheckoutOrderCreationFailedEventModel.php @@ -0,0 +1,252 @@ +id = $id; + $this->notificationType = $notificationType; + $this->resourceType = $resourceType; + $this->createdAt = $createdAt; + $this->data = $data; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *Unique identifier of the Event.
+ * + * + * @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; + } + + /** + * + * @return null|string + */ + public function getNotificationType() + { + if (is_null($this->notificationType)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NOTIFICATION_TYPE); + if (is_null($data)) { + return null; + } + $this->notificationType = (string) $data; + } + + return $this->notificationType; + } + + /** + * + * @return null|string + */ + public function getResourceType() + { + if (is_null($this->resourceType)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_RESOURCE_TYPE); + if (is_null($data)) { + return null; + } + $this->resourceType = (string) $data; + } + + return $this->resourceType; + } + + /** + *The type of Event that has occurred.
+ * + * + * @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; + } + + /** + *Date and time (UTC) the Event 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; + } + + /** + *An object containing details of the order which could not be created.
+ * + * + * @return null|CheckoutMessageOrderPayloadBaseData + */ + public function getData() + { + if (is_null($this->data)) { + /** @psalm-var stdClass|arrayUnique identifier of the Event.
+ * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + + * @return null|string + */ + public function getNotificationType() + { + return $this->notificationType; + } + + /** + + * @return null|string + */ + public function getResourceType() + { + return $this->resourceType; + } + + /** + *Date and time (UTC) the Event was generated.
+ * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *An object containing details of the payment authorization that was cancelled.
+ * + + * @return null|CheckoutMessagePaymentsPayloadBaseData + */ + public function getData() + { + return $this->data instanceof CheckoutMessagePaymentsPayloadBaseDataBuilder ? $this->data->build() : $this->data; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?string $notificationType + * @return $this + */ + public function withNotificationType(?string $notificationType) + { + $this->notificationType = $notificationType; + + return $this; + } + + /** + * @param ?string $resourceType + * @return $this + */ + public function withResourceType(?string $resourceType) + { + $this->resourceType = $resourceType; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?CheckoutMessagePaymentsPayloadBaseData $data + * @return $this + */ + public function withData(?CheckoutMessagePaymentsPayloadBaseData $data) + { + $this->data = $data; + + return $this; + } + + /** + * @deprecated use withData() instead + * @return $this + */ + public function withDataBuilder(?CheckoutMessagePaymentsPayloadBaseDataBuilder $data) + { + $this->data = $data; + + return $this; + } + + public function build(): CheckoutPaymentAuthorizationCancelledEvent + { + return new CheckoutPaymentAuthorizationCancelledEventModel( + $this->id, + $this->notificationType, + $this->resourceType, + $this->createdAt, + $this->data instanceof CheckoutMessagePaymentsPayloadBaseDataBuilder ? $this->data->build() : $this->data + ); + } + + public static function of(): CheckoutPaymentAuthorizationCancelledEventBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Event/CheckoutPaymentAuthorizationCancelledEventCollection.php b/lib/commercetools-api/src/Models/Event/CheckoutPaymentAuthorizationCancelledEventCollection.php new file mode 100644 index 00000000000..3b2197f03c2 --- /dev/null +++ b/lib/commercetools-api/src/Models/Event/CheckoutPaymentAuthorizationCancelledEventCollection.php @@ -0,0 +1,56 @@ + + * @method CheckoutPaymentAuthorizationCancelledEvent current() + * @method CheckoutPaymentAuthorizationCancelledEvent end() + * @method CheckoutPaymentAuthorizationCancelledEvent at($offset) + */ +class CheckoutPaymentAuthorizationCancelledEventCollection extends EventCollection +{ + /** + * @psalm-assert CheckoutPaymentAuthorizationCancelledEvent $value + * @psalm-param CheckoutPaymentAuthorizationCancelledEvent|stdClass $value + * @throws InvalidArgumentException + * + * @return CheckoutPaymentAuthorizationCancelledEventCollection + */ + public function add($value) + { + if (!$value instanceof CheckoutPaymentAuthorizationCancelledEvent) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CheckoutPaymentAuthorizationCancelledEvent + */ + protected function mapper() + { + return function (?int $index): ?CheckoutPaymentAuthorizationCancelledEvent { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CheckoutPaymentAuthorizationCancelledEvent $data */ + $data = CheckoutPaymentAuthorizationCancelledEventModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Event/CheckoutPaymentAuthorizationCancelledEventModel.php b/lib/commercetools-api/src/Models/Event/CheckoutPaymentAuthorizationCancelledEventModel.php new file mode 100644 index 00000000000..cfce26d75e6 --- /dev/null +++ b/lib/commercetools-api/src/Models/Event/CheckoutPaymentAuthorizationCancelledEventModel.php @@ -0,0 +1,252 @@ +id = $id; + $this->notificationType = $notificationType; + $this->resourceType = $resourceType; + $this->createdAt = $createdAt; + $this->data = $data; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *Unique identifier of the Event.
+ * + * + * @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; + } + + /** + * + * @return null|string + */ + public function getNotificationType() + { + if (is_null($this->notificationType)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NOTIFICATION_TYPE); + if (is_null($data)) { + return null; + } + $this->notificationType = (string) $data; + } + + return $this->notificationType; + } + + /** + * + * @return null|string + */ + public function getResourceType() + { + if (is_null($this->resourceType)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_RESOURCE_TYPE); + if (is_null($data)) { + return null; + } + $this->resourceType = (string) $data; + } + + return $this->resourceType; + } + + /** + *The type of Event that has occurred.
+ * + * + * @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; + } + + /** + *Date and time (UTC) the Event 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; + } + + /** + *An object containing details of the payment authorization that was cancelled.
+ * + * + * @return null|CheckoutMessagePaymentsPayloadBaseData + */ + public function getData() + { + if (is_null($this->data)) { + /** @psalm-var stdClass|arrayUnique identifier of the Event.
+ * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + + * @return null|string + */ + public function getNotificationType() + { + return $this->notificationType; + } + + /** + + * @return null|string + */ + public function getResourceType() + { + return $this->resourceType; + } + + /** + *Date and time (UTC) the Event was generated.
+ * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *An object containing details of the payment authorization that failed.
+ * + + * @return null|CheckoutMessagePaymentsPayloadBaseData + */ + public function getData() + { + return $this->data instanceof CheckoutMessagePaymentsPayloadBaseDataBuilder ? $this->data->build() : $this->data; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?string $notificationType + * @return $this + */ + public function withNotificationType(?string $notificationType) + { + $this->notificationType = $notificationType; + + return $this; + } + + /** + * @param ?string $resourceType + * @return $this + */ + public function withResourceType(?string $resourceType) + { + $this->resourceType = $resourceType; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?CheckoutMessagePaymentsPayloadBaseData $data + * @return $this + */ + public function withData(?CheckoutMessagePaymentsPayloadBaseData $data) + { + $this->data = $data; + + return $this; + } + + /** + * @deprecated use withData() instead + * @return $this + */ + public function withDataBuilder(?CheckoutMessagePaymentsPayloadBaseDataBuilder $data) + { + $this->data = $data; + + return $this; + } + + public function build(): CheckoutPaymentAuthorizationFailedEvent + { + return new CheckoutPaymentAuthorizationFailedEventModel( + $this->id, + $this->notificationType, + $this->resourceType, + $this->createdAt, + $this->data instanceof CheckoutMessagePaymentsPayloadBaseDataBuilder ? $this->data->build() : $this->data + ); + } + + public static function of(): CheckoutPaymentAuthorizationFailedEventBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Event/CheckoutPaymentAuthorizationFailedEventCollection.php b/lib/commercetools-api/src/Models/Event/CheckoutPaymentAuthorizationFailedEventCollection.php new file mode 100644 index 00000000000..5e5cf0d78c3 --- /dev/null +++ b/lib/commercetools-api/src/Models/Event/CheckoutPaymentAuthorizationFailedEventCollection.php @@ -0,0 +1,56 @@ + + * @method CheckoutPaymentAuthorizationFailedEvent current() + * @method CheckoutPaymentAuthorizationFailedEvent end() + * @method CheckoutPaymentAuthorizationFailedEvent at($offset) + */ +class CheckoutPaymentAuthorizationFailedEventCollection extends EventCollection +{ + /** + * @psalm-assert CheckoutPaymentAuthorizationFailedEvent $value + * @psalm-param CheckoutPaymentAuthorizationFailedEvent|stdClass $value + * @throws InvalidArgumentException + * + * @return CheckoutPaymentAuthorizationFailedEventCollection + */ + public function add($value) + { + if (!$value instanceof CheckoutPaymentAuthorizationFailedEvent) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CheckoutPaymentAuthorizationFailedEvent + */ + protected function mapper() + { + return function (?int $index): ?CheckoutPaymentAuthorizationFailedEvent { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CheckoutPaymentAuthorizationFailedEvent $data */ + $data = CheckoutPaymentAuthorizationFailedEventModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Event/CheckoutPaymentAuthorizationFailedEventModel.php b/lib/commercetools-api/src/Models/Event/CheckoutPaymentAuthorizationFailedEventModel.php new file mode 100644 index 00000000000..545cd458096 --- /dev/null +++ b/lib/commercetools-api/src/Models/Event/CheckoutPaymentAuthorizationFailedEventModel.php @@ -0,0 +1,252 @@ +id = $id; + $this->notificationType = $notificationType; + $this->resourceType = $resourceType; + $this->createdAt = $createdAt; + $this->data = $data; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *Unique identifier of the Event.
+ * + * + * @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; + } + + /** + * + * @return null|string + */ + public function getNotificationType() + { + if (is_null($this->notificationType)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NOTIFICATION_TYPE); + if (is_null($data)) { + return null; + } + $this->notificationType = (string) $data; + } + + return $this->notificationType; + } + + /** + * + * @return null|string + */ + public function getResourceType() + { + if (is_null($this->resourceType)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_RESOURCE_TYPE); + if (is_null($data)) { + return null; + } + $this->resourceType = (string) $data; + } + + return $this->resourceType; + } + + /** + *The type of Event that has occurred.
+ * + * + * @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; + } + + /** + *Date and time (UTC) the Event 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; + } + + /** + *An object containing details of the payment authorization that failed.
+ * + * + * @return null|CheckoutMessagePaymentsPayloadBaseData + */ + public function getData() + { + if (is_null($this->data)) { + /** @psalm-var stdClass|arrayUnique identifier of the Event.
+ * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + + * @return null|string + */ + public function getNotificationType() + { + return $this->notificationType; + } + + /** + + * @return null|string + */ + public function getResourceType() + { + return $this->resourceType; + } + + /** + *Date and time (UTC) the Event was generated.
+ * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *An object containing details of the successful payment authorization.
+ * + + * @return null|CheckoutMessagePaymentsPayloadBaseData + */ + public function getData() + { + return $this->data instanceof CheckoutMessagePaymentsPayloadBaseDataBuilder ? $this->data->build() : $this->data; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?string $notificationType + * @return $this + */ + public function withNotificationType(?string $notificationType) + { + $this->notificationType = $notificationType; + + return $this; + } + + /** + * @param ?string $resourceType + * @return $this + */ + public function withResourceType(?string $resourceType) + { + $this->resourceType = $resourceType; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?CheckoutMessagePaymentsPayloadBaseData $data + * @return $this + */ + public function withData(?CheckoutMessagePaymentsPayloadBaseData $data) + { + $this->data = $data; + + return $this; + } + + /** + * @deprecated use withData() instead + * @return $this + */ + public function withDataBuilder(?CheckoutMessagePaymentsPayloadBaseDataBuilder $data) + { + $this->data = $data; + + return $this; + } + + public function build(): CheckoutPaymentAuthorizedEvent + { + return new CheckoutPaymentAuthorizedEventModel( + $this->id, + $this->notificationType, + $this->resourceType, + $this->createdAt, + $this->data instanceof CheckoutMessagePaymentsPayloadBaseDataBuilder ? $this->data->build() : $this->data + ); + } + + public static function of(): CheckoutPaymentAuthorizedEventBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Event/CheckoutPaymentAuthorizedEventCollection.php b/lib/commercetools-api/src/Models/Event/CheckoutPaymentAuthorizedEventCollection.php new file mode 100644 index 00000000000..46cb4a19129 --- /dev/null +++ b/lib/commercetools-api/src/Models/Event/CheckoutPaymentAuthorizedEventCollection.php @@ -0,0 +1,56 @@ + + * @method CheckoutPaymentAuthorizedEvent current() + * @method CheckoutPaymentAuthorizedEvent end() + * @method CheckoutPaymentAuthorizedEvent at($offset) + */ +class CheckoutPaymentAuthorizedEventCollection extends EventCollection +{ + /** + * @psalm-assert CheckoutPaymentAuthorizedEvent $value + * @psalm-param CheckoutPaymentAuthorizedEvent|stdClass $value + * @throws InvalidArgumentException + * + * @return CheckoutPaymentAuthorizedEventCollection + */ + public function add($value) + { + if (!$value instanceof CheckoutPaymentAuthorizedEvent) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CheckoutPaymentAuthorizedEvent + */ + protected function mapper() + { + return function (?int $index): ?CheckoutPaymentAuthorizedEvent { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CheckoutPaymentAuthorizedEvent $data */ + $data = CheckoutPaymentAuthorizedEventModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Event/CheckoutPaymentAuthorizedEventModel.php b/lib/commercetools-api/src/Models/Event/CheckoutPaymentAuthorizedEventModel.php new file mode 100644 index 00000000000..ad7bbbff475 --- /dev/null +++ b/lib/commercetools-api/src/Models/Event/CheckoutPaymentAuthorizedEventModel.php @@ -0,0 +1,252 @@ +id = $id; + $this->notificationType = $notificationType; + $this->resourceType = $resourceType; + $this->createdAt = $createdAt; + $this->data = $data; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *Unique identifier of the Event.
+ * + * + * @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; + } + + /** + * + * @return null|string + */ + public function getNotificationType() + { + if (is_null($this->notificationType)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NOTIFICATION_TYPE); + if (is_null($data)) { + return null; + } + $this->notificationType = (string) $data; + } + + return $this->notificationType; + } + + /** + * + * @return null|string + */ + public function getResourceType() + { + if (is_null($this->resourceType)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_RESOURCE_TYPE); + if (is_null($data)) { + return null; + } + $this->resourceType = (string) $data; + } + + return $this->resourceType; + } + + /** + *The type of Event that has occurred.
+ * + * + * @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; + } + + /** + *Date and time (UTC) the Event 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; + } + + /** + *An object containing details of the successful payment authorization.
+ * + * + * @return null|CheckoutMessagePaymentsPayloadBaseData + */ + public function getData() + { + if (is_null($this->data)) { + /** @psalm-var stdClass|arrayUnique identifier of the Event.
+ * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + + * @return null|string + */ + public function getNotificationType() + { + return $this->notificationType; + } + + /** + + * @return null|string + */ + public function getResourceType() + { + return $this->resourceType; + } + + /** + *Date and time (UTC) the Event was generated.
+ * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *An object containing details of the payment authorization that could not be cancelled.
+ * + + * @return null|CheckoutMessagePaymentsPayloadBaseData + */ + public function getData() + { + return $this->data instanceof CheckoutMessagePaymentsPayloadBaseDataBuilder ? $this->data->build() : $this->data; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?string $notificationType + * @return $this + */ + public function withNotificationType(?string $notificationType) + { + $this->notificationType = $notificationType; + + return $this; + } + + /** + * @param ?string $resourceType + * @return $this + */ + public function withResourceType(?string $resourceType) + { + $this->resourceType = $resourceType; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?CheckoutMessagePaymentsPayloadBaseData $data + * @return $this + */ + public function withData(?CheckoutMessagePaymentsPayloadBaseData $data) + { + $this->data = $data; + + return $this; + } + + /** + * @deprecated use withData() instead + * @return $this + */ + public function withDataBuilder(?CheckoutMessagePaymentsPayloadBaseDataBuilder $data) + { + $this->data = $data; + + return $this; + } + + public function build(): CheckoutPaymentCancelAuthorizationFailedEvent + { + return new CheckoutPaymentCancelAuthorizationFailedEventModel( + $this->id, + $this->notificationType, + $this->resourceType, + $this->createdAt, + $this->data instanceof CheckoutMessagePaymentsPayloadBaseDataBuilder ? $this->data->build() : $this->data + ); + } + + public static function of(): CheckoutPaymentCancelAuthorizationFailedEventBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Event/CheckoutPaymentCancelAuthorizationFailedEventCollection.php b/lib/commercetools-api/src/Models/Event/CheckoutPaymentCancelAuthorizationFailedEventCollection.php new file mode 100644 index 00000000000..b5a251dc9b7 --- /dev/null +++ b/lib/commercetools-api/src/Models/Event/CheckoutPaymentCancelAuthorizationFailedEventCollection.php @@ -0,0 +1,56 @@ + + * @method CheckoutPaymentCancelAuthorizationFailedEvent current() + * @method CheckoutPaymentCancelAuthorizationFailedEvent end() + * @method CheckoutPaymentCancelAuthorizationFailedEvent at($offset) + */ +class CheckoutPaymentCancelAuthorizationFailedEventCollection extends EventCollection +{ + /** + * @psalm-assert CheckoutPaymentCancelAuthorizationFailedEvent $value + * @psalm-param CheckoutPaymentCancelAuthorizationFailedEvent|stdClass $value + * @throws InvalidArgumentException + * + * @return CheckoutPaymentCancelAuthorizationFailedEventCollection + */ + public function add($value) + { + if (!$value instanceof CheckoutPaymentCancelAuthorizationFailedEvent) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CheckoutPaymentCancelAuthorizationFailedEvent + */ + protected function mapper() + { + return function (?int $index): ?CheckoutPaymentCancelAuthorizationFailedEvent { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CheckoutPaymentCancelAuthorizationFailedEvent $data */ + $data = CheckoutPaymentCancelAuthorizationFailedEventModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Event/CheckoutPaymentCancelAuthorizationFailedEventModel.php b/lib/commercetools-api/src/Models/Event/CheckoutPaymentCancelAuthorizationFailedEventModel.php new file mode 100644 index 00000000000..b2a4295c214 --- /dev/null +++ b/lib/commercetools-api/src/Models/Event/CheckoutPaymentCancelAuthorizationFailedEventModel.php @@ -0,0 +1,252 @@ +id = $id; + $this->notificationType = $notificationType; + $this->resourceType = $resourceType; + $this->createdAt = $createdAt; + $this->data = $data; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *Unique identifier of the Event.
+ * + * + * @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; + } + + /** + * + * @return null|string + */ + public function getNotificationType() + { + if (is_null($this->notificationType)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NOTIFICATION_TYPE); + if (is_null($data)) { + return null; + } + $this->notificationType = (string) $data; + } + + return $this->notificationType; + } + + /** + * + * @return null|string + */ + public function getResourceType() + { + if (is_null($this->resourceType)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_RESOURCE_TYPE); + if (is_null($data)) { + return null; + } + $this->resourceType = (string) $data; + } + + return $this->resourceType; + } + + /** + *The type of Event that has occurred.
+ * + * + * @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; + } + + /** + *Date and time (UTC) the Event 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; + } + + /** + *An object containing details of the payment authorization that could not be cancelled.
+ * + * + * @return null|CheckoutMessagePaymentsPayloadBaseData + */ + public function getData() + { + if (is_null($this->data)) { + /** @psalm-var stdClass|arrayUnique identifier of the Event.
+ * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + + * @return null|string + */ + public function getNotificationType() + { + return $this->notificationType; + } + + /** + + * @return null|string + */ + public function getResourceType() + { + return $this->resourceType; + } + + /** + *Date and time (UTC) the Event was generated.
+ * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *An object containing details of the failed payment charge.
+ * + + * @return null|CheckoutMessagePaymentsPayloadBaseData + */ + public function getData() + { + return $this->data instanceof CheckoutMessagePaymentsPayloadBaseDataBuilder ? $this->data->build() : $this->data; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?string $notificationType + * @return $this + */ + public function withNotificationType(?string $notificationType) + { + $this->notificationType = $notificationType; + + return $this; + } + + /** + * @param ?string $resourceType + * @return $this + */ + public function withResourceType(?string $resourceType) + { + $this->resourceType = $resourceType; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?CheckoutMessagePaymentsPayloadBaseData $data + * @return $this + */ + public function withData(?CheckoutMessagePaymentsPayloadBaseData $data) + { + $this->data = $data; + + return $this; + } + + /** + * @deprecated use withData() instead + * @return $this + */ + public function withDataBuilder(?CheckoutMessagePaymentsPayloadBaseDataBuilder $data) + { + $this->data = $data; + + return $this; + } + + public function build(): CheckoutPaymentChargeFailedEvent + { + return new CheckoutPaymentChargeFailedEventModel( + $this->id, + $this->notificationType, + $this->resourceType, + $this->createdAt, + $this->data instanceof CheckoutMessagePaymentsPayloadBaseDataBuilder ? $this->data->build() : $this->data + ); + } + + public static function of(): CheckoutPaymentChargeFailedEventBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Event/CheckoutPaymentChargeFailedEventCollection.php b/lib/commercetools-api/src/Models/Event/CheckoutPaymentChargeFailedEventCollection.php new file mode 100644 index 00000000000..703d34c9048 --- /dev/null +++ b/lib/commercetools-api/src/Models/Event/CheckoutPaymentChargeFailedEventCollection.php @@ -0,0 +1,56 @@ + + * @method CheckoutPaymentChargeFailedEvent current() + * @method CheckoutPaymentChargeFailedEvent end() + * @method CheckoutPaymentChargeFailedEvent at($offset) + */ +class CheckoutPaymentChargeFailedEventCollection extends EventCollection +{ + /** + * @psalm-assert CheckoutPaymentChargeFailedEvent $value + * @psalm-param CheckoutPaymentChargeFailedEvent|stdClass $value + * @throws InvalidArgumentException + * + * @return CheckoutPaymentChargeFailedEventCollection + */ + public function add($value) + { + if (!$value instanceof CheckoutPaymentChargeFailedEvent) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CheckoutPaymentChargeFailedEvent + */ + protected function mapper() + { + return function (?int $index): ?CheckoutPaymentChargeFailedEvent { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CheckoutPaymentChargeFailedEvent $data */ + $data = CheckoutPaymentChargeFailedEventModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Event/CheckoutPaymentChargeFailedEventModel.php b/lib/commercetools-api/src/Models/Event/CheckoutPaymentChargeFailedEventModel.php new file mode 100644 index 00000000000..87918674763 --- /dev/null +++ b/lib/commercetools-api/src/Models/Event/CheckoutPaymentChargeFailedEventModel.php @@ -0,0 +1,252 @@ +id = $id; + $this->notificationType = $notificationType; + $this->resourceType = $resourceType; + $this->createdAt = $createdAt; + $this->data = $data; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *Unique identifier of the Event.
+ * + * + * @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; + } + + /** + * + * @return null|string + */ + public function getNotificationType() + { + if (is_null($this->notificationType)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NOTIFICATION_TYPE); + if (is_null($data)) { + return null; + } + $this->notificationType = (string) $data; + } + + return $this->notificationType; + } + + /** + * + * @return null|string + */ + public function getResourceType() + { + if (is_null($this->resourceType)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_RESOURCE_TYPE); + if (is_null($data)) { + return null; + } + $this->resourceType = (string) $data; + } + + return $this->resourceType; + } + + /** + *The type of Event that has occurred.
+ * + * + * @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; + } + + /** + *Date and time (UTC) the Event 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; + } + + /** + *An object containing details of the failed payment charge.
+ * + * + * @return null|CheckoutMessagePaymentsPayloadBaseData + */ + public function getData() + { + if (is_null($this->data)) { + /** @psalm-var stdClass|arrayUnique identifier of the Event.
+ * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + + * @return null|string + */ + public function getNotificationType() + { + return $this->notificationType; + } + + /** + + * @return null|string + */ + public function getResourceType() + { + return $this->resourceType; + } + + /** + *Date and time (UTC) the Event was generated.
+ * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *An object containing details of the successful payment charge.
+ * + + * @return null|CheckoutMessagePaymentsPayloadBaseData + */ + public function getData() + { + return $this->data instanceof CheckoutMessagePaymentsPayloadBaseDataBuilder ? $this->data->build() : $this->data; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?string $notificationType + * @return $this + */ + public function withNotificationType(?string $notificationType) + { + $this->notificationType = $notificationType; + + return $this; + } + + /** + * @param ?string $resourceType + * @return $this + */ + public function withResourceType(?string $resourceType) + { + $this->resourceType = $resourceType; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?CheckoutMessagePaymentsPayloadBaseData $data + * @return $this + */ + public function withData(?CheckoutMessagePaymentsPayloadBaseData $data) + { + $this->data = $data; + + return $this; + } + + /** + * @deprecated use withData() instead + * @return $this + */ + public function withDataBuilder(?CheckoutMessagePaymentsPayloadBaseDataBuilder $data) + { + $this->data = $data; + + return $this; + } + + public function build(): CheckoutPaymentChargedEvent + { + return new CheckoutPaymentChargedEventModel( + $this->id, + $this->notificationType, + $this->resourceType, + $this->createdAt, + $this->data instanceof CheckoutMessagePaymentsPayloadBaseDataBuilder ? $this->data->build() : $this->data + ); + } + + public static function of(): CheckoutPaymentChargedEventBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Event/CheckoutPaymentChargedEventCollection.php b/lib/commercetools-api/src/Models/Event/CheckoutPaymentChargedEventCollection.php new file mode 100644 index 00000000000..d7698573905 --- /dev/null +++ b/lib/commercetools-api/src/Models/Event/CheckoutPaymentChargedEventCollection.php @@ -0,0 +1,56 @@ + + * @method CheckoutPaymentChargedEvent current() + * @method CheckoutPaymentChargedEvent end() + * @method CheckoutPaymentChargedEvent at($offset) + */ +class CheckoutPaymentChargedEventCollection extends EventCollection +{ + /** + * @psalm-assert CheckoutPaymentChargedEvent $value + * @psalm-param CheckoutPaymentChargedEvent|stdClass $value + * @throws InvalidArgumentException + * + * @return CheckoutPaymentChargedEventCollection + */ + public function add($value) + { + if (!$value instanceof CheckoutPaymentChargedEvent) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CheckoutPaymentChargedEvent + */ + protected function mapper() + { + return function (?int $index): ?CheckoutPaymentChargedEvent { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CheckoutPaymentChargedEvent $data */ + $data = CheckoutPaymentChargedEventModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Event/CheckoutPaymentChargedEventModel.php b/lib/commercetools-api/src/Models/Event/CheckoutPaymentChargedEventModel.php new file mode 100644 index 00000000000..8fa28ac1710 --- /dev/null +++ b/lib/commercetools-api/src/Models/Event/CheckoutPaymentChargedEventModel.php @@ -0,0 +1,252 @@ +id = $id; + $this->notificationType = $notificationType; + $this->resourceType = $resourceType; + $this->createdAt = $createdAt; + $this->data = $data; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *Unique identifier of the Event.
+ * + * + * @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; + } + + /** + * + * @return null|string + */ + public function getNotificationType() + { + if (is_null($this->notificationType)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NOTIFICATION_TYPE); + if (is_null($data)) { + return null; + } + $this->notificationType = (string) $data; + } + + return $this->notificationType; + } + + /** + * + * @return null|string + */ + public function getResourceType() + { + if (is_null($this->resourceType)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_RESOURCE_TYPE); + if (is_null($data)) { + return null; + } + $this->resourceType = (string) $data; + } + + return $this->resourceType; + } + + /** + *The type of Event that has occurred.
+ * + * + * @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; + } + + /** + *Date and time (UTC) the Event 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; + } + + /** + *An object containing details of the successful payment charge.
+ * + * + * @return null|CheckoutMessagePaymentsPayloadBaseData + */ + public function getData() + { + if (is_null($this->data)) { + /** @psalm-var stdClass|arrayUnique identifier of the Event.
+ * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + + * @return null|string + */ + public function getNotificationType() + { + return $this->notificationType; + } + + /** + + * @return null|string + */ + public function getResourceType() + { + return $this->resourceType; + } + + /** + *Date and time (UTC) the Event was generated.
+ * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *An object containing details of the failed payment refund attempt.
+ * + + * @return null|CheckoutMessagePaymentsPayloadBaseData + */ + public function getData() + { + return $this->data instanceof CheckoutMessagePaymentsPayloadBaseDataBuilder ? $this->data->build() : $this->data; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?string $notificationType + * @return $this + */ + public function withNotificationType(?string $notificationType) + { + $this->notificationType = $notificationType; + + return $this; + } + + /** + * @param ?string $resourceType + * @return $this + */ + public function withResourceType(?string $resourceType) + { + $this->resourceType = $resourceType; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?CheckoutMessagePaymentsPayloadBaseData $data + * @return $this + */ + public function withData(?CheckoutMessagePaymentsPayloadBaseData $data) + { + $this->data = $data; + + return $this; + } + + /** + * @deprecated use withData() instead + * @return $this + */ + public function withDataBuilder(?CheckoutMessagePaymentsPayloadBaseDataBuilder $data) + { + $this->data = $data; + + return $this; + } + + public function build(): CheckoutPaymentRefundFailedEvent + { + return new CheckoutPaymentRefundFailedEventModel( + $this->id, + $this->notificationType, + $this->resourceType, + $this->createdAt, + $this->data instanceof CheckoutMessagePaymentsPayloadBaseDataBuilder ? $this->data->build() : $this->data + ); + } + + public static function of(): CheckoutPaymentRefundFailedEventBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Event/CheckoutPaymentRefundFailedEventCollection.php b/lib/commercetools-api/src/Models/Event/CheckoutPaymentRefundFailedEventCollection.php new file mode 100644 index 00000000000..aca463750c2 --- /dev/null +++ b/lib/commercetools-api/src/Models/Event/CheckoutPaymentRefundFailedEventCollection.php @@ -0,0 +1,56 @@ + + * @method CheckoutPaymentRefundFailedEvent current() + * @method CheckoutPaymentRefundFailedEvent end() + * @method CheckoutPaymentRefundFailedEvent at($offset) + */ +class CheckoutPaymentRefundFailedEventCollection extends EventCollection +{ + /** + * @psalm-assert CheckoutPaymentRefundFailedEvent $value + * @psalm-param CheckoutPaymentRefundFailedEvent|stdClass $value + * @throws InvalidArgumentException + * + * @return CheckoutPaymentRefundFailedEventCollection + */ + public function add($value) + { + if (!$value instanceof CheckoutPaymentRefundFailedEvent) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CheckoutPaymentRefundFailedEvent + */ + protected function mapper() + { + return function (?int $index): ?CheckoutPaymentRefundFailedEvent { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CheckoutPaymentRefundFailedEvent $data */ + $data = CheckoutPaymentRefundFailedEventModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Event/CheckoutPaymentRefundFailedEventModel.php b/lib/commercetools-api/src/Models/Event/CheckoutPaymentRefundFailedEventModel.php new file mode 100644 index 00000000000..b1370597a7a --- /dev/null +++ b/lib/commercetools-api/src/Models/Event/CheckoutPaymentRefundFailedEventModel.php @@ -0,0 +1,252 @@ +id = $id; + $this->notificationType = $notificationType; + $this->resourceType = $resourceType; + $this->createdAt = $createdAt; + $this->data = $data; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *Unique identifier of the Event.
+ * + * + * @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; + } + + /** + * + * @return null|string + */ + public function getNotificationType() + { + if (is_null($this->notificationType)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NOTIFICATION_TYPE); + if (is_null($data)) { + return null; + } + $this->notificationType = (string) $data; + } + + return $this->notificationType; + } + + /** + * + * @return null|string + */ + public function getResourceType() + { + if (is_null($this->resourceType)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_RESOURCE_TYPE); + if (is_null($data)) { + return null; + } + $this->resourceType = (string) $data; + } + + return $this->resourceType; + } + + /** + *The type of Event that has occurred.
+ * + * + * @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; + } + + /** + *Date and time (UTC) the Event 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; + } + + /** + *An object containing details of the failed payment refund attempt.
+ * + * + * @return null|CheckoutMessagePaymentsPayloadBaseData + */ + public function getData() + { + if (is_null($this->data)) { + /** @psalm-var stdClass|arrayUnique identifier of the Event.
+ * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + + * @return null|string + */ + public function getNotificationType() + { + return $this->notificationType; + } + + /** + + * @return null|string + */ + public function getResourceType() + { + return $this->resourceType; + } + + /** + *Date and time (UTC) the Event was generated.
+ * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *An object containing details of the successful payment refund.
+ * + + * @return null|CheckoutMessagePaymentsPayloadBaseData + */ + public function getData() + { + return $this->data instanceof CheckoutMessagePaymentsPayloadBaseDataBuilder ? $this->data->build() : $this->data; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?string $notificationType + * @return $this + */ + public function withNotificationType(?string $notificationType) + { + $this->notificationType = $notificationType; + + return $this; + } + + /** + * @param ?string $resourceType + * @return $this + */ + public function withResourceType(?string $resourceType) + { + $this->resourceType = $resourceType; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?CheckoutMessagePaymentsPayloadBaseData $data + * @return $this + */ + public function withData(?CheckoutMessagePaymentsPayloadBaseData $data) + { + $this->data = $data; + + return $this; + } + + /** + * @deprecated use withData() instead + * @return $this + */ + public function withDataBuilder(?CheckoutMessagePaymentsPayloadBaseDataBuilder $data) + { + $this->data = $data; + + return $this; + } + + public function build(): CheckoutPaymentRefundedEvent + { + return new CheckoutPaymentRefundedEventModel( + $this->id, + $this->notificationType, + $this->resourceType, + $this->createdAt, + $this->data instanceof CheckoutMessagePaymentsPayloadBaseDataBuilder ? $this->data->build() : $this->data + ); + } + + public static function of(): CheckoutPaymentRefundedEventBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Event/CheckoutPaymentRefundedEventCollection.php b/lib/commercetools-api/src/Models/Event/CheckoutPaymentRefundedEventCollection.php new file mode 100644 index 00000000000..0f092e5fd2a --- /dev/null +++ b/lib/commercetools-api/src/Models/Event/CheckoutPaymentRefundedEventCollection.php @@ -0,0 +1,56 @@ + + * @method CheckoutPaymentRefundedEvent current() + * @method CheckoutPaymentRefundedEvent end() + * @method CheckoutPaymentRefundedEvent at($offset) + */ +class CheckoutPaymentRefundedEventCollection extends EventCollection +{ + /** + * @psalm-assert CheckoutPaymentRefundedEvent $value + * @psalm-param CheckoutPaymentRefundedEvent|stdClass $value + * @throws InvalidArgumentException + * + * @return CheckoutPaymentRefundedEventCollection + */ + public function add($value) + { + if (!$value instanceof CheckoutPaymentRefundedEvent) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CheckoutPaymentRefundedEvent + */ + protected function mapper() + { + return function (?int $index): ?CheckoutPaymentRefundedEvent { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CheckoutPaymentRefundedEvent $data */ + $data = CheckoutPaymentRefundedEventModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Event/CheckoutPaymentRefundedEventModel.php b/lib/commercetools-api/src/Models/Event/CheckoutPaymentRefundedEventModel.php new file mode 100644 index 00000000000..2750931e1c2 --- /dev/null +++ b/lib/commercetools-api/src/Models/Event/CheckoutPaymentRefundedEventModel.php @@ -0,0 +1,252 @@ +id = $id; + $this->notificationType = $notificationType; + $this->resourceType = $resourceType; + $this->createdAt = $createdAt; + $this->data = $data; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *Unique identifier of the Event.
+ * + * + * @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; + } + + /** + * + * @return null|string + */ + public function getNotificationType() + { + if (is_null($this->notificationType)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NOTIFICATION_TYPE); + if (is_null($data)) { + return null; + } + $this->notificationType = (string) $data; + } + + return $this->notificationType; + } + + /** + * + * @return null|string + */ + public function getResourceType() + { + if (is_null($this->resourceType)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_RESOURCE_TYPE); + if (is_null($data)) { + return null; + } + $this->resourceType = (string) $data; + } + + return $this->resourceType; + } + + /** + *The type of Event that has occurred.
+ * + * + * @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; + } + + /** + *Date and time (UTC) the Event 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; + } + + /** + *An object containing details of the successful payment refund.
+ * + * + * @return null|CheckoutMessagePaymentsPayloadBaseData + */ + public function getData() + { + if (is_null($this->data)) { + /** @psalm-var stdClass|arrayUnique identifier for the type of resource, for example, import-api.
Unique identifier for the type of resource.
* * @return null|string @@ -27,7 +27,7 @@ public function getResourceTypeId(); /** *Must contain valid event types for the resource.
* For example, for resource type import-api the event type ImportContainerCreated is valid.
- * If no types are given, the Subscription will receive all events for this resource.
types are given, the Subscription will receive all events for the defined resource type.
*
* @return null|array
diff --git a/lib/commercetools-api/src/Models/Subscription/EventSubscriptionBuilder.php b/lib/commercetools-api/src/Models/Subscription/EventSubscriptionBuilder.php
index 23d9549d331..ae28a9c0294 100644
--- a/lib/commercetools-api/src/Models/Subscription/EventSubscriptionBuilder.php
+++ b/lib/commercetools-api/src/Models/Subscription/EventSubscriptionBuilder.php
@@ -33,7 +33,7 @@ final class EventSubscriptionBuilder implements Builder
private $types;
/**
- * Unique identifier for the type of resource, for example, import-api.
Unique identifier for the type of resource.
* * @return null|string @@ -46,7 +46,7 @@ public function getResourceTypeId() /** *Must contain valid event types for the resource.
* For example, for resource type import-api the event type ImportContainerCreated is valid.
- * If no types are given, the Subscription will receive all events for this resource.
types are given, the Subscription will receive all events for the defined resource type.
*
* @return null|array
diff --git a/lib/commercetools-api/src/Models/Subscription/EventSubscriptionModel.php b/lib/commercetools-api/src/Models/Subscription/EventSubscriptionModel.php
index 512cd6d3893..c3efcd78329 100644
--- a/lib/commercetools-api/src/Models/Subscription/EventSubscriptionModel.php
+++ b/lib/commercetools-api/src/Models/Subscription/EventSubscriptionModel.php
@@ -44,7 +44,7 @@ public function __construct(
}
/**
- * Unique identifier for the type of resource, for example, import-api.
Unique identifier for the type of resource.
* * * @return null|string @@ -66,7 +66,7 @@ public function getResourceTypeId() /** *Must contain valid event types for the resource.
* For example, for resource type import-api the event type ImportContainerCreated is valid.
- * If no types are given, the Subscription will receive all events for this resource.
types are given, the Subscription will receive all events for the defined resource type.
*
*
* @return null|array
diff --git a/references.txt b/references.txt
index d1dbb4f80ba..0ad3129253d 100644
--- a/references.txt
+++ b/references.txt
@@ -417,3 +417,4 @@ ab2859c84d9f146e5d8556e905538b92af4aa044
5f7c0bef26fa70b6a3ec382455b56146e3088e0e
5f7c0bef26fa70b6a3ec382455b56146e3088e0e
7c59b29681399c1a3000934fd59a46c10cbe5401
+dd595db3882a9eef83a47515f013be37deae6bff