From c5374403c99688ef197bf2fffe8ad93448dcbc27 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Feb 2024 13:33:26 +0000 Subject: [PATCH 1/2] build(deps): bump braze-specification from `27458a7` to `c5618cb` Bumps [braze-specification](https://github.com/braze-community/braze-specification) from `27458a7` to `c5618cb`. - [Release notes](https://github.com/braze-community/braze-specification/releases) - [Commits](https://github.com/braze-community/braze-specification/compare/27458a78e7b8e1d1de71f53a3803de1d00453064...c5618cb35f673b4dc5ad67cf363de9eb52cf6a4f) --- updated-dependencies: - dependency-name: braze-specification dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- braze-specification | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/braze-specification b/braze-specification index 27458a7..c5618cb 160000 --- a/braze-specification +++ b/braze-specification @@ -1 +1 @@ -Subproject commit 27458a78e7b8e1d1de71f53a3803de1d00453064 +Subproject commit c5618cb35f673b4dc5ad67cf363de9eb52cf6a4f From 99b9ae89f13120b6a02c9c66913a1c043dc350ac Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Thu, 1 Feb 2024 13:36:51 +0000 Subject: [PATCH 2/2] feat(lib): generate code from braze-specification --- ...heduleCreatePostBodyAudienceNormalizer.php | 182 +++++-- ...riggerScheduleCreatePostBodyNormalizer.php | 324 +++++++---- ...CreatePostBodyRecipientsItemNormalizer.php | 220 +++++--- ...heduleCreatePostBodyScheduleNormalizer.php | 200 ++++--- ...riggerScheduleDeletePostBodyNormalizer.php | 179 ++++-- ...riggerScheduleUpdatePostBodyNormalizer.php | 200 ++++--- ...heduleUpdatePostBodyScheduleNormalizer.php | 179 ++++-- ...sTriggerSendPostBodyAudienceNormalizer.php | 182 +++++-- ...CampaignsTriggerSendPostBodyNormalizer.php | 303 +++++++---- ...BodyRecipientsItemAttributesNormalizer.php | 160 ++++-- ...erSendPostBodyRecipientsItemNormalizer.php | 262 ++++++--- ...tBodyRecipientsItemUserAliasNormalizer.php | 179 ++++-- ...heduleCreatePostBodyAudienceNormalizer.php | 182 +++++-- ...riggerScheduleCreatePostBodyNormalizer.php | 305 +++++++---- ...CreatePostBodyRecipientsItemNormalizer.php | 261 ++++++--- ...heduleCreatePostBodyScheduleNormalizer.php | 200 ++++--- ...riggerScheduleDeletePostBodyNormalizer.php | 179 ++++-- ...riggerScheduleUpdatePostBodyNormalizer.php | 200 ++++--- ...heduleUpdatePostBodyScheduleNormalizer.php | 179 ++++-- ...sTriggerSendPostBodyAudienceNormalizer.php | 182 +++++-- ...ostBodyCanvasEntryPropertiesNormalizer.php | 188 +++++-- .../CanvasTriggerSendPostBodyNormalizer.php | 262 ++++++--- ...BodyRecipientsItemAttributesNormalizer.php | 160 ++++-- ...erSendPostBodyRecipientsItemNormalizer.php | 283 +++++++--- ...tBodyRecipientsItemUserAliasNormalizer.php | 179 ++++-- ...alogNameItemsItemIdPatchBodyNormalizer.php | 202 ++++--- ...talogNameItemsItemIdPostBodyNormalizer.php | 202 ++++--- ...atalogNameItemsItemIdPutBodyNormalizer.php | 202 ++++--- ...gNameItemsPatchBodyItemsItemNormalizer.php | 160 ++++-- ...ogsCatalogNameItemsPatchBodyNormalizer.php | 182 +++++-- ...logsCatalogNameItemsPostBodyNormalizer.php | 202 ++++--- ...alogsCatalogNameItemsPutBodyNormalizer.php | 202 ++++--- ...stBodyCatalogsItemFieldsItemNormalizer.php | 179 ++++-- ...CatalogsPostBodyCatalogsItemNormalizer.php | 220 +++++--- lib/Normalizer/CatalogsPostBodyNormalizer.php | 182 +++++-- .../ContentBlocksCreatePostBodyNormalizer.php | 262 ++++++--- .../ContentBlocksUpdatePostBodyNormalizer.php | 283 +++++++--- .../EmailBlacklistPostBodyNormalizer.php | 182 +++++-- .../EmailBlocklistPostBodyNormalizer.php | 182 +++++-- .../EmailBounceRemovePostBodyNormalizer.php | 160 ++++-- .../EmailSpamRemovePostBodyNormalizer.php | 160 ++++-- .../EmailStatusPostBodyNormalizer.php | 179 ++++-- lib/Normalizer/ErrorNormalizer.php | 201 ++++--- lib/Normalizer/JaneObjectNormalizer.php | 149 +++-- ...tyUpdatePostBodyContentStateNormalizer.php | 179 ++++-- ...esLiveActivityUpdatePostBodyNormalizer.php | 284 +++++++--- ...atePostBodyNotificationAlertNormalizer.php | 179 ++++-- ...tyUpdatePostBodyNotificationNormalizer.php | 160 ++++-- ...heduleCreatePostBodyAudienceNormalizer.php | 182 +++++-- ...heduleCreatePostBodyMessagesNormalizer.php | 510 ++++++++++++------ ...ssagesScheduleCreatePostBodyNormalizer.php | 368 +++++++++---- ...heduleCreatePostBodyScheduleNormalizer.php | 200 ++++--- ...uleCreatePostBodyUserAliasesNormalizer.php | 179 ++++-- ...ssagesScheduleDeletePostBodyNormalizer.php | 160 ++++-- ...ePostBodyMessagesAndroidPushNormalizer.php | 179 ++++-- ...atePostBodyMessagesApplePushNormalizer.php | 179 ++++-- ...heduleUpdatePostBodyMessagesNormalizer.php | 200 ++++--- ...uleUpdatePostBodyMessagesSmsNormalizer.php | 221 +++++--- ...ssagesScheduleUpdatePostBodyNormalizer.php | 200 ++++--- ...heduleUpdatePostBodyScheduleNormalizer.php | 160 ++++-- ...MessagesSendPostBodyAudienceNormalizer.php | 182 +++++-- ...MessagesSendPostBodyMessagesNormalizer.php | 305 +++++++---- .../MessagesSendPostBodyNormalizer.php | 347 ++++++++---- ...sagesSendPostBodyUserAliasesNormalizer.php | 179 ++++-- .../PreferenceCenterV1PostBodyNormalizer.php | 263 ++++++--- ...renceCenterV1PostBodyOptionsNormalizer.php | 160 ++++-- ...renceCenterExternalIDPutBodyNormalizer.php | 220 +++++--- ...ternalIDPutBodyRecipientItemNormalizer.php | 160 ++++-- ...alIDPutBodyTriggerPropertiesNormalizer.php | 179 ++++-- .../ScimV2UsersIdPutBodyNameNormalizer.php | 179 ++++-- .../ScimV2UsersIdPutBodyNormalizer.php | 243 ++++++--- ...tBodyPermissionsAppGroupItemNormalizer.php | 242 ++++++--- ...missionsAppGroupItemTeamItemNormalizer.php | 201 ++++--- ...mV2UsersIdPutBodyPermissionsNormalizer.php | 223 +++++--- .../ScimV2UsersPostBodyNameNormalizer.php | 179 ++++-- .../ScimV2UsersPostBodyNormalizer.php | 264 ++++++--- ...tBodyPermissionsAppGroupItemNormalizer.php | 242 ++++++--- ...missionsAppGroupItemTeamItemNormalizer.php | 201 ++++--- ...imV2UsersPostBodyPermissionsNormalizer.php | 223 +++++--- .../SendsIdCreatePostBodyNormalizer.php | 179 ++++-- ...idPhoneNumbersRemovePostBodyNormalizer.php | 182 +++++-- ...ubscriptionStatusSetPostBodyNormalizer.php | 241 ++++++--- ...TemplatesEmailCreatePostBodyNormalizer.php | 283 +++++++--- ...TemplatesEmailUpdatePostBodyNormalizer.php | 304 +++++++---- ...paignsCampaignIdSendPostBodyNormalizer.php | 220 +++++--- ...nIdSendPostBodyRecipientItemNormalizer.php | 160 ++++-- ...endPostBodyTriggerPropertiesNormalizer.php | 179 ++++-- .../UsersAliasNewPostBodyNormalizer.php | 182 +++++-- ...asNewPostBodyUserAliasesItemNormalizer.php | 200 ++++--- ...datePostBodyAliasUpdatesItemNormalizer.php | 200 ++++--- .../UsersAliasUpdatePostBodyNormalizer.php | 182 +++++-- .../UsersDeletePostBodyNormalizer.php | 264 ++++++--- ...eletePostBodyUserAliasesItemNormalizer.php | 179 ++++-- ...rtGlobalControlGroupPostBodyNormalizer.php | 222 +++++--- .../UsersExportIdsPostBodyNormalizer.php | 346 ++++++++---- ...rtIdsPostBodyUserAliasesItemNormalizer.php | 179 ++++-- .../UsersExportSegmentPostBodyNormalizer.php | 241 ++++++--- ...ersExternalIdsRemovePostBodyNormalizer.php | 182 +++++-- ...ostBodyExternalIdRenamesItemNormalizer.php | 179 ++++-- ...ersExternalIdsRenamePostBodyNormalizer.php | 182 +++++-- ...ostBodyAliasesToIdentifyItemNormalizer.php | 179 ++++-- ...iasesToIdentifyItemUserAliasNormalizer.php | 179 ++++-- .../UsersIdentifyPostBodyNormalizer.php | 182 +++++-- .../UsersMergePostBodyNormalizer.php | 182 +++++-- .../UsersTrackPostBodyNormalizer.php | 304 +++++++---- ...ubscriptionStatusSetPostBodyNormalizer.php | 182 +++++-- ...stBodySubscriptionGroupsItemNormalizer.php | 220 +++++--- lib/Runtime/Client/BaseEndpoint.php | 1 + lib/Runtime/Client/Client.php | 2 +- .../Normalizer/ReferenceNormalizer.php | 37 +- lib/Runtime/Normalizer/ValidatorTrait.php | 3 +- 111 files changed, 15885 insertions(+), 6825 deletions(-) diff --git a/lib/Normalizer/CampaignsTriggerScheduleCreatePostBodyAudienceNormalizer.php b/lib/Normalizer/CampaignsTriggerScheduleCreatePostBodyAudienceNormalizer.php index d9c4b53..028e123 100644 --- a/lib/Normalizer/CampaignsTriggerScheduleCreatePostBodyAudienceNormalizer.php +++ b/lib/Normalizer/CampaignsTriggerScheduleCreatePostBodyAudienceNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,76 +21,149 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class CampaignsTriggerScheduleCreatePostBodyAudienceNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class CampaignsTriggerScheduleCreatePostBodyAudienceNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return $type === 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBodyAudience'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool - { - return is_object($data) && get_class($data) === 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBodyAudience'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBodyAudience'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBodyAudience'; } - $object = new \Braze\Model\CampaignsTriggerScheduleCreatePostBodyAudience(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CampaignsTriggerScheduleCreatePostBodyAudience(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('AND', $data)) { + $values = []; + foreach ($data['AND'] as $value) { + $values[] = $value; + } + $object->setAND($values); + unset($data['AND']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('AND', $data)) { - $values = []; - foreach ($data['AND'] as $value) { - $values[] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('aND') && null !== $object->getAND()) { + $values = []; + foreach ($object->getAND() as $value) { + $values[] = $value; + } + $data['AND'] = $values; } - $object->setAND($values); - unset($data['AND']); - } - foreach ($data as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value_1; + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CampaignsTriggerScheduleCreatePostBodyAudience' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class CampaignsTriggerScheduleCreatePostBodyAudienceNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('aND') && null !== $object->getAND()) { - $values = []; - foreach ($object->getAND() as $value) { - $values[] = $value; - } - $data['AND'] = $values; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBodyAudience'; } - foreach ($object as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value_1; + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBodyAudience'; + } + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CampaignsTriggerScheduleCreatePostBodyAudience(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('AND', $data)) { + $values = []; + foreach ($data['AND'] as $value) { + $values[] = $value; + } + $object->setAND($values); + unset($data['AND']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('aND') && null !== $object->getAND()) { + $values = []; + foreach ($object->getAND() as $value) { + $values[] = $value; + } + $data['AND'] = $values; + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\CampaignsTriggerScheduleCreatePostBodyAudience' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CampaignsTriggerScheduleCreatePostBodyAudience' => false]; + } } } diff --git a/lib/Normalizer/CampaignsTriggerScheduleCreatePostBodyNormalizer.php b/lib/Normalizer/CampaignsTriggerScheduleCreatePostBodyNormalizer.php index 57b3279..e70d2ec 100644 --- a/lib/Normalizer/CampaignsTriggerScheduleCreatePostBodyNormalizer.php +++ b/lib/Normalizer/CampaignsTriggerScheduleCreatePostBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,126 +21,249 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class CampaignsTriggerScheduleCreatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class CampaignsTriggerScheduleCreatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return $type === 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool - { - return is_object($data) && get_class($data) === 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBody'; } - $object = new \Braze\Model\CampaignsTriggerScheduleCreatePostBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CampaignsTriggerScheduleCreatePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('campaign_id', $data)) { + $object->setCampaignId($data['campaign_id']); + unset($data['campaign_id']); + } + if (\array_key_exists('send_id', $data)) { + $object->setSendId($data['send_id']); + unset($data['send_id']); + } + if (\array_key_exists('recipients', $data)) { + $values = []; + foreach ($data['recipients'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBodyRecipientsItem', 'json', $context); + } + $object->setRecipients($values); + unset($data['recipients']); + } + if (\array_key_exists('audience', $data)) { + $object->setAudience($this->denormalizer->denormalize($data['audience'], 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBodyAudience', 'json', $context)); + unset($data['audience']); + } + if (\array_key_exists('broadcast', $data)) { + $object->setBroadcast($data['broadcast']); + unset($data['broadcast']); + } + if (\array_key_exists('trigger_properties', $data)) { + $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['trigger_properties'] as $key => $value_1) { + $values_1[$key] = $value_1; + } + $object->setTriggerProperties($values_1); + unset($data['trigger_properties']); + } + if (\array_key_exists('schedule', $data)) { + $object->setSchedule($this->denormalizer->denormalize($data['schedule'], 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBodySchedule', 'json', $context)); + unset($data['schedule']); + } + foreach ($data as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_2; + } + } + return $object; } - if (\array_key_exists('campaign_id', $data)) { - $object->setCampaignId($data['campaign_id']); - unset($data['campaign_id']); - } - if (\array_key_exists('send_id', $data)) { - $object->setSendId($data['send_id']); - unset($data['send_id']); - } - if (\array_key_exists('recipients', $data)) { - $values = []; - foreach ($data['recipients'] as $value) { - $values[] = $this->denormalizer->denormalize($value, 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBodyRecipientsItem', 'json', $context); + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('campaignId') && null !== $object->getCampaignId()) { + $data['campaign_id'] = $object->getCampaignId(); } - $object->setRecipients($values); - unset($data['recipients']); - } - if (\array_key_exists('audience', $data)) { - $object->setAudience($this->denormalizer->denormalize($data['audience'], 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBodyAudience', 'json', $context)); - unset($data['audience']); - } - if (\array_key_exists('broadcast', $data)) { - $object->setBroadcast($data['broadcast']); - unset($data['broadcast']); - } - if (\array_key_exists('trigger_properties', $data)) { - $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data['trigger_properties'] as $key => $value_1) { - $values_1[$key] = $value_1; + if ($object->isInitialized('sendId') && null !== $object->getSendId()) { + $data['send_id'] = $object->getSendId(); } - $object->setTriggerProperties($values_1); - unset($data['trigger_properties']); - } - if (\array_key_exists('schedule', $data)) { - $object->setSchedule($this->denormalizer->denormalize($data['schedule'], 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBodySchedule', 'json', $context)); - unset($data['schedule']); - } - foreach ($data as $key_1 => $value_2) { - if (preg_match('/.*/', (string) $key_1)) { - $object[$key_1] = $value_2; + if ($object->isInitialized('recipients') && null !== $object->getRecipients()) { + $values = []; + foreach ($object->getRecipients() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['recipients'] = $values; + } + if ($object->isInitialized('audience') && null !== $object->getAudience()) { + $data['audience'] = $this->normalizer->normalize($object->getAudience(), 'json', $context); + } + if ($object->isInitialized('broadcast') && null !== $object->getBroadcast()) { + $data['broadcast'] = $object->getBroadcast(); } + if ($object->isInitialized('triggerProperties') && null !== $object->getTriggerProperties()) { + $values_1 = []; + foreach ($object->getTriggerProperties() as $key => $value_1) { + $values_1[$key] = $value_1; + } + $data['trigger_properties'] = $values_1; + } + if ($object->isInitialized('schedule') && null !== $object->getSchedule()) { + $data['schedule'] = $this->normalizer->normalize($object->getSchedule(), 'json', $context); + } + foreach ($object as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $data[$key_1] = $value_2; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CampaignsTriggerScheduleCreatePostBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class CampaignsTriggerScheduleCreatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('campaignId') && null !== $object->getCampaignId()) { - $data['campaign_id'] = $object->getCampaignId(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBody'; } - if ($object->isInitialized('sendId') && null !== $object->getSendId()) { - $data['send_id'] = $object->getSendId(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBody'; } - if ($object->isInitialized('recipients') && null !== $object->getRecipients()) { - $values = []; - foreach ($object->getRecipients() as $value) { - $values[] = $this->normalizer->normalize($value, 'json', $context); + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - $data['recipients'] = $values; - } - if ($object->isInitialized('audience') && null !== $object->getAudience()) { - $data['audience'] = $this->normalizer->normalize($object->getAudience(), 'json', $context); - } - if ($object->isInitialized('broadcast') && null !== $object->getBroadcast()) { - $data['broadcast'] = $object->getBroadcast(); - } - if ($object->isInitialized('triggerProperties') && null !== $object->getTriggerProperties()) { - $values_1 = []; - foreach ($object->getTriggerProperties() as $key => $value_1) { - $values_1[$key] = $value_1; + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } - $data['trigger_properties'] = $values_1; - } - if ($object->isInitialized('schedule') && null !== $object->getSchedule()) { - $data['schedule'] = $this->normalizer->normalize($object->getSchedule(), 'json', $context); - } - foreach ($object as $key_1 => $value_2) { - if (preg_match('/.*/', (string) $key_1)) { - $data[$key_1] = $value_2; + $object = new \Braze\Model\CampaignsTriggerScheduleCreatePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('campaign_id', $data)) { + $object->setCampaignId($data['campaign_id']); + unset($data['campaign_id']); + } + if (\array_key_exists('send_id', $data)) { + $object->setSendId($data['send_id']); + unset($data['send_id']); + } + if (\array_key_exists('recipients', $data)) { + $values = []; + foreach ($data['recipients'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBodyRecipientsItem', 'json', $context); + } + $object->setRecipients($values); + unset($data['recipients']); + } + if (\array_key_exists('audience', $data)) { + $object->setAudience($this->denormalizer->denormalize($data['audience'], 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBodyAudience', 'json', $context)); + unset($data['audience']); + } + if (\array_key_exists('broadcast', $data)) { + $object->setBroadcast($data['broadcast']); + unset($data['broadcast']); + } + if (\array_key_exists('trigger_properties', $data)) { + $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['trigger_properties'] as $key => $value_1) { + $values_1[$key] = $value_1; + } + $object->setTriggerProperties($values_1); + unset($data['trigger_properties']); + } + if (\array_key_exists('schedule', $data)) { + $object->setSchedule($this->denormalizer->denormalize($data['schedule'], 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBodySchedule', 'json', $context)); + unset($data['schedule']); } + foreach ($data as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_2; + } + } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('campaignId') && null !== $object->getCampaignId()) { + $data['campaign_id'] = $object->getCampaignId(); + } + if ($object->isInitialized('sendId') && null !== $object->getSendId()) { + $data['send_id'] = $object->getSendId(); + } + if ($object->isInitialized('recipients') && null !== $object->getRecipients()) { + $values = []; + foreach ($object->getRecipients() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['recipients'] = $values; + } + if ($object->isInitialized('audience') && null !== $object->getAudience()) { + $data['audience'] = $this->normalizer->normalize($object->getAudience(), 'json', $context); + } + if ($object->isInitialized('broadcast') && null !== $object->getBroadcast()) { + $data['broadcast'] = $object->getBroadcast(); + } + if ($object->isInitialized('triggerProperties') && null !== $object->getTriggerProperties()) { + $values_1 = []; + foreach ($object->getTriggerProperties() as $key => $value_1) { + $values_1[$key] = $value_1; + } + $data['trigger_properties'] = $values_1; + } + if ($object->isInitialized('schedule') && null !== $object->getSchedule()) { + $data['schedule'] = $this->normalizer->normalize($object->getSchedule(), 'json', $context); + } + foreach ($object as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $data[$key_1] = $value_2; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\CampaignsTriggerScheduleCreatePostBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CampaignsTriggerScheduleCreatePostBody' => false]; + } } } diff --git a/lib/Normalizer/CampaignsTriggerScheduleCreatePostBodyRecipientsItemNormalizer.php b/lib/Normalizer/CampaignsTriggerScheduleCreatePostBodyRecipientsItemNormalizer.php index bafd116..f34b7f6 100644 --- a/lib/Normalizer/CampaignsTriggerScheduleCreatePostBodyRecipientsItemNormalizer.php +++ b/lib/Normalizer/CampaignsTriggerScheduleCreatePostBodyRecipientsItemNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,90 +21,177 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class CampaignsTriggerScheduleCreatePostBodyRecipientsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBodyRecipientsItem'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class CampaignsTriggerScheduleCreatePostBodyRecipientsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBodyRecipientsItem'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBodyRecipientsItem'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBodyRecipientsItem'; } - $object = new \Braze\Model\CampaignsTriggerScheduleCreatePostBodyRecipientsItem(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CampaignsTriggerScheduleCreatePostBodyRecipientsItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('user_alias', $data)) { + $object->setUserAlias($data['user_alias']); + unset($data['user_alias']); + } + if (\array_key_exists('external_user_id', $data)) { + $object->setExternalUserId($data['external_user_id']); + unset($data['external_user_id']); + } + if (\array_key_exists('trigger_properties', $data)) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['trigger_properties'] as $key => $value) { + $values[$key] = $value; + } + $object->setTriggerProperties($values); + unset($data['trigger_properties']); + } + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_1; + } + } + return $object; } - if (\array_key_exists('user_alias', $data)) { - $object->setUserAlias($data['user_alias']); - unset($data['user_alias']); - } - if (\array_key_exists('external_user_id', $data)) { - $object->setExternalUserId($data['external_user_id']); - unset($data['external_user_id']); - } - if (\array_key_exists('trigger_properties', $data)) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data['trigger_properties'] as $key => $value) { - $values[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('userAlias') && null !== $object->getUserAlias()) { + $data['user_alias'] = $object->getUserAlias(); } - $object->setTriggerProperties($values); - unset($data['trigger_properties']); - } - foreach ($data as $key_1 => $value_1) { - if (preg_match('/.*/', (string) $key_1)) { - $object[$key_1] = $value_1; + if ($object->isInitialized('externalUserId') && null !== $object->getExternalUserId()) { + $data['external_user_id'] = $object->getExternalUserId(); + } + if ($object->isInitialized('triggerProperties') && null !== $object->getTriggerProperties()) { + $values = []; + foreach ($object->getTriggerProperties() as $key => $value) { + $values[$key] = $value; + } + $data['trigger_properties'] = $values; } + foreach ($object as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $data[$key_1] = $value_1; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CampaignsTriggerScheduleCreatePostBodyRecipientsItem' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class CampaignsTriggerScheduleCreatePostBodyRecipientsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('userAlias') && null !== $object->getUserAlias()) { - $data['user_alias'] = $object->getUserAlias(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBodyRecipientsItem'; } - if ($object->isInitialized('externalUserId') && null !== $object->getExternalUserId()) { - $data['external_user_id'] = $object->getExternalUserId(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBodyRecipientsItem'; } - if ($object->isInitialized('triggerProperties') && null !== $object->getTriggerProperties()) { - $values = []; - foreach ($object->getTriggerProperties() as $key => $value) { - $values[$key] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - $data['trigger_properties'] = $values; - } - foreach ($object as $key_1 => $value_1) { - if (preg_match('/.*/', (string) $key_1)) { - $data[$key_1] = $value_1; + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CampaignsTriggerScheduleCreatePostBodyRecipientsItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('user_alias', $data)) { + $object->setUserAlias($data['user_alias']); + unset($data['user_alias']); + } + if (\array_key_exists('external_user_id', $data)) { + $object->setExternalUserId($data['external_user_id']); + unset($data['external_user_id']); + } + if (\array_key_exists('trigger_properties', $data)) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['trigger_properties'] as $key => $value) { + $values[$key] = $value; + } + $object->setTriggerProperties($values); + unset($data['trigger_properties']); + } + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_1; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('userAlias') && null !== $object->getUserAlias()) { + $data['user_alias'] = $object->getUserAlias(); + } + if ($object->isInitialized('externalUserId') && null !== $object->getExternalUserId()) { + $data['external_user_id'] = $object->getExternalUserId(); + } + if ($object->isInitialized('triggerProperties') && null !== $object->getTriggerProperties()) { + $values = []; + foreach ($object->getTriggerProperties() as $key => $value) { + $values[$key] = $value; + } + $data['trigger_properties'] = $values; + } + foreach ($object as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $data[$key_1] = $value_1; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\CampaignsTriggerScheduleCreatePostBodyRecipientsItem' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CampaignsTriggerScheduleCreatePostBodyRecipientsItem' => false]; + } } } diff --git a/lib/Normalizer/CampaignsTriggerScheduleCreatePostBodyScheduleNormalizer.php b/lib/Normalizer/CampaignsTriggerScheduleCreatePostBodyScheduleNormalizer.php index f7e1a1f..3b1f3df 100644 --- a/lib/Normalizer/CampaignsTriggerScheduleCreatePostBodyScheduleNormalizer.php +++ b/lib/Normalizer/CampaignsTriggerScheduleCreatePostBodyScheduleNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,82 +21,161 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class CampaignsTriggerScheduleCreatePostBodyScheduleNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBodySchedule'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class CampaignsTriggerScheduleCreatePostBodyScheduleNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBodySchedule'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBodySchedule'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBodySchedule'; } - $object = new \Braze\Model\CampaignsTriggerScheduleCreatePostBodySchedule(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CampaignsTriggerScheduleCreatePostBodySchedule(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('time', $data)) { + $object->setTime($data['time']); + unset($data['time']); + } + if (\array_key_exists('in_local_time', $data)) { + $object->setInLocalTime($data['in_local_time']); + unset($data['in_local_time']); + } + if (\array_key_exists('at_optimal_time', $data)) { + $object->setAtOptimalTime($data['at_optimal_time']); + unset($data['at_optimal_time']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('time', $data)) { - $object->setTime($data['time']); - unset($data['time']); - } - if (\array_key_exists('in_local_time', $data)) { - $object->setInLocalTime($data['in_local_time']); - unset($data['in_local_time']); - } - if (\array_key_exists('at_optimal_time', $data)) { - $object->setAtOptimalTime($data['at_optimal_time']); - unset($data['at_optimal_time']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('time') && null !== $object->getTime()) { + $data['time'] = $object->getTime(); + } + if ($object->isInitialized('inLocalTime') && null !== $object->getInLocalTime()) { + $data['in_local_time'] = $object->getInLocalTime(); } + if ($object->isInitialized('atOptimalTime') && null !== $object->getAtOptimalTime()) { + $data['at_optimal_time'] = $object->getAtOptimalTime(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CampaignsTriggerScheduleCreatePostBodySchedule' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class CampaignsTriggerScheduleCreatePostBodyScheduleNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('time') && null !== $object->getTime()) { - $data['time'] = $object->getTime(); - } - if ($object->isInitialized('inLocalTime') && null !== $object->getInLocalTime()) { - $data['in_local_time'] = $object->getInLocalTime(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBodySchedule'; } - if ($object->isInitialized('atOptimalTime') && null !== $object->getAtOptimalTime()) { - $data['at_optimal_time'] = $object->getAtOptimalTime(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBodySchedule'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CampaignsTriggerScheduleCreatePostBodySchedule(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('time', $data)) { + $object->setTime($data['time']); + unset($data['time']); + } + if (\array_key_exists('in_local_time', $data)) { + $object->setInLocalTime($data['in_local_time']); + unset($data['in_local_time']); + } + if (\array_key_exists('at_optimal_time', $data)) { + $object->setAtOptimalTime($data['at_optimal_time']); + unset($data['at_optimal_time']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('time') && null !== $object->getTime()) { + $data['time'] = $object->getTime(); + } + if ($object->isInitialized('inLocalTime') && null !== $object->getInLocalTime()) { + $data['in_local_time'] = $object->getInLocalTime(); + } + if ($object->isInitialized('atOptimalTime') && null !== $object->getAtOptimalTime()) { + $data['at_optimal_time'] = $object->getAtOptimalTime(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\CampaignsTriggerScheduleCreatePostBodySchedule' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CampaignsTriggerScheduleCreatePostBodySchedule' => false]; + } } } diff --git a/lib/Normalizer/CampaignsTriggerScheduleDeletePostBodyNormalizer.php b/lib/Normalizer/CampaignsTriggerScheduleDeletePostBodyNormalizer.php index 1bf7c31..075717c 100644 --- a/lib/Normalizer/CampaignsTriggerScheduleDeletePostBodyNormalizer.php +++ b/lib/Normalizer/CampaignsTriggerScheduleDeletePostBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,75 +21,147 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class CampaignsTriggerScheduleDeletePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\CampaignsTriggerScheduleDeletePostBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class CampaignsTriggerScheduleDeletePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\CampaignsTriggerScheduleDeletePostBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CampaignsTriggerScheduleDeletePostBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CampaignsTriggerScheduleDeletePostBody'; } - $object = new \Braze\Model\CampaignsTriggerScheduleDeletePostBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CampaignsTriggerScheduleDeletePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('campaign_id', $data)) { + $object->setCampaignId($data['campaign_id']); + unset($data['campaign_id']); + } + if (\array_key_exists('schedule_id', $data)) { + $object->setScheduleId($data['schedule_id']); + unset($data['schedule_id']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('campaign_id', $data)) { - $object->setCampaignId($data['campaign_id']); - unset($data['campaign_id']); - } - if (\array_key_exists('schedule_id', $data)) { - $object->setScheduleId($data['schedule_id']); - unset($data['schedule_id']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('campaignId') && null !== $object->getCampaignId()) { + $data['campaign_id'] = $object->getCampaignId(); + } + if ($object->isInitialized('scheduleId') && null !== $object->getScheduleId()) { + $data['schedule_id'] = $object->getScheduleId(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CampaignsTriggerScheduleDeletePostBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class CampaignsTriggerScheduleDeletePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('campaignId') && null !== $object->getCampaignId()) { - $data['campaign_id'] = $object->getCampaignId(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CampaignsTriggerScheduleDeletePostBody'; } - if ($object->isInitialized('scheduleId') && null !== $object->getScheduleId()) { - $data['schedule_id'] = $object->getScheduleId(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CampaignsTriggerScheduleDeletePostBody'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CampaignsTriggerScheduleDeletePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('campaign_id', $data)) { + $object->setCampaignId($data['campaign_id']); + unset($data['campaign_id']); + } + if (\array_key_exists('schedule_id', $data)) { + $object->setScheduleId($data['schedule_id']); + unset($data['schedule_id']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('campaignId') && null !== $object->getCampaignId()) { + $data['campaign_id'] = $object->getCampaignId(); + } + if ($object->isInitialized('scheduleId') && null !== $object->getScheduleId()) { + $data['schedule_id'] = $object->getScheduleId(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\CampaignsTriggerScheduleDeletePostBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CampaignsTriggerScheduleDeletePostBody' => false]; + } } } diff --git a/lib/Normalizer/CampaignsTriggerScheduleUpdatePostBodyNormalizer.php b/lib/Normalizer/CampaignsTriggerScheduleUpdatePostBodyNormalizer.php index 4e2fdd9..bdb722a 100644 --- a/lib/Normalizer/CampaignsTriggerScheduleUpdatePostBodyNormalizer.php +++ b/lib/Normalizer/CampaignsTriggerScheduleUpdatePostBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,82 +21,161 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class CampaignsTriggerScheduleUpdatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\CampaignsTriggerScheduleUpdatePostBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class CampaignsTriggerScheduleUpdatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\CampaignsTriggerScheduleUpdatePostBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CampaignsTriggerScheduleUpdatePostBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CampaignsTriggerScheduleUpdatePostBody'; } - $object = new \Braze\Model\CampaignsTriggerScheduleUpdatePostBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CampaignsTriggerScheduleUpdatePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('campaign_id', $data)) { + $object->setCampaignId($data['campaign_id']); + unset($data['campaign_id']); + } + if (\array_key_exists('schedule_id', $data)) { + $object->setScheduleId($data['schedule_id']); + unset($data['schedule_id']); + } + if (\array_key_exists('schedule', $data)) { + $object->setSchedule($this->denormalizer->denormalize($data['schedule'], 'Braze\\Model\\CampaignsTriggerScheduleUpdatePostBodySchedule', 'json', $context)); + unset($data['schedule']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('campaign_id', $data)) { - $object->setCampaignId($data['campaign_id']); - unset($data['campaign_id']); - } - if (\array_key_exists('schedule_id', $data)) { - $object->setScheduleId($data['schedule_id']); - unset($data['schedule_id']); - } - if (\array_key_exists('schedule', $data)) { - $object->setSchedule($this->denormalizer->denormalize($data['schedule'], 'Braze\\Model\\CampaignsTriggerScheduleUpdatePostBodySchedule', 'json', $context)); - unset($data['schedule']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('campaignId') && null !== $object->getCampaignId()) { + $data['campaign_id'] = $object->getCampaignId(); + } + if ($object->isInitialized('scheduleId') && null !== $object->getScheduleId()) { + $data['schedule_id'] = $object->getScheduleId(); } + if ($object->isInitialized('schedule') && null !== $object->getSchedule()) { + $data['schedule'] = $this->normalizer->normalize($object->getSchedule(), 'json', $context); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CampaignsTriggerScheduleUpdatePostBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class CampaignsTriggerScheduleUpdatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('campaignId') && null !== $object->getCampaignId()) { - $data['campaign_id'] = $object->getCampaignId(); - } - if ($object->isInitialized('scheduleId') && null !== $object->getScheduleId()) { - $data['schedule_id'] = $object->getScheduleId(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CampaignsTriggerScheduleUpdatePostBody'; } - if ($object->isInitialized('schedule') && null !== $object->getSchedule()) { - $data['schedule'] = $this->normalizer->normalize($object->getSchedule(), 'json', $context); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CampaignsTriggerScheduleUpdatePostBody'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CampaignsTriggerScheduleUpdatePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('campaign_id', $data)) { + $object->setCampaignId($data['campaign_id']); + unset($data['campaign_id']); + } + if (\array_key_exists('schedule_id', $data)) { + $object->setScheduleId($data['schedule_id']); + unset($data['schedule_id']); + } + if (\array_key_exists('schedule', $data)) { + $object->setSchedule($this->denormalizer->denormalize($data['schedule'], 'Braze\\Model\\CampaignsTriggerScheduleUpdatePostBodySchedule', 'json', $context)); + unset($data['schedule']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('campaignId') && null !== $object->getCampaignId()) { + $data['campaign_id'] = $object->getCampaignId(); + } + if ($object->isInitialized('scheduleId') && null !== $object->getScheduleId()) { + $data['schedule_id'] = $object->getScheduleId(); + } + if ($object->isInitialized('schedule') && null !== $object->getSchedule()) { + $data['schedule'] = $this->normalizer->normalize($object->getSchedule(), 'json', $context); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\CampaignsTriggerScheduleUpdatePostBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CampaignsTriggerScheduleUpdatePostBody' => false]; + } } } diff --git a/lib/Normalizer/CampaignsTriggerScheduleUpdatePostBodyScheduleNormalizer.php b/lib/Normalizer/CampaignsTriggerScheduleUpdatePostBodyScheduleNormalizer.php index 3d47f1b..a923398 100644 --- a/lib/Normalizer/CampaignsTriggerScheduleUpdatePostBodyScheduleNormalizer.php +++ b/lib/Normalizer/CampaignsTriggerScheduleUpdatePostBodyScheduleNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,75 +21,147 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class CampaignsTriggerScheduleUpdatePostBodyScheduleNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\CampaignsTriggerScheduleUpdatePostBodySchedule'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class CampaignsTriggerScheduleUpdatePostBodyScheduleNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\CampaignsTriggerScheduleUpdatePostBodySchedule'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CampaignsTriggerScheduleUpdatePostBodySchedule'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CampaignsTriggerScheduleUpdatePostBodySchedule'; } - $object = new \Braze\Model\CampaignsTriggerScheduleUpdatePostBodySchedule(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CampaignsTriggerScheduleUpdatePostBodySchedule(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('time', $data)) { + $object->setTime(\DateTime::createFromFormat('Y-m-d\\TH:i:sP', $data['time'])); + unset($data['time']); + } + if (\array_key_exists('in_local_time', $data)) { + $object->setInLocalTime($data['in_local_time']); + unset($data['in_local_time']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('time', $data)) { - $object->setTime(\DateTime::createFromFormat('Y-m-d\\TH:i:sP', $data['time'])); - unset($data['time']); - } - if (\array_key_exists('in_local_time', $data)) { - $object->setInLocalTime($data['in_local_time']); - unset($data['in_local_time']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('time') && null !== $object->getTime()) { + $data['time'] = $object->getTime()->format('Y-m-d\\TH:i:sP'); + } + if ($object->isInitialized('inLocalTime') && null !== $object->getInLocalTime()) { + $data['in_local_time'] = $object->getInLocalTime(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CampaignsTriggerScheduleUpdatePostBodySchedule' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class CampaignsTriggerScheduleUpdatePostBodyScheduleNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('time') && null !== $object->getTime()) { - $data['time'] = $object->getTime()->format('Y-m-d\\TH:i:sP'); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CampaignsTriggerScheduleUpdatePostBodySchedule'; } - if ($object->isInitialized('inLocalTime') && null !== $object->getInLocalTime()) { - $data['in_local_time'] = $object->getInLocalTime(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CampaignsTriggerScheduleUpdatePostBodySchedule'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CampaignsTriggerScheduleUpdatePostBodySchedule(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('time', $data)) { + $object->setTime(\DateTime::createFromFormat('Y-m-d\\TH:i:sP', $data['time'])); + unset($data['time']); + } + if (\array_key_exists('in_local_time', $data)) { + $object->setInLocalTime($data['in_local_time']); + unset($data['in_local_time']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('time') && null !== $object->getTime()) { + $data['time'] = $object->getTime()->format('Y-m-d\\TH:i:sP'); + } + if ($object->isInitialized('inLocalTime') && null !== $object->getInLocalTime()) { + $data['in_local_time'] = $object->getInLocalTime(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\CampaignsTriggerScheduleUpdatePostBodySchedule' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CampaignsTriggerScheduleUpdatePostBodySchedule' => false]; + } } } diff --git a/lib/Normalizer/CampaignsTriggerSendPostBodyAudienceNormalizer.php b/lib/Normalizer/CampaignsTriggerSendPostBodyAudienceNormalizer.php index 181650d..6e69c49 100644 --- a/lib/Normalizer/CampaignsTriggerSendPostBodyAudienceNormalizer.php +++ b/lib/Normalizer/CampaignsTriggerSendPostBodyAudienceNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,76 +21,149 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class CampaignsTriggerSendPostBodyAudienceNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class CampaignsTriggerSendPostBodyAudienceNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return $type === 'Braze\\Model\\CampaignsTriggerSendPostBodyAudience'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool - { - return is_object($data) && get_class($data) === 'Braze\\Model\\CampaignsTriggerSendPostBodyAudience'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CampaignsTriggerSendPostBodyAudience'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CampaignsTriggerSendPostBodyAudience'; } - $object = new \Braze\Model\CampaignsTriggerSendPostBodyAudience(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CampaignsTriggerSendPostBodyAudience(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('AND', $data)) { + $values = []; + foreach ($data['AND'] as $value) { + $values[] = $value; + } + $object->setAND($values); + unset($data['AND']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('AND', $data)) { - $values = []; - foreach ($data['AND'] as $value) { - $values[] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('aND') && null !== $object->getAND()) { + $values = []; + foreach ($object->getAND() as $value) { + $values[] = $value; + } + $data['AND'] = $values; } - $object->setAND($values); - unset($data['AND']); - } - foreach ($data as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value_1; + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CampaignsTriggerSendPostBodyAudience' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class CampaignsTriggerSendPostBodyAudienceNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('aND') && null !== $object->getAND()) { - $values = []; - foreach ($object->getAND() as $value) { - $values[] = $value; - } - $data['AND'] = $values; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CampaignsTriggerSendPostBodyAudience'; } - foreach ($object as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value_1; + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CampaignsTriggerSendPostBodyAudience'; + } + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CampaignsTriggerSendPostBodyAudience(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('AND', $data)) { + $values = []; + foreach ($data['AND'] as $value) { + $values[] = $value; + } + $object->setAND($values); + unset($data['AND']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('aND') && null !== $object->getAND()) { + $values = []; + foreach ($object->getAND() as $value) { + $values[] = $value; + } + $data['AND'] = $values; + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\CampaignsTriggerSendPostBodyAudience' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CampaignsTriggerSendPostBodyAudience' => false]; + } } } diff --git a/lib/Normalizer/CampaignsTriggerSendPostBodyNormalizer.php b/lib/Normalizer/CampaignsTriggerSendPostBodyNormalizer.php index f130d42..ebd46cc 100644 --- a/lib/Normalizer/CampaignsTriggerSendPostBodyNormalizer.php +++ b/lib/Normalizer/CampaignsTriggerSendPostBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,119 +21,235 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class CampaignsTriggerSendPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\CampaignsTriggerSendPostBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class CampaignsTriggerSendPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\CampaignsTriggerSendPostBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CampaignsTriggerSendPostBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CampaignsTriggerSendPostBody'; } - $object = new \Braze\Model\CampaignsTriggerSendPostBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CampaignsTriggerSendPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('campaign_id', $data)) { + $object->setCampaignId($data['campaign_id']); + unset($data['campaign_id']); + } + if (\array_key_exists('send_id', $data)) { + $object->setSendId($data['send_id']); + unset($data['send_id']); + } + if (\array_key_exists('trigger_properties', $data)) { + $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)) { + $object->setBroadcast($data['broadcast']); + unset($data['broadcast']); + } + if (\array_key_exists('audience', $data)) { + $object->setAudience($this->denormalizer->denormalize($data['audience'], 'Braze\\Model\\CampaignsTriggerSendPostBodyAudience', 'json', $context)); + unset($data['audience']); + } + if (\array_key_exists('recipients', $data)) { + $values_1 = []; + foreach ($data['recipients'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItem', 'json', $context); + } + $object->setRecipients($values_1); + unset($data['recipients']); + } + foreach ($data as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_2; + } + } + return $object; } - if (\array_key_exists('campaign_id', $data)) { - $object->setCampaignId($data['campaign_id']); - unset($data['campaign_id']); - } - if (\array_key_exists('send_id', $data)) { - $object->setSendId($data['send_id']); - unset($data['send_id']); - } - if (\array_key_exists('trigger_properties', $data)) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data['trigger_properties'] as $key => $value) { - $values[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('campaignId') && null !== $object->getCampaignId()) { + $data['campaign_id'] = $object->getCampaignId(); } - $object->setTriggerProperties($values); - unset($data['trigger_properties']); - } - if (\array_key_exists('broadcast', $data)) { - $object->setBroadcast($data['broadcast']); - unset($data['broadcast']); - } - if (\array_key_exists('audience', $data)) { - $object->setAudience($this->denormalizer->denormalize($data['audience'], 'Braze\\Model\\CampaignsTriggerSendPostBodyAudience', 'json', $context)); - unset($data['audience']); - } - if (\array_key_exists('recipients', $data)) { - $values_1 = []; - foreach ($data['recipients'] as $value_1) { - $values_1[] = $this->denormalizer->denormalize($value_1, 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItem', 'json', $context); + if ($object->isInitialized('sendId') && null !== $object->getSendId()) { + $data['send_id'] = $object->getSendId(); } - $object->setRecipients($values_1); - unset($data['recipients']); - } - foreach ($data as $key_1 => $value_2) { - if (preg_match('/.*/', (string) $key_1)) { - $object[$key_1] = $value_2; + if ($object->isInitialized('triggerProperties') && null !== $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(); + } + if ($object->isInitialized('audience') && null !== $object->getAudience()) { + $data['audience'] = $this->normalizer->normalize($object->getAudience(), 'json', $context); } + if ($object->isInitialized('recipients') && null !== $object->getRecipients()) { + $values_1 = []; + foreach ($object->getRecipients() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $data['recipients'] = $values_1; + } + foreach ($object as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $data[$key_1] = $value_2; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CampaignsTriggerSendPostBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class CampaignsTriggerSendPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('campaignId') && null !== $object->getCampaignId()) { - $data['campaign_id'] = $object->getCampaignId(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CampaignsTriggerSendPostBody'; } - if ($object->isInitialized('sendId') && null !== $object->getSendId()) { - $data['send_id'] = $object->getSendId(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CampaignsTriggerSendPostBody'; } - if ($object->isInitialized('triggerProperties') && null !== $object->getTriggerProperties()) { - $values = []; - foreach ($object->getTriggerProperties() as $key => $value) { - $values[$key] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - $data['trigger_properties'] = $values; - } - if ($object->isInitialized('broadcast') && null !== $object->getBroadcast()) { - $data['broadcast'] = $object->getBroadcast(); - } - if ($object->isInitialized('audience') && null !== $object->getAudience()) { - $data['audience'] = $this->normalizer->normalize($object->getAudience(), 'json', $context); - } - if ($object->isInitialized('recipients') && null !== $object->getRecipients()) { - $values_1 = []; - foreach ($object->getRecipients() as $value_1) { - $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } - $data['recipients'] = $values_1; - } - foreach ($object as $key_1 => $value_2) { - if (preg_match('/.*/', (string) $key_1)) { - $data[$key_1] = $value_2; + $object = new \Braze\Model\CampaignsTriggerSendPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('campaign_id', $data)) { + $object->setCampaignId($data['campaign_id']); + unset($data['campaign_id']); + } + if (\array_key_exists('send_id', $data)) { + $object->setSendId($data['send_id']); + unset($data['send_id']); + } + if (\array_key_exists('trigger_properties', $data)) { + $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)) { + $object->setBroadcast($data['broadcast']); + unset($data['broadcast']); + } + if (\array_key_exists('audience', $data)) { + $object->setAudience($this->denormalizer->denormalize($data['audience'], 'Braze\\Model\\CampaignsTriggerSendPostBodyAudience', 'json', $context)); + unset($data['audience']); + } + if (\array_key_exists('recipients', $data)) { + $values_1 = []; + foreach ($data['recipients'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItem', 'json', $context); + } + $object->setRecipients($values_1); + unset($data['recipients']); } + foreach ($data as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_2; + } + } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('campaignId') && null !== $object->getCampaignId()) { + $data['campaign_id'] = $object->getCampaignId(); + } + if ($object->isInitialized('sendId') && null !== $object->getSendId()) { + $data['send_id'] = $object->getSendId(); + } + if ($object->isInitialized('triggerProperties') && null !== $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(); + } + if ($object->isInitialized('audience') && null !== $object->getAudience()) { + $data['audience'] = $this->normalizer->normalize($object->getAudience(), 'json', $context); + } + if ($object->isInitialized('recipients') && null !== $object->getRecipients()) { + $values_1 = []; + foreach ($object->getRecipients() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $data['recipients'] = $values_1; + } + foreach ($object as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $data[$key_1] = $value_2; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\CampaignsTriggerSendPostBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CampaignsTriggerSendPostBody' => false]; + } } } diff --git a/lib/Normalizer/CampaignsTriggerSendPostBodyRecipientsItemAttributesNormalizer.php b/lib/Normalizer/CampaignsTriggerSendPostBodyRecipientsItemAttributesNormalizer.php index 0f17bb3..e956cba 100644 --- a/lib/Normalizer/CampaignsTriggerSendPostBodyRecipientsItemAttributesNormalizer.php +++ b/lib/Normalizer/CampaignsTriggerSendPostBodyRecipientsItemAttributesNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,68 +21,133 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class CampaignsTriggerSendPostBodyRecipientsItemAttributesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class CampaignsTriggerSendPostBodyRecipientsItemAttributesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return $type === 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItemAttributes'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool - { - return is_object($data) && get_class($data) === 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItemAttributes'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItemAttributes'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItemAttributes'; } - $object = new \Braze\Model\CampaignsTriggerSendPostBodyRecipientsItemAttributes(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CampaignsTriggerSendPostBodyRecipientsItemAttributes(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('first_name', $data)) { + $object->setFirstName($data['first_name']); + unset($data['first_name']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('first_name', $data)) { - $object->setFirstName($data['first_name']); - unset($data['first_name']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('firstName') && null !== $object->getFirstName()) { + $data['first_name'] = $object->getFirstName(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItemAttributes' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class CampaignsTriggerSendPostBodyRecipientsItemAttributesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('firstName') && null !== $object->getFirstName()) { - $data['first_name'] = $object->getFirstName(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItemAttributes'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItemAttributes'; + } + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CampaignsTriggerSendPostBodyRecipientsItemAttributes(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('first_name', $data)) { + $object->setFirstName($data['first_name']); + unset($data['first_name']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('firstName') && null !== $object->getFirstName()) { + $data['first_name'] = $object->getFirstName(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItemAttributes' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItemAttributes' => false]; + } } } diff --git a/lib/Normalizer/CampaignsTriggerSendPostBodyRecipientsItemNormalizer.php b/lib/Normalizer/CampaignsTriggerSendPostBodyRecipientsItemNormalizer.php index 422d51f..0c4e5c7 100644 --- a/lib/Normalizer/CampaignsTriggerSendPostBodyRecipientsItemNormalizer.php +++ b/lib/Normalizer/CampaignsTriggerSendPostBodyRecipientsItemNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,104 +21,205 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class CampaignsTriggerSendPostBodyRecipientsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItem'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class CampaignsTriggerSendPostBodyRecipientsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItem'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItem'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItem'; } - $object = new \Braze\Model\CampaignsTriggerSendPostBodyRecipientsItem(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CampaignsTriggerSendPostBodyRecipientsItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('user_alias', $data)) { + $object->setUserAlias($this->denormalizer->denormalize($data['user_alias'], 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItemUserAlias', 'json', $context)); + unset($data['user_alias']); + } + if (\array_key_exists('external_user_id', $data)) { + $object->setExternalUserId($data['external_user_id']); + unset($data['external_user_id']); + } + if (\array_key_exists('trigger_properties', $data)) { + $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)) { + $object->setSendToExistingOnly($data['send_to_existing_only']); + unset($data['send_to_existing_only']); + } + if (\array_key_exists('attributes', $data)) { + $object->setAttributes($this->denormalizer->denormalize($data['attributes'], 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItemAttributes', 'json', $context)); + unset($data['attributes']); + } + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_1; + } + } + return $object; } - if (\array_key_exists('user_alias', $data)) { - $object->setUserAlias($this->denormalizer->denormalize($data['user_alias'], 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItemUserAlias', 'json', $context)); - unset($data['user_alias']); - } - if (\array_key_exists('external_user_id', $data)) { - $object->setExternalUserId($data['external_user_id']); - unset($data['external_user_id']); - } - if (\array_key_exists('trigger_properties', $data)) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data['trigger_properties'] as $key => $value) { - $values[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('userAlias') && null !== $object->getUserAlias()) { + $data['user_alias'] = $this->normalizer->normalize($object->getUserAlias(), 'json', $context); } - $object->setTriggerProperties($values); - unset($data['trigger_properties']); - } - if (\array_key_exists('send_to_existing_only', $data)) { - $object->setSendToExistingOnly($data['send_to_existing_only']); - unset($data['send_to_existing_only']); - } - if (\array_key_exists('attributes', $data)) { - $object->setAttributes($this->denormalizer->denormalize($data['attributes'], 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItemAttributes', 'json', $context)); - unset($data['attributes']); - } - foreach ($data as $key_1 => $value_1) { - if (preg_match('/.*/', (string) $key_1)) { - $object[$key_1] = $value_1; + if ($object->isInitialized('externalUserId') && null !== $object->getExternalUserId()) { + $data['external_user_id'] = $object->getExternalUserId(); + } + if ($object->isInitialized('triggerProperties') && null !== $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(); } + if ($object->isInitialized('attributes') && null !== $object->getAttributes()) { + $data['attributes'] = $this->normalizer->normalize($object->getAttributes(), 'json', $context); + } + foreach ($object as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $data[$key_1] = $value_1; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItem' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class CampaignsTriggerSendPostBodyRecipientsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('userAlias') && null !== $object->getUserAlias()) { - $data['user_alias'] = $this->normalizer->normalize($object->getUserAlias(), 'json', $context); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItem'; } - if ($object->isInitialized('externalUserId') && null !== $object->getExternalUserId()) { - $data['external_user_id'] = $object->getExternalUserId(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItem'; } - if ($object->isInitialized('triggerProperties') && null !== $object->getTriggerProperties()) { - $values = []; - foreach ($object->getTriggerProperties() as $key => $value) { - $values[$key] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - $data['trigger_properties'] = $values; - } - if ($object->isInitialized('sendToExistingOnly') && null !== $object->getSendToExistingOnly()) { - $data['send_to_existing_only'] = $object->getSendToExistingOnly(); - } - if ($object->isInitialized('attributes') && null !== $object->getAttributes()) { - $data['attributes'] = $this->normalizer->normalize($object->getAttributes(), 'json', $context); - } - foreach ($object as $key_1 => $value_1) { - if (preg_match('/.*/', (string) $key_1)) { - $data[$key_1] = $value_1; + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CampaignsTriggerSendPostBodyRecipientsItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('user_alias', $data)) { + $object->setUserAlias($this->denormalizer->denormalize($data['user_alias'], 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItemUserAlias', 'json', $context)); + unset($data['user_alias']); + } + if (\array_key_exists('external_user_id', $data)) { + $object->setExternalUserId($data['external_user_id']); + unset($data['external_user_id']); + } + if (\array_key_exists('trigger_properties', $data)) { + $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)) { + $object->setSendToExistingOnly($data['send_to_existing_only']); + unset($data['send_to_existing_only']); + } + if (\array_key_exists('attributes', $data)) { + $object->setAttributes($this->denormalizer->denormalize($data['attributes'], 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItemAttributes', 'json', $context)); + unset($data['attributes']); } + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_1; + } + } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('userAlias') && null !== $object->getUserAlias()) { + $data['user_alias'] = $this->normalizer->normalize($object->getUserAlias(), 'json', $context); + } + if ($object->isInitialized('externalUserId') && null !== $object->getExternalUserId()) { + $data['external_user_id'] = $object->getExternalUserId(); + } + if ($object->isInitialized('triggerProperties') && null !== $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(); + } + if ($object->isInitialized('attributes') && null !== $object->getAttributes()) { + $data['attributes'] = $this->normalizer->normalize($object->getAttributes(), 'json', $context); + } + foreach ($object as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $data[$key_1] = $value_1; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItem' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItem' => false]; + } } } diff --git a/lib/Normalizer/CampaignsTriggerSendPostBodyRecipientsItemUserAliasNormalizer.php b/lib/Normalizer/CampaignsTriggerSendPostBodyRecipientsItemUserAliasNormalizer.php index 197e54a..df09028 100644 --- a/lib/Normalizer/CampaignsTriggerSendPostBodyRecipientsItemUserAliasNormalizer.php +++ b/lib/Normalizer/CampaignsTriggerSendPostBodyRecipientsItemUserAliasNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,75 +21,147 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class CampaignsTriggerSendPostBodyRecipientsItemUserAliasNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItemUserAlias'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class CampaignsTriggerSendPostBodyRecipientsItemUserAliasNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItemUserAlias'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItemUserAlias'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItemUserAlias'; } - $object = new \Braze\Model\CampaignsTriggerSendPostBodyRecipientsItemUserAlias(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CampaignsTriggerSendPostBodyRecipientsItemUserAlias(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('alias_name', $data)) { + $object->setAliasName($data['alias_name']); + unset($data['alias_name']); + } + if (\array_key_exists('alias_label', $data)) { + $object->setAliasLabel($data['alias_label']); + unset($data['alias_label']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('alias_name', $data)) { - $object->setAliasName($data['alias_name']); - unset($data['alias_name']); - } - if (\array_key_exists('alias_label', $data)) { - $object->setAliasLabel($data['alias_label']); - unset($data['alias_label']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('aliasName') && null !== $object->getAliasName()) { + $data['alias_name'] = $object->getAliasName(); + } + if ($object->isInitialized('aliasLabel') && null !== $object->getAliasLabel()) { + $data['alias_label'] = $object->getAliasLabel(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItemUserAlias' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class CampaignsTriggerSendPostBodyRecipientsItemUserAliasNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('aliasName') && null !== $object->getAliasName()) { - $data['alias_name'] = $object->getAliasName(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItemUserAlias'; } - if ($object->isInitialized('aliasLabel') && null !== $object->getAliasLabel()) { - $data['alias_label'] = $object->getAliasLabel(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItemUserAlias'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CampaignsTriggerSendPostBodyRecipientsItemUserAlias(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('alias_name', $data)) { + $object->setAliasName($data['alias_name']); + unset($data['alias_name']); + } + if (\array_key_exists('alias_label', $data)) { + $object->setAliasLabel($data['alias_label']); + unset($data['alias_label']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('aliasName') && null !== $object->getAliasName()) { + $data['alias_name'] = $object->getAliasName(); + } + if ($object->isInitialized('aliasLabel') && null !== $object->getAliasLabel()) { + $data['alias_label'] = $object->getAliasLabel(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItemUserAlias' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItemUserAlias' => false]; + } } } diff --git a/lib/Normalizer/CanvasTriggerScheduleCreatePostBodyAudienceNormalizer.php b/lib/Normalizer/CanvasTriggerScheduleCreatePostBodyAudienceNormalizer.php index 46d725a..9605b7b 100644 --- a/lib/Normalizer/CanvasTriggerScheduleCreatePostBodyAudienceNormalizer.php +++ b/lib/Normalizer/CanvasTriggerScheduleCreatePostBodyAudienceNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,76 +21,149 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class CanvasTriggerScheduleCreatePostBodyAudienceNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class CanvasTriggerScheduleCreatePostBodyAudienceNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return $type === 'Braze\\Model\\CanvasTriggerScheduleCreatePostBodyAudience'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool - { - return is_object($data) && get_class($data) === 'Braze\\Model\\CanvasTriggerScheduleCreatePostBodyAudience'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CanvasTriggerScheduleCreatePostBodyAudience'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CanvasTriggerScheduleCreatePostBodyAudience'; } - $object = new \Braze\Model\CanvasTriggerScheduleCreatePostBodyAudience(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CanvasTriggerScheduleCreatePostBodyAudience(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('AND', $data)) { + $values = []; + foreach ($data['AND'] as $value) { + $values[] = $value; + } + $object->setAND($values); + unset($data['AND']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('AND', $data)) { - $values = []; - foreach ($data['AND'] as $value) { - $values[] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('aND') && null !== $object->getAND()) { + $values = []; + foreach ($object->getAND() as $value) { + $values[] = $value; + } + $data['AND'] = $values; } - $object->setAND($values); - unset($data['AND']); - } - foreach ($data as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value_1; + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CanvasTriggerScheduleCreatePostBodyAudience' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class CanvasTriggerScheduleCreatePostBodyAudienceNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('aND') && null !== $object->getAND()) { - $values = []; - foreach ($object->getAND() as $value) { - $values[] = $value; - } - $data['AND'] = $values; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CanvasTriggerScheduleCreatePostBodyAudience'; } - foreach ($object as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value_1; + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CanvasTriggerScheduleCreatePostBodyAudience'; + } + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CanvasTriggerScheduleCreatePostBodyAudience(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('AND', $data)) { + $values = []; + foreach ($data['AND'] as $value) { + $values[] = $value; + } + $object->setAND($values); + unset($data['AND']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('aND') && null !== $object->getAND()) { + $values = []; + foreach ($object->getAND() as $value) { + $values[] = $value; + } + $data['AND'] = $values; + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\CanvasTriggerScheduleCreatePostBodyAudience' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CanvasTriggerScheduleCreatePostBodyAudience' => false]; + } } } diff --git a/lib/Normalizer/CanvasTriggerScheduleCreatePostBodyNormalizer.php b/lib/Normalizer/CanvasTriggerScheduleCreatePostBodyNormalizer.php index 9846f18..4d3d2b5 100644 --- a/lib/Normalizer/CanvasTriggerScheduleCreatePostBodyNormalizer.php +++ b/lib/Normalizer/CanvasTriggerScheduleCreatePostBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,119 +21,235 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class CanvasTriggerScheduleCreatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\CanvasTriggerScheduleCreatePostBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class CanvasTriggerScheduleCreatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\CanvasTriggerScheduleCreatePostBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CanvasTriggerScheduleCreatePostBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CanvasTriggerScheduleCreatePostBody'; } - $object = new \Braze\Model\CanvasTriggerScheduleCreatePostBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CanvasTriggerScheduleCreatePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('canvas_id', $data)) { + $object->setCanvasId($data['canvas_id']); + unset($data['canvas_id']); + } + if (\array_key_exists('recipients', $data)) { + $values = []; + foreach ($data['recipients'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'Braze\\Model\\CanvasTriggerScheduleCreatePostBodyRecipientsItem', 'json', $context); + } + $object->setRecipients($values); + unset($data['recipients']); + } + if (\array_key_exists('audience', $data)) { + $object->setAudience($this->denormalizer->denormalize($data['audience'], 'Braze\\Model\\CanvasTriggerScheduleCreatePostBodyAudience', 'json', $context)); + unset($data['audience']); + } + if (\array_key_exists('broadcast', $data)) { + $object->setBroadcast($data['broadcast']); + unset($data['broadcast']); + } + if (\array_key_exists('canvas_entry_properties', $data)) { + $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['canvas_entry_properties'] as $key => $value_1) { + $values_1[$key] = $value_1; + } + $object->setCanvasEntryProperties($values_1); + unset($data['canvas_entry_properties']); + } + if (\array_key_exists('schedule', $data)) { + $object->setSchedule($this->denormalizer->denormalize($data['schedule'], 'Braze\\Model\\CanvasTriggerScheduleCreatePostBodySchedule', 'json', $context)); + unset($data['schedule']); + } + foreach ($data as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_2; + } + } + return $object; } - if (\array_key_exists('canvas_id', $data)) { - $object->setCanvasId($data['canvas_id']); - unset($data['canvas_id']); - } - if (\array_key_exists('recipients', $data)) { - $values = []; - foreach ($data['recipients'] as $value) { - $values[] = $this->denormalizer->denormalize($value, 'Braze\\Model\\CanvasTriggerScheduleCreatePostBodyRecipientsItem', 'json', $context); + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('canvasId') && null !== $object->getCanvasId()) { + $data['canvas_id'] = $object->getCanvasId(); } - $object->setRecipients($values); - unset($data['recipients']); - } - if (\array_key_exists('audience', $data)) { - $object->setAudience($this->denormalizer->denormalize($data['audience'], 'Braze\\Model\\CanvasTriggerScheduleCreatePostBodyAudience', 'json', $context)); - unset($data['audience']); - } - if (\array_key_exists('broadcast', $data)) { - $object->setBroadcast($data['broadcast']); - unset($data['broadcast']); - } - if (\array_key_exists('canvas_entry_properties', $data)) { - $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data['canvas_entry_properties'] as $key => $value_1) { - $values_1[$key] = $value_1; + if ($object->isInitialized('recipients') && null !== $object->getRecipients()) { + $values = []; + foreach ($object->getRecipients() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['recipients'] = $values; } - $object->setCanvasEntryProperties($values_1); - unset($data['canvas_entry_properties']); - } - if (\array_key_exists('schedule', $data)) { - $object->setSchedule($this->denormalizer->denormalize($data['schedule'], 'Braze\\Model\\CanvasTriggerScheduleCreatePostBodySchedule', 'json', $context)); - unset($data['schedule']); - } - foreach ($data as $key_1 => $value_2) { - if (preg_match('/.*/', (string) $key_1)) { - $object[$key_1] = $value_2; + if ($object->isInitialized('audience') && null !== $object->getAudience()) { + $data['audience'] = $this->normalizer->normalize($object->getAudience(), 'json', $context); + } + if ($object->isInitialized('broadcast') && null !== $object->getBroadcast()) { + $data['broadcast'] = $object->getBroadcast(); + } + if ($object->isInitialized('canvasEntryProperties') && null !== $object->getCanvasEntryProperties()) { + $values_1 = []; + foreach ($object->getCanvasEntryProperties() as $key => $value_1) { + $values_1[$key] = $value_1; + } + $data['canvas_entry_properties'] = $values_1; } + if ($object->isInitialized('schedule') && null !== $object->getSchedule()) { + $data['schedule'] = $this->normalizer->normalize($object->getSchedule(), 'json', $context); + } + foreach ($object as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $data[$key_1] = $value_2; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CanvasTriggerScheduleCreatePostBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class CanvasTriggerScheduleCreatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('canvasId') && null !== $object->getCanvasId()) { - $data['canvas_id'] = $object->getCanvasId(); - } - if ($object->isInitialized('recipients') && null !== $object->getRecipients()) { - $values = []; - foreach ($object->getRecipients() as $value) { - $values[] = $this->normalizer->normalize($value, 'json', $context); - } - $data['recipients'] = $values; - } - if ($object->isInitialized('audience') && null !== $object->getAudience()) { - $data['audience'] = $this->normalizer->normalize($object->getAudience(), 'json', $context); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CanvasTriggerScheduleCreatePostBody'; } - if ($object->isInitialized('broadcast') && null !== $object->getBroadcast()) { - $data['broadcast'] = $object->getBroadcast(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CanvasTriggerScheduleCreatePostBody'; } - if ($object->isInitialized('canvasEntryProperties') && null !== $object->getCanvasEntryProperties()) { - $values_1 = []; - foreach ($object->getCanvasEntryProperties() as $key => $value_1) { - $values_1[$key] = $value_1; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - $data['canvas_entry_properties'] = $values_1; - } - if ($object->isInitialized('schedule') && null !== $object->getSchedule()) { - $data['schedule'] = $this->normalizer->normalize($object->getSchedule(), 'json', $context); - } - foreach ($object as $key_1 => $value_2) { - if (preg_match('/.*/', (string) $key_1)) { - $data[$key_1] = $value_2; + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CanvasTriggerScheduleCreatePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('canvas_id', $data)) { + $object->setCanvasId($data['canvas_id']); + unset($data['canvas_id']); + } + if (\array_key_exists('recipients', $data)) { + $values = []; + foreach ($data['recipients'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'Braze\\Model\\CanvasTriggerScheduleCreatePostBodyRecipientsItem', 'json', $context); + } + $object->setRecipients($values); + unset($data['recipients']); + } + if (\array_key_exists('audience', $data)) { + $object->setAudience($this->denormalizer->denormalize($data['audience'], 'Braze\\Model\\CanvasTriggerScheduleCreatePostBodyAudience', 'json', $context)); + unset($data['audience']); + } + if (\array_key_exists('broadcast', $data)) { + $object->setBroadcast($data['broadcast']); + unset($data['broadcast']); + } + if (\array_key_exists('canvas_entry_properties', $data)) { + $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['canvas_entry_properties'] as $key => $value_1) { + $values_1[$key] = $value_1; + } + $object->setCanvasEntryProperties($values_1); + unset($data['canvas_entry_properties']); + } + if (\array_key_exists('schedule', $data)) { + $object->setSchedule($this->denormalizer->denormalize($data['schedule'], 'Braze\\Model\\CanvasTriggerScheduleCreatePostBodySchedule', 'json', $context)); + unset($data['schedule']); } + foreach ($data as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_2; + } + } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('canvasId') && null !== $object->getCanvasId()) { + $data['canvas_id'] = $object->getCanvasId(); + } + if ($object->isInitialized('recipients') && null !== $object->getRecipients()) { + $values = []; + foreach ($object->getRecipients() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['recipients'] = $values; + } + if ($object->isInitialized('audience') && null !== $object->getAudience()) { + $data['audience'] = $this->normalizer->normalize($object->getAudience(), 'json', $context); + } + if ($object->isInitialized('broadcast') && null !== $object->getBroadcast()) { + $data['broadcast'] = $object->getBroadcast(); + } + if ($object->isInitialized('canvasEntryProperties') && null !== $object->getCanvasEntryProperties()) { + $values_1 = []; + foreach ($object->getCanvasEntryProperties() as $key => $value_1) { + $values_1[$key] = $value_1; + } + $data['canvas_entry_properties'] = $values_1; + } + if ($object->isInitialized('schedule') && null !== $object->getSchedule()) { + $data['schedule'] = $this->normalizer->normalize($object->getSchedule(), 'json', $context); + } + foreach ($object as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $data[$key_1] = $value_2; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\CanvasTriggerScheduleCreatePostBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CanvasTriggerScheduleCreatePostBody' => false]; + } } } diff --git a/lib/Normalizer/CanvasTriggerScheduleCreatePostBodyRecipientsItemNormalizer.php b/lib/Normalizer/CanvasTriggerScheduleCreatePostBodyRecipientsItemNormalizer.php index ac111a3..48456a9 100644 --- a/lib/Normalizer/CanvasTriggerScheduleCreatePostBodyRecipientsItemNormalizer.php +++ b/lib/Normalizer/CanvasTriggerScheduleCreatePostBodyRecipientsItemNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,105 +21,207 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class CanvasTriggerScheduleCreatePostBodyRecipientsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class CanvasTriggerScheduleCreatePostBodyRecipientsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return $type === 'Braze\\Model\\CanvasTriggerScheduleCreatePostBodyRecipientsItem'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function supportsNormalization($data, $format = null, array $context = []): bool - { - return is_object($data) && get_class($data) === 'Braze\\Model\\CanvasTriggerScheduleCreatePostBodyRecipientsItem'; - } - - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CanvasTriggerScheduleCreatePostBodyRecipientsItem'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CanvasTriggerScheduleCreatePostBodyRecipientsItem'; } - $object = new \Braze\Model\CanvasTriggerScheduleCreatePostBodyRecipientsItem(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CanvasTriggerScheduleCreatePostBodyRecipientsItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('user_alias', $data)) { + $object->setUserAlias($data['user_alias']); + unset($data['user_alias']); + } + if (\array_key_exists('external_user_id', $data)) { + $object->setExternalUserId($data['external_user_id']); + unset($data['external_user_id']); + } + if (\array_key_exists('trigger_properties', $data)) { + $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_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_1); + unset($data['canvas_entry_properties']); + } + foreach ($data as $key_2 => $value_2) { + if (preg_match('/.*/', (string) $key_2)) { + $object[$key_2] = $value_2; + } + } + return $object; } - if (\array_key_exists('user_alias', $data)) { - $object->setUserAlias($data['user_alias']); - unset($data['user_alias']); - } - if (\array_key_exists('external_user_id', $data)) { - $object->setExternalUserId($data['external_user_id']); - unset($data['external_user_id']); - } - if (\array_key_exists('trigger_properties', $data)) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data['trigger_properties'] as $key => $value) { - $values[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('userAlias') && null !== $object->getUserAlias()) { + $data['user_alias'] = $object->getUserAlias(); } - $object->setTriggerProperties($values); - unset($data['trigger_properties']); - } - if (\array_key_exists('canvas_entry_properties', $data)) { - $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data['canvas_entry_properties'] as $key_1 => $value_1) { - $values_1[$key_1] = $value_1; + if ($object->isInitialized('externalUserId') && null !== $object->getExternalUserId()) { + $data['external_user_id'] = $object->getExternalUserId(); } - $object->setCanvasEntryProperties($values_1); - unset($data['canvas_entry_properties']); - } - foreach ($data as $key_2 => $value_2) { - if (preg_match('/.*/', (string) $key_2)) { - $object[$key_2] = $value_2; + if ($object->isInitialized('triggerProperties') && null !== $object->getTriggerProperties()) { + $values = []; + foreach ($object->getTriggerProperties() as $key => $value) { + $values[$key] = $value; + } + $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_2 => $value_2) { + if (preg_match('/.*/', (string) $key_2)) { + $data[$key_2] = $value_2; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CanvasTriggerScheduleCreatePostBodyRecipientsItem' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class CanvasTriggerScheduleCreatePostBodyRecipientsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('userAlias') && null !== $object->getUserAlias()) { - $data['user_alias'] = $object->getUserAlias(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CanvasTriggerScheduleCreatePostBodyRecipientsItem'; } - if ($object->isInitialized('externalUserId') && null !== $object->getExternalUserId()) { - $data['external_user_id'] = $object->getExternalUserId(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CanvasTriggerScheduleCreatePostBodyRecipientsItem'; } - if ($object->isInitialized('triggerProperties') && null !== $object->getTriggerProperties()) { - $values = []; - foreach ($object->getTriggerProperties() as $key => $value) { - $values[$key] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - $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; + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } - $data['canvas_entry_properties'] = $values_1; - } - foreach ($object as $key_2 => $value_2) { - if (preg_match('/.*/', (string) $key_2)) { - $data[$key_2] = $value_2; + $object = new \Braze\Model\CanvasTriggerScheduleCreatePostBodyRecipientsItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('user_alias', $data)) { + $object->setUserAlias($data['user_alias']); + unset($data['user_alias']); + } + if (\array_key_exists('external_user_id', $data)) { + $object->setExternalUserId($data['external_user_id']); + unset($data['external_user_id']); + } + if (\array_key_exists('trigger_properties', $data)) { + $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_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_1); + unset($data['canvas_entry_properties']); + } + foreach ($data as $key_2 => $value_2) { + if (preg_match('/.*/', (string) $key_2)) { + $object[$key_2] = $value_2; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('userAlias') && null !== $object->getUserAlias()) { + $data['user_alias'] = $object->getUserAlias(); + } + if ($object->isInitialized('externalUserId') && null !== $object->getExternalUserId()) { + $data['external_user_id'] = $object->getExternalUserId(); + } + if ($object->isInitialized('triggerProperties') && null !== $object->getTriggerProperties()) { + $values = []; + foreach ($object->getTriggerProperties() as $key => $value) { + $values[$key] = $value; + } + $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_2 => $value_2) { + if (preg_match('/.*/', (string) $key_2)) { + $data[$key_2] = $value_2; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\CanvasTriggerScheduleCreatePostBodyRecipientsItem' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CanvasTriggerScheduleCreatePostBodyRecipientsItem' => false]; + } } } diff --git a/lib/Normalizer/CanvasTriggerScheduleCreatePostBodyScheduleNormalizer.php b/lib/Normalizer/CanvasTriggerScheduleCreatePostBodyScheduleNormalizer.php index 7a93d39..3da7748 100644 --- a/lib/Normalizer/CanvasTriggerScheduleCreatePostBodyScheduleNormalizer.php +++ b/lib/Normalizer/CanvasTriggerScheduleCreatePostBodyScheduleNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,82 +21,161 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class CanvasTriggerScheduleCreatePostBodyScheduleNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\CanvasTriggerScheduleCreatePostBodySchedule'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class CanvasTriggerScheduleCreatePostBodyScheduleNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\CanvasTriggerScheduleCreatePostBodySchedule'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CanvasTriggerScheduleCreatePostBodySchedule'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CanvasTriggerScheduleCreatePostBodySchedule'; } - $object = new \Braze\Model\CanvasTriggerScheduleCreatePostBodySchedule(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CanvasTriggerScheduleCreatePostBodySchedule(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('time', $data)) { + $object->setTime($data['time']); + unset($data['time']); + } + if (\array_key_exists('in_local_time', $data)) { + $object->setInLocalTime($data['in_local_time']); + unset($data['in_local_time']); + } + if (\array_key_exists('at_optimal_time', $data)) { + $object->setAtOptimalTime($data['at_optimal_time']); + unset($data['at_optimal_time']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('time', $data)) { - $object->setTime($data['time']); - unset($data['time']); - } - if (\array_key_exists('in_local_time', $data)) { - $object->setInLocalTime($data['in_local_time']); - unset($data['in_local_time']); - } - if (\array_key_exists('at_optimal_time', $data)) { - $object->setAtOptimalTime($data['at_optimal_time']); - unset($data['at_optimal_time']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('time') && null !== $object->getTime()) { + $data['time'] = $object->getTime(); + } + if ($object->isInitialized('inLocalTime') && null !== $object->getInLocalTime()) { + $data['in_local_time'] = $object->getInLocalTime(); } + if ($object->isInitialized('atOptimalTime') && null !== $object->getAtOptimalTime()) { + $data['at_optimal_time'] = $object->getAtOptimalTime(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CanvasTriggerScheduleCreatePostBodySchedule' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class CanvasTriggerScheduleCreatePostBodyScheduleNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('time') && null !== $object->getTime()) { - $data['time'] = $object->getTime(); - } - if ($object->isInitialized('inLocalTime') && null !== $object->getInLocalTime()) { - $data['in_local_time'] = $object->getInLocalTime(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CanvasTriggerScheduleCreatePostBodySchedule'; } - if ($object->isInitialized('atOptimalTime') && null !== $object->getAtOptimalTime()) { - $data['at_optimal_time'] = $object->getAtOptimalTime(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CanvasTriggerScheduleCreatePostBodySchedule'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CanvasTriggerScheduleCreatePostBodySchedule(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('time', $data)) { + $object->setTime($data['time']); + unset($data['time']); + } + if (\array_key_exists('in_local_time', $data)) { + $object->setInLocalTime($data['in_local_time']); + unset($data['in_local_time']); + } + if (\array_key_exists('at_optimal_time', $data)) { + $object->setAtOptimalTime($data['at_optimal_time']); + unset($data['at_optimal_time']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('time') && null !== $object->getTime()) { + $data['time'] = $object->getTime(); + } + if ($object->isInitialized('inLocalTime') && null !== $object->getInLocalTime()) { + $data['in_local_time'] = $object->getInLocalTime(); + } + if ($object->isInitialized('atOptimalTime') && null !== $object->getAtOptimalTime()) { + $data['at_optimal_time'] = $object->getAtOptimalTime(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\CanvasTriggerScheduleCreatePostBodySchedule' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CanvasTriggerScheduleCreatePostBodySchedule' => false]; + } } } diff --git a/lib/Normalizer/CanvasTriggerScheduleDeletePostBodyNormalizer.php b/lib/Normalizer/CanvasTriggerScheduleDeletePostBodyNormalizer.php index 9bfcef1..721d9f6 100644 --- a/lib/Normalizer/CanvasTriggerScheduleDeletePostBodyNormalizer.php +++ b/lib/Normalizer/CanvasTriggerScheduleDeletePostBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,75 +21,147 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class CanvasTriggerScheduleDeletePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\CanvasTriggerScheduleDeletePostBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class CanvasTriggerScheduleDeletePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\CanvasTriggerScheduleDeletePostBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CanvasTriggerScheduleDeletePostBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CanvasTriggerScheduleDeletePostBody'; } - $object = new \Braze\Model\CanvasTriggerScheduleDeletePostBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CanvasTriggerScheduleDeletePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('canvas_id', $data)) { + $object->setCanvasId($data['canvas_id']); + unset($data['canvas_id']); + } + if (\array_key_exists('schedule_id', $data)) { + $object->setScheduleId($data['schedule_id']); + unset($data['schedule_id']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('canvas_id', $data)) { - $object->setCanvasId($data['canvas_id']); - unset($data['canvas_id']); - } - if (\array_key_exists('schedule_id', $data)) { - $object->setScheduleId($data['schedule_id']); - unset($data['schedule_id']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('canvasId') && null !== $object->getCanvasId()) { + $data['canvas_id'] = $object->getCanvasId(); + } + if ($object->isInitialized('scheduleId') && null !== $object->getScheduleId()) { + $data['schedule_id'] = $object->getScheduleId(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CanvasTriggerScheduleDeletePostBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class CanvasTriggerScheduleDeletePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('canvasId') && null !== $object->getCanvasId()) { - $data['canvas_id'] = $object->getCanvasId(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CanvasTriggerScheduleDeletePostBody'; } - if ($object->isInitialized('scheduleId') && null !== $object->getScheduleId()) { - $data['schedule_id'] = $object->getScheduleId(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CanvasTriggerScheduleDeletePostBody'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CanvasTriggerScheduleDeletePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('canvas_id', $data)) { + $object->setCanvasId($data['canvas_id']); + unset($data['canvas_id']); + } + if (\array_key_exists('schedule_id', $data)) { + $object->setScheduleId($data['schedule_id']); + unset($data['schedule_id']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('canvasId') && null !== $object->getCanvasId()) { + $data['canvas_id'] = $object->getCanvasId(); + } + if ($object->isInitialized('scheduleId') && null !== $object->getScheduleId()) { + $data['schedule_id'] = $object->getScheduleId(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\CanvasTriggerScheduleDeletePostBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CanvasTriggerScheduleDeletePostBody' => false]; + } } } diff --git a/lib/Normalizer/CanvasTriggerScheduleUpdatePostBodyNormalizer.php b/lib/Normalizer/CanvasTriggerScheduleUpdatePostBodyNormalizer.php index 2e1ec3d..4cf1d1d 100644 --- a/lib/Normalizer/CanvasTriggerScheduleUpdatePostBodyNormalizer.php +++ b/lib/Normalizer/CanvasTriggerScheduleUpdatePostBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,82 +21,161 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class CanvasTriggerScheduleUpdatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\CanvasTriggerScheduleUpdatePostBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class CanvasTriggerScheduleUpdatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\CanvasTriggerScheduleUpdatePostBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CanvasTriggerScheduleUpdatePostBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CanvasTriggerScheduleUpdatePostBody'; } - $object = new \Braze\Model\CanvasTriggerScheduleUpdatePostBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CanvasTriggerScheduleUpdatePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('canvas_id', $data)) { + $object->setCanvasId($data['canvas_id']); + unset($data['canvas_id']); + } + if (\array_key_exists('schedule_id', $data)) { + $object->setScheduleId($data['schedule_id']); + unset($data['schedule_id']); + } + if (\array_key_exists('schedule', $data)) { + $object->setSchedule($this->denormalizer->denormalize($data['schedule'], 'Braze\\Model\\CanvasTriggerScheduleUpdatePostBodySchedule', 'json', $context)); + unset($data['schedule']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('canvas_id', $data)) { - $object->setCanvasId($data['canvas_id']); - unset($data['canvas_id']); - } - if (\array_key_exists('schedule_id', $data)) { - $object->setScheduleId($data['schedule_id']); - unset($data['schedule_id']); - } - if (\array_key_exists('schedule', $data)) { - $object->setSchedule($this->denormalizer->denormalize($data['schedule'], 'Braze\\Model\\CanvasTriggerScheduleUpdatePostBodySchedule', 'json', $context)); - unset($data['schedule']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('canvasId') && null !== $object->getCanvasId()) { + $data['canvas_id'] = $object->getCanvasId(); + } + if ($object->isInitialized('scheduleId') && null !== $object->getScheduleId()) { + $data['schedule_id'] = $object->getScheduleId(); } + if ($object->isInitialized('schedule') && null !== $object->getSchedule()) { + $data['schedule'] = $this->normalizer->normalize($object->getSchedule(), 'json', $context); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CanvasTriggerScheduleUpdatePostBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class CanvasTriggerScheduleUpdatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('canvasId') && null !== $object->getCanvasId()) { - $data['canvas_id'] = $object->getCanvasId(); - } - if ($object->isInitialized('scheduleId') && null !== $object->getScheduleId()) { - $data['schedule_id'] = $object->getScheduleId(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CanvasTriggerScheduleUpdatePostBody'; } - if ($object->isInitialized('schedule') && null !== $object->getSchedule()) { - $data['schedule'] = $this->normalizer->normalize($object->getSchedule(), 'json', $context); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CanvasTriggerScheduleUpdatePostBody'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CanvasTriggerScheduleUpdatePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('canvas_id', $data)) { + $object->setCanvasId($data['canvas_id']); + unset($data['canvas_id']); + } + if (\array_key_exists('schedule_id', $data)) { + $object->setScheduleId($data['schedule_id']); + unset($data['schedule_id']); + } + if (\array_key_exists('schedule', $data)) { + $object->setSchedule($this->denormalizer->denormalize($data['schedule'], 'Braze\\Model\\CanvasTriggerScheduleUpdatePostBodySchedule', 'json', $context)); + unset($data['schedule']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('canvasId') && null !== $object->getCanvasId()) { + $data['canvas_id'] = $object->getCanvasId(); + } + if ($object->isInitialized('scheduleId') && null !== $object->getScheduleId()) { + $data['schedule_id'] = $object->getScheduleId(); + } + if ($object->isInitialized('schedule') && null !== $object->getSchedule()) { + $data['schedule'] = $this->normalizer->normalize($object->getSchedule(), 'json', $context); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\CanvasTriggerScheduleUpdatePostBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CanvasTriggerScheduleUpdatePostBody' => false]; + } } } diff --git a/lib/Normalizer/CanvasTriggerScheduleUpdatePostBodyScheduleNormalizer.php b/lib/Normalizer/CanvasTriggerScheduleUpdatePostBodyScheduleNormalizer.php index 419182f..3c1d0dc 100644 --- a/lib/Normalizer/CanvasTriggerScheduleUpdatePostBodyScheduleNormalizer.php +++ b/lib/Normalizer/CanvasTriggerScheduleUpdatePostBodyScheduleNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,75 +21,147 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class CanvasTriggerScheduleUpdatePostBodyScheduleNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\CanvasTriggerScheduleUpdatePostBodySchedule'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class CanvasTriggerScheduleUpdatePostBodyScheduleNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\CanvasTriggerScheduleUpdatePostBodySchedule'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CanvasTriggerScheduleUpdatePostBodySchedule'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CanvasTriggerScheduleUpdatePostBodySchedule'; } - $object = new \Braze\Model\CanvasTriggerScheduleUpdatePostBodySchedule(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CanvasTriggerScheduleUpdatePostBodySchedule(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('time', $data)) { + $object->setTime(\DateTime::createFromFormat('Y-m-d\\TH:i:sP', $data['time'])); + unset($data['time']); + } + if (\array_key_exists('in_local_time', $data)) { + $object->setInLocalTime($data['in_local_time']); + unset($data['in_local_time']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('time', $data)) { - $object->setTime(\DateTime::createFromFormat('Y-m-d\\TH:i:sP', $data['time'])); - unset($data['time']); - } - if (\array_key_exists('in_local_time', $data)) { - $object->setInLocalTime($data['in_local_time']); - unset($data['in_local_time']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('time') && null !== $object->getTime()) { + $data['time'] = $object->getTime()->format('Y-m-d\\TH:i:sP'); + } + if ($object->isInitialized('inLocalTime') && null !== $object->getInLocalTime()) { + $data['in_local_time'] = $object->getInLocalTime(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CanvasTriggerScheduleUpdatePostBodySchedule' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class CanvasTriggerScheduleUpdatePostBodyScheduleNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('time') && null !== $object->getTime()) { - $data['time'] = $object->getTime()->format('Y-m-d\\TH:i:sP'); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CanvasTriggerScheduleUpdatePostBodySchedule'; } - if ($object->isInitialized('inLocalTime') && null !== $object->getInLocalTime()) { - $data['in_local_time'] = $object->getInLocalTime(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CanvasTriggerScheduleUpdatePostBodySchedule'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CanvasTriggerScheduleUpdatePostBodySchedule(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('time', $data)) { + $object->setTime(\DateTime::createFromFormat('Y-m-d\\TH:i:sP', $data['time'])); + unset($data['time']); + } + if (\array_key_exists('in_local_time', $data)) { + $object->setInLocalTime($data['in_local_time']); + unset($data['in_local_time']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('time') && null !== $object->getTime()) { + $data['time'] = $object->getTime()->format('Y-m-d\\TH:i:sP'); + } + if ($object->isInitialized('inLocalTime') && null !== $object->getInLocalTime()) { + $data['in_local_time'] = $object->getInLocalTime(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\CanvasTriggerScheduleUpdatePostBodySchedule' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CanvasTriggerScheduleUpdatePostBodySchedule' => false]; + } } } diff --git a/lib/Normalizer/CanvasTriggerSendPostBodyAudienceNormalizer.php b/lib/Normalizer/CanvasTriggerSendPostBodyAudienceNormalizer.php index 7fdb14a..48c4c8c 100644 --- a/lib/Normalizer/CanvasTriggerSendPostBodyAudienceNormalizer.php +++ b/lib/Normalizer/CanvasTriggerSendPostBodyAudienceNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,76 +21,149 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class CanvasTriggerSendPostBodyAudienceNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class CanvasTriggerSendPostBodyAudienceNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return $type === 'Braze\\Model\\CanvasTriggerSendPostBodyAudience'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool - { - return is_object($data) && get_class($data) === 'Braze\\Model\\CanvasTriggerSendPostBodyAudience'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CanvasTriggerSendPostBodyAudience'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CanvasTriggerSendPostBodyAudience'; } - $object = new \Braze\Model\CanvasTriggerSendPostBodyAudience(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CanvasTriggerSendPostBodyAudience(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('AND', $data)) { + $values = []; + foreach ($data['AND'] as $value) { + $values[] = $value; + } + $object->setAND($values); + unset($data['AND']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('AND', $data)) { - $values = []; - foreach ($data['AND'] as $value) { - $values[] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('aND') && null !== $object->getAND()) { + $values = []; + foreach ($object->getAND() as $value) { + $values[] = $value; + } + $data['AND'] = $values; } - $object->setAND($values); - unset($data['AND']); - } - foreach ($data as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value_1; + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CanvasTriggerSendPostBodyAudience' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class CanvasTriggerSendPostBodyAudienceNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('aND') && null !== $object->getAND()) { - $values = []; - foreach ($object->getAND() as $value) { - $values[] = $value; - } - $data['AND'] = $values; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CanvasTriggerSendPostBodyAudience'; } - foreach ($object as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value_1; + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CanvasTriggerSendPostBodyAudience'; + } + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CanvasTriggerSendPostBodyAudience(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('AND', $data)) { + $values = []; + foreach ($data['AND'] as $value) { + $values[] = $value; + } + $object->setAND($values); + unset($data['AND']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('aND') && null !== $object->getAND()) { + $values = []; + foreach ($object->getAND() as $value) { + $values[] = $value; + } + $data['AND'] = $values; + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\CanvasTriggerSendPostBodyAudience' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CanvasTriggerSendPostBodyAudience' => false]; + } } } diff --git a/lib/Normalizer/CanvasTriggerSendPostBodyCanvasEntryPropertiesNormalizer.php b/lib/Normalizer/CanvasTriggerSendPostBodyCanvasEntryPropertiesNormalizer.php index 00adec9..1be5f72 100644 --- a/lib/Normalizer/CanvasTriggerSendPostBodyCanvasEntryPropertiesNormalizer.php +++ b/lib/Normalizer/CanvasTriggerSendPostBodyCanvasEntryPropertiesNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,78 +21,153 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class CanvasTriggerSendPostBodyCanvasEntryPropertiesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\CanvasTriggerSendPostBodyCanvasEntryProperties'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class CanvasTriggerSendPostBodyCanvasEntryPropertiesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\CanvasTriggerSendPostBodyCanvasEntryProperties'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CanvasTriggerSendPostBodyCanvasEntryProperties'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); - } - $object = new \Braze\Model\CanvasTriggerSendPostBodyCanvasEntryProperties(); - if (\array_key_exists('product_price', $data) && \is_int($data['product_price'])) { - $data['product_price'] = (float) $data['product_price']; + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CanvasTriggerSendPostBodyCanvasEntryProperties'; } - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CanvasTriggerSendPostBodyCanvasEntryProperties(); + if (\array_key_exists('product_price', $data) && \is_int($data['product_price'])) { + $data['product_price'] = (float) $data['product_price']; + } + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('product_name', $data)) { + $object->setProductName($data['product_name']); + unset($data['product_name']); + } + if (\array_key_exists('product_price', $data)) { + $object->setProductPrice($data['product_price']); + unset($data['product_price']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('product_name', $data)) { - $object->setProductName($data['product_name']); - unset($data['product_name']); - } - if (\array_key_exists('product_price', $data)) { - $object->setProductPrice($data['product_price']); - unset($data['product_price']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('productName') && null !== $object->getProductName()) { + $data['product_name'] = $object->getProductName(); + } + if ($object->isInitialized('productPrice') && null !== $object->getProductPrice()) { + $data['product_price'] = $object->getProductPrice(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CanvasTriggerSendPostBodyCanvasEntryProperties' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class CanvasTriggerSendPostBodyCanvasEntryPropertiesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('productName') && null !== $object->getProductName()) { - $data['product_name'] = $object->getProductName(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CanvasTriggerSendPostBodyCanvasEntryProperties'; } - if ($object->isInitialized('productPrice') && null !== $object->getProductPrice()) { - $data['product_price'] = $object->getProductPrice(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CanvasTriggerSendPostBodyCanvasEntryProperties'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CanvasTriggerSendPostBodyCanvasEntryProperties(); + if (\array_key_exists('product_price', $data) && \is_int($data['product_price'])) { + $data['product_price'] = (float) $data['product_price']; + } + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('product_name', $data)) { + $object->setProductName($data['product_name']); + unset($data['product_name']); + } + if (\array_key_exists('product_price', $data)) { + $object->setProductPrice($data['product_price']); + unset($data['product_price']); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('productName') && null !== $object->getProductName()) { + $data['product_name'] = $object->getProductName(); + } + if ($object->isInitialized('productPrice') && null !== $object->getProductPrice()) { + $data['product_price'] = $object->getProductPrice(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\CanvasTriggerSendPostBodyCanvasEntryProperties' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CanvasTriggerSendPostBodyCanvasEntryProperties' => false]; + } } } diff --git a/lib/Normalizer/CanvasTriggerSendPostBodyNormalizer.php b/lib/Normalizer/CanvasTriggerSendPostBodyNormalizer.php index 3ba8c4d..64e23c2 100644 --- a/lib/Normalizer/CanvasTriggerSendPostBodyNormalizer.php +++ b/lib/Normalizer/CanvasTriggerSendPostBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,104 +21,205 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class CanvasTriggerSendPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\CanvasTriggerSendPostBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class CanvasTriggerSendPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\CanvasTriggerSendPostBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CanvasTriggerSendPostBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CanvasTriggerSendPostBody'; } - $object = new \Braze\Model\CanvasTriggerSendPostBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CanvasTriggerSendPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('canvas_id', $data)) { + $object->setCanvasId($data['canvas_id']); + unset($data['canvas_id']); + } + if (\array_key_exists('canvas_entry_properties', $data)) { + $object->setCanvasEntryProperties($this->denormalizer->denormalize($data['canvas_entry_properties'], 'Braze\\Model\\CanvasTriggerSendPostBodyCanvasEntryProperties', 'json', $context)); + unset($data['canvas_entry_properties']); + } + if (\array_key_exists('broadcast', $data)) { + $object->setBroadcast($data['broadcast']); + unset($data['broadcast']); + } + if (\array_key_exists('audience', $data)) { + $object->setAudience($this->denormalizer->denormalize($data['audience'], 'Braze\\Model\\CanvasTriggerSendPostBodyAudience', 'json', $context)); + unset($data['audience']); + } + if (\array_key_exists('recipients', $data)) { + $values = []; + foreach ($data['recipients'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItem', 'json', $context); + } + $object->setRecipients($values); + unset($data['recipients']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('canvas_id', $data)) { - $object->setCanvasId($data['canvas_id']); - unset($data['canvas_id']); - } - if (\array_key_exists('canvas_entry_properties', $data)) { - $object->setCanvasEntryProperties($this->denormalizer->denormalize($data['canvas_entry_properties'], 'Braze\\Model\\CanvasTriggerSendPostBodyCanvasEntryProperties', 'json', $context)); - unset($data['canvas_entry_properties']); - } - if (\array_key_exists('broadcast', $data)) { - $object->setBroadcast($data['broadcast']); - unset($data['broadcast']); - } - if (\array_key_exists('audience', $data)) { - $object->setAudience($this->denormalizer->denormalize($data['audience'], 'Braze\\Model\\CanvasTriggerSendPostBodyAudience', 'json', $context)); - unset($data['audience']); - } - if (\array_key_exists('recipients', $data)) { - $values = []; - foreach ($data['recipients'] as $value) { - $values[] = $this->denormalizer->denormalize($value, 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItem', 'json', $context); + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('canvasId') && null !== $object->getCanvasId()) { + $data['canvas_id'] = $object->getCanvasId(); } - $object->setRecipients($values); - unset($data['recipients']); - } - foreach ($data as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value_1; + if ($object->isInitialized('canvasEntryProperties') && null !== $object->getCanvasEntryProperties()) { + $data['canvas_entry_properties'] = $this->normalizer->normalize($object->getCanvasEntryProperties(), 'json', $context); + } + if ($object->isInitialized('broadcast') && null !== $object->getBroadcast()) { + $data['broadcast'] = $object->getBroadcast(); + } + if ($object->isInitialized('audience') && null !== $object->getAudience()) { + $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); + } + $data['recipients'] = $values; + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CanvasTriggerSendPostBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class CanvasTriggerSendPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('canvasId') && null !== $object->getCanvasId()) { - $data['canvas_id'] = $object->getCanvasId(); - } - if ($object->isInitialized('canvasEntryProperties') && null !== $object->getCanvasEntryProperties()) { - $data['canvas_entry_properties'] = $this->normalizer->normalize($object->getCanvasEntryProperties(), 'json', $context); - } - if ($object->isInitialized('broadcast') && null !== $object->getBroadcast()) { - $data['broadcast'] = $object->getBroadcast(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CanvasTriggerSendPostBody'; } - if ($object->isInitialized('audience') && null !== $object->getAudience()) { - $data['audience'] = $this->normalizer->normalize($object->getAudience(), 'json', $context); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CanvasTriggerSendPostBody'; } - if ($object->isInitialized('recipients') && null !== $object->getRecipients()) { - $values = []; - foreach ($object->getRecipients() as $value) { - $values[] = $this->normalizer->normalize($value, 'json', $context); + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - $data['recipients'] = $values; - } - foreach ($object as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value_1; + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CanvasTriggerSendPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('canvas_id', $data)) { + $object->setCanvasId($data['canvas_id']); + unset($data['canvas_id']); + } + if (\array_key_exists('canvas_entry_properties', $data)) { + $object->setCanvasEntryProperties($this->denormalizer->denormalize($data['canvas_entry_properties'], 'Braze\\Model\\CanvasTriggerSendPostBodyCanvasEntryProperties', 'json', $context)); + unset($data['canvas_entry_properties']); + } + if (\array_key_exists('broadcast', $data)) { + $object->setBroadcast($data['broadcast']); + unset($data['broadcast']); + } + if (\array_key_exists('audience', $data)) { + $object->setAudience($this->denormalizer->denormalize($data['audience'], 'Braze\\Model\\CanvasTriggerSendPostBodyAudience', 'json', $context)); + unset($data['audience']); + } + if (\array_key_exists('recipients', $data)) { + $values = []; + foreach ($data['recipients'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItem', 'json', $context); + } + $object->setRecipients($values); + unset($data['recipients']); } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('canvasId') && null !== $object->getCanvasId()) { + $data['canvas_id'] = $object->getCanvasId(); + } + if ($object->isInitialized('canvasEntryProperties') && null !== $object->getCanvasEntryProperties()) { + $data['canvas_entry_properties'] = $this->normalizer->normalize($object->getCanvasEntryProperties(), 'json', $context); + } + if ($object->isInitialized('broadcast') && null !== $object->getBroadcast()) { + $data['broadcast'] = $object->getBroadcast(); + } + if ($object->isInitialized('audience') && null !== $object->getAudience()) { + $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); + } + $data['recipients'] = $values; + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\CanvasTriggerSendPostBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CanvasTriggerSendPostBody' => false]; + } } } diff --git a/lib/Normalizer/CanvasTriggerSendPostBodyRecipientsItemAttributesNormalizer.php b/lib/Normalizer/CanvasTriggerSendPostBodyRecipientsItemAttributesNormalizer.php index 14f1091..e4c1479 100644 --- a/lib/Normalizer/CanvasTriggerSendPostBodyRecipientsItemAttributesNormalizer.php +++ b/lib/Normalizer/CanvasTriggerSendPostBodyRecipientsItemAttributesNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,68 +21,133 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class CanvasTriggerSendPostBodyRecipientsItemAttributesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class CanvasTriggerSendPostBodyRecipientsItemAttributesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return $type === 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItemAttributes'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool - { - return is_object($data) && get_class($data) === 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItemAttributes'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItemAttributes'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItemAttributes'; } - $object = new \Braze\Model\CanvasTriggerSendPostBodyRecipientsItemAttributes(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CanvasTriggerSendPostBodyRecipientsItemAttributes(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('first_name', $data)) { + $object->setFirstName($data['first_name']); + unset($data['first_name']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('first_name', $data)) { - $object->setFirstName($data['first_name']); - unset($data['first_name']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('firstName') && null !== $object->getFirstName()) { + $data['first_name'] = $object->getFirstName(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItemAttributes' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class CanvasTriggerSendPostBodyRecipientsItemAttributesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('firstName') && null !== $object->getFirstName()) { - $data['first_name'] = $object->getFirstName(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItemAttributes'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItemAttributes'; + } + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CanvasTriggerSendPostBodyRecipientsItemAttributes(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('first_name', $data)) { + $object->setFirstName($data['first_name']); + unset($data['first_name']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('firstName') && null !== $object->getFirstName()) { + $data['first_name'] = $object->getFirstName(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItemAttributes' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItemAttributes' => false]; + } } } diff --git a/lib/Normalizer/CanvasTriggerSendPostBodyRecipientsItemNormalizer.php b/lib/Normalizer/CanvasTriggerSendPostBodyRecipientsItemNormalizer.php index d983048..09ed3a2 100644 --- a/lib/Normalizer/CanvasTriggerSendPostBodyRecipientsItemNormalizer.php +++ b/lib/Normalizer/CanvasTriggerSendPostBodyRecipientsItemNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,111 +21,219 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class CanvasTriggerSendPostBodyRecipientsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItem'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class CanvasTriggerSendPostBodyRecipientsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItem'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItem'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItem'; } - $object = new \Braze\Model\CanvasTriggerSendPostBodyRecipientsItem(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CanvasTriggerSendPostBodyRecipientsItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('user_alias', $data)) { + $object->setUserAlias($this->denormalizer->denormalize($data['user_alias'], 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItemUserAlias', 'json', $context)); + unset($data['user_alias']); + } + if (\array_key_exists('external_user_id', $data)) { + $object->setExternalUserId($data['external_user_id']); + unset($data['external_user_id']); + } + if (\array_key_exists('trigger_properties', $data)) { + $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)) { + $object->setCanvasEntryProperties($data['canvas_entry_properties']); + unset($data['canvas_entry_properties']); + } + if (\array_key_exists('send_to_existing_only', $data)) { + $object->setSendToExistingOnly($data['send_to_existing_only']); + unset($data['send_to_existing_only']); + } + if (\array_key_exists('attributes', $data)) { + $object->setAttributes($this->denormalizer->denormalize($data['attributes'], 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItemAttributes', 'json', $context)); + unset($data['attributes']); + } + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_1; + } + } + return $object; } - if (\array_key_exists('user_alias', $data)) { - $object->setUserAlias($this->denormalizer->denormalize($data['user_alias'], 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItemUserAlias', 'json', $context)); - unset($data['user_alias']); - } - if (\array_key_exists('external_user_id', $data)) { - $object->setExternalUserId($data['external_user_id']); - unset($data['external_user_id']); - } - if (\array_key_exists('trigger_properties', $data)) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data['trigger_properties'] as $key => $value) { - $values[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('userAlias') && null !== $object->getUserAlias()) { + $data['user_alias'] = $this->normalizer->normalize($object->getUserAlias(), 'json', $context); } - $object->setTriggerProperties($values); - unset($data['trigger_properties']); - } - if (\array_key_exists('canvas_entry_properties', $data)) { - $object->setCanvasEntryProperties($data['canvas_entry_properties']); - unset($data['canvas_entry_properties']); - } - if (\array_key_exists('send_to_existing_only', $data)) { - $object->setSendToExistingOnly($data['send_to_existing_only']); - unset($data['send_to_existing_only']); - } - if (\array_key_exists('attributes', $data)) { - $object->setAttributes($this->denormalizer->denormalize($data['attributes'], 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItemAttributes', 'json', $context)); - unset($data['attributes']); - } - foreach ($data as $key_1 => $value_1) { - if (preg_match('/.*/', (string) $key_1)) { - $object[$key_1] = $value_1; + if ($object->isInitialized('externalUserId') && null !== $object->getExternalUserId()) { + $data['external_user_id'] = $object->getExternalUserId(); + } + if ($object->isInitialized('triggerProperties') && null !== $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(); } + if ($object->isInitialized('sendToExistingOnly') && null !== $object->getSendToExistingOnly()) { + $data['send_to_existing_only'] = $object->getSendToExistingOnly(); + } + if ($object->isInitialized('attributes') && null !== $object->getAttributes()) { + $data['attributes'] = $this->normalizer->normalize($object->getAttributes(), 'json', $context); + } + foreach ($object as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $data[$key_1] = $value_1; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItem' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class CanvasTriggerSendPostBodyRecipientsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('userAlias') && null !== $object->getUserAlias()) { - $data['user_alias'] = $this->normalizer->normalize($object->getUserAlias(), 'json', $context); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItem'; } - if ($object->isInitialized('externalUserId') && null !== $object->getExternalUserId()) { - $data['external_user_id'] = $object->getExternalUserId(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItem'; } - if ($object->isInitialized('triggerProperties') && null !== $object->getTriggerProperties()) { - $values = []; - foreach ($object->getTriggerProperties() as $key => $value) { - $values[$key] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - $data['trigger_properties'] = $values; - } - if ($object->isInitialized('canvasEntryProperties') && null !== $object->getCanvasEntryProperties()) { - $data['canvas_entry_properties'] = $object->getCanvasEntryProperties(); - } - if ($object->isInitialized('sendToExistingOnly') && null !== $object->getSendToExistingOnly()) { - $data['send_to_existing_only'] = $object->getSendToExistingOnly(); - } - if ($object->isInitialized('attributes') && null !== $object->getAttributes()) { - $data['attributes'] = $this->normalizer->normalize($object->getAttributes(), 'json', $context); - } - foreach ($object as $key_1 => $value_1) { - if (preg_match('/.*/', (string) $key_1)) { - $data[$key_1] = $value_1; + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CanvasTriggerSendPostBodyRecipientsItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('user_alias', $data)) { + $object->setUserAlias($this->denormalizer->denormalize($data['user_alias'], 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItemUserAlias', 'json', $context)); + unset($data['user_alias']); + } + if (\array_key_exists('external_user_id', $data)) { + $object->setExternalUserId($data['external_user_id']); + unset($data['external_user_id']); + } + if (\array_key_exists('trigger_properties', $data)) { + $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)) { + $object->setCanvasEntryProperties($data['canvas_entry_properties']); + unset($data['canvas_entry_properties']); + } + if (\array_key_exists('send_to_existing_only', $data)) { + $object->setSendToExistingOnly($data['send_to_existing_only']); + unset($data['send_to_existing_only']); + } + if (\array_key_exists('attributes', $data)) { + $object->setAttributes($this->denormalizer->denormalize($data['attributes'], 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItemAttributes', 'json', $context)); + unset($data['attributes']); } + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_1; + } + } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('userAlias') && null !== $object->getUserAlias()) { + $data['user_alias'] = $this->normalizer->normalize($object->getUserAlias(), 'json', $context); + } + if ($object->isInitialized('externalUserId') && null !== $object->getExternalUserId()) { + $data['external_user_id'] = $object->getExternalUserId(); + } + if ($object->isInitialized('triggerProperties') && null !== $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(); + } + if ($object->isInitialized('sendToExistingOnly') && null !== $object->getSendToExistingOnly()) { + $data['send_to_existing_only'] = $object->getSendToExistingOnly(); + } + if ($object->isInitialized('attributes') && null !== $object->getAttributes()) { + $data['attributes'] = $this->normalizer->normalize($object->getAttributes(), 'json', $context); + } + foreach ($object as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $data[$key_1] = $value_1; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItem' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItem' => false]; + } } } diff --git a/lib/Normalizer/CanvasTriggerSendPostBodyRecipientsItemUserAliasNormalizer.php b/lib/Normalizer/CanvasTriggerSendPostBodyRecipientsItemUserAliasNormalizer.php index 80fb86c..787aadd 100644 --- a/lib/Normalizer/CanvasTriggerSendPostBodyRecipientsItemUserAliasNormalizer.php +++ b/lib/Normalizer/CanvasTriggerSendPostBodyRecipientsItemUserAliasNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,75 +21,147 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class CanvasTriggerSendPostBodyRecipientsItemUserAliasNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItemUserAlias'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class CanvasTriggerSendPostBodyRecipientsItemUserAliasNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItemUserAlias'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItemUserAlias'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItemUserAlias'; } - $object = new \Braze\Model\CanvasTriggerSendPostBodyRecipientsItemUserAlias(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CanvasTriggerSendPostBodyRecipientsItemUserAlias(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('alias_name', $data)) { + $object->setAliasName($data['alias_name']); + unset($data['alias_name']); + } + if (\array_key_exists('alias_label', $data)) { + $object->setAliasLabel($data['alias_label']); + unset($data['alias_label']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('alias_name', $data)) { - $object->setAliasName($data['alias_name']); - unset($data['alias_name']); - } - if (\array_key_exists('alias_label', $data)) { - $object->setAliasLabel($data['alias_label']); - unset($data['alias_label']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('aliasName') && null !== $object->getAliasName()) { + $data['alias_name'] = $object->getAliasName(); + } + if ($object->isInitialized('aliasLabel') && null !== $object->getAliasLabel()) { + $data['alias_label'] = $object->getAliasLabel(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItemUserAlias' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class CanvasTriggerSendPostBodyRecipientsItemUserAliasNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('aliasName') && null !== $object->getAliasName()) { - $data['alias_name'] = $object->getAliasName(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItemUserAlias'; } - if ($object->isInitialized('aliasLabel') && null !== $object->getAliasLabel()) { - $data['alias_label'] = $object->getAliasLabel(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItemUserAlias'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CanvasTriggerSendPostBodyRecipientsItemUserAlias(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('alias_name', $data)) { + $object->setAliasName($data['alias_name']); + unset($data['alias_name']); + } + if (\array_key_exists('alias_label', $data)) { + $object->setAliasLabel($data['alias_label']); + unset($data['alias_label']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('aliasName') && null !== $object->getAliasName()) { + $data['alias_name'] = $object->getAliasName(); + } + if ($object->isInitialized('aliasLabel') && null !== $object->getAliasLabel()) { + $data['alias_label'] = $object->getAliasLabel(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItemUserAlias' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItemUserAlias' => false]; + } } } diff --git a/lib/Normalizer/CatalogsCatalogNameItemsItemIdPatchBodyNormalizer.php b/lib/Normalizer/CatalogsCatalogNameItemsItemIdPatchBodyNormalizer.php index 79dd3b0..080d1db 100644 --- a/lib/Normalizer/CatalogsCatalogNameItemsItemIdPatchBodyNormalizer.php +++ b/lib/Normalizer/CatalogsCatalogNameItemsItemIdPatchBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,84 +21,165 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class CatalogsCatalogNameItemsItemIdPatchBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\CatalogsCatalogNameItemsItemIdPatchBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class CatalogsCatalogNameItemsItemIdPatchBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\CatalogsCatalogNameItemsItemIdPatchBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CatalogsCatalogNameItemsItemIdPatchBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CatalogsCatalogNameItemsItemIdPatchBody'; } - $object = new \Braze\Model\CatalogsCatalogNameItemsItemIdPatchBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CatalogsCatalogNameItemsItemIdPatchBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('items', $data)) { + $values = []; + foreach ($data['items'] as $value) { + $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($value as $key => $value_1) { + $values_1[$key] = $value_1; + } + $values[] = $values_1; + } + $object->setItems($values); + unset($data['items']); + } + foreach ($data as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_2; + } + } + return $object; } - if (\array_key_exists('items', $data)) { - $values = []; - foreach ($data['items'] as $value) { - $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($value as $key => $value_1) { - $values_1[$key] = $value_1; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('items') && null !== $object->getItems()) { + $values = []; + foreach ($object->getItems() as $value) { + $values_1 = []; + foreach ($value as $key => $value_1) { + $values_1[$key] = $value_1; + } + $values[] = $values_1; } - $values[] = $values_1; + $data['items'] = $values; } - $object->setItems($values); - unset($data['items']); - } - foreach ($data as $key_1 => $value_2) { - if (preg_match('/.*/', (string) $key_1)) { - $object[$key_1] = $value_2; + foreach ($object as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $data[$key_1] = $value_2; + } } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CatalogsCatalogNameItemsItemIdPatchBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class CatalogsCatalogNameItemsItemIdPatchBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('items') && null !== $object->getItems()) { - $values = []; - foreach ($object->getItems() as $value) { - $values_1 = []; - foreach ($value as $key => $value_1) { - $values_1[$key] = $value_1; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CatalogsCatalogNameItemsItemIdPatchBody'; + } + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CatalogsCatalogNameItemsItemIdPatchBody'; + } + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CatalogsCatalogNameItemsItemIdPatchBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('items', $data)) { + $values = []; + foreach ($data['items'] as $value) { + $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($value as $key => $value_1) { + $values_1[$key] = $value_1; + } + $values[] = $values_1; } - $values[] = $values_1; + $object->setItems($values); + unset($data['items']); } - $data['items'] = $values; - } - foreach ($object as $key_1 => $value_2) { - if (preg_match('/.*/', (string) $key_1)) { - $data[$key_1] = $value_2; + foreach ($data as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_2; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('items') && null !== $object->getItems()) { + $values = []; + foreach ($object->getItems() as $value) { + $values_1 = []; + foreach ($value as $key => $value_1) { + $values_1[$key] = $value_1; + } + $values[] = $values_1; + } + $data['items'] = $values; + } + foreach ($object as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $data[$key_1] = $value_2; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\CatalogsCatalogNameItemsItemIdPatchBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CatalogsCatalogNameItemsItemIdPatchBody' => false]; + } } } diff --git a/lib/Normalizer/CatalogsCatalogNameItemsItemIdPostBodyNormalizer.php b/lib/Normalizer/CatalogsCatalogNameItemsItemIdPostBodyNormalizer.php index 4ea642b..127bb29 100644 --- a/lib/Normalizer/CatalogsCatalogNameItemsItemIdPostBodyNormalizer.php +++ b/lib/Normalizer/CatalogsCatalogNameItemsItemIdPostBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,84 +21,165 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class CatalogsCatalogNameItemsItemIdPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\CatalogsCatalogNameItemsItemIdPostBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class CatalogsCatalogNameItemsItemIdPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\CatalogsCatalogNameItemsItemIdPostBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CatalogsCatalogNameItemsItemIdPostBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CatalogsCatalogNameItemsItemIdPostBody'; } - $object = new \Braze\Model\CatalogsCatalogNameItemsItemIdPostBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CatalogsCatalogNameItemsItemIdPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('items', $data)) { + $values = []; + foreach ($data['items'] as $value) { + $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($value as $key => $value_1) { + $values_1[$key] = $value_1; + } + $values[] = $values_1; + } + $object->setItems($values); + unset($data['items']); + } + foreach ($data as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_2; + } + } + return $object; } - if (\array_key_exists('items', $data)) { - $values = []; - foreach ($data['items'] as $value) { - $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($value as $key => $value_1) { - $values_1[$key] = $value_1; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('items') && null !== $object->getItems()) { + $values = []; + foreach ($object->getItems() as $value) { + $values_1 = []; + foreach ($value as $key => $value_1) { + $values_1[$key] = $value_1; + } + $values[] = $values_1; } - $values[] = $values_1; + $data['items'] = $values; } - $object->setItems($values); - unset($data['items']); - } - foreach ($data as $key_1 => $value_2) { - if (preg_match('/.*/', (string) $key_1)) { - $object[$key_1] = $value_2; + foreach ($object as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $data[$key_1] = $value_2; + } } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CatalogsCatalogNameItemsItemIdPostBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class CatalogsCatalogNameItemsItemIdPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('items') && null !== $object->getItems()) { - $values = []; - foreach ($object->getItems() as $value) { - $values_1 = []; - foreach ($value as $key => $value_1) { - $values_1[$key] = $value_1; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CatalogsCatalogNameItemsItemIdPostBody'; + } + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CatalogsCatalogNameItemsItemIdPostBody'; + } + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CatalogsCatalogNameItemsItemIdPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('items', $data)) { + $values = []; + foreach ($data['items'] as $value) { + $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($value as $key => $value_1) { + $values_1[$key] = $value_1; + } + $values[] = $values_1; } - $values[] = $values_1; + $object->setItems($values); + unset($data['items']); } - $data['items'] = $values; - } - foreach ($object as $key_1 => $value_2) { - if (preg_match('/.*/', (string) $key_1)) { - $data[$key_1] = $value_2; + foreach ($data as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_2; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('items') && null !== $object->getItems()) { + $values = []; + foreach ($object->getItems() as $value) { + $values_1 = []; + foreach ($value as $key => $value_1) { + $values_1[$key] = $value_1; + } + $values[] = $values_1; + } + $data['items'] = $values; + } + foreach ($object as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $data[$key_1] = $value_2; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\CatalogsCatalogNameItemsItemIdPostBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CatalogsCatalogNameItemsItemIdPostBody' => false]; + } } } diff --git a/lib/Normalizer/CatalogsCatalogNameItemsItemIdPutBodyNormalizer.php b/lib/Normalizer/CatalogsCatalogNameItemsItemIdPutBodyNormalizer.php index 53d0bd8..5d966e0 100644 --- a/lib/Normalizer/CatalogsCatalogNameItemsItemIdPutBodyNormalizer.php +++ b/lib/Normalizer/CatalogsCatalogNameItemsItemIdPutBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,84 +21,165 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class CatalogsCatalogNameItemsItemIdPutBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\CatalogsCatalogNameItemsItemIdPutBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class CatalogsCatalogNameItemsItemIdPutBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\CatalogsCatalogNameItemsItemIdPutBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CatalogsCatalogNameItemsItemIdPutBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CatalogsCatalogNameItemsItemIdPutBody'; } - $object = new \Braze\Model\CatalogsCatalogNameItemsItemIdPutBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CatalogsCatalogNameItemsItemIdPutBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('items', $data)) { + $values = []; + foreach ($data['items'] as $value) { + $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($value as $key => $value_1) { + $values_1[$key] = $value_1; + } + $values[] = $values_1; + } + $object->setItems($values); + unset($data['items']); + } + foreach ($data as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_2; + } + } + return $object; } - if (\array_key_exists('items', $data)) { - $values = []; - foreach ($data['items'] as $value) { - $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($value as $key => $value_1) { - $values_1[$key] = $value_1; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('items') && null !== $object->getItems()) { + $values = []; + foreach ($object->getItems() as $value) { + $values_1 = []; + foreach ($value as $key => $value_1) { + $values_1[$key] = $value_1; + } + $values[] = $values_1; } - $values[] = $values_1; + $data['items'] = $values; } - $object->setItems($values); - unset($data['items']); - } - foreach ($data as $key_1 => $value_2) { - if (preg_match('/.*/', (string) $key_1)) { - $object[$key_1] = $value_2; + foreach ($object as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $data[$key_1] = $value_2; + } } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CatalogsCatalogNameItemsItemIdPutBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class CatalogsCatalogNameItemsItemIdPutBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('items') && null !== $object->getItems()) { - $values = []; - foreach ($object->getItems() as $value) { - $values_1 = []; - foreach ($value as $key => $value_1) { - $values_1[$key] = $value_1; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CatalogsCatalogNameItemsItemIdPutBody'; + } + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CatalogsCatalogNameItemsItemIdPutBody'; + } + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CatalogsCatalogNameItemsItemIdPutBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('items', $data)) { + $values = []; + foreach ($data['items'] as $value) { + $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($value as $key => $value_1) { + $values_1[$key] = $value_1; + } + $values[] = $values_1; } - $values[] = $values_1; + $object->setItems($values); + unset($data['items']); } - $data['items'] = $values; - } - foreach ($object as $key_1 => $value_2) { - if (preg_match('/.*/', (string) $key_1)) { - $data[$key_1] = $value_2; + foreach ($data as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_2; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('items') && null !== $object->getItems()) { + $values = []; + foreach ($object->getItems() as $value) { + $values_1 = []; + foreach ($value as $key => $value_1) { + $values_1[$key] = $value_1; + } + $values[] = $values_1; + } + $data['items'] = $values; + } + foreach ($object as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $data[$key_1] = $value_2; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\CatalogsCatalogNameItemsItemIdPutBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CatalogsCatalogNameItemsItemIdPutBody' => false]; + } } } diff --git a/lib/Normalizer/CatalogsCatalogNameItemsPatchBodyItemsItemNormalizer.php b/lib/Normalizer/CatalogsCatalogNameItemsPatchBodyItemsItemNormalizer.php index b677d5e..23667e0 100644 --- a/lib/Normalizer/CatalogsCatalogNameItemsPatchBodyItemsItemNormalizer.php +++ b/lib/Normalizer/CatalogsCatalogNameItemsPatchBodyItemsItemNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,68 +21,133 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class CatalogsCatalogNameItemsPatchBodyItemsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class CatalogsCatalogNameItemsPatchBodyItemsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return $type === 'Braze\\Model\\CatalogsCatalogNameItemsPatchBodyItemsItem'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool - { - return is_object($data) && get_class($data) === 'Braze\\Model\\CatalogsCatalogNameItemsPatchBodyItemsItem'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CatalogsCatalogNameItemsPatchBodyItemsItem'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CatalogsCatalogNameItemsPatchBodyItemsItem'; } - $object = new \Braze\Model\CatalogsCatalogNameItemsPatchBodyItemsItem(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CatalogsCatalogNameItemsPatchBodyItemsItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('id', $data)) { + $object->setId($data['id']); + unset($data['id']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('id', $data)) { - $object->setId($data['id']); - unset($data['id']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('id') && null !== $object->getId()) { + $data['id'] = $object->getId(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CatalogsCatalogNameItemsPatchBodyItemsItem' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class CatalogsCatalogNameItemsPatchBodyItemsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('id') && null !== $object->getId()) { - $data['id'] = $object->getId(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CatalogsCatalogNameItemsPatchBodyItemsItem'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CatalogsCatalogNameItemsPatchBodyItemsItem'; + } + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CatalogsCatalogNameItemsPatchBodyItemsItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('id', $data)) { + $object->setId($data['id']); + unset($data['id']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('id') && null !== $object->getId()) { + $data['id'] = $object->getId(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\CatalogsCatalogNameItemsPatchBodyItemsItem' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CatalogsCatalogNameItemsPatchBodyItemsItem' => false]; + } } } diff --git a/lib/Normalizer/CatalogsCatalogNameItemsPatchBodyNormalizer.php b/lib/Normalizer/CatalogsCatalogNameItemsPatchBodyNormalizer.php index d768ae9..ac47d2a 100644 --- a/lib/Normalizer/CatalogsCatalogNameItemsPatchBodyNormalizer.php +++ b/lib/Normalizer/CatalogsCatalogNameItemsPatchBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,76 +21,149 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class CatalogsCatalogNameItemsPatchBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class CatalogsCatalogNameItemsPatchBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return $type === 'Braze\\Model\\CatalogsCatalogNameItemsPatchBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool - { - return is_object($data) && get_class($data) === 'Braze\\Model\\CatalogsCatalogNameItemsPatchBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CatalogsCatalogNameItemsPatchBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CatalogsCatalogNameItemsPatchBody'; } - $object = new \Braze\Model\CatalogsCatalogNameItemsPatchBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CatalogsCatalogNameItemsPatchBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('items', $data)) { + $values = []; + foreach ($data['items'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'Braze\\Model\\CatalogsCatalogNameItemsPatchBodyItemsItem', 'json', $context); + } + $object->setItems($values); + unset($data['items']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('items', $data)) { - $values = []; - foreach ($data['items'] as $value) { - $values[] = $this->denormalizer->denormalize($value, 'Braze\\Model\\CatalogsCatalogNameItemsPatchBodyItemsItem', 'json', $context); + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('items') && null !== $object->getItems()) { + $values = []; + foreach ($object->getItems() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['items'] = $values; } - $object->setItems($values); - unset($data['items']); - } - foreach ($data as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value_1; + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CatalogsCatalogNameItemsPatchBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class CatalogsCatalogNameItemsPatchBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('items') && null !== $object->getItems()) { - $values = []; - foreach ($object->getItems() as $value) { - $values[] = $this->normalizer->normalize($value, 'json', $context); - } - $data['items'] = $values; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CatalogsCatalogNameItemsPatchBody'; } - foreach ($object as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value_1; + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CatalogsCatalogNameItemsPatchBody'; + } + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CatalogsCatalogNameItemsPatchBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('items', $data)) { + $values = []; + foreach ($data['items'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'Braze\\Model\\CatalogsCatalogNameItemsPatchBodyItemsItem', 'json', $context); + } + $object->setItems($values); + unset($data['items']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('items') && null !== $object->getItems()) { + $values = []; + foreach ($object->getItems() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['items'] = $values; + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\CatalogsCatalogNameItemsPatchBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CatalogsCatalogNameItemsPatchBody' => false]; + } } } diff --git a/lib/Normalizer/CatalogsCatalogNameItemsPostBodyNormalizer.php b/lib/Normalizer/CatalogsCatalogNameItemsPostBodyNormalizer.php index 1035c2e..bc900ed 100644 --- a/lib/Normalizer/CatalogsCatalogNameItemsPostBodyNormalizer.php +++ b/lib/Normalizer/CatalogsCatalogNameItemsPostBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,84 +21,165 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class CatalogsCatalogNameItemsPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\CatalogsCatalogNameItemsPostBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class CatalogsCatalogNameItemsPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\CatalogsCatalogNameItemsPostBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CatalogsCatalogNameItemsPostBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CatalogsCatalogNameItemsPostBody'; } - $object = new \Braze\Model\CatalogsCatalogNameItemsPostBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CatalogsCatalogNameItemsPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('items', $data)) { + $values = []; + foreach ($data['items'] as $value) { + $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($value as $key => $value_1) { + $values_1[$key] = $value_1; + } + $values[] = $values_1; + } + $object->setItems($values); + unset($data['items']); + } + foreach ($data as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_2; + } + } + return $object; } - if (\array_key_exists('items', $data)) { - $values = []; - foreach ($data['items'] as $value) { - $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($value as $key => $value_1) { - $values_1[$key] = $value_1; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('items') && null !== $object->getItems()) { + $values = []; + foreach ($object->getItems() as $value) { + $values_1 = []; + foreach ($value as $key => $value_1) { + $values_1[$key] = $value_1; + } + $values[] = $values_1; } - $values[] = $values_1; + $data['items'] = $values; } - $object->setItems($values); - unset($data['items']); - } - foreach ($data as $key_1 => $value_2) { - if (preg_match('/.*/', (string) $key_1)) { - $object[$key_1] = $value_2; + foreach ($object as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $data[$key_1] = $value_2; + } } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CatalogsCatalogNameItemsPostBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class CatalogsCatalogNameItemsPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('items') && null !== $object->getItems()) { - $values = []; - foreach ($object->getItems() as $value) { - $values_1 = []; - foreach ($value as $key => $value_1) { - $values_1[$key] = $value_1; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CatalogsCatalogNameItemsPostBody'; + } + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CatalogsCatalogNameItemsPostBody'; + } + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CatalogsCatalogNameItemsPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('items', $data)) { + $values = []; + foreach ($data['items'] as $value) { + $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($value as $key => $value_1) { + $values_1[$key] = $value_1; + } + $values[] = $values_1; } - $values[] = $values_1; + $object->setItems($values); + unset($data['items']); } - $data['items'] = $values; - } - foreach ($object as $key_1 => $value_2) { - if (preg_match('/.*/', (string) $key_1)) { - $data[$key_1] = $value_2; + foreach ($data as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_2; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('items') && null !== $object->getItems()) { + $values = []; + foreach ($object->getItems() as $value) { + $values_1 = []; + foreach ($value as $key => $value_1) { + $values_1[$key] = $value_1; + } + $values[] = $values_1; + } + $data['items'] = $values; + } + foreach ($object as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $data[$key_1] = $value_2; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\CatalogsCatalogNameItemsPostBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CatalogsCatalogNameItemsPostBody' => false]; + } } } diff --git a/lib/Normalizer/CatalogsCatalogNameItemsPutBodyNormalizer.php b/lib/Normalizer/CatalogsCatalogNameItemsPutBodyNormalizer.php index 42e58ed..65423ab 100644 --- a/lib/Normalizer/CatalogsCatalogNameItemsPutBodyNormalizer.php +++ b/lib/Normalizer/CatalogsCatalogNameItemsPutBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,84 +21,165 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class CatalogsCatalogNameItemsPutBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\CatalogsCatalogNameItemsPutBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class CatalogsCatalogNameItemsPutBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\CatalogsCatalogNameItemsPutBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CatalogsCatalogNameItemsPutBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CatalogsCatalogNameItemsPutBody'; } - $object = new \Braze\Model\CatalogsCatalogNameItemsPutBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CatalogsCatalogNameItemsPutBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('items', $data)) { + $values = []; + foreach ($data['items'] as $value) { + $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($value as $key => $value_1) { + $values_1[$key] = $value_1; + } + $values[] = $values_1; + } + $object->setItems($values); + unset($data['items']); + } + foreach ($data as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_2; + } + } + return $object; } - if (\array_key_exists('items', $data)) { - $values = []; - foreach ($data['items'] as $value) { - $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($value as $key => $value_1) { - $values_1[$key] = $value_1; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('items') && null !== $object->getItems()) { + $values = []; + foreach ($object->getItems() as $value) { + $values_1 = []; + foreach ($value as $key => $value_1) { + $values_1[$key] = $value_1; + } + $values[] = $values_1; } - $values[] = $values_1; + $data['items'] = $values; } - $object->setItems($values); - unset($data['items']); - } - foreach ($data as $key_1 => $value_2) { - if (preg_match('/.*/', (string) $key_1)) { - $object[$key_1] = $value_2; + foreach ($object as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $data[$key_1] = $value_2; + } } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CatalogsCatalogNameItemsPutBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class CatalogsCatalogNameItemsPutBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('items') && null !== $object->getItems()) { - $values = []; - foreach ($object->getItems() as $value) { - $values_1 = []; - foreach ($value as $key => $value_1) { - $values_1[$key] = $value_1; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CatalogsCatalogNameItemsPutBody'; + } + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CatalogsCatalogNameItemsPutBody'; + } + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CatalogsCatalogNameItemsPutBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('items', $data)) { + $values = []; + foreach ($data['items'] as $value) { + $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($value as $key => $value_1) { + $values_1[$key] = $value_1; + } + $values[] = $values_1; } - $values[] = $values_1; + $object->setItems($values); + unset($data['items']); } - $data['items'] = $values; - } - foreach ($object as $key_1 => $value_2) { - if (preg_match('/.*/', (string) $key_1)) { - $data[$key_1] = $value_2; + foreach ($data as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_2; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('items') && null !== $object->getItems()) { + $values = []; + foreach ($object->getItems() as $value) { + $values_1 = []; + foreach ($value as $key => $value_1) { + $values_1[$key] = $value_1; + } + $values[] = $values_1; + } + $data['items'] = $values; + } + foreach ($object as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $data[$key_1] = $value_2; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\CatalogsCatalogNameItemsPutBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CatalogsCatalogNameItemsPutBody' => false]; + } } } diff --git a/lib/Normalizer/CatalogsPostBodyCatalogsItemFieldsItemNormalizer.php b/lib/Normalizer/CatalogsPostBodyCatalogsItemFieldsItemNormalizer.php index 6618e23..d063cbc 100644 --- a/lib/Normalizer/CatalogsPostBodyCatalogsItemFieldsItemNormalizer.php +++ b/lib/Normalizer/CatalogsPostBodyCatalogsItemFieldsItemNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,75 +21,147 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class CatalogsPostBodyCatalogsItemFieldsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\CatalogsPostBodyCatalogsItemFieldsItem'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class CatalogsPostBodyCatalogsItemFieldsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\CatalogsPostBodyCatalogsItemFieldsItem'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CatalogsPostBodyCatalogsItemFieldsItem'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CatalogsPostBodyCatalogsItemFieldsItem'; } - $object = new \Braze\Model\CatalogsPostBodyCatalogsItemFieldsItem(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CatalogsPostBodyCatalogsItemFieldsItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('name', $data)) { + $object->setName($data['name']); + unset($data['name']); + } + if (\array_key_exists('type', $data)) { + $object->setType($data['type']); + unset($data['type']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('name', $data)) { - $object->setName($data['name']); - unset($data['name']); - } - if (\array_key_exists('type', $data)) { - $object->setType($data['type']); - unset($data['type']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['name'] = $object->getName(); + } + if ($object->isInitialized('type') && null !== $object->getType()) { + $data['type'] = $object->getType(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CatalogsPostBodyCatalogsItemFieldsItem' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class CatalogsPostBodyCatalogsItemFieldsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('name') && null !== $object->getName()) { - $data['name'] = $object->getName(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CatalogsPostBodyCatalogsItemFieldsItem'; } - if ($object->isInitialized('type') && null !== $object->getType()) { - $data['type'] = $object->getType(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CatalogsPostBodyCatalogsItemFieldsItem'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CatalogsPostBodyCatalogsItemFieldsItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('name', $data)) { + $object->setName($data['name']); + unset($data['name']); + } + if (\array_key_exists('type', $data)) { + $object->setType($data['type']); + unset($data['type']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['name'] = $object->getName(); + } + if ($object->isInitialized('type') && null !== $object->getType()) { + $data['type'] = $object->getType(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\CatalogsPostBodyCatalogsItemFieldsItem' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CatalogsPostBodyCatalogsItemFieldsItem' => false]; + } } } diff --git a/lib/Normalizer/CatalogsPostBodyCatalogsItemNormalizer.php b/lib/Normalizer/CatalogsPostBodyCatalogsItemNormalizer.php index d981452..8bf2b95 100644 --- a/lib/Normalizer/CatalogsPostBodyCatalogsItemNormalizer.php +++ b/lib/Normalizer/CatalogsPostBodyCatalogsItemNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,90 +21,177 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class CatalogsPostBodyCatalogsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\CatalogsPostBodyCatalogsItem'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class CatalogsPostBodyCatalogsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\CatalogsPostBodyCatalogsItem'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CatalogsPostBodyCatalogsItem'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CatalogsPostBodyCatalogsItem'; } - $object = new \Braze\Model\CatalogsPostBodyCatalogsItem(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CatalogsPostBodyCatalogsItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('name', $data)) { + $object->setName($data['name']); + unset($data['name']); + } + if (\array_key_exists('description', $data)) { + $object->setDescription($data['description']); + unset($data['description']); + } + if (\array_key_exists('fields', $data)) { + $values = []; + foreach ($data['fields'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'Braze\\Model\\CatalogsPostBodyCatalogsItemFieldsItem', 'json', $context); + } + $object->setFields($values); + unset($data['fields']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('name', $data)) { - $object->setName($data['name']); - unset($data['name']); - } - if (\array_key_exists('description', $data)) { - $object->setDescription($data['description']); - unset($data['description']); - } - if (\array_key_exists('fields', $data)) { - $values = []; - foreach ($data['fields'] as $value) { - $values[] = $this->denormalizer->denormalize($value, 'Braze\\Model\\CatalogsPostBodyCatalogsItemFieldsItem', 'json', $context); + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['name'] = $object->getName(); } - $object->setFields($values); - unset($data['fields']); - } - foreach ($data as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value_1; + if ($object->isInitialized('description') && null !== $object->getDescription()) { + $data['description'] = $object->getDescription(); + } + if ($object->isInitialized('fields') && null !== $object->getFields()) { + $values = []; + foreach ($object->getFields() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['fields'] = $values; } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CatalogsPostBodyCatalogsItem' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class CatalogsPostBodyCatalogsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('name') && null !== $object->getName()) { - $data['name'] = $object->getName(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CatalogsPostBodyCatalogsItem'; } - if ($object->isInitialized('description') && null !== $object->getDescription()) { - $data['description'] = $object->getDescription(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CatalogsPostBodyCatalogsItem'; } - if ($object->isInitialized('fields') && null !== $object->getFields()) { - $values = []; - foreach ($object->getFields() as $value) { - $values[] = $this->normalizer->normalize($value, 'json', $context); + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - $data['fields'] = $values; - } - foreach ($object as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value_1; + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CatalogsPostBodyCatalogsItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('name', $data)) { + $object->setName($data['name']); + unset($data['name']); + } + if (\array_key_exists('description', $data)) { + $object->setDescription($data['description']); + unset($data['description']); + } + if (\array_key_exists('fields', $data)) { + $values = []; + foreach ($data['fields'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'Braze\\Model\\CatalogsPostBodyCatalogsItemFieldsItem', 'json', $context); + } + $object->setFields($values); + unset($data['fields']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['name'] = $object->getName(); + } + if ($object->isInitialized('description') && null !== $object->getDescription()) { + $data['description'] = $object->getDescription(); + } + if ($object->isInitialized('fields') && null !== $object->getFields()) { + $values = []; + foreach ($object->getFields() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['fields'] = $values; + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\CatalogsPostBodyCatalogsItem' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CatalogsPostBodyCatalogsItem' => false]; + } } } diff --git a/lib/Normalizer/CatalogsPostBodyNormalizer.php b/lib/Normalizer/CatalogsPostBodyNormalizer.php index 7aae14a..a134b1e 100644 --- a/lib/Normalizer/CatalogsPostBodyNormalizer.php +++ b/lib/Normalizer/CatalogsPostBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,76 +21,149 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class CatalogsPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class CatalogsPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return $type === 'Braze\\Model\\CatalogsPostBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool - { - return is_object($data) && get_class($data) === 'Braze\\Model\\CatalogsPostBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CatalogsPostBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CatalogsPostBody'; } - $object = new \Braze\Model\CatalogsPostBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CatalogsPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('catalogs', $data)) { + $values = []; + foreach ($data['catalogs'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'Braze\\Model\\CatalogsPostBodyCatalogsItem', 'json', $context); + } + $object->setCatalogs($values); + unset($data['catalogs']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('catalogs', $data)) { - $values = []; - foreach ($data['catalogs'] as $value) { - $values[] = $this->denormalizer->denormalize($value, 'Braze\\Model\\CatalogsPostBodyCatalogsItem', 'json', $context); + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('catalogs') && null !== $object->getCatalogs()) { + $values = []; + foreach ($object->getCatalogs() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['catalogs'] = $values; } - $object->setCatalogs($values); - unset($data['catalogs']); - } - foreach ($data as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value_1; + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CatalogsPostBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class CatalogsPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('catalogs') && null !== $object->getCatalogs()) { - $values = []; - foreach ($object->getCatalogs() as $value) { - $values[] = $this->normalizer->normalize($value, 'json', $context); - } - $data['catalogs'] = $values; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\CatalogsPostBody'; } - foreach ($object as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value_1; + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\CatalogsPostBody'; + } + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\CatalogsPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('catalogs', $data)) { + $values = []; + foreach ($data['catalogs'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'Braze\\Model\\CatalogsPostBodyCatalogsItem', 'json', $context); + } + $object->setCatalogs($values); + unset($data['catalogs']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('catalogs') && null !== $object->getCatalogs()) { + $values = []; + foreach ($object->getCatalogs() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['catalogs'] = $values; + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\CatalogsPostBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\CatalogsPostBody' => false]; + } } } diff --git a/lib/Normalizer/ContentBlocksCreatePostBodyNormalizer.php b/lib/Normalizer/ContentBlocksCreatePostBodyNormalizer.php index bf442c5..3e2f2c0 100644 --- a/lib/Normalizer/ContentBlocksCreatePostBodyNormalizer.php +++ b/lib/Normalizer/ContentBlocksCreatePostBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,104 +21,205 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class ContentBlocksCreatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\ContentBlocksCreatePostBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ContentBlocksCreatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\ContentBlocksCreatePostBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\ContentBlocksCreatePostBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\ContentBlocksCreatePostBody'; } - $object = new \Braze\Model\ContentBlocksCreatePostBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\ContentBlocksCreatePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('name', $data)) { + $object->setName($data['name']); + unset($data['name']); + } + if (\array_key_exists('description', $data)) { + $object->setDescription($data['description']); + unset($data['description']); + } + if (\array_key_exists('content', $data)) { + $object->setContent($data['content']); + unset($data['content']); + } + if (\array_key_exists('state', $data)) { + $object->setState($data['state']); + unset($data['state']); + } + if (\array_key_exists('tags', $data)) { + $values = []; + foreach ($data['tags'] as $value) { + $values[] = $value; + } + $object->setTags($values); + unset($data['tags']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('name', $data)) { - $object->setName($data['name']); - unset($data['name']); - } - if (\array_key_exists('description', $data)) { - $object->setDescription($data['description']); - unset($data['description']); - } - if (\array_key_exists('content', $data)) { - $object->setContent($data['content']); - unset($data['content']); - } - if (\array_key_exists('state', $data)) { - $object->setState($data['state']); - unset($data['state']); - } - if (\array_key_exists('tags', $data)) { - $values = []; - foreach ($data['tags'] as $value) { - $values[] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['name'] = $object->getName(); } - $object->setTags($values); - unset($data['tags']); - } - foreach ($data as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value_1; + if ($object->isInitialized('description') && null !== $object->getDescription()) { + $data['description'] = $object->getDescription(); + } + if ($object->isInitialized('content') && null !== $object->getContent()) { + $data['content'] = $object->getContent(); + } + if ($object->isInitialized('state') && null !== $object->getState()) { + $data['state'] = $object->getState(); } + if ($object->isInitialized('tags') && null !== $object->getTags()) { + $values = []; + foreach ($object->getTags() as $value) { + $values[] = $value; + } + $data['tags'] = $values; + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\ContentBlocksCreatePostBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class ContentBlocksCreatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('name') && null !== $object->getName()) { - $data['name'] = $object->getName(); - } - if ($object->isInitialized('description') && null !== $object->getDescription()) { - $data['description'] = $object->getDescription(); - } - if ($object->isInitialized('content') && null !== $object->getContent()) { - $data['content'] = $object->getContent(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\ContentBlocksCreatePostBody'; } - if ($object->isInitialized('state') && null !== $object->getState()) { - $data['state'] = $object->getState(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\ContentBlocksCreatePostBody'; } - if ($object->isInitialized('tags') && null !== $object->getTags()) { - $values = []; - foreach ($object->getTags() as $value) { - $values[] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - $data['tags'] = $values; - } - foreach ($object as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value_1; + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\ContentBlocksCreatePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('name', $data)) { + $object->setName($data['name']); + unset($data['name']); + } + if (\array_key_exists('description', $data)) { + $object->setDescription($data['description']); + unset($data['description']); + } + if (\array_key_exists('content', $data)) { + $object->setContent($data['content']); + unset($data['content']); + } + if (\array_key_exists('state', $data)) { + $object->setState($data['state']); + unset($data['state']); + } + if (\array_key_exists('tags', $data)) { + $values = []; + foreach ($data['tags'] as $value) { + $values[] = $value; + } + $object->setTags($values); + unset($data['tags']); } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['name'] = $object->getName(); + } + if ($object->isInitialized('description') && null !== $object->getDescription()) { + $data['description'] = $object->getDescription(); + } + if ($object->isInitialized('content') && null !== $object->getContent()) { + $data['content'] = $object->getContent(); + } + if ($object->isInitialized('state') && null !== $object->getState()) { + $data['state'] = $object->getState(); + } + if ($object->isInitialized('tags') && null !== $object->getTags()) { + $values = []; + foreach ($object->getTags() as $value) { + $values[] = $value; + } + $data['tags'] = $values; + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\ContentBlocksCreatePostBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\ContentBlocksCreatePostBody' => false]; + } } } diff --git a/lib/Normalizer/ContentBlocksUpdatePostBodyNormalizer.php b/lib/Normalizer/ContentBlocksUpdatePostBodyNormalizer.php index 29f3234..a3baa74 100644 --- a/lib/Normalizer/ContentBlocksUpdatePostBodyNormalizer.php +++ b/lib/Normalizer/ContentBlocksUpdatePostBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,111 +21,219 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class ContentBlocksUpdatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\ContentBlocksUpdatePostBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ContentBlocksUpdatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\ContentBlocksUpdatePostBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\ContentBlocksUpdatePostBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\ContentBlocksUpdatePostBody'; } - $object = new \Braze\Model\ContentBlocksUpdatePostBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\ContentBlocksUpdatePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('content_block_id', $data)) { + $object->setContentBlockId($data['content_block_id']); + unset($data['content_block_id']); + } + if (\array_key_exists('name', $data)) { + $object->setName($data['name']); + unset($data['name']); + } + if (\array_key_exists('description', $data)) { + $object->setDescription($data['description']); + unset($data['description']); + } + if (\array_key_exists('content', $data)) { + $object->setContent($data['content']); + unset($data['content']); + } + if (\array_key_exists('state', $data)) { + $object->setState($data['state']); + unset($data['state']); + } + if (\array_key_exists('tags', $data)) { + $values = []; + foreach ($data['tags'] as $value) { + $values[] = $value; + } + $object->setTags($values); + unset($data['tags']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('content_block_id', $data)) { - $object->setContentBlockId($data['content_block_id']); - unset($data['content_block_id']); - } - if (\array_key_exists('name', $data)) { - $object->setName($data['name']); - unset($data['name']); - } - if (\array_key_exists('description', $data)) { - $object->setDescription($data['description']); - unset($data['description']); - } - if (\array_key_exists('content', $data)) { - $object->setContent($data['content']); - unset($data['content']); - } - if (\array_key_exists('state', $data)) { - $object->setState($data['state']); - unset($data['state']); - } - if (\array_key_exists('tags', $data)) { - $values = []; - foreach ($data['tags'] as $value) { - $values[] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('contentBlockId') && null !== $object->getContentBlockId()) { + $data['content_block_id'] = $object->getContentBlockId(); } - $object->setTags($values); - unset($data['tags']); - } - foreach ($data as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value_1; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['name'] = $object->getName(); + } + if ($object->isInitialized('description') && null !== $object->getDescription()) { + $data['description'] = $object->getDescription(); + } + if ($object->isInitialized('content') && null !== $object->getContent()) { + $data['content'] = $object->getContent(); } + if ($object->isInitialized('state') && null !== $object->getState()) { + $data['state'] = $object->getState(); + } + if ($object->isInitialized('tags') && null !== $object->getTags()) { + $values = []; + foreach ($object->getTags() as $value) { + $values[] = $value; + } + $data['tags'] = $values; + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\ContentBlocksUpdatePostBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class ContentBlocksUpdatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('contentBlockId') && null !== $object->getContentBlockId()) { - $data['content_block_id'] = $object->getContentBlockId(); - } - if ($object->isInitialized('name') && null !== $object->getName()) { - $data['name'] = $object->getName(); - } - if ($object->isInitialized('description') && null !== $object->getDescription()) { - $data['description'] = $object->getDescription(); - } - if ($object->isInitialized('content') && null !== $object->getContent()) { - $data['content'] = $object->getContent(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\ContentBlocksUpdatePostBody'; } - if ($object->isInitialized('state') && null !== $object->getState()) { - $data['state'] = $object->getState(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\ContentBlocksUpdatePostBody'; } - if ($object->isInitialized('tags') && null !== $object->getTags()) { - $values = []; - foreach ($object->getTags() as $value) { - $values[] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - $data['tags'] = $values; - } - foreach ($object as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value_1; + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\ContentBlocksUpdatePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('content_block_id', $data)) { + $object->setContentBlockId($data['content_block_id']); + unset($data['content_block_id']); + } + if (\array_key_exists('name', $data)) { + $object->setName($data['name']); + unset($data['name']); + } + if (\array_key_exists('description', $data)) { + $object->setDescription($data['description']); + unset($data['description']); + } + if (\array_key_exists('content', $data)) { + $object->setContent($data['content']); + unset($data['content']); + } + if (\array_key_exists('state', $data)) { + $object->setState($data['state']); + unset($data['state']); + } + if (\array_key_exists('tags', $data)) { + $values = []; + foreach ($data['tags'] as $value) { + $values[] = $value; + } + $object->setTags($values); + unset($data['tags']); } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('contentBlockId') && null !== $object->getContentBlockId()) { + $data['content_block_id'] = $object->getContentBlockId(); + } + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['name'] = $object->getName(); + } + if ($object->isInitialized('description') && null !== $object->getDescription()) { + $data['description'] = $object->getDescription(); + } + if ($object->isInitialized('content') && null !== $object->getContent()) { + $data['content'] = $object->getContent(); + } + if ($object->isInitialized('state') && null !== $object->getState()) { + $data['state'] = $object->getState(); + } + if ($object->isInitialized('tags') && null !== $object->getTags()) { + $values = []; + foreach ($object->getTags() as $value) { + $values[] = $value; + } + $data['tags'] = $values; + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\ContentBlocksUpdatePostBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\ContentBlocksUpdatePostBody' => false]; + } } } diff --git a/lib/Normalizer/EmailBlacklistPostBodyNormalizer.php b/lib/Normalizer/EmailBlacklistPostBodyNormalizer.php index 675cbe5..c6e13b2 100644 --- a/lib/Normalizer/EmailBlacklistPostBodyNormalizer.php +++ b/lib/Normalizer/EmailBlacklistPostBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,76 +21,149 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class EmailBlacklistPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class EmailBlacklistPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return $type === 'Braze\\Model\\EmailBlacklistPostBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool - { - return is_object($data) && get_class($data) === 'Braze\\Model\\EmailBlacklistPostBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\EmailBlacklistPostBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\EmailBlacklistPostBody'; } - $object = new \Braze\Model\EmailBlacklistPostBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\EmailBlacklistPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('email', $data)) { + $values = []; + foreach ($data['email'] as $value) { + $values[] = $value; + } + $object->setEmail($values); + unset($data['email']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('email', $data)) { - $values = []; - foreach ($data['email'] as $value) { - $values[] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('email') && null !== $object->getEmail()) { + $values = []; + foreach ($object->getEmail() as $value) { + $values[] = $value; + } + $data['email'] = $values; } - $object->setEmail($values); - unset($data['email']); - } - foreach ($data as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value_1; + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\EmailBlacklistPostBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class EmailBlacklistPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('email') && null !== $object->getEmail()) { - $values = []; - foreach ($object->getEmail() as $value) { - $values[] = $value; - } - $data['email'] = $values; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\EmailBlacklistPostBody'; } - foreach ($object as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value_1; + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\EmailBlacklistPostBody'; + } + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\EmailBlacklistPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('email', $data)) { + $values = []; + foreach ($data['email'] as $value) { + $values[] = $value; + } + $object->setEmail($values); + unset($data['email']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('email') && null !== $object->getEmail()) { + $values = []; + foreach ($object->getEmail() as $value) { + $values[] = $value; + } + $data['email'] = $values; + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\EmailBlacklistPostBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\EmailBlacklistPostBody' => false]; + } } } diff --git a/lib/Normalizer/EmailBlocklistPostBodyNormalizer.php b/lib/Normalizer/EmailBlocklistPostBodyNormalizer.php index a71eb40..3911435 100644 --- a/lib/Normalizer/EmailBlocklistPostBodyNormalizer.php +++ b/lib/Normalizer/EmailBlocklistPostBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,76 +21,149 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class EmailBlocklistPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class EmailBlocklistPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return $type === 'Braze\\Model\\EmailBlocklistPostBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool - { - return is_object($data) && get_class($data) === 'Braze\\Model\\EmailBlocklistPostBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\EmailBlocklistPostBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\EmailBlocklistPostBody'; } - $object = new \Braze\Model\EmailBlocklistPostBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\EmailBlocklistPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('email', $data)) { + $values = []; + foreach ($data['email'] as $value) { + $values[] = $value; + } + $object->setEmail($values); + unset($data['email']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('email', $data)) { - $values = []; - foreach ($data['email'] as $value) { - $values[] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('email') && null !== $object->getEmail()) { + $values = []; + foreach ($object->getEmail() as $value) { + $values[] = $value; + } + $data['email'] = $values; } - $object->setEmail($values); - unset($data['email']); - } - foreach ($data as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value_1; + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\EmailBlocklistPostBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class EmailBlocklistPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('email') && null !== $object->getEmail()) { - $values = []; - foreach ($object->getEmail() as $value) { - $values[] = $value; - } - $data['email'] = $values; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\EmailBlocklistPostBody'; } - foreach ($object as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value_1; + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\EmailBlocklistPostBody'; + } + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\EmailBlocklistPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('email', $data)) { + $values = []; + foreach ($data['email'] as $value) { + $values[] = $value; + } + $object->setEmail($values); + unset($data['email']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('email') && null !== $object->getEmail()) { + $values = []; + foreach ($object->getEmail() as $value) { + $values[] = $value; + } + $data['email'] = $values; + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\EmailBlocklistPostBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\EmailBlocklistPostBody' => false]; + } } } diff --git a/lib/Normalizer/EmailBounceRemovePostBodyNormalizer.php b/lib/Normalizer/EmailBounceRemovePostBodyNormalizer.php index 862572d..a1215da 100644 --- a/lib/Normalizer/EmailBounceRemovePostBodyNormalizer.php +++ b/lib/Normalizer/EmailBounceRemovePostBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,68 +21,133 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class EmailBounceRemovePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class EmailBounceRemovePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return $type === 'Braze\\Model\\EmailBounceRemovePostBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool - { - return is_object($data) && get_class($data) === 'Braze\\Model\\EmailBounceRemovePostBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\EmailBounceRemovePostBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\EmailBounceRemovePostBody'; } - $object = new \Braze\Model\EmailBounceRemovePostBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\EmailBounceRemovePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('email', $data)) { + $object->setEmail($data['email']); + unset($data['email']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('email', $data)) { - $object->setEmail($data['email']); - unset($data['email']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('email') && null !== $object->getEmail()) { + $data['email'] = $object->getEmail(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\EmailBounceRemovePostBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class EmailBounceRemovePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('email') && null !== $object->getEmail()) { - $data['email'] = $object->getEmail(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\EmailBounceRemovePostBody'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\EmailBounceRemovePostBody'; + } + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\EmailBounceRemovePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('email', $data)) { + $object->setEmail($data['email']); + unset($data['email']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('email') && null !== $object->getEmail()) { + $data['email'] = $object->getEmail(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\EmailBounceRemovePostBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\EmailBounceRemovePostBody' => false]; + } } } diff --git a/lib/Normalizer/EmailSpamRemovePostBodyNormalizer.php b/lib/Normalizer/EmailSpamRemovePostBodyNormalizer.php index 9db9bb7..00feb94 100644 --- a/lib/Normalizer/EmailSpamRemovePostBodyNormalizer.php +++ b/lib/Normalizer/EmailSpamRemovePostBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,68 +21,133 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class EmailSpamRemovePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class EmailSpamRemovePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return $type === 'Braze\\Model\\EmailSpamRemovePostBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool - { - return is_object($data) && get_class($data) === 'Braze\\Model\\EmailSpamRemovePostBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\EmailSpamRemovePostBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\EmailSpamRemovePostBody'; } - $object = new \Braze\Model\EmailSpamRemovePostBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\EmailSpamRemovePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('email', $data)) { + $object->setEmail($data['email']); + unset($data['email']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('email', $data)) { - $object->setEmail($data['email']); - unset($data['email']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('email') && null !== $object->getEmail()) { + $data['email'] = $object->getEmail(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\EmailSpamRemovePostBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class EmailSpamRemovePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('email') && null !== $object->getEmail()) { - $data['email'] = $object->getEmail(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\EmailSpamRemovePostBody'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\EmailSpamRemovePostBody'; + } + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\EmailSpamRemovePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('email', $data)) { + $object->setEmail($data['email']); + unset($data['email']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('email') && null !== $object->getEmail()) { + $data['email'] = $object->getEmail(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\EmailSpamRemovePostBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\EmailSpamRemovePostBody' => false]; + } } } diff --git a/lib/Normalizer/EmailStatusPostBodyNormalizer.php b/lib/Normalizer/EmailStatusPostBodyNormalizer.php index bb3b7a9..5349b47 100644 --- a/lib/Normalizer/EmailStatusPostBodyNormalizer.php +++ b/lib/Normalizer/EmailStatusPostBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,75 +21,147 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class EmailStatusPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\EmailStatusPostBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class EmailStatusPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\EmailStatusPostBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\EmailStatusPostBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\EmailStatusPostBody'; } - $object = new \Braze\Model\EmailStatusPostBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\EmailStatusPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('email', $data)) { + $object->setEmail($data['email']); + unset($data['email']); + } + if (\array_key_exists('subscription_state', $data)) { + $object->setSubscriptionState($data['subscription_state']); + unset($data['subscription_state']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('email', $data)) { - $object->setEmail($data['email']); - unset($data['email']); - } - if (\array_key_exists('subscription_state', $data)) { - $object->setSubscriptionState($data['subscription_state']); - unset($data['subscription_state']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('email') && null !== $object->getEmail()) { + $data['email'] = $object->getEmail(); + } + if ($object->isInitialized('subscriptionState') && null !== $object->getSubscriptionState()) { + $data['subscription_state'] = $object->getSubscriptionState(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\EmailStatusPostBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class EmailStatusPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('email') && null !== $object->getEmail()) { - $data['email'] = $object->getEmail(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\EmailStatusPostBody'; } - if ($object->isInitialized('subscriptionState') && null !== $object->getSubscriptionState()) { - $data['subscription_state'] = $object->getSubscriptionState(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\EmailStatusPostBody'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\EmailStatusPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('email', $data)) { + $object->setEmail($data['email']); + unset($data['email']); + } + if (\array_key_exists('subscription_state', $data)) { + $object->setSubscriptionState($data['subscription_state']); + unset($data['subscription_state']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('email') && null !== $object->getEmail()) { + $data['email'] = $object->getEmail(); + } + if ($object->isInitialized('subscriptionState') && null !== $object->getSubscriptionState()) { + $data['subscription_state'] = $object->getSubscriptionState(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\EmailStatusPostBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\EmailStatusPostBody' => false]; + } } } diff --git a/lib/Normalizer/ErrorNormalizer.php b/lib/Normalizer/ErrorNormalizer.php index 87901d7..118e543 100644 --- a/lib/Normalizer/ErrorNormalizer.php +++ b/lib/Normalizer/ErrorNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,83 +21,163 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class ErrorNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\Error'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ErrorNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\Error'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\Error'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\Error'; } - $object = new \Braze\Model\Error(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\Error(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('message', $data)) { + $object->setMessage($data['message']); + unset($data['message']); + } + if (\array_key_exists('errors', $data)) { + $values = []; + foreach ($data['errors'] as $value) { + $values[] = $value; + } + $object->setErrors($values); + unset($data['errors']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('message', $data)) { - $object->setMessage($data['message']); - unset($data['message']); - } - if (\array_key_exists('errors', $data)) { - $values = []; - foreach ($data['errors'] as $value) { - $values[] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('message') && null !== $object->getMessage()) { + $data['message'] = $object->getMessage(); } - $object->setErrors($values); - unset($data['errors']); - } - foreach ($data as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value_1; + if ($object->isInitialized('errors') && null !== $object->getErrors()) { + $values = []; + foreach ($object->getErrors() as $value) { + $values[] = $value; + } + $data['errors'] = $values; + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\Error' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class ErrorNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('message') && null !== $object->getMessage()) { - $data['message'] = $object->getMessage(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\Error'; } - if ($object->isInitialized('errors') && null !== $object->getErrors()) { - $values = []; - foreach ($object->getErrors() as $value) { - $values[] = $value; - } - $data['errors'] = $values; + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\Error'; } - foreach ($object as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value_1; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\Error(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('message', $data)) { + $object->setMessage($data['message']); + unset($data['message']); + } + if (\array_key_exists('errors', $data)) { + $values = []; + foreach ($data['errors'] as $value) { + $values[] = $value; + } + $object->setErrors($values); + unset($data['errors']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('message') && null !== $object->getMessage()) { + $data['message'] = $object->getMessage(); + } + if ($object->isInitialized('errors') && null !== $object->getErrors()) { + $values = []; + foreach ($object->getErrors() as $value) { + $values[] = $value; + } + $data['errors'] = $values; + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\Error' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\Error' => false]; + } } } diff --git a/lib/Normalizer/JaneObjectNormalizer.php b/lib/Normalizer/JaneObjectNormalizer.php index 20a9491..3413674 100644 --- a/lib/Normalizer/JaneObjectNormalizer.php +++ b/lib/Normalizer/JaneObjectNormalizer.php @@ -12,6 +12,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,61 +20,119 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class JaneObjectNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - protected $normalizers = ['Braze\\Model\\Error' => 'Braze\\Normalizer\\ErrorNormalizer', 'Braze\\Model\\TemplatesEmailUpdatePostBody' => 'Braze\\Normalizer\\TemplatesEmailUpdatePostBodyNormalizer', 'Braze\\Model\\UsersTrackPostBody' => 'Braze\\Normalizer\\UsersTrackPostBodyNormalizer', 'Braze\\Model\\CatalogsPostBody' => 'Braze\\Normalizer\\CatalogsPostBodyNormalizer', 'Braze\\Model\\CatalogsPostBodyCatalogsItem' => 'Braze\\Normalizer\\CatalogsPostBodyCatalogsItemNormalizer', 'Braze\\Model\\CatalogsPostBodyCatalogsItemFieldsItem' => 'Braze\\Normalizer\\CatalogsPostBodyCatalogsItemFieldsItemNormalizer', 'Braze\\Model\\CatalogsCatalogNameItemsPatchBody' => 'Braze\\Normalizer\\CatalogsCatalogNameItemsPatchBodyNormalizer', 'Braze\\Model\\CatalogsCatalogNameItemsPatchBodyItemsItem' => 'Braze\\Normalizer\\CatalogsCatalogNameItemsPatchBodyItemsItemNormalizer', 'Braze\\Model\\CatalogsCatalogNameItemsPostBody' => 'Braze\\Normalizer\\CatalogsCatalogNameItemsPostBodyNormalizer', 'Braze\\Model\\CatalogsCatalogNameItemsPutBody' => 'Braze\\Normalizer\\CatalogsCatalogNameItemsPutBodyNormalizer', 'Braze\\Model\\CatalogsCatalogNameItemsItemIdPatchBody' => 'Braze\\Normalizer\\CatalogsCatalogNameItemsItemIdPatchBodyNormalizer', 'Braze\\Model\\CatalogsCatalogNameItemsItemIdPostBody' => 'Braze\\Normalizer\\CatalogsCatalogNameItemsItemIdPostBodyNormalizer', 'Braze\\Model\\CatalogsCatalogNameItemsItemIdPutBody' => 'Braze\\Normalizer\\CatalogsCatalogNameItemsItemIdPutBodyNormalizer', 'Braze\\Model\\EmailStatusPostBody' => 'Braze\\Normalizer\\EmailStatusPostBodyNormalizer', 'Braze\\Model\\EmailBounceRemovePostBody' => 'Braze\\Normalizer\\EmailBounceRemovePostBodyNormalizer', 'Braze\\Model\\EmailSpamRemovePostBody' => 'Braze\\Normalizer\\EmailSpamRemovePostBodyNormalizer', 'Braze\\Model\\EmailBlocklistPostBody' => 'Braze\\Normalizer\\EmailBlocklistPostBodyNormalizer', 'Braze\\Model\\EmailBlacklistPostBody' => 'Braze\\Normalizer\\EmailBlacklistPostBodyNormalizer', 'Braze\\Model\\UsersExportIdsPostBody' => 'Braze\\Normalizer\\UsersExportIdsPostBodyNormalizer', 'Braze\\Model\\UsersExportIdsPostBodyUserAliasesItem' => 'Braze\\Normalizer\\UsersExportIdsPostBodyUserAliasesItemNormalizer', 'Braze\\Model\\UsersExportSegmentPostBody' => 'Braze\\Normalizer\\UsersExportSegmentPostBodyNormalizer', 'Braze\\Model\\UsersExportGlobalControlGroupPostBody' => 'Braze\\Normalizer\\UsersExportGlobalControlGroupPostBodyNormalizer', 'Braze\\Model\\MessagesLiveActivityUpdatePostBody' => 'Braze\\Normalizer\\MessagesLiveActivityUpdatePostBodyNormalizer', 'Braze\\Model\\MessagesLiveActivityUpdatePostBodyContentState' => 'Braze\\Normalizer\\MessagesLiveActivityUpdatePostBodyContentStateNormalizer', 'Braze\\Model\\MessagesLiveActivityUpdatePostBodyNotification' => 'Braze\\Normalizer\\MessagesLiveActivityUpdatePostBodyNotificationNormalizer', 'Braze\\Model\\MessagesLiveActivityUpdatePostBodyNotificationAlert' => 'Braze\\Normalizer\\MessagesLiveActivityUpdatePostBodyNotificationAlertNormalizer', 'Braze\\Model\\MessagesScheduleDeletePostBody' => 'Braze\\Normalizer\\MessagesScheduleDeletePostBodyNormalizer', 'Braze\\Model\\CanvasTriggerScheduleDeletePostBody' => 'Braze\\Normalizer\\CanvasTriggerScheduleDeletePostBodyNormalizer', 'Braze\\Model\\CampaignsTriggerScheduleDeletePostBody' => 'Braze\\Normalizer\\CampaignsTriggerScheduleDeletePostBodyNormalizer', 'Braze\\Model\\MessagesScheduleCreatePostBody' => 'Braze\\Normalizer\\MessagesScheduleCreatePostBodyNormalizer', 'Braze\\Model\\MessagesScheduleCreatePostBodyUserAliases' => 'Braze\\Normalizer\\MessagesScheduleCreatePostBodyUserAliasesNormalizer', 'Braze\\Model\\MessagesScheduleCreatePostBodyAudience' => 'Braze\\Normalizer\\MessagesScheduleCreatePostBodyAudienceNormalizer', 'Braze\\Model\\MessagesScheduleCreatePostBodySchedule' => 'Braze\\Normalizer\\MessagesScheduleCreatePostBodyScheduleNormalizer', 'Braze\\Model\\MessagesScheduleCreatePostBodyMessages' => 'Braze\\Normalizer\\MessagesScheduleCreatePostBodyMessagesNormalizer', 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBody' => 'Braze\\Normalizer\\CampaignsTriggerScheduleCreatePostBodyNormalizer', 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBodyRecipientsItem' => 'Braze\\Normalizer\\CampaignsTriggerScheduleCreatePostBodyRecipientsItemNormalizer', 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBodyAudience' => 'Braze\\Normalizer\\CampaignsTriggerScheduleCreatePostBodyAudienceNormalizer', 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBodySchedule' => 'Braze\\Normalizer\\CampaignsTriggerScheduleCreatePostBodyScheduleNormalizer', 'Braze\\Model\\CanvasTriggerScheduleCreatePostBody' => 'Braze\\Normalizer\\CanvasTriggerScheduleCreatePostBodyNormalizer', 'Braze\\Model\\CanvasTriggerScheduleCreatePostBodyRecipientsItem' => 'Braze\\Normalizer\\CanvasTriggerScheduleCreatePostBodyRecipientsItemNormalizer', 'Braze\\Model\\CanvasTriggerScheduleCreatePostBodyAudience' => 'Braze\\Normalizer\\CanvasTriggerScheduleCreatePostBodyAudienceNormalizer', 'Braze\\Model\\CanvasTriggerScheduleCreatePostBodySchedule' => 'Braze\\Normalizer\\CanvasTriggerScheduleCreatePostBodyScheduleNormalizer', 'Braze\\Model\\MessagesScheduleUpdatePostBody' => 'Braze\\Normalizer\\MessagesScheduleUpdatePostBodyNormalizer', 'Braze\\Model\\MessagesScheduleUpdatePostBodySchedule' => 'Braze\\Normalizer\\MessagesScheduleUpdatePostBodyScheduleNormalizer', 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessages' => 'Braze\\Normalizer\\MessagesScheduleUpdatePostBodyMessagesNormalizer', 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesApplePush' => 'Braze\\Normalizer\\MessagesScheduleUpdatePostBodyMessagesApplePushNormalizer', 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesAndroidPush' => 'Braze\\Normalizer\\MessagesScheduleUpdatePostBodyMessagesAndroidPushNormalizer', 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesSms' => 'Braze\\Normalizer\\MessagesScheduleUpdatePostBodyMessagesSmsNormalizer', 'Braze\\Model\\CampaignsTriggerScheduleUpdatePostBody' => 'Braze\\Normalizer\\CampaignsTriggerScheduleUpdatePostBodyNormalizer', 'Braze\\Model\\CampaignsTriggerScheduleUpdatePostBodySchedule' => 'Braze\\Normalizer\\CampaignsTriggerScheduleUpdatePostBodyScheduleNormalizer', 'Braze\\Model\\CanvasTriggerScheduleUpdatePostBody' => 'Braze\\Normalizer\\CanvasTriggerScheduleUpdatePostBodyNormalizer', 'Braze\\Model\\CanvasTriggerScheduleUpdatePostBodySchedule' => 'Braze\\Normalizer\\CanvasTriggerScheduleUpdatePostBodyScheduleNormalizer', 'Braze\\Model\\SendsIdCreatePostBody' => 'Braze\\Normalizer\\SendsIdCreatePostBodyNormalizer', 'Braze\\Model\\MessagesSendPostBody' => 'Braze\\Normalizer\\MessagesSendPostBodyNormalizer', 'Braze\\Model\\MessagesSendPostBodyUserAliases' => 'Braze\\Normalizer\\MessagesSendPostBodyUserAliasesNormalizer', 'Braze\\Model\\MessagesSendPostBodyAudience' => 'Braze\\Normalizer\\MessagesSendPostBodyAudienceNormalizer', 'Braze\\Model\\MessagesSendPostBodyMessages' => 'Braze\\Normalizer\\MessagesSendPostBodyMessagesNormalizer', 'Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBody' => 'Braze\\Normalizer\\TransactionalV1CampaignsCampaignIdSendPostBodyNormalizer', 'Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBodyTriggerProperties' => 'Braze\\Normalizer\\TransactionalV1CampaignsCampaignIdSendPostBodyTriggerPropertiesNormalizer', 'Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBodyRecipientItem' => 'Braze\\Normalizer\\TransactionalV1CampaignsCampaignIdSendPostBodyRecipientItemNormalizer', 'Braze\\Model\\CampaignsTriggerSendPostBody' => 'Braze\\Normalizer\\CampaignsTriggerSendPostBodyNormalizer', 'Braze\\Model\\CampaignsTriggerSendPostBodyAudience' => 'Braze\\Normalizer\\CampaignsTriggerSendPostBodyAudienceNormalizer', 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItem' => 'Braze\\Normalizer\\CampaignsTriggerSendPostBodyRecipientsItemNormalizer', 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItemUserAlias' => 'Braze\\Normalizer\\CampaignsTriggerSendPostBodyRecipientsItemUserAliasNormalizer', 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItemAttributes' => 'Braze\\Normalizer\\CampaignsTriggerSendPostBodyRecipientsItemAttributesNormalizer', 'Braze\\Model\\CanvasTriggerSendPostBody' => 'Braze\\Normalizer\\CanvasTriggerSendPostBodyNormalizer', 'Braze\\Model\\CanvasTriggerSendPostBodyCanvasEntryProperties' => 'Braze\\Normalizer\\CanvasTriggerSendPostBodyCanvasEntryPropertiesNormalizer', 'Braze\\Model\\CanvasTriggerSendPostBodyAudience' => 'Braze\\Normalizer\\CanvasTriggerSendPostBodyAudienceNormalizer', 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItem' => 'Braze\\Normalizer\\CanvasTriggerSendPostBodyRecipientsItemNormalizer', 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItemUserAlias' => 'Braze\\Normalizer\\CanvasTriggerSendPostBodyRecipientsItemUserAliasNormalizer', 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItemAttributes' => 'Braze\\Normalizer\\CanvasTriggerSendPostBodyRecipientsItemAttributesNormalizer', 'Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBody' => 'Braze\\Normalizer\\PreferenceCenterV1PreferenceCenterExternalIDPutBodyNormalizer', 'Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBodyTriggerProperties' => 'Braze\\Normalizer\\PreferenceCenterV1PreferenceCenterExternalIDPutBodyTriggerPropertiesNormalizer', 'Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBodyRecipientItem' => 'Braze\\Normalizer\\PreferenceCenterV1PreferenceCenterExternalIDPutBodyRecipientItemNormalizer', 'Braze\\Model\\PreferenceCenterV1PostBody' => 'Braze\\Normalizer\\PreferenceCenterV1PostBodyNormalizer', 'Braze\\Model\\PreferenceCenterV1PostBodyOptions' => 'Braze\\Normalizer\\PreferenceCenterV1PostBodyOptionsNormalizer', 'Braze\\Model\\ScimV2UsersIdPutBody' => 'Braze\\Normalizer\\ScimV2UsersIdPutBodyNormalizer', 'Braze\\Model\\ScimV2UsersIdPutBodyName' => 'Braze\\Normalizer\\ScimV2UsersIdPutBodyNameNormalizer', 'Braze\\Model\\ScimV2UsersIdPutBodyPermissions' => 'Braze\\Normalizer\\ScimV2UsersIdPutBodyPermissionsNormalizer', 'Braze\\Model\\ScimV2UsersIdPutBodyPermissionsAppGroupItem' => 'Braze\\Normalizer\\ScimV2UsersIdPutBodyPermissionsAppGroupItemNormalizer', 'Braze\\Model\\ScimV2UsersIdPutBodyPermissionsAppGroupItemTeamItem' => 'Braze\\Normalizer\\ScimV2UsersIdPutBodyPermissionsAppGroupItemTeamItemNormalizer', 'Braze\\Model\\ScimV2UsersPostBody' => 'Braze\\Normalizer\\ScimV2UsersPostBodyNormalizer', 'Braze\\Model\\ScimV2UsersPostBodyName' => 'Braze\\Normalizer\\ScimV2UsersPostBodyNameNormalizer', 'Braze\\Model\\ScimV2UsersPostBodyPermissions' => 'Braze\\Normalizer\\ScimV2UsersPostBodyPermissionsNormalizer', 'Braze\\Model\\ScimV2UsersPostBodyPermissionsAppGroupItem' => 'Braze\\Normalizer\\ScimV2UsersPostBodyPermissionsAppGroupItemNormalizer', 'Braze\\Model\\ScimV2UsersPostBodyPermissionsAppGroupItemTeamItem' => 'Braze\\Normalizer\\ScimV2UsersPostBodyPermissionsAppGroupItemTeamItemNormalizer', 'Braze\\Model\\SmsInvalidPhoneNumbersRemovePostBody' => 'Braze\\Normalizer\\SmsInvalidPhoneNumbersRemovePostBodyNormalizer', 'Braze\\Model\\SubscriptionStatusSetPostBody' => 'Braze\\Normalizer\\SubscriptionStatusSetPostBodyNormalizer', 'Braze\\Model\\V2SubscriptionStatusSetPostBody' => 'Braze\\Normalizer\\V2SubscriptionStatusSetPostBodyNormalizer', 'Braze\\Model\\V2SubscriptionStatusSetPostBodySubscriptionGroupsItem' => 'Braze\\Normalizer\\V2SubscriptionStatusSetPostBodySubscriptionGroupsItemNormalizer', 'Braze\\Model\\ContentBlocksCreatePostBody' => 'Braze\\Normalizer\\ContentBlocksCreatePostBodyNormalizer', 'Braze\\Model\\ContentBlocksUpdatePostBody' => 'Braze\\Normalizer\\ContentBlocksUpdatePostBodyNormalizer', 'Braze\\Model\\TemplatesEmailCreatePostBody' => 'Braze\\Normalizer\\TemplatesEmailCreatePostBodyNormalizer', 'Braze\\Model\\UsersExternalIdsRenamePostBody' => 'Braze\\Normalizer\\UsersExternalIdsRenamePostBodyNormalizer', 'Braze\\Model\\UsersExternalIdsRenamePostBodyExternalIdRenamesItem' => 'Braze\\Normalizer\\UsersExternalIdsRenamePostBodyExternalIdRenamesItemNormalizer', 'Braze\\Model\\UsersExternalIdsRemovePostBody' => 'Braze\\Normalizer\\UsersExternalIdsRemovePostBodyNormalizer', 'Braze\\Model\\UsersAliasUpdatePostBody' => 'Braze\\Normalizer\\UsersAliasUpdatePostBodyNormalizer', 'Braze\\Model\\UsersAliasUpdatePostBodyAliasUpdatesItem' => 'Braze\\Normalizer\\UsersAliasUpdatePostBodyAliasUpdatesItemNormalizer', 'Braze\\Model\\UsersAliasNewPostBody' => 'Braze\\Normalizer\\UsersAliasNewPostBodyNormalizer', 'Braze\\Model\\UsersAliasNewPostBodyUserAliasesItem' => 'Braze\\Normalizer\\UsersAliasNewPostBodyUserAliasesItemNormalizer', 'Braze\\Model\\UsersDeletePostBody' => 'Braze\\Normalizer\\UsersDeletePostBodyNormalizer', 'Braze\\Model\\UsersDeletePostBodyUserAliasesItem' => 'Braze\\Normalizer\\UsersDeletePostBodyUserAliasesItemNormalizer', 'Braze\\Model\\UsersIdentifyPostBody' => 'Braze\\Normalizer\\UsersIdentifyPostBodyNormalizer', 'Braze\\Model\\UsersIdentifyPostBodyAliasesToIdentifyItem' => 'Braze\\Normalizer\\UsersIdentifyPostBodyAliasesToIdentifyItemNormalizer', 'Braze\\Model\\UsersIdentifyPostBodyAliasesToIdentifyItemUserAlias' => 'Braze\\Normalizer\\UsersIdentifyPostBodyAliasesToIdentifyItemUserAliasNormalizer', 'Braze\\Model\\UsersMergePostBody' => 'Braze\\Normalizer\\UsersMergePostBodyNormalizer', '\\Jane\\Component\\JsonSchemaRuntime\\Reference' => '\\Braze\\Runtime\\Normalizer\\ReferenceNormalizer']; - protected $normalizersCache = []; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class JaneObjectNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return array_key_exists($type, $this->normalizers); - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + protected $normalizers = ['Braze\\Model\\Error' => 'Braze\\Normalizer\\ErrorNormalizer', 'Braze\\Model\\TemplatesEmailUpdatePostBody' => 'Braze\\Normalizer\\TemplatesEmailUpdatePostBodyNormalizer', 'Braze\\Model\\UsersTrackPostBody' => 'Braze\\Normalizer\\UsersTrackPostBodyNormalizer', 'Braze\\Model\\CatalogsPostBody' => 'Braze\\Normalizer\\CatalogsPostBodyNormalizer', 'Braze\\Model\\CatalogsPostBodyCatalogsItem' => 'Braze\\Normalizer\\CatalogsPostBodyCatalogsItemNormalizer', 'Braze\\Model\\CatalogsPostBodyCatalogsItemFieldsItem' => 'Braze\\Normalizer\\CatalogsPostBodyCatalogsItemFieldsItemNormalizer', 'Braze\\Model\\CatalogsCatalogNameItemsPatchBody' => 'Braze\\Normalizer\\CatalogsCatalogNameItemsPatchBodyNormalizer', 'Braze\\Model\\CatalogsCatalogNameItemsPatchBodyItemsItem' => 'Braze\\Normalizer\\CatalogsCatalogNameItemsPatchBodyItemsItemNormalizer', 'Braze\\Model\\CatalogsCatalogNameItemsPostBody' => 'Braze\\Normalizer\\CatalogsCatalogNameItemsPostBodyNormalizer', 'Braze\\Model\\CatalogsCatalogNameItemsPutBody' => 'Braze\\Normalizer\\CatalogsCatalogNameItemsPutBodyNormalizer', 'Braze\\Model\\CatalogsCatalogNameItemsItemIdPatchBody' => 'Braze\\Normalizer\\CatalogsCatalogNameItemsItemIdPatchBodyNormalizer', 'Braze\\Model\\CatalogsCatalogNameItemsItemIdPostBody' => 'Braze\\Normalizer\\CatalogsCatalogNameItemsItemIdPostBodyNormalizer', 'Braze\\Model\\CatalogsCatalogNameItemsItemIdPutBody' => 'Braze\\Normalizer\\CatalogsCatalogNameItemsItemIdPutBodyNormalizer', 'Braze\\Model\\EmailStatusPostBody' => 'Braze\\Normalizer\\EmailStatusPostBodyNormalizer', 'Braze\\Model\\EmailBounceRemovePostBody' => 'Braze\\Normalizer\\EmailBounceRemovePostBodyNormalizer', 'Braze\\Model\\EmailSpamRemovePostBody' => 'Braze\\Normalizer\\EmailSpamRemovePostBodyNormalizer', 'Braze\\Model\\EmailBlocklistPostBody' => 'Braze\\Normalizer\\EmailBlocklistPostBodyNormalizer', 'Braze\\Model\\EmailBlacklistPostBody' => 'Braze\\Normalizer\\EmailBlacklistPostBodyNormalizer', 'Braze\\Model\\UsersExportIdsPostBody' => 'Braze\\Normalizer\\UsersExportIdsPostBodyNormalizer', 'Braze\\Model\\UsersExportIdsPostBodyUserAliasesItem' => 'Braze\\Normalizer\\UsersExportIdsPostBodyUserAliasesItemNormalizer', 'Braze\\Model\\UsersExportSegmentPostBody' => 'Braze\\Normalizer\\UsersExportSegmentPostBodyNormalizer', 'Braze\\Model\\UsersExportGlobalControlGroupPostBody' => 'Braze\\Normalizer\\UsersExportGlobalControlGroupPostBodyNormalizer', 'Braze\\Model\\MessagesLiveActivityUpdatePostBody' => 'Braze\\Normalizer\\MessagesLiveActivityUpdatePostBodyNormalizer', 'Braze\\Model\\MessagesLiveActivityUpdatePostBodyContentState' => 'Braze\\Normalizer\\MessagesLiveActivityUpdatePostBodyContentStateNormalizer', 'Braze\\Model\\MessagesLiveActivityUpdatePostBodyNotification' => 'Braze\\Normalizer\\MessagesLiveActivityUpdatePostBodyNotificationNormalizer', 'Braze\\Model\\MessagesLiveActivityUpdatePostBodyNotificationAlert' => 'Braze\\Normalizer\\MessagesLiveActivityUpdatePostBodyNotificationAlertNormalizer', 'Braze\\Model\\MessagesScheduleDeletePostBody' => 'Braze\\Normalizer\\MessagesScheduleDeletePostBodyNormalizer', 'Braze\\Model\\CanvasTriggerScheduleDeletePostBody' => 'Braze\\Normalizer\\CanvasTriggerScheduleDeletePostBodyNormalizer', 'Braze\\Model\\CampaignsTriggerScheduleDeletePostBody' => 'Braze\\Normalizer\\CampaignsTriggerScheduleDeletePostBodyNormalizer', 'Braze\\Model\\MessagesScheduleCreatePostBody' => 'Braze\\Normalizer\\MessagesScheduleCreatePostBodyNormalizer', 'Braze\\Model\\MessagesScheduleCreatePostBodyUserAliases' => 'Braze\\Normalizer\\MessagesScheduleCreatePostBodyUserAliasesNormalizer', 'Braze\\Model\\MessagesScheduleCreatePostBodyAudience' => 'Braze\\Normalizer\\MessagesScheduleCreatePostBodyAudienceNormalizer', 'Braze\\Model\\MessagesScheduleCreatePostBodySchedule' => 'Braze\\Normalizer\\MessagesScheduleCreatePostBodyScheduleNormalizer', 'Braze\\Model\\MessagesScheduleCreatePostBodyMessages' => 'Braze\\Normalizer\\MessagesScheduleCreatePostBodyMessagesNormalizer', 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBody' => 'Braze\\Normalizer\\CampaignsTriggerScheduleCreatePostBodyNormalizer', 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBodyRecipientsItem' => 'Braze\\Normalizer\\CampaignsTriggerScheduleCreatePostBodyRecipientsItemNormalizer', 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBodyAudience' => 'Braze\\Normalizer\\CampaignsTriggerScheduleCreatePostBodyAudienceNormalizer', 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBodySchedule' => 'Braze\\Normalizer\\CampaignsTriggerScheduleCreatePostBodyScheduleNormalizer', 'Braze\\Model\\CanvasTriggerScheduleCreatePostBody' => 'Braze\\Normalizer\\CanvasTriggerScheduleCreatePostBodyNormalizer', 'Braze\\Model\\CanvasTriggerScheduleCreatePostBodyRecipientsItem' => 'Braze\\Normalizer\\CanvasTriggerScheduleCreatePostBodyRecipientsItemNormalizer', 'Braze\\Model\\CanvasTriggerScheduleCreatePostBodyAudience' => 'Braze\\Normalizer\\CanvasTriggerScheduleCreatePostBodyAudienceNormalizer', 'Braze\\Model\\CanvasTriggerScheduleCreatePostBodySchedule' => 'Braze\\Normalizer\\CanvasTriggerScheduleCreatePostBodyScheduleNormalizer', 'Braze\\Model\\MessagesScheduleUpdatePostBody' => 'Braze\\Normalizer\\MessagesScheduleUpdatePostBodyNormalizer', 'Braze\\Model\\MessagesScheduleUpdatePostBodySchedule' => 'Braze\\Normalizer\\MessagesScheduleUpdatePostBodyScheduleNormalizer', 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessages' => 'Braze\\Normalizer\\MessagesScheduleUpdatePostBodyMessagesNormalizer', 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesApplePush' => 'Braze\\Normalizer\\MessagesScheduleUpdatePostBodyMessagesApplePushNormalizer', 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesAndroidPush' => 'Braze\\Normalizer\\MessagesScheduleUpdatePostBodyMessagesAndroidPushNormalizer', 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesSms' => 'Braze\\Normalizer\\MessagesScheduleUpdatePostBodyMessagesSmsNormalizer', 'Braze\\Model\\CampaignsTriggerScheduleUpdatePostBody' => 'Braze\\Normalizer\\CampaignsTriggerScheduleUpdatePostBodyNormalizer', 'Braze\\Model\\CampaignsTriggerScheduleUpdatePostBodySchedule' => 'Braze\\Normalizer\\CampaignsTriggerScheduleUpdatePostBodyScheduleNormalizer', 'Braze\\Model\\CanvasTriggerScheduleUpdatePostBody' => 'Braze\\Normalizer\\CanvasTriggerScheduleUpdatePostBodyNormalizer', 'Braze\\Model\\CanvasTriggerScheduleUpdatePostBodySchedule' => 'Braze\\Normalizer\\CanvasTriggerScheduleUpdatePostBodyScheduleNormalizer', 'Braze\\Model\\SendsIdCreatePostBody' => 'Braze\\Normalizer\\SendsIdCreatePostBodyNormalizer', 'Braze\\Model\\MessagesSendPostBody' => 'Braze\\Normalizer\\MessagesSendPostBodyNormalizer', 'Braze\\Model\\MessagesSendPostBodyUserAliases' => 'Braze\\Normalizer\\MessagesSendPostBodyUserAliasesNormalizer', 'Braze\\Model\\MessagesSendPostBodyAudience' => 'Braze\\Normalizer\\MessagesSendPostBodyAudienceNormalizer', 'Braze\\Model\\MessagesSendPostBodyMessages' => 'Braze\\Normalizer\\MessagesSendPostBodyMessagesNormalizer', 'Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBody' => 'Braze\\Normalizer\\TransactionalV1CampaignsCampaignIdSendPostBodyNormalizer', 'Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBodyTriggerProperties' => 'Braze\\Normalizer\\TransactionalV1CampaignsCampaignIdSendPostBodyTriggerPropertiesNormalizer', 'Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBodyRecipientItem' => 'Braze\\Normalizer\\TransactionalV1CampaignsCampaignIdSendPostBodyRecipientItemNormalizer', 'Braze\\Model\\CampaignsTriggerSendPostBody' => 'Braze\\Normalizer\\CampaignsTriggerSendPostBodyNormalizer', 'Braze\\Model\\CampaignsTriggerSendPostBodyAudience' => 'Braze\\Normalizer\\CampaignsTriggerSendPostBodyAudienceNormalizer', 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItem' => 'Braze\\Normalizer\\CampaignsTriggerSendPostBodyRecipientsItemNormalizer', 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItemUserAlias' => 'Braze\\Normalizer\\CampaignsTriggerSendPostBodyRecipientsItemUserAliasNormalizer', 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItemAttributes' => 'Braze\\Normalizer\\CampaignsTriggerSendPostBodyRecipientsItemAttributesNormalizer', 'Braze\\Model\\CanvasTriggerSendPostBody' => 'Braze\\Normalizer\\CanvasTriggerSendPostBodyNormalizer', 'Braze\\Model\\CanvasTriggerSendPostBodyCanvasEntryProperties' => 'Braze\\Normalizer\\CanvasTriggerSendPostBodyCanvasEntryPropertiesNormalizer', 'Braze\\Model\\CanvasTriggerSendPostBodyAudience' => 'Braze\\Normalizer\\CanvasTriggerSendPostBodyAudienceNormalizer', 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItem' => 'Braze\\Normalizer\\CanvasTriggerSendPostBodyRecipientsItemNormalizer', 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItemUserAlias' => 'Braze\\Normalizer\\CanvasTriggerSendPostBodyRecipientsItemUserAliasNormalizer', 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItemAttributes' => 'Braze\\Normalizer\\CanvasTriggerSendPostBodyRecipientsItemAttributesNormalizer', 'Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBody' => 'Braze\\Normalizer\\PreferenceCenterV1PreferenceCenterExternalIDPutBodyNormalizer', 'Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBodyTriggerProperties' => 'Braze\\Normalizer\\PreferenceCenterV1PreferenceCenterExternalIDPutBodyTriggerPropertiesNormalizer', 'Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBodyRecipientItem' => 'Braze\\Normalizer\\PreferenceCenterV1PreferenceCenterExternalIDPutBodyRecipientItemNormalizer', 'Braze\\Model\\PreferenceCenterV1PostBody' => 'Braze\\Normalizer\\PreferenceCenterV1PostBodyNormalizer', 'Braze\\Model\\PreferenceCenterV1PostBodyOptions' => 'Braze\\Normalizer\\PreferenceCenterV1PostBodyOptionsNormalizer', 'Braze\\Model\\ScimV2UsersIdPutBody' => 'Braze\\Normalizer\\ScimV2UsersIdPutBodyNormalizer', 'Braze\\Model\\ScimV2UsersIdPutBodyName' => 'Braze\\Normalizer\\ScimV2UsersIdPutBodyNameNormalizer', 'Braze\\Model\\ScimV2UsersIdPutBodyPermissions' => 'Braze\\Normalizer\\ScimV2UsersIdPutBodyPermissionsNormalizer', 'Braze\\Model\\ScimV2UsersIdPutBodyPermissionsAppGroupItem' => 'Braze\\Normalizer\\ScimV2UsersIdPutBodyPermissionsAppGroupItemNormalizer', 'Braze\\Model\\ScimV2UsersIdPutBodyPermissionsAppGroupItemTeamItem' => 'Braze\\Normalizer\\ScimV2UsersIdPutBodyPermissionsAppGroupItemTeamItemNormalizer', 'Braze\\Model\\ScimV2UsersPostBody' => 'Braze\\Normalizer\\ScimV2UsersPostBodyNormalizer', 'Braze\\Model\\ScimV2UsersPostBodyName' => 'Braze\\Normalizer\\ScimV2UsersPostBodyNameNormalizer', 'Braze\\Model\\ScimV2UsersPostBodyPermissions' => 'Braze\\Normalizer\\ScimV2UsersPostBodyPermissionsNormalizer', 'Braze\\Model\\ScimV2UsersPostBodyPermissionsAppGroupItem' => 'Braze\\Normalizer\\ScimV2UsersPostBodyPermissionsAppGroupItemNormalizer', 'Braze\\Model\\ScimV2UsersPostBodyPermissionsAppGroupItemTeamItem' => 'Braze\\Normalizer\\ScimV2UsersPostBodyPermissionsAppGroupItemTeamItemNormalizer', 'Braze\\Model\\SmsInvalidPhoneNumbersRemovePostBody' => 'Braze\\Normalizer\\SmsInvalidPhoneNumbersRemovePostBodyNormalizer', 'Braze\\Model\\SubscriptionStatusSetPostBody' => 'Braze\\Normalizer\\SubscriptionStatusSetPostBodyNormalizer', 'Braze\\Model\\V2SubscriptionStatusSetPostBody' => 'Braze\\Normalizer\\V2SubscriptionStatusSetPostBodyNormalizer', 'Braze\\Model\\V2SubscriptionStatusSetPostBodySubscriptionGroupsItem' => 'Braze\\Normalizer\\V2SubscriptionStatusSetPostBodySubscriptionGroupsItemNormalizer', 'Braze\\Model\\ContentBlocksCreatePostBody' => 'Braze\\Normalizer\\ContentBlocksCreatePostBodyNormalizer', 'Braze\\Model\\ContentBlocksUpdatePostBody' => 'Braze\\Normalizer\\ContentBlocksUpdatePostBodyNormalizer', 'Braze\\Model\\TemplatesEmailCreatePostBody' => 'Braze\\Normalizer\\TemplatesEmailCreatePostBodyNormalizer', 'Braze\\Model\\UsersExternalIdsRenamePostBody' => 'Braze\\Normalizer\\UsersExternalIdsRenamePostBodyNormalizer', 'Braze\\Model\\UsersExternalIdsRenamePostBodyExternalIdRenamesItem' => 'Braze\\Normalizer\\UsersExternalIdsRenamePostBodyExternalIdRenamesItemNormalizer', 'Braze\\Model\\UsersExternalIdsRemovePostBody' => 'Braze\\Normalizer\\UsersExternalIdsRemovePostBodyNormalizer', 'Braze\\Model\\UsersAliasUpdatePostBody' => 'Braze\\Normalizer\\UsersAliasUpdatePostBodyNormalizer', 'Braze\\Model\\UsersAliasUpdatePostBodyAliasUpdatesItem' => 'Braze\\Normalizer\\UsersAliasUpdatePostBodyAliasUpdatesItemNormalizer', 'Braze\\Model\\UsersAliasNewPostBody' => 'Braze\\Normalizer\\UsersAliasNewPostBodyNormalizer', 'Braze\\Model\\UsersAliasNewPostBodyUserAliasesItem' => 'Braze\\Normalizer\\UsersAliasNewPostBodyUserAliasesItemNormalizer', 'Braze\\Model\\UsersDeletePostBody' => 'Braze\\Normalizer\\UsersDeletePostBodyNormalizer', 'Braze\\Model\\UsersDeletePostBodyUserAliasesItem' => 'Braze\\Normalizer\\UsersDeletePostBodyUserAliasesItemNormalizer', 'Braze\\Model\\UsersIdentifyPostBody' => 'Braze\\Normalizer\\UsersIdentifyPostBodyNormalizer', 'Braze\\Model\\UsersIdentifyPostBodyAliasesToIdentifyItem' => 'Braze\\Normalizer\\UsersIdentifyPostBodyAliasesToIdentifyItemNormalizer', 'Braze\\Model\\UsersIdentifyPostBodyAliasesToIdentifyItemUserAlias' => 'Braze\\Normalizer\\UsersIdentifyPostBodyAliasesToIdentifyItemUserAliasNormalizer', 'Braze\\Model\\UsersMergePostBody' => 'Braze\\Normalizer\\UsersMergePostBodyNormalizer', '\\Jane\\Component\\JsonSchemaRuntime\\Reference' => '\\Braze\\Runtime\\Normalizer\\ReferenceNormalizer']; + protected $normalizersCache = []; - public function supportsNormalization($data, $format = null, array $context = []): bool - { - return is_object($data) && array_key_exists(get_class($data), $this->normalizers); - } + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool + { + return array_key_exists($type, $this->normalizers); + } - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) - { - $normalizerClass = $this->normalizers[get_class($object)]; - $normalizer = $this->getNormalizer($normalizerClass); + public function supportsNormalization($data, $format = null, array $context = []): bool + { + return is_object($data) && array_key_exists(get_class($data), $this->normalizers); + } - return $normalizer->normalize($object, $format, $context); - } + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $normalizerClass = $this->normalizers[get_class($object)]; + $normalizer = $this->getNormalizer($normalizerClass); - public function denormalize($data, $class, $format = null, array $context = []) - { - $denormalizerClass = $this->normalizers[$class]; - $denormalizer = $this->getNormalizer($denormalizerClass); + return $normalizer->normalize($object, $format, $context); + } - return $denormalizer->denormalize($data, $class, $format, $context); - } + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + $denormalizerClass = $this->normalizers[$type]; + $denormalizer = $this->getNormalizer($denormalizerClass); - private function getNormalizer(string $normalizerClass) - { - return $this->normalizersCache[$normalizerClass] ?? $this->initNormalizer($normalizerClass); - } + return $denormalizer->denormalize($data, $type, $format, $context); + } - private function initNormalizer(string $normalizerClass) - { - $normalizer = new $normalizerClass(); - $normalizer->setNormalizer($this->normalizer); - $normalizer->setDenormalizer($this->denormalizer); - $this->normalizersCache[$normalizerClass] = $normalizer; + private function getNormalizer(string $normalizerClass) + { + return $this->normalizersCache[$normalizerClass] ?? $this->initNormalizer($normalizerClass); + } - return $normalizer; - } + private function initNormalizer(string $normalizerClass) + { + $normalizer = new $normalizerClass(); + $normalizer->setNormalizer($this->normalizer); + $normalizer->setDenormalizer($this->denormalizer); + $this->normalizersCache[$normalizerClass] = $normalizer; - public function getSupportedTypes(string $format = null): array + return $normalizer; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\Error' => false, 'Braze\\Model\\TemplatesEmailUpdatePostBody' => false, 'Braze\\Model\\UsersTrackPostBody' => false, 'Braze\\Model\\CatalogsPostBody' => false, 'Braze\\Model\\CatalogsPostBodyCatalogsItem' => false, 'Braze\\Model\\CatalogsPostBodyCatalogsItemFieldsItem' => false, 'Braze\\Model\\CatalogsCatalogNameItemsPatchBody' => false, 'Braze\\Model\\CatalogsCatalogNameItemsPatchBodyItemsItem' => false, 'Braze\\Model\\CatalogsCatalogNameItemsPostBody' => false, 'Braze\\Model\\CatalogsCatalogNameItemsPutBody' => false, 'Braze\\Model\\CatalogsCatalogNameItemsItemIdPatchBody' => false, 'Braze\\Model\\CatalogsCatalogNameItemsItemIdPostBody' => false, 'Braze\\Model\\CatalogsCatalogNameItemsItemIdPutBody' => false, 'Braze\\Model\\EmailStatusPostBody' => false, 'Braze\\Model\\EmailBounceRemovePostBody' => false, 'Braze\\Model\\EmailSpamRemovePostBody' => false, 'Braze\\Model\\EmailBlocklistPostBody' => false, 'Braze\\Model\\EmailBlacklistPostBody' => false, 'Braze\\Model\\UsersExportIdsPostBody' => false, 'Braze\\Model\\UsersExportIdsPostBodyUserAliasesItem' => false, 'Braze\\Model\\UsersExportSegmentPostBody' => false, 'Braze\\Model\\UsersExportGlobalControlGroupPostBody' => false, 'Braze\\Model\\MessagesLiveActivityUpdatePostBody' => false, 'Braze\\Model\\MessagesLiveActivityUpdatePostBodyContentState' => false, 'Braze\\Model\\MessagesLiveActivityUpdatePostBodyNotification' => false, 'Braze\\Model\\MessagesLiveActivityUpdatePostBodyNotificationAlert' => false, 'Braze\\Model\\MessagesScheduleDeletePostBody' => false, 'Braze\\Model\\CanvasTriggerScheduleDeletePostBody' => false, 'Braze\\Model\\CampaignsTriggerScheduleDeletePostBody' => false, 'Braze\\Model\\MessagesScheduleCreatePostBody' => false, 'Braze\\Model\\MessagesScheduleCreatePostBodyUserAliases' => false, 'Braze\\Model\\MessagesScheduleCreatePostBodyAudience' => false, 'Braze\\Model\\MessagesScheduleCreatePostBodySchedule' => false, 'Braze\\Model\\MessagesScheduleCreatePostBodyMessages' => false, 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBody' => false, 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBodyRecipientsItem' => false, 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBodyAudience' => false, 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBodySchedule' => false, 'Braze\\Model\\CanvasTriggerScheduleCreatePostBody' => false, 'Braze\\Model\\CanvasTriggerScheduleCreatePostBodyRecipientsItem' => false, 'Braze\\Model\\CanvasTriggerScheduleCreatePostBodyAudience' => false, 'Braze\\Model\\CanvasTriggerScheduleCreatePostBodySchedule' => false, 'Braze\\Model\\MessagesScheduleUpdatePostBody' => false, 'Braze\\Model\\MessagesScheduleUpdatePostBodySchedule' => false, 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessages' => false, 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesApplePush' => false, 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesAndroidPush' => false, 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesSms' => false, 'Braze\\Model\\CampaignsTriggerScheduleUpdatePostBody' => false, 'Braze\\Model\\CampaignsTriggerScheduleUpdatePostBodySchedule' => false, 'Braze\\Model\\CanvasTriggerScheduleUpdatePostBody' => false, 'Braze\\Model\\CanvasTriggerScheduleUpdatePostBodySchedule' => false, 'Braze\\Model\\SendsIdCreatePostBody' => false, 'Braze\\Model\\MessagesSendPostBody' => false, 'Braze\\Model\\MessagesSendPostBodyUserAliases' => false, 'Braze\\Model\\MessagesSendPostBodyAudience' => false, 'Braze\\Model\\MessagesSendPostBodyMessages' => false, 'Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBody' => false, 'Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBodyTriggerProperties' => false, 'Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBodyRecipientItem' => false, 'Braze\\Model\\CampaignsTriggerSendPostBody' => false, 'Braze\\Model\\CampaignsTriggerSendPostBodyAudience' => false, 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItem' => false, 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItemUserAlias' => false, 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItemAttributes' => false, 'Braze\\Model\\CanvasTriggerSendPostBody' => false, 'Braze\\Model\\CanvasTriggerSendPostBodyCanvasEntryProperties' => false, 'Braze\\Model\\CanvasTriggerSendPostBodyAudience' => false, 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItem' => false, 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItemUserAlias' => false, 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItemAttributes' => false, 'Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBody' => false, 'Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBodyTriggerProperties' => false, 'Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBodyRecipientItem' => false, 'Braze\\Model\\PreferenceCenterV1PostBody' => false, 'Braze\\Model\\PreferenceCenterV1PostBodyOptions' => false, 'Braze\\Model\\ScimV2UsersIdPutBody' => false, 'Braze\\Model\\ScimV2UsersIdPutBodyName' => false, 'Braze\\Model\\ScimV2UsersIdPutBodyPermissions' => false, 'Braze\\Model\\ScimV2UsersIdPutBodyPermissionsAppGroupItem' => false, 'Braze\\Model\\ScimV2UsersIdPutBodyPermissionsAppGroupItemTeamItem' => false, 'Braze\\Model\\ScimV2UsersPostBody' => false, 'Braze\\Model\\ScimV2UsersPostBodyName' => false, 'Braze\\Model\\ScimV2UsersPostBodyPermissions' => false, 'Braze\\Model\\ScimV2UsersPostBodyPermissionsAppGroupItem' => false, 'Braze\\Model\\ScimV2UsersPostBodyPermissionsAppGroupItemTeamItem' => false, 'Braze\\Model\\SmsInvalidPhoneNumbersRemovePostBody' => false, 'Braze\\Model\\SubscriptionStatusSetPostBody' => false, 'Braze\\Model\\V2SubscriptionStatusSetPostBody' => false, 'Braze\\Model\\V2SubscriptionStatusSetPostBodySubscriptionGroupsItem' => false, 'Braze\\Model\\ContentBlocksCreatePostBody' => false, 'Braze\\Model\\ContentBlocksUpdatePostBody' => false, 'Braze\\Model\\TemplatesEmailCreatePostBody' => false, 'Braze\\Model\\UsersExternalIdsRenamePostBody' => false, 'Braze\\Model\\UsersExternalIdsRenamePostBodyExternalIdRenamesItem' => false, 'Braze\\Model\\UsersExternalIdsRemovePostBody' => false, 'Braze\\Model\\UsersAliasUpdatePostBody' => false, 'Braze\\Model\\UsersAliasUpdatePostBodyAliasUpdatesItem' => false, 'Braze\\Model\\UsersAliasNewPostBody' => false, 'Braze\\Model\\UsersAliasNewPostBodyUserAliasesItem' => false, 'Braze\\Model\\UsersDeletePostBody' => false, 'Braze\\Model\\UsersDeletePostBodyUserAliasesItem' => false, 'Braze\\Model\\UsersIdentifyPostBody' => false, 'Braze\\Model\\UsersIdentifyPostBodyAliasesToIdentifyItem' => false, 'Braze\\Model\\UsersIdentifyPostBodyAliasesToIdentifyItemUserAlias' => false, 'Braze\\Model\\UsersMergePostBody' => false, '\\Jane\\Component\\JsonSchemaRuntime\\Reference' => false]; + } + } +} else { + class JaneObjectNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return ['Braze\\Model\\Error' => false, 'Braze\\Model\\TemplatesEmailUpdatePostBody' => false, 'Braze\\Model\\UsersTrackPostBody' => false, 'Braze\\Model\\CatalogsPostBody' => false, 'Braze\\Model\\CatalogsPostBodyCatalogsItem' => false, 'Braze\\Model\\CatalogsPostBodyCatalogsItemFieldsItem' => false, 'Braze\\Model\\CatalogsCatalogNameItemsPatchBody' => false, 'Braze\\Model\\CatalogsCatalogNameItemsPatchBodyItemsItem' => false, 'Braze\\Model\\CatalogsCatalogNameItemsPostBody' => false, 'Braze\\Model\\CatalogsCatalogNameItemsPutBody' => false, 'Braze\\Model\\CatalogsCatalogNameItemsItemIdPatchBody' => false, 'Braze\\Model\\CatalogsCatalogNameItemsItemIdPostBody' => false, 'Braze\\Model\\CatalogsCatalogNameItemsItemIdPutBody' => false, 'Braze\\Model\\EmailStatusPostBody' => false, 'Braze\\Model\\EmailBounceRemovePostBody' => false, 'Braze\\Model\\EmailSpamRemovePostBody' => false, 'Braze\\Model\\EmailBlocklistPostBody' => false, 'Braze\\Model\\EmailBlacklistPostBody' => false, 'Braze\\Model\\UsersExportIdsPostBody' => false, 'Braze\\Model\\UsersExportIdsPostBodyUserAliasesItem' => false, 'Braze\\Model\\UsersExportSegmentPostBody' => false, 'Braze\\Model\\UsersExportGlobalControlGroupPostBody' => false, 'Braze\\Model\\MessagesLiveActivityUpdatePostBody' => false, 'Braze\\Model\\MessagesLiveActivityUpdatePostBodyContentState' => false, 'Braze\\Model\\MessagesLiveActivityUpdatePostBodyNotification' => false, 'Braze\\Model\\MessagesLiveActivityUpdatePostBodyNotificationAlert' => false, 'Braze\\Model\\MessagesScheduleDeletePostBody' => false, 'Braze\\Model\\CanvasTriggerScheduleDeletePostBody' => false, 'Braze\\Model\\CampaignsTriggerScheduleDeletePostBody' => false, 'Braze\\Model\\MessagesScheduleCreatePostBody' => false, 'Braze\\Model\\MessagesScheduleCreatePostBodyUserAliases' => false, 'Braze\\Model\\MessagesScheduleCreatePostBodyAudience' => false, 'Braze\\Model\\MessagesScheduleCreatePostBodySchedule' => false, 'Braze\\Model\\MessagesScheduleCreatePostBodyMessages' => false, 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBody' => false, 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBodyRecipientsItem' => false, 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBodyAudience' => false, 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBodySchedule' => false, 'Braze\\Model\\CanvasTriggerScheduleCreatePostBody' => false, 'Braze\\Model\\CanvasTriggerScheduleCreatePostBodyRecipientsItem' => false, 'Braze\\Model\\CanvasTriggerScheduleCreatePostBodyAudience' => false, 'Braze\\Model\\CanvasTriggerScheduleCreatePostBodySchedule' => false, 'Braze\\Model\\MessagesScheduleUpdatePostBody' => false, 'Braze\\Model\\MessagesScheduleUpdatePostBodySchedule' => false, 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessages' => false, 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesApplePush' => false, 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesAndroidPush' => false, 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesSms' => false, 'Braze\\Model\\CampaignsTriggerScheduleUpdatePostBody' => false, 'Braze\\Model\\CampaignsTriggerScheduleUpdatePostBodySchedule' => false, 'Braze\\Model\\CanvasTriggerScheduleUpdatePostBody' => false, 'Braze\\Model\\CanvasTriggerScheduleUpdatePostBodySchedule' => false, 'Braze\\Model\\SendsIdCreatePostBody' => false, 'Braze\\Model\\MessagesSendPostBody' => false, 'Braze\\Model\\MessagesSendPostBodyUserAliases' => false, 'Braze\\Model\\MessagesSendPostBodyAudience' => false, 'Braze\\Model\\MessagesSendPostBodyMessages' => false, 'Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBody' => false, 'Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBodyTriggerProperties' => false, 'Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBodyRecipientItem' => false, 'Braze\\Model\\CampaignsTriggerSendPostBody' => false, 'Braze\\Model\\CampaignsTriggerSendPostBodyAudience' => false, 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItem' => false, 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItemUserAlias' => false, 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItemAttributes' => false, 'Braze\\Model\\CanvasTriggerSendPostBody' => false, 'Braze\\Model\\CanvasTriggerSendPostBodyCanvasEntryProperties' => false, 'Braze\\Model\\CanvasTriggerSendPostBodyAudience' => false, 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItem' => false, 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItemUserAlias' => false, 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItemAttributes' => false, 'Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBody' => false, 'Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBodyTriggerProperties' => false, 'Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBodyRecipientItem' => false, 'Braze\\Model\\PreferenceCenterV1PostBody' => false, 'Braze\\Model\\PreferenceCenterV1PostBodyOptions' => false, 'Braze\\Model\\ScimV2UsersIdPutBody' => false, 'Braze\\Model\\ScimV2UsersIdPutBodyName' => false, 'Braze\\Model\\ScimV2UsersIdPutBodyPermissions' => false, 'Braze\\Model\\ScimV2UsersIdPutBodyPermissionsAppGroupItem' => false, 'Braze\\Model\\ScimV2UsersIdPutBodyPermissionsAppGroupItemTeamItem' => false, 'Braze\\Model\\ScimV2UsersPostBody' => false, 'Braze\\Model\\ScimV2UsersPostBodyName' => false, 'Braze\\Model\\ScimV2UsersPostBodyPermissions' => false, 'Braze\\Model\\ScimV2UsersPostBodyPermissionsAppGroupItem' => false, 'Braze\\Model\\ScimV2UsersPostBodyPermissionsAppGroupItemTeamItem' => false, 'Braze\\Model\\SmsInvalidPhoneNumbersRemovePostBody' => false, 'Braze\\Model\\SubscriptionStatusSetPostBody' => false, 'Braze\\Model\\V2SubscriptionStatusSetPostBody' => false, 'Braze\\Model\\V2SubscriptionStatusSetPostBodySubscriptionGroupsItem' => false, 'Braze\\Model\\ContentBlocksCreatePostBody' => false, 'Braze\\Model\\ContentBlocksUpdatePostBody' => false, 'Braze\\Model\\TemplatesEmailCreatePostBody' => false, 'Braze\\Model\\UsersExternalIdsRenamePostBody' => false, 'Braze\\Model\\UsersExternalIdsRenamePostBodyExternalIdRenamesItem' => false, 'Braze\\Model\\UsersExternalIdsRemovePostBody' => false, 'Braze\\Model\\UsersAliasUpdatePostBody' => false, 'Braze\\Model\\UsersAliasUpdatePostBodyAliasUpdatesItem' => false, 'Braze\\Model\\UsersAliasNewPostBody' => false, 'Braze\\Model\\UsersAliasNewPostBodyUserAliasesItem' => false, 'Braze\\Model\\UsersDeletePostBody' => false, 'Braze\\Model\\UsersDeletePostBodyUserAliasesItem' => false, 'Braze\\Model\\UsersIdentifyPostBody' => false, 'Braze\\Model\\UsersIdentifyPostBodyAliasesToIdentifyItem' => false, 'Braze\\Model\\UsersIdentifyPostBodyAliasesToIdentifyItemUserAlias' => false, 'Braze\\Model\\UsersMergePostBody' => false, '\\Jane\\Component\\JsonSchemaRuntime\\Reference' => false]; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + protected $normalizers = ['Braze\\Model\\Error' => 'Braze\\Normalizer\\ErrorNormalizer', 'Braze\\Model\\TemplatesEmailUpdatePostBody' => 'Braze\\Normalizer\\TemplatesEmailUpdatePostBodyNormalizer', 'Braze\\Model\\UsersTrackPostBody' => 'Braze\\Normalizer\\UsersTrackPostBodyNormalizer', 'Braze\\Model\\CatalogsPostBody' => 'Braze\\Normalizer\\CatalogsPostBodyNormalizer', 'Braze\\Model\\CatalogsPostBodyCatalogsItem' => 'Braze\\Normalizer\\CatalogsPostBodyCatalogsItemNormalizer', 'Braze\\Model\\CatalogsPostBodyCatalogsItemFieldsItem' => 'Braze\\Normalizer\\CatalogsPostBodyCatalogsItemFieldsItemNormalizer', 'Braze\\Model\\CatalogsCatalogNameItemsPatchBody' => 'Braze\\Normalizer\\CatalogsCatalogNameItemsPatchBodyNormalizer', 'Braze\\Model\\CatalogsCatalogNameItemsPatchBodyItemsItem' => 'Braze\\Normalizer\\CatalogsCatalogNameItemsPatchBodyItemsItemNormalizer', 'Braze\\Model\\CatalogsCatalogNameItemsPostBody' => 'Braze\\Normalizer\\CatalogsCatalogNameItemsPostBodyNormalizer', 'Braze\\Model\\CatalogsCatalogNameItemsPutBody' => 'Braze\\Normalizer\\CatalogsCatalogNameItemsPutBodyNormalizer', 'Braze\\Model\\CatalogsCatalogNameItemsItemIdPatchBody' => 'Braze\\Normalizer\\CatalogsCatalogNameItemsItemIdPatchBodyNormalizer', 'Braze\\Model\\CatalogsCatalogNameItemsItemIdPostBody' => 'Braze\\Normalizer\\CatalogsCatalogNameItemsItemIdPostBodyNormalizer', 'Braze\\Model\\CatalogsCatalogNameItemsItemIdPutBody' => 'Braze\\Normalizer\\CatalogsCatalogNameItemsItemIdPutBodyNormalizer', 'Braze\\Model\\EmailStatusPostBody' => 'Braze\\Normalizer\\EmailStatusPostBodyNormalizer', 'Braze\\Model\\EmailBounceRemovePostBody' => 'Braze\\Normalizer\\EmailBounceRemovePostBodyNormalizer', 'Braze\\Model\\EmailSpamRemovePostBody' => 'Braze\\Normalizer\\EmailSpamRemovePostBodyNormalizer', 'Braze\\Model\\EmailBlocklistPostBody' => 'Braze\\Normalizer\\EmailBlocklistPostBodyNormalizer', 'Braze\\Model\\EmailBlacklistPostBody' => 'Braze\\Normalizer\\EmailBlacklistPostBodyNormalizer', 'Braze\\Model\\UsersExportIdsPostBody' => 'Braze\\Normalizer\\UsersExportIdsPostBodyNormalizer', 'Braze\\Model\\UsersExportIdsPostBodyUserAliasesItem' => 'Braze\\Normalizer\\UsersExportIdsPostBodyUserAliasesItemNormalizer', 'Braze\\Model\\UsersExportSegmentPostBody' => 'Braze\\Normalizer\\UsersExportSegmentPostBodyNormalizer', 'Braze\\Model\\UsersExportGlobalControlGroupPostBody' => 'Braze\\Normalizer\\UsersExportGlobalControlGroupPostBodyNormalizer', 'Braze\\Model\\MessagesLiveActivityUpdatePostBody' => 'Braze\\Normalizer\\MessagesLiveActivityUpdatePostBodyNormalizer', 'Braze\\Model\\MessagesLiveActivityUpdatePostBodyContentState' => 'Braze\\Normalizer\\MessagesLiveActivityUpdatePostBodyContentStateNormalizer', 'Braze\\Model\\MessagesLiveActivityUpdatePostBodyNotification' => 'Braze\\Normalizer\\MessagesLiveActivityUpdatePostBodyNotificationNormalizer', 'Braze\\Model\\MessagesLiveActivityUpdatePostBodyNotificationAlert' => 'Braze\\Normalizer\\MessagesLiveActivityUpdatePostBodyNotificationAlertNormalizer', 'Braze\\Model\\MessagesScheduleDeletePostBody' => 'Braze\\Normalizer\\MessagesScheduleDeletePostBodyNormalizer', 'Braze\\Model\\CanvasTriggerScheduleDeletePostBody' => 'Braze\\Normalizer\\CanvasTriggerScheduleDeletePostBodyNormalizer', 'Braze\\Model\\CampaignsTriggerScheduleDeletePostBody' => 'Braze\\Normalizer\\CampaignsTriggerScheduleDeletePostBodyNormalizer', 'Braze\\Model\\MessagesScheduleCreatePostBody' => 'Braze\\Normalizer\\MessagesScheduleCreatePostBodyNormalizer', 'Braze\\Model\\MessagesScheduleCreatePostBodyUserAliases' => 'Braze\\Normalizer\\MessagesScheduleCreatePostBodyUserAliasesNormalizer', 'Braze\\Model\\MessagesScheduleCreatePostBodyAudience' => 'Braze\\Normalizer\\MessagesScheduleCreatePostBodyAudienceNormalizer', 'Braze\\Model\\MessagesScheduleCreatePostBodySchedule' => 'Braze\\Normalizer\\MessagesScheduleCreatePostBodyScheduleNormalizer', 'Braze\\Model\\MessagesScheduleCreatePostBodyMessages' => 'Braze\\Normalizer\\MessagesScheduleCreatePostBodyMessagesNormalizer', 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBody' => 'Braze\\Normalizer\\CampaignsTriggerScheduleCreatePostBodyNormalizer', 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBodyRecipientsItem' => 'Braze\\Normalizer\\CampaignsTriggerScheduleCreatePostBodyRecipientsItemNormalizer', 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBodyAudience' => 'Braze\\Normalizer\\CampaignsTriggerScheduleCreatePostBodyAudienceNormalizer', 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBodySchedule' => 'Braze\\Normalizer\\CampaignsTriggerScheduleCreatePostBodyScheduleNormalizer', 'Braze\\Model\\CanvasTriggerScheduleCreatePostBody' => 'Braze\\Normalizer\\CanvasTriggerScheduleCreatePostBodyNormalizer', 'Braze\\Model\\CanvasTriggerScheduleCreatePostBodyRecipientsItem' => 'Braze\\Normalizer\\CanvasTriggerScheduleCreatePostBodyRecipientsItemNormalizer', 'Braze\\Model\\CanvasTriggerScheduleCreatePostBodyAudience' => 'Braze\\Normalizer\\CanvasTriggerScheduleCreatePostBodyAudienceNormalizer', 'Braze\\Model\\CanvasTriggerScheduleCreatePostBodySchedule' => 'Braze\\Normalizer\\CanvasTriggerScheduleCreatePostBodyScheduleNormalizer', 'Braze\\Model\\MessagesScheduleUpdatePostBody' => 'Braze\\Normalizer\\MessagesScheduleUpdatePostBodyNormalizer', 'Braze\\Model\\MessagesScheduleUpdatePostBodySchedule' => 'Braze\\Normalizer\\MessagesScheduleUpdatePostBodyScheduleNormalizer', 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessages' => 'Braze\\Normalizer\\MessagesScheduleUpdatePostBodyMessagesNormalizer', 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesApplePush' => 'Braze\\Normalizer\\MessagesScheduleUpdatePostBodyMessagesApplePushNormalizer', 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesAndroidPush' => 'Braze\\Normalizer\\MessagesScheduleUpdatePostBodyMessagesAndroidPushNormalizer', 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesSms' => 'Braze\\Normalizer\\MessagesScheduleUpdatePostBodyMessagesSmsNormalizer', 'Braze\\Model\\CampaignsTriggerScheduleUpdatePostBody' => 'Braze\\Normalizer\\CampaignsTriggerScheduleUpdatePostBodyNormalizer', 'Braze\\Model\\CampaignsTriggerScheduleUpdatePostBodySchedule' => 'Braze\\Normalizer\\CampaignsTriggerScheduleUpdatePostBodyScheduleNormalizer', 'Braze\\Model\\CanvasTriggerScheduleUpdatePostBody' => 'Braze\\Normalizer\\CanvasTriggerScheduleUpdatePostBodyNormalizer', 'Braze\\Model\\CanvasTriggerScheduleUpdatePostBodySchedule' => 'Braze\\Normalizer\\CanvasTriggerScheduleUpdatePostBodyScheduleNormalizer', 'Braze\\Model\\SendsIdCreatePostBody' => 'Braze\\Normalizer\\SendsIdCreatePostBodyNormalizer', 'Braze\\Model\\MessagesSendPostBody' => 'Braze\\Normalizer\\MessagesSendPostBodyNormalizer', 'Braze\\Model\\MessagesSendPostBodyUserAliases' => 'Braze\\Normalizer\\MessagesSendPostBodyUserAliasesNormalizer', 'Braze\\Model\\MessagesSendPostBodyAudience' => 'Braze\\Normalizer\\MessagesSendPostBodyAudienceNormalizer', 'Braze\\Model\\MessagesSendPostBodyMessages' => 'Braze\\Normalizer\\MessagesSendPostBodyMessagesNormalizer', 'Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBody' => 'Braze\\Normalizer\\TransactionalV1CampaignsCampaignIdSendPostBodyNormalizer', 'Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBodyTriggerProperties' => 'Braze\\Normalizer\\TransactionalV1CampaignsCampaignIdSendPostBodyTriggerPropertiesNormalizer', 'Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBodyRecipientItem' => 'Braze\\Normalizer\\TransactionalV1CampaignsCampaignIdSendPostBodyRecipientItemNormalizer', 'Braze\\Model\\CampaignsTriggerSendPostBody' => 'Braze\\Normalizer\\CampaignsTriggerSendPostBodyNormalizer', 'Braze\\Model\\CampaignsTriggerSendPostBodyAudience' => 'Braze\\Normalizer\\CampaignsTriggerSendPostBodyAudienceNormalizer', 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItem' => 'Braze\\Normalizer\\CampaignsTriggerSendPostBodyRecipientsItemNormalizer', 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItemUserAlias' => 'Braze\\Normalizer\\CampaignsTriggerSendPostBodyRecipientsItemUserAliasNormalizer', 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItemAttributes' => 'Braze\\Normalizer\\CampaignsTriggerSendPostBodyRecipientsItemAttributesNormalizer', 'Braze\\Model\\CanvasTriggerSendPostBody' => 'Braze\\Normalizer\\CanvasTriggerSendPostBodyNormalizer', 'Braze\\Model\\CanvasTriggerSendPostBodyCanvasEntryProperties' => 'Braze\\Normalizer\\CanvasTriggerSendPostBodyCanvasEntryPropertiesNormalizer', 'Braze\\Model\\CanvasTriggerSendPostBodyAudience' => 'Braze\\Normalizer\\CanvasTriggerSendPostBodyAudienceNormalizer', 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItem' => 'Braze\\Normalizer\\CanvasTriggerSendPostBodyRecipientsItemNormalizer', 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItemUserAlias' => 'Braze\\Normalizer\\CanvasTriggerSendPostBodyRecipientsItemUserAliasNormalizer', 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItemAttributes' => 'Braze\\Normalizer\\CanvasTriggerSendPostBodyRecipientsItemAttributesNormalizer', 'Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBody' => 'Braze\\Normalizer\\PreferenceCenterV1PreferenceCenterExternalIDPutBodyNormalizer', 'Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBodyTriggerProperties' => 'Braze\\Normalizer\\PreferenceCenterV1PreferenceCenterExternalIDPutBodyTriggerPropertiesNormalizer', 'Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBodyRecipientItem' => 'Braze\\Normalizer\\PreferenceCenterV1PreferenceCenterExternalIDPutBodyRecipientItemNormalizer', 'Braze\\Model\\PreferenceCenterV1PostBody' => 'Braze\\Normalizer\\PreferenceCenterV1PostBodyNormalizer', 'Braze\\Model\\PreferenceCenterV1PostBodyOptions' => 'Braze\\Normalizer\\PreferenceCenterV1PostBodyOptionsNormalizer', 'Braze\\Model\\ScimV2UsersIdPutBody' => 'Braze\\Normalizer\\ScimV2UsersIdPutBodyNormalizer', 'Braze\\Model\\ScimV2UsersIdPutBodyName' => 'Braze\\Normalizer\\ScimV2UsersIdPutBodyNameNormalizer', 'Braze\\Model\\ScimV2UsersIdPutBodyPermissions' => 'Braze\\Normalizer\\ScimV2UsersIdPutBodyPermissionsNormalizer', 'Braze\\Model\\ScimV2UsersIdPutBodyPermissionsAppGroupItem' => 'Braze\\Normalizer\\ScimV2UsersIdPutBodyPermissionsAppGroupItemNormalizer', 'Braze\\Model\\ScimV2UsersIdPutBodyPermissionsAppGroupItemTeamItem' => 'Braze\\Normalizer\\ScimV2UsersIdPutBodyPermissionsAppGroupItemTeamItemNormalizer', 'Braze\\Model\\ScimV2UsersPostBody' => 'Braze\\Normalizer\\ScimV2UsersPostBodyNormalizer', 'Braze\\Model\\ScimV2UsersPostBodyName' => 'Braze\\Normalizer\\ScimV2UsersPostBodyNameNormalizer', 'Braze\\Model\\ScimV2UsersPostBodyPermissions' => 'Braze\\Normalizer\\ScimV2UsersPostBodyPermissionsNormalizer', 'Braze\\Model\\ScimV2UsersPostBodyPermissionsAppGroupItem' => 'Braze\\Normalizer\\ScimV2UsersPostBodyPermissionsAppGroupItemNormalizer', 'Braze\\Model\\ScimV2UsersPostBodyPermissionsAppGroupItemTeamItem' => 'Braze\\Normalizer\\ScimV2UsersPostBodyPermissionsAppGroupItemTeamItemNormalizer', 'Braze\\Model\\SmsInvalidPhoneNumbersRemovePostBody' => 'Braze\\Normalizer\\SmsInvalidPhoneNumbersRemovePostBodyNormalizer', 'Braze\\Model\\SubscriptionStatusSetPostBody' => 'Braze\\Normalizer\\SubscriptionStatusSetPostBodyNormalizer', 'Braze\\Model\\V2SubscriptionStatusSetPostBody' => 'Braze\\Normalizer\\V2SubscriptionStatusSetPostBodyNormalizer', 'Braze\\Model\\V2SubscriptionStatusSetPostBodySubscriptionGroupsItem' => 'Braze\\Normalizer\\V2SubscriptionStatusSetPostBodySubscriptionGroupsItemNormalizer', 'Braze\\Model\\ContentBlocksCreatePostBody' => 'Braze\\Normalizer\\ContentBlocksCreatePostBodyNormalizer', 'Braze\\Model\\ContentBlocksUpdatePostBody' => 'Braze\\Normalizer\\ContentBlocksUpdatePostBodyNormalizer', 'Braze\\Model\\TemplatesEmailCreatePostBody' => 'Braze\\Normalizer\\TemplatesEmailCreatePostBodyNormalizer', 'Braze\\Model\\UsersExternalIdsRenamePostBody' => 'Braze\\Normalizer\\UsersExternalIdsRenamePostBodyNormalizer', 'Braze\\Model\\UsersExternalIdsRenamePostBodyExternalIdRenamesItem' => 'Braze\\Normalizer\\UsersExternalIdsRenamePostBodyExternalIdRenamesItemNormalizer', 'Braze\\Model\\UsersExternalIdsRemovePostBody' => 'Braze\\Normalizer\\UsersExternalIdsRemovePostBodyNormalizer', 'Braze\\Model\\UsersAliasUpdatePostBody' => 'Braze\\Normalizer\\UsersAliasUpdatePostBodyNormalizer', 'Braze\\Model\\UsersAliasUpdatePostBodyAliasUpdatesItem' => 'Braze\\Normalizer\\UsersAliasUpdatePostBodyAliasUpdatesItemNormalizer', 'Braze\\Model\\UsersAliasNewPostBody' => 'Braze\\Normalizer\\UsersAliasNewPostBodyNormalizer', 'Braze\\Model\\UsersAliasNewPostBodyUserAliasesItem' => 'Braze\\Normalizer\\UsersAliasNewPostBodyUserAliasesItemNormalizer', 'Braze\\Model\\UsersDeletePostBody' => 'Braze\\Normalizer\\UsersDeletePostBodyNormalizer', 'Braze\\Model\\UsersDeletePostBodyUserAliasesItem' => 'Braze\\Normalizer\\UsersDeletePostBodyUserAliasesItemNormalizer', 'Braze\\Model\\UsersIdentifyPostBody' => 'Braze\\Normalizer\\UsersIdentifyPostBodyNormalizer', 'Braze\\Model\\UsersIdentifyPostBodyAliasesToIdentifyItem' => 'Braze\\Normalizer\\UsersIdentifyPostBodyAliasesToIdentifyItemNormalizer', 'Braze\\Model\\UsersIdentifyPostBodyAliasesToIdentifyItemUserAlias' => 'Braze\\Normalizer\\UsersIdentifyPostBodyAliasesToIdentifyItemUserAliasNormalizer', 'Braze\\Model\\UsersMergePostBody' => 'Braze\\Normalizer\\UsersMergePostBodyNormalizer', '\\Jane\\Component\\JsonSchemaRuntime\\Reference' => '\\Braze\\Runtime\\Normalizer\\ReferenceNormalizer']; + protected $normalizersCache = []; + + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool + { + return array_key_exists($type, $this->normalizers); + } + + public function supportsNormalization($data, $format = null, array $context = []): bool + { + return is_object($data) && array_key_exists(get_class($data), $this->normalizers); + } + + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $normalizerClass = $this->normalizers[get_class($object)]; + $normalizer = $this->getNormalizer($normalizerClass); + + return $normalizer->normalize($object, $format, $context); + } + + public function denormalize($data, $type, $format = null, array $context = []) + { + $denormalizerClass = $this->normalizers[$type]; + $denormalizer = $this->getNormalizer($denormalizerClass); + + return $denormalizer->denormalize($data, $type, $format, $context); + } + + private function getNormalizer(string $normalizerClass) + { + return $this->normalizersCache[$normalizerClass] ?? $this->initNormalizer($normalizerClass); + } + + private function initNormalizer(string $normalizerClass) + { + $normalizer = new $normalizerClass(); + $normalizer->setNormalizer($this->normalizer); + $normalizer->setDenormalizer($this->denormalizer); + $this->normalizersCache[$normalizerClass] = $normalizer; + + return $normalizer; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\Error' => false, 'Braze\\Model\\TemplatesEmailUpdatePostBody' => false, 'Braze\\Model\\UsersTrackPostBody' => false, 'Braze\\Model\\CatalogsPostBody' => false, 'Braze\\Model\\CatalogsPostBodyCatalogsItem' => false, 'Braze\\Model\\CatalogsPostBodyCatalogsItemFieldsItem' => false, 'Braze\\Model\\CatalogsCatalogNameItemsPatchBody' => false, 'Braze\\Model\\CatalogsCatalogNameItemsPatchBodyItemsItem' => false, 'Braze\\Model\\CatalogsCatalogNameItemsPostBody' => false, 'Braze\\Model\\CatalogsCatalogNameItemsPutBody' => false, 'Braze\\Model\\CatalogsCatalogNameItemsItemIdPatchBody' => false, 'Braze\\Model\\CatalogsCatalogNameItemsItemIdPostBody' => false, 'Braze\\Model\\CatalogsCatalogNameItemsItemIdPutBody' => false, 'Braze\\Model\\EmailStatusPostBody' => false, 'Braze\\Model\\EmailBounceRemovePostBody' => false, 'Braze\\Model\\EmailSpamRemovePostBody' => false, 'Braze\\Model\\EmailBlocklistPostBody' => false, 'Braze\\Model\\EmailBlacklistPostBody' => false, 'Braze\\Model\\UsersExportIdsPostBody' => false, 'Braze\\Model\\UsersExportIdsPostBodyUserAliasesItem' => false, 'Braze\\Model\\UsersExportSegmentPostBody' => false, 'Braze\\Model\\UsersExportGlobalControlGroupPostBody' => false, 'Braze\\Model\\MessagesLiveActivityUpdatePostBody' => false, 'Braze\\Model\\MessagesLiveActivityUpdatePostBodyContentState' => false, 'Braze\\Model\\MessagesLiveActivityUpdatePostBodyNotification' => false, 'Braze\\Model\\MessagesLiveActivityUpdatePostBodyNotificationAlert' => false, 'Braze\\Model\\MessagesScheduleDeletePostBody' => false, 'Braze\\Model\\CanvasTriggerScheduleDeletePostBody' => false, 'Braze\\Model\\CampaignsTriggerScheduleDeletePostBody' => false, 'Braze\\Model\\MessagesScheduleCreatePostBody' => false, 'Braze\\Model\\MessagesScheduleCreatePostBodyUserAliases' => false, 'Braze\\Model\\MessagesScheduleCreatePostBodyAudience' => false, 'Braze\\Model\\MessagesScheduleCreatePostBodySchedule' => false, 'Braze\\Model\\MessagesScheduleCreatePostBodyMessages' => false, 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBody' => false, 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBodyRecipientsItem' => false, 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBodyAudience' => false, 'Braze\\Model\\CampaignsTriggerScheduleCreatePostBodySchedule' => false, 'Braze\\Model\\CanvasTriggerScheduleCreatePostBody' => false, 'Braze\\Model\\CanvasTriggerScheduleCreatePostBodyRecipientsItem' => false, 'Braze\\Model\\CanvasTriggerScheduleCreatePostBodyAudience' => false, 'Braze\\Model\\CanvasTriggerScheduleCreatePostBodySchedule' => false, 'Braze\\Model\\MessagesScheduleUpdatePostBody' => false, 'Braze\\Model\\MessagesScheduleUpdatePostBodySchedule' => false, 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessages' => false, 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesApplePush' => false, 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesAndroidPush' => false, 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesSms' => false, 'Braze\\Model\\CampaignsTriggerScheduleUpdatePostBody' => false, 'Braze\\Model\\CampaignsTriggerScheduleUpdatePostBodySchedule' => false, 'Braze\\Model\\CanvasTriggerScheduleUpdatePostBody' => false, 'Braze\\Model\\CanvasTriggerScheduleUpdatePostBodySchedule' => false, 'Braze\\Model\\SendsIdCreatePostBody' => false, 'Braze\\Model\\MessagesSendPostBody' => false, 'Braze\\Model\\MessagesSendPostBodyUserAliases' => false, 'Braze\\Model\\MessagesSendPostBodyAudience' => false, 'Braze\\Model\\MessagesSendPostBodyMessages' => false, 'Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBody' => false, 'Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBodyTriggerProperties' => false, 'Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBodyRecipientItem' => false, 'Braze\\Model\\CampaignsTriggerSendPostBody' => false, 'Braze\\Model\\CampaignsTriggerSendPostBodyAudience' => false, 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItem' => false, 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItemUserAlias' => false, 'Braze\\Model\\CampaignsTriggerSendPostBodyRecipientsItemAttributes' => false, 'Braze\\Model\\CanvasTriggerSendPostBody' => false, 'Braze\\Model\\CanvasTriggerSendPostBodyCanvasEntryProperties' => false, 'Braze\\Model\\CanvasTriggerSendPostBodyAudience' => false, 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItem' => false, 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItemUserAlias' => false, 'Braze\\Model\\CanvasTriggerSendPostBodyRecipientsItemAttributes' => false, 'Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBody' => false, 'Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBodyTriggerProperties' => false, 'Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBodyRecipientItem' => false, 'Braze\\Model\\PreferenceCenterV1PostBody' => false, 'Braze\\Model\\PreferenceCenterV1PostBodyOptions' => false, 'Braze\\Model\\ScimV2UsersIdPutBody' => false, 'Braze\\Model\\ScimV2UsersIdPutBodyName' => false, 'Braze\\Model\\ScimV2UsersIdPutBodyPermissions' => false, 'Braze\\Model\\ScimV2UsersIdPutBodyPermissionsAppGroupItem' => false, 'Braze\\Model\\ScimV2UsersIdPutBodyPermissionsAppGroupItemTeamItem' => false, 'Braze\\Model\\ScimV2UsersPostBody' => false, 'Braze\\Model\\ScimV2UsersPostBodyName' => false, 'Braze\\Model\\ScimV2UsersPostBodyPermissions' => false, 'Braze\\Model\\ScimV2UsersPostBodyPermissionsAppGroupItem' => false, 'Braze\\Model\\ScimV2UsersPostBodyPermissionsAppGroupItemTeamItem' => false, 'Braze\\Model\\SmsInvalidPhoneNumbersRemovePostBody' => false, 'Braze\\Model\\SubscriptionStatusSetPostBody' => false, 'Braze\\Model\\V2SubscriptionStatusSetPostBody' => false, 'Braze\\Model\\V2SubscriptionStatusSetPostBodySubscriptionGroupsItem' => false, 'Braze\\Model\\ContentBlocksCreatePostBody' => false, 'Braze\\Model\\ContentBlocksUpdatePostBody' => false, 'Braze\\Model\\TemplatesEmailCreatePostBody' => false, 'Braze\\Model\\UsersExternalIdsRenamePostBody' => false, 'Braze\\Model\\UsersExternalIdsRenamePostBodyExternalIdRenamesItem' => false, 'Braze\\Model\\UsersExternalIdsRemovePostBody' => false, 'Braze\\Model\\UsersAliasUpdatePostBody' => false, 'Braze\\Model\\UsersAliasUpdatePostBodyAliasUpdatesItem' => false, 'Braze\\Model\\UsersAliasNewPostBody' => false, 'Braze\\Model\\UsersAliasNewPostBodyUserAliasesItem' => false, 'Braze\\Model\\UsersDeletePostBody' => false, 'Braze\\Model\\UsersDeletePostBodyUserAliasesItem' => false, 'Braze\\Model\\UsersIdentifyPostBody' => false, 'Braze\\Model\\UsersIdentifyPostBodyAliasesToIdentifyItem' => false, 'Braze\\Model\\UsersIdentifyPostBodyAliasesToIdentifyItemUserAlias' => false, 'Braze\\Model\\UsersMergePostBody' => false, '\\Jane\\Component\\JsonSchemaRuntime\\Reference' => false]; + } } } diff --git a/lib/Normalizer/MessagesLiveActivityUpdatePostBodyContentStateNormalizer.php b/lib/Normalizer/MessagesLiveActivityUpdatePostBodyContentStateNormalizer.php index 33d9c2b..48b647b 100644 --- a/lib/Normalizer/MessagesLiveActivityUpdatePostBodyContentStateNormalizer.php +++ b/lib/Normalizer/MessagesLiveActivityUpdatePostBodyContentStateNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,75 +21,147 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class MessagesLiveActivityUpdatePostBodyContentStateNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\MessagesLiveActivityUpdatePostBodyContentState'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class MessagesLiveActivityUpdatePostBodyContentStateNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesLiveActivityUpdatePostBodyContentState'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\MessagesLiveActivityUpdatePostBodyContentState'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesLiveActivityUpdatePostBodyContentState'; } - $object = new \Braze\Model\MessagesLiveActivityUpdatePostBodyContentState(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\MessagesLiveActivityUpdatePostBodyContentState(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('teamOneScore', $data)) { + $object->setTeamOneScore($data['teamOneScore']); + unset($data['teamOneScore']); + } + if (\array_key_exists('teamTwoScore', $data)) { + $object->setTeamTwoScore($data['teamTwoScore']); + unset($data['teamTwoScore']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('teamOneScore', $data)) { - $object->setTeamOneScore($data['teamOneScore']); - unset($data['teamOneScore']); - } - if (\array_key_exists('teamTwoScore', $data)) { - $object->setTeamTwoScore($data['teamTwoScore']); - unset($data['teamTwoScore']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('teamOneScore') && null !== $object->getTeamOneScore()) { + $data['teamOneScore'] = $object->getTeamOneScore(); + } + if ($object->isInitialized('teamTwoScore') && null !== $object->getTeamTwoScore()) { + $data['teamTwoScore'] = $object->getTeamTwoScore(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\MessagesLiveActivityUpdatePostBodyContentState' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class MessagesLiveActivityUpdatePostBodyContentStateNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('teamOneScore') && null !== $object->getTeamOneScore()) { - $data['teamOneScore'] = $object->getTeamOneScore(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\MessagesLiveActivityUpdatePostBodyContentState'; } - if ($object->isInitialized('teamTwoScore') && null !== $object->getTeamTwoScore()) { - $data['teamTwoScore'] = $object->getTeamTwoScore(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesLiveActivityUpdatePostBodyContentState'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\MessagesLiveActivityUpdatePostBodyContentState(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('teamOneScore', $data)) { + $object->setTeamOneScore($data['teamOneScore']); + unset($data['teamOneScore']); + } + if (\array_key_exists('teamTwoScore', $data)) { + $object->setTeamTwoScore($data['teamTwoScore']); + unset($data['teamTwoScore']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('teamOneScore') && null !== $object->getTeamOneScore()) { + $data['teamOneScore'] = $object->getTeamOneScore(); + } + if ($object->isInitialized('teamTwoScore') && null !== $object->getTeamTwoScore()) { + $data['teamTwoScore'] = $object->getTeamTwoScore(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\MessagesLiveActivityUpdatePostBodyContentState' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\MessagesLiveActivityUpdatePostBodyContentState' => false]; + } } } diff --git a/lib/Normalizer/MessagesLiveActivityUpdatePostBodyNormalizer.php b/lib/Normalizer/MessagesLiveActivityUpdatePostBodyNormalizer.php index dd91768..1309bf8 100644 --- a/lib/Normalizer/MessagesLiveActivityUpdatePostBodyNormalizer.php +++ b/lib/Normalizer/MessagesLiveActivityUpdatePostBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,110 +21,217 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class MessagesLiveActivityUpdatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class MessagesLiveActivityUpdatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return $type === 'Braze\\Model\\MessagesLiveActivityUpdatePostBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool - { - return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesLiveActivityUpdatePostBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\MessagesLiveActivityUpdatePostBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesLiveActivityUpdatePostBody'; } - $object = new \Braze\Model\MessagesLiveActivityUpdatePostBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\MessagesLiveActivityUpdatePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('app_id', $data)) { + $object->setAppId($data['app_id']); + unset($data['app_id']); + } + if (\array_key_exists('activity_id', $data)) { + $object->setActivityId($data['activity_id']); + unset($data['activity_id']); + } + if (\array_key_exists('content_state', $data)) { + $object->setContentState($this->denormalizer->denormalize($data['content_state'], 'Braze\\Model\\MessagesLiveActivityUpdatePostBodyContentState', 'json', $context)); + unset($data['content_state']); + } + if (\array_key_exists('end_activity', $data)) { + $object->setEndActivity($data['end_activity']); + unset($data['end_activity']); + } + if (\array_key_exists('dismissal_date', $data)) { + $object->setDismissalDate(\DateTime::createFromFormat('Y-m-d\\TH:i:sP', $data['dismissal_date'])); + unset($data['dismissal_date']); + } + if (\array_key_exists('stale_date', $data)) { + $object->setStaleDate(\DateTime::createFromFormat('Y-m-d\\TH:i:sP', $data['stale_date'])); + unset($data['stale_date']); + } + if (\array_key_exists('notification', $data)) { + $object->setNotification($this->denormalizer->denormalize($data['notification'], 'Braze\\Model\\MessagesLiveActivityUpdatePostBodyNotification', 'json', $context)); + unset($data['notification']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('app_id', $data)) { - $object->setAppId($data['app_id']); - unset($data['app_id']); - } - if (\array_key_exists('activity_id', $data)) { - $object->setActivityId($data['activity_id']); - unset($data['activity_id']); - } - if (\array_key_exists('content_state', $data)) { - $object->setContentState($this->denormalizer->denormalize($data['content_state'], 'Braze\\Model\\MessagesLiveActivityUpdatePostBodyContentState', 'json', $context)); - unset($data['content_state']); - } - if (\array_key_exists('end_activity', $data)) { - $object->setEndActivity($data['end_activity']); - unset($data['end_activity']); - } - if (\array_key_exists('dismissal_date', $data)) { - $object->setDismissalDate(\DateTime::createFromFormat('Y-m-d\\TH:i:sP', $data['dismissal_date'])); - unset($data['dismissal_date']); - } - if (\array_key_exists('stale_date', $data)) { - $object->setStaleDate(\DateTime::createFromFormat('Y-m-d\\TH:i:sP', $data['stale_date'])); - unset($data['stale_date']); - } - if (\array_key_exists('notification', $data)) { - $object->setNotification($this->denormalizer->denormalize($data['notification'], 'Braze\\Model\\MessagesLiveActivityUpdatePostBodyNotification', 'json', $context)); - unset($data['notification']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('appId') && null !== $object->getAppId()) { + $data['app_id'] = $object->getAppId(); + } + if ($object->isInitialized('activityId') && null !== $object->getActivityId()) { + $data['activity_id'] = $object->getActivityId(); + } + if ($object->isInitialized('contentState') && null !== $object->getContentState()) { + $data['content_state'] = $this->normalizer->normalize($object->getContentState(), 'json', $context); + } + if ($object->isInitialized('endActivity') && null !== $object->getEndActivity()) { + $data['end_activity'] = $object->getEndActivity(); + } + if ($object->isInitialized('dismissalDate') && null !== $object->getDismissalDate()) { + $data['dismissal_date'] = $object->getDismissalDate()->format('Y-m-d\\TH:i:sP'); } + if ($object->isInitialized('staleDate') && null !== $object->getStaleDate()) { + $data['stale_date'] = $object->getStaleDate()->format('Y-m-d\\TH:i:sP'); + } + if ($object->isInitialized('notification') && null !== $object->getNotification()) { + $data['notification'] = $this->normalizer->normalize($object->getNotification(), 'json', $context); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\MessagesLiveActivityUpdatePostBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class MessagesLiveActivityUpdatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('appId') && null !== $object->getAppId()) { - $data['app_id'] = $object->getAppId(); - } - if ($object->isInitialized('activityId') && null !== $object->getActivityId()) { - $data['activity_id'] = $object->getActivityId(); - } - if ($object->isInitialized('contentState') && null !== $object->getContentState()) { - $data['content_state'] = $this->normalizer->normalize($object->getContentState(), 'json', $context); - } - if ($object->isInitialized('endActivity') && null !== $object->getEndActivity()) { - $data['end_activity'] = $object->getEndActivity(); - } - if ($object->isInitialized('dismissalDate') && null !== $object->getDismissalDate()) { - $data['dismissal_date'] = $object->getDismissalDate()->format('Y-m-d\\TH:i:sP'); - } - if ($object->isInitialized('staleDate') && null !== $object->getStaleDate()) { - $data['stale_date'] = $object->getStaleDate()->format('Y-m-d\\TH:i:sP'); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\MessagesLiveActivityUpdatePostBody'; } - if ($object->isInitialized('notification') && null !== $object->getNotification()) { - $data['notification'] = $this->normalizer->normalize($object->getNotification(), 'json', $context); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesLiveActivityUpdatePostBody'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\MessagesLiveActivityUpdatePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('app_id', $data)) { + $object->setAppId($data['app_id']); + unset($data['app_id']); + } + if (\array_key_exists('activity_id', $data)) { + $object->setActivityId($data['activity_id']); + unset($data['activity_id']); + } + if (\array_key_exists('content_state', $data)) { + $object->setContentState($this->denormalizer->denormalize($data['content_state'], 'Braze\\Model\\MessagesLiveActivityUpdatePostBodyContentState', 'json', $context)); + unset($data['content_state']); + } + if (\array_key_exists('end_activity', $data)) { + $object->setEndActivity($data['end_activity']); + unset($data['end_activity']); + } + if (\array_key_exists('dismissal_date', $data)) { + $object->setDismissalDate(\DateTime::createFromFormat('Y-m-d\\TH:i:sP', $data['dismissal_date'])); + unset($data['dismissal_date']); + } + if (\array_key_exists('stale_date', $data)) { + $object->setStaleDate(\DateTime::createFromFormat('Y-m-d\\TH:i:sP', $data['stale_date'])); + unset($data['stale_date']); } + if (\array_key_exists('notification', $data)) { + $object->setNotification($this->denormalizer->denormalize($data['notification'], 'Braze\\Model\\MessagesLiveActivityUpdatePostBodyNotification', 'json', $context)); + unset($data['notification']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('appId') && null !== $object->getAppId()) { + $data['app_id'] = $object->getAppId(); + } + if ($object->isInitialized('activityId') && null !== $object->getActivityId()) { + $data['activity_id'] = $object->getActivityId(); + } + if ($object->isInitialized('contentState') && null !== $object->getContentState()) { + $data['content_state'] = $this->normalizer->normalize($object->getContentState(), 'json', $context); + } + if ($object->isInitialized('endActivity') && null !== $object->getEndActivity()) { + $data['end_activity'] = $object->getEndActivity(); + } + if ($object->isInitialized('dismissalDate') && null !== $object->getDismissalDate()) { + $data['dismissal_date'] = $object->getDismissalDate()->format('Y-m-d\\TH:i:sP'); + } + if ($object->isInitialized('staleDate') && null !== $object->getStaleDate()) { + $data['stale_date'] = $object->getStaleDate()->format('Y-m-d\\TH:i:sP'); + } + if ($object->isInitialized('notification') && null !== $object->getNotification()) { + $data['notification'] = $this->normalizer->normalize($object->getNotification(), 'json', $context); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\MessagesLiveActivityUpdatePostBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\MessagesLiveActivityUpdatePostBody' => false]; + } } } diff --git a/lib/Normalizer/MessagesLiveActivityUpdatePostBodyNotificationAlertNormalizer.php b/lib/Normalizer/MessagesLiveActivityUpdatePostBodyNotificationAlertNormalizer.php index 720d73e..c2056d1 100644 --- a/lib/Normalizer/MessagesLiveActivityUpdatePostBodyNotificationAlertNormalizer.php +++ b/lib/Normalizer/MessagesLiveActivityUpdatePostBodyNotificationAlertNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,75 +21,147 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class MessagesLiveActivityUpdatePostBodyNotificationAlertNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\MessagesLiveActivityUpdatePostBodyNotificationAlert'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class MessagesLiveActivityUpdatePostBodyNotificationAlertNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesLiveActivityUpdatePostBodyNotificationAlert'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\MessagesLiveActivityUpdatePostBodyNotificationAlert'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesLiveActivityUpdatePostBodyNotificationAlert'; } - $object = new \Braze\Model\MessagesLiveActivityUpdatePostBodyNotificationAlert(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\MessagesLiveActivityUpdatePostBodyNotificationAlert(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('body', $data)) { + $object->setBody($data['body']); + unset($data['body']); + } + if (\array_key_exists('title', $data)) { + $object->setTitle($data['title']); + unset($data['title']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('body', $data)) { - $object->setBody($data['body']); - unset($data['body']); - } - if (\array_key_exists('title', $data)) { - $object->setTitle($data['title']); - unset($data['title']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('body') && null !== $object->getBody()) { + $data['body'] = $object->getBody(); + } + if ($object->isInitialized('title') && null !== $object->getTitle()) { + $data['title'] = $object->getTitle(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\MessagesLiveActivityUpdatePostBodyNotificationAlert' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class MessagesLiveActivityUpdatePostBodyNotificationAlertNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('body') && null !== $object->getBody()) { - $data['body'] = $object->getBody(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\MessagesLiveActivityUpdatePostBodyNotificationAlert'; } - if ($object->isInitialized('title') && null !== $object->getTitle()) { - $data['title'] = $object->getTitle(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesLiveActivityUpdatePostBodyNotificationAlert'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\MessagesLiveActivityUpdatePostBodyNotificationAlert(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('body', $data)) { + $object->setBody($data['body']); + unset($data['body']); + } + if (\array_key_exists('title', $data)) { + $object->setTitle($data['title']); + unset($data['title']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('body') && null !== $object->getBody()) { + $data['body'] = $object->getBody(); + } + if ($object->isInitialized('title') && null !== $object->getTitle()) { + $data['title'] = $object->getTitle(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\MessagesLiveActivityUpdatePostBodyNotificationAlert' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\MessagesLiveActivityUpdatePostBodyNotificationAlert' => false]; + } } } diff --git a/lib/Normalizer/MessagesLiveActivityUpdatePostBodyNotificationNormalizer.php b/lib/Normalizer/MessagesLiveActivityUpdatePostBodyNotificationNormalizer.php index 743ce88..60d67b9 100644 --- a/lib/Normalizer/MessagesLiveActivityUpdatePostBodyNotificationNormalizer.php +++ b/lib/Normalizer/MessagesLiveActivityUpdatePostBodyNotificationNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,68 +21,133 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class MessagesLiveActivityUpdatePostBodyNotificationNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class MessagesLiveActivityUpdatePostBodyNotificationNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return $type === 'Braze\\Model\\MessagesLiveActivityUpdatePostBodyNotification'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool - { - return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesLiveActivityUpdatePostBodyNotification'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\MessagesLiveActivityUpdatePostBodyNotification'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesLiveActivityUpdatePostBodyNotification'; } - $object = new \Braze\Model\MessagesLiveActivityUpdatePostBodyNotification(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\MessagesLiveActivityUpdatePostBodyNotification(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('alert', $data)) { + $object->setAlert($this->denormalizer->denormalize($data['alert'], 'Braze\\Model\\MessagesLiveActivityUpdatePostBodyNotificationAlert', 'json', $context)); + unset($data['alert']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('alert', $data)) { - $object->setAlert($this->denormalizer->denormalize($data['alert'], 'Braze\\Model\\MessagesLiveActivityUpdatePostBodyNotificationAlert', 'json', $context)); - unset($data['alert']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('alert') && null !== $object->getAlert()) { + $data['alert'] = $this->normalizer->normalize($object->getAlert(), 'json', $context); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\MessagesLiveActivityUpdatePostBodyNotification' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class MessagesLiveActivityUpdatePostBodyNotificationNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('alert') && null !== $object->getAlert()) { - $data['alert'] = $this->normalizer->normalize($object->getAlert(), 'json', $context); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\MessagesLiveActivityUpdatePostBodyNotification'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesLiveActivityUpdatePostBodyNotification'; + } + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\MessagesLiveActivityUpdatePostBodyNotification(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('alert', $data)) { + $object->setAlert($this->denormalizer->denormalize($data['alert'], 'Braze\\Model\\MessagesLiveActivityUpdatePostBodyNotificationAlert', 'json', $context)); + unset($data['alert']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('alert') && null !== $object->getAlert()) { + $data['alert'] = $this->normalizer->normalize($object->getAlert(), 'json', $context); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\MessagesLiveActivityUpdatePostBodyNotification' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\MessagesLiveActivityUpdatePostBodyNotification' => false]; + } } } diff --git a/lib/Normalizer/MessagesScheduleCreatePostBodyAudienceNormalizer.php b/lib/Normalizer/MessagesScheduleCreatePostBodyAudienceNormalizer.php index 42f7cb2..6c6ee57 100644 --- a/lib/Normalizer/MessagesScheduleCreatePostBodyAudienceNormalizer.php +++ b/lib/Normalizer/MessagesScheduleCreatePostBodyAudienceNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,76 +21,149 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class MessagesScheduleCreatePostBodyAudienceNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class MessagesScheduleCreatePostBodyAudienceNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return $type === 'Braze\\Model\\MessagesScheduleCreatePostBodyAudience'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool - { - return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesScheduleCreatePostBodyAudience'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\MessagesScheduleCreatePostBodyAudience'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesScheduleCreatePostBodyAudience'; } - $object = new \Braze\Model\MessagesScheduleCreatePostBodyAudience(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\MessagesScheduleCreatePostBodyAudience(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('AND', $data)) { + $values = []; + foreach ($data['AND'] as $value) { + $values[] = $value; + } + $object->setAND($values); + unset($data['AND']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('AND', $data)) { - $values = []; - foreach ($data['AND'] as $value) { - $values[] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('aND') && null !== $object->getAND()) { + $values = []; + foreach ($object->getAND() as $value) { + $values[] = $value; + } + $data['AND'] = $values; } - $object->setAND($values); - unset($data['AND']); - } - foreach ($data as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value_1; + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\MessagesScheduleCreatePostBodyAudience' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class MessagesScheduleCreatePostBodyAudienceNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('aND') && null !== $object->getAND()) { - $values = []; - foreach ($object->getAND() as $value) { - $values[] = $value; - } - $data['AND'] = $values; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\MessagesScheduleCreatePostBodyAudience'; } - foreach ($object as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value_1; + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesScheduleCreatePostBodyAudience'; + } + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\MessagesScheduleCreatePostBodyAudience(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('AND', $data)) { + $values = []; + foreach ($data['AND'] as $value) { + $values[] = $value; + } + $object->setAND($values); + unset($data['AND']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('aND') && null !== $object->getAND()) { + $values = []; + foreach ($object->getAND() as $value) { + $values[] = $value; + } + $data['AND'] = $values; + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\MessagesScheduleCreatePostBodyAudience' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\MessagesScheduleCreatePostBodyAudience' => false]; + } } } diff --git a/lib/Normalizer/MessagesScheduleCreatePostBodyMessagesNormalizer.php b/lib/Normalizer/MessagesScheduleCreatePostBodyMessagesNormalizer.php index 55af149..81253fe 100644 --- a/lib/Normalizer/MessagesScheduleCreatePostBodyMessagesNormalizer.php +++ b/lib/Normalizer/MessagesScheduleCreatePostBodyMessagesNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,196 +21,389 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class MessagesScheduleCreatePostBodyMessagesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class MessagesScheduleCreatePostBodyMessagesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return $type === 'Braze\\Model\\MessagesScheduleCreatePostBodyMessages'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool - { - return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesScheduleCreatePostBodyMessages'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\MessagesScheduleCreatePostBodyMessages'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesScheduleCreatePostBodyMessages'; } - $object = new \Braze\Model\MessagesScheduleCreatePostBodyMessages(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\MessagesScheduleCreatePostBodyMessages(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('apple_push', $data)) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['apple_push'] as $key => $value) { + $values[$key] = $value; + } + $object->setApplePush($values); + unset($data['apple_push']); + } + if (\array_key_exists('android_push', $data)) { + $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['android_push'] as $key_1 => $value_1) { + $values_1[$key_1] = $value_1; + } + $object->setAndroidPush($values_1); + unset($data['android_push']); + } + if (\array_key_exists('windows_push', $data)) { + $values_2 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['windows_push'] as $key_2 => $value_2) { + $values_2[$key_2] = $value_2; + } + $object->setWindowsPush($values_2); + unset($data['windows_push']); + } + if (\array_key_exists('windows8_push', $data)) { + $values_3 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['windows8_push'] as $key_3 => $value_3) { + $values_3[$key_3] = $value_3; + } + $object->setWindows8Push($values_3); + unset($data['windows8_push']); + } + if (\array_key_exists('kindle_push', $data)) { + $values_4 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['kindle_push'] as $key_4 => $value_4) { + $values_4[$key_4] = $value_4; + } + $object->setKindlePush($values_4); + unset($data['kindle_push']); + } + if (\array_key_exists('web_push', $data)) { + $values_5 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['web_push'] as $key_5 => $value_5) { + $values_5[$key_5] = $value_5; + } + $object->setWebPush($values_5); + unset($data['web_push']); + } + if (\array_key_exists('email', $data)) { + $values_6 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['email'] as $key_6 => $value_6) { + $values_6[$key_6] = $value_6; + } + $object->setEmail($values_6); + unset($data['email']); + } + if (\array_key_exists('webhook', $data)) { + $values_7 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['webhook'] as $key_7 => $value_7) { + $values_7[$key_7] = $value_7; + } + $object->setWebhook($values_7); + unset($data['webhook']); + } + if (\array_key_exists('content_card', $data)) { + $values_8 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['content_card'] as $key_8 => $value_8) { + $values_8[$key_8] = $value_8; + } + $object->setContentCard($values_8); + unset($data['content_card']); + } + foreach ($data as $key_9 => $value_9) { + if (preg_match('/.*/', (string) $key_9)) { + $object[$key_9] = $value_9; + } + } + return $object; } - if (\array_key_exists('apple_push', $data)) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data['apple_push'] as $key => $value) { - $values[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('applePush') && null !== $object->getApplePush()) { + $values = []; + foreach ($object->getApplePush() as $key => $value) { + $values[$key] = $value; + } + $data['apple_push'] = $values; } - $object->setApplePush($values); - unset($data['apple_push']); - } - if (\array_key_exists('android_push', $data)) { - $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data['android_push'] as $key_1 => $value_1) { - $values_1[$key_1] = $value_1; + if ($object->isInitialized('androidPush') && null !== $object->getAndroidPush()) { + $values_1 = []; + foreach ($object->getAndroidPush() as $key_1 => $value_1) { + $values_1[$key_1] = $value_1; + } + $data['android_push'] = $values_1; } - $object->setAndroidPush($values_1); - unset($data['android_push']); - } - if (\array_key_exists('windows_push', $data)) { - $values_2 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data['windows_push'] as $key_2 => $value_2) { - $values_2[$key_2] = $value_2; + if ($object->isInitialized('windowsPush') && null !== $object->getWindowsPush()) { + $values_2 = []; + foreach ($object->getWindowsPush() as $key_2 => $value_2) { + $values_2[$key_2] = $value_2; + } + $data['windows_push'] = $values_2; } - $object->setWindowsPush($values_2); - unset($data['windows_push']); - } - if (\array_key_exists('windows8_push', $data)) { - $values_3 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data['windows8_push'] as $key_3 => $value_3) { - $values_3[$key_3] = $value_3; + if ($object->isInitialized('windows8Push') && null !== $object->getWindows8Push()) { + $values_3 = []; + foreach ($object->getWindows8Push() as $key_3 => $value_3) { + $values_3[$key_3] = $value_3; + } + $data['windows8_push'] = $values_3; } - $object->setWindows8Push($values_3); - unset($data['windows8_push']); - } - if (\array_key_exists('kindle_push', $data)) { - $values_4 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data['kindle_push'] as $key_4 => $value_4) { - $values_4[$key_4] = $value_4; + if ($object->isInitialized('kindlePush') && null !== $object->getKindlePush()) { + $values_4 = []; + foreach ($object->getKindlePush() as $key_4 => $value_4) { + $values_4[$key_4] = $value_4; + } + $data['kindle_push'] = $values_4; } - $object->setKindlePush($values_4); - unset($data['kindle_push']); - } - if (\array_key_exists('web_push', $data)) { - $values_5 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data['web_push'] as $key_5 => $value_5) { - $values_5[$key_5] = $value_5; + if ($object->isInitialized('webPush') && null !== $object->getWebPush()) { + $values_5 = []; + foreach ($object->getWebPush() as $key_5 => $value_5) { + $values_5[$key_5] = $value_5; + } + $data['web_push'] = $values_5; } - $object->setWebPush($values_5); - unset($data['web_push']); - } - if (\array_key_exists('email', $data)) { - $values_6 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data['email'] as $key_6 => $value_6) { - $values_6[$key_6] = $value_6; + if ($object->isInitialized('email') && null !== $object->getEmail()) { + $values_6 = []; + foreach ($object->getEmail() as $key_6 => $value_6) { + $values_6[$key_6] = $value_6; + } + $data['email'] = $values_6; } - $object->setEmail($values_6); - unset($data['email']); - } - if (\array_key_exists('webhook', $data)) { - $values_7 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data['webhook'] as $key_7 => $value_7) { - $values_7[$key_7] = $value_7; + if ($object->isInitialized('webhook') && null !== $object->getWebhook()) { + $values_7 = []; + foreach ($object->getWebhook() as $key_7 => $value_7) { + $values_7[$key_7] = $value_7; + } + $data['webhook'] = $values_7; } - $object->setWebhook($values_7); - unset($data['webhook']); - } - if (\array_key_exists('content_card', $data)) { - $values_8 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data['content_card'] as $key_8 => $value_8) { - $values_8[$key_8] = $value_8; + if ($object->isInitialized('contentCard') && null !== $object->getContentCard()) { + $values_8 = []; + foreach ($object->getContentCard() as $key_8 => $value_8) { + $values_8[$key_8] = $value_8; + } + $data['content_card'] = $values_8; } - $object->setContentCard($values_8); - unset($data['content_card']); - } - foreach ($data as $key_9 => $value_9) { - if (preg_match('/.*/', (string) $key_9)) { - $object[$key_9] = $value_9; + foreach ($object as $key_9 => $value_9) { + if (preg_match('/.*/', (string) $key_9)) { + $data[$key_9] = $value_9; + } } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\MessagesScheduleCreatePostBodyMessages' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class MessagesScheduleCreatePostBodyMessagesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('applePush') && null !== $object->getApplePush()) { - $values = []; - foreach ($object->getApplePush() as $key => $value) { - $values[$key] = $value; - } - $data['apple_push'] = $values; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\MessagesScheduleCreatePostBodyMessages'; } - if ($object->isInitialized('androidPush') && null !== $object->getAndroidPush()) { - $values_1 = []; - foreach ($object->getAndroidPush() as $key_1 => $value_1) { - $values_1[$key_1] = $value_1; - } - $data['android_push'] = $values_1; + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesScheduleCreatePostBodyMessages'; } - if ($object->isInitialized('windowsPush') && null !== $object->getWindowsPush()) { - $values_2 = []; - foreach ($object->getWindowsPush() as $key_2 => $value_2) { - $values_2[$key_2] = $value_2; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - $data['windows_push'] = $values_2; - } - if ($object->isInitialized('windows8Push') && null !== $object->getWindows8Push()) { - $values_3 = []; - foreach ($object->getWindows8Push() as $key_3 => $value_3) { - $values_3[$key_3] = $value_3; + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } - $data['windows8_push'] = $values_3; - } - if ($object->isInitialized('kindlePush') && null !== $object->getKindlePush()) { - $values_4 = []; - foreach ($object->getKindlePush() as $key_4 => $value_4) { - $values_4[$key_4] = $value_4; + $object = new \Braze\Model\MessagesScheduleCreatePostBodyMessages(); + if (null === $data || false === \is_array($data)) { + return $object; } - $data['kindle_push'] = $values_4; - } - if ($object->isInitialized('webPush') && null !== $object->getWebPush()) { - $values_5 = []; - foreach ($object->getWebPush() as $key_5 => $value_5) { - $values_5[$key_5] = $value_5; + if (\array_key_exists('apple_push', $data)) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['apple_push'] as $key => $value) { + $values[$key] = $value; + } + $object->setApplePush($values); + unset($data['apple_push']); } - $data['web_push'] = $values_5; - } - if ($object->isInitialized('email') && null !== $object->getEmail()) { - $values_6 = []; - foreach ($object->getEmail() as $key_6 => $value_6) { - $values_6[$key_6] = $value_6; + if (\array_key_exists('android_push', $data)) { + $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['android_push'] as $key_1 => $value_1) { + $values_1[$key_1] = $value_1; + } + $object->setAndroidPush($values_1); + unset($data['android_push']); } - $data['email'] = $values_6; - } - if ($object->isInitialized('webhook') && null !== $object->getWebhook()) { - $values_7 = []; - foreach ($object->getWebhook() as $key_7 => $value_7) { - $values_7[$key_7] = $value_7; + if (\array_key_exists('windows_push', $data)) { + $values_2 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['windows_push'] as $key_2 => $value_2) { + $values_2[$key_2] = $value_2; + } + $object->setWindowsPush($values_2); + unset($data['windows_push']); } - $data['webhook'] = $values_7; - } - if ($object->isInitialized('contentCard') && null !== $object->getContentCard()) { - $values_8 = []; - foreach ($object->getContentCard() as $key_8 => $value_8) { - $values_8[$key_8] = $value_8; + if (\array_key_exists('windows8_push', $data)) { + $values_3 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['windows8_push'] as $key_3 => $value_3) { + $values_3[$key_3] = $value_3; + } + $object->setWindows8Push($values_3); + unset($data['windows8_push']); } - $data['content_card'] = $values_8; - } - foreach ($object as $key_9 => $value_9) { - if (preg_match('/.*/', (string) $key_9)) { - $data[$key_9] = $value_9; + if (\array_key_exists('kindle_push', $data)) { + $values_4 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['kindle_push'] as $key_4 => $value_4) { + $values_4[$key_4] = $value_4; + } + $object->setKindlePush($values_4); + unset($data['kindle_push']); + } + if (\array_key_exists('web_push', $data)) { + $values_5 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['web_push'] as $key_5 => $value_5) { + $values_5[$key_5] = $value_5; + } + $object->setWebPush($values_5); + unset($data['web_push']); + } + if (\array_key_exists('email', $data)) { + $values_6 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['email'] as $key_6 => $value_6) { + $values_6[$key_6] = $value_6; + } + $object->setEmail($values_6); + unset($data['email']); + } + if (\array_key_exists('webhook', $data)) { + $values_7 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['webhook'] as $key_7 => $value_7) { + $values_7[$key_7] = $value_7; + } + $object->setWebhook($values_7); + unset($data['webhook']); + } + if (\array_key_exists('content_card', $data)) { + $values_8 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['content_card'] as $key_8 => $value_8) { + $values_8[$key_8] = $value_8; + } + $object->setContentCard($values_8); + unset($data['content_card']); + } + foreach ($data as $key_9 => $value_9) { + if (preg_match('/.*/', (string) $key_9)) { + $object[$key_9] = $value_9; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('applePush') && null !== $object->getApplePush()) { + $values = []; + foreach ($object->getApplePush() as $key => $value) { + $values[$key] = $value; + } + $data['apple_push'] = $values; + } + if ($object->isInitialized('androidPush') && null !== $object->getAndroidPush()) { + $values_1 = []; + foreach ($object->getAndroidPush() as $key_1 => $value_1) { + $values_1[$key_1] = $value_1; + } + $data['android_push'] = $values_1; + } + if ($object->isInitialized('windowsPush') && null !== $object->getWindowsPush()) { + $values_2 = []; + foreach ($object->getWindowsPush() as $key_2 => $value_2) { + $values_2[$key_2] = $value_2; + } + $data['windows_push'] = $values_2; + } + if ($object->isInitialized('windows8Push') && null !== $object->getWindows8Push()) { + $values_3 = []; + foreach ($object->getWindows8Push() as $key_3 => $value_3) { + $values_3[$key_3] = $value_3; + } + $data['windows8_push'] = $values_3; + } + if ($object->isInitialized('kindlePush') && null !== $object->getKindlePush()) { + $values_4 = []; + foreach ($object->getKindlePush() as $key_4 => $value_4) { + $values_4[$key_4] = $value_4; + } + $data['kindle_push'] = $values_4; + } + if ($object->isInitialized('webPush') && null !== $object->getWebPush()) { + $values_5 = []; + foreach ($object->getWebPush() as $key_5 => $value_5) { + $values_5[$key_5] = $value_5; + } + $data['web_push'] = $values_5; + } + if ($object->isInitialized('email') && null !== $object->getEmail()) { + $values_6 = []; + foreach ($object->getEmail() as $key_6 => $value_6) { + $values_6[$key_6] = $value_6; + } + $data['email'] = $values_6; + } + if ($object->isInitialized('webhook') && null !== $object->getWebhook()) { + $values_7 = []; + foreach ($object->getWebhook() as $key_7 => $value_7) { + $values_7[$key_7] = $value_7; + } + $data['webhook'] = $values_7; + } + if ($object->isInitialized('contentCard') && null !== $object->getContentCard()) { + $values_8 = []; + foreach ($object->getContentCard() as $key_8 => $value_8) { + $values_8[$key_8] = $value_8; + } + $data['content_card'] = $values_8; + } + foreach ($object as $key_9 => $value_9) { + if (preg_match('/.*/', (string) $key_9)) { + $data[$key_9] = $value_9; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\MessagesScheduleCreatePostBodyMessages' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\MessagesScheduleCreatePostBodyMessages' => false]; + } } } diff --git a/lib/Normalizer/MessagesScheduleCreatePostBodyNormalizer.php b/lib/Normalizer/MessagesScheduleCreatePostBodyNormalizer.php index e5ef8b0..bf4b495 100644 --- a/lib/Normalizer/MessagesScheduleCreatePostBodyNormalizer.php +++ b/lib/Normalizer/MessagesScheduleCreatePostBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,138 +21,273 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class MessagesScheduleCreatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\MessagesScheduleCreatePostBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class MessagesScheduleCreatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesScheduleCreatePostBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\MessagesScheduleCreatePostBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesScheduleCreatePostBody'; } - $object = new \Braze\Model\MessagesScheduleCreatePostBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\MessagesScheduleCreatePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('broadcast', $data)) { + $object->setBroadcast($data['broadcast']); + unset($data['broadcast']); + } + if (\array_key_exists('external_user_ids', $data)) { + $object->setExternalUserIds($data['external_user_ids']); + unset($data['external_user_ids']); + } + if (\array_key_exists('user_aliases', $data)) { + $object->setUserAliases($this->denormalizer->denormalize($data['user_aliases'], 'Braze\\Model\\MessagesScheduleCreatePostBodyUserAliases', 'json', $context)); + unset($data['user_aliases']); + } + if (\array_key_exists('segment_id', $data)) { + $object->setSegmentId($data['segment_id']); + unset($data['segment_id']); + } + if (\array_key_exists('audience', $data)) { + $object->setAudience($this->denormalizer->denormalize($data['audience'], 'Braze\\Model\\MessagesScheduleCreatePostBodyAudience', 'json', $context)); + unset($data['audience']); + } + if (\array_key_exists('campaign_id', $data)) { + $object->setCampaignId($data['campaign_id']); + unset($data['campaign_id']); + } + if (\array_key_exists('send_id', $data)) { + $object->setSendId($data['send_id']); + unset($data['send_id']); + } + if (\array_key_exists('override_messaging_limits', $data)) { + $object->setOverrideMessagingLimits($data['override_messaging_limits']); + unset($data['override_messaging_limits']); + } + if (\array_key_exists('recipient_subscription_state', $data)) { + $object->setRecipientSubscriptionState($data['recipient_subscription_state']); + unset($data['recipient_subscription_state']); + } + if (\array_key_exists('schedule', $data)) { + $object->setSchedule($this->denormalizer->denormalize($data['schedule'], 'Braze\\Model\\MessagesScheduleCreatePostBodySchedule', 'json', $context)); + unset($data['schedule']); + } + if (\array_key_exists('messages', $data)) { + $object->setMessages($this->denormalizer->denormalize($data['messages'], 'Braze\\Model\\MessagesScheduleCreatePostBodyMessages', 'json', $context)); + unset($data['messages']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('broadcast', $data)) { - $object->setBroadcast($data['broadcast']); - unset($data['broadcast']); - } - if (\array_key_exists('external_user_ids', $data)) { - $object->setExternalUserIds($data['external_user_ids']); - unset($data['external_user_ids']); - } - if (\array_key_exists('user_aliases', $data)) { - $object->setUserAliases($this->denormalizer->denormalize($data['user_aliases'], 'Braze\\Model\\MessagesScheduleCreatePostBodyUserAliases', 'json', $context)); - unset($data['user_aliases']); - } - if (\array_key_exists('segment_id', $data)) { - $object->setSegmentId($data['segment_id']); - unset($data['segment_id']); - } - if (\array_key_exists('audience', $data)) { - $object->setAudience($this->denormalizer->denormalize($data['audience'], 'Braze\\Model\\MessagesScheduleCreatePostBodyAudience', 'json', $context)); - unset($data['audience']); - } - if (\array_key_exists('campaign_id', $data)) { - $object->setCampaignId($data['campaign_id']); - unset($data['campaign_id']); - } - if (\array_key_exists('send_id', $data)) { - $object->setSendId($data['send_id']); - unset($data['send_id']); - } - if (\array_key_exists('override_messaging_limits', $data)) { - $object->setOverrideMessagingLimits($data['override_messaging_limits']); - unset($data['override_messaging_limits']); - } - if (\array_key_exists('recipient_subscription_state', $data)) { - $object->setRecipientSubscriptionState($data['recipient_subscription_state']); - unset($data['recipient_subscription_state']); - } - if (\array_key_exists('schedule', $data)) { - $object->setSchedule($this->denormalizer->denormalize($data['schedule'], 'Braze\\Model\\MessagesScheduleCreatePostBodySchedule', 'json', $context)); - unset($data['schedule']); - } - if (\array_key_exists('messages', $data)) { - $object->setMessages($this->denormalizer->denormalize($data['messages'], 'Braze\\Model\\MessagesScheduleCreatePostBodyMessages', 'json', $context)); - unset($data['messages']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('broadcast') && null !== $object->getBroadcast()) { + $data['broadcast'] = $object->getBroadcast(); } + if ($object->isInitialized('externalUserIds') && null !== $object->getExternalUserIds()) { + $data['external_user_ids'] = $object->getExternalUserIds(); + } + if ($object->isInitialized('userAliases') && null !== $object->getUserAliases()) { + $data['user_aliases'] = $this->normalizer->normalize($object->getUserAliases(), 'json', $context); + } + if ($object->isInitialized('segmentId') && null !== $object->getSegmentId()) { + $data['segment_id'] = $object->getSegmentId(); + } + if ($object->isInitialized('audience') && null !== $object->getAudience()) { + $data['audience'] = $this->normalizer->normalize($object->getAudience(), 'json', $context); + } + if ($object->isInitialized('campaignId') && null !== $object->getCampaignId()) { + $data['campaign_id'] = $object->getCampaignId(); + } + if ($object->isInitialized('sendId') && null !== $object->getSendId()) { + $data['send_id'] = $object->getSendId(); + } + if ($object->isInitialized('overrideMessagingLimits') && null !== $object->getOverrideMessagingLimits()) { + $data['override_messaging_limits'] = $object->getOverrideMessagingLimits(); + } + if ($object->isInitialized('recipientSubscriptionState') && null !== $object->getRecipientSubscriptionState()) { + $data['recipient_subscription_state'] = $object->getRecipientSubscriptionState(); + } + if ($object->isInitialized('schedule') && null !== $object->getSchedule()) { + $data['schedule'] = $this->normalizer->normalize($object->getSchedule(), 'json', $context); + } + if ($object->isInitialized('messages') && null !== $object->getMessages()) { + $data['messages'] = $this->normalizer->normalize($object->getMessages(), 'json', $context); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\MessagesScheduleCreatePostBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class MessagesScheduleCreatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('broadcast') && null !== $object->getBroadcast()) { - $data['broadcast'] = $object->getBroadcast(); - } - if ($object->isInitialized('externalUserIds') && null !== $object->getExternalUserIds()) { - $data['external_user_ids'] = $object->getExternalUserIds(); - } - if ($object->isInitialized('userAliases') && null !== $object->getUserAliases()) { - $data['user_aliases'] = $this->normalizer->normalize($object->getUserAliases(), 'json', $context); - } - if ($object->isInitialized('segmentId') && null !== $object->getSegmentId()) { - $data['segment_id'] = $object->getSegmentId(); - } - if ($object->isInitialized('audience') && null !== $object->getAudience()) { - $data['audience'] = $this->normalizer->normalize($object->getAudience(), 'json', $context); - } - if ($object->isInitialized('campaignId') && null !== $object->getCampaignId()) { - $data['campaign_id'] = $object->getCampaignId(); - } - if ($object->isInitialized('sendId') && null !== $object->getSendId()) { - $data['send_id'] = $object->getSendId(); - } - if ($object->isInitialized('overrideMessagingLimits') && null !== $object->getOverrideMessagingLimits()) { - $data['override_messaging_limits'] = $object->getOverrideMessagingLimits(); - } - if ($object->isInitialized('recipientSubscriptionState') && null !== $object->getRecipientSubscriptionState()) { - $data['recipient_subscription_state'] = $object->getRecipientSubscriptionState(); - } - if ($object->isInitialized('schedule') && null !== $object->getSchedule()) { - $data['schedule'] = $this->normalizer->normalize($object->getSchedule(), 'json', $context); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\MessagesScheduleCreatePostBody'; } - if ($object->isInitialized('messages') && null !== $object->getMessages()) { - $data['messages'] = $this->normalizer->normalize($object->getMessages(), 'json', $context); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesScheduleCreatePostBody'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\MessagesScheduleCreatePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('broadcast', $data)) { + $object->setBroadcast($data['broadcast']); + unset($data['broadcast']); + } + if (\array_key_exists('external_user_ids', $data)) { + $object->setExternalUserIds($data['external_user_ids']); + unset($data['external_user_ids']); + } + if (\array_key_exists('user_aliases', $data)) { + $object->setUserAliases($this->denormalizer->denormalize($data['user_aliases'], 'Braze\\Model\\MessagesScheduleCreatePostBodyUserAliases', 'json', $context)); + unset($data['user_aliases']); + } + if (\array_key_exists('segment_id', $data)) { + $object->setSegmentId($data['segment_id']); + unset($data['segment_id']); + } + if (\array_key_exists('audience', $data)) { + $object->setAudience($this->denormalizer->denormalize($data['audience'], 'Braze\\Model\\MessagesScheduleCreatePostBodyAudience', 'json', $context)); + unset($data['audience']); + } + if (\array_key_exists('campaign_id', $data)) { + $object->setCampaignId($data['campaign_id']); + unset($data['campaign_id']); + } + if (\array_key_exists('send_id', $data)) { + $object->setSendId($data['send_id']); + unset($data['send_id']); + } + if (\array_key_exists('override_messaging_limits', $data)) { + $object->setOverrideMessagingLimits($data['override_messaging_limits']); + unset($data['override_messaging_limits']); } + if (\array_key_exists('recipient_subscription_state', $data)) { + $object->setRecipientSubscriptionState($data['recipient_subscription_state']); + unset($data['recipient_subscription_state']); + } + if (\array_key_exists('schedule', $data)) { + $object->setSchedule($this->denormalizer->denormalize($data['schedule'], 'Braze\\Model\\MessagesScheduleCreatePostBodySchedule', 'json', $context)); + unset($data['schedule']); + } + if (\array_key_exists('messages', $data)) { + $object->setMessages($this->denormalizer->denormalize($data['messages'], 'Braze\\Model\\MessagesScheduleCreatePostBodyMessages', 'json', $context)); + unset($data['messages']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('broadcast') && null !== $object->getBroadcast()) { + $data['broadcast'] = $object->getBroadcast(); + } + if ($object->isInitialized('externalUserIds') && null !== $object->getExternalUserIds()) { + $data['external_user_ids'] = $object->getExternalUserIds(); + } + if ($object->isInitialized('userAliases') && null !== $object->getUserAliases()) { + $data['user_aliases'] = $this->normalizer->normalize($object->getUserAliases(), 'json', $context); + } + if ($object->isInitialized('segmentId') && null !== $object->getSegmentId()) { + $data['segment_id'] = $object->getSegmentId(); + } + if ($object->isInitialized('audience') && null !== $object->getAudience()) { + $data['audience'] = $this->normalizer->normalize($object->getAudience(), 'json', $context); + } + if ($object->isInitialized('campaignId') && null !== $object->getCampaignId()) { + $data['campaign_id'] = $object->getCampaignId(); + } + if ($object->isInitialized('sendId') && null !== $object->getSendId()) { + $data['send_id'] = $object->getSendId(); + } + if ($object->isInitialized('overrideMessagingLimits') && null !== $object->getOverrideMessagingLimits()) { + $data['override_messaging_limits'] = $object->getOverrideMessagingLimits(); + } + if ($object->isInitialized('recipientSubscriptionState') && null !== $object->getRecipientSubscriptionState()) { + $data['recipient_subscription_state'] = $object->getRecipientSubscriptionState(); + } + if ($object->isInitialized('schedule') && null !== $object->getSchedule()) { + $data['schedule'] = $this->normalizer->normalize($object->getSchedule(), 'json', $context); + } + if ($object->isInitialized('messages') && null !== $object->getMessages()) { + $data['messages'] = $this->normalizer->normalize($object->getMessages(), 'json', $context); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\MessagesScheduleCreatePostBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\MessagesScheduleCreatePostBody' => false]; + } } } diff --git a/lib/Normalizer/MessagesScheduleCreatePostBodyScheduleNormalizer.php b/lib/Normalizer/MessagesScheduleCreatePostBodyScheduleNormalizer.php index 9bac937..0ac0e1e 100644 --- a/lib/Normalizer/MessagesScheduleCreatePostBodyScheduleNormalizer.php +++ b/lib/Normalizer/MessagesScheduleCreatePostBodyScheduleNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,82 +21,161 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class MessagesScheduleCreatePostBodyScheduleNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\MessagesScheduleCreatePostBodySchedule'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class MessagesScheduleCreatePostBodyScheduleNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesScheduleCreatePostBodySchedule'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\MessagesScheduleCreatePostBodySchedule'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesScheduleCreatePostBodySchedule'; } - $object = new \Braze\Model\MessagesScheduleCreatePostBodySchedule(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\MessagesScheduleCreatePostBodySchedule(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('time', $data)) { + $object->setTime($data['time']); + unset($data['time']); + } + if (\array_key_exists('in_local_time', $data)) { + $object->setInLocalTime($data['in_local_time']); + unset($data['in_local_time']); + } + if (\array_key_exists('at_optimal_time', $data)) { + $object->setAtOptimalTime($data['at_optimal_time']); + unset($data['at_optimal_time']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('time', $data)) { - $object->setTime($data['time']); - unset($data['time']); - } - if (\array_key_exists('in_local_time', $data)) { - $object->setInLocalTime($data['in_local_time']); - unset($data['in_local_time']); - } - if (\array_key_exists('at_optimal_time', $data)) { - $object->setAtOptimalTime($data['at_optimal_time']); - unset($data['at_optimal_time']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('time') && null !== $object->getTime()) { + $data['time'] = $object->getTime(); + } + if ($object->isInitialized('inLocalTime') && null !== $object->getInLocalTime()) { + $data['in_local_time'] = $object->getInLocalTime(); } + if ($object->isInitialized('atOptimalTime') && null !== $object->getAtOptimalTime()) { + $data['at_optimal_time'] = $object->getAtOptimalTime(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\MessagesScheduleCreatePostBodySchedule' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class MessagesScheduleCreatePostBodyScheduleNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('time') && null !== $object->getTime()) { - $data['time'] = $object->getTime(); - } - if ($object->isInitialized('inLocalTime') && null !== $object->getInLocalTime()) { - $data['in_local_time'] = $object->getInLocalTime(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\MessagesScheduleCreatePostBodySchedule'; } - if ($object->isInitialized('atOptimalTime') && null !== $object->getAtOptimalTime()) { - $data['at_optimal_time'] = $object->getAtOptimalTime(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesScheduleCreatePostBodySchedule'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\MessagesScheduleCreatePostBodySchedule(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('time', $data)) { + $object->setTime($data['time']); + unset($data['time']); + } + if (\array_key_exists('in_local_time', $data)) { + $object->setInLocalTime($data['in_local_time']); + unset($data['in_local_time']); + } + if (\array_key_exists('at_optimal_time', $data)) { + $object->setAtOptimalTime($data['at_optimal_time']); + unset($data['at_optimal_time']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('time') && null !== $object->getTime()) { + $data['time'] = $object->getTime(); + } + if ($object->isInitialized('inLocalTime') && null !== $object->getInLocalTime()) { + $data['in_local_time'] = $object->getInLocalTime(); + } + if ($object->isInitialized('atOptimalTime') && null !== $object->getAtOptimalTime()) { + $data['at_optimal_time'] = $object->getAtOptimalTime(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\MessagesScheduleCreatePostBodySchedule' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\MessagesScheduleCreatePostBodySchedule' => false]; + } } } diff --git a/lib/Normalizer/MessagesScheduleCreatePostBodyUserAliasesNormalizer.php b/lib/Normalizer/MessagesScheduleCreatePostBodyUserAliasesNormalizer.php index 8cf0521..809eaf4 100644 --- a/lib/Normalizer/MessagesScheduleCreatePostBodyUserAliasesNormalizer.php +++ b/lib/Normalizer/MessagesScheduleCreatePostBodyUserAliasesNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,75 +21,147 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class MessagesScheduleCreatePostBodyUserAliasesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\MessagesScheduleCreatePostBodyUserAliases'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class MessagesScheduleCreatePostBodyUserAliasesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesScheduleCreatePostBodyUserAliases'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\MessagesScheduleCreatePostBodyUserAliases'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesScheduleCreatePostBodyUserAliases'; } - $object = new \Braze\Model\MessagesScheduleCreatePostBodyUserAliases(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\MessagesScheduleCreatePostBodyUserAliases(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('alias_name', $data)) { + $object->setAliasName($data['alias_name']); + unset($data['alias_name']); + } + if (\array_key_exists('alias_label', $data)) { + $object->setAliasLabel($data['alias_label']); + unset($data['alias_label']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('alias_name', $data)) { - $object->setAliasName($data['alias_name']); - unset($data['alias_name']); - } - if (\array_key_exists('alias_label', $data)) { - $object->setAliasLabel($data['alias_label']); - unset($data['alias_label']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('aliasName') && null !== $object->getAliasName()) { + $data['alias_name'] = $object->getAliasName(); + } + if ($object->isInitialized('aliasLabel') && null !== $object->getAliasLabel()) { + $data['alias_label'] = $object->getAliasLabel(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\MessagesScheduleCreatePostBodyUserAliases' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class MessagesScheduleCreatePostBodyUserAliasesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('aliasName') && null !== $object->getAliasName()) { - $data['alias_name'] = $object->getAliasName(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\MessagesScheduleCreatePostBodyUserAliases'; } - if ($object->isInitialized('aliasLabel') && null !== $object->getAliasLabel()) { - $data['alias_label'] = $object->getAliasLabel(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesScheduleCreatePostBodyUserAliases'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\MessagesScheduleCreatePostBodyUserAliases(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('alias_name', $data)) { + $object->setAliasName($data['alias_name']); + unset($data['alias_name']); + } + if (\array_key_exists('alias_label', $data)) { + $object->setAliasLabel($data['alias_label']); + unset($data['alias_label']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('aliasName') && null !== $object->getAliasName()) { + $data['alias_name'] = $object->getAliasName(); + } + if ($object->isInitialized('aliasLabel') && null !== $object->getAliasLabel()) { + $data['alias_label'] = $object->getAliasLabel(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\MessagesScheduleCreatePostBodyUserAliases' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\MessagesScheduleCreatePostBodyUserAliases' => false]; + } } } diff --git a/lib/Normalizer/MessagesScheduleDeletePostBodyNormalizer.php b/lib/Normalizer/MessagesScheduleDeletePostBodyNormalizer.php index 8b4b5cd..19aea68 100644 --- a/lib/Normalizer/MessagesScheduleDeletePostBodyNormalizer.php +++ b/lib/Normalizer/MessagesScheduleDeletePostBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,68 +21,133 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class MessagesScheduleDeletePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class MessagesScheduleDeletePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return $type === 'Braze\\Model\\MessagesScheduleDeletePostBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool - { - return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesScheduleDeletePostBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\MessagesScheduleDeletePostBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesScheduleDeletePostBody'; } - $object = new \Braze\Model\MessagesScheduleDeletePostBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\MessagesScheduleDeletePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('schedule_id', $data)) { + $object->setScheduleId($data['schedule_id']); + unset($data['schedule_id']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('schedule_id', $data)) { - $object->setScheduleId($data['schedule_id']); - unset($data['schedule_id']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('scheduleId') && null !== $object->getScheduleId()) { + $data['schedule_id'] = $object->getScheduleId(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\MessagesScheduleDeletePostBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class MessagesScheduleDeletePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('scheduleId') && null !== $object->getScheduleId()) { - $data['schedule_id'] = $object->getScheduleId(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\MessagesScheduleDeletePostBody'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesScheduleDeletePostBody'; + } + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\MessagesScheduleDeletePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('schedule_id', $data)) { + $object->setScheduleId($data['schedule_id']); + unset($data['schedule_id']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('scheduleId') && null !== $object->getScheduleId()) { + $data['schedule_id'] = $object->getScheduleId(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\MessagesScheduleDeletePostBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\MessagesScheduleDeletePostBody' => false]; + } } } diff --git a/lib/Normalizer/MessagesScheduleUpdatePostBodyMessagesAndroidPushNormalizer.php b/lib/Normalizer/MessagesScheduleUpdatePostBodyMessagesAndroidPushNormalizer.php index 50f4984..390eaa0 100644 --- a/lib/Normalizer/MessagesScheduleUpdatePostBodyMessagesAndroidPushNormalizer.php +++ b/lib/Normalizer/MessagesScheduleUpdatePostBodyMessagesAndroidPushNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,75 +21,147 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class MessagesScheduleUpdatePostBodyMessagesAndroidPushNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesAndroidPush'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class MessagesScheduleUpdatePostBodyMessagesAndroidPushNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesAndroidPush'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesAndroidPush'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesAndroidPush'; } - $object = new \Braze\Model\MessagesScheduleUpdatePostBodyMessagesAndroidPush(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\MessagesScheduleUpdatePostBodyMessagesAndroidPush(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('title', $data)) { + $object->setTitle($data['title']); + unset($data['title']); + } + if (\array_key_exists('alert', $data)) { + $object->setAlert($data['alert']); + unset($data['alert']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('title', $data)) { - $object->setTitle($data['title']); - unset($data['title']); - } - if (\array_key_exists('alert', $data)) { - $object->setAlert($data['alert']); - unset($data['alert']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('title') && null !== $object->getTitle()) { + $data['title'] = $object->getTitle(); + } + if ($object->isInitialized('alert') && null !== $object->getAlert()) { + $data['alert'] = $object->getAlert(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesAndroidPush' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class MessagesScheduleUpdatePostBodyMessagesAndroidPushNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('title') && null !== $object->getTitle()) { - $data['title'] = $object->getTitle(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesAndroidPush'; } - if ($object->isInitialized('alert') && null !== $object->getAlert()) { - $data['alert'] = $object->getAlert(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesAndroidPush'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\MessagesScheduleUpdatePostBodyMessagesAndroidPush(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('title', $data)) { + $object->setTitle($data['title']); + unset($data['title']); + } + if (\array_key_exists('alert', $data)) { + $object->setAlert($data['alert']); + unset($data['alert']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('title') && null !== $object->getTitle()) { + $data['title'] = $object->getTitle(); + } + if ($object->isInitialized('alert') && null !== $object->getAlert()) { + $data['alert'] = $object->getAlert(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesAndroidPush' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesAndroidPush' => false]; + } } } diff --git a/lib/Normalizer/MessagesScheduleUpdatePostBodyMessagesApplePushNormalizer.php b/lib/Normalizer/MessagesScheduleUpdatePostBodyMessagesApplePushNormalizer.php index c960155..bf71d5e 100644 --- a/lib/Normalizer/MessagesScheduleUpdatePostBodyMessagesApplePushNormalizer.php +++ b/lib/Normalizer/MessagesScheduleUpdatePostBodyMessagesApplePushNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,75 +21,147 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class MessagesScheduleUpdatePostBodyMessagesApplePushNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesApplePush'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class MessagesScheduleUpdatePostBodyMessagesApplePushNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesApplePush'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesApplePush'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesApplePush'; } - $object = new \Braze\Model\MessagesScheduleUpdatePostBodyMessagesApplePush(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\MessagesScheduleUpdatePostBodyMessagesApplePush(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('alert', $data)) { + $object->setAlert($data['alert']); + unset($data['alert']); + } + if (\array_key_exists('badge', $data)) { + $object->setBadge($data['badge']); + unset($data['badge']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('alert', $data)) { - $object->setAlert($data['alert']); - unset($data['alert']); - } - if (\array_key_exists('badge', $data)) { - $object->setBadge($data['badge']); - unset($data['badge']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('alert') && null !== $object->getAlert()) { + $data['alert'] = $object->getAlert(); + } + if ($object->isInitialized('badge') && null !== $object->getBadge()) { + $data['badge'] = $object->getBadge(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesApplePush' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class MessagesScheduleUpdatePostBodyMessagesApplePushNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('alert') && null !== $object->getAlert()) { - $data['alert'] = $object->getAlert(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesApplePush'; } - if ($object->isInitialized('badge') && null !== $object->getBadge()) { - $data['badge'] = $object->getBadge(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesApplePush'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\MessagesScheduleUpdatePostBodyMessagesApplePush(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('alert', $data)) { + $object->setAlert($data['alert']); + unset($data['alert']); + } + if (\array_key_exists('badge', $data)) { + $object->setBadge($data['badge']); + unset($data['badge']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('alert') && null !== $object->getAlert()) { + $data['alert'] = $object->getAlert(); + } + if ($object->isInitialized('badge') && null !== $object->getBadge()) { + $data['badge'] = $object->getBadge(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesApplePush' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesApplePush' => false]; + } } } diff --git a/lib/Normalizer/MessagesScheduleUpdatePostBodyMessagesNormalizer.php b/lib/Normalizer/MessagesScheduleUpdatePostBodyMessagesNormalizer.php index 9161a44..53aaf7f 100644 --- a/lib/Normalizer/MessagesScheduleUpdatePostBodyMessagesNormalizer.php +++ b/lib/Normalizer/MessagesScheduleUpdatePostBodyMessagesNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,82 +21,161 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class MessagesScheduleUpdatePostBodyMessagesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessages'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class MessagesScheduleUpdatePostBodyMessagesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessages'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessages'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessages'; } - $object = new \Braze\Model\MessagesScheduleUpdatePostBodyMessages(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\MessagesScheduleUpdatePostBodyMessages(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('apple_push', $data)) { + $object->setApplePush($this->denormalizer->denormalize($data['apple_push'], 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesApplePush', 'json', $context)); + unset($data['apple_push']); + } + if (\array_key_exists('android_push', $data)) { + $object->setAndroidPush($this->denormalizer->denormalize($data['android_push'], 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesAndroidPush', 'json', $context)); + unset($data['android_push']); + } + if (\array_key_exists('sms', $data)) { + $object->setSms($this->denormalizer->denormalize($data['sms'], 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesSms', 'json', $context)); + unset($data['sms']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('apple_push', $data)) { - $object->setApplePush($this->denormalizer->denormalize($data['apple_push'], 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesApplePush', 'json', $context)); - unset($data['apple_push']); - } - if (\array_key_exists('android_push', $data)) { - $object->setAndroidPush($this->denormalizer->denormalize($data['android_push'], 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesAndroidPush', 'json', $context)); - unset($data['android_push']); - } - if (\array_key_exists('sms', $data)) { - $object->setSms($this->denormalizer->denormalize($data['sms'], 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesSms', 'json', $context)); - unset($data['sms']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('applePush') && null !== $object->getApplePush()) { + $data['apple_push'] = $this->normalizer->normalize($object->getApplePush(), 'json', $context); + } + if ($object->isInitialized('androidPush') && null !== $object->getAndroidPush()) { + $data['android_push'] = $this->normalizer->normalize($object->getAndroidPush(), 'json', $context); } + if ($object->isInitialized('sms') && null !== $object->getSms()) { + $data['sms'] = $this->normalizer->normalize($object->getSms(), 'json', $context); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\MessagesScheduleUpdatePostBodyMessages' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class MessagesScheduleUpdatePostBodyMessagesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('applePush') && null !== $object->getApplePush()) { - $data['apple_push'] = $this->normalizer->normalize($object->getApplePush(), 'json', $context); - } - if ($object->isInitialized('androidPush') && null !== $object->getAndroidPush()) { - $data['android_push'] = $this->normalizer->normalize($object->getAndroidPush(), 'json', $context); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessages'; } - if ($object->isInitialized('sms') && null !== $object->getSms()) { - $data['sms'] = $this->normalizer->normalize($object->getSms(), 'json', $context); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessages'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\MessagesScheduleUpdatePostBodyMessages(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('apple_push', $data)) { + $object->setApplePush($this->denormalizer->denormalize($data['apple_push'], 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesApplePush', 'json', $context)); + unset($data['apple_push']); + } + if (\array_key_exists('android_push', $data)) { + $object->setAndroidPush($this->denormalizer->denormalize($data['android_push'], 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesAndroidPush', 'json', $context)); + unset($data['android_push']); + } + if (\array_key_exists('sms', $data)) { + $object->setSms($this->denormalizer->denormalize($data['sms'], 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesSms', 'json', $context)); + unset($data['sms']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('applePush') && null !== $object->getApplePush()) { + $data['apple_push'] = $this->normalizer->normalize($object->getApplePush(), 'json', $context); + } + if ($object->isInitialized('androidPush') && null !== $object->getAndroidPush()) { + $data['android_push'] = $this->normalizer->normalize($object->getAndroidPush(), 'json', $context); + } + if ($object->isInitialized('sms') && null !== $object->getSms()) { + $data['sms'] = $this->normalizer->normalize($object->getSms(), 'json', $context); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\MessagesScheduleUpdatePostBodyMessages' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\MessagesScheduleUpdatePostBodyMessages' => false]; + } } } diff --git a/lib/Normalizer/MessagesScheduleUpdatePostBodyMessagesSmsNormalizer.php b/lib/Normalizer/MessagesScheduleUpdatePostBodyMessagesSmsNormalizer.php index e368c52..080970c 100644 --- a/lib/Normalizer/MessagesScheduleUpdatePostBodyMessagesSmsNormalizer.php +++ b/lib/Normalizer/MessagesScheduleUpdatePostBodyMessagesSmsNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,89 +21,175 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class MessagesScheduleUpdatePostBodyMessagesSmsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class MessagesScheduleUpdatePostBodyMessagesSmsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return $type === 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesSms'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function supportsNormalization($data, $format = null, array $context = []): bool - { - return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesSms'; - } - - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesSms'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesSms'; } - $object = new \Braze\Model\MessagesScheduleUpdatePostBodyMessagesSms(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\MessagesScheduleUpdatePostBodyMessagesSms(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('subscription_group_id', $data)) { + $object->setSubscriptionGroupId($data['subscription_group_id']); + unset($data['subscription_group_id']); + } + if (\array_key_exists('message_variation_id', $data)) { + $object->setMessageVariationId($data['message_variation_id']); + unset($data['message_variation_id']); + } + if (\array_key_exists('body', $data)) { + $object->setBody($data['body']); + unset($data['body']); + } + if (\array_key_exists('app_id', $data)) { + $object->setAppId($data['app_id']); + unset($data['app_id']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('subscription_group_id', $data)) { - $object->setSubscriptionGroupId($data['subscription_group_id']); - unset($data['subscription_group_id']); - } - if (\array_key_exists('message_variation_id', $data)) { - $object->setMessageVariationId($data['message_variation_id']); - unset($data['message_variation_id']); - } - if (\array_key_exists('body', $data)) { - $object->setBody($data['body']); - unset($data['body']); - } - if (\array_key_exists('app_id', $data)) { - $object->setAppId($data['app_id']); - unset($data['app_id']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('subscriptionGroupId') && null !== $object->getSubscriptionGroupId()) { + $data['subscription_group_id'] = $object->getSubscriptionGroupId(); + } + if ($object->isInitialized('messageVariationId') && null !== $object->getMessageVariationId()) { + $data['message_variation_id'] = $object->getMessageVariationId(); + } + if ($object->isInitialized('body') && null !== $object->getBody()) { + $data['body'] = $object->getBody(); } + if ($object->isInitialized('appId') && null !== $object->getAppId()) { + $data['app_id'] = $object->getAppId(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesSms' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class MessagesScheduleUpdatePostBodyMessagesSmsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('subscriptionGroupId') && null !== $object->getSubscriptionGroupId()) { - $data['subscription_group_id'] = $object->getSubscriptionGroupId(); - } - if ($object->isInitialized('messageVariationId') && null !== $object->getMessageVariationId()) { - $data['message_variation_id'] = $object->getMessageVariationId(); - } - if ($object->isInitialized('body') && null !== $object->getBody()) { - $data['body'] = $object->getBody(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesSms'; } - if ($object->isInitialized('appId') && null !== $object->getAppId()) { - $data['app_id'] = $object->getAppId(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesSms'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\MessagesScheduleUpdatePostBodyMessagesSms(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('subscription_group_id', $data)) { + $object->setSubscriptionGroupId($data['subscription_group_id']); + unset($data['subscription_group_id']); + } + if (\array_key_exists('message_variation_id', $data)) { + $object->setMessageVariationId($data['message_variation_id']); + unset($data['message_variation_id']); + } + if (\array_key_exists('body', $data)) { + $object->setBody($data['body']); + unset($data['body']); + } + if (\array_key_exists('app_id', $data)) { + $object->setAppId($data['app_id']); + unset($data['app_id']); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('subscriptionGroupId') && null !== $object->getSubscriptionGroupId()) { + $data['subscription_group_id'] = $object->getSubscriptionGroupId(); + } + if ($object->isInitialized('messageVariationId') && null !== $object->getMessageVariationId()) { + $data['message_variation_id'] = $object->getMessageVariationId(); + } + if ($object->isInitialized('body') && null !== $object->getBody()) { + $data['body'] = $object->getBody(); + } + if ($object->isInitialized('appId') && null !== $object->getAppId()) { + $data['app_id'] = $object->getAppId(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesSms' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\MessagesScheduleUpdatePostBodyMessagesSms' => false]; + } } } diff --git a/lib/Normalizer/MessagesScheduleUpdatePostBodyNormalizer.php b/lib/Normalizer/MessagesScheduleUpdatePostBodyNormalizer.php index 8acd254..a6affa1 100644 --- a/lib/Normalizer/MessagesScheduleUpdatePostBodyNormalizer.php +++ b/lib/Normalizer/MessagesScheduleUpdatePostBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,82 +21,161 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class MessagesScheduleUpdatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\MessagesScheduleUpdatePostBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class MessagesScheduleUpdatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesScheduleUpdatePostBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\MessagesScheduleUpdatePostBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesScheduleUpdatePostBody'; } - $object = new \Braze\Model\MessagesScheduleUpdatePostBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\MessagesScheduleUpdatePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('schedule_id', $data)) { + $object->setScheduleId($data['schedule_id']); + unset($data['schedule_id']); + } + if (\array_key_exists('schedule', $data)) { + $object->setSchedule($this->denormalizer->denormalize($data['schedule'], 'Braze\\Model\\MessagesScheduleUpdatePostBodySchedule', 'json', $context)); + unset($data['schedule']); + } + if (\array_key_exists('messages', $data)) { + $object->setMessages($this->denormalizer->denormalize($data['messages'], 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessages', 'json', $context)); + unset($data['messages']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('schedule_id', $data)) { - $object->setScheduleId($data['schedule_id']); - unset($data['schedule_id']); - } - if (\array_key_exists('schedule', $data)) { - $object->setSchedule($this->denormalizer->denormalize($data['schedule'], 'Braze\\Model\\MessagesScheduleUpdatePostBodySchedule', 'json', $context)); - unset($data['schedule']); - } - if (\array_key_exists('messages', $data)) { - $object->setMessages($this->denormalizer->denormalize($data['messages'], 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessages', 'json', $context)); - unset($data['messages']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('scheduleId') && null !== $object->getScheduleId()) { + $data['schedule_id'] = $object->getScheduleId(); + } + if ($object->isInitialized('schedule') && null !== $object->getSchedule()) { + $data['schedule'] = $this->normalizer->normalize($object->getSchedule(), 'json', $context); } + if ($object->isInitialized('messages') && null !== $object->getMessages()) { + $data['messages'] = $this->normalizer->normalize($object->getMessages(), 'json', $context); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\MessagesScheduleUpdatePostBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class MessagesScheduleUpdatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('scheduleId') && null !== $object->getScheduleId()) { - $data['schedule_id'] = $object->getScheduleId(); - } - if ($object->isInitialized('schedule') && null !== $object->getSchedule()) { - $data['schedule'] = $this->normalizer->normalize($object->getSchedule(), 'json', $context); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\MessagesScheduleUpdatePostBody'; } - if ($object->isInitialized('messages') && null !== $object->getMessages()) { - $data['messages'] = $this->normalizer->normalize($object->getMessages(), 'json', $context); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesScheduleUpdatePostBody'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\MessagesScheduleUpdatePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('schedule_id', $data)) { + $object->setScheduleId($data['schedule_id']); + unset($data['schedule_id']); + } + if (\array_key_exists('schedule', $data)) { + $object->setSchedule($this->denormalizer->denormalize($data['schedule'], 'Braze\\Model\\MessagesScheduleUpdatePostBodySchedule', 'json', $context)); + unset($data['schedule']); + } + if (\array_key_exists('messages', $data)) { + $object->setMessages($this->denormalizer->denormalize($data['messages'], 'Braze\\Model\\MessagesScheduleUpdatePostBodyMessages', 'json', $context)); + unset($data['messages']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('scheduleId') && null !== $object->getScheduleId()) { + $data['schedule_id'] = $object->getScheduleId(); + } + if ($object->isInitialized('schedule') && null !== $object->getSchedule()) { + $data['schedule'] = $this->normalizer->normalize($object->getSchedule(), 'json', $context); + } + if ($object->isInitialized('messages') && null !== $object->getMessages()) { + $data['messages'] = $this->normalizer->normalize($object->getMessages(), 'json', $context); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\MessagesScheduleUpdatePostBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\MessagesScheduleUpdatePostBody' => false]; + } } } diff --git a/lib/Normalizer/MessagesScheduleUpdatePostBodyScheduleNormalizer.php b/lib/Normalizer/MessagesScheduleUpdatePostBodyScheduleNormalizer.php index c70eb2c..2b56abd 100644 --- a/lib/Normalizer/MessagesScheduleUpdatePostBodyScheduleNormalizer.php +++ b/lib/Normalizer/MessagesScheduleUpdatePostBodyScheduleNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,68 +21,133 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class MessagesScheduleUpdatePostBodyScheduleNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class MessagesScheduleUpdatePostBodyScheduleNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return $type === 'Braze\\Model\\MessagesScheduleUpdatePostBodySchedule'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool - { - return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesScheduleUpdatePostBodySchedule'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\MessagesScheduleUpdatePostBodySchedule'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesScheduleUpdatePostBodySchedule'; } - $object = new \Braze\Model\MessagesScheduleUpdatePostBodySchedule(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\MessagesScheduleUpdatePostBodySchedule(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('time', $data)) { + $object->setTime(\DateTime::createFromFormat('Y-m-d\\TH:i:sP', $data['time'])); + unset($data['time']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('time', $data)) { - $object->setTime(\DateTime::createFromFormat('Y-m-d\\TH:i:sP', $data['time'])); - unset($data['time']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('time') && null !== $object->getTime()) { + $data['time'] = $object->getTime()->format('Y-m-d\\TH:i:sP'); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\MessagesScheduleUpdatePostBodySchedule' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class MessagesScheduleUpdatePostBodyScheduleNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('time') && null !== $object->getTime()) { - $data['time'] = $object->getTime()->format('Y-m-d\\TH:i:sP'); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\MessagesScheduleUpdatePostBodySchedule'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesScheduleUpdatePostBodySchedule'; + } + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\MessagesScheduleUpdatePostBodySchedule(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('time', $data)) { + $object->setTime(\DateTime::createFromFormat('Y-m-d\\TH:i:sP', $data['time'])); + unset($data['time']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('time') && null !== $object->getTime()) { + $data['time'] = $object->getTime()->format('Y-m-d\\TH:i:sP'); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\MessagesScheduleUpdatePostBodySchedule' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\MessagesScheduleUpdatePostBodySchedule' => false]; + } } } diff --git a/lib/Normalizer/MessagesSendPostBodyAudienceNormalizer.php b/lib/Normalizer/MessagesSendPostBodyAudienceNormalizer.php index 670fc7a..50e0103 100644 --- a/lib/Normalizer/MessagesSendPostBodyAudienceNormalizer.php +++ b/lib/Normalizer/MessagesSendPostBodyAudienceNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,76 +21,149 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class MessagesSendPostBodyAudienceNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class MessagesSendPostBodyAudienceNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return $type === 'Braze\\Model\\MessagesSendPostBodyAudience'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool - { - return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesSendPostBodyAudience'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\MessagesSendPostBodyAudience'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesSendPostBodyAudience'; } - $object = new \Braze\Model\MessagesSendPostBodyAudience(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\MessagesSendPostBodyAudience(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('AND', $data)) { + $values = []; + foreach ($data['AND'] as $value) { + $values[] = $value; + } + $object->setAND($values); + unset($data['AND']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('AND', $data)) { - $values = []; - foreach ($data['AND'] as $value) { - $values[] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('aND') && null !== $object->getAND()) { + $values = []; + foreach ($object->getAND() as $value) { + $values[] = $value; + } + $data['AND'] = $values; } - $object->setAND($values); - unset($data['AND']); - } - foreach ($data as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value_1; + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\MessagesSendPostBodyAudience' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class MessagesSendPostBodyAudienceNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('aND') && null !== $object->getAND()) { - $values = []; - foreach ($object->getAND() as $value) { - $values[] = $value; - } - $data['AND'] = $values; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\MessagesSendPostBodyAudience'; } - foreach ($object as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value_1; + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesSendPostBodyAudience'; + } + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\MessagesSendPostBodyAudience(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('AND', $data)) { + $values = []; + foreach ($data['AND'] as $value) { + $values[] = $value; + } + $object->setAND($values); + unset($data['AND']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('aND') && null !== $object->getAND()) { + $values = []; + foreach ($object->getAND() as $value) { + $values[] = $value; + } + $data['AND'] = $values; + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\MessagesSendPostBodyAudience' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\MessagesSendPostBodyAudience' => false]; + } } } diff --git a/lib/Normalizer/MessagesSendPostBodyMessagesNormalizer.php b/lib/Normalizer/MessagesSendPostBodyMessagesNormalizer.php index a26745a..3389956 100644 --- a/lib/Normalizer/MessagesSendPostBodyMessagesNormalizer.php +++ b/lib/Normalizer/MessagesSendPostBodyMessagesNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,117 +21,231 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class MessagesSendPostBodyMessagesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class MessagesSendPostBodyMessagesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return $type === 'Braze\\Model\\MessagesSendPostBodyMessages'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool - { - return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesSendPostBodyMessages'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\MessagesSendPostBodyMessages'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesSendPostBodyMessages'; } - $object = new \Braze\Model\MessagesSendPostBodyMessages(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\MessagesSendPostBodyMessages(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('android_push', $data)) { + $object->setAndroidPush($data['android_push']); + unset($data['android_push']); + } + if (\array_key_exists('apple_push', $data)) { + $object->setApplePush($data['apple_push']); + unset($data['apple_push']); + } + if (\array_key_exists('content_card', $data)) { + $object->setContentCard($data['content_card']); + unset($data['content_card']); + } + if (\array_key_exists('email', $data)) { + $object->setEmail($data['email']); + unset($data['email']); + } + if (\array_key_exists('kindle_push', $data)) { + $object->setKindlePush($data['kindle_push']); + unset($data['kindle_push']); + } + if (\array_key_exists('web_push', $data)) { + $object->setWebPush($data['web_push']); + unset($data['web_push']); + } + if (\array_key_exists('windows_phone8_push', $data)) { + $object->setWindowsPhone8Push($data['windows_phone8_push']); + unset($data['windows_phone8_push']); + } + if (\array_key_exists('windows_universal_push', $data)) { + $object->setWindowsUniversalPush($data['windows_universal_push']); + unset($data['windows_universal_push']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('android_push', $data)) { - $object->setAndroidPush($data['android_push']); - unset($data['android_push']); - } - if (\array_key_exists('apple_push', $data)) { - $object->setApplePush($data['apple_push']); - unset($data['apple_push']); - } - if (\array_key_exists('content_card', $data)) { - $object->setContentCard($data['content_card']); - unset($data['content_card']); - } - if (\array_key_exists('email', $data)) { - $object->setEmail($data['email']); - unset($data['email']); - } - if (\array_key_exists('kindle_push', $data)) { - $object->setKindlePush($data['kindle_push']); - unset($data['kindle_push']); - } - if (\array_key_exists('web_push', $data)) { - $object->setWebPush($data['web_push']); - unset($data['web_push']); - } - if (\array_key_exists('windows_phone8_push', $data)) { - $object->setWindowsPhone8Push($data['windows_phone8_push']); - unset($data['windows_phone8_push']); - } - if (\array_key_exists('windows_universal_push', $data)) { - $object->setWindowsUniversalPush($data['windows_universal_push']); - unset($data['windows_universal_push']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('androidPush') && null !== $object->getAndroidPush()) { + $data['android_push'] = $object->getAndroidPush(); } + if ($object->isInitialized('applePush') && null !== $object->getApplePush()) { + $data['apple_push'] = $object->getApplePush(); + } + if ($object->isInitialized('contentCard') && null !== $object->getContentCard()) { + $data['content_card'] = $object->getContentCard(); + } + if ($object->isInitialized('email') && null !== $object->getEmail()) { + $data['email'] = $object->getEmail(); + } + if ($object->isInitialized('kindlePush') && null !== $object->getKindlePush()) { + $data['kindle_push'] = $object->getKindlePush(); + } + if ($object->isInitialized('webPush') && null !== $object->getWebPush()) { + $data['web_push'] = $object->getWebPush(); + } + if ($object->isInitialized('windowsPhone8Push') && null !== $object->getWindowsPhone8Push()) { + $data['windows_phone8_push'] = $object->getWindowsPhone8Push(); + } + if ($object->isInitialized('windowsUniversalPush') && null !== $object->getWindowsUniversalPush()) { + $data['windows_universal_push'] = $object->getWindowsUniversalPush(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\MessagesSendPostBodyMessages' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class MessagesSendPostBodyMessagesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('androidPush') && null !== $object->getAndroidPush()) { - $data['android_push'] = $object->getAndroidPush(); - } - if ($object->isInitialized('applePush') && null !== $object->getApplePush()) { - $data['apple_push'] = $object->getApplePush(); - } - if ($object->isInitialized('contentCard') && null !== $object->getContentCard()) { - $data['content_card'] = $object->getContentCard(); - } - if ($object->isInitialized('email') && null !== $object->getEmail()) { - $data['email'] = $object->getEmail(); - } - if ($object->isInitialized('kindlePush') && null !== $object->getKindlePush()) { - $data['kindle_push'] = $object->getKindlePush(); - } - if ($object->isInitialized('webPush') && null !== $object->getWebPush()) { - $data['web_push'] = $object->getWebPush(); - } - if ($object->isInitialized('windowsPhone8Push') && null !== $object->getWindowsPhone8Push()) { - $data['windows_phone8_push'] = $object->getWindowsPhone8Push(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\MessagesSendPostBodyMessages'; } - if ($object->isInitialized('windowsUniversalPush') && null !== $object->getWindowsUniversalPush()) { - $data['windows_universal_push'] = $object->getWindowsUniversalPush(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesSendPostBodyMessages'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\MessagesSendPostBodyMessages(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('android_push', $data)) { + $object->setAndroidPush($data['android_push']); + unset($data['android_push']); + } + if (\array_key_exists('apple_push', $data)) { + $object->setApplePush($data['apple_push']); + unset($data['apple_push']); + } + if (\array_key_exists('content_card', $data)) { + $object->setContentCard($data['content_card']); + unset($data['content_card']); + } + if (\array_key_exists('email', $data)) { + $object->setEmail($data['email']); + unset($data['email']); + } + if (\array_key_exists('kindle_push', $data)) { + $object->setKindlePush($data['kindle_push']); + unset($data['kindle_push']); + } + if (\array_key_exists('web_push', $data)) { + $object->setWebPush($data['web_push']); + unset($data['web_push']); } + if (\array_key_exists('windows_phone8_push', $data)) { + $object->setWindowsPhone8Push($data['windows_phone8_push']); + unset($data['windows_phone8_push']); + } + if (\array_key_exists('windows_universal_push', $data)) { + $object->setWindowsUniversalPush($data['windows_universal_push']); + unset($data['windows_universal_push']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('androidPush') && null !== $object->getAndroidPush()) { + $data['android_push'] = $object->getAndroidPush(); + } + if ($object->isInitialized('applePush') && null !== $object->getApplePush()) { + $data['apple_push'] = $object->getApplePush(); + } + if ($object->isInitialized('contentCard') && null !== $object->getContentCard()) { + $data['content_card'] = $object->getContentCard(); + } + if ($object->isInitialized('email') && null !== $object->getEmail()) { + $data['email'] = $object->getEmail(); + } + if ($object->isInitialized('kindlePush') && null !== $object->getKindlePush()) { + $data['kindle_push'] = $object->getKindlePush(); + } + if ($object->isInitialized('webPush') && null !== $object->getWebPush()) { + $data['web_push'] = $object->getWebPush(); + } + if ($object->isInitialized('windowsPhone8Push') && null !== $object->getWindowsPhone8Push()) { + $data['windows_phone8_push'] = $object->getWindowsPhone8Push(); + } + if ($object->isInitialized('windowsUniversalPush') && null !== $object->getWindowsUniversalPush()) { + $data['windows_universal_push'] = $object->getWindowsUniversalPush(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\MessagesSendPostBodyMessages' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\MessagesSendPostBodyMessages' => false]; + } } } diff --git a/lib/Normalizer/MessagesSendPostBodyNormalizer.php b/lib/Normalizer/MessagesSendPostBodyNormalizer.php index 3eabec1..ff98676 100644 --- a/lib/Normalizer/MessagesSendPostBodyNormalizer.php +++ b/lib/Normalizer/MessagesSendPostBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,131 +21,259 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class MessagesSendPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\MessagesSendPostBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class MessagesSendPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesSendPostBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\MessagesSendPostBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesSendPostBody'; } - $object = new \Braze\Model\MessagesSendPostBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\MessagesSendPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('broadcast', $data)) { + $object->setBroadcast($data['broadcast']); + unset($data['broadcast']); + } + if (\array_key_exists('external_user_ids', $data)) { + $object->setExternalUserIds($data['external_user_ids']); + unset($data['external_user_ids']); + } + if (\array_key_exists('user_aliases', $data)) { + $object->setUserAliases($this->denormalizer->denormalize($data['user_aliases'], 'Braze\\Model\\MessagesSendPostBodyUserAliases', 'json', $context)); + unset($data['user_aliases']); + } + if (\array_key_exists('segment_id', $data)) { + $object->setSegmentId($data['segment_id']); + unset($data['segment_id']); + } + if (\array_key_exists('audience', $data)) { + $object->setAudience($this->denormalizer->denormalize($data['audience'], 'Braze\\Model\\MessagesSendPostBodyAudience', 'json', $context)); + unset($data['audience']); + } + if (\array_key_exists('campaign_id', $data)) { + $object->setCampaignId($data['campaign_id']); + unset($data['campaign_id']); + } + if (\array_key_exists('send_id', $data)) { + $object->setSendId($data['send_id']); + unset($data['send_id']); + } + if (\array_key_exists('override_frequency_capping', $data)) { + $object->setOverrideFrequencyCapping($data['override_frequency_capping']); + unset($data['override_frequency_capping']); + } + if (\array_key_exists('recipient_subscription_state', $data)) { + $object->setRecipientSubscriptionState($data['recipient_subscription_state']); + unset($data['recipient_subscription_state']); + } + if (\array_key_exists('messages', $data)) { + $object->setMessages($this->denormalizer->denormalize($data['messages'], 'Braze\\Model\\MessagesSendPostBodyMessages', 'json', $context)); + unset($data['messages']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('broadcast', $data)) { - $object->setBroadcast($data['broadcast']); - unset($data['broadcast']); - } - if (\array_key_exists('external_user_ids', $data)) { - $object->setExternalUserIds($data['external_user_ids']); - unset($data['external_user_ids']); - } - if (\array_key_exists('user_aliases', $data)) { - $object->setUserAliases($this->denormalizer->denormalize($data['user_aliases'], 'Braze\\Model\\MessagesSendPostBodyUserAliases', 'json', $context)); - unset($data['user_aliases']); - } - if (\array_key_exists('segment_id', $data)) { - $object->setSegmentId($data['segment_id']); - unset($data['segment_id']); - } - if (\array_key_exists('audience', $data)) { - $object->setAudience($this->denormalizer->denormalize($data['audience'], 'Braze\\Model\\MessagesSendPostBodyAudience', 'json', $context)); - unset($data['audience']); - } - if (\array_key_exists('campaign_id', $data)) { - $object->setCampaignId($data['campaign_id']); - unset($data['campaign_id']); - } - if (\array_key_exists('send_id', $data)) { - $object->setSendId($data['send_id']); - unset($data['send_id']); - } - if (\array_key_exists('override_frequency_capping', $data)) { - $object->setOverrideFrequencyCapping($data['override_frequency_capping']); - unset($data['override_frequency_capping']); - } - if (\array_key_exists('recipient_subscription_state', $data)) { - $object->setRecipientSubscriptionState($data['recipient_subscription_state']); - unset($data['recipient_subscription_state']); - } - if (\array_key_exists('messages', $data)) { - $object->setMessages($this->denormalizer->denormalize($data['messages'], 'Braze\\Model\\MessagesSendPostBodyMessages', 'json', $context)); - unset($data['messages']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('broadcast') && null !== $object->getBroadcast()) { + $data['broadcast'] = $object->getBroadcast(); } + if ($object->isInitialized('externalUserIds') && null !== $object->getExternalUserIds()) { + $data['external_user_ids'] = $object->getExternalUserIds(); + } + if ($object->isInitialized('userAliases') && null !== $object->getUserAliases()) { + $data['user_aliases'] = $this->normalizer->normalize($object->getUserAliases(), 'json', $context); + } + if ($object->isInitialized('segmentId') && null !== $object->getSegmentId()) { + $data['segment_id'] = $object->getSegmentId(); + } + if ($object->isInitialized('audience') && null !== $object->getAudience()) { + $data['audience'] = $this->normalizer->normalize($object->getAudience(), 'json', $context); + } + if ($object->isInitialized('campaignId') && null !== $object->getCampaignId()) { + $data['campaign_id'] = $object->getCampaignId(); + } + if ($object->isInitialized('sendId') && null !== $object->getSendId()) { + $data['send_id'] = $object->getSendId(); + } + if ($object->isInitialized('overrideFrequencyCapping') && null !== $object->getOverrideFrequencyCapping()) { + $data['override_frequency_capping'] = $object->getOverrideFrequencyCapping(); + } + if ($object->isInitialized('recipientSubscriptionState') && null !== $object->getRecipientSubscriptionState()) { + $data['recipient_subscription_state'] = $object->getRecipientSubscriptionState(); + } + if ($object->isInitialized('messages') && null !== $object->getMessages()) { + $data['messages'] = $this->normalizer->normalize($object->getMessages(), 'json', $context); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\MessagesSendPostBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class MessagesSendPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('broadcast') && null !== $object->getBroadcast()) { - $data['broadcast'] = $object->getBroadcast(); - } - if ($object->isInitialized('externalUserIds') && null !== $object->getExternalUserIds()) { - $data['external_user_ids'] = $object->getExternalUserIds(); - } - if ($object->isInitialized('userAliases') && null !== $object->getUserAliases()) { - $data['user_aliases'] = $this->normalizer->normalize($object->getUserAliases(), 'json', $context); - } - if ($object->isInitialized('segmentId') && null !== $object->getSegmentId()) { - $data['segment_id'] = $object->getSegmentId(); - } - if ($object->isInitialized('audience') && null !== $object->getAudience()) { - $data['audience'] = $this->normalizer->normalize($object->getAudience(), 'json', $context); - } - if ($object->isInitialized('campaignId') && null !== $object->getCampaignId()) { - $data['campaign_id'] = $object->getCampaignId(); - } - if ($object->isInitialized('sendId') && null !== $object->getSendId()) { - $data['send_id'] = $object->getSendId(); - } - if ($object->isInitialized('overrideFrequencyCapping') && null !== $object->getOverrideFrequencyCapping()) { - $data['override_frequency_capping'] = $object->getOverrideFrequencyCapping(); - } - if ($object->isInitialized('recipientSubscriptionState') && null !== $object->getRecipientSubscriptionState()) { - $data['recipient_subscription_state'] = $object->getRecipientSubscriptionState(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\MessagesSendPostBody'; } - if ($object->isInitialized('messages') && null !== $object->getMessages()) { - $data['messages'] = $this->normalizer->normalize($object->getMessages(), 'json', $context); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesSendPostBody'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\MessagesSendPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('broadcast', $data)) { + $object->setBroadcast($data['broadcast']); + unset($data['broadcast']); + } + if (\array_key_exists('external_user_ids', $data)) { + $object->setExternalUserIds($data['external_user_ids']); + unset($data['external_user_ids']); + } + if (\array_key_exists('user_aliases', $data)) { + $object->setUserAliases($this->denormalizer->denormalize($data['user_aliases'], 'Braze\\Model\\MessagesSendPostBodyUserAliases', 'json', $context)); + unset($data['user_aliases']); + } + if (\array_key_exists('segment_id', $data)) { + $object->setSegmentId($data['segment_id']); + unset($data['segment_id']); + } + if (\array_key_exists('audience', $data)) { + $object->setAudience($this->denormalizer->denormalize($data['audience'], 'Braze\\Model\\MessagesSendPostBodyAudience', 'json', $context)); + unset($data['audience']); + } + if (\array_key_exists('campaign_id', $data)) { + $object->setCampaignId($data['campaign_id']); + unset($data['campaign_id']); + } + if (\array_key_exists('send_id', $data)) { + $object->setSendId($data['send_id']); + unset($data['send_id']); } + if (\array_key_exists('override_frequency_capping', $data)) { + $object->setOverrideFrequencyCapping($data['override_frequency_capping']); + unset($data['override_frequency_capping']); + } + if (\array_key_exists('recipient_subscription_state', $data)) { + $object->setRecipientSubscriptionState($data['recipient_subscription_state']); + unset($data['recipient_subscription_state']); + } + if (\array_key_exists('messages', $data)) { + $object->setMessages($this->denormalizer->denormalize($data['messages'], 'Braze\\Model\\MessagesSendPostBodyMessages', 'json', $context)); + unset($data['messages']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('broadcast') && null !== $object->getBroadcast()) { + $data['broadcast'] = $object->getBroadcast(); + } + if ($object->isInitialized('externalUserIds') && null !== $object->getExternalUserIds()) { + $data['external_user_ids'] = $object->getExternalUserIds(); + } + if ($object->isInitialized('userAliases') && null !== $object->getUserAliases()) { + $data['user_aliases'] = $this->normalizer->normalize($object->getUserAliases(), 'json', $context); + } + if ($object->isInitialized('segmentId') && null !== $object->getSegmentId()) { + $data['segment_id'] = $object->getSegmentId(); + } + if ($object->isInitialized('audience') && null !== $object->getAudience()) { + $data['audience'] = $this->normalizer->normalize($object->getAudience(), 'json', $context); + } + if ($object->isInitialized('campaignId') && null !== $object->getCampaignId()) { + $data['campaign_id'] = $object->getCampaignId(); + } + if ($object->isInitialized('sendId') && null !== $object->getSendId()) { + $data['send_id'] = $object->getSendId(); + } + if ($object->isInitialized('overrideFrequencyCapping') && null !== $object->getOverrideFrequencyCapping()) { + $data['override_frequency_capping'] = $object->getOverrideFrequencyCapping(); + } + if ($object->isInitialized('recipientSubscriptionState') && null !== $object->getRecipientSubscriptionState()) { + $data['recipient_subscription_state'] = $object->getRecipientSubscriptionState(); + } + if ($object->isInitialized('messages') && null !== $object->getMessages()) { + $data['messages'] = $this->normalizer->normalize($object->getMessages(), 'json', $context); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\MessagesSendPostBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\MessagesSendPostBody' => false]; + } } } diff --git a/lib/Normalizer/MessagesSendPostBodyUserAliasesNormalizer.php b/lib/Normalizer/MessagesSendPostBodyUserAliasesNormalizer.php index 287bfa2..901f472 100644 --- a/lib/Normalizer/MessagesSendPostBodyUserAliasesNormalizer.php +++ b/lib/Normalizer/MessagesSendPostBodyUserAliasesNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,75 +21,147 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class MessagesSendPostBodyUserAliasesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\MessagesSendPostBodyUserAliases'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class MessagesSendPostBodyUserAliasesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesSendPostBodyUserAliases'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\MessagesSendPostBodyUserAliases'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesSendPostBodyUserAliases'; } - $object = new \Braze\Model\MessagesSendPostBodyUserAliases(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\MessagesSendPostBodyUserAliases(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('alias_name', $data)) { + $object->setAliasName($data['alias_name']); + unset($data['alias_name']); + } + if (\array_key_exists('alias_label', $data)) { + $object->setAliasLabel($data['alias_label']); + unset($data['alias_label']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('alias_name', $data)) { - $object->setAliasName($data['alias_name']); - unset($data['alias_name']); - } - if (\array_key_exists('alias_label', $data)) { - $object->setAliasLabel($data['alias_label']); - unset($data['alias_label']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('aliasName') && null !== $object->getAliasName()) { + $data['alias_name'] = $object->getAliasName(); + } + if ($object->isInitialized('aliasLabel') && null !== $object->getAliasLabel()) { + $data['alias_label'] = $object->getAliasLabel(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\MessagesSendPostBodyUserAliases' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class MessagesSendPostBodyUserAliasesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('aliasName') && null !== $object->getAliasName()) { - $data['alias_name'] = $object->getAliasName(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\MessagesSendPostBodyUserAliases'; } - if ($object->isInitialized('aliasLabel') && null !== $object->getAliasLabel()) { - $data['alias_label'] = $object->getAliasLabel(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\MessagesSendPostBodyUserAliases'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\MessagesSendPostBodyUserAliases(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('alias_name', $data)) { + $object->setAliasName($data['alias_name']); + unset($data['alias_name']); + } + if (\array_key_exists('alias_label', $data)) { + $object->setAliasLabel($data['alias_label']); + unset($data['alias_label']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('aliasName') && null !== $object->getAliasName()) { + $data['alias_name'] = $object->getAliasName(); + } + if ($object->isInitialized('aliasLabel') && null !== $object->getAliasLabel()) { + $data['alias_label'] = $object->getAliasLabel(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\MessagesSendPostBodyUserAliases' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\MessagesSendPostBodyUserAliases' => false]; + } } } diff --git a/lib/Normalizer/PreferenceCenterV1PostBodyNormalizer.php b/lib/Normalizer/PreferenceCenterV1PostBodyNormalizer.php index 96c55ab..821bafc 100644 --- a/lib/Normalizer/PreferenceCenterV1PostBodyNormalizer.php +++ b/lib/Normalizer/PreferenceCenterV1PostBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,103 +21,203 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class PreferenceCenterV1PostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class PreferenceCenterV1PostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return $type === 'Braze\\Model\\PreferenceCenterV1PostBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool - { - return is_object($data) && get_class($data) === 'Braze\\Model\\PreferenceCenterV1PostBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\PreferenceCenterV1PostBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\PreferenceCenterV1PostBody'; } - $object = new \Braze\Model\PreferenceCenterV1PostBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\PreferenceCenterV1PostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('name', $data)) { + $object->setName($data['name']); + unset($data['name']); + } + if (\array_key_exists('preference_center_title', $data)) { + $object->setPreferenceCenterTitle($data['preference_center_title']); + unset($data['preference_center_title']); + } + if (\array_key_exists('preference_center_page_html', $data)) { + $object->setPreferenceCenterPageHtml($data['preference_center_page_html']); + unset($data['preference_center_page_html']); + } + if (\array_key_exists('confirmation_page_html', $data)) { + $object->setConfirmationPageHtml($data['confirmation_page_html']); + unset($data['confirmation_page_html']); + } + if (\array_key_exists('state', $data)) { + $object->setState($data['state']); + unset($data['state']); + } + if (\array_key_exists('options', $data)) { + $object->setOptions($this->denormalizer->denormalize($data['options'], 'Braze\\Model\\PreferenceCenterV1PostBodyOptions', 'json', $context)); + unset($data['options']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('name', $data)) { - $object->setName($data['name']); - unset($data['name']); - } - if (\array_key_exists('preference_center_title', $data)) { - $object->setPreferenceCenterTitle($data['preference_center_title']); - unset($data['preference_center_title']); - } - if (\array_key_exists('preference_center_page_html', $data)) { - $object->setPreferenceCenterPageHtml($data['preference_center_page_html']); - unset($data['preference_center_page_html']); - } - if (\array_key_exists('confirmation_page_html', $data)) { - $object->setConfirmationPageHtml($data['confirmation_page_html']); - unset($data['confirmation_page_html']); - } - if (\array_key_exists('state', $data)) { - $object->setState($data['state']); - unset($data['state']); - } - if (\array_key_exists('options', $data)) { - $object->setOptions($this->denormalizer->denormalize($data['options'], 'Braze\\Model\\PreferenceCenterV1PostBodyOptions', 'json', $context)); - unset($data['options']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['name'] = $object->getName(); + } + if ($object->isInitialized('preferenceCenterTitle') && null !== $object->getPreferenceCenterTitle()) { + $data['preference_center_title'] = $object->getPreferenceCenterTitle(); + } + if ($object->isInitialized('preferenceCenterPageHtml') && null !== $object->getPreferenceCenterPageHtml()) { + $data['preference_center_page_html'] = $object->getPreferenceCenterPageHtml(); + } + if ($object->isInitialized('confirmationPageHtml') && null !== $object->getConfirmationPageHtml()) { + $data['confirmation_page_html'] = $object->getConfirmationPageHtml(); } + if ($object->isInitialized('state') && null !== $object->getState()) { + $data['state'] = $object->getState(); + } + if ($object->isInitialized('options') && null !== $object->getOptions()) { + $data['options'] = $this->normalizer->normalize($object->getOptions(), 'json', $context); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\PreferenceCenterV1PostBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class PreferenceCenterV1PostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('name') && null !== $object->getName()) { - $data['name'] = $object->getName(); - } - if ($object->isInitialized('preferenceCenterTitle') && null !== $object->getPreferenceCenterTitle()) { - $data['preference_center_title'] = $object->getPreferenceCenterTitle(); - } - if ($object->isInitialized('preferenceCenterPageHtml') && null !== $object->getPreferenceCenterPageHtml()) { - $data['preference_center_page_html'] = $object->getPreferenceCenterPageHtml(); - } - if ($object->isInitialized('confirmationPageHtml') && null !== $object->getConfirmationPageHtml()) { - $data['confirmation_page_html'] = $object->getConfirmationPageHtml(); - } - if ($object->isInitialized('state') && null !== $object->getState()) { - $data['state'] = $object->getState(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\PreferenceCenterV1PostBody'; } - if ($object->isInitialized('options') && null !== $object->getOptions()) { - $data['options'] = $this->normalizer->normalize($object->getOptions(), 'json', $context); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\PreferenceCenterV1PostBody'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\PreferenceCenterV1PostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('name', $data)) { + $object->setName($data['name']); + unset($data['name']); + } + if (\array_key_exists('preference_center_title', $data)) { + $object->setPreferenceCenterTitle($data['preference_center_title']); + unset($data['preference_center_title']); + } + if (\array_key_exists('preference_center_page_html', $data)) { + $object->setPreferenceCenterPageHtml($data['preference_center_page_html']); + unset($data['preference_center_page_html']); + } + if (\array_key_exists('confirmation_page_html', $data)) { + $object->setConfirmationPageHtml($data['confirmation_page_html']); + unset($data['confirmation_page_html']); + } + if (\array_key_exists('state', $data)) { + $object->setState($data['state']); + unset($data['state']); } + if (\array_key_exists('options', $data)) { + $object->setOptions($this->denormalizer->denormalize($data['options'], 'Braze\\Model\\PreferenceCenterV1PostBodyOptions', 'json', $context)); + unset($data['options']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['name'] = $object->getName(); + } + if ($object->isInitialized('preferenceCenterTitle') && null !== $object->getPreferenceCenterTitle()) { + $data['preference_center_title'] = $object->getPreferenceCenterTitle(); + } + if ($object->isInitialized('preferenceCenterPageHtml') && null !== $object->getPreferenceCenterPageHtml()) { + $data['preference_center_page_html'] = $object->getPreferenceCenterPageHtml(); + } + if ($object->isInitialized('confirmationPageHtml') && null !== $object->getConfirmationPageHtml()) { + $data['confirmation_page_html'] = $object->getConfirmationPageHtml(); + } + if ($object->isInitialized('state') && null !== $object->getState()) { + $data['state'] = $object->getState(); + } + if ($object->isInitialized('options') && null !== $object->getOptions()) { + $data['options'] = $this->normalizer->normalize($object->getOptions(), 'json', $context); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\PreferenceCenterV1PostBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\PreferenceCenterV1PostBody' => false]; + } } } diff --git a/lib/Normalizer/PreferenceCenterV1PostBodyOptionsNormalizer.php b/lib/Normalizer/PreferenceCenterV1PostBodyOptionsNormalizer.php index ab6bed7..075e5f7 100644 --- a/lib/Normalizer/PreferenceCenterV1PostBodyOptionsNormalizer.php +++ b/lib/Normalizer/PreferenceCenterV1PostBodyOptionsNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,68 +21,133 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class PreferenceCenterV1PostBodyOptionsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class PreferenceCenterV1PostBodyOptionsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return $type === 'Braze\\Model\\PreferenceCenterV1PostBodyOptions'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool - { - return is_object($data) && get_class($data) === 'Braze\\Model\\PreferenceCenterV1PostBodyOptions'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\PreferenceCenterV1PostBodyOptions'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\PreferenceCenterV1PostBodyOptions'; } - $object = new \Braze\Model\PreferenceCenterV1PostBodyOptions(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\PreferenceCenterV1PostBodyOptions(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('meta-viewport-content', $data)) { + $object->setMetaViewportContent($data['meta-viewport-content']); + unset($data['meta-viewport-content']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('meta-viewport-content', $data)) { - $object->setMetaViewportContent($data['meta-viewport-content']); - unset($data['meta-viewport-content']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('metaViewportContent') && null !== $object->getMetaViewportContent()) { + $data['meta-viewport-content'] = $object->getMetaViewportContent(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\PreferenceCenterV1PostBodyOptions' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class PreferenceCenterV1PostBodyOptionsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('metaViewportContent') && null !== $object->getMetaViewportContent()) { - $data['meta-viewport-content'] = $object->getMetaViewportContent(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\PreferenceCenterV1PostBodyOptions'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\PreferenceCenterV1PostBodyOptions'; + } + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\PreferenceCenterV1PostBodyOptions(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('meta-viewport-content', $data)) { + $object->setMetaViewportContent($data['meta-viewport-content']); + unset($data['meta-viewport-content']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('metaViewportContent') && null !== $object->getMetaViewportContent()) { + $data['meta-viewport-content'] = $object->getMetaViewportContent(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\PreferenceCenterV1PostBodyOptions' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\PreferenceCenterV1PostBodyOptions' => false]; + } } } diff --git a/lib/Normalizer/PreferenceCenterV1PreferenceCenterExternalIDPutBodyNormalizer.php b/lib/Normalizer/PreferenceCenterV1PreferenceCenterExternalIDPutBodyNormalizer.php index 645b2af..24dad91 100644 --- a/lib/Normalizer/PreferenceCenterV1PreferenceCenterExternalIDPutBodyNormalizer.php +++ b/lib/Normalizer/PreferenceCenterV1PreferenceCenterExternalIDPutBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,90 +21,177 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class PreferenceCenterV1PreferenceCenterExternalIDPutBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class PreferenceCenterV1PreferenceCenterExternalIDPutBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBody'; } - $object = new \Braze\Model\PreferenceCenterV1PreferenceCenterExternalIDPutBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\PreferenceCenterV1PreferenceCenterExternalIDPutBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('external_send_id', $data)) { + $object->setExternalSendId($data['external_send_id']); + unset($data['external_send_id']); + } + if (\array_key_exists('trigger_properties', $data)) { + $object->setTriggerProperties($this->denormalizer->denormalize($data['trigger_properties'], 'Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBodyTriggerProperties', 'json', $context)); + unset($data['trigger_properties']); + } + if (\array_key_exists('recipient', $data)) { + $values = []; + foreach ($data['recipient'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBodyRecipientItem', 'json', $context); + } + $object->setRecipient($values); + unset($data['recipient']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('external_send_id', $data)) { - $object->setExternalSendId($data['external_send_id']); - unset($data['external_send_id']); - } - if (\array_key_exists('trigger_properties', $data)) { - $object->setTriggerProperties($this->denormalizer->denormalize($data['trigger_properties'], 'Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBodyTriggerProperties', 'json', $context)); - unset($data['trigger_properties']); - } - if (\array_key_exists('recipient', $data)) { - $values = []; - foreach ($data['recipient'] as $value) { - $values[] = $this->denormalizer->denormalize($value, 'Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBodyRecipientItem', 'json', $context); + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('externalSendId') && null !== $object->getExternalSendId()) { + $data['external_send_id'] = $object->getExternalSendId(); } - $object->setRecipient($values); - unset($data['recipient']); - } - foreach ($data as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value_1; + if ($object->isInitialized('triggerProperties') && null !== $object->getTriggerProperties()) { + $data['trigger_properties'] = $this->normalizer->normalize($object->getTriggerProperties(), 'json', $context); + } + if ($object->isInitialized('recipient') && null !== $object->getRecipient()) { + $values = []; + foreach ($object->getRecipient() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['recipient'] = $values; } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class PreferenceCenterV1PreferenceCenterExternalIDPutBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('externalSendId') && null !== $object->getExternalSendId()) { - $data['external_send_id'] = $object->getExternalSendId(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBody'; } - if ($object->isInitialized('triggerProperties') && null !== $object->getTriggerProperties()) { - $data['trigger_properties'] = $this->normalizer->normalize($object->getTriggerProperties(), 'json', $context); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBody'; } - if ($object->isInitialized('recipient') && null !== $object->getRecipient()) { - $values = []; - foreach ($object->getRecipient() as $value) { - $values[] = $this->normalizer->normalize($value, 'json', $context); + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - $data['recipient'] = $values; - } - foreach ($object as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value_1; + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\PreferenceCenterV1PreferenceCenterExternalIDPutBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('external_send_id', $data)) { + $object->setExternalSendId($data['external_send_id']); + unset($data['external_send_id']); + } + if (\array_key_exists('trigger_properties', $data)) { + $object->setTriggerProperties($this->denormalizer->denormalize($data['trigger_properties'], 'Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBodyTriggerProperties', 'json', $context)); + unset($data['trigger_properties']); + } + if (\array_key_exists('recipient', $data)) { + $values = []; + foreach ($data['recipient'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBodyRecipientItem', 'json', $context); + } + $object->setRecipient($values); + unset($data['recipient']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('externalSendId') && null !== $object->getExternalSendId()) { + $data['external_send_id'] = $object->getExternalSendId(); + } + if ($object->isInitialized('triggerProperties') && null !== $object->getTriggerProperties()) { + $data['trigger_properties'] = $this->normalizer->normalize($object->getTriggerProperties(), 'json', $context); + } + if ($object->isInitialized('recipient') && null !== $object->getRecipient()) { + $values = []; + foreach ($object->getRecipient() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['recipient'] = $values; + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBody' => false]; + } } } diff --git a/lib/Normalizer/PreferenceCenterV1PreferenceCenterExternalIDPutBodyRecipientItemNormalizer.php b/lib/Normalizer/PreferenceCenterV1PreferenceCenterExternalIDPutBodyRecipientItemNormalizer.php index 60834cc..3b3dab6 100644 --- a/lib/Normalizer/PreferenceCenterV1PreferenceCenterExternalIDPutBodyRecipientItemNormalizer.php +++ b/lib/Normalizer/PreferenceCenterV1PreferenceCenterExternalIDPutBodyRecipientItemNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,68 +21,133 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class PreferenceCenterV1PreferenceCenterExternalIDPutBodyRecipientItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class PreferenceCenterV1PreferenceCenterExternalIDPutBodyRecipientItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return $type === 'Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBodyRecipientItem'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool - { - return is_object($data) && get_class($data) === 'Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBodyRecipientItem'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBodyRecipientItem'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBodyRecipientItem'; } - $object = new \Braze\Model\PreferenceCenterV1PreferenceCenterExternalIDPutBodyRecipientItem(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\PreferenceCenterV1PreferenceCenterExternalIDPutBodyRecipientItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('external_user_id', $data)) { + $object->setExternalUserId($data['external_user_id']); + unset($data['external_user_id']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('external_user_id', $data)) { - $object->setExternalUserId($data['external_user_id']); - unset($data['external_user_id']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('externalUserId') && null !== $object->getExternalUserId()) { + $data['external_user_id'] = $object->getExternalUserId(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBodyRecipientItem' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class PreferenceCenterV1PreferenceCenterExternalIDPutBodyRecipientItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('externalUserId') && null !== $object->getExternalUserId()) { - $data['external_user_id'] = $object->getExternalUserId(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBodyRecipientItem'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBodyRecipientItem'; + } + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\PreferenceCenterV1PreferenceCenterExternalIDPutBodyRecipientItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('external_user_id', $data)) { + $object->setExternalUserId($data['external_user_id']); + unset($data['external_user_id']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('externalUserId') && null !== $object->getExternalUserId()) { + $data['external_user_id'] = $object->getExternalUserId(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBodyRecipientItem' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBodyRecipientItem' => false]; + } } } diff --git a/lib/Normalizer/PreferenceCenterV1PreferenceCenterExternalIDPutBodyTriggerPropertiesNormalizer.php b/lib/Normalizer/PreferenceCenterV1PreferenceCenterExternalIDPutBodyTriggerPropertiesNormalizer.php index 5b7f9ca..efdcdcc 100644 --- a/lib/Normalizer/PreferenceCenterV1PreferenceCenterExternalIDPutBodyTriggerPropertiesNormalizer.php +++ b/lib/Normalizer/PreferenceCenterV1PreferenceCenterExternalIDPutBodyTriggerPropertiesNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,75 +21,147 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class PreferenceCenterV1PreferenceCenterExternalIDPutBodyTriggerPropertiesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBodyTriggerProperties'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class PreferenceCenterV1PreferenceCenterExternalIDPutBodyTriggerPropertiesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBodyTriggerProperties'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBodyTriggerProperties'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBodyTriggerProperties'; } - $object = new \Braze\Model\PreferenceCenterV1PreferenceCenterExternalIDPutBodyTriggerProperties(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\PreferenceCenterV1PreferenceCenterExternalIDPutBodyTriggerProperties(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('example_string_property', $data)) { + $object->setExampleStringProperty($data['example_string_property']); + unset($data['example_string_property']); + } + if (\array_key_exists('example_integer_property', $data)) { + $object->setExampleIntegerProperty($data['example_integer_property']); + unset($data['example_integer_property']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('example_string_property', $data)) { - $object->setExampleStringProperty($data['example_string_property']); - unset($data['example_string_property']); - } - if (\array_key_exists('example_integer_property', $data)) { - $object->setExampleIntegerProperty($data['example_integer_property']); - unset($data['example_integer_property']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('exampleStringProperty') && null !== $object->getExampleStringProperty()) { + $data['example_string_property'] = $object->getExampleStringProperty(); + } + if ($object->isInitialized('exampleIntegerProperty') && null !== $object->getExampleIntegerProperty()) { + $data['example_integer_property'] = $object->getExampleIntegerProperty(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBodyTriggerProperties' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class PreferenceCenterV1PreferenceCenterExternalIDPutBodyTriggerPropertiesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('exampleStringProperty') && null !== $object->getExampleStringProperty()) { - $data['example_string_property'] = $object->getExampleStringProperty(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBodyTriggerProperties'; } - if ($object->isInitialized('exampleIntegerProperty') && null !== $object->getExampleIntegerProperty()) { - $data['example_integer_property'] = $object->getExampleIntegerProperty(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBodyTriggerProperties'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\PreferenceCenterV1PreferenceCenterExternalIDPutBodyTriggerProperties(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('example_string_property', $data)) { + $object->setExampleStringProperty($data['example_string_property']); + unset($data['example_string_property']); + } + if (\array_key_exists('example_integer_property', $data)) { + $object->setExampleIntegerProperty($data['example_integer_property']); + unset($data['example_integer_property']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('exampleStringProperty') && null !== $object->getExampleStringProperty()) { + $data['example_string_property'] = $object->getExampleStringProperty(); + } + if ($object->isInitialized('exampleIntegerProperty') && null !== $object->getExampleIntegerProperty()) { + $data['example_integer_property'] = $object->getExampleIntegerProperty(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBodyTriggerProperties' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\PreferenceCenterV1PreferenceCenterExternalIDPutBodyTriggerProperties' => false]; + } } } diff --git a/lib/Normalizer/ScimV2UsersIdPutBodyNameNormalizer.php b/lib/Normalizer/ScimV2UsersIdPutBodyNameNormalizer.php index e3bec14..a82c166 100644 --- a/lib/Normalizer/ScimV2UsersIdPutBodyNameNormalizer.php +++ b/lib/Normalizer/ScimV2UsersIdPutBodyNameNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,75 +21,147 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class ScimV2UsersIdPutBodyNameNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\ScimV2UsersIdPutBodyName'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ScimV2UsersIdPutBodyNameNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\ScimV2UsersIdPutBodyName'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\ScimV2UsersIdPutBodyName'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\ScimV2UsersIdPutBodyName'; } - $object = new \Braze\Model\ScimV2UsersIdPutBodyName(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\ScimV2UsersIdPutBodyName(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('givenName', $data)) { + $object->setGivenName($data['givenName']); + unset($data['givenName']); + } + if (\array_key_exists('familyName', $data)) { + $object->setFamilyName($data['familyName']); + unset($data['familyName']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('givenName', $data)) { - $object->setGivenName($data['givenName']); - unset($data['givenName']); - } - if (\array_key_exists('familyName', $data)) { - $object->setFamilyName($data['familyName']); - unset($data['familyName']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('givenName') && null !== $object->getGivenName()) { + $data['givenName'] = $object->getGivenName(); + } + if ($object->isInitialized('familyName') && null !== $object->getFamilyName()) { + $data['familyName'] = $object->getFamilyName(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\ScimV2UsersIdPutBodyName' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class ScimV2UsersIdPutBodyNameNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('givenName') && null !== $object->getGivenName()) { - $data['givenName'] = $object->getGivenName(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\ScimV2UsersIdPutBodyName'; } - if ($object->isInitialized('familyName') && null !== $object->getFamilyName()) { - $data['familyName'] = $object->getFamilyName(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\ScimV2UsersIdPutBodyName'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\ScimV2UsersIdPutBodyName(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('givenName', $data)) { + $object->setGivenName($data['givenName']); + unset($data['givenName']); + } + if (\array_key_exists('familyName', $data)) { + $object->setFamilyName($data['familyName']); + unset($data['familyName']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('givenName') && null !== $object->getGivenName()) { + $data['givenName'] = $object->getGivenName(); + } + if ($object->isInitialized('familyName') && null !== $object->getFamilyName()) { + $data['familyName'] = $object->getFamilyName(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\ScimV2UsersIdPutBodyName' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\ScimV2UsersIdPutBodyName' => false]; + } } } diff --git a/lib/Normalizer/ScimV2UsersIdPutBodyNormalizer.php b/lib/Normalizer/ScimV2UsersIdPutBodyNormalizer.php index bcdd735..86fc4eb 100644 --- a/lib/Normalizer/ScimV2UsersIdPutBodyNormalizer.php +++ b/lib/Normalizer/ScimV2UsersIdPutBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,97 +21,191 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class ScimV2UsersIdPutBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ScimV2UsersIdPutBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return $type === 'Braze\\Model\\ScimV2UsersIdPutBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function supportsNormalization($data, $format = null, array $context = []): bool - { - return is_object($data) && get_class($data) === 'Braze\\Model\\ScimV2UsersIdPutBody'; - } - - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\ScimV2UsersIdPutBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\ScimV2UsersIdPutBody'; } - $object = new \Braze\Model\ScimV2UsersIdPutBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\ScimV2UsersIdPutBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('schemas', $data)) { + $values = []; + foreach ($data['schemas'] as $value) { + $values[] = $value; + } + $object->setSchemas($values); + unset($data['schemas']); + } + if (\array_key_exists('name', $data)) { + $object->setName($this->denormalizer->denormalize($data['name'], 'Braze\\Model\\ScimV2UsersIdPutBodyName', 'json', $context)); + unset($data['name']); + } + if (\array_key_exists('department', $data)) { + $object->setDepartment($data['department']); + unset($data['department']); + } + if (\array_key_exists('permissions', $data)) { + $object->setPermissions($this->denormalizer->denormalize($data['permissions'], 'Braze\\Model\\ScimV2UsersIdPutBodyPermissions', 'json', $context)); + unset($data['permissions']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('schemas', $data)) { - $values = []; - foreach ($data['schemas'] as $value) { - $values[] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('schemas') && null !== $object->getSchemas()) { + $values = []; + foreach ($object->getSchemas() as $value) { + $values[] = $value; + } + $data['schemas'] = $values; } - $object->setSchemas($values); - unset($data['schemas']); - } - if (\array_key_exists('name', $data)) { - $object->setName($this->denormalizer->denormalize($data['name'], 'Braze\\Model\\ScimV2UsersIdPutBodyName', 'json', $context)); - unset($data['name']); - } - if (\array_key_exists('department', $data)) { - $object->setDepartment($data['department']); - unset($data['department']); - } - if (\array_key_exists('permissions', $data)) { - $object->setPermissions($this->denormalizer->denormalize($data['permissions'], 'Braze\\Model\\ScimV2UsersIdPutBodyPermissions', 'json', $context)); - unset($data['permissions']); - } - foreach ($data as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value_1; + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['name'] = $this->normalizer->normalize($object->getName(), 'json', $context); + } + if ($object->isInitialized('department') && null !== $object->getDepartment()) { + $data['department'] = $object->getDepartment(); + } + if ($object->isInitialized('permissions') && null !== $object->getPermissions()) { + $data['permissions'] = $this->normalizer->normalize($object->getPermissions(), 'json', $context); } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\ScimV2UsersIdPutBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class ScimV2UsersIdPutBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('schemas') && null !== $object->getSchemas()) { - $values = []; - foreach ($object->getSchemas() as $value) { - $values[] = $value; - } - $data['schemas'] = $values; - } - if ($object->isInitialized('name') && null !== $object->getName()) { - $data['name'] = $this->normalizer->normalize($object->getName(), 'json', $context); - } - if ($object->isInitialized('department') && null !== $object->getDepartment()) { - $data['department'] = $object->getDepartment(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\ScimV2UsersIdPutBody'; } - if ($object->isInitialized('permissions') && null !== $object->getPermissions()) { - $data['permissions'] = $this->normalizer->normalize($object->getPermissions(), 'json', $context); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\ScimV2UsersIdPutBody'; } - foreach ($object as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value_1; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\ScimV2UsersIdPutBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('schemas', $data)) { + $values = []; + foreach ($data['schemas'] as $value) { + $values[] = $value; + } + $object->setSchemas($values); + unset($data['schemas']); + } + if (\array_key_exists('name', $data)) { + $object->setName($this->denormalizer->denormalize($data['name'], 'Braze\\Model\\ScimV2UsersIdPutBodyName', 'json', $context)); + unset($data['name']); + } + if (\array_key_exists('department', $data)) { + $object->setDepartment($data['department']); + unset($data['department']); + } + if (\array_key_exists('permissions', $data)) { + $object->setPermissions($this->denormalizer->denormalize($data['permissions'], 'Braze\\Model\\ScimV2UsersIdPutBodyPermissions', 'json', $context)); + unset($data['permissions']); } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('schemas') && null !== $object->getSchemas()) { + $values = []; + foreach ($object->getSchemas() as $value) { + $values[] = $value; + } + $data['schemas'] = $values; + } + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['name'] = $this->normalizer->normalize($object->getName(), 'json', $context); + } + if ($object->isInitialized('department') && null !== $object->getDepartment()) { + $data['department'] = $object->getDepartment(); + } + if ($object->isInitialized('permissions') && null !== $object->getPermissions()) { + $data['permissions'] = $this->normalizer->normalize($object->getPermissions(), 'json', $context); + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\ScimV2UsersIdPutBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\ScimV2UsersIdPutBody' => false]; + } } } diff --git a/lib/Normalizer/ScimV2UsersIdPutBodyPermissionsAppGroupItemNormalizer.php b/lib/Normalizer/ScimV2UsersIdPutBodyPermissionsAppGroupItemNormalizer.php index 20bde76..99685c9 100644 --- a/lib/Normalizer/ScimV2UsersIdPutBodyPermissionsAppGroupItemNormalizer.php +++ b/lib/Normalizer/ScimV2UsersIdPutBodyPermissionsAppGroupItemNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,98 +21,193 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class ScimV2UsersIdPutBodyPermissionsAppGroupItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\ScimV2UsersIdPutBodyPermissionsAppGroupItem'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ScimV2UsersIdPutBodyPermissionsAppGroupItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\ScimV2UsersIdPutBodyPermissionsAppGroupItem'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\ScimV2UsersIdPutBodyPermissionsAppGroupItem'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\ScimV2UsersIdPutBodyPermissionsAppGroupItem'; } - $object = new \Braze\Model\ScimV2UsersIdPutBodyPermissionsAppGroupItem(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\ScimV2UsersIdPutBodyPermissionsAppGroupItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('appGroupName', $data)) { + $object->setAppGroupName($data['appGroupName']); + unset($data['appGroupName']); + } + if (\array_key_exists('appGroupPermissions', $data)) { + $values = []; + foreach ($data['appGroupPermissions'] as $value) { + $values[] = $value; + } + $object->setAppGroupPermissions($values); + unset($data['appGroupPermissions']); + } + if (\array_key_exists('team', $data)) { + $values_1 = []; + foreach ($data['team'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, 'Braze\\Model\\ScimV2UsersIdPutBodyPermissionsAppGroupItemTeamItem', 'json', $context); + } + $object->setTeam($values_1); + unset($data['team']); + } + foreach ($data as $key => $value_2) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_2; + } + } + return $object; } - if (\array_key_exists('appGroupName', $data)) { - $object->setAppGroupName($data['appGroupName']); - unset($data['appGroupName']); - } - if (\array_key_exists('appGroupPermissions', $data)) { - $values = []; - foreach ($data['appGroupPermissions'] as $value) { - $values[] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('appGroupName') && null !== $object->getAppGroupName()) { + $data['appGroupName'] = $object->getAppGroupName(); } - $object->setAppGroupPermissions($values); - unset($data['appGroupPermissions']); - } - if (\array_key_exists('team', $data)) { - $values_1 = []; - foreach ($data['team'] as $value_1) { - $values_1[] = $this->denormalizer->denormalize($value_1, 'Braze\\Model\\ScimV2UsersIdPutBodyPermissionsAppGroupItemTeamItem', 'json', $context); + if ($object->isInitialized('appGroupPermissions') && null !== $object->getAppGroupPermissions()) { + $values = []; + foreach ($object->getAppGroupPermissions() as $value) { + $values[] = $value; + } + $data['appGroupPermissions'] = $values; } - $object->setTeam($values_1); - unset($data['team']); - } - foreach ($data as $key => $value_2) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value_2; + if ($object->isInitialized('team') && null !== $object->getTeam()) { + $values_1 = []; + foreach ($object->getTeam() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $data['team'] = $values_1; + } + foreach ($object as $key => $value_2) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_2; + } } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\ScimV2UsersIdPutBodyPermissionsAppGroupItem' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class ScimV2UsersIdPutBodyPermissionsAppGroupItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('appGroupName') && null !== $object->getAppGroupName()) { - $data['appGroupName'] = $object->getAppGroupName(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\ScimV2UsersIdPutBodyPermissionsAppGroupItem'; } - if ($object->isInitialized('appGroupPermissions') && null !== $object->getAppGroupPermissions()) { - $values = []; - foreach ($object->getAppGroupPermissions() as $value) { - $values[] = $value; - } - $data['appGroupPermissions'] = $values; + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\ScimV2UsersIdPutBodyPermissionsAppGroupItem'; } - if ($object->isInitialized('team') && null !== $object->getTeam()) { - $values_1 = []; - foreach ($object->getTeam() as $value_1) { - $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - $data['team'] = $values_1; - } - foreach ($object as $key => $value_2) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value_2; + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\ScimV2UsersIdPutBodyPermissionsAppGroupItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('appGroupName', $data)) { + $object->setAppGroupName($data['appGroupName']); + unset($data['appGroupName']); + } + if (\array_key_exists('appGroupPermissions', $data)) { + $values = []; + foreach ($data['appGroupPermissions'] as $value) { + $values[] = $value; + } + $object->setAppGroupPermissions($values); + unset($data['appGroupPermissions']); + } + if (\array_key_exists('team', $data)) { + $values_1 = []; + foreach ($data['team'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, 'Braze\\Model\\ScimV2UsersIdPutBodyPermissionsAppGroupItemTeamItem', 'json', $context); + } + $object->setTeam($values_1); + unset($data['team']); + } + foreach ($data as $key => $value_2) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_2; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('appGroupName') && null !== $object->getAppGroupName()) { + $data['appGroupName'] = $object->getAppGroupName(); + } + if ($object->isInitialized('appGroupPermissions') && null !== $object->getAppGroupPermissions()) { + $values = []; + foreach ($object->getAppGroupPermissions() as $value) { + $values[] = $value; + } + $data['appGroupPermissions'] = $values; + } + if ($object->isInitialized('team') && null !== $object->getTeam()) { + $values_1 = []; + foreach ($object->getTeam() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $data['team'] = $values_1; + } + foreach ($object as $key => $value_2) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_2; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\ScimV2UsersIdPutBodyPermissionsAppGroupItem' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\ScimV2UsersIdPutBodyPermissionsAppGroupItem' => false]; + } } } diff --git a/lib/Normalizer/ScimV2UsersIdPutBodyPermissionsAppGroupItemTeamItemNormalizer.php b/lib/Normalizer/ScimV2UsersIdPutBodyPermissionsAppGroupItemTeamItemNormalizer.php index c21304c..8d87056 100644 --- a/lib/Normalizer/ScimV2UsersIdPutBodyPermissionsAppGroupItemTeamItemNormalizer.php +++ b/lib/Normalizer/ScimV2UsersIdPutBodyPermissionsAppGroupItemTeamItemNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,83 +21,163 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class ScimV2UsersIdPutBodyPermissionsAppGroupItemTeamItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\ScimV2UsersIdPutBodyPermissionsAppGroupItemTeamItem'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ScimV2UsersIdPutBodyPermissionsAppGroupItemTeamItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\ScimV2UsersIdPutBodyPermissionsAppGroupItemTeamItem'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\ScimV2UsersIdPutBodyPermissionsAppGroupItemTeamItem'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\ScimV2UsersIdPutBodyPermissionsAppGroupItemTeamItem'; } - $object = new \Braze\Model\ScimV2UsersIdPutBodyPermissionsAppGroupItemTeamItem(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\ScimV2UsersIdPutBodyPermissionsAppGroupItemTeamItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('teamName', $data)) { + $object->setTeamName($data['teamName']); + unset($data['teamName']); + } + if (\array_key_exists('teamPermissions', $data)) { + $values = []; + foreach ($data['teamPermissions'] as $value) { + $values[] = $value; + } + $object->setTeamPermissions($values); + unset($data['teamPermissions']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('teamName', $data)) { - $object->setTeamName($data['teamName']); - unset($data['teamName']); - } - if (\array_key_exists('teamPermissions', $data)) { - $values = []; - foreach ($data['teamPermissions'] as $value) { - $values[] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('teamName') && null !== $object->getTeamName()) { + $data['teamName'] = $object->getTeamName(); } - $object->setTeamPermissions($values); - unset($data['teamPermissions']); - } - foreach ($data as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value_1; + if ($object->isInitialized('teamPermissions') && null !== $object->getTeamPermissions()) { + $values = []; + foreach ($object->getTeamPermissions() as $value) { + $values[] = $value; + } + $data['teamPermissions'] = $values; + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\ScimV2UsersIdPutBodyPermissionsAppGroupItemTeamItem' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class ScimV2UsersIdPutBodyPermissionsAppGroupItemTeamItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('teamName') && null !== $object->getTeamName()) { - $data['teamName'] = $object->getTeamName(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\ScimV2UsersIdPutBodyPermissionsAppGroupItemTeamItem'; } - if ($object->isInitialized('teamPermissions') && null !== $object->getTeamPermissions()) { - $values = []; - foreach ($object->getTeamPermissions() as $value) { - $values[] = $value; - } - $data['teamPermissions'] = $values; + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\ScimV2UsersIdPutBodyPermissionsAppGroupItemTeamItem'; } - foreach ($object as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value_1; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\ScimV2UsersIdPutBodyPermissionsAppGroupItemTeamItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('teamName', $data)) { + $object->setTeamName($data['teamName']); + unset($data['teamName']); + } + if (\array_key_exists('teamPermissions', $data)) { + $values = []; + foreach ($data['teamPermissions'] as $value) { + $values[] = $value; + } + $object->setTeamPermissions($values); + unset($data['teamPermissions']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('teamName') && null !== $object->getTeamName()) { + $data['teamName'] = $object->getTeamName(); + } + if ($object->isInitialized('teamPermissions') && null !== $object->getTeamPermissions()) { + $values = []; + foreach ($object->getTeamPermissions() as $value) { + $values[] = $value; + } + $data['teamPermissions'] = $values; + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\ScimV2UsersIdPutBodyPermissionsAppGroupItemTeamItem' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\ScimV2UsersIdPutBodyPermissionsAppGroupItemTeamItem' => false]; + } } } diff --git a/lib/Normalizer/ScimV2UsersIdPutBodyPermissionsNormalizer.php b/lib/Normalizer/ScimV2UsersIdPutBodyPermissionsNormalizer.php index 5427100..300c4d0 100644 --- a/lib/Normalizer/ScimV2UsersIdPutBodyPermissionsNormalizer.php +++ b/lib/Normalizer/ScimV2UsersIdPutBodyPermissionsNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,91 +21,179 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class ScimV2UsersIdPutBodyPermissionsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\ScimV2UsersIdPutBodyPermissions'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ScimV2UsersIdPutBodyPermissionsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\ScimV2UsersIdPutBodyPermissions'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\ScimV2UsersIdPutBodyPermissions'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\ScimV2UsersIdPutBodyPermissions'; } - $object = new \Braze\Model\ScimV2UsersIdPutBodyPermissions(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\ScimV2UsersIdPutBodyPermissions(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('companyPermissions', $data)) { + $values = []; + foreach ($data['companyPermissions'] as $value) { + $values[] = $value; + } + $object->setCompanyPermissions($values); + unset($data['companyPermissions']); + } + if (\array_key_exists('appGroup', $data)) { + $values_1 = []; + foreach ($data['appGroup'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, 'Braze\\Model\\ScimV2UsersIdPutBodyPermissionsAppGroupItem', 'json', $context); + } + $object->setAppGroup($values_1); + unset($data['appGroup']); + } + foreach ($data as $key => $value_2) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_2; + } + } + return $object; } - if (\array_key_exists('companyPermissions', $data)) { - $values = []; - foreach ($data['companyPermissions'] as $value) { - $values[] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('companyPermissions') && null !== $object->getCompanyPermissions()) { + $values = []; + foreach ($object->getCompanyPermissions() as $value) { + $values[] = $value; + } + $data['companyPermissions'] = $values; } - $object->setCompanyPermissions($values); - unset($data['companyPermissions']); - } - if (\array_key_exists('appGroup', $data)) { - $values_1 = []; - foreach ($data['appGroup'] as $value_1) { - $values_1[] = $this->denormalizer->denormalize($value_1, 'Braze\\Model\\ScimV2UsersIdPutBodyPermissionsAppGroupItem', 'json', $context); + if ($object->isInitialized('appGroup') && null !== $object->getAppGroup()) { + $values_1 = []; + foreach ($object->getAppGroup() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $data['appGroup'] = $values_1; } - $object->setAppGroup($values_1); - unset($data['appGroup']); - } - foreach ($data as $key => $value_2) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value_2; + foreach ($object as $key => $value_2) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_2; + } } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\ScimV2UsersIdPutBodyPermissions' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class ScimV2UsersIdPutBodyPermissionsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('companyPermissions') && null !== $object->getCompanyPermissions()) { - $values = []; - foreach ($object->getCompanyPermissions() as $value) { - $values[] = $value; - } - $data['companyPermissions'] = $values; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\ScimV2UsersIdPutBodyPermissions'; } - if ($object->isInitialized('appGroup') && null !== $object->getAppGroup()) { - $values_1 = []; - foreach ($object->getAppGroup() as $value_1) { - $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); - } - $data['appGroup'] = $values_1; + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\ScimV2UsersIdPutBodyPermissions'; } - foreach ($object as $key => $value_2) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value_2; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\ScimV2UsersIdPutBodyPermissions(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('companyPermissions', $data)) { + $values = []; + foreach ($data['companyPermissions'] as $value) { + $values[] = $value; + } + $object->setCompanyPermissions($values); + unset($data['companyPermissions']); + } + if (\array_key_exists('appGroup', $data)) { + $values_1 = []; + foreach ($data['appGroup'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, 'Braze\\Model\\ScimV2UsersIdPutBodyPermissionsAppGroupItem', 'json', $context); + } + $object->setAppGroup($values_1); + unset($data['appGroup']); + } + foreach ($data as $key => $value_2) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_2; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('companyPermissions') && null !== $object->getCompanyPermissions()) { + $values = []; + foreach ($object->getCompanyPermissions() as $value) { + $values[] = $value; + } + $data['companyPermissions'] = $values; + } + if ($object->isInitialized('appGroup') && null !== $object->getAppGroup()) { + $values_1 = []; + foreach ($object->getAppGroup() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $data['appGroup'] = $values_1; + } + foreach ($object as $key => $value_2) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_2; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\ScimV2UsersIdPutBodyPermissions' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\ScimV2UsersIdPutBodyPermissions' => false]; + } } } diff --git a/lib/Normalizer/ScimV2UsersPostBodyNameNormalizer.php b/lib/Normalizer/ScimV2UsersPostBodyNameNormalizer.php index 3d9b756..521cf58 100644 --- a/lib/Normalizer/ScimV2UsersPostBodyNameNormalizer.php +++ b/lib/Normalizer/ScimV2UsersPostBodyNameNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,75 +21,147 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class ScimV2UsersPostBodyNameNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\ScimV2UsersPostBodyName'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ScimV2UsersPostBodyNameNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\ScimV2UsersPostBodyName'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\ScimV2UsersPostBodyName'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\ScimV2UsersPostBodyName'; } - $object = new \Braze\Model\ScimV2UsersPostBodyName(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\ScimV2UsersPostBodyName(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('givenName', $data)) { + $object->setGivenName($data['givenName']); + unset($data['givenName']); + } + if (\array_key_exists('familyName', $data)) { + $object->setFamilyName($data['familyName']); + unset($data['familyName']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('givenName', $data)) { - $object->setGivenName($data['givenName']); - unset($data['givenName']); - } - if (\array_key_exists('familyName', $data)) { - $object->setFamilyName($data['familyName']); - unset($data['familyName']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('givenName') && null !== $object->getGivenName()) { + $data['givenName'] = $object->getGivenName(); + } + if ($object->isInitialized('familyName') && null !== $object->getFamilyName()) { + $data['familyName'] = $object->getFamilyName(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\ScimV2UsersPostBodyName' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class ScimV2UsersPostBodyNameNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('givenName') && null !== $object->getGivenName()) { - $data['givenName'] = $object->getGivenName(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\ScimV2UsersPostBodyName'; } - if ($object->isInitialized('familyName') && null !== $object->getFamilyName()) { - $data['familyName'] = $object->getFamilyName(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\ScimV2UsersPostBodyName'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\ScimV2UsersPostBodyName(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('givenName', $data)) { + $object->setGivenName($data['givenName']); + unset($data['givenName']); + } + if (\array_key_exists('familyName', $data)) { + $object->setFamilyName($data['familyName']); + unset($data['familyName']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('givenName') && null !== $object->getGivenName()) { + $data['givenName'] = $object->getGivenName(); + } + if ($object->isInitialized('familyName') && null !== $object->getFamilyName()) { + $data['familyName'] = $object->getFamilyName(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\ScimV2UsersPostBodyName' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\ScimV2UsersPostBodyName' => false]; + } } } diff --git a/lib/Normalizer/ScimV2UsersPostBodyNormalizer.php b/lib/Normalizer/ScimV2UsersPostBodyNormalizer.php index a7073f3..c8d0ac9 100644 --- a/lib/Normalizer/ScimV2UsersPostBodyNormalizer.php +++ b/lib/Normalizer/ScimV2UsersPostBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,104 +21,205 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class ScimV2UsersPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\ScimV2UsersPostBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ScimV2UsersPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\ScimV2UsersPostBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\ScimV2UsersPostBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\ScimV2UsersPostBody'; } - $object = new \Braze\Model\ScimV2UsersPostBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\ScimV2UsersPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('schemas', $data)) { + $values = []; + foreach ($data['schemas'] as $value) { + $values[] = $value; + } + $object->setSchemas($values); + unset($data['schemas']); + } + if (\array_key_exists('userName', $data)) { + $object->setUserName($data['userName']); + unset($data['userName']); + } + if (\array_key_exists('name', $data)) { + $object->setName($this->denormalizer->denormalize($data['name'], 'Braze\\Model\\ScimV2UsersPostBodyName', 'json', $context)); + unset($data['name']); + } + if (\array_key_exists('department', $data)) { + $object->setDepartment($data['department']); + unset($data['department']); + } + if (\array_key_exists('permissions', $data)) { + $object->setPermissions($this->denormalizer->denormalize($data['permissions'], 'Braze\\Model\\ScimV2UsersPostBodyPermissions', 'json', $context)); + unset($data['permissions']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('schemas', $data)) { - $values = []; - foreach ($data['schemas'] as $value) { - $values[] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('schemas') && null !== $object->getSchemas()) { + $values = []; + foreach ($object->getSchemas() as $value) { + $values[] = $value; + } + $data['schemas'] = $values; } - $object->setSchemas($values); - unset($data['schemas']); - } - if (\array_key_exists('userName', $data)) { - $object->setUserName($data['userName']); - unset($data['userName']); - } - if (\array_key_exists('name', $data)) { - $object->setName($this->denormalizer->denormalize($data['name'], 'Braze\\Model\\ScimV2UsersPostBodyName', 'json', $context)); - unset($data['name']); - } - if (\array_key_exists('department', $data)) { - $object->setDepartment($data['department']); - unset($data['department']); - } - if (\array_key_exists('permissions', $data)) { - $object->setPermissions($this->denormalizer->denormalize($data['permissions'], 'Braze\\Model\\ScimV2UsersPostBodyPermissions', 'json', $context)); - unset($data['permissions']); - } - foreach ($data as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value_1; + if ($object->isInitialized('userName') && null !== $object->getUserName()) { + $data['userName'] = $object->getUserName(); + } + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['name'] = $this->normalizer->normalize($object->getName(), 'json', $context); + } + if ($object->isInitialized('department') && null !== $object->getDepartment()) { + $data['department'] = $object->getDepartment(); + } + if ($object->isInitialized('permissions') && null !== $object->getPermissions()) { + $data['permissions'] = $this->normalizer->normalize($object->getPermissions(), 'json', $context); } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\ScimV2UsersPostBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class ScimV2UsersPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('schemas') && null !== $object->getSchemas()) { - $values = []; - foreach ($object->getSchemas() as $value) { - $values[] = $value; - } - $data['schemas'] = $values; - } - if ($object->isInitialized('userName') && null !== $object->getUserName()) { - $data['userName'] = $object->getUserName(); - } - if ($object->isInitialized('name') && null !== $object->getName()) { - $data['name'] = $this->normalizer->normalize($object->getName(), 'json', $context); - } - if ($object->isInitialized('department') && null !== $object->getDepartment()) { - $data['department'] = $object->getDepartment(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\ScimV2UsersPostBody'; } - if ($object->isInitialized('permissions') && null !== $object->getPermissions()) { - $data['permissions'] = $this->normalizer->normalize($object->getPermissions(), 'json', $context); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\ScimV2UsersPostBody'; } - foreach ($object as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value_1; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\ScimV2UsersPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('schemas', $data)) { + $values = []; + foreach ($data['schemas'] as $value) { + $values[] = $value; + } + $object->setSchemas($values); + unset($data['schemas']); + } + if (\array_key_exists('userName', $data)) { + $object->setUserName($data['userName']); + unset($data['userName']); + } + if (\array_key_exists('name', $data)) { + $object->setName($this->denormalizer->denormalize($data['name'], 'Braze\\Model\\ScimV2UsersPostBodyName', 'json', $context)); + unset($data['name']); + } + if (\array_key_exists('department', $data)) { + $object->setDepartment($data['department']); + unset($data['department']); + } + if (\array_key_exists('permissions', $data)) { + $object->setPermissions($this->denormalizer->denormalize($data['permissions'], 'Braze\\Model\\ScimV2UsersPostBodyPermissions', 'json', $context)); + unset($data['permissions']); } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('schemas') && null !== $object->getSchemas()) { + $values = []; + foreach ($object->getSchemas() as $value) { + $values[] = $value; + } + $data['schemas'] = $values; + } + if ($object->isInitialized('userName') && null !== $object->getUserName()) { + $data['userName'] = $object->getUserName(); + } + if ($object->isInitialized('name') && null !== $object->getName()) { + $data['name'] = $this->normalizer->normalize($object->getName(), 'json', $context); + } + if ($object->isInitialized('department') && null !== $object->getDepartment()) { + $data['department'] = $object->getDepartment(); + } + if ($object->isInitialized('permissions') && null !== $object->getPermissions()) { + $data['permissions'] = $this->normalizer->normalize($object->getPermissions(), 'json', $context); + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\ScimV2UsersPostBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\ScimV2UsersPostBody' => false]; + } } } diff --git a/lib/Normalizer/ScimV2UsersPostBodyPermissionsAppGroupItemNormalizer.php b/lib/Normalizer/ScimV2UsersPostBodyPermissionsAppGroupItemNormalizer.php index 2826a3f..be9bc49 100644 --- a/lib/Normalizer/ScimV2UsersPostBodyPermissionsAppGroupItemNormalizer.php +++ b/lib/Normalizer/ScimV2UsersPostBodyPermissionsAppGroupItemNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,98 +21,193 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class ScimV2UsersPostBodyPermissionsAppGroupItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\ScimV2UsersPostBodyPermissionsAppGroupItem'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ScimV2UsersPostBodyPermissionsAppGroupItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\ScimV2UsersPostBodyPermissionsAppGroupItem'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\ScimV2UsersPostBodyPermissionsAppGroupItem'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\ScimV2UsersPostBodyPermissionsAppGroupItem'; } - $object = new \Braze\Model\ScimV2UsersPostBodyPermissionsAppGroupItem(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\ScimV2UsersPostBodyPermissionsAppGroupItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('appGroupName', $data)) { + $object->setAppGroupName($data['appGroupName']); + unset($data['appGroupName']); + } + if (\array_key_exists('appGroupPermissions', $data)) { + $values = []; + foreach ($data['appGroupPermissions'] as $value) { + $values[] = $value; + } + $object->setAppGroupPermissions($values); + unset($data['appGroupPermissions']); + } + if (\array_key_exists('team', $data)) { + $values_1 = []; + foreach ($data['team'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, 'Braze\\Model\\ScimV2UsersPostBodyPermissionsAppGroupItemTeamItem', 'json', $context); + } + $object->setTeam($values_1); + unset($data['team']); + } + foreach ($data as $key => $value_2) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_2; + } + } + return $object; } - if (\array_key_exists('appGroupName', $data)) { - $object->setAppGroupName($data['appGroupName']); - unset($data['appGroupName']); - } - if (\array_key_exists('appGroupPermissions', $data)) { - $values = []; - foreach ($data['appGroupPermissions'] as $value) { - $values[] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('appGroupName') && null !== $object->getAppGroupName()) { + $data['appGroupName'] = $object->getAppGroupName(); } - $object->setAppGroupPermissions($values); - unset($data['appGroupPermissions']); - } - if (\array_key_exists('team', $data)) { - $values_1 = []; - foreach ($data['team'] as $value_1) { - $values_1[] = $this->denormalizer->denormalize($value_1, 'Braze\\Model\\ScimV2UsersPostBodyPermissionsAppGroupItemTeamItem', 'json', $context); + if ($object->isInitialized('appGroupPermissions') && null !== $object->getAppGroupPermissions()) { + $values = []; + foreach ($object->getAppGroupPermissions() as $value) { + $values[] = $value; + } + $data['appGroupPermissions'] = $values; } - $object->setTeam($values_1); - unset($data['team']); - } - foreach ($data as $key => $value_2) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value_2; + if ($object->isInitialized('team') && null !== $object->getTeam()) { + $values_1 = []; + foreach ($object->getTeam() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $data['team'] = $values_1; + } + foreach ($object as $key => $value_2) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_2; + } } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\ScimV2UsersPostBodyPermissionsAppGroupItem' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class ScimV2UsersPostBodyPermissionsAppGroupItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('appGroupName') && null !== $object->getAppGroupName()) { - $data['appGroupName'] = $object->getAppGroupName(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\ScimV2UsersPostBodyPermissionsAppGroupItem'; } - if ($object->isInitialized('appGroupPermissions') && null !== $object->getAppGroupPermissions()) { - $values = []; - foreach ($object->getAppGroupPermissions() as $value) { - $values[] = $value; - } - $data['appGroupPermissions'] = $values; + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\ScimV2UsersPostBodyPermissionsAppGroupItem'; } - if ($object->isInitialized('team') && null !== $object->getTeam()) { - $values_1 = []; - foreach ($object->getTeam() as $value_1) { - $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - $data['team'] = $values_1; - } - foreach ($object as $key => $value_2) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value_2; + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\ScimV2UsersPostBodyPermissionsAppGroupItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('appGroupName', $data)) { + $object->setAppGroupName($data['appGroupName']); + unset($data['appGroupName']); + } + if (\array_key_exists('appGroupPermissions', $data)) { + $values = []; + foreach ($data['appGroupPermissions'] as $value) { + $values[] = $value; + } + $object->setAppGroupPermissions($values); + unset($data['appGroupPermissions']); + } + if (\array_key_exists('team', $data)) { + $values_1 = []; + foreach ($data['team'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, 'Braze\\Model\\ScimV2UsersPostBodyPermissionsAppGroupItemTeamItem', 'json', $context); + } + $object->setTeam($values_1); + unset($data['team']); + } + foreach ($data as $key => $value_2) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_2; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('appGroupName') && null !== $object->getAppGroupName()) { + $data['appGroupName'] = $object->getAppGroupName(); + } + if ($object->isInitialized('appGroupPermissions') && null !== $object->getAppGroupPermissions()) { + $values = []; + foreach ($object->getAppGroupPermissions() as $value) { + $values[] = $value; + } + $data['appGroupPermissions'] = $values; + } + if ($object->isInitialized('team') && null !== $object->getTeam()) { + $values_1 = []; + foreach ($object->getTeam() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $data['team'] = $values_1; + } + foreach ($object as $key => $value_2) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_2; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\ScimV2UsersPostBodyPermissionsAppGroupItem' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\ScimV2UsersPostBodyPermissionsAppGroupItem' => false]; + } } } diff --git a/lib/Normalizer/ScimV2UsersPostBodyPermissionsAppGroupItemTeamItemNormalizer.php b/lib/Normalizer/ScimV2UsersPostBodyPermissionsAppGroupItemTeamItemNormalizer.php index f2c738f..06101b2 100644 --- a/lib/Normalizer/ScimV2UsersPostBodyPermissionsAppGroupItemTeamItemNormalizer.php +++ b/lib/Normalizer/ScimV2UsersPostBodyPermissionsAppGroupItemTeamItemNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,83 +21,163 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class ScimV2UsersPostBodyPermissionsAppGroupItemTeamItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\ScimV2UsersPostBodyPermissionsAppGroupItemTeamItem'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ScimV2UsersPostBodyPermissionsAppGroupItemTeamItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\ScimV2UsersPostBodyPermissionsAppGroupItemTeamItem'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\ScimV2UsersPostBodyPermissionsAppGroupItemTeamItem'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\ScimV2UsersPostBodyPermissionsAppGroupItemTeamItem'; } - $object = new \Braze\Model\ScimV2UsersPostBodyPermissionsAppGroupItemTeamItem(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\ScimV2UsersPostBodyPermissionsAppGroupItemTeamItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('teamName', $data)) { + $object->setTeamName($data['teamName']); + unset($data['teamName']); + } + if (\array_key_exists('teamPermissions', $data)) { + $values = []; + foreach ($data['teamPermissions'] as $value) { + $values[] = $value; + } + $object->setTeamPermissions($values); + unset($data['teamPermissions']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('teamName', $data)) { - $object->setTeamName($data['teamName']); - unset($data['teamName']); - } - if (\array_key_exists('teamPermissions', $data)) { - $values = []; - foreach ($data['teamPermissions'] as $value) { - $values[] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('teamName') && null !== $object->getTeamName()) { + $data['teamName'] = $object->getTeamName(); } - $object->setTeamPermissions($values); - unset($data['teamPermissions']); - } - foreach ($data as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value_1; + if ($object->isInitialized('teamPermissions') && null !== $object->getTeamPermissions()) { + $values = []; + foreach ($object->getTeamPermissions() as $value) { + $values[] = $value; + } + $data['teamPermissions'] = $values; + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\ScimV2UsersPostBodyPermissionsAppGroupItemTeamItem' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class ScimV2UsersPostBodyPermissionsAppGroupItemTeamItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('teamName') && null !== $object->getTeamName()) { - $data['teamName'] = $object->getTeamName(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\ScimV2UsersPostBodyPermissionsAppGroupItemTeamItem'; } - if ($object->isInitialized('teamPermissions') && null !== $object->getTeamPermissions()) { - $values = []; - foreach ($object->getTeamPermissions() as $value) { - $values[] = $value; - } - $data['teamPermissions'] = $values; + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\ScimV2UsersPostBodyPermissionsAppGroupItemTeamItem'; } - foreach ($object as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value_1; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\ScimV2UsersPostBodyPermissionsAppGroupItemTeamItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('teamName', $data)) { + $object->setTeamName($data['teamName']); + unset($data['teamName']); + } + if (\array_key_exists('teamPermissions', $data)) { + $values = []; + foreach ($data['teamPermissions'] as $value) { + $values[] = $value; + } + $object->setTeamPermissions($values); + unset($data['teamPermissions']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('teamName') && null !== $object->getTeamName()) { + $data['teamName'] = $object->getTeamName(); + } + if ($object->isInitialized('teamPermissions') && null !== $object->getTeamPermissions()) { + $values = []; + foreach ($object->getTeamPermissions() as $value) { + $values[] = $value; + } + $data['teamPermissions'] = $values; + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\ScimV2UsersPostBodyPermissionsAppGroupItemTeamItem' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\ScimV2UsersPostBodyPermissionsAppGroupItemTeamItem' => false]; + } } } diff --git a/lib/Normalizer/ScimV2UsersPostBodyPermissionsNormalizer.php b/lib/Normalizer/ScimV2UsersPostBodyPermissionsNormalizer.php index c18a98f..d620b25 100644 --- a/lib/Normalizer/ScimV2UsersPostBodyPermissionsNormalizer.php +++ b/lib/Normalizer/ScimV2UsersPostBodyPermissionsNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,91 +21,179 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class ScimV2UsersPostBodyPermissionsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\ScimV2UsersPostBodyPermissions'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class ScimV2UsersPostBodyPermissionsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\ScimV2UsersPostBodyPermissions'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\ScimV2UsersPostBodyPermissions'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\ScimV2UsersPostBodyPermissions'; } - $object = new \Braze\Model\ScimV2UsersPostBodyPermissions(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\ScimV2UsersPostBodyPermissions(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('companyPermissions', $data)) { + $values = []; + foreach ($data['companyPermissions'] as $value) { + $values[] = $value; + } + $object->setCompanyPermissions($values); + unset($data['companyPermissions']); + } + if (\array_key_exists('appGroup', $data)) { + $values_1 = []; + foreach ($data['appGroup'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, 'Braze\\Model\\ScimV2UsersPostBodyPermissionsAppGroupItem', 'json', $context); + } + $object->setAppGroup($values_1); + unset($data['appGroup']); + } + foreach ($data as $key => $value_2) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_2; + } + } + return $object; } - if (\array_key_exists('companyPermissions', $data)) { - $values = []; - foreach ($data['companyPermissions'] as $value) { - $values[] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('companyPermissions') && null !== $object->getCompanyPermissions()) { + $values = []; + foreach ($object->getCompanyPermissions() as $value) { + $values[] = $value; + } + $data['companyPermissions'] = $values; } - $object->setCompanyPermissions($values); - unset($data['companyPermissions']); - } - if (\array_key_exists('appGroup', $data)) { - $values_1 = []; - foreach ($data['appGroup'] as $value_1) { - $values_1[] = $this->denormalizer->denormalize($value_1, 'Braze\\Model\\ScimV2UsersPostBodyPermissionsAppGroupItem', 'json', $context); + if ($object->isInitialized('appGroup') && null !== $object->getAppGroup()) { + $values_1 = []; + foreach ($object->getAppGroup() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $data['appGroup'] = $values_1; } - $object->setAppGroup($values_1); - unset($data['appGroup']); - } - foreach ($data as $key => $value_2) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value_2; + foreach ($object as $key => $value_2) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_2; + } } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\ScimV2UsersPostBodyPermissions' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class ScimV2UsersPostBodyPermissionsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('companyPermissions') && null !== $object->getCompanyPermissions()) { - $values = []; - foreach ($object->getCompanyPermissions() as $value) { - $values[] = $value; - } - $data['companyPermissions'] = $values; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\ScimV2UsersPostBodyPermissions'; } - if ($object->isInitialized('appGroup') && null !== $object->getAppGroup()) { - $values_1 = []; - foreach ($object->getAppGroup() as $value_1) { - $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); - } - $data['appGroup'] = $values_1; + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\ScimV2UsersPostBodyPermissions'; } - foreach ($object as $key => $value_2) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value_2; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\ScimV2UsersPostBodyPermissions(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('companyPermissions', $data)) { + $values = []; + foreach ($data['companyPermissions'] as $value) { + $values[] = $value; + } + $object->setCompanyPermissions($values); + unset($data['companyPermissions']); + } + if (\array_key_exists('appGroup', $data)) { + $values_1 = []; + foreach ($data['appGroup'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, 'Braze\\Model\\ScimV2UsersPostBodyPermissionsAppGroupItem', 'json', $context); + } + $object->setAppGroup($values_1); + unset($data['appGroup']); + } + foreach ($data as $key => $value_2) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_2; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('companyPermissions') && null !== $object->getCompanyPermissions()) { + $values = []; + foreach ($object->getCompanyPermissions() as $value) { + $values[] = $value; + } + $data['companyPermissions'] = $values; + } + if ($object->isInitialized('appGroup') && null !== $object->getAppGroup()) { + $values_1 = []; + foreach ($object->getAppGroup() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $data['appGroup'] = $values_1; + } + foreach ($object as $key => $value_2) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_2; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\ScimV2UsersPostBodyPermissions' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\ScimV2UsersPostBodyPermissions' => false]; + } } } diff --git a/lib/Normalizer/SendsIdCreatePostBodyNormalizer.php b/lib/Normalizer/SendsIdCreatePostBodyNormalizer.php index acdd976..9a40b44 100644 --- a/lib/Normalizer/SendsIdCreatePostBodyNormalizer.php +++ b/lib/Normalizer/SendsIdCreatePostBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,75 +21,147 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class SendsIdCreatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\SendsIdCreatePostBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class SendsIdCreatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\SendsIdCreatePostBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\SendsIdCreatePostBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\SendsIdCreatePostBody'; } - $object = new \Braze\Model\SendsIdCreatePostBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\SendsIdCreatePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('campaign_id', $data)) { + $object->setCampaignId($data['campaign_id']); + unset($data['campaign_id']); + } + if (\array_key_exists('send_id', $data)) { + $object->setSendId($data['send_id']); + unset($data['send_id']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('campaign_id', $data)) { - $object->setCampaignId($data['campaign_id']); - unset($data['campaign_id']); - } - if (\array_key_exists('send_id', $data)) { - $object->setSendId($data['send_id']); - unset($data['send_id']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('campaignId') && null !== $object->getCampaignId()) { + $data['campaign_id'] = $object->getCampaignId(); + } + if ($object->isInitialized('sendId') && null !== $object->getSendId()) { + $data['send_id'] = $object->getSendId(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\SendsIdCreatePostBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class SendsIdCreatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('campaignId') && null !== $object->getCampaignId()) { - $data['campaign_id'] = $object->getCampaignId(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\SendsIdCreatePostBody'; } - if ($object->isInitialized('sendId') && null !== $object->getSendId()) { - $data['send_id'] = $object->getSendId(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\SendsIdCreatePostBody'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\SendsIdCreatePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('campaign_id', $data)) { + $object->setCampaignId($data['campaign_id']); + unset($data['campaign_id']); + } + if (\array_key_exists('send_id', $data)) { + $object->setSendId($data['send_id']); + unset($data['send_id']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('campaignId') && null !== $object->getCampaignId()) { + $data['campaign_id'] = $object->getCampaignId(); + } + if ($object->isInitialized('sendId') && null !== $object->getSendId()) { + $data['send_id'] = $object->getSendId(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\SendsIdCreatePostBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\SendsIdCreatePostBody' => false]; + } } } diff --git a/lib/Normalizer/SmsInvalidPhoneNumbersRemovePostBodyNormalizer.php b/lib/Normalizer/SmsInvalidPhoneNumbersRemovePostBodyNormalizer.php index dbe858a..b4e5da1 100644 --- a/lib/Normalizer/SmsInvalidPhoneNumbersRemovePostBodyNormalizer.php +++ b/lib/Normalizer/SmsInvalidPhoneNumbersRemovePostBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,76 +21,149 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class SmsInvalidPhoneNumbersRemovePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class SmsInvalidPhoneNumbersRemovePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return $type === 'Braze\\Model\\SmsInvalidPhoneNumbersRemovePostBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool - { - return is_object($data) && get_class($data) === 'Braze\\Model\\SmsInvalidPhoneNumbersRemovePostBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\SmsInvalidPhoneNumbersRemovePostBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\SmsInvalidPhoneNumbersRemovePostBody'; } - $object = new \Braze\Model\SmsInvalidPhoneNumbersRemovePostBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\SmsInvalidPhoneNumbersRemovePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('phone_numbers', $data)) { + $values = []; + foreach ($data['phone_numbers'] as $value) { + $values[] = $value; + } + $object->setPhoneNumbers($values); + unset($data['phone_numbers']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('phone_numbers', $data)) { - $values = []; - foreach ($data['phone_numbers'] as $value) { - $values[] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('phoneNumbers') && null !== $object->getPhoneNumbers()) { + $values = []; + foreach ($object->getPhoneNumbers() as $value) { + $values[] = $value; + } + $data['phone_numbers'] = $values; } - $object->setPhoneNumbers($values); - unset($data['phone_numbers']); - } - foreach ($data as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value_1; + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\SmsInvalidPhoneNumbersRemovePostBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class SmsInvalidPhoneNumbersRemovePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('phoneNumbers') && null !== $object->getPhoneNumbers()) { - $values = []; - foreach ($object->getPhoneNumbers() as $value) { - $values[] = $value; - } - $data['phone_numbers'] = $values; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\SmsInvalidPhoneNumbersRemovePostBody'; } - foreach ($object as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value_1; + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\SmsInvalidPhoneNumbersRemovePostBody'; + } + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\SmsInvalidPhoneNumbersRemovePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('phone_numbers', $data)) { + $values = []; + foreach ($data['phone_numbers'] as $value) { + $values[] = $value; + } + $object->setPhoneNumbers($values); + unset($data['phone_numbers']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('phoneNumbers') && null !== $object->getPhoneNumbers()) { + $values = []; + foreach ($object->getPhoneNumbers() as $value) { + $values[] = $value; + } + $data['phone_numbers'] = $values; + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\SmsInvalidPhoneNumbersRemovePostBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\SmsInvalidPhoneNumbersRemovePostBody' => false]; + } } } diff --git a/lib/Normalizer/SubscriptionStatusSetPostBodyNormalizer.php b/lib/Normalizer/SubscriptionStatusSetPostBodyNormalizer.php index 2879a4f..6d5fa0e 100644 --- a/lib/Normalizer/SubscriptionStatusSetPostBodyNormalizer.php +++ b/lib/Normalizer/SubscriptionStatusSetPostBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,97 +21,191 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class SubscriptionStatusSetPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class SubscriptionStatusSetPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return $type === 'Braze\\Model\\SubscriptionStatusSetPostBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function supportsNormalization($data, $format = null, array $context = []): bool - { - return is_object($data) && get_class($data) === 'Braze\\Model\\SubscriptionStatusSetPostBody'; - } - - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\SubscriptionStatusSetPostBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\SubscriptionStatusSetPostBody'; } - $object = new \Braze\Model\SubscriptionStatusSetPostBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\SubscriptionStatusSetPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('subscription_group_id', $data)) { + $object->setSubscriptionGroupId($data['subscription_group_id']); + unset($data['subscription_group_id']); + } + if (\array_key_exists('subscription_state', $data)) { + $object->setSubscriptionState($data['subscription_state']); + unset($data['subscription_state']); + } + if (\array_key_exists('external_id', $data)) { + $object->setExternalId($data['external_id']); + unset($data['external_id']); + } + if (\array_key_exists('phone', $data)) { + $values = []; + foreach ($data['phone'] as $value) { + $values[] = $value; + } + $object->setPhone($values); + unset($data['phone']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('subscription_group_id', $data)) { - $object->setSubscriptionGroupId($data['subscription_group_id']); - unset($data['subscription_group_id']); - } - if (\array_key_exists('subscription_state', $data)) { - $object->setSubscriptionState($data['subscription_state']); - unset($data['subscription_state']); - } - if (\array_key_exists('external_id', $data)) { - $object->setExternalId($data['external_id']); - unset($data['external_id']); - } - if (\array_key_exists('phone', $data)) { - $values = []; - foreach ($data['phone'] as $value) { - $values[] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('subscriptionGroupId') && null !== $object->getSubscriptionGroupId()) { + $data['subscription_group_id'] = $object->getSubscriptionGroupId(); } - $object->setPhone($values); - unset($data['phone']); - } - foreach ($data as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value_1; + if ($object->isInitialized('subscriptionState') && null !== $object->getSubscriptionState()) { + $data['subscription_state'] = $object->getSubscriptionState(); + } + if ($object->isInitialized('externalId') && null !== $object->getExternalId()) { + $data['external_id'] = $object->getExternalId(); } + if ($object->isInitialized('phone') && null !== $object->getPhone()) { + $values = []; + foreach ($object->getPhone() as $value) { + $values[] = $value; + } + $data['phone'] = $values; + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\SubscriptionStatusSetPostBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class SubscriptionStatusSetPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('subscriptionGroupId') && null !== $object->getSubscriptionGroupId()) { - $data['subscription_group_id'] = $object->getSubscriptionGroupId(); - } - if ($object->isInitialized('subscriptionState') && null !== $object->getSubscriptionState()) { - $data['subscription_state'] = $object->getSubscriptionState(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\SubscriptionStatusSetPostBody'; } - if ($object->isInitialized('externalId') && null !== $object->getExternalId()) { - $data['external_id'] = $object->getExternalId(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\SubscriptionStatusSetPostBody'; } - if ($object->isInitialized('phone') && null !== $object->getPhone()) { - $values = []; - foreach ($object->getPhone() as $value) { - $values[] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - $data['phone'] = $values; - } - foreach ($object as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value_1; + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\SubscriptionStatusSetPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('subscription_group_id', $data)) { + $object->setSubscriptionGroupId($data['subscription_group_id']); + unset($data['subscription_group_id']); + } + if (\array_key_exists('subscription_state', $data)) { + $object->setSubscriptionState($data['subscription_state']); + unset($data['subscription_state']); + } + if (\array_key_exists('external_id', $data)) { + $object->setExternalId($data['external_id']); + unset($data['external_id']); + } + if (\array_key_exists('phone', $data)) { + $values = []; + foreach ($data['phone'] as $value) { + $values[] = $value; + } + $object->setPhone($values); + unset($data['phone']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('subscriptionGroupId') && null !== $object->getSubscriptionGroupId()) { + $data['subscription_group_id'] = $object->getSubscriptionGroupId(); + } + if ($object->isInitialized('subscriptionState') && null !== $object->getSubscriptionState()) { + $data['subscription_state'] = $object->getSubscriptionState(); + } + if ($object->isInitialized('externalId') && null !== $object->getExternalId()) { + $data['external_id'] = $object->getExternalId(); + } + if ($object->isInitialized('phone') && null !== $object->getPhone()) { + $values = []; + foreach ($object->getPhone() as $value) { + $values[] = $value; + } + $data['phone'] = $values; + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\SubscriptionStatusSetPostBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\SubscriptionStatusSetPostBody' => false]; + } } } diff --git a/lib/Normalizer/TemplatesEmailCreatePostBodyNormalizer.php b/lib/Normalizer/TemplatesEmailCreatePostBodyNormalizer.php index aeeb408..32d9988 100644 --- a/lib/Normalizer/TemplatesEmailCreatePostBodyNormalizer.php +++ b/lib/Normalizer/TemplatesEmailCreatePostBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,111 +21,219 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class TemplatesEmailCreatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\TemplatesEmailCreatePostBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class TemplatesEmailCreatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\TemplatesEmailCreatePostBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\TemplatesEmailCreatePostBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\TemplatesEmailCreatePostBody'; } - $object = new \Braze\Model\TemplatesEmailCreatePostBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\TemplatesEmailCreatePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('template_name', $data)) { + $object->setTemplateName($data['template_name']); + unset($data['template_name']); + } + if (\array_key_exists('subject', $data)) { + $object->setSubject($data['subject']); + unset($data['subject']); + } + if (\array_key_exists('body', $data)) { + $object->setBody($data['body']); + unset($data['body']); + } + if (\array_key_exists('plaintext_body', $data)) { + $object->setPlaintextBody($data['plaintext_body']); + unset($data['plaintext_body']); + } + if (\array_key_exists('preheader', $data)) { + $object->setPreheader($data['preheader']); + unset($data['preheader']); + } + if (\array_key_exists('tags', $data)) { + $values = []; + foreach ($data['tags'] as $value) { + $values[] = $value; + } + $object->setTags($values); + unset($data['tags']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('template_name', $data)) { - $object->setTemplateName($data['template_name']); - unset($data['template_name']); - } - if (\array_key_exists('subject', $data)) { - $object->setSubject($data['subject']); - unset($data['subject']); - } - if (\array_key_exists('body', $data)) { - $object->setBody($data['body']); - unset($data['body']); - } - if (\array_key_exists('plaintext_body', $data)) { - $object->setPlaintextBody($data['plaintext_body']); - unset($data['plaintext_body']); - } - if (\array_key_exists('preheader', $data)) { - $object->setPreheader($data['preheader']); - unset($data['preheader']); - } - if (\array_key_exists('tags', $data)) { - $values = []; - foreach ($data['tags'] as $value) { - $values[] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('templateName') && null !== $object->getTemplateName()) { + $data['template_name'] = $object->getTemplateName(); } - $object->setTags($values); - unset($data['tags']); - } - foreach ($data as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value_1; + if ($object->isInitialized('subject') && null !== $object->getSubject()) { + $data['subject'] = $object->getSubject(); + } + if ($object->isInitialized('body') && null !== $object->getBody()) { + $data['body'] = $object->getBody(); + } + if ($object->isInitialized('plaintextBody') && null !== $object->getPlaintextBody()) { + $data['plaintext_body'] = $object->getPlaintextBody(); } + if ($object->isInitialized('preheader') && null !== $object->getPreheader()) { + $data['preheader'] = $object->getPreheader(); + } + if ($object->isInitialized('tags') && null !== $object->getTags()) { + $values = []; + foreach ($object->getTags() as $value) { + $values[] = $value; + } + $data['tags'] = $values; + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\TemplatesEmailCreatePostBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class TemplatesEmailCreatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('templateName') && null !== $object->getTemplateName()) { - $data['template_name'] = $object->getTemplateName(); - } - if ($object->isInitialized('subject') && null !== $object->getSubject()) { - $data['subject'] = $object->getSubject(); - } - if ($object->isInitialized('body') && null !== $object->getBody()) { - $data['body'] = $object->getBody(); - } - if ($object->isInitialized('plaintextBody') && null !== $object->getPlaintextBody()) { - $data['plaintext_body'] = $object->getPlaintextBody(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\TemplatesEmailCreatePostBody'; } - if ($object->isInitialized('preheader') && null !== $object->getPreheader()) { - $data['preheader'] = $object->getPreheader(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\TemplatesEmailCreatePostBody'; } - if ($object->isInitialized('tags') && null !== $object->getTags()) { - $values = []; - foreach ($object->getTags() as $value) { - $values[] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - $data['tags'] = $values; - } - foreach ($object as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value_1; + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\TemplatesEmailCreatePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('template_name', $data)) { + $object->setTemplateName($data['template_name']); + unset($data['template_name']); + } + if (\array_key_exists('subject', $data)) { + $object->setSubject($data['subject']); + unset($data['subject']); + } + if (\array_key_exists('body', $data)) { + $object->setBody($data['body']); + unset($data['body']); + } + if (\array_key_exists('plaintext_body', $data)) { + $object->setPlaintextBody($data['plaintext_body']); + unset($data['plaintext_body']); + } + if (\array_key_exists('preheader', $data)) { + $object->setPreheader($data['preheader']); + unset($data['preheader']); + } + if (\array_key_exists('tags', $data)) { + $values = []; + foreach ($data['tags'] as $value) { + $values[] = $value; + } + $object->setTags($values); + unset($data['tags']); } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('templateName') && null !== $object->getTemplateName()) { + $data['template_name'] = $object->getTemplateName(); + } + if ($object->isInitialized('subject') && null !== $object->getSubject()) { + $data['subject'] = $object->getSubject(); + } + if ($object->isInitialized('body') && null !== $object->getBody()) { + $data['body'] = $object->getBody(); + } + if ($object->isInitialized('plaintextBody') && null !== $object->getPlaintextBody()) { + $data['plaintext_body'] = $object->getPlaintextBody(); + } + if ($object->isInitialized('preheader') && null !== $object->getPreheader()) { + $data['preheader'] = $object->getPreheader(); + } + if ($object->isInitialized('tags') && null !== $object->getTags()) { + $values = []; + foreach ($object->getTags() as $value) { + $values[] = $value; + } + $data['tags'] = $values; + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\TemplatesEmailCreatePostBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\TemplatesEmailCreatePostBody' => false]; + } } } diff --git a/lib/Normalizer/TemplatesEmailUpdatePostBodyNormalizer.php b/lib/Normalizer/TemplatesEmailUpdatePostBodyNormalizer.php index d89bd22..ce29963 100644 --- a/lib/Normalizer/TemplatesEmailUpdatePostBodyNormalizer.php +++ b/lib/Normalizer/TemplatesEmailUpdatePostBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,118 +21,233 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class TemplatesEmailUpdatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class TemplatesEmailUpdatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return $type === 'Braze\\Model\\TemplatesEmailUpdatePostBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool - { - return is_object($data) && get_class($data) === 'Braze\\Model\\TemplatesEmailUpdatePostBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\TemplatesEmailUpdatePostBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\TemplatesEmailUpdatePostBody'; } - $object = new \Braze\Model\TemplatesEmailUpdatePostBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\TemplatesEmailUpdatePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('email_template_id', $data)) { + $object->setEmailTemplateId($data['email_template_id']); + unset($data['email_template_id']); + } + if (\array_key_exists('template_name', $data)) { + $object->setTemplateName($data['template_name']); + unset($data['template_name']); + } + if (\array_key_exists('subject', $data)) { + $object->setSubject($data['subject']); + unset($data['subject']); + } + if (\array_key_exists('body', $data)) { + $object->setBody($data['body']); + unset($data['body']); + } + if (\array_key_exists('plaintext_body', $data)) { + $object->setPlaintextBody($data['plaintext_body']); + unset($data['plaintext_body']); + } + if (\array_key_exists('preheader', $data)) { + $object->setPreheader($data['preheader']); + unset($data['preheader']); + } + if (\array_key_exists('tags', $data)) { + $values = []; + foreach ($data['tags'] as $value) { + $values[] = $value; + } + $object->setTags($values); + unset($data['tags']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('email_template_id', $data)) { - $object->setEmailTemplateId($data['email_template_id']); - unset($data['email_template_id']); - } - if (\array_key_exists('template_name', $data)) { - $object->setTemplateName($data['template_name']); - unset($data['template_name']); - } - if (\array_key_exists('subject', $data)) { - $object->setSubject($data['subject']); - unset($data['subject']); - } - if (\array_key_exists('body', $data)) { - $object->setBody($data['body']); - unset($data['body']); - } - if (\array_key_exists('plaintext_body', $data)) { - $object->setPlaintextBody($data['plaintext_body']); - unset($data['plaintext_body']); - } - if (\array_key_exists('preheader', $data)) { - $object->setPreheader($data['preheader']); - unset($data['preheader']); - } - if (\array_key_exists('tags', $data)) { - $values = []; - foreach ($data['tags'] as $value) { - $values[] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('emailTemplateId') && null !== $object->getEmailTemplateId()) { + $data['email_template_id'] = $object->getEmailTemplateId(); } - $object->setTags($values); - unset($data['tags']); - } - foreach ($data as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value_1; + if ($object->isInitialized('templateName') && null !== $object->getTemplateName()) { + $data['template_name'] = $object->getTemplateName(); + } + if ($object->isInitialized('subject') && null !== $object->getSubject()) { + $data['subject'] = $object->getSubject(); + } + if ($object->isInitialized('body') && null !== $object->getBody()) { + $data['body'] = $object->getBody(); + } + if ($object->isInitialized('plaintextBody') && null !== $object->getPlaintextBody()) { + $data['plaintext_body'] = $object->getPlaintextBody(); } + if ($object->isInitialized('preheader') && null !== $object->getPreheader()) { + $data['preheader'] = $object->getPreheader(); + } + if ($object->isInitialized('tags') && null !== $object->getTags()) { + $values = []; + foreach ($object->getTags() as $value) { + $values[] = $value; + } + $data['tags'] = $values; + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\TemplatesEmailUpdatePostBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class TemplatesEmailUpdatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('emailTemplateId') && null !== $object->getEmailTemplateId()) { - $data['email_template_id'] = $object->getEmailTemplateId(); - } - if ($object->isInitialized('templateName') && null !== $object->getTemplateName()) { - $data['template_name'] = $object->getTemplateName(); - } - if ($object->isInitialized('subject') && null !== $object->getSubject()) { - $data['subject'] = $object->getSubject(); - } - if ($object->isInitialized('body') && null !== $object->getBody()) { - $data['body'] = $object->getBody(); - } - if ($object->isInitialized('plaintextBody') && null !== $object->getPlaintextBody()) { - $data['plaintext_body'] = $object->getPlaintextBody(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\TemplatesEmailUpdatePostBody'; } - if ($object->isInitialized('preheader') && null !== $object->getPreheader()) { - $data['preheader'] = $object->getPreheader(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\TemplatesEmailUpdatePostBody'; } - if ($object->isInitialized('tags') && null !== $object->getTags()) { - $values = []; - foreach ($object->getTags() as $value) { - $values[] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - $data['tags'] = $values; - } - foreach ($object as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value_1; + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\TemplatesEmailUpdatePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('email_template_id', $data)) { + $object->setEmailTemplateId($data['email_template_id']); + unset($data['email_template_id']); + } + if (\array_key_exists('template_name', $data)) { + $object->setTemplateName($data['template_name']); + unset($data['template_name']); + } + if (\array_key_exists('subject', $data)) { + $object->setSubject($data['subject']); + unset($data['subject']); + } + if (\array_key_exists('body', $data)) { + $object->setBody($data['body']); + unset($data['body']); + } + if (\array_key_exists('plaintext_body', $data)) { + $object->setPlaintextBody($data['plaintext_body']); + unset($data['plaintext_body']); + } + if (\array_key_exists('preheader', $data)) { + $object->setPreheader($data['preheader']); + unset($data['preheader']); } + if (\array_key_exists('tags', $data)) { + $values = []; + foreach ($data['tags'] as $value) { + $values[] = $value; + } + $object->setTags($values); + unset($data['tags']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('emailTemplateId') && null !== $object->getEmailTemplateId()) { + $data['email_template_id'] = $object->getEmailTemplateId(); + } + if ($object->isInitialized('templateName') && null !== $object->getTemplateName()) { + $data['template_name'] = $object->getTemplateName(); + } + if ($object->isInitialized('subject') && null !== $object->getSubject()) { + $data['subject'] = $object->getSubject(); + } + if ($object->isInitialized('body') && null !== $object->getBody()) { + $data['body'] = $object->getBody(); + } + if ($object->isInitialized('plaintextBody') && null !== $object->getPlaintextBody()) { + $data['plaintext_body'] = $object->getPlaintextBody(); + } + if ($object->isInitialized('preheader') && null !== $object->getPreheader()) { + $data['preheader'] = $object->getPreheader(); + } + if ($object->isInitialized('tags') && null !== $object->getTags()) { + $values = []; + foreach ($object->getTags() as $value) { + $values[] = $value; + } + $data['tags'] = $values; + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\TemplatesEmailUpdatePostBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\TemplatesEmailUpdatePostBody' => false]; + } } } diff --git a/lib/Normalizer/TransactionalV1CampaignsCampaignIdSendPostBodyNormalizer.php b/lib/Normalizer/TransactionalV1CampaignsCampaignIdSendPostBodyNormalizer.php index fc6dba1..b3f4eb4 100644 --- a/lib/Normalizer/TransactionalV1CampaignsCampaignIdSendPostBodyNormalizer.php +++ b/lib/Normalizer/TransactionalV1CampaignsCampaignIdSendPostBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,90 +21,177 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class TransactionalV1CampaignsCampaignIdSendPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class TransactionalV1CampaignsCampaignIdSendPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBody'; } - $object = new \Braze\Model\TransactionalV1CampaignsCampaignIdSendPostBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\TransactionalV1CampaignsCampaignIdSendPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('external_send_id', $data)) { + $object->setExternalSendId($data['external_send_id']); + unset($data['external_send_id']); + } + if (\array_key_exists('trigger_properties', $data)) { + $object->setTriggerProperties($this->denormalizer->denormalize($data['trigger_properties'], 'Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBodyTriggerProperties', 'json', $context)); + unset($data['trigger_properties']); + } + if (\array_key_exists('recipient', $data)) { + $values = []; + foreach ($data['recipient'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBodyRecipientItem', 'json', $context); + } + $object->setRecipient($values); + unset($data['recipient']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('external_send_id', $data)) { - $object->setExternalSendId($data['external_send_id']); - unset($data['external_send_id']); - } - if (\array_key_exists('trigger_properties', $data)) { - $object->setTriggerProperties($this->denormalizer->denormalize($data['trigger_properties'], 'Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBodyTriggerProperties', 'json', $context)); - unset($data['trigger_properties']); - } - if (\array_key_exists('recipient', $data)) { - $values = []; - foreach ($data['recipient'] as $value) { - $values[] = $this->denormalizer->denormalize($value, 'Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBodyRecipientItem', 'json', $context); + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('externalSendId') && null !== $object->getExternalSendId()) { + $data['external_send_id'] = $object->getExternalSendId(); } - $object->setRecipient($values); - unset($data['recipient']); - } - foreach ($data as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value_1; + if ($object->isInitialized('triggerProperties') && null !== $object->getTriggerProperties()) { + $data['trigger_properties'] = $this->normalizer->normalize($object->getTriggerProperties(), 'json', $context); + } + if ($object->isInitialized('recipient') && null !== $object->getRecipient()) { + $values = []; + foreach ($object->getRecipient() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['recipient'] = $values; } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class TransactionalV1CampaignsCampaignIdSendPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('externalSendId') && null !== $object->getExternalSendId()) { - $data['external_send_id'] = $object->getExternalSendId(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBody'; } - if ($object->isInitialized('triggerProperties') && null !== $object->getTriggerProperties()) { - $data['trigger_properties'] = $this->normalizer->normalize($object->getTriggerProperties(), 'json', $context); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBody'; } - if ($object->isInitialized('recipient') && null !== $object->getRecipient()) { - $values = []; - foreach ($object->getRecipient() as $value) { - $values[] = $this->normalizer->normalize($value, 'json', $context); + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - $data['recipient'] = $values; - } - foreach ($object as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value_1; + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\TransactionalV1CampaignsCampaignIdSendPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('external_send_id', $data)) { + $object->setExternalSendId($data['external_send_id']); + unset($data['external_send_id']); + } + if (\array_key_exists('trigger_properties', $data)) { + $object->setTriggerProperties($this->denormalizer->denormalize($data['trigger_properties'], 'Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBodyTriggerProperties', 'json', $context)); + unset($data['trigger_properties']); + } + if (\array_key_exists('recipient', $data)) { + $values = []; + foreach ($data['recipient'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBodyRecipientItem', 'json', $context); + } + $object->setRecipient($values); + unset($data['recipient']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('externalSendId') && null !== $object->getExternalSendId()) { + $data['external_send_id'] = $object->getExternalSendId(); + } + if ($object->isInitialized('triggerProperties') && null !== $object->getTriggerProperties()) { + $data['trigger_properties'] = $this->normalizer->normalize($object->getTriggerProperties(), 'json', $context); + } + if ($object->isInitialized('recipient') && null !== $object->getRecipient()) { + $values = []; + foreach ($object->getRecipient() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['recipient'] = $values; + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBody' => false]; + } } } diff --git a/lib/Normalizer/TransactionalV1CampaignsCampaignIdSendPostBodyRecipientItemNormalizer.php b/lib/Normalizer/TransactionalV1CampaignsCampaignIdSendPostBodyRecipientItemNormalizer.php index 3237e37..7503c94 100644 --- a/lib/Normalizer/TransactionalV1CampaignsCampaignIdSendPostBodyRecipientItemNormalizer.php +++ b/lib/Normalizer/TransactionalV1CampaignsCampaignIdSendPostBodyRecipientItemNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,68 +21,133 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class TransactionalV1CampaignsCampaignIdSendPostBodyRecipientItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class TransactionalV1CampaignsCampaignIdSendPostBodyRecipientItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return $type === 'Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBodyRecipientItem'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool - { - return is_object($data) && get_class($data) === 'Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBodyRecipientItem'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBodyRecipientItem'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBodyRecipientItem'; } - $object = new \Braze\Model\TransactionalV1CampaignsCampaignIdSendPostBodyRecipientItem(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\TransactionalV1CampaignsCampaignIdSendPostBodyRecipientItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('external_user_id', $data)) { + $object->setExternalUserId($data['external_user_id']); + unset($data['external_user_id']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('external_user_id', $data)) { - $object->setExternalUserId($data['external_user_id']); - unset($data['external_user_id']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('externalUserId') && null !== $object->getExternalUserId()) { + $data['external_user_id'] = $object->getExternalUserId(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBodyRecipientItem' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class TransactionalV1CampaignsCampaignIdSendPostBodyRecipientItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('externalUserId') && null !== $object->getExternalUserId()) { - $data['external_user_id'] = $object->getExternalUserId(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBodyRecipientItem'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBodyRecipientItem'; + } + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\TransactionalV1CampaignsCampaignIdSendPostBodyRecipientItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('external_user_id', $data)) { + $object->setExternalUserId($data['external_user_id']); + unset($data['external_user_id']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('externalUserId') && null !== $object->getExternalUserId()) { + $data['external_user_id'] = $object->getExternalUserId(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBodyRecipientItem' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBodyRecipientItem' => false]; + } } } diff --git a/lib/Normalizer/TransactionalV1CampaignsCampaignIdSendPostBodyTriggerPropertiesNormalizer.php b/lib/Normalizer/TransactionalV1CampaignsCampaignIdSendPostBodyTriggerPropertiesNormalizer.php index 41a0864..535b26b 100644 --- a/lib/Normalizer/TransactionalV1CampaignsCampaignIdSendPostBodyTriggerPropertiesNormalizer.php +++ b/lib/Normalizer/TransactionalV1CampaignsCampaignIdSendPostBodyTriggerPropertiesNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,75 +21,147 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class TransactionalV1CampaignsCampaignIdSendPostBodyTriggerPropertiesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBodyTriggerProperties'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class TransactionalV1CampaignsCampaignIdSendPostBodyTriggerPropertiesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBodyTriggerProperties'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBodyTriggerProperties'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBodyTriggerProperties'; } - $object = new \Braze\Model\TransactionalV1CampaignsCampaignIdSendPostBodyTriggerProperties(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\TransactionalV1CampaignsCampaignIdSendPostBodyTriggerProperties(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('example_string_property', $data)) { + $object->setExampleStringProperty($data['example_string_property']); + unset($data['example_string_property']); + } + if (\array_key_exists('example_integer_property', $data)) { + $object->setExampleIntegerProperty($data['example_integer_property']); + unset($data['example_integer_property']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('example_string_property', $data)) { - $object->setExampleStringProperty($data['example_string_property']); - unset($data['example_string_property']); - } - if (\array_key_exists('example_integer_property', $data)) { - $object->setExampleIntegerProperty($data['example_integer_property']); - unset($data['example_integer_property']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('exampleStringProperty') && null !== $object->getExampleStringProperty()) { + $data['example_string_property'] = $object->getExampleStringProperty(); + } + if ($object->isInitialized('exampleIntegerProperty') && null !== $object->getExampleIntegerProperty()) { + $data['example_integer_property'] = $object->getExampleIntegerProperty(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBodyTriggerProperties' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class TransactionalV1CampaignsCampaignIdSendPostBodyTriggerPropertiesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('exampleStringProperty') && null !== $object->getExampleStringProperty()) { - $data['example_string_property'] = $object->getExampleStringProperty(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBodyTriggerProperties'; } - if ($object->isInitialized('exampleIntegerProperty') && null !== $object->getExampleIntegerProperty()) { - $data['example_integer_property'] = $object->getExampleIntegerProperty(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBodyTriggerProperties'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\TransactionalV1CampaignsCampaignIdSendPostBodyTriggerProperties(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('example_string_property', $data)) { + $object->setExampleStringProperty($data['example_string_property']); + unset($data['example_string_property']); + } + if (\array_key_exists('example_integer_property', $data)) { + $object->setExampleIntegerProperty($data['example_integer_property']); + unset($data['example_integer_property']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('exampleStringProperty') && null !== $object->getExampleStringProperty()) { + $data['example_string_property'] = $object->getExampleStringProperty(); + } + if ($object->isInitialized('exampleIntegerProperty') && null !== $object->getExampleIntegerProperty()) { + $data['example_integer_property'] = $object->getExampleIntegerProperty(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBodyTriggerProperties' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\TransactionalV1CampaignsCampaignIdSendPostBodyTriggerProperties' => false]; + } } } diff --git a/lib/Normalizer/UsersAliasNewPostBodyNormalizer.php b/lib/Normalizer/UsersAliasNewPostBodyNormalizer.php index db1ef42..075b3f1 100644 --- a/lib/Normalizer/UsersAliasNewPostBodyNormalizer.php +++ b/lib/Normalizer/UsersAliasNewPostBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,76 +21,149 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class UsersAliasNewPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class UsersAliasNewPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return $type === 'Braze\\Model\\UsersAliasNewPostBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool - { - return is_object($data) && get_class($data) === 'Braze\\Model\\UsersAliasNewPostBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\UsersAliasNewPostBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\UsersAliasNewPostBody'; } - $object = new \Braze\Model\UsersAliasNewPostBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\UsersAliasNewPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('user_aliases', $data)) { + $values = []; + foreach ($data['user_aliases'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'Braze\\Model\\UsersAliasNewPostBodyUserAliasesItem', 'json', $context); + } + $object->setUserAliases($values); + unset($data['user_aliases']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('user_aliases', $data)) { - $values = []; - foreach ($data['user_aliases'] as $value) { - $values[] = $this->denormalizer->denormalize($value, 'Braze\\Model\\UsersAliasNewPostBodyUserAliasesItem', 'json', $context); + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('userAliases') && null !== $object->getUserAliases()) { + $values = []; + foreach ($object->getUserAliases() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['user_aliases'] = $values; } - $object->setUserAliases($values); - unset($data['user_aliases']); - } - foreach ($data as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value_1; + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\UsersAliasNewPostBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class UsersAliasNewPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('userAliases') && null !== $object->getUserAliases()) { - $values = []; - foreach ($object->getUserAliases() as $value) { - $values[] = $this->normalizer->normalize($value, 'json', $context); - } - $data['user_aliases'] = $values; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\UsersAliasNewPostBody'; } - foreach ($object as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value_1; + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\UsersAliasNewPostBody'; + } + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\UsersAliasNewPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('user_aliases', $data)) { + $values = []; + foreach ($data['user_aliases'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'Braze\\Model\\UsersAliasNewPostBodyUserAliasesItem', 'json', $context); + } + $object->setUserAliases($values); + unset($data['user_aliases']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('userAliases') && null !== $object->getUserAliases()) { + $values = []; + foreach ($object->getUserAliases() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['user_aliases'] = $values; + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\UsersAliasNewPostBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\UsersAliasNewPostBody' => false]; + } } } diff --git a/lib/Normalizer/UsersAliasNewPostBodyUserAliasesItemNormalizer.php b/lib/Normalizer/UsersAliasNewPostBodyUserAliasesItemNormalizer.php index e7a6e9d..8f75a7b 100644 --- a/lib/Normalizer/UsersAliasNewPostBodyUserAliasesItemNormalizer.php +++ b/lib/Normalizer/UsersAliasNewPostBodyUserAliasesItemNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,82 +21,161 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class UsersAliasNewPostBodyUserAliasesItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\UsersAliasNewPostBodyUserAliasesItem'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class UsersAliasNewPostBodyUserAliasesItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\UsersAliasNewPostBodyUserAliasesItem'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\UsersAliasNewPostBodyUserAliasesItem'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\UsersAliasNewPostBodyUserAliasesItem'; } - $object = new \Braze\Model\UsersAliasNewPostBodyUserAliasesItem(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\UsersAliasNewPostBodyUserAliasesItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('external_id', $data)) { + $object->setExternalId($data['external_id']); + unset($data['external_id']); + } + if (\array_key_exists('alias_name', $data)) { + $object->setAliasName($data['alias_name']); + unset($data['alias_name']); + } + if (\array_key_exists('alias_label', $data)) { + $object->setAliasLabel($data['alias_label']); + unset($data['alias_label']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('external_id', $data)) { - $object->setExternalId($data['external_id']); - unset($data['external_id']); - } - if (\array_key_exists('alias_name', $data)) { - $object->setAliasName($data['alias_name']); - unset($data['alias_name']); - } - if (\array_key_exists('alias_label', $data)) { - $object->setAliasLabel($data['alias_label']); - unset($data['alias_label']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('externalId') && null !== $object->getExternalId()) { + $data['external_id'] = $object->getExternalId(); + } + if ($object->isInitialized('aliasName') && null !== $object->getAliasName()) { + $data['alias_name'] = $object->getAliasName(); } + if ($object->isInitialized('aliasLabel') && null !== $object->getAliasLabel()) { + $data['alias_label'] = $object->getAliasLabel(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\UsersAliasNewPostBodyUserAliasesItem' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class UsersAliasNewPostBodyUserAliasesItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('externalId') && null !== $object->getExternalId()) { - $data['external_id'] = $object->getExternalId(); - } - if ($object->isInitialized('aliasName') && null !== $object->getAliasName()) { - $data['alias_name'] = $object->getAliasName(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\UsersAliasNewPostBodyUserAliasesItem'; } - if ($object->isInitialized('aliasLabel') && null !== $object->getAliasLabel()) { - $data['alias_label'] = $object->getAliasLabel(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\UsersAliasNewPostBodyUserAliasesItem'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\UsersAliasNewPostBodyUserAliasesItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('external_id', $data)) { + $object->setExternalId($data['external_id']); + unset($data['external_id']); + } + if (\array_key_exists('alias_name', $data)) { + $object->setAliasName($data['alias_name']); + unset($data['alias_name']); + } + if (\array_key_exists('alias_label', $data)) { + $object->setAliasLabel($data['alias_label']); + unset($data['alias_label']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('externalId') && null !== $object->getExternalId()) { + $data['external_id'] = $object->getExternalId(); + } + if ($object->isInitialized('aliasName') && null !== $object->getAliasName()) { + $data['alias_name'] = $object->getAliasName(); + } + if ($object->isInitialized('aliasLabel') && null !== $object->getAliasLabel()) { + $data['alias_label'] = $object->getAliasLabel(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\UsersAliasNewPostBodyUserAliasesItem' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\UsersAliasNewPostBodyUserAliasesItem' => false]; + } } } diff --git a/lib/Normalizer/UsersAliasUpdatePostBodyAliasUpdatesItemNormalizer.php b/lib/Normalizer/UsersAliasUpdatePostBodyAliasUpdatesItemNormalizer.php index 4121778..4899a5f 100644 --- a/lib/Normalizer/UsersAliasUpdatePostBodyAliasUpdatesItemNormalizer.php +++ b/lib/Normalizer/UsersAliasUpdatePostBodyAliasUpdatesItemNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,82 +21,161 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class UsersAliasUpdatePostBodyAliasUpdatesItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\UsersAliasUpdatePostBodyAliasUpdatesItem'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class UsersAliasUpdatePostBodyAliasUpdatesItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\UsersAliasUpdatePostBodyAliasUpdatesItem'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\UsersAliasUpdatePostBodyAliasUpdatesItem'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\UsersAliasUpdatePostBodyAliasUpdatesItem'; } - $object = new \Braze\Model\UsersAliasUpdatePostBodyAliasUpdatesItem(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\UsersAliasUpdatePostBodyAliasUpdatesItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('alias_label', $data)) { + $object->setAliasLabel($data['alias_label']); + unset($data['alias_label']); + } + if (\array_key_exists('old_alias_name', $data)) { + $object->setOldAliasName($data['old_alias_name']); + unset($data['old_alias_name']); + } + if (\array_key_exists('new_alias_name', $data)) { + $object->setNewAliasName($data['new_alias_name']); + unset($data['new_alias_name']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('alias_label', $data)) { - $object->setAliasLabel($data['alias_label']); - unset($data['alias_label']); - } - if (\array_key_exists('old_alias_name', $data)) { - $object->setOldAliasName($data['old_alias_name']); - unset($data['old_alias_name']); - } - if (\array_key_exists('new_alias_name', $data)) { - $object->setNewAliasName($data['new_alias_name']); - unset($data['new_alias_name']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('aliasLabel') && null !== $object->getAliasLabel()) { + $data['alias_label'] = $object->getAliasLabel(); + } + if ($object->isInitialized('oldAliasName') && null !== $object->getOldAliasName()) { + $data['old_alias_name'] = $object->getOldAliasName(); } + if ($object->isInitialized('newAliasName') && null !== $object->getNewAliasName()) { + $data['new_alias_name'] = $object->getNewAliasName(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\UsersAliasUpdatePostBodyAliasUpdatesItem' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class UsersAliasUpdatePostBodyAliasUpdatesItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('aliasLabel') && null !== $object->getAliasLabel()) { - $data['alias_label'] = $object->getAliasLabel(); - } - if ($object->isInitialized('oldAliasName') && null !== $object->getOldAliasName()) { - $data['old_alias_name'] = $object->getOldAliasName(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\UsersAliasUpdatePostBodyAliasUpdatesItem'; } - if ($object->isInitialized('newAliasName') && null !== $object->getNewAliasName()) { - $data['new_alias_name'] = $object->getNewAliasName(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\UsersAliasUpdatePostBodyAliasUpdatesItem'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\UsersAliasUpdatePostBodyAliasUpdatesItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('alias_label', $data)) { + $object->setAliasLabel($data['alias_label']); + unset($data['alias_label']); + } + if (\array_key_exists('old_alias_name', $data)) { + $object->setOldAliasName($data['old_alias_name']); + unset($data['old_alias_name']); + } + if (\array_key_exists('new_alias_name', $data)) { + $object->setNewAliasName($data['new_alias_name']); + unset($data['new_alias_name']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('aliasLabel') && null !== $object->getAliasLabel()) { + $data['alias_label'] = $object->getAliasLabel(); + } + if ($object->isInitialized('oldAliasName') && null !== $object->getOldAliasName()) { + $data['old_alias_name'] = $object->getOldAliasName(); + } + if ($object->isInitialized('newAliasName') && null !== $object->getNewAliasName()) { + $data['new_alias_name'] = $object->getNewAliasName(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\UsersAliasUpdatePostBodyAliasUpdatesItem' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\UsersAliasUpdatePostBodyAliasUpdatesItem' => false]; + } } } diff --git a/lib/Normalizer/UsersAliasUpdatePostBodyNormalizer.php b/lib/Normalizer/UsersAliasUpdatePostBodyNormalizer.php index 27b796b..955a5ef 100644 --- a/lib/Normalizer/UsersAliasUpdatePostBodyNormalizer.php +++ b/lib/Normalizer/UsersAliasUpdatePostBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,76 +21,149 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class UsersAliasUpdatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class UsersAliasUpdatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return $type === 'Braze\\Model\\UsersAliasUpdatePostBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool - { - return is_object($data) && get_class($data) === 'Braze\\Model\\UsersAliasUpdatePostBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\UsersAliasUpdatePostBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\UsersAliasUpdatePostBody'; } - $object = new \Braze\Model\UsersAliasUpdatePostBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\UsersAliasUpdatePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('alias_updates', $data)) { + $values = []; + foreach ($data['alias_updates'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'Braze\\Model\\UsersAliasUpdatePostBodyAliasUpdatesItem', 'json', $context); + } + $object->setAliasUpdates($values); + unset($data['alias_updates']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('alias_updates', $data)) { - $values = []; - foreach ($data['alias_updates'] as $value) { - $values[] = $this->denormalizer->denormalize($value, 'Braze\\Model\\UsersAliasUpdatePostBodyAliasUpdatesItem', 'json', $context); + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('aliasUpdates') && null !== $object->getAliasUpdates()) { + $values = []; + foreach ($object->getAliasUpdates() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['alias_updates'] = $values; } - $object->setAliasUpdates($values); - unset($data['alias_updates']); - } - foreach ($data as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value_1; + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\UsersAliasUpdatePostBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class UsersAliasUpdatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('aliasUpdates') && null !== $object->getAliasUpdates()) { - $values = []; - foreach ($object->getAliasUpdates() as $value) { - $values[] = $this->normalizer->normalize($value, 'json', $context); - } - $data['alias_updates'] = $values; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\UsersAliasUpdatePostBody'; } - foreach ($object as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value_1; + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\UsersAliasUpdatePostBody'; + } + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\UsersAliasUpdatePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('alias_updates', $data)) { + $values = []; + foreach ($data['alias_updates'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'Braze\\Model\\UsersAliasUpdatePostBodyAliasUpdatesItem', 'json', $context); + } + $object->setAliasUpdates($values); + unset($data['alias_updates']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('aliasUpdates') && null !== $object->getAliasUpdates()) { + $values = []; + foreach ($object->getAliasUpdates() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['alias_updates'] = $values; + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\UsersAliasUpdatePostBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\UsersAliasUpdatePostBody' => false]; + } } } diff --git a/lib/Normalizer/UsersDeletePostBodyNormalizer.php b/lib/Normalizer/UsersDeletePostBodyNormalizer.php index ee09e3b..f545f46 100644 --- a/lib/Normalizer/UsersDeletePostBodyNormalizer.php +++ b/lib/Normalizer/UsersDeletePostBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,106 +21,209 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class UsersDeletePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\UsersDeletePostBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class UsersDeletePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\UsersDeletePostBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\UsersDeletePostBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\UsersDeletePostBody'; } - $object = new \Braze\Model\UsersDeletePostBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\UsersDeletePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('external_ids', $data)) { + $values = []; + foreach ($data['external_ids'] as $value) { + $values[] = $value; + } + $object->setExternalIds($values); + unset($data['external_ids']); + } + if (\array_key_exists('braze_ids', $data)) { + $values_1 = []; + foreach ($data['braze_ids'] as $value_1) { + $values_1[] = $value_1; + } + $object->setBrazeIds($values_1); + unset($data['braze_ids']); + } + if (\array_key_exists('user_aliases', $data)) { + $values_2 = []; + foreach ($data['user_aliases'] as $value_2) { + $values_2[] = $this->denormalizer->denormalize($value_2, 'Braze\\Model\\UsersDeletePostBodyUserAliasesItem', 'json', $context); + } + $object->setUserAliases($values_2); + unset($data['user_aliases']); + } + foreach ($data as $key => $value_3) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_3; + } + } + return $object; } - if (\array_key_exists('external_ids', $data)) { - $values = []; - foreach ($data['external_ids'] as $value) { - $values[] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('externalIds') && null !== $object->getExternalIds()) { + $values = []; + foreach ($object->getExternalIds() as $value) { + $values[] = $value; + } + $data['external_ids'] = $values; } - $object->setExternalIds($values); - unset($data['external_ids']); - } - if (\array_key_exists('braze_ids', $data)) { - $values_1 = []; - foreach ($data['braze_ids'] as $value_1) { - $values_1[] = $value_1; + if ($object->isInitialized('brazeIds') && null !== $object->getBrazeIds()) { + $values_1 = []; + foreach ($object->getBrazeIds() as $value_1) { + $values_1[] = $value_1; + } + $data['braze_ids'] = $values_1; } - $object->setBrazeIds($values_1); - unset($data['braze_ids']); - } - if (\array_key_exists('user_aliases', $data)) { - $values_2 = []; - foreach ($data['user_aliases'] as $value_2) { - $values_2[] = $this->denormalizer->denormalize($value_2, 'Braze\\Model\\UsersDeletePostBodyUserAliasesItem', 'json', $context); + if ($object->isInitialized('userAliases') && null !== $object->getUserAliases()) { + $values_2 = []; + foreach ($object->getUserAliases() as $value_2) { + $values_2[] = $this->normalizer->normalize($value_2, 'json', $context); + } + $data['user_aliases'] = $values_2; } - $object->setUserAliases($values_2); - unset($data['user_aliases']); - } - foreach ($data as $key => $value_3) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value_3; + foreach ($object as $key => $value_3) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_3; + } } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\UsersDeletePostBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class UsersDeletePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('externalIds') && null !== $object->getExternalIds()) { - $values = []; - foreach ($object->getExternalIds() as $value) { - $values[] = $value; - } - $data['external_ids'] = $values; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\UsersDeletePostBody'; } - if ($object->isInitialized('brazeIds') && null !== $object->getBrazeIds()) { - $values_1 = []; - foreach ($object->getBrazeIds() as $value_1) { - $values_1[] = $value_1; - } - $data['braze_ids'] = $values_1; + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\UsersDeletePostBody'; } - if ($object->isInitialized('userAliases') && null !== $object->getUserAliases()) { - $values_2 = []; - foreach ($object->getUserAliases() as $value_2) { - $values_2[] = $this->normalizer->normalize($value_2, 'json', $context); + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - $data['user_aliases'] = $values_2; - } - foreach ($object as $key => $value_3) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value_3; + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\UsersDeletePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('external_ids', $data)) { + $values = []; + foreach ($data['external_ids'] as $value) { + $values[] = $value; + } + $object->setExternalIds($values); + unset($data['external_ids']); + } + if (\array_key_exists('braze_ids', $data)) { + $values_1 = []; + foreach ($data['braze_ids'] as $value_1) { + $values_1[] = $value_1; + } + $object->setBrazeIds($values_1); + unset($data['braze_ids']); + } + if (\array_key_exists('user_aliases', $data)) { + $values_2 = []; + foreach ($data['user_aliases'] as $value_2) { + $values_2[] = $this->denormalizer->denormalize($value_2, 'Braze\\Model\\UsersDeletePostBodyUserAliasesItem', 'json', $context); + } + $object->setUserAliases($values_2); + unset($data['user_aliases']); + } + foreach ($data as $key => $value_3) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_3; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('externalIds') && null !== $object->getExternalIds()) { + $values = []; + foreach ($object->getExternalIds() as $value) { + $values[] = $value; + } + $data['external_ids'] = $values; + } + if ($object->isInitialized('brazeIds') && null !== $object->getBrazeIds()) { + $values_1 = []; + foreach ($object->getBrazeIds() as $value_1) { + $values_1[] = $value_1; + } + $data['braze_ids'] = $values_1; + } + if ($object->isInitialized('userAliases') && null !== $object->getUserAliases()) { + $values_2 = []; + foreach ($object->getUserAliases() as $value_2) { + $values_2[] = $this->normalizer->normalize($value_2, 'json', $context); + } + $data['user_aliases'] = $values_2; + } + foreach ($object as $key => $value_3) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_3; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\UsersDeletePostBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\UsersDeletePostBody' => false]; + } } } diff --git a/lib/Normalizer/UsersDeletePostBodyUserAliasesItemNormalizer.php b/lib/Normalizer/UsersDeletePostBodyUserAliasesItemNormalizer.php index add159b..a6a52dd 100644 --- a/lib/Normalizer/UsersDeletePostBodyUserAliasesItemNormalizer.php +++ b/lib/Normalizer/UsersDeletePostBodyUserAliasesItemNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,75 +21,147 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class UsersDeletePostBodyUserAliasesItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\UsersDeletePostBodyUserAliasesItem'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class UsersDeletePostBodyUserAliasesItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\UsersDeletePostBodyUserAliasesItem'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\UsersDeletePostBodyUserAliasesItem'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\UsersDeletePostBodyUserAliasesItem'; } - $object = new \Braze\Model\UsersDeletePostBodyUserAliasesItem(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\UsersDeletePostBodyUserAliasesItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('alias_name', $data)) { + $object->setAliasName($data['alias_name']); + unset($data['alias_name']); + } + if (\array_key_exists('alias_label', $data)) { + $object->setAliasLabel($data['alias_label']); + unset($data['alias_label']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('alias_name', $data)) { - $object->setAliasName($data['alias_name']); - unset($data['alias_name']); - } - if (\array_key_exists('alias_label', $data)) { - $object->setAliasLabel($data['alias_label']); - unset($data['alias_label']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('aliasName') && null !== $object->getAliasName()) { + $data['alias_name'] = $object->getAliasName(); + } + if ($object->isInitialized('aliasLabel') && null !== $object->getAliasLabel()) { + $data['alias_label'] = $object->getAliasLabel(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\UsersDeletePostBodyUserAliasesItem' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class UsersDeletePostBodyUserAliasesItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('aliasName') && null !== $object->getAliasName()) { - $data['alias_name'] = $object->getAliasName(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\UsersDeletePostBodyUserAliasesItem'; } - if ($object->isInitialized('aliasLabel') && null !== $object->getAliasLabel()) { - $data['alias_label'] = $object->getAliasLabel(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\UsersDeletePostBodyUserAliasesItem'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\UsersDeletePostBodyUserAliasesItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('alias_name', $data)) { + $object->setAliasName($data['alias_name']); + unset($data['alias_name']); + } + if (\array_key_exists('alias_label', $data)) { + $object->setAliasLabel($data['alias_label']); + unset($data['alias_label']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('aliasName') && null !== $object->getAliasName()) { + $data['alias_name'] = $object->getAliasName(); + } + if ($object->isInitialized('aliasLabel') && null !== $object->getAliasLabel()) { + $data['alias_label'] = $object->getAliasLabel(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\UsersDeletePostBodyUserAliasesItem' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\UsersDeletePostBodyUserAliasesItem' => false]; + } } } diff --git a/lib/Normalizer/UsersExportGlobalControlGroupPostBodyNormalizer.php b/lib/Normalizer/UsersExportGlobalControlGroupPostBodyNormalizer.php index a4dc31e..61d7231 100644 --- a/lib/Normalizer/UsersExportGlobalControlGroupPostBodyNormalizer.php +++ b/lib/Normalizer/UsersExportGlobalControlGroupPostBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,90 +21,177 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class UsersExportGlobalControlGroupPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\UsersExportGlobalControlGroupPostBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class UsersExportGlobalControlGroupPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\UsersExportGlobalControlGroupPostBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\UsersExportGlobalControlGroupPostBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\UsersExportGlobalControlGroupPostBody'; } - $object = new \Braze\Model\UsersExportGlobalControlGroupPostBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\UsersExportGlobalControlGroupPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('callback_endpoint', $data)) { + $object->setCallbackEndpoint($data['callback_endpoint']); + unset($data['callback_endpoint']); + } + if (\array_key_exists('fields_to_export', $data)) { + $values = []; + foreach ($data['fields_to_export'] as $value) { + $values[] = $value; + } + $object->setFieldsToExport($values); + unset($data['fields_to_export']); + } + if (\array_key_exists('output_format', $data)) { + $object->setOutputFormat($data['output_format']); + unset($data['output_format']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('callback_endpoint', $data)) { - $object->setCallbackEndpoint($data['callback_endpoint']); - unset($data['callback_endpoint']); - } - if (\array_key_exists('fields_to_export', $data)) { - $values = []; - foreach ($data['fields_to_export'] as $value) { - $values[] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('callbackEndpoint') && null !== $object->getCallbackEndpoint()) { + $data['callback_endpoint'] = $object->getCallbackEndpoint(); } - $object->setFieldsToExport($values); - unset($data['fields_to_export']); - } - if (\array_key_exists('output_format', $data)) { - $object->setOutputFormat($data['output_format']); - unset($data['output_format']); - } - foreach ($data as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value_1; + if ($object->isInitialized('fieldsToExport') && null !== $object->getFieldsToExport()) { + $values = []; + foreach ($object->getFieldsToExport() as $value) { + $values[] = $value; + } + $data['fields_to_export'] = $values; + } + if ($object->isInitialized('outputFormat') && null !== $object->getOutputFormat()) { + $data['output_format'] = $object->getOutputFormat(); } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\UsersExportGlobalControlGroupPostBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class UsersExportGlobalControlGroupPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('callbackEndpoint') && null !== $object->getCallbackEndpoint()) { - $data['callback_endpoint'] = $object->getCallbackEndpoint(); - } - if ($object->isInitialized('fieldsToExport') && null !== $object->getFieldsToExport()) { - $values = []; - foreach ($object->getFieldsToExport() as $value) { - $values[] = $value; - } - $data['fields_to_export'] = $values; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\UsersExportGlobalControlGroupPostBody'; } - if ($object->isInitialized('outputFormat') && null !== $object->getOutputFormat()) { - $data['output_format'] = $object->getOutputFormat(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\UsersExportGlobalControlGroupPostBody'; } - foreach ($object as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value_1; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\UsersExportGlobalControlGroupPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('callback_endpoint', $data)) { + $object->setCallbackEndpoint($data['callback_endpoint']); + unset($data['callback_endpoint']); + } + if (\array_key_exists('fields_to_export', $data)) { + $values = []; + foreach ($data['fields_to_export'] as $value) { + $values[] = $value; + } + $object->setFieldsToExport($values); + unset($data['fields_to_export']); + } + if (\array_key_exists('output_format', $data)) { + $object->setOutputFormat($data['output_format']); + unset($data['output_format']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('callbackEndpoint') && null !== $object->getCallbackEndpoint()) { + $data['callback_endpoint'] = $object->getCallbackEndpoint(); + } + if ($object->isInitialized('fieldsToExport') && null !== $object->getFieldsToExport()) { + $values = []; + foreach ($object->getFieldsToExport() as $value) { + $values[] = $value; + } + $data['fields_to_export'] = $values; + } + if ($object->isInitialized('outputFormat') && null !== $object->getOutputFormat()) { + $data['output_format'] = $object->getOutputFormat(); + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\UsersExportGlobalControlGroupPostBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\UsersExportGlobalControlGroupPostBody' => false]; + } } } diff --git a/lib/Normalizer/UsersExportIdsPostBodyNormalizer.php b/lib/Normalizer/UsersExportIdsPostBodyNormalizer.php index 4c9ca8b..517fcd8 100644 --- a/lib/Normalizer/UsersExportIdsPostBodyNormalizer.php +++ b/lib/Normalizer/UsersExportIdsPostBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,134 +21,265 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class UsersExportIdsPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class UsersExportIdsPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return $type === 'Braze\\Model\\UsersExportIdsPostBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool - { - return is_object($data) && get_class($data) === 'Braze\\Model\\UsersExportIdsPostBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\UsersExportIdsPostBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\UsersExportIdsPostBody'; } - $object = new \Braze\Model\UsersExportIdsPostBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\UsersExportIdsPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('external_ids', $data)) { + $values = []; + foreach ($data['external_ids'] as $value) { + $values[] = $value; + } + $object->setExternalIds($values); + unset($data['external_ids']); + } + if (\array_key_exists('user_aliases', $data)) { + $values_1 = []; + foreach ($data['user_aliases'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, 'Braze\\Model\\UsersExportIdsPostBodyUserAliasesItem', 'json', $context); + } + $object->setUserAliases($values_1); + unset($data['user_aliases']); + } + if (\array_key_exists('device_id', $data)) { + $object->setDeviceId($data['device_id']); + unset($data['device_id']); + } + if (\array_key_exists('braze_id', $data)) { + $object->setBrazeId($data['braze_id']); + unset($data['braze_id']); + } + if (\array_key_exists('email_address', $data)) { + $object->setEmailAddress($data['email_address']); + unset($data['email_address']); + } + if (\array_key_exists('phone', $data)) { + $object->setPhone($data['phone']); + unset($data['phone']); + } + if (\array_key_exists('fields_to_export', $data)) { + $values_2 = []; + foreach ($data['fields_to_export'] as $value_2) { + $values_2[] = $value_2; + } + $object->setFieldsToExport($values_2); + unset($data['fields_to_export']); + } + foreach ($data as $key => $value_3) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_3; + } + } + return $object; } - if (\array_key_exists('external_ids', $data)) { - $values = []; - foreach ($data['external_ids'] as $value) { - $values[] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('externalIds') && null !== $object->getExternalIds()) { + $values = []; + foreach ($object->getExternalIds() as $value) { + $values[] = $value; + } + $data['external_ids'] = $values; } - $object->setExternalIds($values); - unset($data['external_ids']); - } - if (\array_key_exists('user_aliases', $data)) { - $values_1 = []; - foreach ($data['user_aliases'] as $value_1) { - $values_1[] = $this->denormalizer->denormalize($value_1, 'Braze\\Model\\UsersExportIdsPostBodyUserAliasesItem', 'json', $context); + if ($object->isInitialized('userAliases') && null !== $object->getUserAliases()) { + $values_1 = []; + foreach ($object->getUserAliases() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $data['user_aliases'] = $values_1; } - $object->setUserAliases($values_1); - unset($data['user_aliases']); - } - if (\array_key_exists('device_id', $data)) { - $object->setDeviceId($data['device_id']); - unset($data['device_id']); + if ($object->isInitialized('deviceId') && null !== $object->getDeviceId()) { + $data['device_id'] = $object->getDeviceId(); + } + if ($object->isInitialized('brazeId') && null !== $object->getBrazeId()) { + $data['braze_id'] = $object->getBrazeId(); + } + if ($object->isInitialized('emailAddress') && null !== $object->getEmailAddress()) { + $data['email_address'] = $object->getEmailAddress(); + } + if ($object->isInitialized('phone') && null !== $object->getPhone()) { + $data['phone'] = $object->getPhone(); + } + if ($object->isInitialized('fieldsToExport') && null !== $object->getFieldsToExport()) { + $values_2 = []; + foreach ($object->getFieldsToExport() as $value_2) { + $values_2[] = $value_2; + } + $data['fields_to_export'] = $values_2; + } + foreach ($object as $key => $value_3) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_3; + } + } + + return $data; } - if (\array_key_exists('braze_id', $data)) { - $object->setBrazeId($data['braze_id']); - unset($data['braze_id']); + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\UsersExportIdsPostBody' => false]; } - if (\array_key_exists('email_address', $data)) { - $object->setEmailAddress($data['email_address']); - unset($data['email_address']); + } +} else { + class UsersExportIdsPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\UsersExportIdsPostBody'; } - if (\array_key_exists('phone', $data)) { - $object->setPhone($data['phone']); - unset($data['phone']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\UsersExportIdsPostBody'; } - if (\array_key_exists('fields_to_export', $data)) { - $values_2 = []; - foreach ($data['fields_to_export'] as $value_2) { - $values_2[] = $value_2; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - $object->setFieldsToExport($values_2); - unset($data['fields_to_export']); - } - foreach ($data as $key => $value_3) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value_3; + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\UsersExportIdsPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('external_ids', $data)) { + $values = []; + foreach ($data['external_ids'] as $value) { + $values[] = $value; + } + $object->setExternalIds($values); + unset($data['external_ids']); + } + if (\array_key_exists('user_aliases', $data)) { + $values_1 = []; + foreach ($data['user_aliases'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, 'Braze\\Model\\UsersExportIdsPostBodyUserAliasesItem', 'json', $context); + } + $object->setUserAliases($values_1); + unset($data['user_aliases']); + } + if (\array_key_exists('device_id', $data)) { + $object->setDeviceId($data['device_id']); + unset($data['device_id']); + } + if (\array_key_exists('braze_id', $data)) { + $object->setBrazeId($data['braze_id']); + unset($data['braze_id']); + } + if (\array_key_exists('email_address', $data)) { + $object->setEmailAddress($data['email_address']); + unset($data['email_address']); + } + if (\array_key_exists('phone', $data)) { + $object->setPhone($data['phone']); + unset($data['phone']); + } + if (\array_key_exists('fields_to_export', $data)) { + $values_2 = []; + foreach ($data['fields_to_export'] as $value_2) { + $values_2[] = $value_2; + } + $object->setFieldsToExport($values_2); + unset($data['fields_to_export']); + } + foreach ($data as $key => $value_3) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_3; + } } - } - return $object; - } + return $object; + } - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) - { - $data = []; - if ($object->isInitialized('externalIds') && null !== $object->getExternalIds()) { - $values = []; - foreach ($object->getExternalIds() as $value) { - $values[] = $value; + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('externalIds') && null !== $object->getExternalIds()) { + $values = []; + foreach ($object->getExternalIds() as $value) { + $values[] = $value; + } + $data['external_ids'] = $values; } - $data['external_ids'] = $values; - } - if ($object->isInitialized('userAliases') && null !== $object->getUserAliases()) { - $values_1 = []; - foreach ($object->getUserAliases() as $value_1) { - $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + if ($object->isInitialized('userAliases') && null !== $object->getUserAliases()) { + $values_1 = []; + foreach ($object->getUserAliases() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $data['user_aliases'] = $values_1; } - $data['user_aliases'] = $values_1; - } - if ($object->isInitialized('deviceId') && null !== $object->getDeviceId()) { - $data['device_id'] = $object->getDeviceId(); - } - if ($object->isInitialized('brazeId') && null !== $object->getBrazeId()) { - $data['braze_id'] = $object->getBrazeId(); - } - if ($object->isInitialized('emailAddress') && null !== $object->getEmailAddress()) { - $data['email_address'] = $object->getEmailAddress(); - } - if ($object->isInitialized('phone') && null !== $object->getPhone()) { - $data['phone'] = $object->getPhone(); - } - if ($object->isInitialized('fieldsToExport') && null !== $object->getFieldsToExport()) { - $values_2 = []; - foreach ($object->getFieldsToExport() as $value_2) { - $values_2[] = $value_2; + if ($object->isInitialized('deviceId') && null !== $object->getDeviceId()) { + $data['device_id'] = $object->getDeviceId(); } - $data['fields_to_export'] = $values_2; - } - foreach ($object as $key => $value_3) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value_3; + if ($object->isInitialized('brazeId') && null !== $object->getBrazeId()) { + $data['braze_id'] = $object->getBrazeId(); + } + if ($object->isInitialized('emailAddress') && null !== $object->getEmailAddress()) { + $data['email_address'] = $object->getEmailAddress(); + } + if ($object->isInitialized('phone') && null !== $object->getPhone()) { + $data['phone'] = $object->getPhone(); + } + if ($object->isInitialized('fieldsToExport') && null !== $object->getFieldsToExport()) { + $values_2 = []; + foreach ($object->getFieldsToExport() as $value_2) { + $values_2[] = $value_2; + } + $data['fields_to_export'] = $values_2; + } + foreach ($object as $key => $value_3) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_3; + } } - } - return $data; - } + return $data; + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\UsersExportIdsPostBody' => false]; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\UsersExportIdsPostBody' => false]; + } } } diff --git a/lib/Normalizer/UsersExportIdsPostBodyUserAliasesItemNormalizer.php b/lib/Normalizer/UsersExportIdsPostBodyUserAliasesItemNormalizer.php index 3505022..2994516 100644 --- a/lib/Normalizer/UsersExportIdsPostBodyUserAliasesItemNormalizer.php +++ b/lib/Normalizer/UsersExportIdsPostBodyUserAliasesItemNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,75 +21,147 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class UsersExportIdsPostBodyUserAliasesItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\UsersExportIdsPostBodyUserAliasesItem'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class UsersExportIdsPostBodyUserAliasesItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\UsersExportIdsPostBodyUserAliasesItem'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\UsersExportIdsPostBodyUserAliasesItem'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\UsersExportIdsPostBodyUserAliasesItem'; } - $object = new \Braze\Model\UsersExportIdsPostBodyUserAliasesItem(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\UsersExportIdsPostBodyUserAliasesItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('alias_name', $data)) { + $object->setAliasName($data['alias_name']); + unset($data['alias_name']); + } + if (\array_key_exists('alias_label', $data)) { + $object->setAliasLabel($data['alias_label']); + unset($data['alias_label']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('alias_name', $data)) { - $object->setAliasName($data['alias_name']); - unset($data['alias_name']); - } - if (\array_key_exists('alias_label', $data)) { - $object->setAliasLabel($data['alias_label']); - unset($data['alias_label']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('aliasName') && null !== $object->getAliasName()) { + $data['alias_name'] = $object->getAliasName(); + } + if ($object->isInitialized('aliasLabel') && null !== $object->getAliasLabel()) { + $data['alias_label'] = $object->getAliasLabel(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\UsersExportIdsPostBodyUserAliasesItem' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class UsersExportIdsPostBodyUserAliasesItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('aliasName') && null !== $object->getAliasName()) { - $data['alias_name'] = $object->getAliasName(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\UsersExportIdsPostBodyUserAliasesItem'; } - if ($object->isInitialized('aliasLabel') && null !== $object->getAliasLabel()) { - $data['alias_label'] = $object->getAliasLabel(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\UsersExportIdsPostBodyUserAliasesItem'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\UsersExportIdsPostBodyUserAliasesItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('alias_name', $data)) { + $object->setAliasName($data['alias_name']); + unset($data['alias_name']); + } + if (\array_key_exists('alias_label', $data)) { + $object->setAliasLabel($data['alias_label']); + unset($data['alias_label']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('aliasName') && null !== $object->getAliasName()) { + $data['alias_name'] = $object->getAliasName(); + } + if ($object->isInitialized('aliasLabel') && null !== $object->getAliasLabel()) { + $data['alias_label'] = $object->getAliasLabel(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\UsersExportIdsPostBodyUserAliasesItem' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\UsersExportIdsPostBodyUserAliasesItem' => false]; + } } } diff --git a/lib/Normalizer/UsersExportSegmentPostBodyNormalizer.php b/lib/Normalizer/UsersExportSegmentPostBodyNormalizer.php index 287cdcd..7773144 100644 --- a/lib/Normalizer/UsersExportSegmentPostBodyNormalizer.php +++ b/lib/Normalizer/UsersExportSegmentPostBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,97 +21,191 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class UsersExportSegmentPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class UsersExportSegmentPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return $type === 'Braze\\Model\\UsersExportSegmentPostBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function supportsNormalization($data, $format = null, array $context = []): bool - { - return is_object($data) && get_class($data) === 'Braze\\Model\\UsersExportSegmentPostBody'; - } - - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\UsersExportSegmentPostBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\UsersExportSegmentPostBody'; } - $object = new \Braze\Model\UsersExportSegmentPostBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\UsersExportSegmentPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('segment_id', $data)) { + $object->setSegmentId($data['segment_id']); + unset($data['segment_id']); + } + if (\array_key_exists('callback_endpoint', $data)) { + $object->setCallbackEndpoint($data['callback_endpoint']); + unset($data['callback_endpoint']); + } + if (\array_key_exists('fields_to_export', $data)) { + $values = []; + foreach ($data['fields_to_export'] as $value) { + $values[] = $value; + } + $object->setFieldsToExport($values); + unset($data['fields_to_export']); + } + if (\array_key_exists('output_format', $data)) { + $object->setOutputFormat($data['output_format']); + unset($data['output_format']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('segment_id', $data)) { - $object->setSegmentId($data['segment_id']); - unset($data['segment_id']); - } - if (\array_key_exists('callback_endpoint', $data)) { - $object->setCallbackEndpoint($data['callback_endpoint']); - unset($data['callback_endpoint']); - } - if (\array_key_exists('fields_to_export', $data)) { - $values = []; - foreach ($data['fields_to_export'] as $value) { - $values[] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('segmentId') && null !== $object->getSegmentId()) { + $data['segment_id'] = $object->getSegmentId(); } - $object->setFieldsToExport($values); - unset($data['fields_to_export']); - } - if (\array_key_exists('output_format', $data)) { - $object->setOutputFormat($data['output_format']); - unset($data['output_format']); - } - foreach ($data as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value_1; + if ($object->isInitialized('callbackEndpoint') && null !== $object->getCallbackEndpoint()) { + $data['callback_endpoint'] = $object->getCallbackEndpoint(); + } + if ($object->isInitialized('fieldsToExport') && null !== $object->getFieldsToExport()) { + $values = []; + foreach ($object->getFieldsToExport() as $value) { + $values[] = $value; + } + $data['fields_to_export'] = $values; } + if ($object->isInitialized('outputFormat') && null !== $object->getOutputFormat()) { + $data['output_format'] = $object->getOutputFormat(); + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\UsersExportSegmentPostBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class UsersExportSegmentPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('segmentId') && null !== $object->getSegmentId()) { - $data['segment_id'] = $object->getSegmentId(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\UsersExportSegmentPostBody'; } - if ($object->isInitialized('callbackEndpoint') && null !== $object->getCallbackEndpoint()) { - $data['callback_endpoint'] = $object->getCallbackEndpoint(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\UsersExportSegmentPostBody'; } - if ($object->isInitialized('fieldsToExport') && null !== $object->getFieldsToExport()) { - $values = []; - foreach ($object->getFieldsToExport() as $value) { - $values[] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - $data['fields_to_export'] = $values; - } - if ($object->isInitialized('outputFormat') && null !== $object->getOutputFormat()) { - $data['output_format'] = $object->getOutputFormat(); - } - foreach ($object as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value_1; + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\UsersExportSegmentPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('segment_id', $data)) { + $object->setSegmentId($data['segment_id']); + unset($data['segment_id']); + } + if (\array_key_exists('callback_endpoint', $data)) { + $object->setCallbackEndpoint($data['callback_endpoint']); + unset($data['callback_endpoint']); + } + if (\array_key_exists('fields_to_export', $data)) { + $values = []; + foreach ($data['fields_to_export'] as $value) { + $values[] = $value; + } + $object->setFieldsToExport($values); + unset($data['fields_to_export']); + } + if (\array_key_exists('output_format', $data)) { + $object->setOutputFormat($data['output_format']); + unset($data['output_format']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('segmentId') && null !== $object->getSegmentId()) { + $data['segment_id'] = $object->getSegmentId(); + } + if ($object->isInitialized('callbackEndpoint') && null !== $object->getCallbackEndpoint()) { + $data['callback_endpoint'] = $object->getCallbackEndpoint(); + } + if ($object->isInitialized('fieldsToExport') && null !== $object->getFieldsToExport()) { + $values = []; + foreach ($object->getFieldsToExport() as $value) { + $values[] = $value; + } + $data['fields_to_export'] = $values; + } + if ($object->isInitialized('outputFormat') && null !== $object->getOutputFormat()) { + $data['output_format'] = $object->getOutputFormat(); + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\UsersExportSegmentPostBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\UsersExportSegmentPostBody' => false]; + } } } diff --git a/lib/Normalizer/UsersExternalIdsRemovePostBodyNormalizer.php b/lib/Normalizer/UsersExternalIdsRemovePostBodyNormalizer.php index c3e2de5..e42a21c 100644 --- a/lib/Normalizer/UsersExternalIdsRemovePostBodyNormalizer.php +++ b/lib/Normalizer/UsersExternalIdsRemovePostBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,76 +21,149 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class UsersExternalIdsRemovePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class UsersExternalIdsRemovePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return $type === 'Braze\\Model\\UsersExternalIdsRemovePostBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool - { - return is_object($data) && get_class($data) === 'Braze\\Model\\UsersExternalIdsRemovePostBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\UsersExternalIdsRemovePostBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\UsersExternalIdsRemovePostBody'; } - $object = new \Braze\Model\UsersExternalIdsRemovePostBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\UsersExternalIdsRemovePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('external_ids', $data)) { + $values = []; + foreach ($data['external_ids'] as $value) { + $values[] = $value; + } + $object->setExternalIds($values); + unset($data['external_ids']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('external_ids', $data)) { - $values = []; - foreach ($data['external_ids'] as $value) { - $values[] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('externalIds') && null !== $object->getExternalIds()) { + $values = []; + foreach ($object->getExternalIds() as $value) { + $values[] = $value; + } + $data['external_ids'] = $values; } - $object->setExternalIds($values); - unset($data['external_ids']); - } - foreach ($data as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value_1; + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\UsersExternalIdsRemovePostBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class UsersExternalIdsRemovePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('externalIds') && null !== $object->getExternalIds()) { - $values = []; - foreach ($object->getExternalIds() as $value) { - $values[] = $value; - } - $data['external_ids'] = $values; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\UsersExternalIdsRemovePostBody'; } - foreach ($object as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value_1; + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\UsersExternalIdsRemovePostBody'; + } + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\UsersExternalIdsRemovePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('external_ids', $data)) { + $values = []; + foreach ($data['external_ids'] as $value) { + $values[] = $value; + } + $object->setExternalIds($values); + unset($data['external_ids']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('externalIds') && null !== $object->getExternalIds()) { + $values = []; + foreach ($object->getExternalIds() as $value) { + $values[] = $value; + } + $data['external_ids'] = $values; + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\UsersExternalIdsRemovePostBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\UsersExternalIdsRemovePostBody' => false]; + } } } diff --git a/lib/Normalizer/UsersExternalIdsRenamePostBodyExternalIdRenamesItemNormalizer.php b/lib/Normalizer/UsersExternalIdsRenamePostBodyExternalIdRenamesItemNormalizer.php index 0c3c592..1718966 100644 --- a/lib/Normalizer/UsersExternalIdsRenamePostBodyExternalIdRenamesItemNormalizer.php +++ b/lib/Normalizer/UsersExternalIdsRenamePostBodyExternalIdRenamesItemNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,75 +21,147 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class UsersExternalIdsRenamePostBodyExternalIdRenamesItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\UsersExternalIdsRenamePostBodyExternalIdRenamesItem'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class UsersExternalIdsRenamePostBodyExternalIdRenamesItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\UsersExternalIdsRenamePostBodyExternalIdRenamesItem'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\UsersExternalIdsRenamePostBodyExternalIdRenamesItem'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\UsersExternalIdsRenamePostBodyExternalIdRenamesItem'; } - $object = new \Braze\Model\UsersExternalIdsRenamePostBodyExternalIdRenamesItem(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\UsersExternalIdsRenamePostBodyExternalIdRenamesItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('current_external_id', $data)) { + $object->setCurrentExternalId($data['current_external_id']); + unset($data['current_external_id']); + } + if (\array_key_exists('new_external_id', $data)) { + $object->setNewExternalId($data['new_external_id']); + unset($data['new_external_id']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('current_external_id', $data)) { - $object->setCurrentExternalId($data['current_external_id']); - unset($data['current_external_id']); - } - if (\array_key_exists('new_external_id', $data)) { - $object->setNewExternalId($data['new_external_id']); - unset($data['new_external_id']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('currentExternalId') && null !== $object->getCurrentExternalId()) { + $data['current_external_id'] = $object->getCurrentExternalId(); + } + if ($object->isInitialized('newExternalId') && null !== $object->getNewExternalId()) { + $data['new_external_id'] = $object->getNewExternalId(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\UsersExternalIdsRenamePostBodyExternalIdRenamesItem' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class UsersExternalIdsRenamePostBodyExternalIdRenamesItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('currentExternalId') && null !== $object->getCurrentExternalId()) { - $data['current_external_id'] = $object->getCurrentExternalId(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\UsersExternalIdsRenamePostBodyExternalIdRenamesItem'; } - if ($object->isInitialized('newExternalId') && null !== $object->getNewExternalId()) { - $data['new_external_id'] = $object->getNewExternalId(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\UsersExternalIdsRenamePostBodyExternalIdRenamesItem'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\UsersExternalIdsRenamePostBodyExternalIdRenamesItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('current_external_id', $data)) { + $object->setCurrentExternalId($data['current_external_id']); + unset($data['current_external_id']); + } + if (\array_key_exists('new_external_id', $data)) { + $object->setNewExternalId($data['new_external_id']); + unset($data['new_external_id']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('currentExternalId') && null !== $object->getCurrentExternalId()) { + $data['current_external_id'] = $object->getCurrentExternalId(); + } + if ($object->isInitialized('newExternalId') && null !== $object->getNewExternalId()) { + $data['new_external_id'] = $object->getNewExternalId(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\UsersExternalIdsRenamePostBodyExternalIdRenamesItem' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\UsersExternalIdsRenamePostBodyExternalIdRenamesItem' => false]; + } } } diff --git a/lib/Normalizer/UsersExternalIdsRenamePostBodyNormalizer.php b/lib/Normalizer/UsersExternalIdsRenamePostBodyNormalizer.php index 653e65c..376b540 100644 --- a/lib/Normalizer/UsersExternalIdsRenamePostBodyNormalizer.php +++ b/lib/Normalizer/UsersExternalIdsRenamePostBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,76 +21,149 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class UsersExternalIdsRenamePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class UsersExternalIdsRenamePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return $type === 'Braze\\Model\\UsersExternalIdsRenamePostBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool - { - return is_object($data) && get_class($data) === 'Braze\\Model\\UsersExternalIdsRenamePostBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\UsersExternalIdsRenamePostBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\UsersExternalIdsRenamePostBody'; } - $object = new \Braze\Model\UsersExternalIdsRenamePostBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\UsersExternalIdsRenamePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('external_id_renames', $data)) { + $values = []; + foreach ($data['external_id_renames'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'Braze\\Model\\UsersExternalIdsRenamePostBodyExternalIdRenamesItem', 'json', $context); + } + $object->setExternalIdRenames($values); + unset($data['external_id_renames']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('external_id_renames', $data)) { - $values = []; - foreach ($data['external_id_renames'] as $value) { - $values[] = $this->denormalizer->denormalize($value, 'Braze\\Model\\UsersExternalIdsRenamePostBodyExternalIdRenamesItem', 'json', $context); + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('externalIdRenames') && null !== $object->getExternalIdRenames()) { + $values = []; + foreach ($object->getExternalIdRenames() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['external_id_renames'] = $values; } - $object->setExternalIdRenames($values); - unset($data['external_id_renames']); - } - foreach ($data as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value_1; + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\UsersExternalIdsRenamePostBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class UsersExternalIdsRenamePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('externalIdRenames') && null !== $object->getExternalIdRenames()) { - $values = []; - foreach ($object->getExternalIdRenames() as $value) { - $values[] = $this->normalizer->normalize($value, 'json', $context); - } - $data['external_id_renames'] = $values; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\UsersExternalIdsRenamePostBody'; } - foreach ($object as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value_1; + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\UsersExternalIdsRenamePostBody'; + } + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\UsersExternalIdsRenamePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('external_id_renames', $data)) { + $values = []; + foreach ($data['external_id_renames'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'Braze\\Model\\UsersExternalIdsRenamePostBodyExternalIdRenamesItem', 'json', $context); + } + $object->setExternalIdRenames($values); + unset($data['external_id_renames']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('externalIdRenames') && null !== $object->getExternalIdRenames()) { + $values = []; + foreach ($object->getExternalIdRenames() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['external_id_renames'] = $values; + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\UsersExternalIdsRenamePostBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\UsersExternalIdsRenamePostBody' => false]; + } } } diff --git a/lib/Normalizer/UsersIdentifyPostBodyAliasesToIdentifyItemNormalizer.php b/lib/Normalizer/UsersIdentifyPostBodyAliasesToIdentifyItemNormalizer.php index edc34c6..0d3f398 100644 --- a/lib/Normalizer/UsersIdentifyPostBodyAliasesToIdentifyItemNormalizer.php +++ b/lib/Normalizer/UsersIdentifyPostBodyAliasesToIdentifyItemNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,75 +21,147 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class UsersIdentifyPostBodyAliasesToIdentifyItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\UsersIdentifyPostBodyAliasesToIdentifyItem'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class UsersIdentifyPostBodyAliasesToIdentifyItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\UsersIdentifyPostBodyAliasesToIdentifyItem'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\UsersIdentifyPostBodyAliasesToIdentifyItem'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\UsersIdentifyPostBodyAliasesToIdentifyItem'; } - $object = new \Braze\Model\UsersIdentifyPostBodyAliasesToIdentifyItem(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\UsersIdentifyPostBodyAliasesToIdentifyItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('external_id', $data)) { + $object->setExternalId($data['external_id']); + unset($data['external_id']); + } + if (\array_key_exists('user_alias', $data)) { + $object->setUserAlias($this->denormalizer->denormalize($data['user_alias'], 'Braze\\Model\\UsersIdentifyPostBodyAliasesToIdentifyItemUserAlias', 'json', $context)); + unset($data['user_alias']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('external_id', $data)) { - $object->setExternalId($data['external_id']); - unset($data['external_id']); - } - if (\array_key_exists('user_alias', $data)) { - $object->setUserAlias($this->denormalizer->denormalize($data['user_alias'], 'Braze\\Model\\UsersIdentifyPostBodyAliasesToIdentifyItemUserAlias', 'json', $context)); - unset($data['user_alias']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('externalId') && null !== $object->getExternalId()) { + $data['external_id'] = $object->getExternalId(); + } + if ($object->isInitialized('userAlias') && null !== $object->getUserAlias()) { + $data['user_alias'] = $this->normalizer->normalize($object->getUserAlias(), 'json', $context); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\UsersIdentifyPostBodyAliasesToIdentifyItem' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class UsersIdentifyPostBodyAliasesToIdentifyItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('externalId') && null !== $object->getExternalId()) { - $data['external_id'] = $object->getExternalId(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\UsersIdentifyPostBodyAliasesToIdentifyItem'; } - if ($object->isInitialized('userAlias') && null !== $object->getUserAlias()) { - $data['user_alias'] = $this->normalizer->normalize($object->getUserAlias(), 'json', $context); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\UsersIdentifyPostBodyAliasesToIdentifyItem'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\UsersIdentifyPostBodyAliasesToIdentifyItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('external_id', $data)) { + $object->setExternalId($data['external_id']); + unset($data['external_id']); + } + if (\array_key_exists('user_alias', $data)) { + $object->setUserAlias($this->denormalizer->denormalize($data['user_alias'], 'Braze\\Model\\UsersIdentifyPostBodyAliasesToIdentifyItemUserAlias', 'json', $context)); + unset($data['user_alias']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('externalId') && null !== $object->getExternalId()) { + $data['external_id'] = $object->getExternalId(); + } + if ($object->isInitialized('userAlias') && null !== $object->getUserAlias()) { + $data['user_alias'] = $this->normalizer->normalize($object->getUserAlias(), 'json', $context); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\UsersIdentifyPostBodyAliasesToIdentifyItem' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\UsersIdentifyPostBodyAliasesToIdentifyItem' => false]; + } } } diff --git a/lib/Normalizer/UsersIdentifyPostBodyAliasesToIdentifyItemUserAliasNormalizer.php b/lib/Normalizer/UsersIdentifyPostBodyAliasesToIdentifyItemUserAliasNormalizer.php index 154ecf1..03524db 100644 --- a/lib/Normalizer/UsersIdentifyPostBodyAliasesToIdentifyItemUserAliasNormalizer.php +++ b/lib/Normalizer/UsersIdentifyPostBodyAliasesToIdentifyItemUserAliasNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,75 +21,147 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class UsersIdentifyPostBodyAliasesToIdentifyItemUserAliasNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\UsersIdentifyPostBodyAliasesToIdentifyItemUserAlias'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class UsersIdentifyPostBodyAliasesToIdentifyItemUserAliasNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\UsersIdentifyPostBodyAliasesToIdentifyItemUserAlias'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\UsersIdentifyPostBodyAliasesToIdentifyItemUserAlias'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\UsersIdentifyPostBodyAliasesToIdentifyItemUserAlias'; } - $object = new \Braze\Model\UsersIdentifyPostBodyAliasesToIdentifyItemUserAlias(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\UsersIdentifyPostBodyAliasesToIdentifyItemUserAlias(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('alias_name', $data)) { + $object->setAliasName($data['alias_name']); + unset($data['alias_name']); + } + if (\array_key_exists('alias_label', $data)) { + $object->setAliasLabel($data['alias_label']); + unset($data['alias_label']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('alias_name', $data)) { - $object->setAliasName($data['alias_name']); - unset($data['alias_name']); - } - if (\array_key_exists('alias_label', $data)) { - $object->setAliasLabel($data['alias_label']); - unset($data['alias_label']); - } - foreach ($data as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('aliasName') && null !== $object->getAliasName()) { + $data['alias_name'] = $object->getAliasName(); + } + if ($object->isInitialized('aliasLabel') && null !== $object->getAliasLabel()) { + $data['alias_label'] = $object->getAliasLabel(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\UsersIdentifyPostBodyAliasesToIdentifyItemUserAlias' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class UsersIdentifyPostBodyAliasesToIdentifyItemUserAliasNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('aliasName') && null !== $object->getAliasName()) { - $data['alias_name'] = $object->getAliasName(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\UsersIdentifyPostBodyAliasesToIdentifyItemUserAlias'; } - if ($object->isInitialized('aliasLabel') && null !== $object->getAliasLabel()) { - $data['alias_label'] = $object->getAliasLabel(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\UsersIdentifyPostBodyAliasesToIdentifyItemUserAlias'; } - foreach ($object as $key => $value) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\UsersIdentifyPostBodyAliasesToIdentifyItemUserAlias(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('alias_name', $data)) { + $object->setAliasName($data['alias_name']); + unset($data['alias_name']); + } + if (\array_key_exists('alias_label', $data)) { + $object->setAliasLabel($data['alias_label']); + unset($data['alias_label']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('aliasName') && null !== $object->getAliasName()) { + $data['alias_name'] = $object->getAliasName(); + } + if ($object->isInitialized('aliasLabel') && null !== $object->getAliasLabel()) { + $data['alias_label'] = $object->getAliasLabel(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\UsersIdentifyPostBodyAliasesToIdentifyItemUserAlias' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\UsersIdentifyPostBodyAliasesToIdentifyItemUserAlias' => false]; + } } } diff --git a/lib/Normalizer/UsersIdentifyPostBodyNormalizer.php b/lib/Normalizer/UsersIdentifyPostBodyNormalizer.php index 3ef03e5..566f1d9 100644 --- a/lib/Normalizer/UsersIdentifyPostBodyNormalizer.php +++ b/lib/Normalizer/UsersIdentifyPostBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,76 +21,149 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class UsersIdentifyPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class UsersIdentifyPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return $type === 'Braze\\Model\\UsersIdentifyPostBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool - { - return is_object($data) && get_class($data) === 'Braze\\Model\\UsersIdentifyPostBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\UsersIdentifyPostBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\UsersIdentifyPostBody'; } - $object = new \Braze\Model\UsersIdentifyPostBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\UsersIdentifyPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('aliases_to_identify', $data)) { + $values = []; + foreach ($data['aliases_to_identify'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'Braze\\Model\\UsersIdentifyPostBodyAliasesToIdentifyItem', 'json', $context); + } + $object->setAliasesToIdentify($values); + unset($data['aliases_to_identify']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('aliases_to_identify', $data)) { - $values = []; - foreach ($data['aliases_to_identify'] as $value) { - $values[] = $this->denormalizer->denormalize($value, 'Braze\\Model\\UsersIdentifyPostBodyAliasesToIdentifyItem', 'json', $context); + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('aliasesToIdentify') && null !== $object->getAliasesToIdentify()) { + $values = []; + foreach ($object->getAliasesToIdentify() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['aliases_to_identify'] = $values; } - $object->setAliasesToIdentify($values); - unset($data['aliases_to_identify']); - } - foreach ($data as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value_1; + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\UsersIdentifyPostBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class UsersIdentifyPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('aliasesToIdentify') && null !== $object->getAliasesToIdentify()) { - $values = []; - foreach ($object->getAliasesToIdentify() as $value) { - $values[] = $this->normalizer->normalize($value, 'json', $context); - } - $data['aliases_to_identify'] = $values; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\UsersIdentifyPostBody'; } - foreach ($object as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value_1; + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\UsersIdentifyPostBody'; + } + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\UsersIdentifyPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('aliases_to_identify', $data)) { + $values = []; + foreach ($data['aliases_to_identify'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'Braze\\Model\\UsersIdentifyPostBodyAliasesToIdentifyItem', 'json', $context); + } + $object->setAliasesToIdentify($values); + unset($data['aliases_to_identify']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('aliasesToIdentify') && null !== $object->getAliasesToIdentify()) { + $values = []; + foreach ($object->getAliasesToIdentify() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['aliases_to_identify'] = $values; + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\UsersIdentifyPostBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\UsersIdentifyPostBody' => false]; + } } } diff --git a/lib/Normalizer/UsersMergePostBodyNormalizer.php b/lib/Normalizer/UsersMergePostBodyNormalizer.php index f202002..0b7aed2 100644 --- a/lib/Normalizer/UsersMergePostBodyNormalizer.php +++ b/lib/Normalizer/UsersMergePostBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,76 +21,149 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class UsersMergePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class UsersMergePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return $type === 'Braze\\Model\\UsersMergePostBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool - { - return is_object($data) && get_class($data) === 'Braze\\Model\\UsersMergePostBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\UsersMergePostBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\UsersMergePostBody'; } - $object = new \Braze\Model\UsersMergePostBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\UsersMergePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('merge_updates', $data)) { + $values = []; + foreach ($data['merge_updates'] as $value) { + $values[] = $value; + } + $object->setMergeUpdates($values); + unset($data['merge_updates']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('merge_updates', $data)) { - $values = []; - foreach ($data['merge_updates'] as $value) { - $values[] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('mergeUpdates') && null !== $object->getMergeUpdates()) { + $values = []; + foreach ($object->getMergeUpdates() as $value) { + $values[] = $value; + } + $data['merge_updates'] = $values; } - $object->setMergeUpdates($values); - unset($data['merge_updates']); - } - foreach ($data as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value_1; + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\UsersMergePostBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class UsersMergePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('mergeUpdates') && null !== $object->getMergeUpdates()) { - $values = []; - foreach ($object->getMergeUpdates() as $value) { - $values[] = $value; - } - $data['merge_updates'] = $values; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\UsersMergePostBody'; } - foreach ($object as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value_1; + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\UsersMergePostBody'; + } + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\UsersMergePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('merge_updates', $data)) { + $values = []; + foreach ($data['merge_updates'] as $value) { + $values[] = $value; + } + $object->setMergeUpdates($values); + unset($data['merge_updates']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('mergeUpdates') && null !== $object->getMergeUpdates()) { + $values = []; + foreach ($object->getMergeUpdates() as $value) { + $values[] = $value; + } + $data['merge_updates'] = $values; + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\UsersMergePostBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\UsersMergePostBody' => false]; + } } } diff --git a/lib/Normalizer/UsersTrackPostBodyNormalizer.php b/lib/Normalizer/UsersTrackPostBodyNormalizer.php index 23d76bb..9291ef5 100644 --- a/lib/Normalizer/UsersTrackPostBodyNormalizer.php +++ b/lib/Normalizer/UsersTrackPostBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,122 +21,241 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class UsersTrackPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\UsersTrackPostBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class UsersTrackPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\UsersTrackPostBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\UsersTrackPostBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\UsersTrackPostBody'; } - $object = new \Braze\Model\UsersTrackPostBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\UsersTrackPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('attributes', $data)) { + $values = []; + foreach ($data['attributes'] as $value) { + $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($value as $key => $value_1) { + $values_1[$key] = $value_1; + } + $values[] = $values_1; + } + $object->setAttributes($values); + unset($data['attributes']); + } + if (\array_key_exists('events', $data)) { + $values_2 = []; + foreach ($data['events'] as $value_2) { + $values_2[] = $value_2; + } + $object->setEvents($values_2); + unset($data['events']); + } + if (\array_key_exists('purchases', $data)) { + $values_3 = []; + foreach ($data['purchases'] as $value_3) { + $values_4 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($value_3 as $key_1 => $value_4) { + $values_4[$key_1] = $value_4; + } + $values_3[] = $values_4; + } + $object->setPurchases($values_3); + unset($data['purchases']); + } + foreach ($data as $key_2 => $value_5) { + if (preg_match('/.*/', (string) $key_2)) { + $object[$key_2] = $value_5; + } + } + return $object; } - if (\array_key_exists('attributes', $data)) { - $values = []; - foreach ($data['attributes'] as $value) { - $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($value as $key => $value_1) { - $values_1[$key] = $value_1; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('attributes') && null !== $object->getAttributes()) { + $values = []; + foreach ($object->getAttributes() as $value) { + $values_1 = []; + foreach ($value as $key => $value_1) { + $values_1[$key] = $value_1; + } + $values[] = $values_1; } - $values[] = $values_1; + $data['attributes'] = $values; } - $object->setAttributes($values); - unset($data['attributes']); - } - if (\array_key_exists('events', $data)) { - $values_2 = []; - foreach ($data['events'] as $value_2) { - $values_2[] = $value_2; + if ($object->isInitialized('events') && null !== $object->getEvents()) { + $values_2 = []; + foreach ($object->getEvents() as $value_2) { + $values_2[] = $value_2; + } + $data['events'] = $values_2; } - $object->setEvents($values_2); - unset($data['events']); - } - if (\array_key_exists('purchases', $data)) { - $values_3 = []; - foreach ($data['purchases'] as $value_3) { - $values_4 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($value_3 as $key_1 => $value_4) { - $values_4[$key_1] = $value_4; + if ($object->isInitialized('purchases') && null !== $object->getPurchases()) { + $values_3 = []; + foreach ($object->getPurchases() as $value_3) { + $values_4 = []; + foreach ($value_3 as $key_1 => $value_4) { + $values_4[$key_1] = $value_4; + } + $values_3[] = $values_4; } - $values_3[] = $values_4; + $data['purchases'] = $values_3; } - $object->setPurchases($values_3); - unset($data['purchases']); - } - foreach ($data as $key_2 => $value_5) { - if (preg_match('/.*/', (string) $key_2)) { - $object[$key_2] = $value_5; + foreach ($object as $key_2 => $value_5) { + if (preg_match('/.*/', (string) $key_2)) { + $data[$key_2] = $value_5; + } } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\UsersTrackPostBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class UsersTrackPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('attributes') && null !== $object->getAttributes()) { - $values = []; - foreach ($object->getAttributes() as $value) { - $values_1 = []; - foreach ($value as $key => $value_1) { - $values_1[$key] = $value_1; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\UsersTrackPostBody'; + } + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\UsersTrackPostBody'; + } + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\UsersTrackPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('attributes', $data)) { + $values = []; + foreach ($data['attributes'] as $value) { + $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($value as $key => $value_1) { + $values_1[$key] = $value_1; + } + $values[] = $values_1; } - $values[] = $values_1; + $object->setAttributes($values); + unset($data['attributes']); } - $data['attributes'] = $values; - } - if ($object->isInitialized('events') && null !== $object->getEvents()) { - $values_2 = []; - foreach ($object->getEvents() as $value_2) { - $values_2[] = $value_2; + if (\array_key_exists('events', $data)) { + $values_2 = []; + foreach ($data['events'] as $value_2) { + $values_2[] = $value_2; + } + $object->setEvents($values_2); + unset($data['events']); } - $data['events'] = $values_2; - } - if ($object->isInitialized('purchases') && null !== $object->getPurchases()) { - $values_3 = []; - foreach ($object->getPurchases() as $value_3) { - $values_4 = []; - foreach ($value_3 as $key_1 => $value_4) { - $values_4[$key_1] = $value_4; + if (\array_key_exists('purchases', $data)) { + $values_3 = []; + foreach ($data['purchases'] as $value_3) { + $values_4 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($value_3 as $key_1 => $value_4) { + $values_4[$key_1] = $value_4; + } + $values_3[] = $values_4; } - $values_3[] = $values_4; + $object->setPurchases($values_3); + unset($data['purchases']); } - $data['purchases'] = $values_3; - } - foreach ($object as $key_2 => $value_5) { - if (preg_match('/.*/', (string) $key_2)) { - $data[$key_2] = $value_5; + foreach ($data as $key_2 => $value_5) { + if (preg_match('/.*/', (string) $key_2)) { + $object[$key_2] = $value_5; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('attributes') && null !== $object->getAttributes()) { + $values = []; + foreach ($object->getAttributes() as $value) { + $values_1 = []; + foreach ($value as $key => $value_1) { + $values_1[$key] = $value_1; + } + $values[] = $values_1; + } + $data['attributes'] = $values; + } + if ($object->isInitialized('events') && null !== $object->getEvents()) { + $values_2 = []; + foreach ($object->getEvents() as $value_2) { + $values_2[] = $value_2; + } + $data['events'] = $values_2; + } + if ($object->isInitialized('purchases') && null !== $object->getPurchases()) { + $values_3 = []; + foreach ($object->getPurchases() as $value_3) { + $values_4 = []; + foreach ($value_3 as $key_1 => $value_4) { + $values_4[$key_1] = $value_4; + } + $values_3[] = $values_4; + } + $data['purchases'] = $values_3; + } + foreach ($object as $key_2 => $value_5) { + if (preg_match('/.*/', (string) $key_2)) { + $data[$key_2] = $value_5; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\UsersTrackPostBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\UsersTrackPostBody' => false]; + } } } diff --git a/lib/Normalizer/V2SubscriptionStatusSetPostBodyNormalizer.php b/lib/Normalizer/V2SubscriptionStatusSetPostBodyNormalizer.php index 04d64cb..2ebd51b 100644 --- a/lib/Normalizer/V2SubscriptionStatusSetPostBodyNormalizer.php +++ b/lib/Normalizer/V2SubscriptionStatusSetPostBodyNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,76 +21,149 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class V2SubscriptionStatusSetPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class V2SubscriptionStatusSetPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return $type === 'Braze\\Model\\V2SubscriptionStatusSetPostBody'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool - { - return is_object($data) && get_class($data) === 'Braze\\Model\\V2SubscriptionStatusSetPostBody'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\V2SubscriptionStatusSetPostBody'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\V2SubscriptionStatusSetPostBody'; } - $object = new \Braze\Model\V2SubscriptionStatusSetPostBody(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\V2SubscriptionStatusSetPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('subscription_groups', $data)) { + $values = []; + foreach ($data['subscription_groups'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'Braze\\Model\\V2SubscriptionStatusSetPostBodySubscriptionGroupsItem', 'json', $context); + } + $object->setSubscriptionGroups($values); + unset($data['subscription_groups']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('subscription_groups', $data)) { - $values = []; - foreach ($data['subscription_groups'] as $value) { - $values[] = $this->denormalizer->denormalize($value, 'Braze\\Model\\V2SubscriptionStatusSetPostBodySubscriptionGroupsItem', 'json', $context); + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('subscriptionGroups') && null !== $object->getSubscriptionGroups()) { + $values = []; + foreach ($object->getSubscriptionGroups() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['subscription_groups'] = $values; } - $object->setSubscriptionGroups($values); - unset($data['subscription_groups']); - } - foreach ($data as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value_1; + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\V2SubscriptionStatusSetPostBody' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class V2SubscriptionStatusSetPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('subscriptionGroups') && null !== $object->getSubscriptionGroups()) { - $values = []; - foreach ($object->getSubscriptionGroups() as $value) { - $values[] = $this->normalizer->normalize($value, 'json', $context); - } - $data['subscription_groups'] = $values; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\V2SubscriptionStatusSetPostBody'; } - foreach ($object as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value_1; + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\V2SubscriptionStatusSetPostBody'; + } + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\V2SubscriptionStatusSetPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('subscription_groups', $data)) { + $values = []; + foreach ($data['subscription_groups'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'Braze\\Model\\V2SubscriptionStatusSetPostBodySubscriptionGroupsItem', 'json', $context); + } + $object->setSubscriptionGroups($values); + unset($data['subscription_groups']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('subscriptionGroups') && null !== $object->getSubscriptionGroups()) { + $values = []; + foreach ($object->getSubscriptionGroups() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['subscription_groups'] = $values; + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\V2SubscriptionStatusSetPostBody' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\V2SubscriptionStatusSetPostBody' => false]; + } } } diff --git a/lib/Normalizer/V2SubscriptionStatusSetPostBodySubscriptionGroupsItemNormalizer.php b/lib/Normalizer/V2SubscriptionStatusSetPostBodySubscriptionGroupsItemNormalizer.php index 5285612..081b148 100644 --- a/lib/Normalizer/V2SubscriptionStatusSetPostBodySubscriptionGroupsItemNormalizer.php +++ b/lib/Normalizer/V2SubscriptionStatusSetPostBodySubscriptionGroupsItemNormalizer.php @@ -13,6 +13,7 @@ use Braze\Runtime\Normalizer\CheckArray; use Braze\Runtime\Normalizer\ValidatorTrait; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -20,90 +21,177 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class V2SubscriptionStatusSetPostBodySubscriptionGroupsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - return $type === 'Braze\\Model\\V2SubscriptionStatusSetPostBodySubscriptionGroupsItem'; - } - - public function supportsNormalization($data, $format = null, array $context = []): bool +if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class V2SubscriptionStatusSetPostBodySubscriptionGroupsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return is_object($data) && get_class($data) === 'Braze\\Model\\V2SubscriptionStatusSetPostBodySubscriptionGroupsItem'; - } + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; - public function denormalize($data, $class, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\V2SubscriptionStatusSetPostBodySubscriptionGroupsItem'; } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\V2SubscriptionStatusSetPostBodySubscriptionGroupsItem'; } - $object = new \Braze\Model\V2SubscriptionStatusSetPostBodySubscriptionGroupsItem(); - if (null === $data || false === \is_array($data)) { + + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\V2SubscriptionStatusSetPostBodySubscriptionGroupsItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('subscription_group_id', $data)) { + $object->setSubscriptionGroupId($data['subscription_group_id']); + unset($data['subscription_group_id']); + } + if (\array_key_exists('subscription_state', $data)) { + $object->setSubscriptionState($data['subscription_state']); + unset($data['subscription_state']); + } + if (\array_key_exists('emails', $data)) { + $values = []; + foreach ($data['emails'] as $value) { + $values[] = $value; + } + $object->setEmails($values); + unset($data['emails']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('subscription_group_id', $data)) { - $object->setSubscriptionGroupId($data['subscription_group_id']); - unset($data['subscription_group_id']); - } - if (\array_key_exists('subscription_state', $data)) { - $object->setSubscriptionState($data['subscription_state']); - unset($data['subscription_state']); - } - if (\array_key_exists('emails', $data)) { - $values = []; - foreach ($data['emails'] as $value) { - $values[] = $value; + + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('subscriptionGroupId') && null !== $object->getSubscriptionGroupId()) { + $data['subscription_group_id'] = $object->getSubscriptionGroupId(); } - $object->setEmails($values); - unset($data['emails']); - } - foreach ($data as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value_1; + if ($object->isInitialized('subscriptionState') && null !== $object->getSubscriptionState()) { + $data['subscription_state'] = $object->getSubscriptionState(); + } + if ($object->isInitialized('emails') && null !== $object->getEmails()) { + $values = []; + foreach ($object->getEmails() as $value) { + $values[] = $value; + } + $data['emails'] = $values; } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } + + return $data; } - return $object; + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\V2SubscriptionStatusSetPostBodySubscriptionGroupsItem' => false]; + } } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class V2SubscriptionStatusSetPostBodySubscriptionGroupsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if ($object->isInitialized('subscriptionGroupId') && null !== $object->getSubscriptionGroupId()) { - $data['subscription_group_id'] = $object->getSubscriptionGroupId(); + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, string $format = null, array $context = []): bool + { + return $type === 'Braze\\Model\\V2SubscriptionStatusSetPostBodySubscriptionGroupsItem'; } - if ($object->isInitialized('subscriptionState') && null !== $object->getSubscriptionState()) { - $data['subscription_state'] = $object->getSubscriptionState(); + + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + { + return is_object($data) && get_class($data) === 'Braze\\Model\\V2SubscriptionStatusSetPostBodySubscriptionGroupsItem'; } - if ($object->isInitialized('emails') && null !== $object->getEmails()) { - $values = []; - foreach ($object->getEmails() as $value) { - $values[] = $value; + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - $data['emails'] = $values; - } - foreach ($object as $key => $value_1) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value_1; + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \Braze\Model\V2SubscriptionStatusSetPostBodySubscriptionGroupsItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('subscription_group_id', $data)) { + $object->setSubscriptionGroupId($data['subscription_group_id']); + unset($data['subscription_group_id']); + } + if (\array_key_exists('subscription_state', $data)) { + $object->setSubscriptionState($data['subscription_state']); + unset($data['subscription_state']); + } + if (\array_key_exists('emails', $data)) { + $values = []; + foreach ($data['emails'] as $value) { + $values[] = $value; + } + $object->setEmails($values); + unset($data['emails']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } + + return $object; } - return $data; - } + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('subscriptionGroupId') && null !== $object->getSubscriptionGroupId()) { + $data['subscription_group_id'] = $object->getSubscriptionGroupId(); + } + if ($object->isInitialized('subscriptionState') && null !== $object->getSubscriptionState()) { + $data['subscription_state'] = $object->getSubscriptionState(); + } + if ($object->isInitialized('emails') && null !== $object->getEmails()) { + $values = []; + foreach ($object->getEmails() as $value) { + $values[] = $value; + } + $data['emails'] = $values; + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } - public function getSupportedTypes(string $format = null): array - { - return ['Braze\\Model\\V2SubscriptionStatusSetPostBodySubscriptionGroupsItem' => false]; + return $data; + } + + public function getSupportedTypes(string $format = null): array + { + return ['Braze\\Model\\V2SubscriptionStatusSetPostBodySubscriptionGroupsItem' => false]; + } } } diff --git a/lib/Runtime/Client/BaseEndpoint.php b/lib/Runtime/Client/BaseEndpoint.php index 23aee00..35267ff 100644 --- a/lib/Runtime/Client/BaseEndpoint.php +++ b/lib/Runtime/Client/BaseEndpoint.php @@ -17,6 +17,7 @@ abstract class BaseEndpoint implements Endpoint { + protected $formParameters = []; protected $queryParameters = []; protected $headerParameters = []; protected $body; diff --git a/lib/Runtime/Client/Client.php b/lib/Runtime/Client/Client.php index 319c9d5..c0ba0b6 100644 --- a/lib/Runtime/Client/Client.php +++ b/lib/Runtime/Client/Client.php @@ -83,7 +83,7 @@ private function processEndpoint(Endpoint $endpoint): ResponseInterface } } foreach ($endpoint->getHeaders($bodyHeaders) as $name => $value) { - $request = $request->withHeader($name, $value); + $request = $request->withHeader($name, !is_bool($value) ? $value : ($value ? 'true' : 'false')); } if (count($endpoint->getAuthenticationScopes()) > 0) { $scopes = []; diff --git a/lib/Runtime/Normalizer/ReferenceNormalizer.php b/lib/Runtime/Normalizer/ReferenceNormalizer.php index a151bc6..0291af3 100644 --- a/lib/Runtime/Normalizer/ReferenceNormalizer.php +++ b/lib/Runtime/Normalizer/ReferenceNormalizer.php @@ -11,20 +11,39 @@ namespace Braze\Runtime\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class ReferenceNormalizer implements NormalizerInterface -{ - public function normalize($object, $format = null, array $context = []) +if (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4) { + class ReferenceNormalizer implements NormalizerInterface { - $ref = []; - $ref['$ref'] = (string) $object->getReferenceUri(); + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $ref = []; + $ref['$ref'] = (string) $object->getReferenceUri(); - return $ref; - } + return $ref; + } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null): bool + { + return $data instanceof Reference; + } + } +} else { + class ReferenceNormalizer implements NormalizerInterface { - return $data instanceof Reference; + public function normalize($object, $format = null, array $context = []) + { + $ref = []; + $ref['$ref'] = (string) $object->getReferenceUri(); + + return $ref; + } + + public function supportsNormalization($data, $format = null): bool + { + return $data instanceof Reference; + } } } diff --git a/lib/Runtime/Normalizer/ValidatorTrait.php b/lib/Runtime/Normalizer/ValidatorTrait.php index c7650bb..7a1ec8b 100644 --- a/lib/Runtime/Normalizer/ValidatorTrait.php +++ b/lib/Runtime/Normalizer/ValidatorTrait.php @@ -11,12 +11,13 @@ namespace Braze\Runtime\Normalizer; use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Validation; trait ValidatorTrait { protected function validate(array $data, Constraint $constraint): void { - $validator = \Symfony\Component\Validator\Validation::createValidator(); + $validator = Validation::createValidator(); $violations = $validator->validate($data, $constraint); if ($violations->count() > 0) { throw new ValidationException($violations);