3 declare(strict_types=1);
55 private static $discriminatorClasses = [
56 'Message' => MessageDeliveryPayloadModel::class,
57 'ResourceCreated' => ResourceCreatedDeliveryPayloadModel::class,
58 'ResourceDeleted' => ResourceDeletedDeliveryPayloadModel::class,
59 'ResourceUpdated' => ResourceUpdatedDeliveryPayloadModel::class,
86 if (is_null($this->projectKey)) {
88 $data = $this->
raw(self::FIELD_PROJECT_KEY);
92 $this->projectKey = (string) $data;
106 if (is_null($this->notificationType)) {
108 $data = $this->
raw(self::FIELD_NOTIFICATION_TYPE);
109 if (is_null($data)) {
112 $this->notificationType = (string) $data;
126 if (is_null($this->resource)) {
128 $data = $this->
raw(self::FIELD_RESOURCE);
129 if (is_null($data)) {
133 $this->resource = $className::of($data);
147 if (is_null($this->resourceUserProvidedIdentifiers)) {
149 $data = $this->
raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS);
150 if (is_null($data)) {
194 if (is_object($value) && isset($value->$fieldName)) {
196 $discriminatorValue = $value->$fieldName;
197 if (isset(self::$discriminatorClasses[$discriminatorValue])) {
198 return self::$discriminatorClasses[$discriminatorValue];
201 if (is_array($value) && isset($value[$fieldName])) {
203 $discriminatorValue = $value[$fieldName];
204 if (isset(self::$discriminatorClasses[$discriminatorValue])) {
205 return self::$discriminatorClasses[$discriminatorValue];
210 $type = DeliveryPayloadModel::class;