diff --git a/lib/Model/CampaignsTriggerSendPostBody.php b/lib/Model/CampaignsTriggerSendPostBody.php index e9b1837..374c136 100644 --- a/lib/Model/CampaignsTriggerSendPostBody.php +++ b/lib/Model/CampaignsTriggerSendPostBody.php @@ -30,7 +30,7 @@ public function isInitialized($property): bool */ protected $sendId; /** - * @var string + * @var array */ protected $triggerProperties; /** @@ -72,12 +72,18 @@ public function setSendId(string $sendId): self return $this; } - public function getTriggerProperties(): string + /** + * @return array + */ + public function getTriggerProperties(): iterable { return $this->triggerProperties; } - public function setTriggerProperties(string $triggerProperties): self + /** + * @param array $triggerProperties + */ + public function setTriggerProperties(iterable $triggerProperties): self { $this->initialized['triggerProperties'] = true; $this->triggerProperties = $triggerProperties; diff --git a/lib/Model/CampaignsTriggerSendPostBodyRecipientsItem.php b/lib/Model/CampaignsTriggerSendPostBodyRecipientsItem.php index b7a1b55..f02416c 100644 --- a/lib/Model/CampaignsTriggerSendPostBodyRecipientsItem.php +++ b/lib/Model/CampaignsTriggerSendPostBodyRecipientsItem.php @@ -30,7 +30,7 @@ public function isInitialized($property): bool */ protected $externalUserId; /** - * @var string + * @var array */ protected $triggerProperties; /** @@ -68,12 +68,18 @@ public function setExternalUserId(string $externalUserId): self return $this; } - public function getTriggerProperties(): string + /** + * @return array + */ + public function getTriggerProperties(): iterable { return $this->triggerProperties; } - public function setTriggerProperties(string $triggerProperties): self + /** + * @param array $triggerProperties + */ + public function setTriggerProperties(iterable $triggerProperties): self { $this->initialized['triggerProperties'] = true; $this->triggerProperties = $triggerProperties; diff --git a/lib/Model/CanvasTriggerScheduleCreatePostBodyRecipientsItem.php b/lib/Model/CanvasTriggerScheduleCreatePostBodyRecipientsItem.php index 3246c7e..f94c3f5 100644 --- a/lib/Model/CanvasTriggerScheduleCreatePostBodyRecipientsItem.php +++ b/lib/Model/CanvasTriggerScheduleCreatePostBodyRecipientsItem.php @@ -30,7 +30,7 @@ public function isInitialized($property): bool */ protected $externalUserId; /** - * @var string + * @var array */ protected $triggerProperties; /** @@ -64,12 +64,18 @@ public function setExternalUserId(string $externalUserId): self return $this; } - public function getTriggerProperties(): string + /** + * @return array + */ + public function getTriggerProperties(): iterable { return $this->triggerProperties; } - public function setTriggerProperties(string $triggerProperties): self + /** + * @param array $triggerProperties + */ + public function setTriggerProperties(iterable $triggerProperties): self { $this->initialized['triggerProperties'] = true; $this->triggerProperties = $triggerProperties; diff --git a/lib/Model/CanvasTriggerSendPostBodyRecipientsItem.php b/lib/Model/CanvasTriggerSendPostBodyRecipientsItem.php index e084c4e..bc93ad6 100644 --- a/lib/Model/CanvasTriggerSendPostBodyRecipientsItem.php +++ b/lib/Model/CanvasTriggerSendPostBodyRecipientsItem.php @@ -30,7 +30,7 @@ public function isInitialized($property): bool */ protected $externalUserId; /** - * @var string + * @var array */ protected $triggerProperties; /** @@ -72,12 +72,18 @@ public function setExternalUserId(string $externalUserId): self return $this; } - public function getTriggerProperties(): string + /** + * @return array + */ + public function getTriggerProperties(): iterable { return $this->triggerProperties; } - public function setTriggerProperties(string $triggerProperties): self + /** + * @param array $triggerProperties + */ + public function setTriggerProperties(iterable $triggerProperties): self { $this->initialized['triggerProperties'] = true; $this->triggerProperties = $triggerProperties; diff --git a/lib/Normalizer/CampaignsTriggerSendPostBodyNormalizer.php b/lib/Normalizer/CampaignsTriggerSendPostBodyNormalizer.php index 57fd094..f130d42 100644 --- a/lib/Normalizer/CampaignsTriggerSendPostBodyNormalizer.php +++ b/lib/Normalizer/CampaignsTriggerSendPostBodyNormalizer.php @@ -58,7 +58,11 @@ public function denormalize($data, $class, $format = null, array $context = []) unset($data['send_id']); } if (\array_key_exists('trigger_properties', $data)) { - $object->setTriggerProperties($data['trigger_properties']); + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['trigger_properties'] as $key => $value) { + $values[$key] = $value; + } + $object->setTriggerProperties($values); unset($data['trigger_properties']); } if (\array_key_exists('broadcast', $data)) { @@ -70,16 +74,16 @@ public function denormalize($data, $class, $format = null, array $context = []) unset($data['audience']); } if (\array_key_exists('recipients', $data)) { - $values = []; - foreach ($data['recipients'] as $value) { - $values[] = $this->denormalizer->denormalize($value, 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItem', 'json', $context); + $values_1 = []; + foreach ($data['recipients'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItem', 'json', $context); } - $object->setRecipients($values); + $object->setRecipients($values_1); unset($data['recipients']); } - foreach ($data as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value_1; + foreach ($data as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_2; } } @@ -99,7 +103,11 @@ public function normalize($object, $format = null, array $context = []) $data['send_id'] = $object->getSendId(); } if ($object->isInitialized('triggerProperties') && null !== $object->getTriggerProperties()) { - $data['trigger_properties'] = $object->getTriggerProperties(); + $values = []; + foreach ($object->getTriggerProperties() as $key => $value) { + $values[$key] = $value; + } + $data['trigger_properties'] = $values; } if ($object->isInitialized('broadcast') && null !== $object->getBroadcast()) { $data['broadcast'] = $object->getBroadcast(); @@ -108,15 +116,15 @@ public function normalize($object, $format = null, array $context = []) $data['audience'] = $this->normalizer->normalize($object->getAudience(), 'json', $context); } if ($object->isInitialized('recipients') && null !== $object->getRecipients()) { - $values = []; - foreach ($object->getRecipients() as $value) { - $values[] = $this->normalizer->normalize($value, 'json', $context); + $values_1 = []; + foreach ($object->getRecipients() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); } - $data['recipients'] = $values; + $data['recipients'] = $values_1; } - foreach ($object as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value_1; + foreach ($object as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $data[$key_1] = $value_2; } } diff --git a/lib/Normalizer/CampaignsTriggerSendPostBodyRecipientsItemNormalizer.php b/lib/Normalizer/CampaignsTriggerSendPostBodyRecipientsItemNormalizer.php index 8f75c63..422d51f 100644 --- a/lib/Normalizer/CampaignsTriggerSendPostBodyRecipientsItemNormalizer.php +++ b/lib/Normalizer/CampaignsTriggerSendPostBodyRecipientsItemNormalizer.php @@ -58,7 +58,11 @@ public function denormalize($data, $class, $format = null, array $context = []) unset($data['external_user_id']); } if (\array_key_exists('trigger_properties', $data)) { - $object->setTriggerProperties($data['trigger_properties']); + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['trigger_properties'] as $key => $value) { + $values[$key] = $value; + } + $object->setTriggerProperties($values); unset($data['trigger_properties']); } if (\array_key_exists('send_to_existing_only', $data)) { @@ -69,9 +73,9 @@ public function denormalize($data, $class, $format = null, array $context = []) $object->setAttributes($this->denormalizer->denormalize($data['attributes'], 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItemAttributes', 'json', $context)); unset($data['attributes']); } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_1; } } @@ -91,7 +95,11 @@ public function normalize($object, $format = null, array $context = []) $data['external_user_id'] = $object->getExternalUserId(); } if ($object->isInitialized('triggerProperties') && null !== $object->getTriggerProperties()) { - $data['trigger_properties'] = $object->getTriggerProperties(); + $values = []; + foreach ($object->getTriggerProperties() as $key => $value) { + $values[$key] = $value; + } + $data['trigger_properties'] = $values; } if ($object->isInitialized('sendToExistingOnly') && null !== $object->getSendToExistingOnly()) { $data['send_to_existing_only'] = $object->getSendToExistingOnly(); @@ -99,9 +107,9 @@ public function normalize($object, $format = null, array $context = []) if ($object->isInitialized('attributes') && null !== $object->getAttributes()) { $data['attributes'] = $this->normalizer->normalize($object->getAttributes(), 'json', $context); } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + foreach ($object as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $data[$key_1] = $value_1; } } diff --git a/lib/Normalizer/CanvasTriggerScheduleCreatePostBodyRecipientsItemNormalizer.php b/lib/Normalizer/CanvasTriggerScheduleCreatePostBodyRecipientsItemNormalizer.php index dd99e79..ac111a3 100644 --- a/lib/Normalizer/CanvasTriggerScheduleCreatePostBodyRecipientsItemNormalizer.php +++ b/lib/Normalizer/CanvasTriggerScheduleCreatePostBodyRecipientsItemNormalizer.php @@ -58,20 +58,24 @@ public function denormalize($data, $class, $format = null, array $context = []) unset($data['external_user_id']); } if (\array_key_exists('trigger_properties', $data)) { - $object->setTriggerProperties($data['trigger_properties']); + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['trigger_properties'] as $key => $value) { + $values[$key] = $value; + } + $object->setTriggerProperties($values); unset($data['trigger_properties']); } if (\array_key_exists('canvas_entry_properties', $data)) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data['canvas_entry_properties'] as $key => $value) { - $values[$key] = $value; + $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['canvas_entry_properties'] as $key_1 => $value_1) { + $values_1[$key_1] = $value_1; } - $object->setCanvasEntryProperties($values); + $object->setCanvasEntryProperties($values_1); unset($data['canvas_entry_properties']); } - foreach ($data as $key_1 => $value_1) { - if (preg_match('/.*/', (string) $key_1)) { - $object[$key_1] = $value_1; + foreach ($data as $key_2 => $value_2) { + if (preg_match('/.*/', (string) $key_2)) { + $object[$key_2] = $value_2; } } @@ -91,18 +95,22 @@ public function normalize($object, $format = null, array $context = []) $data['external_user_id'] = $object->getExternalUserId(); } if ($object->isInitialized('triggerProperties') && null !== $object->getTriggerProperties()) { - $data['trigger_properties'] = $object->getTriggerProperties(); - } - if ($object->isInitialized('canvasEntryProperties') && null !== $object->getCanvasEntryProperties()) { $values = []; - foreach ($object->getCanvasEntryProperties() as $key => $value) { + foreach ($object->getTriggerProperties() as $key => $value) { $values[$key] = $value; } - $data['canvas_entry_properties'] = $values; + $data['trigger_properties'] = $values; + } + if ($object->isInitialized('canvasEntryProperties') && null !== $object->getCanvasEntryProperties()) { + $values_1 = []; + foreach ($object->getCanvasEntryProperties() as $key_1 => $value_1) { + $values_1[$key_1] = $value_1; + } + $data['canvas_entry_properties'] = $values_1; } - foreach ($object as $key_1 => $value_1) { - if (preg_match('/.*/', (string) $key_1)) { - $data[$key_1] = $value_1; + foreach ($object as $key_2 => $value_2) { + if (preg_match('/.*/', (string) $key_2)) { + $data[$key_2] = $value_2; } } diff --git a/lib/Normalizer/CanvasTriggerSendPostBodyRecipientsItemNormalizer.php b/lib/Normalizer/CanvasTriggerSendPostBodyRecipientsItemNormalizer.php index 1403cd8..d983048 100644 --- a/lib/Normalizer/CanvasTriggerSendPostBodyRecipientsItemNormalizer.php +++ b/lib/Normalizer/CanvasTriggerSendPostBodyRecipientsItemNormalizer.php @@ -58,7 +58,11 @@ public function denormalize($data, $class, $format = null, array $context = []) unset($data['external_user_id']); } if (\array_key_exists('trigger_properties', $data)) { - $object->setTriggerProperties($data['trigger_properties']); + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['trigger_properties'] as $key => $value) { + $values[$key] = $value; + } + $object->setTriggerProperties($values); unset($data['trigger_properties']); } if (\array_key_exists('canvas_entry_properties', $data)) { @@ -73,9 +77,9 @@ public function denormalize($data, $class, $format = null, array $context = []) $object->setAttributes($this->denormalizer->denormalize($data['attributes'], 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItemAttributes', 'json', $context)); unset($data['attributes']); } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_1; } } @@ -95,7 +99,11 @@ public function normalize($object, $format = null, array $context = []) $data['external_user_id'] = $object->getExternalUserId(); } if ($object->isInitialized('triggerProperties') && null !== $object->getTriggerProperties()) { - $data['trigger_properties'] = $object->getTriggerProperties(); + $values = []; + foreach ($object->getTriggerProperties() as $key => $value) { + $values[$key] = $value; + } + $data['trigger_properties'] = $values; } if ($object->isInitialized('canvasEntryProperties') && null !== $object->getCanvasEntryProperties()) { $data['canvas_entry_properties'] = $object->getCanvasEntryProperties(); @@ -106,9 +114,9 @@ public function normalize($object, $format = null, array $context = []) if ($object->isInitialized('attributes') && null !== $object->getAttributes()) { $data['attributes'] = $this->normalizer->normalize($object->getAttributes(), 'json', $context); } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + foreach ($object as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $data[$key_1] = $value_1; } }