diff --git a/lib/Client.php b/lib/Client.php index b539e42..6822580 100644 --- a/lib/Client.php +++ b/lib/Client.php @@ -67,7 +67,7 @@ class Client extends Runtime\Client\Client * @throws Exception\PostTemplatesEmailUpdateTooManyRequestsException * @throws Exception\PostTemplatesEmailUpdateInternalServerErrorException */ - public function postTemplatesEmailUpdate(Model\TemplatesEmailUpdatePostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function postTemplatesEmailUpdate(?Model\TemplatesEmailUpdatePostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PostTemplatesEmailUpdate($requestBody, $headerParameters), $fetch); } @@ -204,7 +204,7 @@ public function postTemplatesEmailUpdate(Model\TemplatesEmailUpdatePostBody $req * @throws Exception\PostUsersTrackTooManyRequestsException * @throws Exception\PostUsersTrackInternalServerErrorException */ - public function postUsersTrack(Model\UsersTrackPostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function postUsersTrack(?Model\UsersTrackPostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PostUsersTrack($requestBody, $headerParameters), $fetch); } @@ -599,7 +599,7 @@ public function getCatalog(array $headerParameters = [], string $fetch = self::F * @throws Exception\PostCatalogTooManyRequestsException * @throws Exception\PostCatalogInternalServerErrorException */ - public function postCatalog(Model\CatalogsPostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function postCatalog(?Model\CatalogsPostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PostCatalog($requestBody, $headerParameters), $fetch); } @@ -967,7 +967,7 @@ public function getCatalogsByCatalogNameItem(string $catalogName, array $headerP * @throws Exception\PatchCatalogsByCatalogNameItemTooManyRequestsException * @throws Exception\PatchCatalogsByCatalogNameItemInternalServerErrorException */ - public function patchCatalogsByCatalogNameItem(string $catalogName, Model\CatalogsCatalogNameItemsPatchBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function patchCatalogsByCatalogNameItem(string $catalogName, ?Model\CatalogsCatalogNameItemsPatchBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PatchCatalogsByCatalogNameItem($catalogName, $requestBody, $headerParameters), $fetch); } @@ -1110,7 +1110,7 @@ public function patchCatalogsByCatalogNameItem(string $catalogName, Model\Catalo * @throws Exception\PostCatalogsByCatalogNameItemTooManyRequestsException * @throws Exception\PostCatalogsByCatalogNameItemInternalServerErrorException */ - public function postCatalogsByCatalogNameItem(string $catalogName, Model\CatalogsCatalogNameItemsPostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function postCatalogsByCatalogNameItem(string $catalogName, ?Model\CatalogsCatalogNameItemsPostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PostCatalogsByCatalogNameItem($catalogName, $requestBody, $headerParameters), $fetch); } @@ -1218,7 +1218,7 @@ public function postCatalogsByCatalogNameItem(string $catalogName, Model\Catalog * @throws Exception\PutCatalogsByCatalogNameItemTooManyRequestsException * @throws Exception\PutCatalogsByCatalogNameItemInternalServerErrorException */ - public function putCatalogsByCatalogNameItem(string $catalogName, Model\CatalogsCatalogNameItemsPutBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function putCatalogsByCatalogNameItem(string $catalogName, ?Model\CatalogsCatalogNameItemsPutBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PutCatalogsByCatalogNameItem($catalogName, $requestBody, $headerParameters), $fetch); } @@ -1547,7 +1547,7 @@ public function getCatalogsByCatalogNameItemByItemId(string $catalogName, string * @throws Exception\PatchCatalogsByCatalogNameItemByItemIdTooManyRequestsException * @throws Exception\PatchCatalogsByCatalogNameItemByItemIdInternalServerErrorException */ - public function patchCatalogsByCatalogNameItemByItemId(string $catalogName, string $itemId, Model\CatalogsCatalogNameItemsItemIdPatchBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function patchCatalogsByCatalogNameItemByItemId(string $catalogName, string $itemId, ?Model\CatalogsCatalogNameItemsItemIdPatchBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PatchCatalogsByCatalogNameItemByItemId($catalogName, $itemId, $requestBody, $headerParameters), $fetch); } @@ -1673,7 +1673,7 @@ public function patchCatalogsByCatalogNameItemByItemId(string $catalogName, stri * @throws Exception\PostCatalogsByCatalogNameItemByItemIdTooManyRequestsException * @throws Exception\PostCatalogsByCatalogNameItemByItemIdInternalServerErrorException */ - public function postCatalogsByCatalogNameItemByItemId(string $catalogName, string $itemId, Model\CatalogsCatalogNameItemsItemIdPostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function postCatalogsByCatalogNameItemByItemId(string $catalogName, string $itemId, ?Model\CatalogsCatalogNameItemsItemIdPostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PostCatalogsByCatalogNameItemByItemId($catalogName, $itemId, $requestBody, $headerParameters), $fetch); } @@ -1802,7 +1802,7 @@ public function postCatalogsByCatalogNameItemByItemId(string $catalogName, strin * @throws Exception\PutCatalogsByCatalogNameItemByItemIdTooManyRequestsException * @throws Exception\PutCatalogsByCatalogNameItemByItemIdInternalServerErrorException */ - public function putCatalogsByCatalogNameItemByItemId(string $catalogName, string $itemId, Model\CatalogsCatalogNameItemsItemIdPutBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function putCatalogsByCatalogNameItemByItemId(string $catalogName, string $itemId, ?Model\CatalogsCatalogNameItemsItemIdPutBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PutCatalogsByCatalogNameItemByItemId($catalogName, $itemId, $requestBody, $headerParameters), $fetch); } @@ -2029,7 +2029,7 @@ public function getEmailUnsubscribe(array $queryParameters = [], array $headerPa * @throws Exception\PostEmailStatusTooManyRequestsException * @throws Exception\PostEmailStatusInternalServerErrorException */ - public function postEmailStatus(Model\EmailStatusPostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function postEmailStatus(?Model\EmailStatusPostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PostEmailStatus($requestBody, $headerParameters), $fetch); } @@ -2068,7 +2068,7 @@ public function postEmailStatus(Model\EmailStatusPostBody $requestBody = null, a * @throws Exception\PostEmailBounceRemoveTooManyRequestsException * @throws Exception\PostEmailBounceRemoveInternalServerErrorException */ - public function postEmailBounceRemove(Model\EmailBounceRemovePostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function postEmailBounceRemove(?Model\EmailBounceRemovePostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PostEmailBounceRemove($requestBody, $headerParameters), $fetch); } @@ -2107,7 +2107,7 @@ public function postEmailBounceRemove(Model\EmailBounceRemovePostBody $requestBo * @throws Exception\PostEmailSpamRemoveTooManyRequestsException * @throws Exception\PostEmailSpamRemoveInternalServerErrorException */ - public function postEmailSpamRemove(Model\EmailSpamRemovePostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function postEmailSpamRemove(?Model\EmailSpamRemovePostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PostEmailSpamRemove($requestBody, $headerParameters), $fetch); } @@ -2144,7 +2144,7 @@ public function postEmailSpamRemove(Model\EmailSpamRemovePostBody $requestBody = * @throws Exception\PostEmailBlocklistTooManyRequestsException * @throws Exception\PostEmailBlocklistInternalServerErrorException */ - public function postEmailBlocklist(Model\EmailBlocklistPostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function postEmailBlocklist(?Model\EmailBlocklistPostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PostEmailBlocklist($requestBody, $headerParameters), $fetch); } @@ -2181,7 +2181,7 @@ public function postEmailBlocklist(Model\EmailBlocklistPostBody $requestBody = n * @throws Exception\PostEmailBlacklistTooManyRequestsException * @throws Exception\PostEmailBlacklistInternalServerErrorException */ - public function postEmailBlacklist(Model\EmailBlacklistPostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function postEmailBlacklist(?Model\EmailBlacklistPostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PostEmailBlacklist($requestBody, $headerParameters), $fetch); } @@ -4667,7 +4667,7 @@ public function getSessionsDataSeries(array $queryParameters = [], array $header * @throws Exception\PostUsersExportIdTooManyRequestsException * @throws Exception\PostUsersExportIdInternalServerErrorException */ - public function postUsersExportId(Model\UsersExportIdsPostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function postUsersExportId(?Model\UsersExportIdsPostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PostUsersExportId($requestBody, $headerParameters), $fetch); } @@ -5065,7 +5065,7 @@ public function postUsersExportId(Model\UsersExportIdsPostBody $requestBody = nu * @throws Exception\PostUsersExportSegmentTooManyRequestsException * @throws Exception\PostUsersExportSegmentInternalServerErrorException */ - public function postUsersExportSegment(Model\UsersExportSegmentPostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function postUsersExportSegment(?Model\UsersExportSegmentPostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PostUsersExportSegment($requestBody, $headerParameters), $fetch); } @@ -5319,7 +5319,7 @@ public function postUsersExportSegment(Model\UsersExportSegmentPostBody $request * @throws Exception\PostUsersExportGlobalControlGroupTooManyRequestsException * @throws Exception\PostUsersExportGlobalControlGroupInternalServerErrorException */ - public function postUsersExportGlobalControlGroup(Model\UsersExportGlobalControlGroupPostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function postUsersExportGlobalControlGroup(?Model\UsersExportGlobalControlGroupPostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PostUsersExportGlobalControlGroup($requestBody, $headerParameters), $fetch); } @@ -5397,7 +5397,7 @@ public function postUsersExportGlobalControlGroup(Model\UsersExportGlobalControl * @throws Exception\PostMessagesLiveActivityUpdateTooManyRequestsException * @throws Exception\PostMessagesLiveActivityUpdateInternalServerErrorException */ - public function postMessagesLiveActivityUpdate(Model\MessagesLiveActivityUpdatePostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function postMessagesLiveActivityUpdate(?Model\MessagesLiveActivityUpdatePostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PostMessagesLiveActivityUpdate($requestBody, $headerParameters), $fetch); } @@ -5493,7 +5493,7 @@ public function getMessagesScheduledBroadcast(array $queryParameters = [], array * @throws Exception\PostMessagesScheduleDeleteTooManyRequestsException * @throws Exception\PostMessagesScheduleDeleteInternalServerErrorException */ - public function postMessagesScheduleDelete(Model\MessagesScheduleDeletePostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function postMessagesScheduleDelete(?Model\MessagesScheduleDeletePostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PostMessagesScheduleDelete($requestBody, $headerParameters), $fetch); } @@ -5531,7 +5531,7 @@ public function postMessagesScheduleDelete(Model\MessagesScheduleDeletePostBody * @throws Exception\PostCanvasTriggerScheduleDeleteTooManyRequestsException * @throws Exception\PostCanvasTriggerScheduleDeleteInternalServerErrorException */ - public function postCanvasTriggerScheduleDelete(Model\CanvasTriggerScheduleDeletePostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function postCanvasTriggerScheduleDelete(?Model\CanvasTriggerScheduleDeletePostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PostCanvasTriggerScheduleDelete($requestBody, $headerParameters), $fetch); } @@ -5571,7 +5571,7 @@ public function postCanvasTriggerScheduleDelete(Model\CanvasTriggerScheduleDelet * @throws Exception\PostCampaignsTriggerScheduleDeleteTooManyRequestsException * @throws Exception\PostCampaignsTriggerScheduleDeleteInternalServerErrorException */ - public function postCampaignsTriggerScheduleDelete(Model\CampaignsTriggerScheduleDeletePostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function postCampaignsTriggerScheduleDelete(?Model\CampaignsTriggerScheduleDeletePostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PostCampaignsTriggerScheduleDelete($requestBody, $headerParameters), $fetch); } @@ -5635,7 +5635,7 @@ public function postCampaignsTriggerScheduleDelete(Model\CampaignsTriggerSchedul * @throws Exception\PostMessagesScheduleCreateTooManyRequestsException * @throws Exception\PostMessagesScheduleCreateInternalServerErrorException */ - public function postMessagesScheduleCreate(Model\MessagesScheduleCreatePostBody $requestBody = null, string $fetch = self::FETCH_OBJECT) + public function postMessagesScheduleCreate(?Model\MessagesScheduleCreatePostBody $requestBody = null, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PostMessagesScheduleCreate($requestBody), $fetch); } @@ -5705,7 +5705,7 @@ public function postMessagesScheduleCreate(Model\MessagesScheduleCreatePostBody * @throws Exception\PostCampaignsTriggerScheduleCreateTooManyRequestsException * @throws Exception\PostCampaignsTriggerScheduleCreateInternalServerErrorException */ - public function postCampaignsTriggerScheduleCreate(Model\CampaignsTriggerScheduleCreatePostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function postCampaignsTriggerScheduleCreate(?Model\CampaignsTriggerScheduleCreatePostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PostCampaignsTriggerScheduleCreate($requestBody, $headerParameters), $fetch); } @@ -5759,7 +5759,7 @@ public function postCampaignsTriggerScheduleCreate(Model\CampaignsTriggerSchedul * @throws Exception\PostCanvasTriggerScheduleCreateTooManyRequestsException * @throws Exception\PostCanvasTriggerScheduleCreateInternalServerErrorException */ - public function postCanvasTriggerScheduleCreate(Model\CanvasTriggerScheduleCreatePostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function postCanvasTriggerScheduleCreate(?Model\CanvasTriggerScheduleCreatePostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PostCanvasTriggerScheduleCreate($requestBody, $headerParameters), $fetch); } @@ -5800,7 +5800,7 @@ public function postCanvasTriggerScheduleCreate(Model\CanvasTriggerScheduleCreat * @throws Exception\PostMessagesScheduleUpdateTooManyRequestsException * @throws Exception\PostMessagesScheduleUpdateInternalServerErrorException */ - public function postMessagesScheduleUpdate(Model\MessagesScheduleUpdatePostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function postMessagesScheduleUpdate(?Model\MessagesScheduleUpdatePostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PostMessagesScheduleUpdate($requestBody, $headerParameters), $fetch); } @@ -5845,7 +5845,7 @@ public function postMessagesScheduleUpdate(Model\MessagesScheduleUpdatePostBody * @throws Exception\PostCampaignsTriggerScheduleUpdateTooManyRequestsException * @throws Exception\PostCampaignsTriggerScheduleUpdateInternalServerErrorException */ - public function postCampaignsTriggerScheduleUpdate(Model\CampaignsTriggerScheduleUpdatePostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function postCampaignsTriggerScheduleUpdate(?Model\CampaignsTriggerScheduleUpdatePostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PostCampaignsTriggerScheduleUpdate($requestBody, $headerParameters), $fetch); } @@ -5890,7 +5890,7 @@ public function postCampaignsTriggerScheduleUpdate(Model\CampaignsTriggerSchedul * @throws Exception\PostCanvasTriggerScheduleUpdateTooManyRequestsException * @throws Exception\PostCanvasTriggerScheduleUpdateInternalServerErrorException */ - public function postCanvasTriggerScheduleUpdate(Model\CanvasTriggerScheduleUpdatePostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function postCanvasTriggerScheduleUpdate(?Model\CanvasTriggerScheduleUpdatePostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PostCanvasTriggerScheduleUpdate($requestBody, $headerParameters), $fetch); } @@ -5944,7 +5944,7 @@ public function postCanvasTriggerScheduleUpdate(Model\CanvasTriggerScheduleUpdat * @throws Exception\PostSendsIdCreateTooManyRequestsException * @throws Exception\PostSendsIdCreateInternalServerErrorException */ - public function postSendsIdCreate(Model\SendsIdCreatePostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function postSendsIdCreate(?Model\SendsIdCreatePostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PostSendsIdCreate($requestBody, $headerParameters), $fetch); } @@ -6005,7 +6005,7 @@ public function postSendsIdCreate(Model\SendsIdCreatePostBody $requestBody = nul * @throws Exception\PostMessagesSendTooManyRequestsException * @throws Exception\PostMessagesSendInternalServerErrorException */ - public function postMessagesSend(Model\MessagesSendPostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function postMessagesSend(?Model\MessagesSendPostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PostMessagesSend($requestBody, $headerParameters), $fetch); } @@ -6232,7 +6232,7 @@ public function postMessagesSend(Model\MessagesSendPostBody $requestBody = null, * @throws Exception\PostTransactionalV1CampaignsByCampaignIdSendTooManyRequestsException * @throws Exception\PostTransactionalV1CampaignsByCampaignIdSendInternalServerErrorException */ - public function postTransactionalV1CampaignsByCampaignIdSend(string $campaignId, Model\TransactionalV1CampaignsCampaignIdSendPostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function postTransactionalV1CampaignsByCampaignIdSend(string $campaignId, ?Model\TransactionalV1CampaignsCampaignIdSendPostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PostTransactionalV1CampaignsByCampaignIdSend($campaignId, $requestBody, $headerParameters), $fetch); } @@ -6304,7 +6304,7 @@ public function postTransactionalV1CampaignsByCampaignIdSend(string $campaignId, * @throws Exception\PostCampaignsTriggerSendTooManyRequestsException * @throws Exception\PostCampaignsTriggerSendInternalServerErrorException */ - public function postCampaignsTriggerSend(Model\CampaignsTriggerSendPostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function postCampaignsTriggerSend(?Model\CampaignsTriggerSendPostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PostCampaignsTriggerSend($requestBody, $headerParameters), $fetch); } @@ -6373,7 +6373,7 @@ public function postCampaignsTriggerSend(Model\CampaignsTriggerSendPostBody $req * @throws Exception\PostCanvasTriggerSendTooManyRequestsException * @throws Exception\PostCanvasTriggerSendInternalServerErrorException */ - public function postCanvasTriggerSend(Model\CanvasTriggerSendPostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function postCanvasTriggerSend(?Model\CanvasTriggerSendPostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PostCanvasTriggerSend($requestBody, $headerParameters), $fetch); } @@ -6655,7 +6655,7 @@ public function getPreferenceCenterV1ByPreferenceCenterExternalID(string $prefer * @throws Exception\PutPreferenceCenterV1ByPreferenceCenterExternalIDTooManyRequestsException * @throws Exception\PutPreferenceCenterV1ByPreferenceCenterExternalIDInternalServerErrorException */ - public function putPreferenceCenterV1ByPreferenceCenterExternalID(string $preferenceCenterExternalID, Model\PreferenceCenterV1PreferenceCenterExternalIDPutBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function putPreferenceCenterV1ByPreferenceCenterExternalID(string $preferenceCenterExternalID, ?Model\PreferenceCenterV1PreferenceCenterExternalIDPutBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PutPreferenceCenterV1ByPreferenceCenterExternalID($preferenceCenterExternalID, $requestBody, $headerParameters), $fetch); } @@ -6733,7 +6733,7 @@ public function putPreferenceCenterV1ByPreferenceCenterExternalID(string $prefer * @throws Exception\PostPreferenceCenterV1TooManyRequestsException * @throws Exception\PostPreferenceCenterV1InternalServerErrorException */ - public function postPreferenceCenterV1(Model\PreferenceCenterV1PostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function postPreferenceCenterV1(?Model\PreferenceCenterV1PostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PostPreferenceCenterV1($requestBody, $headerParameters), $fetch); } @@ -6967,7 +6967,7 @@ public function getScimV2UserById(string $id, array $headerParameters = [], stri * @throws Exception\PutScimV2UserByIdTooManyRequestsException * @throws Exception\PutScimV2UserByIdInternalServerErrorException */ - public function putScimV2UserById(string $id, Model\ScimV2UsersIdPutBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function putScimV2UserById(string $id, ?Model\ScimV2UsersIdPutBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PutScimV2UserById($id, $requestBody, $headerParameters), $fetch); } @@ -7152,7 +7152,7 @@ public function getScimV2User(array $queryParameters = [], array $headerParamete * @throws Exception\PostScimV2UserTooManyRequestsException * @throws Exception\PostScimV2UserInternalServerErrorException */ - public function postScimV2User(Model\ScimV2UsersPostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function postScimV2User(?Model\ScimV2UsersPostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PostScimV2User($requestBody, $headerParameters), $fetch); } @@ -7267,7 +7267,7 @@ public function getSmsInvalidPhoneNumber(array $queryParameters = [], array $hea * @throws Exception\PostSmsInvalidPhoneNumbersRemoveTooManyRequestsException * @throws Exception\PostSmsInvalidPhoneNumbersRemoveInternalServerErrorException */ - public function postSmsInvalidPhoneNumbersRemove(Model\SmsInvalidPhoneNumbersRemovePostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function postSmsInvalidPhoneNumbersRemove(?Model\SmsInvalidPhoneNumbersRemovePostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PostSmsInvalidPhoneNumbersRemove($requestBody, $headerParameters), $fetch); } @@ -7440,7 +7440,7 @@ public function getSubscriptionUserStatus(array $queryParameters = [], array $he * @throws Exception\PostSubscriptionStatusSetTooManyRequestsException * @throws Exception\PostSubscriptionStatusSetInternalServerErrorException */ - public function postSubscriptionStatusSet(Model\SubscriptionStatusSetPostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function postSubscriptionStatusSet(?Model\SubscriptionStatusSetPostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PostSubscriptionStatusSet($requestBody, $headerParameters), $fetch); } @@ -7493,7 +7493,7 @@ public function postSubscriptionStatusSet(Model\SubscriptionStatusSetPostBody $r * @throws Exception\PostV2SubscriptionStatusSetTooManyRequestsException * @throws Exception\PostV2SubscriptionStatusSetInternalServerErrorException */ - public function postV2SubscriptionStatusSet(Model\V2SubscriptionStatusSetPostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function postV2SubscriptionStatusSet(?Model\V2SubscriptionStatusSetPostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PostV2SubscriptionStatusSet($requestBody, $headerParameters), $fetch); } @@ -7730,7 +7730,7 @@ public function getContentBlocksInfo(array $queryParameters = [], array $headerP * @throws Exception\PostContentBlocksCreateTooManyRequestsException * @throws Exception\PostContentBlocksCreateInternalServerErrorException */ - public function postContentBlocksCreate(Model\ContentBlocksCreatePostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function postContentBlocksCreate(?Model\ContentBlocksCreatePostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PostContentBlocksCreate($requestBody, $headerParameters), $fetch); } @@ -7811,7 +7811,7 @@ public function postContentBlocksCreate(Model\ContentBlocksCreatePostBody $reque * @throws Exception\PostContentBlocksUpdateTooManyRequestsException * @throws Exception\PostContentBlocksUpdateInternalServerErrorException */ - public function postContentBlocksUpdate(Model\ContentBlocksUpdatePostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function postContentBlocksUpdate(?Model\ContentBlocksUpdatePostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PostContentBlocksUpdate($requestBody, $headerParameters), $fetch); } @@ -7998,7 +7998,7 @@ public function getTemplatesEmailInfo(array $queryParameters = [], array $header * @throws Exception\PostTemplatesEmailCreateTooManyRequestsException * @throws Exception\PostTemplatesEmailCreateInternalServerErrorException */ - public function postTemplatesEmailCreate(Model\TemplatesEmailCreatePostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function postTemplatesEmailCreate(?Model\TemplatesEmailCreatePostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PostTemplatesEmailCreate($requestBody, $headerParameters), $fetch); } @@ -8087,7 +8087,7 @@ public function postTemplatesEmailCreate(Model\TemplatesEmailCreatePostBody $req * @throws Exception\PostUsersExternalIdsRenameTooManyRequestsException * @throws Exception\PostUsersExternalIdsRenameInternalServerErrorException */ - public function postUsersExternalIdsRename(Model\UsersExternalIdsRenamePostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function postUsersExternalIdsRename(?Model\UsersExternalIdsRenamePostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PostUsersExternalIdsRename($requestBody, $headerParameters), $fetch); } @@ -8152,7 +8152,7 @@ public function postUsersExternalIdsRename(Model\UsersExternalIdsRenamePostBody * @throws Exception\PostUsersExternalIdsRemoveTooManyRequestsException * @throws Exception\PostUsersExternalIdsRemoveInternalServerErrorException */ - public function postUsersExternalIdsRemove(Model\UsersExternalIdsRemovePostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function postUsersExternalIdsRemove(?Model\UsersExternalIdsRemovePostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PostUsersExternalIdsRemove($requestBody, $headerParameters), $fetch); } @@ -8206,7 +8206,7 @@ public function postUsersExternalIdsRemove(Model\UsersExternalIdsRemovePostBody * @throws Exception\PostUsersAliasUpdateTooManyRequestsException * @throws Exception\PostUsersAliasUpdateInternalServerErrorException */ - public function postUsersAliasUpdate(Model\UsersAliasUpdatePostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function postUsersAliasUpdate(?Model\UsersAliasUpdatePostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PostUsersAliasUpdate($requestBody, $headerParameters), $fetch); } @@ -8249,7 +8249,7 @@ public function postUsersAliasUpdate(Model\UsersAliasUpdatePostBody $requestBody * @throws Exception\PostUsersAliasNewTooManyRequestsException * @throws Exception\PostUsersAliasNewInternalServerErrorException */ - public function postUsersAliasNew(Model\UsersAliasNewPostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function postUsersAliasNew(?Model\UsersAliasNewPostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PostUsersAliasNew($requestBody, $headerParameters), $fetch); } @@ -8293,7 +8293,7 @@ public function postUsersAliasNew(Model\UsersAliasNewPostBody $requestBody = nul * @throws Exception\PostUsersDeleteTooManyRequestsException * @throws Exception\PostUsersDeleteInternalServerErrorException */ - public function postUsersDelete(Model\UsersDeletePostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function postUsersDelete(?Model\UsersDeletePostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PostUsersDelete($requestBody, $headerParameters), $fetch); } @@ -8403,7 +8403,7 @@ public function postUsersDelete(Model\UsersDeletePostBody $requestBody = null, a * @throws Exception\PostUsersIdentifyTooManyRequestsException * @throws Exception\PostUsersIdentifyInternalServerErrorException */ - public function postUsersIdentify(Model\UsersIdentifyPostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function postUsersIdentify(?Model\UsersIdentifyPostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PostUsersIdentify($requestBody, $headerParameters), $fetch); } @@ -8558,7 +8558,7 @@ public function postUsersIdentify(Model\UsersIdentifyPostBody $requestBody = nul * @throws Exception\PostUsersMergeTooManyRequestsException * @throws Exception\PostUsersMergeInternalServerErrorException */ - public function postUsersMerge(Model\UsersMergePostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function postUsersMerge(?Model\UsersMergePostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\PostUsersMerge($requestBody, $headerParameters), $fetch); } diff --git a/lib/Endpoint/DeleteCatalogByCatalogName.php b/lib/Endpoint/DeleteCatalogByCatalogName.php index 208a174..86b3813 100644 --- a/lib/Endpoint/DeleteCatalogByCatalogName.php +++ b/lib/Endpoint/DeleteCatalogByCatalogName.php @@ -130,7 +130,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\DeleteCatalogByCatalogNameTooManyRequestsException * @throws \Braze\Exception\DeleteCatalogByCatalogNameInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/DeleteCatalogsByCatalogNameItem.php b/lib/Endpoint/DeleteCatalogsByCatalogNameItem.php index 48da8f1..de45e7f 100644 --- a/lib/Endpoint/DeleteCatalogsByCatalogNameItem.php +++ b/lib/Endpoint/DeleteCatalogsByCatalogNameItem.php @@ -156,7 +156,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\DeleteCatalogsByCatalogNameItemTooManyRequestsException * @throws \Braze\Exception\DeleteCatalogsByCatalogNameItemInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/DeleteCatalogsByCatalogNameItemByItemId.php b/lib/Endpoint/DeleteCatalogsByCatalogNameItemByItemId.php index f4343c6..62cb02f 100644 --- a/lib/Endpoint/DeleteCatalogsByCatalogNameItemByItemId.php +++ b/lib/Endpoint/DeleteCatalogsByCatalogNameItemByItemId.php @@ -148,7 +148,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\DeleteCatalogsByCatalogNameItemByItemIdTooManyRequestsException * @throws \Braze\Exception\DeleteCatalogsByCatalogNameItemByItemIdInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/DeleteScimV2UserById.php b/lib/Endpoint/DeleteScimV2UserById.php index 3581867..2dd43da 100644 --- a/lib/Endpoint/DeleteScimV2UserById.php +++ b/lib/Endpoint/DeleteScimV2UserById.php @@ -108,7 +108,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\DeleteScimV2UserByIdTooManyRequestsException * @throws \Braze\Exception\DeleteScimV2UserByIdInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/GetCampaignsDataSeries.php b/lib/Endpoint/GetCampaignsDataSeries.php index 11d4834..17f9b32 100644 --- a/lib/Endpoint/GetCampaignsDataSeries.php +++ b/lib/Endpoint/GetCampaignsDataSeries.php @@ -277,7 +277,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\GetCampaignsDataSeriesTooManyRequestsException * @throws \Braze\Exception\GetCampaignsDataSeriesInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/GetCampaignsDetail.php b/lib/Endpoint/GetCampaignsDetail.php index 7e21371..9ba8922 100644 --- a/lib/Endpoint/GetCampaignsDetail.php +++ b/lib/Endpoint/GetCampaignsDetail.php @@ -315,7 +315,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\GetCampaignsDetailTooManyRequestsException * @throws \Braze\Exception\GetCampaignsDetailInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/GetCampaignsList.php b/lib/Endpoint/GetCampaignsList.php index b6f8b67..3cb87df 100644 --- a/lib/Endpoint/GetCampaignsList.php +++ b/lib/Endpoint/GetCampaignsList.php @@ -133,7 +133,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\GetCampaignsListTooManyRequestsException * @throws \Braze\Exception\GetCampaignsListInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/GetCanvasDataSeries.php b/lib/Endpoint/GetCanvasDataSeries.php index d3e33de..18208d5 100644 --- a/lib/Endpoint/GetCanvasDataSeries.php +++ b/lib/Endpoint/GetCanvasDataSeries.php @@ -180,7 +180,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\GetCanvasDataSeriesTooManyRequestsException * @throws \Braze\Exception\GetCanvasDataSeriesInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/GetCanvasDataSummary.php b/lib/Endpoint/GetCanvasDataSummary.php index cace793..ceaf16a 100644 --- a/lib/Endpoint/GetCanvasDataSummary.php +++ b/lib/Endpoint/GetCanvasDataSummary.php @@ -172,7 +172,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\GetCanvasDataSummaryTooManyRequestsException * @throws \Braze\Exception\GetCanvasDataSummaryInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/GetCanvasDetail.php b/lib/Endpoint/GetCanvasDetail.php index 3df8283..a8e58cc 100644 --- a/lib/Endpoint/GetCanvasDetail.php +++ b/lib/Endpoint/GetCanvasDetail.php @@ -143,7 +143,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\GetCanvasDetailTooManyRequestsException * @throws \Braze\Exception\GetCanvasDetailInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/GetCanvasList.php b/lib/Endpoint/GetCanvasList.php index d95b8bb..666f2d9 100644 --- a/lib/Endpoint/GetCanvasList.php +++ b/lib/Endpoint/GetCanvasList.php @@ -134,7 +134,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\GetCanvasListTooManyRequestsException * @throws \Braze\Exception\GetCanvasListInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/GetCatalog.php b/lib/Endpoint/GetCatalog.php index 72630f8..e2c1a6b 100644 --- a/lib/Endpoint/GetCatalog.php +++ b/lib/Endpoint/GetCatalog.php @@ -168,7 +168,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\GetCatalogTooManyRequestsException * @throws \Braze\Exception\GetCatalogInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/GetCatalogsByCatalogNameItem.php b/lib/Endpoint/GetCatalogsByCatalogNameItem.php index 2eabd27..f84b54c 100644 --- a/lib/Endpoint/GetCatalogsByCatalogNameItem.php +++ b/lib/Endpoint/GetCatalogsByCatalogNameItem.php @@ -197,7 +197,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\GetCatalogsByCatalogNameItemTooManyRequestsException * @throws \Braze\Exception\GetCatalogsByCatalogNameItemInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/GetCatalogsByCatalogNameItemByItemId.php b/lib/Endpoint/GetCatalogsByCatalogNameItemByItemId.php index 0f46d7a..9d37247 100644 --- a/lib/Endpoint/GetCatalogsByCatalogNameItemByItemId.php +++ b/lib/Endpoint/GetCatalogsByCatalogNameItemByItemId.php @@ -158,7 +158,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\GetCatalogsByCatalogNameItemByItemIdTooManyRequestsException * @throws \Braze\Exception\GetCatalogsByCatalogNameItemByItemIdInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/GetContentBlocksInfo.php b/lib/Endpoint/GetContentBlocksInfo.php index 7250195..1126612 100644 --- a/lib/Endpoint/GetContentBlocksInfo.php +++ b/lib/Endpoint/GetContentBlocksInfo.php @@ -132,7 +132,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\GetContentBlocksInfoTooManyRequestsException * @throws \Braze\Exception\GetContentBlocksInfoInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/GetContentBlocksList.php b/lib/Endpoint/GetContentBlocksList.php index 12bb011..9f0e90e 100644 --- a/lib/Endpoint/GetContentBlocksList.php +++ b/lib/Endpoint/GetContentBlocksList.php @@ -143,7 +143,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\GetContentBlocksListTooManyRequestsException * @throws \Braze\Exception\GetContentBlocksListInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/GetEmailHardBounce.php b/lib/Endpoint/GetEmailHardBounce.php index 9014d0e..76f0786 100644 --- a/lib/Endpoint/GetEmailHardBounce.php +++ b/lib/Endpoint/GetEmailHardBounce.php @@ -154,7 +154,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\GetEmailHardBounceTooManyRequestsException * @throws \Braze\Exception\GetEmailHardBounceInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/GetEmailUnsubscribe.php b/lib/Endpoint/GetEmailUnsubscribe.php index 8ac71e9..d7be65d 100644 --- a/lib/Endpoint/GetEmailUnsubscribe.php +++ b/lib/Endpoint/GetEmailUnsubscribe.php @@ -154,7 +154,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\GetEmailUnsubscribeTooManyRequestsException * @throws \Braze\Exception\GetEmailUnsubscribeInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/GetEventsDataSeries.php b/lib/Endpoint/GetEventsDataSeries.php index eac8422..57c1176 100644 --- a/lib/Endpoint/GetEventsDataSeries.php +++ b/lib/Endpoint/GetEventsDataSeries.php @@ -139,7 +139,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\GetEventsDataSeriesTooManyRequestsException * @throws \Braze\Exception\GetEventsDataSeriesInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/GetEventsList.php b/lib/Endpoint/GetEventsList.php index e086d80..dfbf77c 100644 --- a/lib/Endpoint/GetEventsList.php +++ b/lib/Endpoint/GetEventsList.php @@ -116,7 +116,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\GetEventsListTooManyRequestsException * @throws \Braze\Exception\GetEventsListInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/GetFeedDataSeries.php b/lib/Endpoint/GetFeedDataSeries.php index b1fa5f3..143881c 100644 --- a/lib/Endpoint/GetFeedDataSeries.php +++ b/lib/Endpoint/GetFeedDataSeries.php @@ -133,7 +133,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\GetFeedDataSeriesTooManyRequestsException * @throws \Braze\Exception\GetFeedDataSeriesInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/GetFeedDetail.php b/lib/Endpoint/GetFeedDetail.php index 9d9c411..980afc1 100644 --- a/lib/Endpoint/GetFeedDetail.php +++ b/lib/Endpoint/GetFeedDetail.php @@ -122,7 +122,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\GetFeedDetailTooManyRequestsException * @throws \Braze\Exception\GetFeedDetailInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/GetFeedList.php b/lib/Endpoint/GetFeedList.php index cda1ebe..0cf2c36 100644 --- a/lib/Endpoint/GetFeedList.php +++ b/lib/Endpoint/GetFeedList.php @@ -128,7 +128,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\GetFeedListTooManyRequestsException * @throws \Braze\Exception\GetFeedListInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/GetKpiDauDataSeries.php b/lib/Endpoint/GetKpiDauDataSeries.php index 603138a..f4139f4 100644 --- a/lib/Endpoint/GetKpiDauDataSeries.php +++ b/lib/Endpoint/GetKpiDauDataSeries.php @@ -122,7 +122,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\GetKpiDauDataSeriesTooManyRequestsException * @throws \Braze\Exception\GetKpiDauDataSeriesInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/GetKpiMauDataSeries.php b/lib/Endpoint/GetKpiMauDataSeries.php index c0a5fca..0b0b5b8 100644 --- a/lib/Endpoint/GetKpiMauDataSeries.php +++ b/lib/Endpoint/GetKpiMauDataSeries.php @@ -123,7 +123,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\GetKpiMauDataSeriesTooManyRequestsException * @throws \Braze\Exception\GetKpiMauDataSeriesInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/GetKpiNewUsersDataSeries.php b/lib/Endpoint/GetKpiNewUsersDataSeries.php index f811357..e9b525e 100644 --- a/lib/Endpoint/GetKpiNewUsersDataSeries.php +++ b/lib/Endpoint/GetKpiNewUsersDataSeries.php @@ -123,7 +123,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\GetKpiNewUsersDataSeriesTooManyRequestsException * @throws \Braze\Exception\GetKpiNewUsersDataSeriesInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/GetKpiUninstallsDataSeries.php b/lib/Endpoint/GetKpiUninstallsDataSeries.php index 5d3b79e..cf92177 100644 --- a/lib/Endpoint/GetKpiUninstallsDataSeries.php +++ b/lib/Endpoint/GetKpiUninstallsDataSeries.php @@ -123,7 +123,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\GetKpiUninstallsDataSeriesTooManyRequestsException * @throws \Braze\Exception\GetKpiUninstallsDataSeriesInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/GetMessagesScheduledBroadcast.php b/lib/Endpoint/GetMessagesScheduledBroadcast.php index f330c50..2ee003d 100644 --- a/lib/Endpoint/GetMessagesScheduledBroadcast.php +++ b/lib/Endpoint/GetMessagesScheduledBroadcast.php @@ -115,7 +115,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\GetMessagesScheduledBroadcastTooManyRequestsException * @throws \Braze\Exception\GetMessagesScheduledBroadcastInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/GetPreferenceCenterV1ByPreferenceCenterExternalID.php b/lib/Endpoint/GetPreferenceCenterV1ByPreferenceCenterExternalID.php index 621f5e3..82b6625 100644 --- a/lib/Endpoint/GetPreferenceCenterV1ByPreferenceCenterExternalID.php +++ b/lib/Endpoint/GetPreferenceCenterV1ByPreferenceCenterExternalID.php @@ -114,7 +114,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\GetPreferenceCenterV1ByPreferenceCenterExternalIDTooManyRequestsException * @throws \Braze\Exception\GetPreferenceCenterV1ByPreferenceCenterExternalIDInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/GetPreferenceCenterV1ByPreferenceCenterExternalIDUrlByUserID.php b/lib/Endpoint/GetPreferenceCenterV1ByPreferenceCenterExternalIDUrlByUserID.php index e22409f..22a071c 100644 --- a/lib/Endpoint/GetPreferenceCenterV1ByPreferenceCenterExternalIDUrlByUserID.php +++ b/lib/Endpoint/GetPreferenceCenterV1ByPreferenceCenterExternalIDUrlByUserID.php @@ -123,7 +123,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\GetPreferenceCenterV1ByPreferenceCenterExternalIDUrlByUserIDTooManyRequestsException * @throws \Braze\Exception\GetPreferenceCenterV1ByPreferenceCenterExternalIDUrlByUserIDInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/GetPreferenceCenterV1List.php b/lib/Endpoint/GetPreferenceCenterV1List.php index e5ab243..d599ee7 100644 --- a/lib/Endpoint/GetPreferenceCenterV1List.php +++ b/lib/Endpoint/GetPreferenceCenterV1List.php @@ -120,7 +120,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\GetPreferenceCenterV1ListTooManyRequestsException * @throws \Braze\Exception\GetPreferenceCenterV1ListInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/GetPurchasesProductList.php b/lib/Endpoint/GetPurchasesProductList.php index 25547a7..deec154 100644 --- a/lib/Endpoint/GetPurchasesProductList.php +++ b/lib/Endpoint/GetPurchasesProductList.php @@ -109,7 +109,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\GetPurchasesProductListTooManyRequestsException * @throws \Braze\Exception\GetPurchasesProductListInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/GetPurchasesQuantitySeries.php b/lib/Endpoint/GetPurchasesQuantitySeries.php index 061fe41..00e88e0 100644 --- a/lib/Endpoint/GetPurchasesQuantitySeries.php +++ b/lib/Endpoint/GetPurchasesQuantitySeries.php @@ -132,7 +132,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\GetPurchasesQuantitySeriesTooManyRequestsException * @throws \Braze\Exception\GetPurchasesQuantitySeriesInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/GetPurchasesRevenueSeries.php b/lib/Endpoint/GetPurchasesRevenueSeries.php index 3b20b04..527b6be 100644 --- a/lib/Endpoint/GetPurchasesRevenueSeries.php +++ b/lib/Endpoint/GetPurchasesRevenueSeries.php @@ -132,7 +132,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\GetPurchasesRevenueSeriesTooManyRequestsException * @throws \Braze\Exception\GetPurchasesRevenueSeriesInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/GetScimV2User.php b/lib/Endpoint/GetScimV2User.php index e1708a5..a238022 100644 --- a/lib/Endpoint/GetScimV2User.php +++ b/lib/Endpoint/GetScimV2User.php @@ -151,7 +151,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\GetScimV2UserTooManyRequestsException * @throws \Braze\Exception\GetScimV2UserInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/GetScimV2UserById.php b/lib/Endpoint/GetScimV2UserById.php index 075698d..9d08ebb 100644 --- a/lib/Endpoint/GetScimV2UserById.php +++ b/lib/Endpoint/GetScimV2UserById.php @@ -124,7 +124,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\GetScimV2UserByIdTooManyRequestsException * @throws \Braze\Exception\GetScimV2UserByIdInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/GetSegmentsDataSeries.php b/lib/Endpoint/GetSegmentsDataSeries.php index a4d4951..551a8f8 100644 --- a/lib/Endpoint/GetSegmentsDataSeries.php +++ b/lib/Endpoint/GetSegmentsDataSeries.php @@ -125,7 +125,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\GetSegmentsDataSeriesTooManyRequestsException * @throws \Braze\Exception\GetSegmentsDataSeriesInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/GetSegmentsDetail.php b/lib/Endpoint/GetSegmentsDetail.php index c1a43b1..5b08ee9 100644 --- a/lib/Endpoint/GetSegmentsDetail.php +++ b/lib/Endpoint/GetSegmentsDetail.php @@ -116,7 +116,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\GetSegmentsDetailTooManyRequestsException * @throws \Braze\Exception\GetSegmentsDetailInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/GetSegmentsList.php b/lib/Endpoint/GetSegmentsList.php index 1d05a0e..68af256 100644 --- a/lib/Endpoint/GetSegmentsList.php +++ b/lib/Endpoint/GetSegmentsList.php @@ -124,7 +124,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\GetSegmentsListTooManyRequestsException * @throws \Braze\Exception\GetSegmentsListInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/GetSendsDataSeries.php b/lib/Endpoint/GetSendsDataSeries.php index c6e471b..2236574 100644 --- a/lib/Endpoint/GetSendsDataSeries.php +++ b/lib/Endpoint/GetSendsDataSeries.php @@ -158,7 +158,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\GetSendsDataSeriesTooManyRequestsException * @throws \Braze\Exception\GetSendsDataSeriesInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/GetSessionsDataSeries.php b/lib/Endpoint/GetSessionsDataSeries.php index e6aece8..1a399e9 100644 --- a/lib/Endpoint/GetSessionsDataSeries.php +++ b/lib/Endpoint/GetSessionsDataSeries.php @@ -131,7 +131,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\GetSessionsDataSeriesTooManyRequestsException * @throws \Braze\Exception\GetSessionsDataSeriesInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/GetSmsInvalidPhoneNumber.php b/lib/Endpoint/GetSmsInvalidPhoneNumber.php index 7f7c326..c48a740 100644 --- a/lib/Endpoint/GetSmsInvalidPhoneNumber.php +++ b/lib/Endpoint/GetSmsInvalidPhoneNumber.php @@ -136,7 +136,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\GetSmsInvalidPhoneNumberTooManyRequestsException * @throws \Braze\Exception\GetSmsInvalidPhoneNumberInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/GetSubscriptionStatusGet.php b/lib/Endpoint/GetSubscriptionStatusGet.php index d905929..8f2cf4a 100644 --- a/lib/Endpoint/GetSubscriptionStatusGet.php +++ b/lib/Endpoint/GetSubscriptionStatusGet.php @@ -124,7 +124,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\GetSubscriptionStatusGetTooManyRequestsException * @throws \Braze\Exception\GetSubscriptionStatusGetInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/GetSubscriptionUserStatus.php b/lib/Endpoint/GetSubscriptionUserStatus.php index 2e0e77e..ecefce9 100644 --- a/lib/Endpoint/GetSubscriptionUserStatus.php +++ b/lib/Endpoint/GetSubscriptionUserStatus.php @@ -107,7 +107,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\GetSubscriptionUserStatusTooManyRequestsException * @throws \Braze\Exception\GetSubscriptionUserStatusInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/GetTemplatesEmailInfo.php b/lib/Endpoint/GetTemplatesEmailInfo.php index f9d4abd..eb3152d 100644 --- a/lib/Endpoint/GetTemplatesEmailInfo.php +++ b/lib/Endpoint/GetTemplatesEmailInfo.php @@ -119,7 +119,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\GetTemplatesEmailInfoTooManyRequestsException * @throws \Braze\Exception\GetTemplatesEmailInfoInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/GetTemplatesEmailList.php b/lib/Endpoint/GetTemplatesEmailList.php index 8933ce9..e5ae445 100644 --- a/lib/Endpoint/GetTemplatesEmailList.php +++ b/lib/Endpoint/GetTemplatesEmailList.php @@ -123,7 +123,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\GetTemplatesEmailListTooManyRequestsException * @throws \Braze\Exception\GetTemplatesEmailListInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PatchCatalogsByCatalogNameItem.php b/lib/Endpoint/PatchCatalogsByCatalogNameItem.php index 6d9be9b..834132f 100644 --- a/lib/Endpoint/PatchCatalogsByCatalogNameItem.php +++ b/lib/Endpoint/PatchCatalogsByCatalogNameItem.php @@ -108,7 +108,7 @@ class PatchCatalogsByCatalogNameItem extends \Braze\Runtime\Client\BaseEndpoint * @var string $Authorization * } */ - public function __construct(string $catalogName, \Braze\Model\CatalogsCatalogNameItemsPatchBody $requestBody = null, array $headerParameters = []) + public function __construct(string $catalogName, ?\Braze\Model\CatalogsCatalogNameItemsPatchBody $requestBody = null, array $headerParameters = []) { $this->catalog_name = $catalogName; $this->body = $requestBody; @@ -161,7 +161,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PatchCatalogsByCatalogNameItemTooManyRequestsException * @throws \Braze\Exception\PatchCatalogsByCatalogNameItemInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PatchCatalogsByCatalogNameItemByItemId.php b/lib/Endpoint/PatchCatalogsByCatalogNameItemByItemId.php index 87327fe..6b418d2 100644 --- a/lib/Endpoint/PatchCatalogsByCatalogNameItemByItemId.php +++ b/lib/Endpoint/PatchCatalogsByCatalogNameItemByItemId.php @@ -121,7 +121,7 @@ class PatchCatalogsByCatalogNameItemByItemId extends \Braze\Runtime\Client\BaseE * @var string $Authorization * } */ - public function __construct(string $catalogName, string $itemId, \Braze\Model\CatalogsCatalogNameItemsItemIdPatchBody $requestBody = null, array $headerParameters = []) + public function __construct(string $catalogName, string $itemId, ?\Braze\Model\CatalogsCatalogNameItemsItemIdPatchBody $requestBody = null, array $headerParameters = []) { $this->catalog_name = $catalogName; $this->item_id = $itemId; @@ -175,7 +175,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PatchCatalogsByCatalogNameItemByItemIdTooManyRequestsException * @throws \Braze\Exception\PatchCatalogsByCatalogNameItemByItemIdInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PostCampaignsTriggerScheduleCreate.php b/lib/Endpoint/PostCampaignsTriggerScheduleCreate.php index df977d1..0f149dd 100644 --- a/lib/Endpoint/PostCampaignsTriggerScheduleCreate.php +++ b/lib/Endpoint/PostCampaignsTriggerScheduleCreate.php @@ -68,7 +68,7 @@ class PostCampaignsTriggerScheduleCreate extends \Braze\Runtime\Client\BaseEndpo * @var string $Authorization * } */ - public function __construct(\Braze\Model\CampaignsTriggerScheduleCreatePostBody $requestBody = null, array $headerParameters = []) + public function __construct(?\Braze\Model\CampaignsTriggerScheduleCreatePostBody $requestBody = null, array $headerParameters = []) { $this->body = $requestBody; $this->headerParameters = $headerParameters; @@ -120,7 +120,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PostCampaignsTriggerScheduleCreateTooManyRequestsException * @throws \Braze\Exception\PostCampaignsTriggerScheduleCreateInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PostCampaignsTriggerScheduleDelete.php b/lib/Endpoint/PostCampaignsTriggerScheduleDelete.php index a9c2581..8530774 100644 --- a/lib/Endpoint/PostCampaignsTriggerScheduleDelete.php +++ b/lib/Endpoint/PostCampaignsTriggerScheduleDelete.php @@ -38,7 +38,7 @@ class PostCampaignsTriggerScheduleDelete extends \Braze\Runtime\Client\BaseEndpo * @var string $Authorization * } */ - public function __construct(\Braze\Model\CampaignsTriggerScheduleDeletePostBody $requestBody = null, array $headerParameters = []) + public function __construct(?\Braze\Model\CampaignsTriggerScheduleDeletePostBody $requestBody = null, array $headerParameters = []) { $this->body = $requestBody; $this->headerParameters = $headerParameters; @@ -90,7 +90,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PostCampaignsTriggerScheduleDeleteTooManyRequestsException * @throws \Braze\Exception\PostCampaignsTriggerScheduleDeleteInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PostCampaignsTriggerScheduleUpdate.php b/lib/Endpoint/PostCampaignsTriggerScheduleUpdate.php index 921cf3c..298ded0 100644 --- a/lib/Endpoint/PostCampaignsTriggerScheduleUpdate.php +++ b/lib/Endpoint/PostCampaignsTriggerScheduleUpdate.php @@ -43,7 +43,7 @@ class PostCampaignsTriggerScheduleUpdate extends \Braze\Runtime\Client\BaseEndpo * @var string $Authorization * } */ - public function __construct(\Braze\Model\CampaignsTriggerScheduleUpdatePostBody $requestBody = null, array $headerParameters = []) + public function __construct(?\Braze\Model\CampaignsTriggerScheduleUpdatePostBody $requestBody = null, array $headerParameters = []) { $this->body = $requestBody; $this->headerParameters = $headerParameters; @@ -95,7 +95,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PostCampaignsTriggerScheduleUpdateTooManyRequestsException * @throws \Braze\Exception\PostCampaignsTriggerScheduleUpdateInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PostCampaignsTriggerSend.php b/lib/Endpoint/PostCampaignsTriggerSend.php index d6d573e..0cb7fed 100644 --- a/lib/Endpoint/PostCampaignsTriggerSend.php +++ b/lib/Endpoint/PostCampaignsTriggerSend.php @@ -70,7 +70,7 @@ class PostCampaignsTriggerSend extends \Braze\Runtime\Client\BaseEndpoint implem * @var string $Authorization * } */ - public function __construct(\Braze\Model\CampaignsTriggerSendPostBody $requestBody = null, array $headerParameters = []) + public function __construct(?\Braze\Model\CampaignsTriggerSendPostBody $requestBody = null, array $headerParameters = []) { $this->body = $requestBody; $this->headerParameters = $headerParameters; @@ -122,7 +122,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PostCampaignsTriggerSendTooManyRequestsException * @throws \Braze\Exception\PostCampaignsTriggerSendInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PostCanvasTriggerScheduleCreate.php b/lib/Endpoint/PostCanvasTriggerScheduleCreate.php index e58dd44..aa47272 100644 --- a/lib/Endpoint/PostCanvasTriggerScheduleCreate.php +++ b/lib/Endpoint/PostCanvasTriggerScheduleCreate.php @@ -52,7 +52,7 @@ class PostCanvasTriggerScheduleCreate extends \Braze\Runtime\Client\BaseEndpoint * @var string $Authorization * } */ - public function __construct(\Braze\Model\CanvasTriggerScheduleCreatePostBody $requestBody = null, array $headerParameters = []) + public function __construct(?\Braze\Model\CanvasTriggerScheduleCreatePostBody $requestBody = null, array $headerParameters = []) { $this->body = $requestBody; $this->headerParameters = $headerParameters; @@ -104,7 +104,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PostCanvasTriggerScheduleCreateTooManyRequestsException * @throws \Braze\Exception\PostCanvasTriggerScheduleCreateInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PostCanvasTriggerScheduleDelete.php b/lib/Endpoint/PostCanvasTriggerScheduleDelete.php index 17dfb9a..4b7a105 100644 --- a/lib/Endpoint/PostCanvasTriggerScheduleDelete.php +++ b/lib/Endpoint/PostCanvasTriggerScheduleDelete.php @@ -36,7 +36,7 @@ class PostCanvasTriggerScheduleDelete extends \Braze\Runtime\Client\BaseEndpoint * @var string $Authorization * } */ - public function __construct(\Braze\Model\CanvasTriggerScheduleDeletePostBody $requestBody = null, array $headerParameters = []) + public function __construct(?\Braze\Model\CanvasTriggerScheduleDeletePostBody $requestBody = null, array $headerParameters = []) { $this->body = $requestBody; $this->headerParameters = $headerParameters; @@ -88,7 +88,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PostCanvasTriggerScheduleDeleteTooManyRequestsException * @throws \Braze\Exception\PostCanvasTriggerScheduleDeleteInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PostCanvasTriggerScheduleUpdate.php b/lib/Endpoint/PostCanvasTriggerScheduleUpdate.php index 9fb36f7..fa8b5fe 100644 --- a/lib/Endpoint/PostCanvasTriggerScheduleUpdate.php +++ b/lib/Endpoint/PostCanvasTriggerScheduleUpdate.php @@ -43,7 +43,7 @@ class PostCanvasTriggerScheduleUpdate extends \Braze\Runtime\Client\BaseEndpoint * @var string $Authorization * } */ - public function __construct(\Braze\Model\CanvasTriggerScheduleUpdatePostBody $requestBody = null, array $headerParameters = []) + public function __construct(?\Braze\Model\CanvasTriggerScheduleUpdatePostBody $requestBody = null, array $headerParameters = []) { $this->body = $requestBody; $this->headerParameters = $headerParameters; @@ -95,7 +95,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PostCanvasTriggerScheduleUpdateTooManyRequestsException * @throws \Braze\Exception\PostCanvasTriggerScheduleUpdateInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PostCanvasTriggerSend.php b/lib/Endpoint/PostCanvasTriggerSend.php index 00a19f4..8f249a4 100644 --- a/lib/Endpoint/PostCanvasTriggerSend.php +++ b/lib/Endpoint/PostCanvasTriggerSend.php @@ -67,7 +67,7 @@ class PostCanvasTriggerSend extends \Braze\Runtime\Client\BaseEndpoint implement * @var string $Authorization * } */ - public function __construct(\Braze\Model\CanvasTriggerSendPostBody $requestBody = null, array $headerParameters = []) + public function __construct(?\Braze\Model\CanvasTriggerSendPostBody $requestBody = null, array $headerParameters = []) { $this->body = $requestBody; $this->headerParameters = $headerParameters; @@ -119,7 +119,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PostCanvasTriggerSendTooManyRequestsException * @throws \Braze\Exception\PostCanvasTriggerSendInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PostCatalog.php b/lib/Endpoint/PostCatalog.php index 7d35d59..e8634a6 100644 --- a/lib/Endpoint/PostCatalog.php +++ b/lib/Endpoint/PostCatalog.php @@ -187,7 +187,7 @@ class PostCatalog extends \Braze\Runtime\Client\BaseEndpoint implements \Braze\R * @var string $Authorization * } */ - public function __construct(\Braze\Model\CatalogsPostBody $requestBody = null, array $headerParameters = []) + public function __construct(?\Braze\Model\CatalogsPostBody $requestBody = null, array $headerParameters = []) { $this->body = $requestBody; $this->headerParameters = $headerParameters; @@ -239,7 +239,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PostCatalogTooManyRequestsException * @throws \Braze\Exception\PostCatalogInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PostCatalogsByCatalogNameItem.php b/lib/Endpoint/PostCatalogsByCatalogNameItem.php index 4795511..a4e6ffa 100644 --- a/lib/Endpoint/PostCatalogsByCatalogNameItem.php +++ b/lib/Endpoint/PostCatalogsByCatalogNameItem.php @@ -142,7 +142,7 @@ class PostCatalogsByCatalogNameItem extends \Braze\Runtime\Client\BaseEndpoint i * @var string $Authorization * } */ - public function __construct(string $catalogName, \Braze\Model\CatalogsCatalogNameItemsPostBody $requestBody = null, array $headerParameters = []) + public function __construct(string $catalogName, ?\Braze\Model\CatalogsCatalogNameItemsPostBody $requestBody = null, array $headerParameters = []) { $this->catalog_name = $catalogName; $this->body = $requestBody; @@ -195,7 +195,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PostCatalogsByCatalogNameItemTooManyRequestsException * @throws \Braze\Exception\PostCatalogsByCatalogNameItemInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PostCatalogsByCatalogNameItemByItemId.php b/lib/Endpoint/PostCatalogsByCatalogNameItemByItemId.php index 5080f76..73dc3ba 100644 --- a/lib/Endpoint/PostCatalogsByCatalogNameItemByItemId.php +++ b/lib/Endpoint/PostCatalogsByCatalogNameItemByItemId.php @@ -126,7 +126,7 @@ class PostCatalogsByCatalogNameItemByItemId extends \Braze\Runtime\Client\BaseEn * @var string $Authorization * } */ - public function __construct(string $catalogName, string $itemId, \Braze\Model\CatalogsCatalogNameItemsItemIdPostBody $requestBody = null, array $headerParameters = []) + public function __construct(string $catalogName, string $itemId, ?\Braze\Model\CatalogsCatalogNameItemsItemIdPostBody $requestBody = null, array $headerParameters = []) { $this->catalog_name = $catalogName; $this->item_id = $itemId; @@ -180,7 +180,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PostCatalogsByCatalogNameItemByItemIdTooManyRequestsException * @throws \Braze\Exception\PostCatalogsByCatalogNameItemByItemIdInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PostContentBlocksCreate.php b/lib/Endpoint/PostContentBlocksCreate.php index 347eccd..36fc4ae 100644 --- a/lib/Endpoint/PostContentBlocksCreate.php +++ b/lib/Endpoint/PostContentBlocksCreate.php @@ -76,7 +76,7 @@ class PostContentBlocksCreate extends \Braze\Runtime\Client\BaseEndpoint impleme * @var string $Authorization * } */ - public function __construct(\Braze\Model\ContentBlocksCreatePostBody $requestBody = null, array $headerParameters = []) + public function __construct(?\Braze\Model\ContentBlocksCreatePostBody $requestBody = null, array $headerParameters = []) { $this->body = $requestBody; $this->headerParameters = $headerParameters; @@ -128,7 +128,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PostContentBlocksCreateTooManyRequestsException * @throws \Braze\Exception\PostContentBlocksCreateInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PostContentBlocksUpdate.php b/lib/Endpoint/PostContentBlocksUpdate.php index dcd808e..e5db53d 100644 --- a/lib/Endpoint/PostContentBlocksUpdate.php +++ b/lib/Endpoint/PostContentBlocksUpdate.php @@ -79,7 +79,7 @@ class PostContentBlocksUpdate extends \Braze\Runtime\Client\BaseEndpoint impleme * @var string $Authorization * } */ - public function __construct(\Braze\Model\ContentBlocksUpdatePostBody $requestBody = null, array $headerParameters = []) + public function __construct(?\Braze\Model\ContentBlocksUpdatePostBody $requestBody = null, array $headerParameters = []) { $this->body = $requestBody; $this->headerParameters = $headerParameters; @@ -131,7 +131,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PostContentBlocksUpdateTooManyRequestsException * @throws \Braze\Exception\PostContentBlocksUpdateInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PostEmailBlacklist.php b/lib/Endpoint/PostEmailBlacklist.php index 9755aef..83b5e4a 100644 --- a/lib/Endpoint/PostEmailBlacklist.php +++ b/lib/Endpoint/PostEmailBlacklist.php @@ -35,7 +35,7 @@ class PostEmailBlacklist extends \Braze\Runtime\Client\BaseEndpoint implements \ * @var string $Authorization * } */ - public function __construct(\Braze\Model\EmailBlacklistPostBody $requestBody = null, array $headerParameters = []) + public function __construct(?\Braze\Model\EmailBlacklistPostBody $requestBody = null, array $headerParameters = []) { $this->body = $requestBody; $this->headerParameters = $headerParameters; @@ -87,7 +87,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PostEmailBlacklistTooManyRequestsException * @throws \Braze\Exception\PostEmailBlacklistInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PostEmailBlocklist.php b/lib/Endpoint/PostEmailBlocklist.php index c1beea4..a279fe9 100644 --- a/lib/Endpoint/PostEmailBlocklist.php +++ b/lib/Endpoint/PostEmailBlocklist.php @@ -35,7 +35,7 @@ class PostEmailBlocklist extends \Braze\Runtime\Client\BaseEndpoint implements \ * @var string $Authorization * } */ - public function __construct(\Braze\Model\EmailBlocklistPostBody $requestBody = null, array $headerParameters = []) + public function __construct(?\Braze\Model\EmailBlocklistPostBody $requestBody = null, array $headerParameters = []) { $this->body = $requestBody; $this->headerParameters = $headerParameters; @@ -87,7 +87,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PostEmailBlocklistTooManyRequestsException * @throws \Braze\Exception\PostEmailBlocklistInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PostEmailBounceRemove.php b/lib/Endpoint/PostEmailBounceRemove.php index 18458c2..619d427 100644 --- a/lib/Endpoint/PostEmailBounceRemove.php +++ b/lib/Endpoint/PostEmailBounceRemove.php @@ -37,7 +37,7 @@ class PostEmailBounceRemove extends \Braze\Runtime\Client\BaseEndpoint implement * @var string $Authorization * } */ - public function __construct(\Braze\Model\EmailBounceRemovePostBody $requestBody = null, array $headerParameters = []) + public function __construct(?\Braze\Model\EmailBounceRemovePostBody $requestBody = null, array $headerParameters = []) { $this->body = $requestBody; $this->headerParameters = $headerParameters; @@ -89,7 +89,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PostEmailBounceRemoveTooManyRequestsException * @throws \Braze\Exception\PostEmailBounceRemoveInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PostEmailSpamRemove.php b/lib/Endpoint/PostEmailSpamRemove.php index 74a071a..2e0c703 100644 --- a/lib/Endpoint/PostEmailSpamRemove.php +++ b/lib/Endpoint/PostEmailSpamRemove.php @@ -37,7 +37,7 @@ class PostEmailSpamRemove extends \Braze\Runtime\Client\BaseEndpoint implements * @var string $Authorization * } */ - public function __construct(\Braze\Model\EmailSpamRemovePostBody $requestBody = null, array $headerParameters = []) + public function __construct(?\Braze\Model\EmailSpamRemovePostBody $requestBody = null, array $headerParameters = []) { $this->body = $requestBody; $this->headerParameters = $headerParameters; @@ -89,7 +89,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PostEmailSpamRemoveTooManyRequestsException * @throws \Braze\Exception\PostEmailSpamRemoveInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PostEmailStatus.php b/lib/Endpoint/PostEmailStatus.php index d18dc7d..f958cef 100644 --- a/lib/Endpoint/PostEmailStatus.php +++ b/lib/Endpoint/PostEmailStatus.php @@ -38,7 +38,7 @@ class PostEmailStatus extends \Braze\Runtime\Client\BaseEndpoint implements \Bra * @var string $Authorization * } */ - public function __construct(\Braze\Model\EmailStatusPostBody $requestBody = null, array $headerParameters = []) + public function __construct(?\Braze\Model\EmailStatusPostBody $requestBody = null, array $headerParameters = []) { $this->body = $requestBody; $this->headerParameters = $headerParameters; @@ -90,7 +90,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PostEmailStatusTooManyRequestsException * @throws \Braze\Exception\PostEmailStatusInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PostMessagesLiveActivityUpdate.php b/lib/Endpoint/PostMessagesLiveActivityUpdate.php index 80f5f5d..3f7f7a5 100644 --- a/lib/Endpoint/PostMessagesLiveActivityUpdate.php +++ b/lib/Endpoint/PostMessagesLiveActivityUpdate.php @@ -76,7 +76,7 @@ class PostMessagesLiveActivityUpdate extends \Braze\Runtime\Client\BaseEndpoint * @var string $Authorization * } */ - public function __construct(\Braze\Model\MessagesLiveActivityUpdatePostBody $requestBody = null, array $headerParameters = []) + public function __construct(?\Braze\Model\MessagesLiveActivityUpdatePostBody $requestBody = null, array $headerParameters = []) { $this->body = $requestBody; $this->headerParameters = $headerParameters; @@ -128,7 +128,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PostMessagesLiveActivityUpdateTooManyRequestsException * @throws \Braze\Exception\PostMessagesLiveActivityUpdateInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PostMessagesScheduleCreate.php b/lib/Endpoint/PostMessagesScheduleCreate.php index 0f0e611..c301484 100644 --- a/lib/Endpoint/PostMessagesScheduleCreate.php +++ b/lib/Endpoint/PostMessagesScheduleCreate.php @@ -62,7 +62,7 @@ class PostMessagesScheduleCreate extends \Braze\Runtime\Client\BaseEndpoint impl * * ``` */ - public function __construct(\Braze\Model\MessagesScheduleCreatePostBody $requestBody = null) + public function __construct(?\Braze\Model\MessagesScheduleCreatePostBody $requestBody = null) { $this->body = $requestBody; } @@ -101,7 +101,7 @@ public function getExtraHeaders(): array * @throws \Braze\Exception\PostMessagesScheduleCreateTooManyRequestsException * @throws \Braze\Exception\PostMessagesScheduleCreateInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PostMessagesScheduleDelete.php b/lib/Endpoint/PostMessagesScheduleDelete.php index 4ecc3f7..1019e1b 100644 --- a/lib/Endpoint/PostMessagesScheduleDelete.php +++ b/lib/Endpoint/PostMessagesScheduleDelete.php @@ -35,7 +35,7 @@ class PostMessagesScheduleDelete extends \Braze\Runtime\Client\BaseEndpoint impl * @var string $Authorization * } */ - public function __construct(\Braze\Model\MessagesScheduleDeletePostBody $requestBody = null, array $headerParameters = []) + public function __construct(?\Braze\Model\MessagesScheduleDeletePostBody $requestBody = null, array $headerParameters = []) { $this->body = $requestBody; $this->headerParameters = $headerParameters; @@ -87,7 +87,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PostMessagesScheduleDeleteTooManyRequestsException * @throws \Braze\Exception\PostMessagesScheduleDeleteInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PostMessagesScheduleUpdate.php b/lib/Endpoint/PostMessagesScheduleUpdate.php index a61ab69..d061d6a 100644 --- a/lib/Endpoint/PostMessagesScheduleUpdate.php +++ b/lib/Endpoint/PostMessagesScheduleUpdate.php @@ -39,7 +39,7 @@ class PostMessagesScheduleUpdate extends \Braze\Runtime\Client\BaseEndpoint impl * @var string $Authorization * } */ - public function __construct(\Braze\Model\MessagesScheduleUpdatePostBody $requestBody = null, array $headerParameters = []) + public function __construct(?\Braze\Model\MessagesScheduleUpdatePostBody $requestBody = null, array $headerParameters = []) { $this->body = $requestBody; $this->headerParameters = $headerParameters; @@ -91,7 +91,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PostMessagesScheduleUpdateTooManyRequestsException * @throws \Braze\Exception\PostMessagesScheduleUpdateInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PostMessagesSend.php b/lib/Endpoint/PostMessagesSend.php index 5997817..8b0fbd8 100644 --- a/lib/Endpoint/PostMessagesSend.php +++ b/lib/Endpoint/PostMessagesSend.php @@ -59,7 +59,7 @@ class PostMessagesSend extends \Braze\Runtime\Client\BaseEndpoint implements \Br * @var string $Authorization * } */ - public function __construct(\Braze\Model\MessagesSendPostBody $requestBody = null, array $headerParameters = []) + public function __construct(?\Braze\Model\MessagesSendPostBody $requestBody = null, array $headerParameters = []) { $this->body = $requestBody; $this->headerParameters = $headerParameters; @@ -111,7 +111,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PostMessagesSendTooManyRequestsException * @throws \Braze\Exception\PostMessagesSendInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PostPreferenceCenterV1.php b/lib/Endpoint/PostPreferenceCenterV1.php index 12cb553..6da60e6 100644 --- a/lib/Endpoint/PostPreferenceCenterV1.php +++ b/lib/Endpoint/PostPreferenceCenterV1.php @@ -76,7 +76,7 @@ class PostPreferenceCenterV1 extends \Braze\Runtime\Client\BaseEndpoint implemen * @var string $Authorization * } */ - public function __construct(\Braze\Model\PreferenceCenterV1PostBody $requestBody = null, array $headerParameters = []) + public function __construct(?\Braze\Model\PreferenceCenterV1PostBody $requestBody = null, array $headerParameters = []) { $this->body = $requestBody; $this->headerParameters = $headerParameters; @@ -128,7 +128,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PostPreferenceCenterV1TooManyRequestsException * @throws \Braze\Exception\PostPreferenceCenterV1InternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PostScimV2User.php b/lib/Endpoint/PostScimV2User.php index 60824d9..a514869 100644 --- a/lib/Endpoint/PostScimV2User.php +++ b/lib/Endpoint/PostScimV2User.php @@ -90,7 +90,7 @@ class PostScimV2User extends \Braze\Runtime\Client\BaseEndpoint implements \Braz * @var string $Authorization * } */ - public function __construct(\Braze\Model\ScimV2UsersPostBody $requestBody = null, array $headerParameters = []) + public function __construct(?\Braze\Model\ScimV2UsersPostBody $requestBody = null, array $headerParameters = []) { $this->body = $requestBody; $this->headerParameters = $headerParameters; @@ -143,7 +143,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PostScimV2UserTooManyRequestsException * @throws \Braze\Exception\PostScimV2UserInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PostSendsIdCreate.php b/lib/Endpoint/PostSendsIdCreate.php index 75cfbcc..f2dc2f8 100644 --- a/lib/Endpoint/PostSendsIdCreate.php +++ b/lib/Endpoint/PostSendsIdCreate.php @@ -52,7 +52,7 @@ class PostSendsIdCreate extends \Braze\Runtime\Client\BaseEndpoint implements \B * @var string $Authorization * } */ - public function __construct(\Braze\Model\SendsIdCreatePostBody $requestBody = null, array $headerParameters = []) + public function __construct(?\Braze\Model\SendsIdCreatePostBody $requestBody = null, array $headerParameters = []) { $this->body = $requestBody; $this->headerParameters = $headerParameters; @@ -104,7 +104,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PostSendsIdCreateTooManyRequestsException * @throws \Braze\Exception\PostSendsIdCreateInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PostSmsInvalidPhoneNumbersRemove.php b/lib/Endpoint/PostSmsInvalidPhoneNumbersRemove.php index 8830f85..4b545c8 100644 --- a/lib/Endpoint/PostSmsInvalidPhoneNumbersRemove.php +++ b/lib/Endpoint/PostSmsInvalidPhoneNumbersRemove.php @@ -37,7 +37,7 @@ class PostSmsInvalidPhoneNumbersRemove extends \Braze\Runtime\Client\BaseEndpoin * @var string $Content-Type * } */ - public function __construct(\Braze\Model\SmsInvalidPhoneNumbersRemovePostBody $requestBody = null, array $headerParameters = []) + public function __construct(?\Braze\Model\SmsInvalidPhoneNumbersRemovePostBody $requestBody = null, array $headerParameters = []) { $this->body = $requestBody; $this->headerParameters = $headerParameters; @@ -89,7 +89,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PostSmsInvalidPhoneNumbersRemoveTooManyRequestsException * @throws \Braze\Exception\PostSmsInvalidPhoneNumbersRemoveInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PostSubscriptionStatusSet.php b/lib/Endpoint/PostSubscriptionStatusSet.php index 31d6ff5..6be72cb 100644 --- a/lib/Endpoint/PostSubscriptionStatusSet.php +++ b/lib/Endpoint/PostSubscriptionStatusSet.php @@ -57,7 +57,7 @@ class PostSubscriptionStatusSet extends \Braze\Runtime\Client\BaseEndpoint imple * @var string $Authorization * } */ - public function __construct(\Braze\Model\SubscriptionStatusSetPostBody $requestBody = null, array $headerParameters = []) + public function __construct(?\Braze\Model\SubscriptionStatusSetPostBody $requestBody = null, array $headerParameters = []) { $this->body = $requestBody; $this->headerParameters = $headerParameters; @@ -109,7 +109,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PostSubscriptionStatusSetTooManyRequestsException * @throws \Braze\Exception\PostSubscriptionStatusSetInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PostTemplatesEmailCreate.php b/lib/Endpoint/PostTemplatesEmailCreate.php index 678dd4c..925be06 100644 --- a/lib/Endpoint/PostTemplatesEmailCreate.php +++ b/lib/Endpoint/PostTemplatesEmailCreate.php @@ -58,7 +58,7 @@ class PostTemplatesEmailCreate extends \Braze\Runtime\Client\BaseEndpoint implem * @var string $Authorization * } */ - public function __construct(\Braze\Model\TemplatesEmailCreatePostBody $requestBody = null, array $headerParameters = []) + public function __construct(?\Braze\Model\TemplatesEmailCreatePostBody $requestBody = null, array $headerParameters = []) { $this->body = $requestBody; $this->headerParameters = $headerParameters; @@ -110,7 +110,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PostTemplatesEmailCreateTooManyRequestsException * @throws \Braze\Exception\PostTemplatesEmailCreateInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PostTemplatesEmailUpdate.php b/lib/Endpoint/PostTemplatesEmailUpdate.php index 8f2b29e..005d3a6 100644 --- a/lib/Endpoint/PostTemplatesEmailUpdate.php +++ b/lib/Endpoint/PostTemplatesEmailUpdate.php @@ -58,7 +58,7 @@ class PostTemplatesEmailUpdate extends \Braze\Runtime\Client\BaseEndpoint implem * @var string $Authorization * } */ - public function __construct(\Braze\Model\TemplatesEmailUpdatePostBody $requestBody = null, array $headerParameters = []) + public function __construct(?\Braze\Model\TemplatesEmailUpdatePostBody $requestBody = null, array $headerParameters = []) { $this->body = $requestBody; $this->headerParameters = $headerParameters; @@ -110,7 +110,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PostTemplatesEmailUpdateTooManyRequestsException * @throws \Braze\Exception\PostTemplatesEmailUpdateInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PostTransactionalV1CampaignsByCampaignIdSend.php b/lib/Endpoint/PostTransactionalV1CampaignsByCampaignIdSend.php index c791ac1..f552cb7 100644 --- a/lib/Endpoint/PostTransactionalV1CampaignsByCampaignIdSend.php +++ b/lib/Endpoint/PostTransactionalV1CampaignsByCampaignIdSend.php @@ -226,7 +226,7 @@ class PostTransactionalV1CampaignsByCampaignIdSend extends \Braze\Runtime\Client * @var string $Authorization * } */ - public function __construct(string $campaignId, \Braze\Model\TransactionalV1CampaignsCampaignIdSendPostBody $requestBody = null, array $headerParameters = []) + public function __construct(string $campaignId, ?\Braze\Model\TransactionalV1CampaignsCampaignIdSendPostBody $requestBody = null, array $headerParameters = []) { $this->campaign_id = $campaignId; $this->body = $requestBody; @@ -279,7 +279,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PostTransactionalV1CampaignsByCampaignIdSendTooManyRequestsException * @throws \Braze\Exception\PostTransactionalV1CampaignsByCampaignIdSendInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PostUsersAliasNew.php b/lib/Endpoint/PostUsersAliasNew.php index 3c6478e..4fa744d 100644 --- a/lib/Endpoint/PostUsersAliasNew.php +++ b/lib/Endpoint/PostUsersAliasNew.php @@ -41,7 +41,7 @@ class PostUsersAliasNew extends \Braze\Runtime\Client\BaseEndpoint implements \B * @var string $Authorization * } */ - public function __construct(\Braze\Model\UsersAliasNewPostBody $requestBody = null, array $headerParameters = []) + public function __construct(?\Braze\Model\UsersAliasNewPostBody $requestBody = null, array $headerParameters = []) { $this->body = $requestBody; $this->headerParameters = $headerParameters; @@ -93,7 +93,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PostUsersAliasNewTooManyRequestsException * @throws \Braze\Exception\PostUsersAliasNewInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PostUsersAliasUpdate.php b/lib/Endpoint/PostUsersAliasUpdate.php index 27e49cb..5de5574 100644 --- a/lib/Endpoint/PostUsersAliasUpdate.php +++ b/lib/Endpoint/PostUsersAliasUpdate.php @@ -52,7 +52,7 @@ class PostUsersAliasUpdate extends \Braze\Runtime\Client\BaseEndpoint implements * @var string $Authorization * } */ - public function __construct(\Braze\Model\UsersAliasUpdatePostBody $requestBody = null, array $headerParameters = []) + public function __construct(?\Braze\Model\UsersAliasUpdatePostBody $requestBody = null, array $headerParameters = []) { $this->body = $requestBody; $this->headerParameters = $headerParameters; @@ -104,7 +104,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PostUsersAliasUpdateTooManyRequestsException * @throws \Braze\Exception\PostUsersAliasUpdateInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PostUsersDelete.php b/lib/Endpoint/PostUsersDelete.php index 3853a67..6c37d8b 100644 --- a/lib/Endpoint/PostUsersDelete.php +++ b/lib/Endpoint/PostUsersDelete.php @@ -42,7 +42,7 @@ class PostUsersDelete extends \Braze\Runtime\Client\BaseEndpoint implements \Bra * @var string $Authorization * } */ - public function __construct(\Braze\Model\UsersDeletePostBody $requestBody = null, array $headerParameters = []) + public function __construct(?\Braze\Model\UsersDeletePostBody $requestBody = null, array $headerParameters = []) { $this->body = $requestBody; $this->headerParameters = $headerParameters; @@ -94,7 +94,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PostUsersDeleteTooManyRequestsException * @throws \Braze\Exception\PostUsersDeleteInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PostUsersExportGlobalControlGroup.php b/lib/Endpoint/PostUsersExportGlobalControlGroup.php index b60a06f..cba836f 100644 --- a/lib/Endpoint/PostUsersExportGlobalControlGroup.php +++ b/lib/Endpoint/PostUsersExportGlobalControlGroup.php @@ -252,7 +252,7 @@ class PostUsersExportGlobalControlGroup extends \Braze\Runtime\Client\BaseEndpoi * @var string $Authorization * } */ - public function __construct(\Braze\Model\UsersExportGlobalControlGroupPostBody $requestBody = null, array $headerParameters = []) + public function __construct(?\Braze\Model\UsersExportGlobalControlGroupPostBody $requestBody = null, array $headerParameters = []) { $this->body = $requestBody; $this->headerParameters = $headerParameters; @@ -304,7 +304,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PostUsersExportGlobalControlGroupTooManyRequestsException * @throws \Braze\Exception\PostUsersExportGlobalControlGroupInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PostUsersExportId.php b/lib/Endpoint/PostUsersExportId.php index 58857a1..e09fe43 100644 --- a/lib/Endpoint/PostUsersExportId.php +++ b/lib/Endpoint/PostUsersExportId.php @@ -374,7 +374,7 @@ class PostUsersExportId extends \Braze\Runtime\Client\BaseEndpoint implements \B * @var string $Authorization * } */ - public function __construct(\Braze\Model\UsersExportIdsPostBody $requestBody = null, array $headerParameters = []) + public function __construct(?\Braze\Model\UsersExportIdsPostBody $requestBody = null, array $headerParameters = []) { $this->body = $requestBody; $this->headerParameters = $headerParameters; @@ -426,7 +426,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PostUsersExportIdTooManyRequestsException * @throws \Braze\Exception\PostUsersExportIdInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PostUsersExportSegment.php b/lib/Endpoint/PostUsersExportSegment.php index a0b9c4f..07201a2 100644 --- a/lib/Endpoint/PostUsersExportSegment.php +++ b/lib/Endpoint/PostUsersExportSegment.php @@ -396,7 +396,7 @@ class PostUsersExportSegment extends \Braze\Runtime\Client\BaseEndpoint implemen * @var string $Authorization * } */ - public function __construct(\Braze\Model\UsersExportSegmentPostBody $requestBody = null, array $headerParameters = []) + public function __construct(?\Braze\Model\UsersExportSegmentPostBody $requestBody = null, array $headerParameters = []) { $this->body = $requestBody; $this->headerParameters = $headerParameters; @@ -448,7 +448,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PostUsersExportSegmentTooManyRequestsException * @throws \Braze\Exception\PostUsersExportSegmentInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PostUsersExternalIdsRemove.php b/lib/Endpoint/PostUsersExternalIdsRemove.php index 1589fbb..e1a6fa8 100644 --- a/lib/Endpoint/PostUsersExternalIdsRemove.php +++ b/lib/Endpoint/PostUsersExternalIdsRemove.php @@ -63,7 +63,7 @@ class PostUsersExternalIdsRemove extends \Braze\Runtime\Client\BaseEndpoint impl * @var string $Authorization * } */ - public function __construct(\Braze\Model\UsersExternalIdsRemovePostBody $requestBody = null, array $headerParameters = []) + public function __construct(?\Braze\Model\UsersExternalIdsRemovePostBody $requestBody = null, array $headerParameters = []) { $this->body = $requestBody; $this->headerParameters = $headerParameters; @@ -115,7 +115,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PostUsersExternalIdsRemoveTooManyRequestsException * @throws \Braze\Exception\PostUsersExternalIdsRemoveInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PostUsersExternalIdsRename.php b/lib/Endpoint/PostUsersExternalIdsRename.php index 0a6e306..95c8bbd 100644 --- a/lib/Endpoint/PostUsersExternalIdsRename.php +++ b/lib/Endpoint/PostUsersExternalIdsRename.php @@ -87,7 +87,7 @@ class PostUsersExternalIdsRename extends \Braze\Runtime\Client\BaseEndpoint impl * @var string $Authorization * } */ - public function __construct(\Braze\Model\UsersExternalIdsRenamePostBody $requestBody = null, array $headerParameters = []) + public function __construct(?\Braze\Model\UsersExternalIdsRenamePostBody $requestBody = null, array $headerParameters = []) { $this->body = $requestBody; $this->headerParameters = $headerParameters; @@ -139,7 +139,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PostUsersExternalIdsRenameTooManyRequestsException * @throws \Braze\Exception\PostUsersExternalIdsRenameInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PostUsersIdentify.php b/lib/Endpoint/PostUsersIdentify.php index 274f55a..ad4bba1 100644 --- a/lib/Endpoint/PostUsersIdentify.php +++ b/lib/Endpoint/PostUsersIdentify.php @@ -108,7 +108,7 @@ class PostUsersIdentify extends \Braze\Runtime\Client\BaseEndpoint implements \B * @var string $Authorization * } */ - public function __construct(\Braze\Model\UsersIdentifyPostBody $requestBody = null, array $headerParameters = []) + public function __construct(?\Braze\Model\UsersIdentifyPostBody $requestBody = null, array $headerParameters = []) { $this->body = $requestBody; $this->headerParameters = $headerParameters; @@ -160,7 +160,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PostUsersIdentifyTooManyRequestsException * @throws \Braze\Exception\PostUsersIdentifyInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PostUsersMerge.php b/lib/Endpoint/PostUsersMerge.php index fcea91a..2ce959a 100644 --- a/lib/Endpoint/PostUsersMerge.php +++ b/lib/Endpoint/PostUsersMerge.php @@ -153,7 +153,7 @@ class PostUsersMerge extends \Braze\Runtime\Client\BaseEndpoint implements \Braz * @var string $Authorization * } */ - public function __construct(\Braze\Model\UsersMergePostBody $requestBody = null, array $headerParameters = []) + public function __construct(?\Braze\Model\UsersMergePostBody $requestBody = null, array $headerParameters = []) { $this->body = $requestBody; $this->headerParameters = $headerParameters; @@ -205,7 +205,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PostUsersMergeTooManyRequestsException * @throws \Braze\Exception\PostUsersMergeInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PostUsersTrack.php b/lib/Endpoint/PostUsersTrack.php index bfdc468..b1d13c7 100644 --- a/lib/Endpoint/PostUsersTrack.php +++ b/lib/Endpoint/PostUsersTrack.php @@ -135,7 +135,7 @@ class PostUsersTrack extends \Braze\Runtime\Client\BaseEndpoint implements \Braz * @var string $Authorization * } */ - public function __construct(\Braze\Model\UsersTrackPostBody $requestBody = null, array $headerParameters = []) + public function __construct(?\Braze\Model\UsersTrackPostBody $requestBody = null, array $headerParameters = []) { $this->body = $requestBody; $this->headerParameters = $headerParameters; @@ -187,7 +187,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PostUsersTrackTooManyRequestsException * @throws \Braze\Exception\PostUsersTrackInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PostV2SubscriptionStatusSet.php b/lib/Endpoint/PostV2SubscriptionStatusSet.php index b67000f..e959d4e 100644 --- a/lib/Endpoint/PostV2SubscriptionStatusSet.php +++ b/lib/Endpoint/PostV2SubscriptionStatusSet.php @@ -51,7 +51,7 @@ class PostV2SubscriptionStatusSet extends \Braze\Runtime\Client\BaseEndpoint imp * @var string $Authorization * } */ - public function __construct(\Braze\Model\V2SubscriptionStatusSetPostBody $requestBody = null, array $headerParameters = []) + public function __construct(?\Braze\Model\V2SubscriptionStatusSetPostBody $requestBody = null, array $headerParameters = []) { $this->body = $requestBody; $this->headerParameters = $headerParameters; @@ -103,7 +103,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PostV2SubscriptionStatusSetTooManyRequestsException * @throws \Braze\Exception\PostV2SubscriptionStatusSetInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PutCatalogsByCatalogNameItem.php b/lib/Endpoint/PutCatalogsByCatalogNameItem.php index c8f645c..dd5e0ca 100644 --- a/lib/Endpoint/PutCatalogsByCatalogNameItem.php +++ b/lib/Endpoint/PutCatalogsByCatalogNameItem.php @@ -107,7 +107,7 @@ class PutCatalogsByCatalogNameItem extends \Braze\Runtime\Client\BaseEndpoint im * @var string $Authorization * } */ - public function __construct(string $catalogName, \Braze\Model\CatalogsCatalogNameItemsPutBody $requestBody = null, array $headerParameters = []) + public function __construct(string $catalogName, ?\Braze\Model\CatalogsCatalogNameItemsPutBody $requestBody = null, array $headerParameters = []) { $this->catalog_name = $catalogName; $this->body = $requestBody; @@ -160,7 +160,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PutCatalogsByCatalogNameItemTooManyRequestsException * @throws \Braze\Exception\PutCatalogsByCatalogNameItemInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PutCatalogsByCatalogNameItemByItemId.php b/lib/Endpoint/PutCatalogsByCatalogNameItemByItemId.php index cf811f7..52f60cb 100644 --- a/lib/Endpoint/PutCatalogsByCatalogNameItemByItemId.php +++ b/lib/Endpoint/PutCatalogsByCatalogNameItemByItemId.php @@ -129,7 +129,7 @@ class PutCatalogsByCatalogNameItemByItemId extends \Braze\Runtime\Client\BaseEnd * @var string $Authorization * } */ - public function __construct(string $catalogName, string $itemId, \Braze\Model\CatalogsCatalogNameItemsItemIdPutBody $requestBody = null, array $headerParameters = []) + public function __construct(string $catalogName, string $itemId, ?\Braze\Model\CatalogsCatalogNameItemsItemIdPutBody $requestBody = null, array $headerParameters = []) { $this->catalog_name = $catalogName; $this->item_id = $itemId; @@ -183,7 +183,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PutCatalogsByCatalogNameItemByItemIdTooManyRequestsException * @throws \Braze\Exception\PutCatalogsByCatalogNameItemByItemIdInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PutPreferenceCenterV1ByPreferenceCenterExternalID.php b/lib/Endpoint/PutPreferenceCenterV1ByPreferenceCenterExternalID.php index 5e7f6b3..fe93b9e 100644 --- a/lib/Endpoint/PutPreferenceCenterV1ByPreferenceCenterExternalID.php +++ b/lib/Endpoint/PutPreferenceCenterV1ByPreferenceCenterExternalID.php @@ -75,7 +75,7 @@ class PutPreferenceCenterV1ByPreferenceCenterExternalID extends \Braze\Runtime\C * @var string * } */ - public function __construct(string $preferenceCenterExternalID, \Braze\Model\PreferenceCenterV1PreferenceCenterExternalIDPutBody $requestBody = null, array $headerParameters = []) + public function __construct(string $preferenceCenterExternalID, ?\Braze\Model\PreferenceCenterV1PreferenceCenterExternalIDPutBody $requestBody = null, array $headerParameters = []) { $this->PreferenceCenterExternalID = $preferenceCenterExternalID; $this->body = $requestBody; @@ -128,7 +128,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PutPreferenceCenterV1ByPreferenceCenterExternalIDTooManyRequestsException * @throws \Braze\Exception\PutPreferenceCenterV1ByPreferenceCenterExternalIDInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Endpoint/PutScimV2UserById.php b/lib/Endpoint/PutScimV2UserById.php index c1855c1..5861499 100644 --- a/lib/Endpoint/PutScimV2UserById.php +++ b/lib/Endpoint/PutScimV2UserById.php @@ -97,7 +97,7 @@ class PutScimV2UserById extends \Braze\Runtime\Client\BaseEndpoint implements \B * @var string $Authorization * } */ - public function __construct(string $id, \Braze\Model\ScimV2UsersIdPutBody $requestBody = null, array $headerParameters = []) + public function __construct(string $id, ?\Braze\Model\ScimV2UsersIdPutBody $requestBody = null, array $headerParameters = []) { $this->id = $id; $this->body = $requestBody; @@ -151,7 +151,7 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv * @throws \Braze\Exception\PutScimV2UserByIdTooManyRequestsException * @throws \Braze\Exception\PutScimV2UserByIdInternalServerErrorException */ - protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); diff --git a/lib/Model/CampaignsTriggerScheduleCreatePostBody.php b/lib/Model/CampaignsTriggerScheduleCreatePostBody.php index cd3f5d4..ced952c 100644 --- a/lib/Model/CampaignsTriggerScheduleCreatePostBody.php +++ b/lib/Model/CampaignsTriggerScheduleCreatePostBody.php @@ -30,7 +30,7 @@ public function isInitialized($property): bool */ protected $sendId; /** - * @var CampaignsTriggerScheduleCreatePostBodyRecipientsItem[] + * @var list */ protected $recipients; /** @@ -77,7 +77,7 @@ public function setSendId(string $sendId): self } /** - * @return CampaignsTriggerScheduleCreatePostBodyRecipientsItem[] + * @return list */ public function getRecipients(): array { @@ -85,7 +85,7 @@ public function getRecipients(): array } /** - * @param CampaignsTriggerScheduleCreatePostBodyRecipientsItem[] $recipients + * @param list $recipients */ public function setRecipients(array $recipients): self { diff --git a/lib/Model/CampaignsTriggerScheduleCreatePostBodyAudience.php b/lib/Model/CampaignsTriggerScheduleCreatePostBodyAudience.php index 2cecc06..8b2b4d1 100644 --- a/lib/Model/CampaignsTriggerScheduleCreatePostBodyAudience.php +++ b/lib/Model/CampaignsTriggerScheduleCreatePostBodyAudience.php @@ -22,12 +22,12 @@ public function isInitialized($property): bool return array_key_exists($property, $this->initialized); } /** - * @var mixed[] + * @var list */ protected $aND; /** - * @return mixed[] + * @return list */ public function getAND(): array { @@ -35,7 +35,7 @@ public function getAND(): array } /** - * @param mixed[] $aND + * @param list $aND */ public function setAND(array $aND): self { diff --git a/lib/Model/CampaignsTriggerSendPostBody.php b/lib/Model/CampaignsTriggerSendPostBody.php index 374c136..587fcec 100644 --- a/lib/Model/CampaignsTriggerSendPostBody.php +++ b/lib/Model/CampaignsTriggerSendPostBody.php @@ -42,7 +42,7 @@ public function isInitialized($property): bool */ protected $audience; /** - * @var CampaignsTriggerSendPostBodyRecipientsItem[] + * @var list */ protected $recipients; @@ -118,7 +118,7 @@ public function setAudience(CampaignsTriggerSendPostBodyAudience $audience): sel } /** - * @return CampaignsTriggerSendPostBodyRecipientsItem[] + * @return list */ public function getRecipients(): array { @@ -126,7 +126,7 @@ public function getRecipients(): array } /** - * @param CampaignsTriggerSendPostBodyRecipientsItem[] $recipients + * @param list $recipients */ public function setRecipients(array $recipients): self { diff --git a/lib/Model/CampaignsTriggerSendPostBodyAudience.php b/lib/Model/CampaignsTriggerSendPostBodyAudience.php index fd9138e..3c3cccc 100644 --- a/lib/Model/CampaignsTriggerSendPostBodyAudience.php +++ b/lib/Model/CampaignsTriggerSendPostBodyAudience.php @@ -22,12 +22,12 @@ public function isInitialized($property): bool return array_key_exists($property, $this->initialized); } /** - * @var mixed[] + * @var list */ protected $aND; /** - * @return mixed[] + * @return list */ public function getAND(): array { @@ -35,7 +35,7 @@ public function getAND(): array } /** - * @param mixed[] $aND + * @param list $aND */ public function setAND(array $aND): self { diff --git a/lib/Model/CanvasTriggerScheduleCreatePostBody.php b/lib/Model/CanvasTriggerScheduleCreatePostBody.php index ae069ab..aa14316 100644 --- a/lib/Model/CanvasTriggerScheduleCreatePostBody.php +++ b/lib/Model/CanvasTriggerScheduleCreatePostBody.php @@ -26,7 +26,7 @@ public function isInitialized($property): bool */ protected $canvasId; /** - * @var CanvasTriggerScheduleCreatePostBodyRecipientsItem[] + * @var list */ protected $recipients; /** @@ -60,7 +60,7 @@ public function setCanvasId(string $canvasId): self } /** - * @return CanvasTriggerScheduleCreatePostBodyRecipientsItem[] + * @return list */ public function getRecipients(): array { @@ -68,7 +68,7 @@ public function getRecipients(): array } /** - * @param CanvasTriggerScheduleCreatePostBodyRecipientsItem[] $recipients + * @param list $recipients */ public function setRecipients(array $recipients): self { diff --git a/lib/Model/CanvasTriggerScheduleCreatePostBodyAudience.php b/lib/Model/CanvasTriggerScheduleCreatePostBodyAudience.php index f61d36f..41ebf82 100644 --- a/lib/Model/CanvasTriggerScheduleCreatePostBodyAudience.php +++ b/lib/Model/CanvasTriggerScheduleCreatePostBodyAudience.php @@ -22,12 +22,12 @@ public function isInitialized($property): bool return array_key_exists($property, $this->initialized); } /** - * @var mixed[] + * @var list */ protected $aND; /** - * @return mixed[] + * @return list */ public function getAND(): array { @@ -35,7 +35,7 @@ public function getAND(): array } /** - * @param mixed[] $aND + * @param list $aND */ public function setAND(array $aND): self { diff --git a/lib/Model/CanvasTriggerSendPostBody.php b/lib/Model/CanvasTriggerSendPostBody.php index 99a30d1..7e594ff 100644 --- a/lib/Model/CanvasTriggerSendPostBody.php +++ b/lib/Model/CanvasTriggerSendPostBody.php @@ -38,7 +38,7 @@ public function isInitialized($property): bool */ protected $audience; /** - * @var CanvasTriggerSendPostBodyRecipientsItem[] + * @var list */ protected $recipients; @@ -95,7 +95,7 @@ public function setAudience(CanvasTriggerSendPostBodyAudience $audience): self } /** - * @return CanvasTriggerSendPostBodyRecipientsItem[] + * @return list */ public function getRecipients(): array { @@ -103,7 +103,7 @@ public function getRecipients(): array } /** - * @param CanvasTriggerSendPostBodyRecipientsItem[] $recipients + * @param list $recipients */ public function setRecipients(array $recipients): self { diff --git a/lib/Model/CanvasTriggerSendPostBodyAudience.php b/lib/Model/CanvasTriggerSendPostBodyAudience.php index 36949ba..ea1179f 100644 --- a/lib/Model/CanvasTriggerSendPostBodyAudience.php +++ b/lib/Model/CanvasTriggerSendPostBodyAudience.php @@ -22,12 +22,12 @@ public function isInitialized($property): bool return array_key_exists($property, $this->initialized); } /** - * @var mixed[] + * @var list */ protected $aND; /** - * @return mixed[] + * @return list */ public function getAND(): array { @@ -35,7 +35,7 @@ public function getAND(): array } /** - * @param mixed[] $aND + * @param list $aND */ public function setAND(array $aND): self { diff --git a/lib/Model/CatalogsCatalogNameItemsItemIdPatchBody.php b/lib/Model/CatalogsCatalogNameItemsItemIdPatchBody.php index 673ff10..77dd18a 100644 --- a/lib/Model/CatalogsCatalogNameItemsItemIdPatchBody.php +++ b/lib/Model/CatalogsCatalogNameItemsItemIdPatchBody.php @@ -22,12 +22,12 @@ public function isInitialized($property): bool return array_key_exists($property, $this->initialized); } /** - * @var array[] + * @var list> */ protected $items; /** - * @return array[] + * @return list> */ public function getItems(): array { @@ -35,7 +35,7 @@ public function getItems(): array } /** - * @param array[] $items + * @param list> $items */ public function setItems(array $items): self { diff --git a/lib/Model/CatalogsCatalogNameItemsItemIdPostBody.php b/lib/Model/CatalogsCatalogNameItemsItemIdPostBody.php index 6ea95dd..f3fbaac 100644 --- a/lib/Model/CatalogsCatalogNameItemsItemIdPostBody.php +++ b/lib/Model/CatalogsCatalogNameItemsItemIdPostBody.php @@ -22,12 +22,12 @@ public function isInitialized($property): bool return array_key_exists($property, $this->initialized); } /** - * @var array[] + * @var list> */ protected $items; /** - * @return array[] + * @return list> */ public function getItems(): array { @@ -35,7 +35,7 @@ public function getItems(): array } /** - * @param array[] $items + * @param list> $items */ public function setItems(array $items): self { diff --git a/lib/Model/CatalogsCatalogNameItemsItemIdPutBody.php b/lib/Model/CatalogsCatalogNameItemsItemIdPutBody.php index 83dd92b..ebd00a4 100644 --- a/lib/Model/CatalogsCatalogNameItemsItemIdPutBody.php +++ b/lib/Model/CatalogsCatalogNameItemsItemIdPutBody.php @@ -22,12 +22,12 @@ public function isInitialized($property): bool return array_key_exists($property, $this->initialized); } /** - * @var array[] + * @var list> */ protected $items; /** - * @return array[] + * @return list> */ public function getItems(): array { @@ -35,7 +35,7 @@ public function getItems(): array } /** - * @param array[] $items + * @param list> $items */ public function setItems(array $items): self { diff --git a/lib/Model/CatalogsCatalogNameItemsPatchBody.php b/lib/Model/CatalogsCatalogNameItemsPatchBody.php index 985a162..e6b3f55 100644 --- a/lib/Model/CatalogsCatalogNameItemsPatchBody.php +++ b/lib/Model/CatalogsCatalogNameItemsPatchBody.php @@ -22,12 +22,12 @@ public function isInitialized($property): bool return array_key_exists($property, $this->initialized); } /** - * @var CatalogsCatalogNameItemsPatchBodyItemsItem[] + * @var list */ protected $items; /** - * @return CatalogsCatalogNameItemsPatchBodyItemsItem[] + * @return list */ public function getItems(): array { @@ -35,7 +35,7 @@ public function getItems(): array } /** - * @param CatalogsCatalogNameItemsPatchBodyItemsItem[] $items + * @param list $items */ public function setItems(array $items): self { diff --git a/lib/Model/CatalogsCatalogNameItemsPostBody.php b/lib/Model/CatalogsCatalogNameItemsPostBody.php index 6709bd1..58c095b 100644 --- a/lib/Model/CatalogsCatalogNameItemsPostBody.php +++ b/lib/Model/CatalogsCatalogNameItemsPostBody.php @@ -22,12 +22,12 @@ public function isInitialized($property): bool return array_key_exists($property, $this->initialized); } /** - * @var array[] + * @var list> */ protected $items; /** - * @return array[] + * @return list> */ public function getItems(): array { @@ -35,7 +35,7 @@ public function getItems(): array } /** - * @param array[] $items + * @param list> $items */ public function setItems(array $items): self { diff --git a/lib/Model/CatalogsCatalogNameItemsPutBody.php b/lib/Model/CatalogsCatalogNameItemsPutBody.php index 39ed26c..554e0dc 100644 --- a/lib/Model/CatalogsCatalogNameItemsPutBody.php +++ b/lib/Model/CatalogsCatalogNameItemsPutBody.php @@ -22,12 +22,12 @@ public function isInitialized($property): bool return array_key_exists($property, $this->initialized); } /** - * @var array[] + * @var list> */ protected $items; /** - * @return array[] + * @return list> */ public function getItems(): array { @@ -35,7 +35,7 @@ public function getItems(): array } /** - * @param array[] $items + * @param list> $items */ public function setItems(array $items): self { diff --git a/lib/Model/CatalogsPostBody.php b/lib/Model/CatalogsPostBody.php index a4300e4..af77238 100644 --- a/lib/Model/CatalogsPostBody.php +++ b/lib/Model/CatalogsPostBody.php @@ -22,12 +22,12 @@ public function isInitialized($property): bool return array_key_exists($property, $this->initialized); } /** - * @var CatalogsPostBodyCatalogsItem[] + * @var list */ protected $catalogs; /** - * @return CatalogsPostBodyCatalogsItem[] + * @return list */ public function getCatalogs(): array { @@ -35,7 +35,7 @@ public function getCatalogs(): array } /** - * @param CatalogsPostBodyCatalogsItem[] $catalogs + * @param list $catalogs */ public function setCatalogs(array $catalogs): self { diff --git a/lib/Model/CatalogsPostBodyCatalogsItem.php b/lib/Model/CatalogsPostBodyCatalogsItem.php index 0262b7c..aa0e55d 100644 --- a/lib/Model/CatalogsPostBodyCatalogsItem.php +++ b/lib/Model/CatalogsPostBodyCatalogsItem.php @@ -30,7 +30,7 @@ public function isInitialized($property): bool */ protected $description; /** - * @var CatalogsPostBodyCatalogsItemFieldsItem[] + * @var list */ protected $fields; @@ -61,7 +61,7 @@ public function setDescription(string $description): self } /** - * @return CatalogsPostBodyCatalogsItemFieldsItem[] + * @return list */ public function getFields(): array { @@ -69,7 +69,7 @@ public function getFields(): array } /** - * @param CatalogsPostBodyCatalogsItemFieldsItem[] $fields + * @param list $fields */ public function setFields(array $fields): self { diff --git a/lib/Model/ContentBlocksCreatePostBody.php b/lib/Model/ContentBlocksCreatePostBody.php index a9021c5..4036d6c 100644 --- a/lib/Model/ContentBlocksCreatePostBody.php +++ b/lib/Model/ContentBlocksCreatePostBody.php @@ -38,7 +38,7 @@ public function isInitialized($property): bool */ protected $state; /** - * @var string[] + * @var list */ protected $tags; @@ -95,7 +95,7 @@ public function setState(string $state): self } /** - * @return string[] + * @return list */ public function getTags(): array { @@ -103,7 +103,7 @@ public function getTags(): array } /** - * @param string[] $tags + * @param list $tags */ public function setTags(array $tags): self { diff --git a/lib/Model/ContentBlocksUpdatePostBody.php b/lib/Model/ContentBlocksUpdatePostBody.php index 5edcaa6..1437859 100644 --- a/lib/Model/ContentBlocksUpdatePostBody.php +++ b/lib/Model/ContentBlocksUpdatePostBody.php @@ -42,7 +42,7 @@ public function isInitialized($property): bool */ protected $state; /** - * @var string[] + * @var list */ protected $tags; @@ -112,7 +112,7 @@ public function setState(string $state): self } /** - * @return string[] + * @return list */ public function getTags(): array { @@ -120,7 +120,7 @@ public function getTags(): array } /** - * @param string[] $tags + * @param list $tags */ public function setTags(array $tags): self { diff --git a/lib/Model/EmailBlacklistPostBody.php b/lib/Model/EmailBlacklistPostBody.php index 5c98380..cf2b075 100644 --- a/lib/Model/EmailBlacklistPostBody.php +++ b/lib/Model/EmailBlacklistPostBody.php @@ -22,12 +22,12 @@ public function isInitialized($property): bool return array_key_exists($property, $this->initialized); } /** - * @var string[] + * @var list */ protected $email; /** - * @return string[] + * @return list */ public function getEmail(): array { @@ -35,7 +35,7 @@ public function getEmail(): array } /** - * @param string[] $email + * @param list $email */ public function setEmail(array $email): self { diff --git a/lib/Model/EmailBlocklistPostBody.php b/lib/Model/EmailBlocklistPostBody.php index 44f8f72..5328ae1 100644 --- a/lib/Model/EmailBlocklistPostBody.php +++ b/lib/Model/EmailBlocklistPostBody.php @@ -22,12 +22,12 @@ public function isInitialized($property): bool return array_key_exists($property, $this->initialized); } /** - * @var string[] + * @var list */ protected $email; /** - * @return string[] + * @return list */ public function getEmail(): array { @@ -35,7 +35,7 @@ public function getEmail(): array } /** - * @param string[] $email + * @param list $email */ public function setEmail(array $email): self { diff --git a/lib/Model/Error.php b/lib/Model/Error.php index 1aa1e57..fec8b71 100644 --- a/lib/Model/Error.php +++ b/lib/Model/Error.php @@ -26,7 +26,7 @@ public function isInitialized($property): bool */ protected $message; /** - * @var string[] + * @var list */ protected $errors; @@ -44,7 +44,7 @@ public function setMessage(string $message): self } /** - * @return string[] + * @return list */ public function getErrors(): array { @@ -52,7 +52,7 @@ public function getErrors(): array } /** - * @param string[] $errors + * @param list $errors */ public function setErrors(array $errors): self { diff --git a/lib/Model/MessagesScheduleCreatePostBodyAudience.php b/lib/Model/MessagesScheduleCreatePostBodyAudience.php index 1e42087..905862d 100644 --- a/lib/Model/MessagesScheduleCreatePostBodyAudience.php +++ b/lib/Model/MessagesScheduleCreatePostBodyAudience.php @@ -22,12 +22,12 @@ public function isInitialized($property): bool return array_key_exists($property, $this->initialized); } /** - * @var mixed[] + * @var list */ protected $aND; /** - * @return mixed[] + * @return list */ public function getAND(): array { @@ -35,7 +35,7 @@ public function getAND(): array } /** - * @param mixed[] $aND + * @param list $aND */ public function setAND(array $aND): self { diff --git a/lib/Model/MessagesSendPostBodyAudience.php b/lib/Model/MessagesSendPostBodyAudience.php index 96d943d..743ec70 100644 --- a/lib/Model/MessagesSendPostBodyAudience.php +++ b/lib/Model/MessagesSendPostBodyAudience.php @@ -22,12 +22,12 @@ public function isInitialized($property): bool return array_key_exists($property, $this->initialized); } /** - * @var mixed[] + * @var list */ protected $aND; /** - * @return mixed[] + * @return list */ public function getAND(): array { @@ -35,7 +35,7 @@ public function getAND(): array } /** - * @param mixed[] $aND + * @param list $aND */ public function setAND(array $aND): self { diff --git a/lib/Model/PreferenceCenterV1PreferenceCenterExternalIDPutBody.php b/lib/Model/PreferenceCenterV1PreferenceCenterExternalIDPutBody.php index a287769..ed64a73 100644 --- a/lib/Model/PreferenceCenterV1PreferenceCenterExternalIDPutBody.php +++ b/lib/Model/PreferenceCenterV1PreferenceCenterExternalIDPutBody.php @@ -30,7 +30,7 @@ public function isInitialized($property): bool */ protected $triggerProperties; /** - * @var PreferenceCenterV1PreferenceCenterExternalIDPutBodyRecipientItem[] + * @var list */ protected $recipient; @@ -61,7 +61,7 @@ public function setTriggerProperties(PreferenceCenterV1PreferenceCenterExternalI } /** - * @return PreferenceCenterV1PreferenceCenterExternalIDPutBodyRecipientItem[] + * @return list */ public function getRecipient(): array { @@ -69,7 +69,7 @@ public function getRecipient(): array } /** - * @param PreferenceCenterV1PreferenceCenterExternalIDPutBodyRecipientItem[] $recipient + * @param list $recipient */ public function setRecipient(array $recipient): self { diff --git a/lib/Model/ScimV2UsersIdPutBody.php b/lib/Model/ScimV2UsersIdPutBody.php index 8c4e624..dad9a62 100644 --- a/lib/Model/ScimV2UsersIdPutBody.php +++ b/lib/Model/ScimV2UsersIdPutBody.php @@ -22,7 +22,7 @@ public function isInitialized($property): bool return array_key_exists($property, $this->initialized); } /** - * @var string[] + * @var list */ protected $schemas; /** @@ -39,7 +39,7 @@ public function isInitialized($property): bool protected $permissions; /** - * @return string[] + * @return list */ public function getSchemas(): array { @@ -47,7 +47,7 @@ public function getSchemas(): array } /** - * @param string[] $schemas + * @param list $schemas */ public function setSchemas(array $schemas): self { diff --git a/lib/Model/ScimV2UsersIdPutBodyPermissions.php b/lib/Model/ScimV2UsersIdPutBodyPermissions.php index 5a0bb01..d73d76e 100644 --- a/lib/Model/ScimV2UsersIdPutBodyPermissions.php +++ b/lib/Model/ScimV2UsersIdPutBodyPermissions.php @@ -22,16 +22,16 @@ public function isInitialized($property): bool return array_key_exists($property, $this->initialized); } /** - * @var string[] + * @var list */ protected $companyPermissions; /** - * @var ScimV2UsersIdPutBodyPermissionsAppGroupItem[] + * @var list */ protected $appGroup; /** - * @return string[] + * @return list */ public function getCompanyPermissions(): array { @@ -39,7 +39,7 @@ public function getCompanyPermissions(): array } /** - * @param string[] $companyPermissions + * @param list $companyPermissions */ public function setCompanyPermissions(array $companyPermissions): self { @@ -50,7 +50,7 @@ public function setCompanyPermissions(array $companyPermissions): self } /** - * @return ScimV2UsersIdPutBodyPermissionsAppGroupItem[] + * @return list */ public function getAppGroup(): array { @@ -58,7 +58,7 @@ public function getAppGroup(): array } /** - * @param ScimV2UsersIdPutBodyPermissionsAppGroupItem[] $appGroup + * @param list $appGroup */ public function setAppGroup(array $appGroup): self { diff --git a/lib/Model/ScimV2UsersIdPutBodyPermissionsAppGroupItem.php b/lib/Model/ScimV2UsersIdPutBodyPermissionsAppGroupItem.php index 5b90236..3da9aad 100644 --- a/lib/Model/ScimV2UsersIdPutBodyPermissionsAppGroupItem.php +++ b/lib/Model/ScimV2UsersIdPutBodyPermissionsAppGroupItem.php @@ -26,11 +26,11 @@ public function isInitialized($property): bool */ protected $appGroupName; /** - * @var string[] + * @var list */ protected $appGroupPermissions; /** - * @var ScimV2UsersIdPutBodyPermissionsAppGroupItemTeamItem[] + * @var list */ protected $team; @@ -48,7 +48,7 @@ public function setAppGroupName(string $appGroupName): self } /** - * @return string[] + * @return list */ public function getAppGroupPermissions(): array { @@ -56,7 +56,7 @@ public function getAppGroupPermissions(): array } /** - * @param string[] $appGroupPermissions + * @param list $appGroupPermissions */ public function setAppGroupPermissions(array $appGroupPermissions): self { @@ -67,7 +67,7 @@ public function setAppGroupPermissions(array $appGroupPermissions): self } /** - * @return ScimV2UsersIdPutBodyPermissionsAppGroupItemTeamItem[] + * @return list */ public function getTeam(): array { @@ -75,7 +75,7 @@ public function getTeam(): array } /** - * @param ScimV2UsersIdPutBodyPermissionsAppGroupItemTeamItem[] $team + * @param list $team */ public function setTeam(array $team): self { diff --git a/lib/Model/ScimV2UsersIdPutBodyPermissionsAppGroupItemTeamItem.php b/lib/Model/ScimV2UsersIdPutBodyPermissionsAppGroupItemTeamItem.php index 02dd58e..8627cd8 100644 --- a/lib/Model/ScimV2UsersIdPutBodyPermissionsAppGroupItemTeamItem.php +++ b/lib/Model/ScimV2UsersIdPutBodyPermissionsAppGroupItemTeamItem.php @@ -26,7 +26,7 @@ public function isInitialized($property): bool */ protected $teamName; /** - * @var string[] + * @var list */ protected $teamPermissions; @@ -44,7 +44,7 @@ public function setTeamName(string $teamName): self } /** - * @return string[] + * @return list */ public function getTeamPermissions(): array { @@ -52,7 +52,7 @@ public function getTeamPermissions(): array } /** - * @param string[] $teamPermissions + * @param list $teamPermissions */ public function setTeamPermissions(array $teamPermissions): self { diff --git a/lib/Model/ScimV2UsersPostBody.php b/lib/Model/ScimV2UsersPostBody.php index 6e41be3..8ecac7c 100644 --- a/lib/Model/ScimV2UsersPostBody.php +++ b/lib/Model/ScimV2UsersPostBody.php @@ -22,7 +22,7 @@ public function isInitialized($property): bool return array_key_exists($property, $this->initialized); } /** - * @var string[] + * @var list */ protected $schemas; /** @@ -43,7 +43,7 @@ public function isInitialized($property): bool protected $permissions; /** - * @return string[] + * @return list */ public function getSchemas(): array { @@ -51,7 +51,7 @@ public function getSchemas(): array } /** - * @param string[] $schemas + * @param list $schemas */ public function setSchemas(array $schemas): self { diff --git a/lib/Model/ScimV2UsersPostBodyPermissions.php b/lib/Model/ScimV2UsersPostBodyPermissions.php index 1a7dbb3..b791f57 100644 --- a/lib/Model/ScimV2UsersPostBodyPermissions.php +++ b/lib/Model/ScimV2UsersPostBodyPermissions.php @@ -22,16 +22,16 @@ public function isInitialized($property): bool return array_key_exists($property, $this->initialized); } /** - * @var string[] + * @var list */ protected $companyPermissions; /** - * @var ScimV2UsersPostBodyPermissionsAppGroupItem[] + * @var list */ protected $appGroup; /** - * @return string[] + * @return list */ public function getCompanyPermissions(): array { @@ -39,7 +39,7 @@ public function getCompanyPermissions(): array } /** - * @param string[] $companyPermissions + * @param list $companyPermissions */ public function setCompanyPermissions(array $companyPermissions): self { @@ -50,7 +50,7 @@ public function setCompanyPermissions(array $companyPermissions): self } /** - * @return ScimV2UsersPostBodyPermissionsAppGroupItem[] + * @return list */ public function getAppGroup(): array { @@ -58,7 +58,7 @@ public function getAppGroup(): array } /** - * @param ScimV2UsersPostBodyPermissionsAppGroupItem[] $appGroup + * @param list $appGroup */ public function setAppGroup(array $appGroup): self { diff --git a/lib/Model/ScimV2UsersPostBodyPermissionsAppGroupItem.php b/lib/Model/ScimV2UsersPostBodyPermissionsAppGroupItem.php index bb6c7d5..5ebfb3f 100644 --- a/lib/Model/ScimV2UsersPostBodyPermissionsAppGroupItem.php +++ b/lib/Model/ScimV2UsersPostBodyPermissionsAppGroupItem.php @@ -26,11 +26,11 @@ public function isInitialized($property): bool */ protected $appGroupName; /** - * @var string[] + * @var list */ protected $appGroupPermissions; /** - * @var ScimV2UsersPostBodyPermissionsAppGroupItemTeamItem[] + * @var list */ protected $team; @@ -48,7 +48,7 @@ public function setAppGroupName(string $appGroupName): self } /** - * @return string[] + * @return list */ public function getAppGroupPermissions(): array { @@ -56,7 +56,7 @@ public function getAppGroupPermissions(): array } /** - * @param string[] $appGroupPermissions + * @param list $appGroupPermissions */ public function setAppGroupPermissions(array $appGroupPermissions): self { @@ -67,7 +67,7 @@ public function setAppGroupPermissions(array $appGroupPermissions): self } /** - * @return ScimV2UsersPostBodyPermissionsAppGroupItemTeamItem[] + * @return list */ public function getTeam(): array { @@ -75,7 +75,7 @@ public function getTeam(): array } /** - * @param ScimV2UsersPostBodyPermissionsAppGroupItemTeamItem[] $team + * @param list $team */ public function setTeam(array $team): self { diff --git a/lib/Model/ScimV2UsersPostBodyPermissionsAppGroupItemTeamItem.php b/lib/Model/ScimV2UsersPostBodyPermissionsAppGroupItemTeamItem.php index bab3015..050fc10 100644 --- a/lib/Model/ScimV2UsersPostBodyPermissionsAppGroupItemTeamItem.php +++ b/lib/Model/ScimV2UsersPostBodyPermissionsAppGroupItemTeamItem.php @@ -26,7 +26,7 @@ public function isInitialized($property): bool */ protected $teamName; /** - * @var string[] + * @var list */ protected $teamPermissions; @@ -44,7 +44,7 @@ public function setTeamName(string $teamName): self } /** - * @return string[] + * @return list */ public function getTeamPermissions(): array { @@ -52,7 +52,7 @@ public function getTeamPermissions(): array } /** - * @param string[] $teamPermissions + * @param list $teamPermissions */ public function setTeamPermissions(array $teamPermissions): self { diff --git a/lib/Model/SmsInvalidPhoneNumbersRemovePostBody.php b/lib/Model/SmsInvalidPhoneNumbersRemovePostBody.php index c669b2d..167d80e 100644 --- a/lib/Model/SmsInvalidPhoneNumbersRemovePostBody.php +++ b/lib/Model/SmsInvalidPhoneNumbersRemovePostBody.php @@ -22,12 +22,12 @@ public function isInitialized($property): bool return array_key_exists($property, $this->initialized); } /** - * @var string[] + * @var list */ protected $phoneNumbers; /** - * @return string[] + * @return list */ public function getPhoneNumbers(): array { @@ -35,7 +35,7 @@ public function getPhoneNumbers(): array } /** - * @param string[] $phoneNumbers + * @param list $phoneNumbers */ public function setPhoneNumbers(array $phoneNumbers): self { diff --git a/lib/Model/SubscriptionStatusSetPostBody.php b/lib/Model/SubscriptionStatusSetPostBody.php index d8a7899..e2cc53f 100644 --- a/lib/Model/SubscriptionStatusSetPostBody.php +++ b/lib/Model/SubscriptionStatusSetPostBody.php @@ -34,7 +34,7 @@ public function isInitialized($property): bool */ protected $externalId; /** - * @var string[] + * @var list */ protected $phone; @@ -78,7 +78,7 @@ public function setExternalId(string $externalId): self } /** - * @return string[] + * @return list */ public function getPhone(): array { @@ -86,7 +86,7 @@ public function getPhone(): array } /** - * @param string[] $phone + * @param list $phone */ public function setPhone(array $phone): self { diff --git a/lib/Model/TemplatesEmailCreatePostBody.php b/lib/Model/TemplatesEmailCreatePostBody.php index 294845c..bce2287 100644 --- a/lib/Model/TemplatesEmailCreatePostBody.php +++ b/lib/Model/TemplatesEmailCreatePostBody.php @@ -42,7 +42,7 @@ public function isInitialized($property): bool */ protected $preheader; /** - * @var string[] + * @var list */ protected $tags; @@ -112,7 +112,7 @@ public function setPreheader(string $preheader): self } /** - * @return string[] + * @return list */ public function getTags(): array { @@ -120,7 +120,7 @@ public function getTags(): array } /** - * @param string[] $tags + * @param list $tags */ public function setTags(array $tags): self { diff --git a/lib/Model/TemplatesEmailUpdatePostBody.php b/lib/Model/TemplatesEmailUpdatePostBody.php index 4286e05..4de2eba 100644 --- a/lib/Model/TemplatesEmailUpdatePostBody.php +++ b/lib/Model/TemplatesEmailUpdatePostBody.php @@ -46,7 +46,7 @@ public function isInitialized($property): bool */ protected $preheader; /** - * @var string[] + * @var list */ protected $tags; @@ -129,7 +129,7 @@ public function setPreheader(string $preheader): self } /** - * @return string[] + * @return list */ public function getTags(): array { @@ -137,7 +137,7 @@ public function getTags(): array } /** - * @param string[] $tags + * @param list $tags */ public function setTags(array $tags): self { diff --git a/lib/Model/TransactionalV1CampaignsCampaignIdSendPostBody.php b/lib/Model/TransactionalV1CampaignsCampaignIdSendPostBody.php index b70a7b7..d463a1f 100644 --- a/lib/Model/TransactionalV1CampaignsCampaignIdSendPostBody.php +++ b/lib/Model/TransactionalV1CampaignsCampaignIdSendPostBody.php @@ -30,7 +30,7 @@ public function isInitialized($property): bool */ protected $triggerProperties; /** - * @var TransactionalV1CampaignsCampaignIdSendPostBodyRecipientItem[] + * @var list */ protected $recipient; @@ -61,7 +61,7 @@ public function setTriggerProperties(TransactionalV1CampaignsCampaignIdSendPostB } /** - * @return TransactionalV1CampaignsCampaignIdSendPostBodyRecipientItem[] + * @return list */ public function getRecipient(): array { @@ -69,7 +69,7 @@ public function getRecipient(): array } /** - * @param TransactionalV1CampaignsCampaignIdSendPostBodyRecipientItem[] $recipient + * @param list $recipient */ public function setRecipient(array $recipient): self { diff --git a/lib/Model/UsersAliasNewPostBody.php b/lib/Model/UsersAliasNewPostBody.php index 59a7fff..abc19fc 100644 --- a/lib/Model/UsersAliasNewPostBody.php +++ b/lib/Model/UsersAliasNewPostBody.php @@ -22,12 +22,12 @@ public function isInitialized($property): bool return array_key_exists($property, $this->initialized); } /** - * @var UsersAliasNewPostBodyUserAliasesItem[] + * @var list */ protected $userAliases; /** - * @return UsersAliasNewPostBodyUserAliasesItem[] + * @return list */ public function getUserAliases(): array { @@ -35,7 +35,7 @@ public function getUserAliases(): array } /** - * @param UsersAliasNewPostBodyUserAliasesItem[] $userAliases + * @param list $userAliases */ public function setUserAliases(array $userAliases): self { diff --git a/lib/Model/UsersAliasUpdatePostBody.php b/lib/Model/UsersAliasUpdatePostBody.php index 8b34b34..2620883 100644 --- a/lib/Model/UsersAliasUpdatePostBody.php +++ b/lib/Model/UsersAliasUpdatePostBody.php @@ -22,12 +22,12 @@ public function isInitialized($property): bool return array_key_exists($property, $this->initialized); } /** - * @var UsersAliasUpdatePostBodyAliasUpdatesItem[] + * @var list */ protected $aliasUpdates; /** - * @return UsersAliasUpdatePostBodyAliasUpdatesItem[] + * @return list */ public function getAliasUpdates(): array { @@ -35,7 +35,7 @@ public function getAliasUpdates(): array } /** - * @param UsersAliasUpdatePostBodyAliasUpdatesItem[] $aliasUpdates + * @param list $aliasUpdates */ public function setAliasUpdates(array $aliasUpdates): self { diff --git a/lib/Model/UsersDeletePostBody.php b/lib/Model/UsersDeletePostBody.php index b559180..98fdc9c 100644 --- a/lib/Model/UsersDeletePostBody.php +++ b/lib/Model/UsersDeletePostBody.php @@ -22,20 +22,20 @@ public function isInitialized($property): bool return array_key_exists($property, $this->initialized); } /** - * @var string[] + * @var list */ protected $externalIds; /** - * @var string[] + * @var list */ protected $brazeIds; /** - * @var UsersDeletePostBodyUserAliasesItem[] + * @var list */ protected $userAliases; /** - * @return string[] + * @return list */ public function getExternalIds(): array { @@ -43,7 +43,7 @@ public function getExternalIds(): array } /** - * @param string[] $externalIds + * @param list $externalIds */ public function setExternalIds(array $externalIds): self { @@ -54,7 +54,7 @@ public function setExternalIds(array $externalIds): self } /** - * @return string[] + * @return list */ public function getBrazeIds(): array { @@ -62,7 +62,7 @@ public function getBrazeIds(): array } /** - * @param string[] $brazeIds + * @param list $brazeIds */ public function setBrazeIds(array $brazeIds): self { @@ -73,7 +73,7 @@ public function setBrazeIds(array $brazeIds): self } /** - * @return UsersDeletePostBodyUserAliasesItem[] + * @return list */ public function getUserAliases(): array { @@ -81,7 +81,7 @@ public function getUserAliases(): array } /** - * @param UsersDeletePostBodyUserAliasesItem[] $userAliases + * @param list $userAliases */ public function setUserAliases(array $userAliases): self { diff --git a/lib/Model/UsersExportGlobalControlGroupPostBody.php b/lib/Model/UsersExportGlobalControlGroupPostBody.php index 2b49e66..6ff7a52 100644 --- a/lib/Model/UsersExportGlobalControlGroupPostBody.php +++ b/lib/Model/UsersExportGlobalControlGroupPostBody.php @@ -26,7 +26,7 @@ public function isInitialized($property): bool */ protected $callbackEndpoint; /** - * @var string[] + * @var list */ protected $fieldsToExport; /** @@ -48,7 +48,7 @@ public function setCallbackEndpoint(string $callbackEndpoint): self } /** - * @return string[] + * @return list */ public function getFieldsToExport(): array { @@ -56,7 +56,7 @@ public function getFieldsToExport(): array } /** - * @param string[] $fieldsToExport + * @param list $fieldsToExport */ public function setFieldsToExport(array $fieldsToExport): self { diff --git a/lib/Model/UsersExportIdsPostBody.php b/lib/Model/UsersExportIdsPostBody.php index 044cb37..21fc6be 100644 --- a/lib/Model/UsersExportIdsPostBody.php +++ b/lib/Model/UsersExportIdsPostBody.php @@ -22,11 +22,11 @@ public function isInitialized($property): bool return array_key_exists($property, $this->initialized); } /** - * @var string[] + * @var list */ protected $externalIds; /** - * @var UsersExportIdsPostBodyUserAliasesItem[] + * @var list */ protected $userAliases; /** @@ -46,12 +46,12 @@ public function isInitialized($property): bool */ protected $phone; /** - * @var string[] + * @var list */ protected $fieldsToExport; /** - * @return string[] + * @return list */ public function getExternalIds(): array { @@ -59,7 +59,7 @@ public function getExternalIds(): array } /** - * @param string[] $externalIds + * @param list $externalIds */ public function setExternalIds(array $externalIds): self { @@ -70,7 +70,7 @@ public function setExternalIds(array $externalIds): self } /** - * @return UsersExportIdsPostBodyUserAliasesItem[] + * @return list */ public function getUserAliases(): array { @@ -78,7 +78,7 @@ public function getUserAliases(): array } /** - * @param UsersExportIdsPostBodyUserAliasesItem[] $userAliases + * @param list $userAliases */ public function setUserAliases(array $userAliases): self { @@ -141,7 +141,7 @@ public function setPhone(string $phone): self } /** - * @return string[] + * @return list */ public function getFieldsToExport(): array { @@ -149,7 +149,7 @@ public function getFieldsToExport(): array } /** - * @param string[] $fieldsToExport + * @param list $fieldsToExport */ public function setFieldsToExport(array $fieldsToExport): self { diff --git a/lib/Model/UsersExportSegmentPostBody.php b/lib/Model/UsersExportSegmentPostBody.php index e396a2b..008cc9f 100644 --- a/lib/Model/UsersExportSegmentPostBody.php +++ b/lib/Model/UsersExportSegmentPostBody.php @@ -30,7 +30,7 @@ public function isInitialized($property): bool */ protected $callbackEndpoint; /** - * @var string[] + * @var list */ protected $fieldsToExport; /** @@ -65,7 +65,7 @@ public function setCallbackEndpoint(string $callbackEndpoint): self } /** - * @return string[] + * @return list */ public function getFieldsToExport(): array { @@ -73,7 +73,7 @@ public function getFieldsToExport(): array } /** - * @param string[] $fieldsToExport + * @param list $fieldsToExport */ public function setFieldsToExport(array $fieldsToExport): self { diff --git a/lib/Model/UsersExternalIdsRemovePostBody.php b/lib/Model/UsersExternalIdsRemovePostBody.php index 10738cb..777e8e3 100644 --- a/lib/Model/UsersExternalIdsRemovePostBody.php +++ b/lib/Model/UsersExternalIdsRemovePostBody.php @@ -22,12 +22,12 @@ public function isInitialized($property): bool return array_key_exists($property, $this->initialized); } /** - * @var string[] + * @var list */ protected $externalIds; /** - * @return string[] + * @return list */ public function getExternalIds(): array { @@ -35,7 +35,7 @@ public function getExternalIds(): array } /** - * @param string[] $externalIds + * @param list $externalIds */ public function setExternalIds(array $externalIds): self { diff --git a/lib/Model/UsersExternalIdsRenamePostBody.php b/lib/Model/UsersExternalIdsRenamePostBody.php index dd734a6..77acd45 100644 --- a/lib/Model/UsersExternalIdsRenamePostBody.php +++ b/lib/Model/UsersExternalIdsRenamePostBody.php @@ -22,12 +22,12 @@ public function isInitialized($property): bool return array_key_exists($property, $this->initialized); } /** - * @var UsersExternalIdsRenamePostBodyExternalIdRenamesItem[] + * @var list */ protected $externalIdRenames; /** - * @return UsersExternalIdsRenamePostBodyExternalIdRenamesItem[] + * @return list */ public function getExternalIdRenames(): array { @@ -35,7 +35,7 @@ public function getExternalIdRenames(): array } /** - * @param UsersExternalIdsRenamePostBodyExternalIdRenamesItem[] $externalIdRenames + * @param list $externalIdRenames */ public function setExternalIdRenames(array $externalIdRenames): self { diff --git a/lib/Model/UsersIdentifyPostBody.php b/lib/Model/UsersIdentifyPostBody.php index a56eedb..a99ad70 100644 --- a/lib/Model/UsersIdentifyPostBody.php +++ b/lib/Model/UsersIdentifyPostBody.php @@ -22,12 +22,12 @@ public function isInitialized($property): bool return array_key_exists($property, $this->initialized); } /** - * @var UsersIdentifyPostBodyAliasesToIdentifyItem[] + * @var list */ protected $aliasesToIdentify; /** - * @return UsersIdentifyPostBodyAliasesToIdentifyItem[] + * @return list */ public function getAliasesToIdentify(): array { @@ -35,7 +35,7 @@ public function getAliasesToIdentify(): array } /** - * @param UsersIdentifyPostBodyAliasesToIdentifyItem[] $aliasesToIdentify + * @param list $aliasesToIdentify */ public function setAliasesToIdentify(array $aliasesToIdentify): self { diff --git a/lib/Model/UsersMergePostBody.php b/lib/Model/UsersMergePostBody.php index 15d2b21..84e540f 100644 --- a/lib/Model/UsersMergePostBody.php +++ b/lib/Model/UsersMergePostBody.php @@ -22,12 +22,12 @@ public function isInitialized($property): bool return array_key_exists($property, $this->initialized); } /** - * @var mixed[] + * @var list */ protected $mergeUpdates; /** - * @return mixed[] + * @return list */ public function getMergeUpdates(): array { @@ -35,7 +35,7 @@ public function getMergeUpdates(): array } /** - * @param mixed[] $mergeUpdates + * @param list $mergeUpdates */ public function setMergeUpdates(array $mergeUpdates): self { diff --git a/lib/Model/UsersTrackPostBody.php b/lib/Model/UsersTrackPostBody.php index 0581f1d..abc6581 100644 --- a/lib/Model/UsersTrackPostBody.php +++ b/lib/Model/UsersTrackPostBody.php @@ -22,20 +22,20 @@ public function isInitialized($property): bool return array_key_exists($property, $this->initialized); } /** - * @var array[] + * @var list> */ protected $attributes; /** - * @var mixed[] + * @var list */ protected $events; /** - * @var array[] + * @var list> */ protected $purchases; /** - * @return array[] + * @return list> */ public function getAttributes(): array { @@ -43,7 +43,7 @@ public function getAttributes(): array } /** - * @param array[] $attributes + * @param list> $attributes */ public function setAttributes(array $attributes): self { @@ -54,7 +54,7 @@ public function setAttributes(array $attributes): self } /** - * @return mixed[] + * @return list */ public function getEvents(): array { @@ -62,7 +62,7 @@ public function getEvents(): array } /** - * @param mixed[] $events + * @param list $events */ public function setEvents(array $events): self { @@ -73,7 +73,7 @@ public function setEvents(array $events): self } /** - * @return array[] + * @return list> */ public function getPurchases(): array { @@ -81,7 +81,7 @@ public function getPurchases(): array } /** - * @param array[] $purchases + * @param list> $purchases */ public function setPurchases(array $purchases): self { diff --git a/lib/Model/V2SubscriptionStatusSetPostBody.php b/lib/Model/V2SubscriptionStatusSetPostBody.php index c3cc773..baea190 100644 --- a/lib/Model/V2SubscriptionStatusSetPostBody.php +++ b/lib/Model/V2SubscriptionStatusSetPostBody.php @@ -22,12 +22,12 @@ public function isInitialized($property): bool return array_key_exists($property, $this->initialized); } /** - * @var V2SubscriptionStatusSetPostBodySubscriptionGroupsItem[] + * @var list */ protected $subscriptionGroups; /** - * @return V2SubscriptionStatusSetPostBodySubscriptionGroupsItem[] + * @return list */ public function getSubscriptionGroups(): array { @@ -35,7 +35,7 @@ public function getSubscriptionGroups(): array } /** - * @param V2SubscriptionStatusSetPostBodySubscriptionGroupsItem[] $subscriptionGroups + * @param list $subscriptionGroups */ public function setSubscriptionGroups(array $subscriptionGroups): self { diff --git a/lib/Model/V2SubscriptionStatusSetPostBodySubscriptionGroupsItem.php b/lib/Model/V2SubscriptionStatusSetPostBodySubscriptionGroupsItem.php index c05b5ed..e866310 100644 --- a/lib/Model/V2SubscriptionStatusSetPostBodySubscriptionGroupsItem.php +++ b/lib/Model/V2SubscriptionStatusSetPostBodySubscriptionGroupsItem.php @@ -30,7 +30,7 @@ public function isInitialized($property): bool */ protected $subscriptionState; /** - * @var string[] + * @var list */ protected $emails; @@ -61,7 +61,7 @@ public function setSubscriptionState(string $subscriptionState): self } /** - * @return string[] + * @return list */ public function getEmails(): array { @@ -69,7 +69,7 @@ public function getEmails(): array } /** - * @param string[] $emails + * @param list $emails */ public function setEmails(array $emails): self { diff --git a/lib/Normalizer/CampaignsTriggerScheduleCreatePostBodyAudienceNormalizer.php b/lib/Normalizer/CampaignsTriggerScheduleCreatePostBodyAudienceNormalizer.php index d9c4b53..21830d7 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..ddad19f 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..6177b52 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..b0082e1 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..f3582af 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..abe181a 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..67a40b6 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..4dca166 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..84bcb86 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..1060b00 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..3e8a266 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..8fb2917 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..5dcf05c 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..5789867 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..78ba99d 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..9e9d2b4 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..1cb8f25 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..03d2cb4 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..1538697 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..ae19168 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..c0f46a6 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..3dbc6e8 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..4410d2a 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..b574947 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..97c9e72 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..9d02d53 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..016ed6b 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..a0f6129 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..a3e7426 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..c50b685 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..49a72c8 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..df149d9 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..b6381bd 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..7bd31f5 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..cbd7754 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..083d2a8 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..aec71f3 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..3d4052e 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..2275dfd 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..9f8e559 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..ce1559a 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..cdb9e44 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..209c1b7 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..0905cce 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..3b1ab94 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..3a66d6f 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..9a324e7 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..58d048a 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..1571b86 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..43bb450 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..9e24ce8 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..a4dc033 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..f7c9a32 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..fb0fd77 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..042aabe 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..45abf52 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..1496d28 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..e7fa0e6 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..3beacdb 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..d24c2a7 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..6edf89e 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..70b0646 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..d6abb6f 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..06dfe3f 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..bf4c7d9 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..ba972c8 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..4d5a3b8 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..de4b0c5 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..05a73cf 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..be92764 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..4729903 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..6812701 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..cfb4fdf 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..59dd78e 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..4b1c7cb 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..3c2fe61 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..ff69ea5 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..cdc55a9 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..80fa477 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..e9597fe 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..138d6f5 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..72262ea 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..4c75917 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..0a58aa3 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..8f110a2 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..ae01d13 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..df2bfac 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..427c20b 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..0bbed0e 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..5eb3c0b 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..ce9a0a8 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..4668f3f 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..1617ad9 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..567f288 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..77ab73f 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..578fbb3 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..e6303f4 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..2aa690b 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..6a3b180 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..f182d8c 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..e6c7124 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..4ceaa39 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..d27ea02 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..a30e247 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..a260c5a 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..94adc7a 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..37033ca 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..3df9cdc 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; @@ -29,7 +30,7 @@ abstract public function getUri(): string; abstract public function getAuthenticationScopes(): array; - abstract protected function transformResponseBody(ResponseInterface $response, SerializerInterface $serializer, string $contentType = null); + abstract protected function transformResponseBody(ResponseInterface $response, SerializerInterface $serializer, ?string $contentType = null); protected function getExtraHeaders(): array { 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/Client/EndpointTrait.php b/lib/Runtime/Client/EndpointTrait.php index 4322df1..9df0d12 100644 --- a/lib/Runtime/Client/EndpointTrait.php +++ b/lib/Runtime/Client/EndpointTrait.php @@ -15,7 +15,7 @@ trait EndpointTrait { - abstract protected function transformResponseBody(ResponseInterface $response, SerializerInterface $serializer, string $contentType = null); + abstract protected function transformResponseBody(ResponseInterface $response, SerializerInterface $serializer, ?string $contentType = null); public function parseResponse(ResponseInterface $response, SerializerInterface $serializer, string $fetchMode = Client::FETCH_OBJECT) { diff --git a/lib/Runtime/Normalizer/ReferenceNormalizer.php b/lib/Runtime/Normalizer/ReferenceNormalizer.php index a151bc6..6699e31 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);