From 6dbd8887c8ca0fb103e5ce9056162d031a1f5b12 Mon Sep 17 00:00:00 2001 From: Xavier Lacot Date: Fri, 29 Mar 2024 11:54:41 +0100 Subject: [PATCH 1/5] switched the tooling to castor --- .gitignore | 3 +++ CONTRIBUTING.md | 2 +- Makefile | 17 -------------- castor.php | 35 ++++++++++++++++++++++++++++ doc/updating-sdk.md | 7 +++++- tools/php-cs-fixer/.gitignore | 1 + tools/php-cs-fixer/castor.php | 39 ++++++++++++++++++++++++++++++++ tools/php-cs-fixer/composer.json | 5 ++++ 8 files changed, 90 insertions(+), 19 deletions(-) delete mode 100644 Makefile create mode 100644 castor.php create mode 100644 tools/php-cs-fixer/.gitignore create mode 100644 tools/php-cs-fixer/castor.php create mode 100644 tools/php-cs-fixer/composer.json diff --git a/.gitignore b/.gitignore index 761708d..ca2052f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# Castor +/.castor.stub.php + # Composer composer.lock composer.phar diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e9f2273..a3ae7c9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -48,7 +48,7 @@ Use [PHP CS fixer](http://cs.sensiolabs.org/) to make your code compliant with our coding standards: ```shell -make cs +castor qa:cs ``` ## Keeping your fork up-to-date diff --git a/Makefile b/Makefile deleted file mode 100644 index 33eab53..0000000 --- a/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -cs: ## Fix CS violations - ./vendor/bin/php-cs-fixer fix --verbose - -cs_dry_run: ## Display CS violations without fixing it - ./vendor/bin/php-cs-fixer fix --verbose --dry-run - -generate_sdk: ## re-generates the SDK - ./vendor/bin/jane-openapi generate -c .jane-openapi.php - -update_sdk: generate_sdk cs ## re-generates the SDK and fixes CS violations - -.PHONY: help - -help: ## Display this help - @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' - -.DEFAULT_GOAL := help diff --git a/castor.php b/castor.php new file mode 100644 index 0000000..e3e926a --- /dev/null +++ b/castor.php @@ -0,0 +1,35 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace sdk; + +use Castor\Attribute\AsTask; + +use function Castor\exit_code; +use function Castor\import; +use function Castor\io; + +import(__DIR__.'/tools/php-cs-fixer/castor.php'); + +#[AsTask(description: 'Re-generates the SDK using the local specification')] +function generate(): int +{ + io()->comment('Generating the SDK using Jane OpenAPI...'); + $result = exit_code('./vendor/bin/jane-openapi generate -c .jane-openapi.php'); + + if (0 !== $result) { + io()->error('An error occurred while generating the SDK.'); + } else { + io()->success('Successfully generated the SDK'); + } + + return $result; +} diff --git a/doc/updating-sdk.md b/doc/updating-sdk.md index 5e86c23..8637a9b 100644 --- a/doc/updating-sdk.md +++ b/doc/updating-sdk.md @@ -1,5 +1,10 @@ # Updating the SDK +> [!NOTE] +> The tooling for this project uses [Castor](https://castor.jolicode.com/), +> a full-featured PHP task runner. In order to install Castor, see the +> [installation instructions](https://castor.jolicode.com/getting-started/installation/). + ## Edit the API specification First, edit the [Forecast OpenAPI specification](../Resources/forecast-openapi.yaml). @@ -11,7 +16,7 @@ If you are uncomfortable with OpenAPI, please read When the OpenAPI specification has been updated, please regenerate the SDK code: ```bash -make update_sdk +castor generate ``` Please do not change manually code in the `generated` folder, as this would diff --git a/tools/php-cs-fixer/.gitignore b/tools/php-cs-fixer/.gitignore new file mode 100644 index 0000000..57872d0 --- /dev/null +++ b/tools/php-cs-fixer/.gitignore @@ -0,0 +1 @@ +/vendor/ diff --git a/tools/php-cs-fixer/castor.php b/tools/php-cs-fixer/castor.php new file mode 100644 index 0000000..46aff63 --- /dev/null +++ b/tools/php-cs-fixer/castor.php @@ -0,0 +1,39 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace qa; + +use Castor\Attribute\AsOption; +use Castor\Attribute\AsTask; + +use function Castor\run; + +#[AsTask(description: 'Fix CS', aliases: ['cs'])] +function cs( + #[AsOption(description: 'Only shows which files would have been modified.')] + bool $dryRun, +): int { + $command = [__DIR__.'/vendor/bin/php-cs-fixer', 'fix', '--config', \dirname(__DIR__, 2).'/.php-cs-fixer.php']; + + if ($dryRun) { + $command[] = '--dry-run'; + } + + return run($command, allowFailure: true)->getExitCode(); +} + +#[AsTask(description: 'Update php-cs-fixer')] +function update(): int +{ + $command = ['composer', 'update', '-o', '--working-dir', __DIR__]; + + return run($command)->getExitCode(); +} diff --git a/tools/php-cs-fixer/composer.json b/tools/php-cs-fixer/composer.json new file mode 100644 index 0000000..4588c00 --- /dev/null +++ b/tools/php-cs-fixer/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "friendsofphp/php-cs-fixer": "^3.52.1" + } +} From cc180c65bd6c713a6779ad13cf394017a57803d6 Mon Sep 17 00:00:00 2001 From: Xavier Lacot Date: Fri, 29 Mar 2024 11:55:27 +0100 Subject: [PATCH 2/5] update to jane 7.6 and regenerate the SDK --- composer.json | 16 +- generated/Client.php | 196 +++--- generated/Endpoint/CountScheduledHours.php | 6 +- generated/Endpoint/CreateAssignment.php | 6 +- generated/Endpoint/CreatePerson.php | 6 +- generated/Endpoint/CreatePlaceholder.php | 6 +- .../Endpoint/CreateRepeatedAssignmentSet.php | 6 +- generated/Endpoint/CreateRole.php | 6 +- generated/Endpoint/DeleteAssignment.php | 6 +- generated/Endpoint/DeletePerson.php | 6 +- generated/Endpoint/DeletePlaceholder.php | 6 +- .../Endpoint/DeleteRepeatedAssignmentSet.php | 6 +- generated/Endpoint/DeleteRole.php | 6 +- generated/Endpoint/EditAssignment.php | 6 +- generated/Endpoint/EditPerson.php | 6 +- generated/Endpoint/EditPlaceholder.php | 6 +- .../Endpoint/EditRepeatedAssignmentSet.php | 6 +- generated/Endpoint/EditRole.php | 6 +- generated/Endpoint/GetAccount.php | 6 +- generated/Endpoint/GetAssignment.php | 6 +- generated/Endpoint/GetClient.php | 6 +- generated/Endpoint/GetPerson.php | 6 +- generated/Endpoint/GetPlaceholder.php | 6 +- generated/Endpoint/GetProject.php | 6 +- .../Endpoint/GetRemainingBudgetedHours.php | 6 +- .../Endpoint/GetRepeatedAssignmentSet.php | 6 +- generated/Endpoint/GetRole.php | 6 +- generated/Endpoint/ListAssignments.php | 32 +- generated/Endpoint/ListClients.php | 6 +- generated/Endpoint/ListPeople.php | 12 +- generated/Endpoint/ListPlaceholders.php | 6 +- generated/Endpoint/ListProjects.php | 6 +- .../Endpoint/ListRepeatedAssignmentSets.php | 6 +- generated/Endpoint/ListRoles.php | 6 +- generated/Endpoint/WhoAmI.php | 6 +- generated/Model/Account.php | 12 +- generated/Model/AccountAccount.php | 25 +- .../Model/AccountAccountColorLabelsItem.php | 13 +- generated/Model/Assignment.php | 23 +- generated/Model/Assignments.php | 18 +- .../Model/AssignmentsIdGetResponse200.php | 12 +- generated/Model/AssignmentsIdPutBody.php | 12 +- .../Model/AssignmentsIdPutResponse200.php | 12 +- generated/Model/AssignmentsPostBody.php | 12 +- .../Model/AssignmentsPostResponse201.php | 12 +- generated/Model/Client.php | 17 +- generated/Model/Clients.php | 18 +- generated/Model/ClientsIdGetResponse200.php | 12 +- generated/Model/Error.php | 18 +- generated/Model/FutureScheduledHour.php | 15 +- generated/Model/FutureScheduledHours.php | 18 +- generated/Model/People.php | 18 +- generated/Model/PeopleIdGetResponse200.php | 12 +- generated/Model/PeopleIdPutBody.php | 12 +- generated/Model/PeopleIdPutResponse200.php | 12 +- generated/Model/PeoplePostBody.php | 12 +- generated/Model/PeoplePostResponse201.php | 12 +- generated/Model/Person.php | 34 +- generated/Model/PersonWorkingDays.php | 18 +- generated/Model/Placeholder.php | 23 +- generated/Model/PlaceholderBody.php | 12 +- .../Model/PlaceholderBodyPlaceholder.php | 20 +- generated/Model/Placeholders.php | 18 +- .../Model/PlaceholdersIdGetResponse200.php | 12 +- .../Model/PlaceholdersIdPutResponse200.php | 12 +- .../Model/PlaceholdersPostResponse201.php | 12 +- generated/Model/Project.php | 30 +- generated/Model/Projects.php | 18 +- generated/Model/ProjectsIdGetResponse200.php | 12 +- generated/Model/RemainingBudgetedHour.php | 16 +- generated/Model/RemainingBudgetedHours.php | 18 +- generated/Model/RepeatedAssignmentSet.php | 21 +- generated/Model/RepeatedAssignmentSetBody.php | 12 +- ...AssignmentSetBodyRepeatedAssignmentSet.php | 13 +- generated/Model/RepeatedAssignmentSets.php | 18 +- ...RepeatedAssignmentSetsIdGetResponse200.php | 12 +- ...RepeatedAssignmentSetsIdPutResponse200.php | 12 +- .../RepeatedAssignmentSetsPostResponse201.php | 12 +- generated/Model/Role.php | 28 +- generated/Model/RoleBody.php | 12 +- generated/Model/RoleBodyRole.php | 19 +- generated/Model/Roles.php | 18 +- generated/Model/RolesIdGetResponse200.php | 12 +- generated/Model/RolesIdPutResponse200.php | 12 +- generated/Model/RolesPostResponse201.php | 12 +- generated/Model/Subscription.php | 12 +- generated/Model/SubscriptionSubscription.php | 25 +- .../Model/SubscriptionSubscriptionAddress.php | 17 +- .../Model/SubscriptionSubscriptionCard.php | 15 +- .../SubscriptionSubscriptionDiscounts.php | 13 +- generated/Model/User.php | 12 +- generated/Model/UserConnection.php | 14 +- generated/Model/UserConnections.php | 18 +- generated/Model/UserCurrentUser.php | 19 +- ...ccountAccountColorLabelsItemNormalizer.php | 193 ++++-- .../Normalizer/AccountAccountNormalizer.php | 359 ++++++++--- generated/Normalizer/AccountNormalizer.php | 169 +++-- generated/Normalizer/AssignmentNormalizer.php | 435 +++++++++---- .../AssignmentsIdGetResponse200Normalizer.php | 169 +++-- .../AssignmentsIdPutBodyNormalizer.php | 169 +++-- .../AssignmentsIdPutResponse200Normalizer.php | 169 +++-- .../Normalizer/AssignmentsNormalizer.php | 187 ++++-- .../AssignmentsPostBodyNormalizer.php | 169 +++-- .../AssignmentsPostResponse201Normalizer.php | 169 +++-- generated/Normalizer/ClientNormalizer.php | 291 ++++++--- .../ClientsIdGetResponse200Normalizer.php | 169 +++-- generated/Normalizer/ClientsNormalizer.php | 187 ++++-- generated/Normalizer/ErrorNormalizer.php | 193 ++++-- .../FutureScheduledHourNormalizer.php | 233 +++++-- .../FutureScheduledHoursNormalizer.php | 187 ++++-- generated/Normalizer/JaneObjectNormalizer.php | 161 +++-- .../PeopleIdGetResponse200Normalizer.php | 169 +++-- .../Normalizer/PeopleIdPutBodyNormalizer.php | 169 +++-- .../PeopleIdPutResponse200Normalizer.php | 169 +++-- generated/Normalizer/PeopleNormalizer.php | 187 ++++-- .../Normalizer/PeoplePostBodyNormalizer.php | 169 +++-- .../PeoplePostResponse201Normalizer.php | 169 +++-- generated/Normalizer/PersonNormalizer.php | 587 +++++++++++++----- .../PersonWorkingDaysNormalizer.php | 323 +++++++--- .../Normalizer/PlaceholderBodyNormalizer.php | 169 +++-- .../PlaceholderBodyPlaceholderNormalizer.php | 225 +++++-- .../Normalizer/PlaceholderNormalizer.php | 313 +++++++--- ...PlaceholdersIdGetResponse200Normalizer.php | 169 +++-- ...PlaceholdersIdPutResponse200Normalizer.php | 169 +++-- .../Normalizer/PlaceholdersNormalizer.php | 187 ++++-- .../PlaceholdersPostResponse201Normalizer.php | 169 +++-- generated/Normalizer/ProjectNormalizer.php | 495 ++++++++++----- .../ProjectsIdGetResponse200Normalizer.php | 169 +++-- generated/Normalizer/ProjectsNormalizer.php | 187 ++++-- .../RemainingBudgetedHourNormalizer.php | 259 +++++--- .../RemainingBudgetedHoursNormalizer.php | 187 ++++-- .../RepeatedAssignmentSetBodyNormalizer.php | 169 +++-- ...SetBodyRepeatedAssignmentSetNormalizer.php | 189 ++++-- .../RepeatedAssignmentSetNormalizer.php | 245 ++++++-- ...signmentSetsIdGetResponse200Normalizer.php | 169 +++-- ...signmentSetsIdPutResponse200Normalizer.php | 169 +++-- .../RepeatedAssignmentSetsNormalizer.php | 187 ++++-- ...ssignmentSetsPostResponse201Normalizer.php | 169 +++-- generated/Normalizer/RoleBodyNormalizer.php | 169 +++-- .../Normalizer/RoleBodyRoleNormalizer.php | 205 ++++-- generated/Normalizer/RoleNormalizer.php | 309 ++++++--- .../RolesIdGetResponse200Normalizer.php | 169 +++-- .../RolesIdPutResponse200Normalizer.php | 169 +++-- generated/Normalizer/RolesNormalizer.php | 187 ++++-- .../RolesPostResponse201Normalizer.php | 169 +++-- .../Normalizer/SubscriptionNormalizer.php | 169 +++-- ...scriptionSubscriptionAddressNormalizer.php | 297 ++++++--- ...SubscriptionSubscriptionCardNormalizer.php | 245 ++++++-- ...riptionSubscriptionDiscountsNormalizer.php | 197 ++++-- .../SubscriptionSubscriptionNormalizer.php | 505 ++++++++++----- .../Normalizer/UserConnectionNormalizer.php | 211 +++++-- .../Normalizer/UserConnectionsNormalizer.php | 187 ++++-- .../Normalizer/UserCurrentUserNormalizer.php | 219 +++++-- generated/Normalizer/UserNormalizer.php | 169 +++-- generated/Runtime/Client/BaseEndpoint.php | 4 +- generated/Runtime/Client/Client.php | 4 +- generated/Runtime/Client/EndpointTrait.php | 4 +- .../Normalizer/ReferenceNormalizer.php | 43 +- .../Normalizer/ValidationException.php | 31 + .../Runtime/Normalizer/ValidatorTrait.php | 27 + src/Client.php | 4 +- src/ClientFactory.php | 2 +- 162 files changed, 10661 insertions(+), 3962 deletions(-) create mode 100644 generated/Runtime/Normalizer/ValidationException.php create mode 100644 generated/Runtime/Normalizer/ValidatorTrait.php diff --git a/composer.json b/composer.json index 732adcc..4d06f0c 100644 --- a/composer.json +++ b/composer.json @@ -17,15 +17,19 @@ } }, "require": { - "php": ">=7.4", - "jane-php/open-api-runtime": "^7.1", + "php": ">=8.1", + "jane-php/open-api-runtime": "^7.6", "php-http/client-implementation": "*", "php-http/client-common": "^1.9 || ^2.0" }, "require-dev": { - "jane-php/open-api-3": "^7.1", - "symfony/http-client": "^5.4 || ^6.0", - "nyholm/psr7": "^1.3", - "friendsofphp/php-cs-fixer": "^3.2" + "jane-php/open-api-3": "^7.6", + "symfony/http-client": "^5.4 || ^6.0|| ^7.0", + "nyholm/psr7": "^1.6" + }, + "config": { + "allow-plugins": { + "php-http/discovery": true + } } } diff --git a/generated/Client.php b/generated/Client.php index e8ece20..7aef947 100644 --- a/generated/Client.php +++ b/generated/Client.php @@ -11,7 +11,7 @@ namespace JoliCode\Forecast\Api; -class Client extends \JoliCode\Forecast\Api\Runtime\Client\Client +class Client extends Runtime\Client\Client { /** * Returns an account details. @@ -19,11 +19,11 @@ class Client extends \JoliCode\Forecast\Api\Runtime\Client\Client * @param int $id Id of the account * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return \JoliCode\Forecast\Api\Model\Account|\JoliCode\Forecast\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + * @return Model\Account|Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function getAccount(int $id, string $fetch = self::FETCH_OBJECT) { - return $this->executeEndpoint(new \JoliCode\Forecast\Api\Endpoint\GetAccount($id), $fetch); + return $this->executeEndpoint(new Endpoint\GetAccount($id), $fetch); } /** @@ -32,21 +32,21 @@ public function getAccount(int $id, string $fetch = self::FETCH_OBJECT) * @param string $date The date after which to lookup * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return \JoliCode\Forecast\Api\Model\FutureScheduledHours|\JoliCode\Forecast\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + * @return Model\FutureScheduledHours|Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function countScheduledHours(string $date, string $fetch = self::FETCH_OBJECT) { - return $this->executeEndpoint(new \JoliCode\Forecast\Api\Endpoint\CountScheduledHours($date), $fetch); + return $this->executeEndpoint(new Endpoint\CountScheduledHours($date), $fetch); } /** * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return \JoliCode\Forecast\Api\Model\RemainingBudgetedHours|\JoliCode\Forecast\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + * @return Model\RemainingBudgetedHours|Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function getRemainingBudgetedHours(string $fetch = self::FETCH_OBJECT) { - return $this->executeEndpoint(new \JoliCode\Forecast\Api\Endpoint\GetRemainingBudgetedHours(), $fetch); + return $this->executeEndpoint(new Endpoint\GetRemainingBudgetedHours(), $fetch); } /** @@ -55,11 +55,11 @@ public function getRemainingBudgetedHours(string $fetch = self::FETCH_OBJECT) * @param int $id Id of the Assignment * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return \JoliCode\Forecast\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + * @return Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function deleteAssignment(int $id, string $fetch = self::FETCH_OBJECT) { - return $this->executeEndpoint(new \JoliCode\Forecast\Api\Endpoint\DeleteAssignment($id), $fetch); + return $this->executeEndpoint(new Endpoint\DeleteAssignment($id), $fetch); } /** @@ -68,25 +68,24 @@ public function deleteAssignment(int $id, string $fetch = self::FETCH_OBJECT) * @param int $id Id of the Assignment * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return \JoliCode\Forecast\Api\Model\AssignmentsIdGetResponse200|\JoliCode\Forecast\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + * @return Model\AssignmentsIdGetResponse200|Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function getAssignment(int $id, string $fetch = self::FETCH_OBJECT) { - return $this->executeEndpoint(new \JoliCode\Forecast\Api\Endpoint\GetAssignment($id), $fetch); + return $this->executeEndpoint(new Endpoint\GetAssignment($id), $fetch); } /** * Edits an assignment. * - * @param int $id Id of the Assignment - * @param \JoliCode\Forecast\Api\Model\AssignmentsIdPutBody|null $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param int $id Id of the Assignment + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return \JoliCode\Forecast\Api\Model\AssignmentsIdPutResponse200|\JoliCode\Forecast\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + * @return Model\AssignmentsIdPutResponse200|Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function editAssignment(int $id, ?Model\AssignmentsIdPutBody $requestBody = null, string $fetch = self::FETCH_OBJECT) { - return $this->executeEndpoint(new \JoliCode\Forecast\Api\Endpoint\EditAssignment($id, $requestBody), $fetch); + return $this->executeEndpoint(new Endpoint\EditAssignment($id, $requestBody), $fetch); } /** @@ -94,34 +93,33 @@ public function editAssignment(int $id, ?Model\AssignmentsIdPutBody $requestBody * * @param array $queryParameters { * - * @var int $project_id Only return assignments for this project - * @var int $person_id Only return assignments for this person - * @var int $repeated_assignment_set Only return assignments for this repeated assignment set - * @var string $start_date Only return assignments after this date - * @var string $end_date Only return assignments before this date - * @var string $state Pass "active" to only return assignments for currently active users - * } + * @var int $project_id Only return assignments for this project + * @var int $person_id Only return assignments for this person + * @var int $repeated_assignment_set Only return assignments for this repeated assignment set + * @var string $start_date Only return assignments after this date + * @var string $end_date Only return assignments before this date + * @var string $state Pass "active" to only return assignments for currently active users + * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return \JoliCode\Forecast\Api\Model\Assignments|\JoliCode\Forecast\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + * @return Model\Assignments|Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function listAssignments(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { - return $this->executeEndpoint(new \JoliCode\Forecast\Api\Endpoint\ListAssignments($queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\ListAssignments($queryParameters), $fetch); } /** * Creates an assignment. * - * @param \JoliCode\Forecast\Api\Model\AssignmentsPostBody|null $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return \JoliCode\Forecast\Api\Model\AssignmentsPostResponse201|\JoliCode\Forecast\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + * @return Model\AssignmentsPostResponse201|Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function createAssignment(?Model\AssignmentsPostBody $requestBody = null, string $fetch = self::FETCH_OBJECT) { - return $this->executeEndpoint(new \JoliCode\Forecast\Api\Endpoint\CreateAssignment($requestBody), $fetch); + return $this->executeEndpoint(new Endpoint\CreateAssignment($requestBody), $fetch); } /** @@ -130,21 +128,21 @@ public function createAssignment(?Model\AssignmentsPostBody $requestBody = null, * @param int $id Id of the Client * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return \JoliCode\Forecast\Api\Model\ClientsIdGetResponse200|\JoliCode\Forecast\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + * @return Model\ClientsIdGetResponse200|Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function getClient(int $id, string $fetch = self::FETCH_OBJECT) { - return $this->executeEndpoint(new \JoliCode\Forecast\Api\Endpoint\GetClient($id), $fetch); + return $this->executeEndpoint(new Endpoint\GetClient($id), $fetch); } /** * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return \JoliCode\Forecast\Api\Model\Clients|\JoliCode\Forecast\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + * @return Model\Clients|Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function listClients(string $fetch = self::FETCH_OBJECT) { - return $this->executeEndpoint(new \JoliCode\Forecast\Api\Endpoint\ListClients(), $fetch); + return $this->executeEndpoint(new Endpoint\ListClients(), $fetch); } /** @@ -153,11 +151,11 @@ public function listClients(string $fetch = self::FETCH_OBJECT) * @param int $id Id of the Person * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return \JoliCode\Forecast\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + * @return Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function deletePerson(int $id, string $fetch = self::FETCH_OBJECT) { - return $this->executeEndpoint(new \JoliCode\Forecast\Api\Endpoint\DeletePerson($id), $fetch); + return $this->executeEndpoint(new Endpoint\DeletePerson($id), $fetch); } /** @@ -166,25 +164,24 @@ public function deletePerson(int $id, string $fetch = self::FETCH_OBJECT) * @param int $id Id of the Person * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return \JoliCode\Forecast\Api\Model\PeopleIdGetResponse200|\JoliCode\Forecast\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + * @return Model\PeopleIdGetResponse200|Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function getPerson(int $id, string $fetch = self::FETCH_OBJECT) { - return $this->executeEndpoint(new \JoliCode\Forecast\Api\Endpoint\GetPerson($id), $fetch); + return $this->executeEndpoint(new Endpoint\GetPerson($id), $fetch); } /** * Edits a Person. * - * @param int $id Id of the Person - * @param \JoliCode\Forecast\Api\Model\PeopleIdPutBody|null $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param int $id Id of the Person + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return \JoliCode\Forecast\Api\Model\PeopleIdPutResponse200|\JoliCode\Forecast\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + * @return Model\PeopleIdPutResponse200|Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function editPerson(int $id, ?Model\PeopleIdPutBody $requestBody = null, string $fetch = self::FETCH_OBJECT) { - return $this->executeEndpoint(new \JoliCode\Forecast\Api\Endpoint\EditPerson($id, $requestBody), $fetch); + return $this->executeEndpoint(new Endpoint\EditPerson($id, $requestBody), $fetch); } /** @@ -192,29 +189,28 @@ public function editPerson(int $id, ?Model\PeopleIdPutBody $requestBody = null, * * @param array $queryParameters { * - * @var string $state Pass "active" to only return active users. Any other value also returns archived users. - * } + * @var string $state Pass "active" to only return active users. Any other value also returns archived users. + * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return \JoliCode\Forecast\Api\Model\People|\JoliCode\Forecast\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + * @return Model\People|Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function listPeople(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { - return $this->executeEndpoint(new \JoliCode\Forecast\Api\Endpoint\ListPeople($queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\ListPeople($queryParameters), $fetch); } /** * Create a Person. * - * @param \JoliCode\Forecast\Api\Model\PeoplePostBody|null $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return \JoliCode\Forecast\Api\Model\PeoplePostResponse201|\JoliCode\Forecast\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + * @return Model\PeoplePostResponse201|Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function createPerson(?Model\PeoplePostBody $requestBody = null, string $fetch = self::FETCH_OBJECT) { - return $this->executeEndpoint(new \JoliCode\Forecast\Api\Endpoint\CreatePerson($requestBody), $fetch); + return $this->executeEndpoint(new Endpoint\CreatePerson($requestBody), $fetch); } /** @@ -223,11 +219,11 @@ public function createPerson(?Model\PeoplePostBody $requestBody = null, string $ * @param int $id Id of the Placeholder * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return \JoliCode\Forecast\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + * @return Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function deletePlaceholder(int $id, string $fetch = self::FETCH_OBJECT) { - return $this->executeEndpoint(new \JoliCode\Forecast\Api\Endpoint\DeletePlaceholder($id), $fetch); + return $this->executeEndpoint(new Endpoint\DeletePlaceholder($id), $fetch); } /** @@ -236,48 +232,46 @@ public function deletePlaceholder(int $id, string $fetch = self::FETCH_OBJECT) * @param int $id Id of the Placeholder * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return \JoliCode\Forecast\Api\Model\PlaceholdersIdGetResponse200|\JoliCode\Forecast\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + * @return Model\PlaceholdersIdGetResponse200|Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function getPlaceholder(int $id, string $fetch = self::FETCH_OBJECT) { - return $this->executeEndpoint(new \JoliCode\Forecast\Api\Endpoint\GetPlaceholder($id), $fetch); + return $this->executeEndpoint(new Endpoint\GetPlaceholder($id), $fetch); } /** * Edit a Placeholder. * - * @param int $id Id of the Placeholder - * @param \JoliCode\Forecast\Api\Model\PlaceholderBody|null $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param int $id Id of the Placeholder + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return \JoliCode\Forecast\Api\Model\PlaceholdersIdPutResponse200|\JoliCode\Forecast\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + * @return Model\PlaceholdersIdPutResponse200|Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function editPlaceholder(int $id, ?Model\PlaceholderBody $requestBody = null, string $fetch = self::FETCH_OBJECT) { - return $this->executeEndpoint(new \JoliCode\Forecast\Api\Endpoint\EditPlaceholder($id, $requestBody), $fetch); + return $this->executeEndpoint(new Endpoint\EditPlaceholder($id, $requestBody), $fetch); } /** * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return \JoliCode\Forecast\Api\Model\Placeholders|\JoliCode\Forecast\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + * @return Model\Placeholders|Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function listPlaceholders(string $fetch = self::FETCH_OBJECT) { - return $this->executeEndpoint(new \JoliCode\Forecast\Api\Endpoint\ListPlaceholders(), $fetch); + return $this->executeEndpoint(new Endpoint\ListPlaceholders(), $fetch); } /** * Create a Placeholder. * - * @param \JoliCode\Forecast\Api\Model\PlaceholderBody|null $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return \JoliCode\Forecast\Api\Model\PlaceholdersPostResponse201|\JoliCode\Forecast\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + * @return Model\PlaceholdersPostResponse201|Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function createPlaceholder(?Model\PlaceholderBody $requestBody = null, string $fetch = self::FETCH_OBJECT) { - return $this->executeEndpoint(new \JoliCode\Forecast\Api\Endpoint\CreatePlaceholder($requestBody), $fetch); + return $this->executeEndpoint(new Endpoint\CreatePlaceholder($requestBody), $fetch); } /** @@ -286,21 +280,21 @@ public function createPlaceholder(?Model\PlaceholderBody $requestBody = null, st * @param int $id Id of the Project * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return \JoliCode\Forecast\Api\Model\ProjectsIdGetResponse200|\JoliCode\Forecast\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + * @return Model\ProjectsIdGetResponse200|Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function getProject(int $id, string $fetch = self::FETCH_OBJECT) { - return $this->executeEndpoint(new \JoliCode\Forecast\Api\Endpoint\GetProject($id), $fetch); + return $this->executeEndpoint(new Endpoint\GetProject($id), $fetch); } /** * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return \JoliCode\Forecast\Api\Model\Projects|\JoliCode\Forecast\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + * @return Model\Projects|Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function listProjects(string $fetch = self::FETCH_OBJECT) { - return $this->executeEndpoint(new \JoliCode\Forecast\Api\Endpoint\ListProjects(), $fetch); + return $this->executeEndpoint(new Endpoint\ListProjects(), $fetch); } /** @@ -309,11 +303,11 @@ public function listProjects(string $fetch = self::FETCH_OBJECT) * @param int $id Id of the Role * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return \JoliCode\Forecast\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + * @return Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function deleteRole(int $id, string $fetch = self::FETCH_OBJECT) { - return $this->executeEndpoint(new \JoliCode\Forecast\Api\Endpoint\DeleteRole($id), $fetch); + return $this->executeEndpoint(new Endpoint\DeleteRole($id), $fetch); } /** @@ -322,48 +316,46 @@ public function deleteRole(int $id, string $fetch = self::FETCH_OBJECT) * @param int $id Id of the Role * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return \JoliCode\Forecast\Api\Model\RolesIdGetResponse200|\JoliCode\Forecast\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + * @return Model\RolesIdGetResponse200|Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function getRole(int $id, string $fetch = self::FETCH_OBJECT) { - return $this->executeEndpoint(new \JoliCode\Forecast\Api\Endpoint\GetRole($id), $fetch); + return $this->executeEndpoint(new Endpoint\GetRole($id), $fetch); } /** * Edit a Role. * - * @param int $id Id of the Role - * @param \JoliCode\Forecast\Api\Model\RoleBody|null $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param int $id Id of the Role + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return \JoliCode\Forecast\Api\Model\RolesIdPutResponse200|\JoliCode\Forecast\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + * @return Model\RolesIdPutResponse200|Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function editRole(int $id, ?Model\RoleBody $requestBody = null, string $fetch = self::FETCH_OBJECT) { - return $this->executeEndpoint(new \JoliCode\Forecast\Api\Endpoint\EditRole($id, $requestBody), $fetch); + return $this->executeEndpoint(new Endpoint\EditRole($id, $requestBody), $fetch); } /** * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return \JoliCode\Forecast\Api\Model\Roles|\JoliCode\Forecast\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + * @return Model\Roles|Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function listRoles(string $fetch = self::FETCH_OBJECT) { - return $this->executeEndpoint(new \JoliCode\Forecast\Api\Endpoint\ListRoles(), $fetch); + return $this->executeEndpoint(new Endpoint\ListRoles(), $fetch); } /** * Creates a Role. * - * @param \JoliCode\Forecast\Api\Model\RoleBody|null $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return \JoliCode\Forecast\Api\Model\RolesPostResponse201|\JoliCode\Forecast\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + * @return Model\RolesPostResponse201|Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function createRole(?Model\RoleBody $requestBody = null, string $fetch = self::FETCH_OBJECT) { - return $this->executeEndpoint(new \JoliCode\Forecast\Api\Endpoint\CreateRole($requestBody), $fetch); + return $this->executeEndpoint(new Endpoint\CreateRole($requestBody), $fetch); } /** @@ -372,11 +364,11 @@ public function createRole(?Model\RoleBody $requestBody = null, string $fetch = * @param int $id Id of the Repeated Assignment Set * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return \JoliCode\Forecast\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + * @return Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function deleteRepeatedAssignmentSet(int $id, string $fetch = self::FETCH_OBJECT) { - return $this->executeEndpoint(new \JoliCode\Forecast\Api\Endpoint\DeleteRepeatedAssignmentSet($id), $fetch); + return $this->executeEndpoint(new Endpoint\DeleteRepeatedAssignmentSet($id), $fetch); } /** @@ -385,58 +377,56 @@ public function deleteRepeatedAssignmentSet(int $id, string $fetch = self::FETCH * @param int $id Id of the RepeatedAssignmentSet * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return \JoliCode\Forecast\Api\Model\RepeatedAssignmentSetsIdGetResponse200|\JoliCode\Forecast\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + * @return Model\RepeatedAssignmentSetsIdGetResponse200|Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function getRepeatedAssignmentSet(int $id, string $fetch = self::FETCH_OBJECT) { - return $this->executeEndpoint(new \JoliCode\Forecast\Api\Endpoint\GetRepeatedAssignmentSet($id), $fetch); + return $this->executeEndpoint(new Endpoint\GetRepeatedAssignmentSet($id), $fetch); } /** * Modifies a Repeated Assignment Set. * - * @param int $id Id of the RepeatedAssignmentSet - * @param \JoliCode\Forecast\Api\Model\RepeatedAssignmentSetBody|null $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param int $id Id of the RepeatedAssignmentSet + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return \JoliCode\Forecast\Api\Model\RepeatedAssignmentSetsIdPutResponse200|\JoliCode\Forecast\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + * @return Model\RepeatedAssignmentSetsIdPutResponse200|Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function editRepeatedAssignmentSet(int $id, ?Model\RepeatedAssignmentSetBody $requestBody = null, string $fetch = self::FETCH_OBJECT) { - return $this->executeEndpoint(new \JoliCode\Forecast\Api\Endpoint\EditRepeatedAssignmentSet($id, $requestBody), $fetch); + return $this->executeEndpoint(new Endpoint\EditRepeatedAssignmentSet($id, $requestBody), $fetch); } /** * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return \JoliCode\Forecast\Api\Model\RepeatedAssignmentSets|\JoliCode\Forecast\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + * @return Model\RepeatedAssignmentSets|Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function listRepeatedAssignmentSets(string $fetch = self::FETCH_OBJECT) { - return $this->executeEndpoint(new \JoliCode\Forecast\Api\Endpoint\ListRepeatedAssignmentSets(), $fetch); + return $this->executeEndpoint(new Endpoint\ListRepeatedAssignmentSets(), $fetch); } /** * Creates a Repeated Assignment Set. * - * @param \JoliCode\Forecast\Api\Model\RepeatedAssignmentSetBody|null $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return \JoliCode\Forecast\Api\Model\RepeatedAssignmentSetsPostResponse201|\JoliCode\Forecast\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + * @return Model\RepeatedAssignmentSetsPostResponse201|Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function createRepeatedAssignmentSet(?Model\RepeatedAssignmentSetBody $requestBody = null, string $fetch = self::FETCH_OBJECT) { - return $this->executeEndpoint(new \JoliCode\Forecast\Api\Endpoint\CreateRepeatedAssignmentSet($requestBody), $fetch); + return $this->executeEndpoint(new Endpoint\CreateRepeatedAssignmentSet($requestBody), $fetch); } /** * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return \JoliCode\Forecast\Api\Model\User|\JoliCode\Forecast\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + * @return Model\User|Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function whoAmI(string $fetch = self::FETCH_OBJECT) { - return $this->executeEndpoint(new \JoliCode\Forecast\Api\Endpoint\WhoAmI(), $fetch); + return $this->executeEndpoint(new Endpoint\WhoAmI(), $fetch); } public static function create($httpClient = null, array $additionalPlugins = [], array $additionalNormalizers = []) @@ -444,7 +434,7 @@ public static function create($httpClient = null, array $additionalPlugins = [], if (null === $httpClient) { $httpClient = \Http\Discovery\Psr18ClientDiscovery::find(); $plugins = []; - $uri = \Http\Discovery\Psr17FactoryDiscovery::findUrlFactory()->createUri('https://api.forecastapp.com/'); + $uri = \Http\Discovery\Psr17FactoryDiscovery::findUriFactory()->createUri('https://api.forecastapp.com/'); $plugins[] = new \Http\Client\Common\Plugin\AddHostPlugin($uri); $plugins[] = new \Http\Client\Common\Plugin\AddPathPlugin($uri); if (\count($additionalPlugins) > 0) { @@ -454,7 +444,7 @@ public static function create($httpClient = null, array $additionalPlugins = [], } $requestFactory = \Http\Discovery\Psr17FactoryDiscovery::findRequestFactory(); $streamFactory = \Http\Discovery\Psr17FactoryDiscovery::findStreamFactory(); - $normalizers = [new \Symfony\Component\Serializer\Normalizer\ArrayDenormalizer(), new \JoliCode\Forecast\Api\Normalizer\JaneObjectNormalizer()]; + $normalizers = [new \Symfony\Component\Serializer\Normalizer\ArrayDenormalizer(), new Normalizer\JaneObjectNormalizer()]; if (\count($additionalNormalizers) > 0) { $normalizers = array_merge($normalizers, $additionalNormalizers); } diff --git a/generated/Endpoint/CountScheduledHours.php b/generated/Endpoint/CountScheduledHours.php index c50d5fb..6467647 100644 --- a/generated/Endpoint/CountScheduledHours.php +++ b/generated/Endpoint/CountScheduledHours.php @@ -52,12 +52,12 @@ public function getAuthenticationScopes(): array } /** - * {@inheritdoc} - * * @return \JoliCode\Forecast\Api\Model\FutureScheduledHours|\JoliCode\Forecast\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \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(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Forecast\\Api\\Model\\FutureScheduledHours', 'json'); } diff --git a/generated/Endpoint/CreateAssignment.php b/generated/Endpoint/CreateAssignment.php index a368e3c..ad04422 100644 --- a/generated/Endpoint/CreateAssignment.php +++ b/generated/Endpoint/CreateAssignment.php @@ -53,12 +53,12 @@ public function getAuthenticationScopes(): array } /** - * {@inheritdoc} - * * @return \JoliCode\Forecast\Api\Model\AssignmentsPostResponse201|\JoliCode\Forecast\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \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(); if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Forecast\\Api\\Model\\AssignmentsPostResponse201', 'json'); } diff --git a/generated/Endpoint/CreatePerson.php b/generated/Endpoint/CreatePerson.php index 29d1f32..69f742d 100644 --- a/generated/Endpoint/CreatePerson.php +++ b/generated/Endpoint/CreatePerson.php @@ -53,12 +53,12 @@ public function getAuthenticationScopes(): array } /** - * {@inheritdoc} - * * @return \JoliCode\Forecast\Api\Model\PeoplePostResponse201|\JoliCode\Forecast\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \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(); if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Forecast\\Api\\Model\\PeoplePostResponse201', 'json'); } diff --git a/generated/Endpoint/CreatePlaceholder.php b/generated/Endpoint/CreatePlaceholder.php index e2d43cc..3861968 100644 --- a/generated/Endpoint/CreatePlaceholder.php +++ b/generated/Endpoint/CreatePlaceholder.php @@ -53,12 +53,12 @@ public function getAuthenticationScopes(): array } /** - * {@inheritdoc} - * * @return \JoliCode\Forecast\Api\Model\PlaceholdersPostResponse201|\JoliCode\Forecast\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \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(); if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Forecast\\Api\\Model\\PlaceholdersPostResponse201', 'json'); } diff --git a/generated/Endpoint/CreateRepeatedAssignmentSet.php b/generated/Endpoint/CreateRepeatedAssignmentSet.php index 0586184..30946d4 100644 --- a/generated/Endpoint/CreateRepeatedAssignmentSet.php +++ b/generated/Endpoint/CreateRepeatedAssignmentSet.php @@ -53,12 +53,12 @@ public function getAuthenticationScopes(): array } /** - * {@inheritdoc} - * * @return \JoliCode\Forecast\Api\Model\RepeatedAssignmentSetsPostResponse201|\JoliCode\Forecast\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \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(); if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetsPostResponse201', 'json'); } diff --git a/generated/Endpoint/CreateRole.php b/generated/Endpoint/CreateRole.php index 16e5508..b6f349f 100644 --- a/generated/Endpoint/CreateRole.php +++ b/generated/Endpoint/CreateRole.php @@ -53,12 +53,12 @@ public function getAuthenticationScopes(): array } /** - * {@inheritdoc} - * * @return \JoliCode\Forecast\Api\Model\RolesPostResponse201|\JoliCode\Forecast\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \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(); if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Forecast\\Api\\Model\\RolesPostResponse201', 'json'); } diff --git a/generated/Endpoint/DeleteAssignment.php b/generated/Endpoint/DeleteAssignment.php index 7f642de..372bb17 100644 --- a/generated/Endpoint/DeleteAssignment.php +++ b/generated/Endpoint/DeleteAssignment.php @@ -52,12 +52,12 @@ public function getAuthenticationScopes(): array } /** - * {@inheritdoc} - * * @return \JoliCode\Forecast\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \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(); if (204 === $status) { return null; } diff --git a/generated/Endpoint/DeletePerson.php b/generated/Endpoint/DeletePerson.php index 43f43bf..03e85d5 100644 --- a/generated/Endpoint/DeletePerson.php +++ b/generated/Endpoint/DeletePerson.php @@ -52,12 +52,12 @@ public function getAuthenticationScopes(): array } /** - * {@inheritdoc} - * * @return \JoliCode\Forecast\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \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(); if (204 === $status) { return null; } diff --git a/generated/Endpoint/DeletePlaceholder.php b/generated/Endpoint/DeletePlaceholder.php index ffcbd7f..7b293c1 100644 --- a/generated/Endpoint/DeletePlaceholder.php +++ b/generated/Endpoint/DeletePlaceholder.php @@ -52,12 +52,12 @@ public function getAuthenticationScopes(): array } /** - * {@inheritdoc} - * * @return \JoliCode\Forecast\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \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(); if (204 === $status) { return null; } diff --git a/generated/Endpoint/DeleteRepeatedAssignmentSet.php b/generated/Endpoint/DeleteRepeatedAssignmentSet.php index b821510..6470992 100644 --- a/generated/Endpoint/DeleteRepeatedAssignmentSet.php +++ b/generated/Endpoint/DeleteRepeatedAssignmentSet.php @@ -52,12 +52,12 @@ public function getAuthenticationScopes(): array } /** - * {@inheritdoc} - * * @return \JoliCode\Forecast\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \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(); if (204 === $status) { return null; } diff --git a/generated/Endpoint/DeleteRole.php b/generated/Endpoint/DeleteRole.php index 996c94d..4e4df0d 100644 --- a/generated/Endpoint/DeleteRole.php +++ b/generated/Endpoint/DeleteRole.php @@ -52,12 +52,12 @@ public function getAuthenticationScopes(): array } /** - * {@inheritdoc} - * * @return \JoliCode\Forecast\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \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(); if (204 === $status) { return null; } diff --git a/generated/Endpoint/EditAssignment.php b/generated/Endpoint/EditAssignment.php index 9cc8043..ab454b4 100644 --- a/generated/Endpoint/EditAssignment.php +++ b/generated/Endpoint/EditAssignment.php @@ -57,12 +57,12 @@ public function getAuthenticationScopes(): array } /** - * {@inheritdoc} - * * @return \JoliCode\Forecast\Api\Model\AssignmentsIdPutResponse200|\JoliCode\Forecast\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \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(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Forecast\\Api\\Model\\AssignmentsIdPutResponse200', 'json'); } diff --git a/generated/Endpoint/EditPerson.php b/generated/Endpoint/EditPerson.php index a2ede7e..203bea1 100644 --- a/generated/Endpoint/EditPerson.php +++ b/generated/Endpoint/EditPerson.php @@ -57,12 +57,12 @@ public function getAuthenticationScopes(): array } /** - * {@inheritdoc} - * * @return \JoliCode\Forecast\Api\Model\PeopleIdPutResponse200|\JoliCode\Forecast\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \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(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Forecast\\Api\\Model\\PeopleIdPutResponse200', 'json'); } diff --git a/generated/Endpoint/EditPlaceholder.php b/generated/Endpoint/EditPlaceholder.php index 3287cff..781dc41 100644 --- a/generated/Endpoint/EditPlaceholder.php +++ b/generated/Endpoint/EditPlaceholder.php @@ -57,12 +57,12 @@ public function getAuthenticationScopes(): array } /** - * {@inheritdoc} - * * @return \JoliCode\Forecast\Api\Model\PlaceholdersIdPutResponse200|\JoliCode\Forecast\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \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(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Forecast\\Api\\Model\\PlaceholdersIdPutResponse200', 'json'); } diff --git a/generated/Endpoint/EditRepeatedAssignmentSet.php b/generated/Endpoint/EditRepeatedAssignmentSet.php index fd7f0c0..e389468 100644 --- a/generated/Endpoint/EditRepeatedAssignmentSet.php +++ b/generated/Endpoint/EditRepeatedAssignmentSet.php @@ -57,12 +57,12 @@ public function getAuthenticationScopes(): array } /** - * {@inheritdoc} - * * @return \JoliCode\Forecast\Api\Model\RepeatedAssignmentSetsIdPutResponse200|\JoliCode\Forecast\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \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(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetsIdPutResponse200', 'json'); } diff --git a/generated/Endpoint/EditRole.php b/generated/Endpoint/EditRole.php index 3620bfd..d17d99c 100644 --- a/generated/Endpoint/EditRole.php +++ b/generated/Endpoint/EditRole.php @@ -57,12 +57,12 @@ public function getAuthenticationScopes(): array } /** - * {@inheritdoc} - * * @return \JoliCode\Forecast\Api\Model\RolesIdPutResponse200|\JoliCode\Forecast\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \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(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Forecast\\Api\\Model\\RolesIdPutResponse200', 'json'); } diff --git a/generated/Endpoint/GetAccount.php b/generated/Endpoint/GetAccount.php index 879951a..45a26f0 100644 --- a/generated/Endpoint/GetAccount.php +++ b/generated/Endpoint/GetAccount.php @@ -52,12 +52,12 @@ public function getAuthenticationScopes(): array } /** - * {@inheritdoc} - * * @return \JoliCode\Forecast\Api\Model\Account|\JoliCode\Forecast\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \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(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Forecast\\Api\\Model\\Account', 'json'); } diff --git a/generated/Endpoint/GetAssignment.php b/generated/Endpoint/GetAssignment.php index 77e8bf1..ed78c3e 100644 --- a/generated/Endpoint/GetAssignment.php +++ b/generated/Endpoint/GetAssignment.php @@ -52,12 +52,12 @@ public function getAuthenticationScopes(): array } /** - * {@inheritdoc} - * * @return \JoliCode\Forecast\Api\Model\AssignmentsIdGetResponse200|\JoliCode\Forecast\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \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(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Forecast\\Api\\Model\\AssignmentsIdGetResponse200', 'json'); } diff --git a/generated/Endpoint/GetClient.php b/generated/Endpoint/GetClient.php index c1425c2..039cc5b 100644 --- a/generated/Endpoint/GetClient.php +++ b/generated/Endpoint/GetClient.php @@ -52,12 +52,12 @@ public function getAuthenticationScopes(): array } /** - * {@inheritdoc} - * * @return \JoliCode\Forecast\Api\Model\ClientsIdGetResponse200|\JoliCode\Forecast\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \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(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Forecast\\Api\\Model\\ClientsIdGetResponse200', 'json'); } diff --git a/generated/Endpoint/GetPerson.php b/generated/Endpoint/GetPerson.php index 1cf9a02..08c7303 100644 --- a/generated/Endpoint/GetPerson.php +++ b/generated/Endpoint/GetPerson.php @@ -52,12 +52,12 @@ public function getAuthenticationScopes(): array } /** - * {@inheritdoc} - * * @return \JoliCode\Forecast\Api\Model\PeopleIdGetResponse200|\JoliCode\Forecast\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \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(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Forecast\\Api\\Model\\PeopleIdGetResponse200', 'json'); } diff --git a/generated/Endpoint/GetPlaceholder.php b/generated/Endpoint/GetPlaceholder.php index cce77ed..ab6e8a9 100644 --- a/generated/Endpoint/GetPlaceholder.php +++ b/generated/Endpoint/GetPlaceholder.php @@ -52,12 +52,12 @@ public function getAuthenticationScopes(): array } /** - * {@inheritdoc} - * * @return \JoliCode\Forecast\Api\Model\PlaceholdersIdGetResponse200|\JoliCode\Forecast\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \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(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Forecast\\Api\\Model\\PlaceholdersIdGetResponse200', 'json'); } diff --git a/generated/Endpoint/GetProject.php b/generated/Endpoint/GetProject.php index 22efa2a..60f2d22 100644 --- a/generated/Endpoint/GetProject.php +++ b/generated/Endpoint/GetProject.php @@ -52,12 +52,12 @@ public function getAuthenticationScopes(): array } /** - * {@inheritdoc} - * * @return \JoliCode\Forecast\Api\Model\ProjectsIdGetResponse200|\JoliCode\Forecast\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \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(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Forecast\\Api\\Model\\ProjectsIdGetResponse200', 'json'); } diff --git a/generated/Endpoint/GetRemainingBudgetedHours.php b/generated/Endpoint/GetRemainingBudgetedHours.php index 9aecb73..8dc3ee9 100644 --- a/generated/Endpoint/GetRemainingBudgetedHours.php +++ b/generated/Endpoint/GetRemainingBudgetedHours.php @@ -41,12 +41,12 @@ public function getAuthenticationScopes(): array } /** - * {@inheritdoc} - * * @return \JoliCode\Forecast\Api\Model\RemainingBudgetedHours|\JoliCode\Forecast\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \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(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Forecast\\Api\\Model\\RemainingBudgetedHours', 'json'); } diff --git a/generated/Endpoint/GetRepeatedAssignmentSet.php b/generated/Endpoint/GetRepeatedAssignmentSet.php index 4794995..ae2b80d 100644 --- a/generated/Endpoint/GetRepeatedAssignmentSet.php +++ b/generated/Endpoint/GetRepeatedAssignmentSet.php @@ -52,12 +52,12 @@ public function getAuthenticationScopes(): array } /** - * {@inheritdoc} - * * @return \JoliCode\Forecast\Api\Model\RepeatedAssignmentSetsIdGetResponse200|\JoliCode\Forecast\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \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(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetsIdGetResponse200', 'json'); } diff --git a/generated/Endpoint/GetRole.php b/generated/Endpoint/GetRole.php index 0fa9908..d3f2a68 100644 --- a/generated/Endpoint/GetRole.php +++ b/generated/Endpoint/GetRole.php @@ -52,12 +52,12 @@ public function getAuthenticationScopes(): array } /** - * {@inheritdoc} - * * @return \JoliCode\Forecast\Api\Model\RolesIdGetResponse200|\JoliCode\Forecast\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \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(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Forecast\\Api\\Model\\RolesIdGetResponse200', 'json'); } diff --git a/generated/Endpoint/ListAssignments.php b/generated/Endpoint/ListAssignments.php index db332eb..053156f 100644 --- a/generated/Endpoint/ListAssignments.php +++ b/generated/Endpoint/ListAssignments.php @@ -20,13 +20,13 @@ class ListAssignments extends \JoliCode\Forecast\Api\Runtime\Client\BaseEndpoint * * @param array $queryParameters { * - * @var int $project_id Only return assignments for this project - * @var int $person_id Only return assignments for this person - * @var int $repeated_assignment_set Only return assignments for this repeated assignment set - * @var string $start_date Only return assignments after this date - * @var string $end_date Only return assignments before this date - * @var string $state Pass "active" to only return assignments for currently active users - * } + * @var int $project_id Only return assignments for this project + * @var int $person_id Only return assignments for this person + * @var int $repeated_assignment_set Only return assignments for this repeated assignment set + * @var string $start_date Only return assignments after this date + * @var string $end_date Only return assignments before this date + * @var string $state Pass "active" to only return assignments for currently active users + * } */ public function __construct(array $queryParameters = []) { @@ -64,23 +64,23 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['project_id', 'person_id', 'repeated_assignment_set', 'start_date', 'end_date', 'state']); $optionsResolver->setRequired(['start_date', 'end_date']); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('project_id', ['int']); - $optionsResolver->setAllowedTypes('person_id', ['int']); - $optionsResolver->setAllowedTypes('repeated_assignment_set', ['int']); - $optionsResolver->setAllowedTypes('start_date', ['string']); - $optionsResolver->setAllowedTypes('end_date', ['string']); - $optionsResolver->setAllowedTypes('state', ['string']); + $optionsResolver->addAllowedTypes('project_id', ['int']); + $optionsResolver->addAllowedTypes('person_id', ['int']); + $optionsResolver->addAllowedTypes('repeated_assignment_set', ['int']); + $optionsResolver->addAllowedTypes('start_date', ['string']); + $optionsResolver->addAllowedTypes('end_date', ['string']); + $optionsResolver->addAllowedTypes('state', ['string']); return $optionsResolver; } /** - * {@inheritdoc} - * * @return \JoliCode\Forecast\Api\Model\Assignments|\JoliCode\Forecast\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \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(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Forecast\\Api\\Model\\Assignments', 'json'); } diff --git a/generated/Endpoint/ListClients.php b/generated/Endpoint/ListClients.php index 6668145..2d1fab5 100644 --- a/generated/Endpoint/ListClients.php +++ b/generated/Endpoint/ListClients.php @@ -41,12 +41,12 @@ public function getAuthenticationScopes(): array } /** - * {@inheritdoc} - * * @return \JoliCode\Forecast\Api\Model\Clients|\JoliCode\Forecast\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \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(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Forecast\\Api\\Model\\Clients', 'json'); } diff --git a/generated/Endpoint/ListPeople.php b/generated/Endpoint/ListPeople.php index 2760259..963f108 100644 --- a/generated/Endpoint/ListPeople.php +++ b/generated/Endpoint/ListPeople.php @@ -20,8 +20,8 @@ class ListPeople extends \JoliCode\Forecast\Api\Runtime\Client\BaseEndpoint impl * * @param array $queryParameters { * - * @var string $state Pass "active" to only return active users. Any other value also returns archived users. - * } + * @var string $state Pass "active" to only return active users. Any other value also returns archived users. + * } */ public function __construct(array $queryParameters = []) { @@ -59,18 +59,18 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['state']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('state', ['string']); + $optionsResolver->addAllowedTypes('state', ['string']); return $optionsResolver; } /** - * {@inheritdoc} - * * @return \JoliCode\Forecast\Api\Model\People|\JoliCode\Forecast\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \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(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Forecast\\Api\\Model\\People', 'json'); } diff --git a/generated/Endpoint/ListPlaceholders.php b/generated/Endpoint/ListPlaceholders.php index f5d791a..7377b4e 100644 --- a/generated/Endpoint/ListPlaceholders.php +++ b/generated/Endpoint/ListPlaceholders.php @@ -41,12 +41,12 @@ public function getAuthenticationScopes(): array } /** - * {@inheritdoc} - * * @return \JoliCode\Forecast\Api\Model\Placeholders|\JoliCode\Forecast\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \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(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Forecast\\Api\\Model\\Placeholders', 'json'); } diff --git a/generated/Endpoint/ListProjects.php b/generated/Endpoint/ListProjects.php index d646d0d..0448600 100644 --- a/generated/Endpoint/ListProjects.php +++ b/generated/Endpoint/ListProjects.php @@ -41,12 +41,12 @@ public function getAuthenticationScopes(): array } /** - * {@inheritdoc} - * * @return \JoliCode\Forecast\Api\Model\Projects|\JoliCode\Forecast\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \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(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Forecast\\Api\\Model\\Projects', 'json'); } diff --git a/generated/Endpoint/ListRepeatedAssignmentSets.php b/generated/Endpoint/ListRepeatedAssignmentSets.php index 2c7f935..9559c40 100644 --- a/generated/Endpoint/ListRepeatedAssignmentSets.php +++ b/generated/Endpoint/ListRepeatedAssignmentSets.php @@ -41,12 +41,12 @@ public function getAuthenticationScopes(): array } /** - * {@inheritdoc} - * * @return \JoliCode\Forecast\Api\Model\RepeatedAssignmentSets|\JoliCode\Forecast\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \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(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSets', 'json'); } diff --git a/generated/Endpoint/ListRoles.php b/generated/Endpoint/ListRoles.php index 3ceffaa..6037f61 100644 --- a/generated/Endpoint/ListRoles.php +++ b/generated/Endpoint/ListRoles.php @@ -41,12 +41,12 @@ public function getAuthenticationScopes(): array } /** - * {@inheritdoc} - * * @return \JoliCode\Forecast\Api\Model\Roles|\JoliCode\Forecast\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \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(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Forecast\\Api\\Model\\Roles', 'json'); } diff --git a/generated/Endpoint/WhoAmI.php b/generated/Endpoint/WhoAmI.php index 6bc381d..acbe035 100644 --- a/generated/Endpoint/WhoAmI.php +++ b/generated/Endpoint/WhoAmI.php @@ -41,12 +41,12 @@ public function getAuthenticationScopes(): array } /** - * {@inheritdoc} - * * @return \JoliCode\Forecast\Api\Model\User|\JoliCode\Forecast\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \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(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Forecast\\Api\\Model\\User', 'json'); } diff --git a/generated/Model/Account.php b/generated/Model/Account.php index 81e8d69..e94fd93 100644 --- a/generated/Model/Account.php +++ b/generated/Model/Account.php @@ -11,13 +11,22 @@ namespace JoliCode\Forecast\Api\Model; -class Account +class Account extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var AccountAccount|null */ protected $account; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getAccount(): ?AccountAccount { return $this->account; @@ -25,6 +34,7 @@ public function getAccount(): ?AccountAccount public function setAccount(?AccountAccount $account): self { + $this->initialized['account'] = true; $this->account = $account; return $this; diff --git a/generated/Model/AccountAccount.php b/generated/Model/AccountAccount.php index 85bf27b..4b9ce78 100644 --- a/generated/Model/AccountAccount.php +++ b/generated/Model/AccountAccount.php @@ -11,8 +11,12 @@ namespace JoliCode\Forecast\Api\Model; -class AccountAccount +class AccountAccount extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * Id of the account. * @@ -34,7 +38,7 @@ class AccountAccount /** * Available color labels. * - * @var AccountAccountColorLabelsItem[]|null + * @var list|null */ protected $colorLabels; /** @@ -62,6 +66,11 @@ class AccountAccount */ protected $createdAt; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * Id of the account. */ @@ -75,6 +84,7 @@ public function getId(): ?int */ public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -93,6 +103,7 @@ public function getName(): ?string */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -111,6 +122,7 @@ public function getWeeklyCapacity(): ?int */ public function setWeeklyCapacity(?int $weeklyCapacity): self { + $this->initialized['weeklyCapacity'] = true; $this->weeklyCapacity = $weeklyCapacity; return $this; @@ -119,7 +131,7 @@ public function setWeeklyCapacity(?int $weeklyCapacity): self /** * Available color labels. * - * @return AccountAccountColorLabelsItem[]|null + * @return list|null */ public function getColorLabels(): ?array { @@ -129,10 +141,11 @@ public function getColorLabels(): ?array /** * Available color labels. * - * @param AccountAccountColorLabelsItem[]|null $colorLabels + * @param list|null $colorLabels */ public function setColorLabels(?array $colorLabels): self { + $this->initialized['colorLabels'] = true; $this->colorLabels = $colorLabels; return $this; @@ -151,6 +164,7 @@ public function getHarvestSubdomain(): ?string */ public function setHarvestSubdomain(?string $harvestSubdomain): self { + $this->initialized['harvestSubdomain'] = true; $this->harvestSubdomain = $harvestSubdomain; return $this; @@ -169,6 +183,7 @@ public function getHarvestName(): ?string */ public function setHarvestName(?string $harvestName): self { + $this->initialized['harvestName'] = true; $this->harvestName = $harvestName; return $this; @@ -187,6 +202,7 @@ public function getWeekendsEnabled(): ?bool */ public function setWeekendsEnabled(?bool $weekendsEnabled): self { + $this->initialized['weekendsEnabled'] = true; $this->weekendsEnabled = $weekendsEnabled; return $this; @@ -205,6 +221,7 @@ public function getCreatedAt(): ?\DateTime */ public function setCreatedAt(?\DateTime $createdAt): self { + $this->initialized['createdAt'] = true; $this->createdAt = $createdAt; return $this; diff --git a/generated/Model/AccountAccountColorLabelsItem.php b/generated/Model/AccountAccountColorLabelsItem.php index a46f941..c0bd63d 100644 --- a/generated/Model/AccountAccountColorLabelsItem.php +++ b/generated/Model/AccountAccountColorLabelsItem.php @@ -11,8 +11,12 @@ namespace JoliCode\Forecast\Api\Model; -class AccountAccountColorLabelsItem +class AccountAccountColorLabelsItem extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * Name of the color. * @@ -26,6 +30,11 @@ class AccountAccountColorLabelsItem */ protected $label; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * Name of the color. */ @@ -39,6 +48,7 @@ public function getName(): ?string */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -57,6 +67,7 @@ public function getLabel(): ?string */ public function setLabel(?string $label): self { + $this->initialized['label'] = true; $this->label = $label; return $this; diff --git a/generated/Model/Assignment.php b/generated/Model/Assignment.php index f9627a5..269b7f5 100644 --- a/generated/Model/Assignment.php +++ b/generated/Model/Assignment.php @@ -11,8 +11,12 @@ namespace JoliCode\Forecast\Api\Model; -class Assignment +class Assignment extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * should the assignement be also active on days off? * @@ -86,6 +90,11 @@ class Assignment */ protected $updatedById; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * should the assignement be also active on days off? */ @@ -99,6 +108,7 @@ public function getActiveOnDaysOff(): ?bool */ public function setActiveOnDaysOff(?bool $activeOnDaysOff): self { + $this->initialized['activeOnDaysOff'] = true; $this->activeOnDaysOff = $activeOnDaysOff; return $this; @@ -117,6 +127,7 @@ public function getAllocation(): ?int */ public function setAllocation(?int $allocation): self { + $this->initialized['allocation'] = true; $this->allocation = $allocation; return $this; @@ -135,6 +146,7 @@ public function getEndDate(): ?\DateTime */ public function setEndDate(?\DateTime $endDate): self { + $this->initialized['endDate'] = true; $this->endDate = $endDate; return $this; @@ -153,6 +165,7 @@ public function getId(): ?int */ public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -171,6 +184,7 @@ public function getNotes(): ?string */ public function setNotes(?string $notes): self { + $this->initialized['notes'] = true; $this->notes = $notes; return $this; @@ -189,6 +203,7 @@ public function getPersonId(): ?int */ public function setPersonId(?int $personId): self { + $this->initialized['personId'] = true; $this->personId = $personId; return $this; @@ -207,6 +222,7 @@ public function getPlaceholderId(): ?int */ public function setPlaceholderId(?int $placeholderId): self { + $this->initialized['placeholderId'] = true; $this->placeholderId = $placeholderId; return $this; @@ -225,6 +241,7 @@ public function getProjectId(): ?int */ public function setProjectId(?int $projectId): self { + $this->initialized['projectId'] = true; $this->projectId = $projectId; return $this; @@ -243,6 +260,7 @@ public function getRepeatedAssignmentSetId(): ?int */ public function setRepeatedAssignmentSetId(?int $repeatedAssignmentSetId): self { + $this->initialized['repeatedAssignmentSetId'] = true; $this->repeatedAssignmentSetId = $repeatedAssignmentSetId; return $this; @@ -261,6 +279,7 @@ public function getStartDate(): ?\DateTime */ public function setStartDate(?\DateTime $startDate): self { + $this->initialized['startDate'] = true; $this->startDate = $startDate; return $this; @@ -279,6 +298,7 @@ public function getUpdatedAt(): ?\DateTime */ public function setUpdatedAt(?\DateTime $updatedAt): self { + $this->initialized['updatedAt'] = true; $this->updatedAt = $updatedAt; return $this; @@ -297,6 +317,7 @@ public function getUpdatedById(): ?int */ public function setUpdatedById(?int $updatedById): self { + $this->initialized['updatedById'] = true; $this->updatedById = $updatedById; return $this; diff --git a/generated/Model/Assignments.php b/generated/Model/Assignments.php index 4311cef..8b1770d 100644 --- a/generated/Model/Assignments.php +++ b/generated/Model/Assignments.php @@ -11,15 +11,24 @@ namespace JoliCode\Forecast\Api\Model; -class Assignments +class Assignments extends \ArrayObject { /** - * @var Assignment[]|null + * @var array + */ + protected $initialized = []; + /** + * @var list|null */ protected $assignments; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** - * @return Assignment[]|null + * @return list|null */ public function getAssignments(): ?array { @@ -27,10 +36,11 @@ public function getAssignments(): ?array } /** - * @param Assignment[]|null $assignments + * @param list|null $assignments */ public function setAssignments(?array $assignments): self { + $this->initialized['assignments'] = true; $this->assignments = $assignments; return $this; diff --git a/generated/Model/AssignmentsIdGetResponse200.php b/generated/Model/AssignmentsIdGetResponse200.php index 2e99541..0a517e7 100644 --- a/generated/Model/AssignmentsIdGetResponse200.php +++ b/generated/Model/AssignmentsIdGetResponse200.php @@ -11,13 +11,22 @@ namespace JoliCode\Forecast\Api\Model; -class AssignmentsIdGetResponse200 +class AssignmentsIdGetResponse200 extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var Assignment|null */ protected $assignment; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getAssignment(): ?Assignment { return $this->assignment; @@ -25,6 +34,7 @@ public function getAssignment(): ?Assignment public function setAssignment(?Assignment $assignment): self { + $this->initialized['assignment'] = true; $this->assignment = $assignment; return $this; diff --git a/generated/Model/AssignmentsIdPutBody.php b/generated/Model/AssignmentsIdPutBody.php index f3b6433..6913344 100644 --- a/generated/Model/AssignmentsIdPutBody.php +++ b/generated/Model/AssignmentsIdPutBody.php @@ -11,13 +11,22 @@ namespace JoliCode\Forecast\Api\Model; -class AssignmentsIdPutBody +class AssignmentsIdPutBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var Assignment|null */ protected $assignment; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getAssignment(): ?Assignment { return $this->assignment; @@ -25,6 +34,7 @@ public function getAssignment(): ?Assignment public function setAssignment(?Assignment $assignment): self { + $this->initialized['assignment'] = true; $this->assignment = $assignment; return $this; diff --git a/generated/Model/AssignmentsIdPutResponse200.php b/generated/Model/AssignmentsIdPutResponse200.php index e378d7c..d3f2772 100644 --- a/generated/Model/AssignmentsIdPutResponse200.php +++ b/generated/Model/AssignmentsIdPutResponse200.php @@ -11,13 +11,22 @@ namespace JoliCode\Forecast\Api\Model; -class AssignmentsIdPutResponse200 +class AssignmentsIdPutResponse200 extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var Assignment|null */ protected $assignment; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getAssignment(): ?Assignment { return $this->assignment; @@ -25,6 +34,7 @@ public function getAssignment(): ?Assignment public function setAssignment(?Assignment $assignment): self { + $this->initialized['assignment'] = true; $this->assignment = $assignment; return $this; diff --git a/generated/Model/AssignmentsPostBody.php b/generated/Model/AssignmentsPostBody.php index 40e0d3a..3c6cf7c 100644 --- a/generated/Model/AssignmentsPostBody.php +++ b/generated/Model/AssignmentsPostBody.php @@ -11,13 +11,22 @@ namespace JoliCode\Forecast\Api\Model; -class AssignmentsPostBody +class AssignmentsPostBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var Assignment|null */ protected $assignment; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getAssignment(): ?Assignment { return $this->assignment; @@ -25,6 +34,7 @@ public function getAssignment(): ?Assignment public function setAssignment(?Assignment $assignment): self { + $this->initialized['assignment'] = true; $this->assignment = $assignment; return $this; diff --git a/generated/Model/AssignmentsPostResponse201.php b/generated/Model/AssignmentsPostResponse201.php index b94e879..2b61c79 100644 --- a/generated/Model/AssignmentsPostResponse201.php +++ b/generated/Model/AssignmentsPostResponse201.php @@ -11,13 +11,22 @@ namespace JoliCode\Forecast\Api\Model; -class AssignmentsPostResponse201 +class AssignmentsPostResponse201 extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var Assignment|null */ protected $assignment; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getAssignment(): ?Assignment { return $this->assignment; @@ -25,6 +34,7 @@ public function getAssignment(): ?Assignment public function setAssignment(?Assignment $assignment): self { + $this->initialized['assignment'] = true; $this->assignment = $assignment; return $this; diff --git a/generated/Model/Client.php b/generated/Model/Client.php index 0c578a5..6ea08fb 100644 --- a/generated/Model/Client.php +++ b/generated/Model/Client.php @@ -11,8 +11,12 @@ namespace JoliCode\Forecast\Api\Model; -class Client +class Client extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * Is this client archived? * @@ -50,6 +54,11 @@ class Client */ protected $updatedById; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * Is this client archived? */ @@ -63,6 +72,7 @@ public function getArchived(): ?bool */ public function setArchived(?bool $archived): self { + $this->initialized['archived'] = true; $this->archived = $archived; return $this; @@ -81,6 +91,7 @@ public function getHarvestId(): ?int */ public function setHarvestId(?int $harvestId): self { + $this->initialized['harvestId'] = true; $this->harvestId = $harvestId; return $this; @@ -99,6 +110,7 @@ public function getId(): ?int */ public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -117,6 +129,7 @@ public function getName(): ?string */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -135,6 +148,7 @@ public function getUpdatedAt(): ?\DateTime */ public function setUpdatedAt(?\DateTime $updatedAt): self { + $this->initialized['updatedAt'] = true; $this->updatedAt = $updatedAt; return $this; @@ -153,6 +167,7 @@ public function getUpdatedById(): ?int */ public function setUpdatedById(?int $updatedById): self { + $this->initialized['updatedById'] = true; $this->updatedById = $updatedById; return $this; diff --git a/generated/Model/Clients.php b/generated/Model/Clients.php index f9664ce..8311d48 100644 --- a/generated/Model/Clients.php +++ b/generated/Model/Clients.php @@ -11,15 +11,24 @@ namespace JoliCode\Forecast\Api\Model; -class Clients +class Clients extends \ArrayObject { /** - * @var Client[]|null + * @var array + */ + protected $initialized = []; + /** + * @var list|null */ protected $clients; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** - * @return Client[]|null + * @return list|null */ public function getClients(): ?array { @@ -27,10 +36,11 @@ public function getClients(): ?array } /** - * @param Client[]|null $clients + * @param list|null $clients */ public function setClients(?array $clients): self { + $this->initialized['clients'] = true; $this->clients = $clients; return $this; diff --git a/generated/Model/ClientsIdGetResponse200.php b/generated/Model/ClientsIdGetResponse200.php index bb4fab3..4990a43 100644 --- a/generated/Model/ClientsIdGetResponse200.php +++ b/generated/Model/ClientsIdGetResponse200.php @@ -11,13 +11,22 @@ namespace JoliCode\Forecast\Api\Model; -class ClientsIdGetResponse200 +class ClientsIdGetResponse200 extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var Client|null */ protected $client; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getClient(): ?Client { return $this->client; @@ -25,6 +34,7 @@ public function getClient(): ?Client public function setClient(?Client $client): self { + $this->initialized['client'] = true; $this->client = $client; return $this; diff --git a/generated/Model/Error.php b/generated/Model/Error.php index 5d88bd7..31cbe28 100644 --- a/generated/Model/Error.php +++ b/generated/Model/Error.php @@ -11,15 +11,24 @@ namespace JoliCode\Forecast\Api\Model; -class Error +class Error extends \ArrayObject { /** - * @var string[]|null + * @var array + */ + protected $initialized = []; + /** + * @var list|null */ protected $errors; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** - * @return string[]|null + * @return list|null */ public function getErrors(): ?array { @@ -27,10 +36,11 @@ public function getErrors(): ?array } /** - * @param string[]|null $errors + * @param list|null $errors */ public function setErrors(?array $errors): self { + $this->initialized['errors'] = true; $this->errors = $errors; return $this; diff --git a/generated/Model/FutureScheduledHour.php b/generated/Model/FutureScheduledHour.php index caa3583..5769335 100644 --- a/generated/Model/FutureScheduledHour.php +++ b/generated/Model/FutureScheduledHour.php @@ -11,8 +11,12 @@ namespace JoliCode\Forecast\Api\Model; -class FutureScheduledHour +class FutureScheduledHour extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * Number of hours allocated. * @@ -38,6 +42,11 @@ class FutureScheduledHour */ protected $projectId; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * Number of hours allocated. */ @@ -51,6 +60,7 @@ public function getAllocation(): ?int */ public function setAllocation(?int $allocation): self { + $this->initialized['allocation'] = true; $this->allocation = $allocation; return $this; @@ -69,6 +79,7 @@ public function getPersonId(): ?int */ public function setPersonId(?int $personId): self { + $this->initialized['personId'] = true; $this->personId = $personId; return $this; @@ -87,6 +98,7 @@ public function getPlaceholderId(): ?int */ public function setPlaceholderId(?int $placeholderId): self { + $this->initialized['placeholderId'] = true; $this->placeholderId = $placeholderId; return $this; @@ -105,6 +117,7 @@ public function getProjectId(): ?int */ public function setProjectId(?int $projectId): self { + $this->initialized['projectId'] = true; $this->projectId = $projectId; return $this; diff --git a/generated/Model/FutureScheduledHours.php b/generated/Model/FutureScheduledHours.php index b394387..9bbfd29 100644 --- a/generated/Model/FutureScheduledHours.php +++ b/generated/Model/FutureScheduledHours.php @@ -11,15 +11,24 @@ namespace JoliCode\Forecast\Api\Model; -class FutureScheduledHours +class FutureScheduledHours extends \ArrayObject { /** - * @var FutureScheduledHour[]|null + * @var array + */ + protected $initialized = []; + /** + * @var list|null */ protected $futureScheduledHours; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** - * @return FutureScheduledHour[]|null + * @return list|null */ public function getFutureScheduledHours(): ?array { @@ -27,10 +36,11 @@ public function getFutureScheduledHours(): ?array } /** - * @param FutureScheduledHour[]|null $futureScheduledHours + * @param list|null $futureScheduledHours */ public function setFutureScheduledHours(?array $futureScheduledHours): self { + $this->initialized['futureScheduledHours'] = true; $this->futureScheduledHours = $futureScheduledHours; return $this; diff --git a/generated/Model/People.php b/generated/Model/People.php index 9d0a51b..9d7ebfb 100644 --- a/generated/Model/People.php +++ b/generated/Model/People.php @@ -11,15 +11,24 @@ namespace JoliCode\Forecast\Api\Model; -class People +class People extends \ArrayObject { /** - * @var Person[]|null + * @var array + */ + protected $initialized = []; + /** + * @var list|null */ protected $people; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** - * @return Person[]|null + * @return list|null */ public function getPeople(): ?array { @@ -27,10 +36,11 @@ public function getPeople(): ?array } /** - * @param Person[]|null $people + * @param list|null $people */ public function setPeople(?array $people): self { + $this->initialized['people'] = true; $this->people = $people; return $this; diff --git a/generated/Model/PeopleIdGetResponse200.php b/generated/Model/PeopleIdGetResponse200.php index 6b2c49b..27bd1d9 100644 --- a/generated/Model/PeopleIdGetResponse200.php +++ b/generated/Model/PeopleIdGetResponse200.php @@ -11,13 +11,22 @@ namespace JoliCode\Forecast\Api\Model; -class PeopleIdGetResponse200 +class PeopleIdGetResponse200 extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var Person|null */ protected $person; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getPerson(): ?Person { return $this->person; @@ -25,6 +34,7 @@ public function getPerson(): ?Person public function setPerson(?Person $person): self { + $this->initialized['person'] = true; $this->person = $person; return $this; diff --git a/generated/Model/PeopleIdPutBody.php b/generated/Model/PeopleIdPutBody.php index ac6eaf1..fd4ae97 100644 --- a/generated/Model/PeopleIdPutBody.php +++ b/generated/Model/PeopleIdPutBody.php @@ -11,13 +11,22 @@ namespace JoliCode\Forecast\Api\Model; -class PeopleIdPutBody +class PeopleIdPutBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var Person|null */ protected $person; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getPerson(): ?Person { return $this->person; @@ -25,6 +34,7 @@ public function getPerson(): ?Person public function setPerson(?Person $person): self { + $this->initialized['person'] = true; $this->person = $person; return $this; diff --git a/generated/Model/PeopleIdPutResponse200.php b/generated/Model/PeopleIdPutResponse200.php index 48eb0d2..bfa7fb2 100644 --- a/generated/Model/PeopleIdPutResponse200.php +++ b/generated/Model/PeopleIdPutResponse200.php @@ -11,13 +11,22 @@ namespace JoliCode\Forecast\Api\Model; -class PeopleIdPutResponse200 +class PeopleIdPutResponse200 extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var Person|null */ protected $person; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getPerson(): ?Person { return $this->person; @@ -25,6 +34,7 @@ public function getPerson(): ?Person public function setPerson(?Person $person): self { + $this->initialized['person'] = true; $this->person = $person; return $this; diff --git a/generated/Model/PeoplePostBody.php b/generated/Model/PeoplePostBody.php index 32aaa14..29c8163 100644 --- a/generated/Model/PeoplePostBody.php +++ b/generated/Model/PeoplePostBody.php @@ -11,13 +11,22 @@ namespace JoliCode\Forecast\Api\Model; -class PeoplePostBody +class PeoplePostBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var Person|null */ protected $person; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getPerson(): ?Person { return $this->person; @@ -25,6 +34,7 @@ public function getPerson(): ?Person public function setPerson(?Person $person): self { + $this->initialized['person'] = true; $this->person = $person; return $this; diff --git a/generated/Model/PeoplePostResponse201.php b/generated/Model/PeoplePostResponse201.php index 7100ddf..0780eda 100644 --- a/generated/Model/PeoplePostResponse201.php +++ b/generated/Model/PeoplePostResponse201.php @@ -11,13 +11,22 @@ namespace JoliCode\Forecast\Api\Model; -class PeoplePostResponse201 +class PeoplePostResponse201 extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var Person|null */ protected $person; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getPerson(): ?Person { return $this->person; @@ -25,6 +34,7 @@ public function getPerson(): ?Person public function setPerson(?Person $person): self { + $this->initialized['person'] = true; $this->person = $person; return $this; diff --git a/generated/Model/Person.php b/generated/Model/Person.php index f930737..8ea8258 100644 --- a/generated/Model/Person.php +++ b/generated/Model/Person.php @@ -11,8 +11,12 @@ namespace JoliCode\Forecast\Api\Model; -class Person +class Person extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var int|null */ @@ -60,7 +64,7 @@ class Person */ protected $avatarUrl; /** - * @var string[]|null + * @var list|null */ protected $roles; /** @@ -100,6 +104,11 @@ class Person */ protected $personalFeedTokenId; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getId(): ?int { return $this->id; @@ -107,6 +116,7 @@ public function getId(): ?int public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -119,6 +129,7 @@ public function getFirstName(): ?string public function setFirstName(?string $firstName): self { + $this->initialized['firstName'] = true; $this->firstName = $firstName; return $this; @@ -131,6 +142,7 @@ public function getLastName(): ?string public function setLastName(?string $lastName): self { + $this->initialized['lastName'] = true; $this->lastName = $lastName; return $this; @@ -143,6 +155,7 @@ public function getEmail(): ?string public function setEmail(?string $email): self { + $this->initialized['email'] = true; $this->email = $email; return $this; @@ -161,6 +174,7 @@ public function getLogin(): ?string */ public function setLogin(?string $login): self { + $this->initialized['login'] = true; $this->login = $login; return $this; @@ -179,6 +193,7 @@ public function getAdmin(): ?bool */ public function setAdmin(?bool $admin): self { + $this->initialized['admin'] = true; $this->admin = $admin; return $this; @@ -197,6 +212,7 @@ public function getArchived(): ?bool */ public function setArchived(?bool $archived): self { + $this->initialized['archived'] = true; $this->archived = $archived; return $this; @@ -215,6 +231,7 @@ public function getSubscribed(): ?bool */ public function setSubscribed(?bool $subscribed): self { + $this->initialized['subscribed'] = true; $this->subscribed = $subscribed; return $this; @@ -233,13 +250,14 @@ public function getAvatarUrl(): ?string */ public function setAvatarUrl(?string $avatarUrl): self { + $this->initialized['avatarUrl'] = true; $this->avatarUrl = $avatarUrl; return $this; } /** - * @return string[]|null + * @return list|null */ public function getRoles(): ?array { @@ -247,10 +265,11 @@ public function getRoles(): ?array } /** - * @param string[]|null $roles + * @param list|null $roles */ public function setRoles(?array $roles): self { + $this->initialized['roles'] = true; $this->roles = $roles; return $this; @@ -269,6 +288,7 @@ public function getUpdatedAt(): ?\DateTime */ public function setUpdatedAt(?\DateTime $updatedAt): self { + $this->initialized['updatedAt'] = true; $this->updatedAt = $updatedAt; return $this; @@ -287,6 +307,7 @@ public function getUpdatedById(): ?int */ public function setUpdatedById(?int $updatedById): self { + $this->initialized['updatedById'] = true; $this->updatedById = $updatedById; return $this; @@ -305,6 +326,7 @@ public function getHarvestUserId(): ?int */ public function setHarvestUserId(?int $harvestUserId): self { + $this->initialized['harvestUserId'] = true; $this->harvestUserId = $harvestUserId; return $this; @@ -323,6 +345,7 @@ public function getWeeklyCapacity(): ?int */ public function setWeeklyCapacity(?int $weeklyCapacity): self { + $this->initialized['weeklyCapacity'] = true; $this->weeklyCapacity = $weeklyCapacity; return $this; @@ -335,6 +358,7 @@ public function getWorkingDays(): ?PersonWorkingDays public function setWorkingDays(?PersonWorkingDays $workingDays): self { + $this->initialized['workingDays'] = true; $this->workingDays = $workingDays; return $this; @@ -347,6 +371,7 @@ public function getColorBlind(): ?bool public function setColorBlind(?bool $colorBlind): self { + $this->initialized['colorBlind'] = true; $this->colorBlind = $colorBlind; return $this; @@ -359,6 +384,7 @@ public function getPersonalFeedTokenId(): ?int public function setPersonalFeedTokenId(?int $personalFeedTokenId): self { + $this->initialized['personalFeedTokenId'] = true; $this->personalFeedTokenId = $personalFeedTokenId; return $this; diff --git a/generated/Model/PersonWorkingDays.php b/generated/Model/PersonWorkingDays.php index 253c718..5bd3acd 100644 --- a/generated/Model/PersonWorkingDays.php +++ b/generated/Model/PersonWorkingDays.php @@ -11,8 +11,12 @@ namespace JoliCode\Forecast\Api\Model; -class PersonWorkingDays +class PersonWorkingDays extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var bool|null */ @@ -42,6 +46,11 @@ class PersonWorkingDays */ protected $sunday; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getMonday(): ?bool { return $this->monday; @@ -49,6 +58,7 @@ public function getMonday(): ?bool public function setMonday(?bool $monday): self { + $this->initialized['monday'] = true; $this->monday = $monday; return $this; @@ -61,6 +71,7 @@ public function getTuesday(): ?bool public function setTuesday(?bool $tuesday): self { + $this->initialized['tuesday'] = true; $this->tuesday = $tuesday; return $this; @@ -73,6 +84,7 @@ public function getWednesday(): ?bool public function setWednesday(?bool $wednesday): self { + $this->initialized['wednesday'] = true; $this->wednesday = $wednesday; return $this; @@ -85,6 +97,7 @@ public function getThursday(): ?bool public function setThursday(?bool $thursday): self { + $this->initialized['thursday'] = true; $this->thursday = $thursday; return $this; @@ -97,6 +110,7 @@ public function getFriday(): ?bool public function setFriday(?bool $friday): self { + $this->initialized['friday'] = true; $this->friday = $friday; return $this; @@ -109,6 +123,7 @@ public function getSaturday(): ?bool public function setSaturday(?bool $saturday): self { + $this->initialized['saturday'] = true; $this->saturday = $saturday; return $this; @@ -121,6 +136,7 @@ public function getSunday(): ?bool public function setSunday(?bool $sunday): self { + $this->initialized['sunday'] = true; $this->sunday = $sunday; return $this; diff --git a/generated/Model/Placeholder.php b/generated/Model/Placeholder.php index 123056b..13f035a 100644 --- a/generated/Model/Placeholder.php +++ b/generated/Model/Placeholder.php @@ -11,8 +11,12 @@ namespace JoliCode\Forecast\Api\Model; -class Placeholder +class Placeholder extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var bool|null */ @@ -26,7 +30,7 @@ class Placeholder */ protected $name; /** - * @var string[]|null + * @var list|null */ protected $roles; /** @@ -42,6 +46,11 @@ class Placeholder */ protected $updatedById; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getArchived(): ?bool { return $this->archived; @@ -49,6 +58,7 @@ public function getArchived(): ?bool public function setArchived(?bool $archived): self { + $this->initialized['archived'] = true; $this->archived = $archived; return $this; @@ -61,6 +71,7 @@ public function getId(): ?int public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -73,13 +84,14 @@ public function getName(): ?string public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; } /** - * @return string[]|null + * @return list|null */ public function getRoles(): ?array { @@ -87,10 +99,11 @@ public function getRoles(): ?array } /** - * @param string[]|null $roles + * @param list|null $roles */ public function setRoles(?array $roles): self { + $this->initialized['roles'] = true; $this->roles = $roles; return $this; @@ -109,6 +122,7 @@ public function getUpdatedAt(): ?\DateTime */ public function setUpdatedAt(?\DateTime $updatedAt): self { + $this->initialized['updatedAt'] = true; $this->updatedAt = $updatedAt; return $this; @@ -127,6 +141,7 @@ public function getUpdatedById(): ?int */ public function setUpdatedById(?int $updatedById): self { + $this->initialized['updatedById'] = true; $this->updatedById = $updatedById; return $this; diff --git a/generated/Model/PlaceholderBody.php b/generated/Model/PlaceholderBody.php index 2002c7c..3195b42 100644 --- a/generated/Model/PlaceholderBody.php +++ b/generated/Model/PlaceholderBody.php @@ -11,13 +11,22 @@ namespace JoliCode\Forecast\Api\Model; -class PlaceholderBody +class PlaceholderBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var PlaceholderBodyPlaceholder|null */ protected $placeholder; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getPlaceholder(): ?PlaceholderBodyPlaceholder { return $this->placeholder; @@ -25,6 +34,7 @@ public function getPlaceholder(): ?PlaceholderBodyPlaceholder public function setPlaceholder(?PlaceholderBodyPlaceholder $placeholder): self { + $this->initialized['placeholder'] = true; $this->placeholder = $placeholder; return $this; diff --git a/generated/Model/PlaceholderBodyPlaceholder.php b/generated/Model/PlaceholderBodyPlaceholder.php index c422aed..30fac3b 100644 --- a/generated/Model/PlaceholderBodyPlaceholder.php +++ b/generated/Model/PlaceholderBodyPlaceholder.php @@ -11,8 +11,12 @@ namespace JoliCode\Forecast\Api\Model; -class PlaceholderBodyPlaceholder +class PlaceholderBodyPlaceholder extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var bool|null */ @@ -22,10 +26,15 @@ class PlaceholderBodyPlaceholder */ protected $name; /** - * @var string[]|null + * @var list|null */ protected $roles; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getArchived(): ?bool { return $this->archived; @@ -33,6 +42,7 @@ public function getArchived(): ?bool public function setArchived(?bool $archived): self { + $this->initialized['archived'] = true; $this->archived = $archived; return $this; @@ -45,13 +55,14 @@ public function getName(): ?string public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; } /** - * @return string[]|null + * @return list|null */ public function getRoles(): ?array { @@ -59,10 +70,11 @@ public function getRoles(): ?array } /** - * @param string[]|null $roles + * @param list|null $roles */ public function setRoles(?array $roles): self { + $this->initialized['roles'] = true; $this->roles = $roles; return $this; diff --git a/generated/Model/Placeholders.php b/generated/Model/Placeholders.php index d887c64..ab7e4b6 100644 --- a/generated/Model/Placeholders.php +++ b/generated/Model/Placeholders.php @@ -11,15 +11,24 @@ namespace JoliCode\Forecast\Api\Model; -class Placeholders +class Placeholders extends \ArrayObject { /** - * @var Placeholder[]|null + * @var array + */ + protected $initialized = []; + /** + * @var list|null */ protected $placeholders; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** - * @return Placeholder[]|null + * @return list|null */ public function getPlaceholders(): ?array { @@ -27,10 +36,11 @@ public function getPlaceholders(): ?array } /** - * @param Placeholder[]|null $placeholders + * @param list|null $placeholders */ public function setPlaceholders(?array $placeholders): self { + $this->initialized['placeholders'] = true; $this->placeholders = $placeholders; return $this; diff --git a/generated/Model/PlaceholdersIdGetResponse200.php b/generated/Model/PlaceholdersIdGetResponse200.php index df9625d..add9d91 100644 --- a/generated/Model/PlaceholdersIdGetResponse200.php +++ b/generated/Model/PlaceholdersIdGetResponse200.php @@ -11,13 +11,22 @@ namespace JoliCode\Forecast\Api\Model; -class PlaceholdersIdGetResponse200 +class PlaceholdersIdGetResponse200 extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var Placeholder|null */ protected $placeholder; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getPlaceholder(): ?Placeholder { return $this->placeholder; @@ -25,6 +34,7 @@ public function getPlaceholder(): ?Placeholder public function setPlaceholder(?Placeholder $placeholder): self { + $this->initialized['placeholder'] = true; $this->placeholder = $placeholder; return $this; diff --git a/generated/Model/PlaceholdersIdPutResponse200.php b/generated/Model/PlaceholdersIdPutResponse200.php index b8f00c3..e4308fb 100644 --- a/generated/Model/PlaceholdersIdPutResponse200.php +++ b/generated/Model/PlaceholdersIdPutResponse200.php @@ -11,13 +11,22 @@ namespace JoliCode\Forecast\Api\Model; -class PlaceholdersIdPutResponse200 +class PlaceholdersIdPutResponse200 extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var Placeholder|null */ protected $placeholder; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getPlaceholder(): ?Placeholder { return $this->placeholder; @@ -25,6 +34,7 @@ public function getPlaceholder(): ?Placeholder public function setPlaceholder(?Placeholder $placeholder): self { + $this->initialized['placeholder'] = true; $this->placeholder = $placeholder; return $this; diff --git a/generated/Model/PlaceholdersPostResponse201.php b/generated/Model/PlaceholdersPostResponse201.php index f26b199..3aae8d6 100644 --- a/generated/Model/PlaceholdersPostResponse201.php +++ b/generated/Model/PlaceholdersPostResponse201.php @@ -11,13 +11,22 @@ namespace JoliCode\Forecast\Api\Model; -class PlaceholdersPostResponse201 +class PlaceholdersPostResponse201 extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var Placeholder|null */ protected $placeholder; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getPlaceholder(): ?Placeholder { return $this->placeholder; @@ -25,6 +34,7 @@ public function getPlaceholder(): ?Placeholder public function setPlaceholder(?Placeholder $placeholder): self { + $this->initialized['placeholder'] = true; $this->placeholder = $placeholder; return $this; diff --git a/generated/Model/Project.php b/generated/Model/Project.php index a4690b7..79db550 100644 --- a/generated/Model/Project.php +++ b/generated/Model/Project.php @@ -11,8 +11,12 @@ namespace JoliCode\Forecast\Api\Model; -class Project +class Project extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var bool|null */ @@ -56,7 +60,7 @@ class Project */ protected $startDate; /** - * @var string[]|null + * @var list|null */ protected $tags; /** @@ -72,6 +76,11 @@ class Project */ protected $updatedById; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getArchived(): ?bool { return $this->archived; @@ -79,6 +88,7 @@ public function getArchived(): ?bool public function setArchived(?bool $archived): self { + $this->initialized['archived'] = true; $this->archived = $archived; return $this; @@ -91,6 +101,7 @@ public function getClientId(): ?int public function setClientId(?int $clientId): self { + $this->initialized['clientId'] = true; $this->clientId = $clientId; return $this; @@ -103,6 +114,7 @@ public function getCode(): ?string public function setCode(?string $code): self { + $this->initialized['code'] = true; $this->code = $code; return $this; @@ -115,6 +127,7 @@ public function getColor(): ?string public function setColor(?string $color): self { + $this->initialized['color'] = true; $this->color = $color; return $this; @@ -127,6 +140,7 @@ public function getEndDate(): ?\DateTime public function setEndDate(?\DateTime $endDate): self { + $this->initialized['endDate'] = true; $this->endDate = $endDate; return $this; @@ -139,6 +153,7 @@ public function getHarvestId(): ?int public function setHarvestId(?int $harvestId): self { + $this->initialized['harvestId'] = true; $this->harvestId = $harvestId; return $this; @@ -151,6 +166,7 @@ public function getId(): ?int public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -163,6 +179,7 @@ public function getName(): ?string public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -181,6 +198,7 @@ public function getNotes(): ?string */ public function setNotes(?string $notes): self { + $this->initialized['notes'] = true; $this->notes = $notes; return $this; @@ -193,13 +211,14 @@ public function getStartDate(): ?\DateTime public function setStartDate(?\DateTime $startDate): self { + $this->initialized['startDate'] = true; $this->startDate = $startDate; return $this; } /** - * @return string[]|null + * @return list|null */ public function getTags(): ?array { @@ -207,10 +226,11 @@ public function getTags(): ?array } /** - * @param string[]|null $tags + * @param list|null $tags */ public function setTags(?array $tags): self { + $this->initialized['tags'] = true; $this->tags = $tags; return $this; @@ -229,6 +249,7 @@ public function getUpdatedAt(): ?\DateTime */ public function setUpdatedAt(?\DateTime $updatedAt): self { + $this->initialized['updatedAt'] = true; $this->updatedAt = $updatedAt; return $this; @@ -247,6 +268,7 @@ public function getUpdatedById(): ?int */ public function setUpdatedById(?int $updatedById): self { + $this->initialized['updatedById'] = true; $this->updatedById = $updatedById; return $this; diff --git a/generated/Model/Projects.php b/generated/Model/Projects.php index ffddff2..b77d448 100644 --- a/generated/Model/Projects.php +++ b/generated/Model/Projects.php @@ -11,15 +11,24 @@ namespace JoliCode\Forecast\Api\Model; -class Projects +class Projects extends \ArrayObject { /** - * @var Project[]|null + * @var array + */ + protected $initialized = []; + /** + * @var list|null */ protected $projects; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** - * @return Project[]|null + * @return list|null */ public function getProjects(): ?array { @@ -27,10 +36,11 @@ public function getProjects(): ?array } /** - * @param Project[]|null $projects + * @param list|null $projects */ public function setProjects(?array $projects): self { + $this->initialized['projects'] = true; $this->projects = $projects; return $this; diff --git a/generated/Model/ProjectsIdGetResponse200.php b/generated/Model/ProjectsIdGetResponse200.php index 9ed3c19..904a02c 100644 --- a/generated/Model/ProjectsIdGetResponse200.php +++ b/generated/Model/ProjectsIdGetResponse200.php @@ -11,13 +11,22 @@ namespace JoliCode\Forecast\Api\Model; -class ProjectsIdGetResponse200 +class ProjectsIdGetResponse200 extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var Project|null */ protected $project; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getProject(): ?Project { return $this->project; @@ -25,6 +34,7 @@ public function getProject(): ?Project public function setProject(?Project $project): self { + $this->initialized['project'] = true; $this->project = $project; return $this; diff --git a/generated/Model/RemainingBudgetedHour.php b/generated/Model/RemainingBudgetedHour.php index 07c5be5..dd335d7 100644 --- a/generated/Model/RemainingBudgetedHour.php +++ b/generated/Model/RemainingBudgetedHour.php @@ -11,8 +11,12 @@ namespace JoliCode\Forecast\Api\Model; -class RemainingBudgetedHour +class RemainingBudgetedHour extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var string|null */ @@ -34,6 +38,11 @@ class RemainingBudgetedHour */ protected $responseCode; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getBudgetBy(): ?string { return $this->budgetBy; @@ -41,6 +50,7 @@ public function getBudgetBy(): ?string public function setBudgetBy(?string $budgetBy): self { + $this->initialized['budgetBy'] = true; $this->budgetBy = $budgetBy; return $this; @@ -53,6 +63,7 @@ public function getBudgetIsMonthly(): ?bool public function setBudgetIsMonthly(?bool $budgetIsMonthly): self { + $this->initialized['budgetIsMonthly'] = true; $this->budgetIsMonthly = $budgetIsMonthly; return $this; @@ -65,6 +76,7 @@ public function getHours(): ?int public function setHours(?int $hours): self { + $this->initialized['hours'] = true; $this->hours = $hours; return $this; @@ -77,6 +89,7 @@ public function getProjectId(): ?int public function setProjectId(?int $projectId): self { + $this->initialized['projectId'] = true; $this->projectId = $projectId; return $this; @@ -89,6 +102,7 @@ public function getResponseCode(): ?int public function setResponseCode(?int $responseCode): self { + $this->initialized['responseCode'] = true; $this->responseCode = $responseCode; return $this; diff --git a/generated/Model/RemainingBudgetedHours.php b/generated/Model/RemainingBudgetedHours.php index 7e1a202..540bf88 100644 --- a/generated/Model/RemainingBudgetedHours.php +++ b/generated/Model/RemainingBudgetedHours.php @@ -11,15 +11,24 @@ namespace JoliCode\Forecast\Api\Model; -class RemainingBudgetedHours +class RemainingBudgetedHours extends \ArrayObject { /** - * @var RemainingBudgetedHour[]|null + * @var array + */ + protected $initialized = []; + /** + * @var list|null */ protected $remainingBudgetedHours; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** - * @return RemainingBudgetedHour[]|null + * @return list|null */ public function getRemainingBudgetedHours(): ?array { @@ -27,10 +36,11 @@ public function getRemainingBudgetedHours(): ?array } /** - * @param RemainingBudgetedHour[]|null $remainingBudgetedHours + * @param list|null $remainingBudgetedHours */ public function setRemainingBudgetedHours(?array $remainingBudgetedHours): self { + $this->initialized['remainingBudgetedHours'] = true; $this->remainingBudgetedHours = $remainingBudgetedHours; return $this; diff --git a/generated/Model/RepeatedAssignmentSet.php b/generated/Model/RepeatedAssignmentSet.php index ed9f083..c623796 100644 --- a/generated/Model/RepeatedAssignmentSet.php +++ b/generated/Model/RepeatedAssignmentSet.php @@ -11,10 +11,14 @@ namespace JoliCode\Forecast\Api\Model; -class RepeatedAssignmentSet +class RepeatedAssignmentSet extends \ArrayObject { /** - * @var int[]|null + * @var array + */ + protected $initialized = []; + /** + * @var list|null */ protected $assignmentIds; /** @@ -30,8 +34,13 @@ class RepeatedAssignmentSet */ protected $lastEndDate; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** - * @return int[]|null + * @return list|null */ public function getAssignmentIds(): ?array { @@ -39,10 +48,11 @@ public function getAssignmentIds(): ?array } /** - * @param int[]|null $assignmentIds + * @param list|null $assignmentIds */ public function setAssignmentIds(?array $assignmentIds): self { + $this->initialized['assignmentIds'] = true; $this->assignmentIds = $assignmentIds; return $this; @@ -55,6 +65,7 @@ public function getFirstStartDate(): ?\DateTime public function setFirstStartDate(?\DateTime $firstStartDate): self { + $this->initialized['firstStartDate'] = true; $this->firstStartDate = $firstStartDate; return $this; @@ -67,6 +78,7 @@ public function getId(): ?int public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -79,6 +91,7 @@ public function getLastEndDate(): ?\DateTime public function setLastEndDate(?\DateTime $lastEndDate): self { + $this->initialized['lastEndDate'] = true; $this->lastEndDate = $lastEndDate; return $this; diff --git a/generated/Model/RepeatedAssignmentSetBody.php b/generated/Model/RepeatedAssignmentSetBody.php index 6fa0c6c..74db6c3 100644 --- a/generated/Model/RepeatedAssignmentSetBody.php +++ b/generated/Model/RepeatedAssignmentSetBody.php @@ -11,13 +11,22 @@ namespace JoliCode\Forecast\Api\Model; -class RepeatedAssignmentSetBody +class RepeatedAssignmentSetBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var RepeatedAssignmentSetBodyRepeatedAssignmentSet|null */ protected $repeatedAssignmentSet; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getRepeatedAssignmentSet(): ?RepeatedAssignmentSetBodyRepeatedAssignmentSet { return $this->repeatedAssignmentSet; @@ -25,6 +34,7 @@ public function getRepeatedAssignmentSet(): ?RepeatedAssignmentSetBodyRepeatedAs public function setRepeatedAssignmentSet(?RepeatedAssignmentSetBodyRepeatedAssignmentSet $repeatedAssignmentSet): self { + $this->initialized['repeatedAssignmentSet'] = true; $this->repeatedAssignmentSet = $repeatedAssignmentSet; return $this; diff --git a/generated/Model/RepeatedAssignmentSetBodyRepeatedAssignmentSet.php b/generated/Model/RepeatedAssignmentSetBodyRepeatedAssignmentSet.php index 83d3dc4..d76fb66 100644 --- a/generated/Model/RepeatedAssignmentSetBodyRepeatedAssignmentSet.php +++ b/generated/Model/RepeatedAssignmentSetBodyRepeatedAssignmentSet.php @@ -11,8 +11,12 @@ namespace JoliCode\Forecast\Api\Model; -class RepeatedAssignmentSetBodyRepeatedAssignmentSet +class RepeatedAssignmentSetBodyRepeatedAssignmentSet extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var Assignment|null */ @@ -24,6 +28,11 @@ class RepeatedAssignmentSetBodyRepeatedAssignmentSet */ protected $weeks; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getAssignment(): ?Assignment { return $this->assignment; @@ -31,6 +40,7 @@ public function getAssignment(): ?Assignment public function setAssignment(?Assignment $assignment): self { + $this->initialized['assignment'] = true; $this->assignment = $assignment; return $this; @@ -49,6 +59,7 @@ public function getWeeks(): ?int */ public function setWeeks(?int $weeks): self { + $this->initialized['weeks'] = true; $this->weeks = $weeks; return $this; diff --git a/generated/Model/RepeatedAssignmentSets.php b/generated/Model/RepeatedAssignmentSets.php index dfe0a4c..0329c75 100644 --- a/generated/Model/RepeatedAssignmentSets.php +++ b/generated/Model/RepeatedAssignmentSets.php @@ -11,15 +11,24 @@ namespace JoliCode\Forecast\Api\Model; -class RepeatedAssignmentSets +class RepeatedAssignmentSets extends \ArrayObject { /** - * @var RepeatedAssignmentSet[]|null + * @var array + */ + protected $initialized = []; + /** + * @var list|null */ protected $repeatedAssignmentSets; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** - * @return RepeatedAssignmentSet[]|null + * @return list|null */ public function getRepeatedAssignmentSets(): ?array { @@ -27,10 +36,11 @@ public function getRepeatedAssignmentSets(): ?array } /** - * @param RepeatedAssignmentSet[]|null $repeatedAssignmentSets + * @param list|null $repeatedAssignmentSets */ public function setRepeatedAssignmentSets(?array $repeatedAssignmentSets): self { + $this->initialized['repeatedAssignmentSets'] = true; $this->repeatedAssignmentSets = $repeatedAssignmentSets; return $this; diff --git a/generated/Model/RepeatedAssignmentSetsIdGetResponse200.php b/generated/Model/RepeatedAssignmentSetsIdGetResponse200.php index d9007dc..2cb070b 100644 --- a/generated/Model/RepeatedAssignmentSetsIdGetResponse200.php +++ b/generated/Model/RepeatedAssignmentSetsIdGetResponse200.php @@ -11,13 +11,22 @@ namespace JoliCode\Forecast\Api\Model; -class RepeatedAssignmentSetsIdGetResponse200 +class RepeatedAssignmentSetsIdGetResponse200 extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var RepeatedAssignmentSet|null */ protected $repeatedAssignmentSet; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getRepeatedAssignmentSet(): ?RepeatedAssignmentSet { return $this->repeatedAssignmentSet; @@ -25,6 +34,7 @@ public function getRepeatedAssignmentSet(): ?RepeatedAssignmentSet public function setRepeatedAssignmentSet(?RepeatedAssignmentSet $repeatedAssignmentSet): self { + $this->initialized['repeatedAssignmentSet'] = true; $this->repeatedAssignmentSet = $repeatedAssignmentSet; return $this; diff --git a/generated/Model/RepeatedAssignmentSetsIdPutResponse200.php b/generated/Model/RepeatedAssignmentSetsIdPutResponse200.php index e1a4737..d1ce0ea 100644 --- a/generated/Model/RepeatedAssignmentSetsIdPutResponse200.php +++ b/generated/Model/RepeatedAssignmentSetsIdPutResponse200.php @@ -11,13 +11,22 @@ namespace JoliCode\Forecast\Api\Model; -class RepeatedAssignmentSetsIdPutResponse200 +class RepeatedAssignmentSetsIdPutResponse200 extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var RepeatedAssignmentSet|null */ protected $repeatedAssignmentSet; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getRepeatedAssignmentSet(): ?RepeatedAssignmentSet { return $this->repeatedAssignmentSet; @@ -25,6 +34,7 @@ public function getRepeatedAssignmentSet(): ?RepeatedAssignmentSet public function setRepeatedAssignmentSet(?RepeatedAssignmentSet $repeatedAssignmentSet): self { + $this->initialized['repeatedAssignmentSet'] = true; $this->repeatedAssignmentSet = $repeatedAssignmentSet; return $this; diff --git a/generated/Model/RepeatedAssignmentSetsPostResponse201.php b/generated/Model/RepeatedAssignmentSetsPostResponse201.php index 2b0b0cc..2157dc3 100644 --- a/generated/Model/RepeatedAssignmentSetsPostResponse201.php +++ b/generated/Model/RepeatedAssignmentSetsPostResponse201.php @@ -11,13 +11,22 @@ namespace JoliCode\Forecast\Api\Model; -class RepeatedAssignmentSetsPostResponse201 +class RepeatedAssignmentSetsPostResponse201 extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var RepeatedAssignmentSet|null */ protected $repeatedAssignmentSet; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getRepeatedAssignmentSet(): ?RepeatedAssignmentSet { return $this->repeatedAssignmentSet; @@ -25,6 +34,7 @@ public function getRepeatedAssignmentSet(): ?RepeatedAssignmentSet public function setRepeatedAssignmentSet(?RepeatedAssignmentSet $repeatedAssignmentSet): self { + $this->initialized['repeatedAssignmentSet'] = true; $this->repeatedAssignmentSet = $repeatedAssignmentSet; return $this; diff --git a/generated/Model/Role.php b/generated/Model/Role.php index f94dead..f804cf2 100644 --- a/generated/Model/Role.php +++ b/generated/Model/Role.php @@ -11,8 +11,12 @@ namespace JoliCode\Forecast\Api\Model; -class Role +class Role extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var int|null */ @@ -22,11 +26,11 @@ class Role */ protected $name; /** - * @var int[]|null + * @var list|null */ protected $placeholderIds; /** - * @var int[]|null + * @var list|null */ protected $personIds; /** @@ -34,6 +38,11 @@ class Role */ protected $harvestRoleId; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getId(): ?int { return $this->id; @@ -41,6 +50,7 @@ public function getId(): ?int public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -53,13 +63,14 @@ public function getName(): ?string public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; } /** - * @return int[]|null + * @return list|null */ public function getPlaceholderIds(): ?array { @@ -67,17 +78,18 @@ public function getPlaceholderIds(): ?array } /** - * @param int[]|null $placeholderIds + * @param list|null $placeholderIds */ public function setPlaceholderIds(?array $placeholderIds): self { + $this->initialized['placeholderIds'] = true; $this->placeholderIds = $placeholderIds; return $this; } /** - * @return int[]|null + * @return list|null */ public function getPersonIds(): ?array { @@ -85,10 +97,11 @@ public function getPersonIds(): ?array } /** - * @param int[]|null $personIds + * @param list|null $personIds */ public function setPersonIds(?array $personIds): self { + $this->initialized['personIds'] = true; $this->personIds = $personIds; return $this; @@ -101,6 +114,7 @@ public function getHarvestRoleId(): ?int public function setHarvestRoleId(?int $harvestRoleId): self { + $this->initialized['harvestRoleId'] = true; $this->harvestRoleId = $harvestRoleId; return $this; diff --git a/generated/Model/RoleBody.php b/generated/Model/RoleBody.php index 215149e..25d91fe 100644 --- a/generated/Model/RoleBody.php +++ b/generated/Model/RoleBody.php @@ -11,13 +11,22 @@ namespace JoliCode\Forecast\Api\Model; -class RoleBody +class RoleBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var RoleBodyRole|null */ protected $role; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getRole(): ?RoleBodyRole { return $this->role; @@ -25,6 +34,7 @@ public function getRole(): ?RoleBodyRole public function setRole(?RoleBodyRole $role): self { + $this->initialized['role'] = true; $this->role = $role; return $this; diff --git a/generated/Model/RoleBodyRole.php b/generated/Model/RoleBodyRole.php index f14f38b..72ebeb1 100644 --- a/generated/Model/RoleBodyRole.php +++ b/generated/Model/RoleBodyRole.php @@ -11,17 +11,26 @@ namespace JoliCode\Forecast\Api\Model; -class RoleBodyRole +class RoleBodyRole extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var string|null */ protected $name; /** - * @var int[]|null + * @var list|null */ protected $personIds; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getName(): ?string { return $this->name; @@ -29,13 +38,14 @@ public function getName(): ?string public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; } /** - * @return int[]|null + * @return list|null */ public function getPersonIds(): ?array { @@ -43,10 +53,11 @@ public function getPersonIds(): ?array } /** - * @param int[]|null $personIds + * @param list|null $personIds */ public function setPersonIds(?array $personIds): self { + $this->initialized['personIds'] = true; $this->personIds = $personIds; return $this; diff --git a/generated/Model/Roles.php b/generated/Model/Roles.php index 188b4a8..47ec74f 100644 --- a/generated/Model/Roles.php +++ b/generated/Model/Roles.php @@ -11,15 +11,24 @@ namespace JoliCode\Forecast\Api\Model; -class Roles +class Roles extends \ArrayObject { /** - * @var Role[]|null + * @var array + */ + protected $initialized = []; + /** + * @var list|null */ protected $roles; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** - * @return Role[]|null + * @return list|null */ public function getRoles(): ?array { @@ -27,10 +36,11 @@ public function getRoles(): ?array } /** - * @param Role[]|null $roles + * @param list|null $roles */ public function setRoles(?array $roles): self { + $this->initialized['roles'] = true; $this->roles = $roles; return $this; diff --git a/generated/Model/RolesIdGetResponse200.php b/generated/Model/RolesIdGetResponse200.php index 9e8c740..f932c0f 100644 --- a/generated/Model/RolesIdGetResponse200.php +++ b/generated/Model/RolesIdGetResponse200.php @@ -11,13 +11,22 @@ namespace JoliCode\Forecast\Api\Model; -class RolesIdGetResponse200 +class RolesIdGetResponse200 extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var Role|null */ protected $role; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getRole(): ?Role { return $this->role; @@ -25,6 +34,7 @@ public function getRole(): ?Role public function setRole(?Role $role): self { + $this->initialized['role'] = true; $this->role = $role; return $this; diff --git a/generated/Model/RolesIdPutResponse200.php b/generated/Model/RolesIdPutResponse200.php index 8800d5f..707eecd 100644 --- a/generated/Model/RolesIdPutResponse200.php +++ b/generated/Model/RolesIdPutResponse200.php @@ -11,13 +11,22 @@ namespace JoliCode\Forecast\Api\Model; -class RolesIdPutResponse200 +class RolesIdPutResponse200 extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var Role|null */ protected $role; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getRole(): ?Role { return $this->role; @@ -25,6 +34,7 @@ public function getRole(): ?Role public function setRole(?Role $role): self { + $this->initialized['role'] = true; $this->role = $role; return $this; diff --git a/generated/Model/RolesPostResponse201.php b/generated/Model/RolesPostResponse201.php index 125a7ec..7d23650 100644 --- a/generated/Model/RolesPostResponse201.php +++ b/generated/Model/RolesPostResponse201.php @@ -11,13 +11,22 @@ namespace JoliCode\Forecast\Api\Model; -class RolesPostResponse201 +class RolesPostResponse201 extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var Role|null */ protected $role; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getRole(): ?Role { return $this->role; @@ -25,6 +34,7 @@ public function getRole(): ?Role public function setRole(?Role $role): self { + $this->initialized['role'] = true; $this->role = $role; return $this; diff --git a/generated/Model/Subscription.php b/generated/Model/Subscription.php index d05d53c..72f30bc 100644 --- a/generated/Model/Subscription.php +++ b/generated/Model/Subscription.php @@ -11,13 +11,22 @@ namespace JoliCode\Forecast\Api\Model; -class Subscription +class Subscription extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var SubscriptionSubscription|null */ protected $subscription; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getSubscription(): ?SubscriptionSubscription { return $this->subscription; @@ -25,6 +34,7 @@ public function getSubscription(): ?SubscriptionSubscription public function setSubscription(?SubscriptionSubscription $subscription): self { + $this->initialized['subscription'] = true; $this->subscription = $subscription; return $this; diff --git a/generated/Model/SubscriptionSubscription.php b/generated/Model/SubscriptionSubscription.php index c691256..3448c68 100644 --- a/generated/Model/SubscriptionSubscription.php +++ b/generated/Model/SubscriptionSubscription.php @@ -11,8 +11,12 @@ namespace JoliCode\Forecast\Api\Model; -class SubscriptionSubscription +class SubscriptionSubscription extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var int|null */ @@ -74,6 +78,11 @@ class SubscriptionSubscription */ protected $address; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getId(): ?int { return $this->id; @@ -81,6 +90,7 @@ public function getId(): ?int public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -93,6 +103,7 @@ public function getNextBillingDate(): ?\DateTime public function setNextBillingDate(?\DateTime $nextBillingDate): self { + $this->initialized['nextBillingDate'] = true; $this->nextBillingDate = $nextBillingDate; return $this; @@ -105,6 +116,7 @@ public function getDaysUntilNextBillingDate(): ?int public function setDaysUntilNextBillingDate(?int $daysUntilNextBillingDate): self { + $this->initialized['daysUntilNextBillingDate'] = true; $this->daysUntilNextBillingDate = $daysUntilNextBillingDate; return $this; @@ -123,6 +135,7 @@ public function getAmount(): ?int */ public function setAmount(?int $amount): self { + $this->initialized['amount'] = true; $this->amount = $amount; return $this; @@ -141,6 +154,7 @@ public function getAmountPerPerson(): ?int */ public function setAmountPerPerson(?int $amountPerPerson): self { + $this->initialized['amountPerPerson'] = true; $this->amountPerPerson = $amountPerPerson; return $this; @@ -153,6 +167,7 @@ public function getReceiptRecipient(): ?string public function setReceiptRecipient(?string $receiptRecipient): self { + $this->initialized['receiptRecipient'] = true; $this->receiptRecipient = $receiptRecipient; return $this; @@ -165,6 +180,7 @@ public function getStatus(): ?string public function setStatus(?string $status): self { + $this->initialized['status'] = true; $this->status = $status; return $this; @@ -177,6 +193,7 @@ public function getPurchasedPeople(): ?int public function setPurchasedPeople(?int $purchasedPeople): self { + $this->initialized['purchasedPeople'] = true; $this->purchasedPeople = $purchasedPeople; return $this; @@ -189,6 +206,7 @@ public function getInterval(): ?string public function setInterval(?string $interval): self { + $this->initialized['interval'] = true; $this->interval = $interval; return $this; @@ -201,6 +219,7 @@ public function getPaidByInvoice(): ?bool public function setPaidByInvoice(?bool $paidByInvoice): self { + $this->initialized['paidByInvoice'] = true; $this->paidByInvoice = $paidByInvoice; return $this; @@ -213,6 +232,7 @@ public function getDiscounts(): ?SubscriptionSubscriptionDiscounts public function setDiscounts(?SubscriptionSubscriptionDiscounts $discounts): self { + $this->initialized['discounts'] = true; $this->discounts = $discounts; return $this; @@ -225,6 +245,7 @@ public function getPlaceholderLimit(): ?int public function setPlaceholderLimit(?int $placeholderLimit): self { + $this->initialized['placeholderLimit'] = true; $this->placeholderLimit = $placeholderLimit; return $this; @@ -237,6 +258,7 @@ public function getCard(): ?SubscriptionSubscriptionCard public function setCard(?SubscriptionSubscriptionCard $card): self { + $this->initialized['card'] = true; $this->card = $card; return $this; @@ -249,6 +271,7 @@ public function getAddress(): ?SubscriptionSubscriptionAddress public function setAddress(?SubscriptionSubscriptionAddress $address): self { + $this->initialized['address'] = true; $this->address = $address; return $this; diff --git a/generated/Model/SubscriptionSubscriptionAddress.php b/generated/Model/SubscriptionSubscriptionAddress.php index ee0191b..b6e0a60 100644 --- a/generated/Model/SubscriptionSubscriptionAddress.php +++ b/generated/Model/SubscriptionSubscriptionAddress.php @@ -11,8 +11,12 @@ namespace JoliCode\Forecast\Api\Model; -class SubscriptionSubscriptionAddress +class SubscriptionSubscriptionAddress extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var string|null */ @@ -38,6 +42,11 @@ class SubscriptionSubscriptionAddress */ protected $country; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getLine1(): ?string { return $this->line1; @@ -45,6 +54,7 @@ public function getLine1(): ?string public function setLine1(?string $line1): self { + $this->initialized['line1'] = true; $this->line1 = $line1; return $this; @@ -57,6 +67,7 @@ public function getLine2(): ?string public function setLine2(?string $line2): self { + $this->initialized['line2'] = true; $this->line2 = $line2; return $this; @@ -69,6 +80,7 @@ public function getCity(): ?string public function setCity(?string $city): self { + $this->initialized['city'] = true; $this->city = $city; return $this; @@ -81,6 +93,7 @@ public function getState(): ?string public function setState(?string $state): self { + $this->initialized['state'] = true; $this->state = $state; return $this; @@ -93,6 +106,7 @@ public function getPostalCode(): ?string public function setPostalCode(?string $postalCode): self { + $this->initialized['postalCode'] = true; $this->postalCode = $postalCode; return $this; @@ -105,6 +119,7 @@ public function getCountry(): ?string public function setCountry(?string $country): self { + $this->initialized['country'] = true; $this->country = $country; return $this; diff --git a/generated/Model/SubscriptionSubscriptionCard.php b/generated/Model/SubscriptionSubscriptionCard.php index 7c66e46..b8a79da 100644 --- a/generated/Model/SubscriptionSubscriptionCard.php +++ b/generated/Model/SubscriptionSubscriptionCard.php @@ -11,8 +11,12 @@ namespace JoliCode\Forecast\Api\Model; -class SubscriptionSubscriptionCard +class SubscriptionSubscriptionCard extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var string|null */ @@ -30,6 +34,11 @@ class SubscriptionSubscriptionCard */ protected $expiryYear; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getBrand(): ?string { return $this->brand; @@ -37,6 +46,7 @@ public function getBrand(): ?string public function setBrand(?string $brand): self { + $this->initialized['brand'] = true; $this->brand = $brand; return $this; @@ -49,6 +59,7 @@ public function getLastFour(): ?string public function setLastFour(?string $lastFour): self { + $this->initialized['lastFour'] = true; $this->lastFour = $lastFour; return $this; @@ -61,6 +72,7 @@ public function getExpiryMonth(): ?int public function setExpiryMonth(?int $expiryMonth): self { + $this->initialized['expiryMonth'] = true; $this->expiryMonth = $expiryMonth; return $this; @@ -73,6 +85,7 @@ public function getExpiryYear(): ?int public function setExpiryYear(?int $expiryYear): self { + $this->initialized['expiryYear'] = true; $this->expiryYear = $expiryYear; return $this; diff --git a/generated/Model/SubscriptionSubscriptionDiscounts.php b/generated/Model/SubscriptionSubscriptionDiscounts.php index 3166d48..b9a819d 100644 --- a/generated/Model/SubscriptionSubscriptionDiscounts.php +++ b/generated/Model/SubscriptionSubscriptionDiscounts.php @@ -11,8 +11,12 @@ namespace JoliCode\Forecast\Api\Model; -class SubscriptionSubscriptionDiscounts +class SubscriptionSubscriptionDiscounts extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var int|null */ @@ -22,6 +26,11 @@ class SubscriptionSubscriptionDiscounts */ protected $yearlyPercentage; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getMonthlyPercentage(): ?int { return $this->monthlyPercentage; @@ -29,6 +38,7 @@ public function getMonthlyPercentage(): ?int public function setMonthlyPercentage(?int $monthlyPercentage): self { + $this->initialized['monthlyPercentage'] = true; $this->monthlyPercentage = $monthlyPercentage; return $this; @@ -41,6 +51,7 @@ public function getYearlyPercentage(): ?int public function setYearlyPercentage(?int $yearlyPercentage): self { + $this->initialized['yearlyPercentage'] = true; $this->yearlyPercentage = $yearlyPercentage; return $this; diff --git a/generated/Model/User.php b/generated/Model/User.php index 5cbf4a5..bde717e 100644 --- a/generated/Model/User.php +++ b/generated/Model/User.php @@ -11,13 +11,22 @@ namespace JoliCode\Forecast\Api\Model; -class User +class User extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var UserCurrentUser|null */ protected $currentUser; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getCurrentUser(): ?UserCurrentUser { return $this->currentUser; @@ -25,6 +34,7 @@ public function getCurrentUser(): ?UserCurrentUser public function setCurrentUser(?UserCurrentUser $currentUser): self { + $this->initialized['currentUser'] = true; $this->currentUser = $currentUser; return $this; diff --git a/generated/Model/UserConnection.php b/generated/Model/UserConnection.php index 5f280ef..e773402 100644 --- a/generated/Model/UserConnection.php +++ b/generated/Model/UserConnection.php @@ -11,8 +11,12 @@ namespace JoliCode\Forecast\Api\Model; -class UserConnection +class UserConnection extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var int|null */ @@ -26,6 +30,11 @@ class UserConnection */ protected $personId; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getId(): ?int { return $this->id; @@ -33,6 +42,7 @@ public function getId(): ?int public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -45,6 +55,7 @@ public function getLastActiveAt(): ?\DateTime public function setLastActiveAt(?\DateTime $lastActiveAt): self { + $this->initialized['lastActiveAt'] = true; $this->lastActiveAt = $lastActiveAt; return $this; @@ -57,6 +68,7 @@ public function getPersonId(): ?int public function setPersonId(?int $personId): self { + $this->initialized['personId'] = true; $this->personId = $personId; return $this; diff --git a/generated/Model/UserConnections.php b/generated/Model/UserConnections.php index 984edc2..1e4d199 100644 --- a/generated/Model/UserConnections.php +++ b/generated/Model/UserConnections.php @@ -11,15 +11,24 @@ namespace JoliCode\Forecast\Api\Model; -class UserConnections +class UserConnections extends \ArrayObject { /** - * @var UserConnection[]|null + * @var array + */ + protected $initialized = []; + /** + * @var list|null */ protected $userConnections; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** - * @return UserConnection[]|null + * @return list|null */ public function getUserConnections(): ?array { @@ -27,10 +36,11 @@ public function getUserConnections(): ?array } /** - * @param UserConnection[]|null $userConnections + * @param list|null $userConnections */ public function setUserConnections(?array $userConnections): self { + $this->initialized['userConnections'] = true; $this->userConnections = $userConnections; return $this; diff --git a/generated/Model/UserCurrentUser.php b/generated/Model/UserCurrentUser.php index a62c275..c938cdd 100644 --- a/generated/Model/UserCurrentUser.php +++ b/generated/Model/UserCurrentUser.php @@ -11,17 +11,26 @@ namespace JoliCode\Forecast\Api\Model; -class UserCurrentUser +class UserCurrentUser extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var int|null */ protected $id; /** - * @var int[]|null + * @var list|null */ protected $accountIds; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getId(): ?int { return $this->id; @@ -29,13 +38,14 @@ public function getId(): ?int public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; } /** - * @return int[]|null + * @return list|null */ public function getAccountIds(): ?array { @@ -43,10 +53,11 @@ public function getAccountIds(): ?array } /** - * @param int[]|null $accountIds + * @param list|null $accountIds */ public function setAccountIds(?array $accountIds): self { + $this->initialized['accountIds'] = true; $this->accountIds = $accountIds; return $this; diff --git a/generated/Normalizer/AccountAccountColorLabelsItemNormalizer.php b/generated/Normalizer/AccountAccountColorLabelsItemNormalizer.php index c4f2484..92bb36b 100644 --- a/generated/Normalizer/AccountAccountColorLabelsItemNormalizer.php +++ b/generated/Normalizer/AccountAccountColorLabelsItemNormalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,69 +22,156 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class AccountAccountColorLabelsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class AccountAccountColorLabelsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\AccountAccountColorLabelsItem' === $type; - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\AccountAccountColorLabelsItem' === \get_class($data); - } - - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\AccountAccountColorLabelsItem' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\AccountAccountColorLabelsItem' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\AccountAccountColorLabelsItem(); - 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 \JoliCode\Forecast\Api\Model\AccountAccountColorLabelsItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('name', $data) && null !== $data['name']) { + $object->setName($data['name']); + unset($data['name']); + } elseif (\array_key_exists('name', $data) && null === $data['name']) { + $object->setName(null); + } + if (\array_key_exists('label', $data) && null !== $data['label']) { + $object->setLabel($data['label']); + unset($data['label']); + } elseif (\array_key_exists('label', $data) && null === $data['label']) { + $object->setLabel(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('name', $data) && null !== $data['name']) { - $object->setName($data['name']); - } elseif (\array_key_exists('name', $data) && null === $data['name']) { - $object->setName(null); - } - if (\array_key_exists('label', $data) && null !== $data['label']) { - $object->setLabel($data['label']); - } elseif (\array_key_exists('label', $data) && null === $data['label']) { - $object->setLabel(null); + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['name'] = $object->getName(); + if ($object->isInitialized('label') && null !== $object->getLabel()) { + $data['label'] = $object->getLabel(); + } + 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 ['JoliCode\\Forecast\\Api\\Model\\AccountAccountColorLabelsItem' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class AccountAccountColorLabelsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - $data['name'] = $object->getName(); - if (null !== $object->getLabel()) { - $data['label'] = $object->getLabel(); + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\AccountAccountColorLabelsItem' === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\AccountAccountColorLabelsItem' === $data::class; + } + + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\AccountAccountColorLabelsItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('name', $data) && null !== $data['name']) { + $object->setName($data['name']); + unset($data['name']); + } elseif (\array_key_exists('name', $data) && null === $data['name']) { + $object->setName(null); + } + if (\array_key_exists('label', $data) && null !== $data['label']) { + $object->setLabel($data['label']); + unset($data['label']); + } elseif (\array_key_exists('label', $data) && null === $data['label']) { + $object->setLabel(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['name'] = $object->getName(); + if ($object->isInitialized('label') && null !== $object->getLabel()) { + $data['label'] = $object->getLabel(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\AccountAccountColorLabelsItem' => false]; + } } } diff --git a/generated/Normalizer/AccountAccountNormalizer.php b/generated/Normalizer/AccountAccountNormalizer.php index 3a5dbf4..1282eda 100644 --- a/generated/Normalizer/AccountAccountNormalizer.php +++ b/generated/Normalizer/AccountAccountNormalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,123 +22,276 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class AccountAccountNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class AccountAccountNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\AccountAccount' === $type; - } - - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\AccountAccount' === \get_class($data); - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\AccountAccount' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\AccountAccount' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\AccountAccount(); - 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 \JoliCode\Forecast\Api\Model\AccountAccount(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('id', $data) && null !== $data['id']) { + $object->setId($data['id']); + unset($data['id']); + } elseif (\array_key_exists('id', $data) && null === $data['id']) { + $object->setId(null); + } + if (\array_key_exists('name', $data) && null !== $data['name']) { + $object->setName($data['name']); + unset($data['name']); + } elseif (\array_key_exists('name', $data) && null === $data['name']) { + $object->setName(null); + } + if (\array_key_exists('weekly_capacity', $data) && null !== $data['weekly_capacity']) { + $object->setWeeklyCapacity($data['weekly_capacity']); + unset($data['weekly_capacity']); + } elseif (\array_key_exists('weekly_capacity', $data) && null === $data['weekly_capacity']) { + $object->setWeeklyCapacity(null); + } + if (\array_key_exists('color_labels', $data) && null !== $data['color_labels']) { + $values = []; + foreach ($data['color_labels'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Forecast\\Api\\Model\\AccountAccountColorLabelsItem', 'json', $context); + } + $object->setColorLabels($values); + unset($data['color_labels']); + } elseif (\array_key_exists('color_labels', $data) && null === $data['color_labels']) { + $object->setColorLabels(null); + } + if (\array_key_exists('harvest_subdomain', $data) && null !== $data['harvest_subdomain']) { + $object->setHarvestSubdomain($data['harvest_subdomain']); + unset($data['harvest_subdomain']); + } elseif (\array_key_exists('harvest_subdomain', $data) && null === $data['harvest_subdomain']) { + $object->setHarvestSubdomain(null); + } + if (\array_key_exists('harvest_name', $data) && null !== $data['harvest_name']) { + $object->setHarvestName($data['harvest_name']); + unset($data['harvest_name']); + } elseif (\array_key_exists('harvest_name', $data) && null === $data['harvest_name']) { + $object->setHarvestName(null); + } + if (\array_key_exists('weekends_enabled', $data) && null !== $data['weekends_enabled']) { + $object->setWeekendsEnabled($data['weekends_enabled']); + unset($data['weekends_enabled']); + } elseif (\array_key_exists('weekends_enabled', $data) && null === $data['weekends_enabled']) { + $object->setWeekendsEnabled(null); + } + if (\array_key_exists('created_at', $data) && null !== $data['created_at']) { + $object->setCreatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s.v\\Z', $data['created_at'])); + unset($data['created_at']); + } elseif (\array_key_exists('created_at', $data) && null === $data['created_at']) { + $object->setCreatedAt(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('id', $data) && null !== $data['id']) { - $object->setId($data['id']); - } elseif (\array_key_exists('id', $data) && null === $data['id']) { - $object->setId(null); - } - if (\array_key_exists('name', $data) && null !== $data['name']) { - $object->setName($data['name']); - } elseif (\array_key_exists('name', $data) && null === $data['name']) { - $object->setName(null); - } - if (\array_key_exists('weekly_capacity', $data) && null !== $data['weekly_capacity']) { - $object->setWeeklyCapacity($data['weekly_capacity']); - } elseif (\array_key_exists('weekly_capacity', $data) && null === $data['weekly_capacity']) { - $object->setWeeklyCapacity(null); - } - if (\array_key_exists('color_labels', $data) && null !== $data['color_labels']) { - $values = []; - foreach ($data['color_labels'] as $value) { - $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Forecast\\Api\\Model\\AccountAccountColorLabelsItem', 'json', $context); - } - $object->setColorLabels($values); - } elseif (\array_key_exists('color_labels', $data) && null === $data['color_labels']) { - $object->setColorLabels(null); - } - if (\array_key_exists('harvest_subdomain', $data) && null !== $data['harvest_subdomain']) { - $object->setHarvestSubdomain($data['harvest_subdomain']); - } elseif (\array_key_exists('harvest_subdomain', $data) && null === $data['harvest_subdomain']) { - $object->setHarvestSubdomain(null); + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['id'] = $object->getId(); + $data['name'] = $object->getName(); + if ($object->isInitialized('weeklyCapacity') && null !== $object->getWeeklyCapacity()) { + $data['weekly_capacity'] = $object->getWeeklyCapacity(); + } + if ($object->isInitialized('colorLabels') && null !== $object->getColorLabels()) { + $values = []; + foreach ($object->getColorLabels() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['color_labels'] = $values; + } + if ($object->isInitialized('harvestSubdomain') && null !== $object->getHarvestSubdomain()) { + $data['harvest_subdomain'] = $object->getHarvestSubdomain(); + } + if ($object->isInitialized('harvestName') && null !== $object->getHarvestName()) { + $data['harvest_name'] = $object->getHarvestName(); + } + if ($object->isInitialized('weekendsEnabled') && null !== $object->getWeekendsEnabled()) { + $data['weekends_enabled'] = $object->getWeekendsEnabled(); + } + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { + $data['created_at'] = $object->getCreatedAt()->format('Y-m-d\\TH:i:s.v\\Z'); + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } + + return $data; } - if (\array_key_exists('harvest_name', $data) && null !== $data['harvest_name']) { - $object->setHarvestName($data['harvest_name']); - } elseif (\array_key_exists('harvest_name', $data) && null === $data['harvest_name']) { - $object->setHarvestName(null); + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\AccountAccount' => false]; } - if (\array_key_exists('weekends_enabled', $data) && null !== $data['weekends_enabled']) { - $object->setWeekendsEnabled($data['weekends_enabled']); - } elseif (\array_key_exists('weekends_enabled', $data) && null === $data['weekends_enabled']) { - $object->setWeekendsEnabled(null); + } +} else { + class AccountAccountNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\AccountAccount' === $type; } - if (\array_key_exists('created_at', $data) && null !== $data['created_at']) { - $object->setCreatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s.v\\Z', $data['created_at'])); - } elseif (\array_key_exists('created_at', $data) && null === $data['created_at']) { - $object->setCreatedAt(null); + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\AccountAccount' === $data::class; } - return $object; - } + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\AccountAccount(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('id', $data) && null !== $data['id']) { + $object->setId($data['id']); + unset($data['id']); + } elseif (\array_key_exists('id', $data) && null === $data['id']) { + $object->setId(null); + } + if (\array_key_exists('name', $data) && null !== $data['name']) { + $object->setName($data['name']); + unset($data['name']); + } elseif (\array_key_exists('name', $data) && null === $data['name']) { + $object->setName(null); + } + if (\array_key_exists('weekly_capacity', $data) && null !== $data['weekly_capacity']) { + $object->setWeeklyCapacity($data['weekly_capacity']); + unset($data['weekly_capacity']); + } elseif (\array_key_exists('weekly_capacity', $data) && null === $data['weekly_capacity']) { + $object->setWeeklyCapacity(null); + } + if (\array_key_exists('color_labels', $data) && null !== $data['color_labels']) { + $values = []; + foreach ($data['color_labels'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Forecast\\Api\\Model\\AccountAccountColorLabelsItem', 'json', $context); + } + $object->setColorLabels($values); + unset($data['color_labels']); + } elseif (\array_key_exists('color_labels', $data) && null === $data['color_labels']) { + $object->setColorLabels(null); + } + if (\array_key_exists('harvest_subdomain', $data) && null !== $data['harvest_subdomain']) { + $object->setHarvestSubdomain($data['harvest_subdomain']); + unset($data['harvest_subdomain']); + } elseif (\array_key_exists('harvest_subdomain', $data) && null === $data['harvest_subdomain']) { + $object->setHarvestSubdomain(null); + } + if (\array_key_exists('harvest_name', $data) && null !== $data['harvest_name']) { + $object->setHarvestName($data['harvest_name']); + unset($data['harvest_name']); + } elseif (\array_key_exists('harvest_name', $data) && null === $data['harvest_name']) { + $object->setHarvestName(null); + } + if (\array_key_exists('weekends_enabled', $data) && null !== $data['weekends_enabled']) { + $object->setWeekendsEnabled($data['weekends_enabled']); + unset($data['weekends_enabled']); + } elseif (\array_key_exists('weekends_enabled', $data) && null === $data['weekends_enabled']) { + $object->setWeekendsEnabled(null); + } + if (\array_key_exists('created_at', $data) && null !== $data['created_at']) { + $object->setCreatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s.v\\Z', $data['created_at'])); + unset($data['created_at']); + } elseif (\array_key_exists('created_at', $data) && null === $data['created_at']) { + $object->setCreatedAt(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) - { - $data = []; - $data['id'] = $object->getId(); - $data['name'] = $object->getName(); - if (null !== $object->getWeeklyCapacity()) { - $data['weekly_capacity'] = $object->getWeeklyCapacity(); + return $object; } - if (null !== $object->getColorLabels()) { - $values = []; - foreach ($object->getColorLabels() as $value) { - $values[] = $this->normalizer->normalize($value, 'json', $context); + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['id'] = $object->getId(); + $data['name'] = $object->getName(); + if ($object->isInitialized('weeklyCapacity') && null !== $object->getWeeklyCapacity()) { + $data['weekly_capacity'] = $object->getWeeklyCapacity(); } - $data['color_labels'] = $values; - } - if (null !== $object->getHarvestSubdomain()) { - $data['harvest_subdomain'] = $object->getHarvestSubdomain(); - } - if (null !== $object->getHarvestName()) { - $data['harvest_name'] = $object->getHarvestName(); - } - if (null !== $object->getWeekendsEnabled()) { - $data['weekends_enabled'] = $object->getWeekendsEnabled(); - } - if (null !== $object->getCreatedAt()) { - $data['created_at'] = $object->getCreatedAt()->format('Y-m-d\\TH:i:s.v\\Z'); + if ($object->isInitialized('colorLabels') && null !== $object->getColorLabels()) { + $values = []; + foreach ($object->getColorLabels() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['color_labels'] = $values; + } + if ($object->isInitialized('harvestSubdomain') && null !== $object->getHarvestSubdomain()) { + $data['harvest_subdomain'] = $object->getHarvestSubdomain(); + } + if ($object->isInitialized('harvestName') && null !== $object->getHarvestName()) { + $data['harvest_name'] = $object->getHarvestName(); + } + if ($object->isInitialized('weekendsEnabled') && null !== $object->getWeekendsEnabled()) { + $data['weekends_enabled'] = $object->getWeekendsEnabled(); + } + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { + $data['created_at'] = $object->getCreatedAt()->format('Y-m-d\\TH:i:s.v\\Z'); + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } + + return $data; } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\AccountAccount' => false]; + } } } diff --git a/generated/Normalizer/AccountNormalizer.php b/generated/Normalizer/AccountNormalizer.php index 72b1015..4a8b768 100644 --- a/generated/Normalizer/AccountNormalizer.php +++ b/generated/Normalizer/AccountNormalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,61 +22,138 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class AccountNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class AccountNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\Account' === $type; - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\Account' === \get_class($data); - } - - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\Account' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\Account' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\Account(); - 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 \JoliCode\Forecast\Api\Model\Account(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('account', $data) && null !== $data['account']) { + $object->setAccount($this->denormalizer->denormalize($data['account'], 'JoliCode\\Forecast\\Api\\Model\\AccountAccount', 'json', $context)); + unset($data['account']); + } elseif (\array_key_exists('account', $data) && null === $data['account']) { + $object->setAccount(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('account', $data) && null !== $data['account']) { - $object->setAccount($this->denormalizer->denormalize($data['account'], 'JoliCode\\Forecast\\Api\\Model\\AccountAccount', 'json', $context)); - } elseif (\array_key_exists('account', $data) && null === $data['account']) { - $object->setAccount(null); + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['account'] = $this->normalizer->normalize($object->getAccount(), '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 ['JoliCode\\Forecast\\Api\\Model\\Account' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class AccountNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - $data['account'] = $this->normalizer->normalize($object->getAccount(), 'json', $context); + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - return $data; + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\Account' === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\Account' === $data::class; + } + + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\Account(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('account', $data) && null !== $data['account']) { + $object->setAccount($this->denormalizer->denormalize($data['account'], 'JoliCode\\Forecast\\Api\\Model\\AccountAccount', 'json', $context)); + unset($data['account']); + } elseif (\array_key_exists('account', $data) && null === $data['account']) { + $object->setAccount(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['account'] = $this->normalizer->normalize($object->getAccount(), 'json', $context); + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\Account' => false]; + } } } diff --git a/generated/Normalizer/AssignmentNormalizer.php b/generated/Normalizer/AssignmentNormalizer.php index 65d55df..6586860 100644 --- a/generated/Normalizer/AssignmentNormalizer.php +++ b/generated/Normalizer/AssignmentNormalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,145 +22,328 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class AssignmentNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class AssignmentNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\Assignment' === $type; - } - - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\Assignment' === \get_class($data); - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\Assignment' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\Assignment' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\Assignment(); - 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 \JoliCode\Forecast\Api\Model\Assignment(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('active_on_days_off', $data) && null !== $data['active_on_days_off']) { + $object->setActiveOnDaysOff($data['active_on_days_off']); + unset($data['active_on_days_off']); + } elseif (\array_key_exists('active_on_days_off', $data) && null === $data['active_on_days_off']) { + $object->setActiveOnDaysOff(null); + } + if (\array_key_exists('allocation', $data) && null !== $data['allocation']) { + $object->setAllocation($data['allocation']); + unset($data['allocation']); + } elseif (\array_key_exists('allocation', $data) && null === $data['allocation']) { + $object->setAllocation(null); + } + if (\array_key_exists('end_date', $data) && null !== $data['end_date']) { + $object->setEndDate(\DateTime::createFromFormat('Y-m-d', $data['end_date'])->setTime(0, 0, 0)); + unset($data['end_date']); + } elseif (\array_key_exists('end_date', $data) && null === $data['end_date']) { + $object->setEndDate(null); + } + if (\array_key_exists('id', $data) && null !== $data['id']) { + $object->setId($data['id']); + unset($data['id']); + } elseif (\array_key_exists('id', $data) && null === $data['id']) { + $object->setId(null); + } + if (\array_key_exists('notes', $data) && null !== $data['notes']) { + $object->setNotes($data['notes']); + unset($data['notes']); + } elseif (\array_key_exists('notes', $data) && null === $data['notes']) { + $object->setNotes(null); + } + if (\array_key_exists('person_id', $data) && null !== $data['person_id']) { + $object->setPersonId($data['person_id']); + unset($data['person_id']); + } elseif (\array_key_exists('person_id', $data) && null === $data['person_id']) { + $object->setPersonId(null); + } + if (\array_key_exists('placeholder_id', $data) && null !== $data['placeholder_id']) { + $object->setPlaceholderId($data['placeholder_id']); + unset($data['placeholder_id']); + } elseif (\array_key_exists('placeholder_id', $data) && null === $data['placeholder_id']) { + $object->setPlaceholderId(null); + } + if (\array_key_exists('project_id', $data) && null !== $data['project_id']) { + $object->setProjectId($data['project_id']); + unset($data['project_id']); + } elseif (\array_key_exists('project_id', $data) && null === $data['project_id']) { + $object->setProjectId(null); + } + if (\array_key_exists('repeated_assignment_set_id', $data) && null !== $data['repeated_assignment_set_id']) { + $object->setRepeatedAssignmentSetId($data['repeated_assignment_set_id']); + unset($data['repeated_assignment_set_id']); + } elseif (\array_key_exists('repeated_assignment_set_id', $data) && null === $data['repeated_assignment_set_id']) { + $object->setRepeatedAssignmentSetId(null); + } + if (\array_key_exists('start_date', $data) && null !== $data['start_date']) { + $object->setStartDate(\DateTime::createFromFormat('Y-m-d', $data['start_date'])->setTime(0, 0, 0)); + unset($data['start_date']); + } elseif (\array_key_exists('start_date', $data) && null === $data['start_date']) { + $object->setStartDate(null); + } + if (\array_key_exists('updated_at', $data) && null !== $data['updated_at']) { + $object->setUpdatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s.v\\Z', $data['updated_at'])); + unset($data['updated_at']); + } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { + $object->setUpdatedAt(null); + } + if (\array_key_exists('updated_by_id', $data) && null !== $data['updated_by_id']) { + $object->setUpdatedById($data['updated_by_id']); + unset($data['updated_by_id']); + } elseif (\array_key_exists('updated_by_id', $data) && null === $data['updated_by_id']) { + $object->setUpdatedById(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('active_on_days_off', $data) && null !== $data['active_on_days_off']) { - $object->setActiveOnDaysOff($data['active_on_days_off']); - } elseif (\array_key_exists('active_on_days_off', $data) && null === $data['active_on_days_off']) { - $object->setActiveOnDaysOff(null); - } - if (\array_key_exists('allocation', $data) && null !== $data['allocation']) { - $object->setAllocation($data['allocation']); - } elseif (\array_key_exists('allocation', $data) && null === $data['allocation']) { - $object->setAllocation(null); - } - if (\array_key_exists('end_date', $data) && null !== $data['end_date']) { - $object->setEndDate(\DateTime::createFromFormat('Y-m-d', $data['end_date'])->setTime(0, 0, 0)); - } elseif (\array_key_exists('end_date', $data) && null === $data['end_date']) { - $object->setEndDate(null); - } - if (\array_key_exists('id', $data) && null !== $data['id']) { - $object->setId($data['id']); - } elseif (\array_key_exists('id', $data) && null === $data['id']) { - $object->setId(null); - } - if (\array_key_exists('notes', $data) && null !== $data['notes']) { - $object->setNotes($data['notes']); - } elseif (\array_key_exists('notes', $data) && null === $data['notes']) { - $object->setNotes(null); - } - if (\array_key_exists('person_id', $data) && null !== $data['person_id']) { - $object->setPersonId($data['person_id']); - } elseif (\array_key_exists('person_id', $data) && null === $data['person_id']) { - $object->setPersonId(null); - } - if (\array_key_exists('placeholder_id', $data) && null !== $data['placeholder_id']) { - $object->setPlaceholderId($data['placeholder_id']); - } elseif (\array_key_exists('placeholder_id', $data) && null === $data['placeholder_id']) { - $object->setPlaceholderId(null); - } - if (\array_key_exists('project_id', $data) && null !== $data['project_id']) { - $object->setProjectId($data['project_id']); - } elseif (\array_key_exists('project_id', $data) && null === $data['project_id']) { - $object->setProjectId(null); - } - if (\array_key_exists('repeated_assignment_set_id', $data) && null !== $data['repeated_assignment_set_id']) { - $object->setRepeatedAssignmentSetId($data['repeated_assignment_set_id']); - } elseif (\array_key_exists('repeated_assignment_set_id', $data) && null === $data['repeated_assignment_set_id']) { - $object->setRepeatedAssignmentSetId(null); - } - if (\array_key_exists('start_date', $data) && null !== $data['start_date']) { - $object->setStartDate(\DateTime::createFromFormat('Y-m-d', $data['start_date'])->setTime(0, 0, 0)); - } elseif (\array_key_exists('start_date', $data) && null === $data['start_date']) { - $object->setStartDate(null); - } - if (\array_key_exists('updated_at', $data) && null !== $data['updated_at']) { - $object->setUpdatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s.v\\Z', $data['updated_at'])); - } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { - $object->setUpdatedAt(null); - } - if (\array_key_exists('updated_by_id', $data) && null !== $data['updated_by_id']) { - $object->setUpdatedById($data['updated_by_id']); - } elseif (\array_key_exists('updated_by_id', $data) && null === $data['updated_by_id']) { - $object->setUpdatedById(null); - } - return $object; - } + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('activeOnDaysOff') && null !== $object->getActiveOnDaysOff()) { + $data['active_on_days_off'] = $object->getActiveOnDaysOff(); + } + $data['allocation'] = $object->getAllocation(); + $data['end_date'] = $object->getEndDate()->format('Y-m-d'); + if ($object->isInitialized('id') && null !== $object->getId()) { + $data['id'] = $object->getId(); + } + if ($object->isInitialized('notes') && null !== $object->getNotes()) { + $data['notes'] = $object->getNotes(); + } + if ($object->isInitialized('personId') && null !== $object->getPersonId()) { + $data['person_id'] = $object->getPersonId(); + } + if ($object->isInitialized('placeholderId') && null !== $object->getPlaceholderId()) { + $data['placeholder_id'] = $object->getPlaceholderId(); + } + if ($object->isInitialized('projectId') && null !== $object->getProjectId()) { + $data['project_id'] = $object->getProjectId(); + } + if ($object->isInitialized('repeatedAssignmentSetId') && null !== $object->getRepeatedAssignmentSetId()) { + $data['repeated_assignment_set_id'] = $object->getRepeatedAssignmentSetId(); + } + $data['start_date'] = $object->getStartDate()->format('Y-m-d'); + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { + $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s.v\\Z'); + } + if ($object->isInitialized('updatedById') && null !== $object->getUpdatedById()) { + $data['updated_by_id'] = $object->getUpdatedById(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) - { - $data = []; - if (null !== $object->getActiveOnDaysOff()) { - $data['active_on_days_off'] = $object->getActiveOnDaysOff(); - } - $data['allocation'] = $object->getAllocation(); - $data['end_date'] = $object->getEndDate()->format('Y-m-d'); - if (null !== $object->getId()) { - $data['id'] = $object->getId(); + return $data; } - if (null !== $object->getNotes()) { - $data['notes'] = $object->getNotes(); - } - if (null !== $object->getPersonId()) { - $data['person_id'] = $object->getPersonId(); - } - if (null !== $object->getPlaceholderId()) { - $data['placeholder_id'] = $object->getPlaceholderId(); + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\Assignment' => false]; } - if (null !== $object->getProjectId()) { - $data['project_id'] = $object->getProjectId(); + } +} else { + class AssignmentNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\Assignment' === $type; } - if (null !== $object->getRepeatedAssignmentSetId()) { - $data['repeated_assignment_set_id'] = $object->getRepeatedAssignmentSetId(); + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\Assignment' === $data::class; } - $data['start_date'] = $object->getStartDate()->format('Y-m-d'); - if (null !== $object->getUpdatedAt()) { - $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s.v\\Z'); + + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\Assignment(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('active_on_days_off', $data) && null !== $data['active_on_days_off']) { + $object->setActiveOnDaysOff($data['active_on_days_off']); + unset($data['active_on_days_off']); + } elseif (\array_key_exists('active_on_days_off', $data) && null === $data['active_on_days_off']) { + $object->setActiveOnDaysOff(null); + } + if (\array_key_exists('allocation', $data) && null !== $data['allocation']) { + $object->setAllocation($data['allocation']); + unset($data['allocation']); + } elseif (\array_key_exists('allocation', $data) && null === $data['allocation']) { + $object->setAllocation(null); + } + if (\array_key_exists('end_date', $data) && null !== $data['end_date']) { + $object->setEndDate(\DateTime::createFromFormat('Y-m-d', $data['end_date'])->setTime(0, 0, 0)); + unset($data['end_date']); + } elseif (\array_key_exists('end_date', $data) && null === $data['end_date']) { + $object->setEndDate(null); + } + if (\array_key_exists('id', $data) && null !== $data['id']) { + $object->setId($data['id']); + unset($data['id']); + } elseif (\array_key_exists('id', $data) && null === $data['id']) { + $object->setId(null); + } + if (\array_key_exists('notes', $data) && null !== $data['notes']) { + $object->setNotes($data['notes']); + unset($data['notes']); + } elseif (\array_key_exists('notes', $data) && null === $data['notes']) { + $object->setNotes(null); + } + if (\array_key_exists('person_id', $data) && null !== $data['person_id']) { + $object->setPersonId($data['person_id']); + unset($data['person_id']); + } elseif (\array_key_exists('person_id', $data) && null === $data['person_id']) { + $object->setPersonId(null); + } + if (\array_key_exists('placeholder_id', $data) && null !== $data['placeholder_id']) { + $object->setPlaceholderId($data['placeholder_id']); + unset($data['placeholder_id']); + } elseif (\array_key_exists('placeholder_id', $data) && null === $data['placeholder_id']) { + $object->setPlaceholderId(null); + } + if (\array_key_exists('project_id', $data) && null !== $data['project_id']) { + $object->setProjectId($data['project_id']); + unset($data['project_id']); + } elseif (\array_key_exists('project_id', $data) && null === $data['project_id']) { + $object->setProjectId(null); + } + if (\array_key_exists('repeated_assignment_set_id', $data) && null !== $data['repeated_assignment_set_id']) { + $object->setRepeatedAssignmentSetId($data['repeated_assignment_set_id']); + unset($data['repeated_assignment_set_id']); + } elseif (\array_key_exists('repeated_assignment_set_id', $data) && null === $data['repeated_assignment_set_id']) { + $object->setRepeatedAssignmentSetId(null); + } + if (\array_key_exists('start_date', $data) && null !== $data['start_date']) { + $object->setStartDate(\DateTime::createFromFormat('Y-m-d', $data['start_date'])->setTime(0, 0, 0)); + unset($data['start_date']); + } elseif (\array_key_exists('start_date', $data) && null === $data['start_date']) { + $object->setStartDate(null); + } + if (\array_key_exists('updated_at', $data) && null !== $data['updated_at']) { + $object->setUpdatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s.v\\Z', $data['updated_at'])); + unset($data['updated_at']); + } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { + $object->setUpdatedAt(null); + } + if (\array_key_exists('updated_by_id', $data) && null !== $data['updated_by_id']) { + $object->setUpdatedById($data['updated_by_id']); + unset($data['updated_by_id']); + } elseif (\array_key_exists('updated_by_id', $data) && null === $data['updated_by_id']) { + $object->setUpdatedById(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; } - if (null !== $object->getUpdatedById()) { - $data['updated_by_id'] = $object->getUpdatedById(); + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('activeOnDaysOff') && null !== $object->getActiveOnDaysOff()) { + $data['active_on_days_off'] = $object->getActiveOnDaysOff(); + } + $data['allocation'] = $object->getAllocation(); + $data['end_date'] = $object->getEndDate()->format('Y-m-d'); + if ($object->isInitialized('id') && null !== $object->getId()) { + $data['id'] = $object->getId(); + } + if ($object->isInitialized('notes') && null !== $object->getNotes()) { + $data['notes'] = $object->getNotes(); + } + if ($object->isInitialized('personId') && null !== $object->getPersonId()) { + $data['person_id'] = $object->getPersonId(); + } + if ($object->isInitialized('placeholderId') && null !== $object->getPlaceholderId()) { + $data['placeholder_id'] = $object->getPlaceholderId(); + } + if ($object->isInitialized('projectId') && null !== $object->getProjectId()) { + $data['project_id'] = $object->getProjectId(); + } + if ($object->isInitialized('repeatedAssignmentSetId') && null !== $object->getRepeatedAssignmentSetId()) { + $data['repeated_assignment_set_id'] = $object->getRepeatedAssignmentSetId(); + } + $data['start_date'] = $object->getStartDate()->format('Y-m-d'); + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { + $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s.v\\Z'); + } + if ($object->isInitialized('updatedById') && null !== $object->getUpdatedById()) { + $data['updated_by_id'] = $object->getUpdatedById(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\Assignment' => false]; + } } } diff --git a/generated/Normalizer/AssignmentsIdGetResponse200Normalizer.php b/generated/Normalizer/AssignmentsIdGetResponse200Normalizer.php index 4a837dd..bf66453 100644 --- a/generated/Normalizer/AssignmentsIdGetResponse200Normalizer.php +++ b/generated/Normalizer/AssignmentsIdGetResponse200Normalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,61 +22,138 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class AssignmentsIdGetResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class AssignmentsIdGetResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\AssignmentsIdGetResponse200' === $type; - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\AssignmentsIdGetResponse200' === \get_class($data); - } - - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\AssignmentsIdGetResponse200' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\AssignmentsIdGetResponse200' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\AssignmentsIdGetResponse200(); - 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 \JoliCode\Forecast\Api\Model\AssignmentsIdGetResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('assignment', $data) && null !== $data['assignment']) { + $object->setAssignment($this->denormalizer->denormalize($data['assignment'], 'JoliCode\\Forecast\\Api\\Model\\Assignment', 'json', $context)); + unset($data['assignment']); + } elseif (\array_key_exists('assignment', $data) && null === $data['assignment']) { + $object->setAssignment(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('assignment', $data) && null !== $data['assignment']) { - $object->setAssignment($this->denormalizer->denormalize($data['assignment'], 'JoliCode\\Forecast\\Api\\Model\\Assignment', 'json', $context)); - } elseif (\array_key_exists('assignment', $data) && null === $data['assignment']) { - $object->setAssignment(null); + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['assignment'] = $this->normalizer->normalize($object->getAssignment(), '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 ['JoliCode\\Forecast\\Api\\Model\\AssignmentsIdGetResponse200' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class AssignmentsIdGetResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - $data['assignment'] = $this->normalizer->normalize($object->getAssignment(), 'json', $context); + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - return $data; + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\AssignmentsIdGetResponse200' === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\AssignmentsIdGetResponse200' === $data::class; + } + + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\AssignmentsIdGetResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('assignment', $data) && null !== $data['assignment']) { + $object->setAssignment($this->denormalizer->denormalize($data['assignment'], 'JoliCode\\Forecast\\Api\\Model\\Assignment', 'json', $context)); + unset($data['assignment']); + } elseif (\array_key_exists('assignment', $data) && null === $data['assignment']) { + $object->setAssignment(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['assignment'] = $this->normalizer->normalize($object->getAssignment(), 'json', $context); + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\AssignmentsIdGetResponse200' => false]; + } } } diff --git a/generated/Normalizer/AssignmentsIdPutBodyNormalizer.php b/generated/Normalizer/AssignmentsIdPutBodyNormalizer.php index 6377336..2b7b2f1 100644 --- a/generated/Normalizer/AssignmentsIdPutBodyNormalizer.php +++ b/generated/Normalizer/AssignmentsIdPutBodyNormalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,61 +22,138 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class AssignmentsIdPutBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class AssignmentsIdPutBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\AssignmentsIdPutBody' === $type; - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\AssignmentsIdPutBody' === \get_class($data); - } - - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\AssignmentsIdPutBody' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\AssignmentsIdPutBody' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\AssignmentsIdPutBody(); - 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 \JoliCode\Forecast\Api\Model\AssignmentsIdPutBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('assignment', $data) && null !== $data['assignment']) { + $object->setAssignment($this->denormalizer->denormalize($data['assignment'], 'JoliCode\\Forecast\\Api\\Model\\Assignment', 'json', $context)); + unset($data['assignment']); + } elseif (\array_key_exists('assignment', $data) && null === $data['assignment']) { + $object->setAssignment(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('assignment', $data) && null !== $data['assignment']) { - $object->setAssignment($this->denormalizer->denormalize($data['assignment'], 'JoliCode\\Forecast\\Api\\Model\\Assignment', 'json', $context)); - } elseif (\array_key_exists('assignment', $data) && null === $data['assignment']) { - $object->setAssignment(null); + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['assignment'] = $this->normalizer->normalize($object->getAssignment(), '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 ['JoliCode\\Forecast\\Api\\Model\\AssignmentsIdPutBody' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class AssignmentsIdPutBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - $data['assignment'] = $this->normalizer->normalize($object->getAssignment(), 'json', $context); + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - return $data; + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\AssignmentsIdPutBody' === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\AssignmentsIdPutBody' === $data::class; + } + + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\AssignmentsIdPutBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('assignment', $data) && null !== $data['assignment']) { + $object->setAssignment($this->denormalizer->denormalize($data['assignment'], 'JoliCode\\Forecast\\Api\\Model\\Assignment', 'json', $context)); + unset($data['assignment']); + } elseif (\array_key_exists('assignment', $data) && null === $data['assignment']) { + $object->setAssignment(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['assignment'] = $this->normalizer->normalize($object->getAssignment(), 'json', $context); + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\AssignmentsIdPutBody' => false]; + } } } diff --git a/generated/Normalizer/AssignmentsIdPutResponse200Normalizer.php b/generated/Normalizer/AssignmentsIdPutResponse200Normalizer.php index a976e1e..140f0fc 100644 --- a/generated/Normalizer/AssignmentsIdPutResponse200Normalizer.php +++ b/generated/Normalizer/AssignmentsIdPutResponse200Normalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,61 +22,138 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class AssignmentsIdPutResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class AssignmentsIdPutResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\AssignmentsIdPutResponse200' === $type; - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\AssignmentsIdPutResponse200' === \get_class($data); - } - - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\AssignmentsIdPutResponse200' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\AssignmentsIdPutResponse200' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\AssignmentsIdPutResponse200(); - 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 \JoliCode\Forecast\Api\Model\AssignmentsIdPutResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('assignment', $data) && null !== $data['assignment']) { + $object->setAssignment($this->denormalizer->denormalize($data['assignment'], 'JoliCode\\Forecast\\Api\\Model\\Assignment', 'json', $context)); + unset($data['assignment']); + } elseif (\array_key_exists('assignment', $data) && null === $data['assignment']) { + $object->setAssignment(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('assignment', $data) && null !== $data['assignment']) { - $object->setAssignment($this->denormalizer->denormalize($data['assignment'], 'JoliCode\\Forecast\\Api\\Model\\Assignment', 'json', $context)); - } elseif (\array_key_exists('assignment', $data) && null === $data['assignment']) { - $object->setAssignment(null); + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['assignment'] = $this->normalizer->normalize($object->getAssignment(), '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 ['JoliCode\\Forecast\\Api\\Model\\AssignmentsIdPutResponse200' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class AssignmentsIdPutResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - $data['assignment'] = $this->normalizer->normalize($object->getAssignment(), 'json', $context); + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - return $data; + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\AssignmentsIdPutResponse200' === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\AssignmentsIdPutResponse200' === $data::class; + } + + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\AssignmentsIdPutResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('assignment', $data) && null !== $data['assignment']) { + $object->setAssignment($this->denormalizer->denormalize($data['assignment'], 'JoliCode\\Forecast\\Api\\Model\\Assignment', 'json', $context)); + unset($data['assignment']); + } elseif (\array_key_exists('assignment', $data) && null === $data['assignment']) { + $object->setAssignment(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['assignment'] = $this->normalizer->normalize($object->getAssignment(), 'json', $context); + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\AssignmentsIdPutResponse200' => false]; + } } } diff --git a/generated/Normalizer/AssignmentsNormalizer.php b/generated/Normalizer/AssignmentsNormalizer.php index 084ea03..f74a0ee 100644 --- a/generated/Normalizer/AssignmentsNormalizer.php +++ b/generated/Normalizer/AssignmentsNormalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,69 +22,154 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class AssignmentsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class AssignmentsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\Assignments' === $type; - } - - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\Assignments' === \get_class($data); - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\Assignments' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\Assignments' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\Assignments(); - 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 \JoliCode\Forecast\Api\Model\Assignments(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('assignments', $data) && null !== $data['assignments']) { + $values = []; + foreach ($data['assignments'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Forecast\\Api\\Model\\Assignment', 'json', $context); + } + $object->setAssignments($values); + unset($data['assignments']); + } elseif (\array_key_exists('assignments', $data) && null === $data['assignments']) { + $object->setAssignments(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('assignments', $data) && null !== $data['assignments']) { + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; $values = []; - foreach ($data['assignments'] as $value) { - $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Forecast\\Api\\Model\\Assignment', 'json', $context); + foreach ($object->getAssignments() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); } - $object->setAssignments($values); - } elseif (\array_key_exists('assignments', $data) && null === $data['assignments']) { - $object->setAssignments(null); + $data['assignments'] = $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 ['JoliCode\\Forecast\\Api\\Model\\Assignments' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class AssignmentsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - $values = []; - foreach ($object->getAssignments() as $value) { - $values[] = $this->normalizer->normalize($value, 'json', $context); + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\Assignments' === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\Assignments' === $data::class; } - $data['assignments'] = $values; - return $data; + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\Assignments(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('assignments', $data) && null !== $data['assignments']) { + $values = []; + foreach ($data['assignments'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Forecast\\Api\\Model\\Assignment', 'json', $context); + } + $object->setAssignments($values); + unset($data['assignments']); + } elseif (\array_key_exists('assignments', $data) && null === $data['assignments']) { + $object->setAssignments(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + + return $object; + } + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $values = []; + foreach ($object->getAssignments() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['assignments'] = $values; + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\Assignments' => false]; + } } } diff --git a/generated/Normalizer/AssignmentsPostBodyNormalizer.php b/generated/Normalizer/AssignmentsPostBodyNormalizer.php index c3646aa..2039103 100644 --- a/generated/Normalizer/AssignmentsPostBodyNormalizer.php +++ b/generated/Normalizer/AssignmentsPostBodyNormalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,61 +22,138 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class AssignmentsPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class AssignmentsPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\AssignmentsPostBody' === $type; - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\AssignmentsPostBody' === \get_class($data); - } - - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\AssignmentsPostBody' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\AssignmentsPostBody' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\AssignmentsPostBody(); - 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 \JoliCode\Forecast\Api\Model\AssignmentsPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('assignment', $data) && null !== $data['assignment']) { + $object->setAssignment($this->denormalizer->denormalize($data['assignment'], 'JoliCode\\Forecast\\Api\\Model\\Assignment', 'json', $context)); + unset($data['assignment']); + } elseif (\array_key_exists('assignment', $data) && null === $data['assignment']) { + $object->setAssignment(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('assignment', $data) && null !== $data['assignment']) { - $object->setAssignment($this->denormalizer->denormalize($data['assignment'], 'JoliCode\\Forecast\\Api\\Model\\Assignment', 'json', $context)); - } elseif (\array_key_exists('assignment', $data) && null === $data['assignment']) { - $object->setAssignment(null); + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['assignment'] = $this->normalizer->normalize($object->getAssignment(), '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 ['JoliCode\\Forecast\\Api\\Model\\AssignmentsPostBody' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class AssignmentsPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - $data['assignment'] = $this->normalizer->normalize($object->getAssignment(), 'json', $context); + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - return $data; + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\AssignmentsPostBody' === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\AssignmentsPostBody' === $data::class; + } + + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\AssignmentsPostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('assignment', $data) && null !== $data['assignment']) { + $object->setAssignment($this->denormalizer->denormalize($data['assignment'], 'JoliCode\\Forecast\\Api\\Model\\Assignment', 'json', $context)); + unset($data['assignment']); + } elseif (\array_key_exists('assignment', $data) && null === $data['assignment']) { + $object->setAssignment(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['assignment'] = $this->normalizer->normalize($object->getAssignment(), 'json', $context); + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\AssignmentsPostBody' => false]; + } } } diff --git a/generated/Normalizer/AssignmentsPostResponse201Normalizer.php b/generated/Normalizer/AssignmentsPostResponse201Normalizer.php index c21cd76..caa9c4c 100644 --- a/generated/Normalizer/AssignmentsPostResponse201Normalizer.php +++ b/generated/Normalizer/AssignmentsPostResponse201Normalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,61 +22,138 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class AssignmentsPostResponse201Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class AssignmentsPostResponse201Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\AssignmentsPostResponse201' === $type; - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\AssignmentsPostResponse201' === \get_class($data); - } - - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\AssignmentsPostResponse201' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\AssignmentsPostResponse201' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\AssignmentsPostResponse201(); - 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 \JoliCode\Forecast\Api\Model\AssignmentsPostResponse201(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('assignment', $data) && null !== $data['assignment']) { + $object->setAssignment($this->denormalizer->denormalize($data['assignment'], 'JoliCode\\Forecast\\Api\\Model\\Assignment', 'json', $context)); + unset($data['assignment']); + } elseif (\array_key_exists('assignment', $data) && null === $data['assignment']) { + $object->setAssignment(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('assignment', $data) && null !== $data['assignment']) { - $object->setAssignment($this->denormalizer->denormalize($data['assignment'], 'JoliCode\\Forecast\\Api\\Model\\Assignment', 'json', $context)); - } elseif (\array_key_exists('assignment', $data) && null === $data['assignment']) { - $object->setAssignment(null); + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['assignment'] = $this->normalizer->normalize($object->getAssignment(), '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 ['JoliCode\\Forecast\\Api\\Model\\AssignmentsPostResponse201' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class AssignmentsPostResponse201Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - $data['assignment'] = $this->normalizer->normalize($object->getAssignment(), 'json', $context); + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - return $data; + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\AssignmentsPostResponse201' === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\AssignmentsPostResponse201' === $data::class; + } + + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\AssignmentsPostResponse201(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('assignment', $data) && null !== $data['assignment']) { + $object->setAssignment($this->denormalizer->denormalize($data['assignment'], 'JoliCode\\Forecast\\Api\\Model\\Assignment', 'json', $context)); + unset($data['assignment']); + } elseif (\array_key_exists('assignment', $data) && null === $data['assignment']) { + $object->setAssignment(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['assignment'] = $this->normalizer->normalize($object->getAssignment(), 'json', $context); + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\AssignmentsPostResponse201' => false]; + } } } diff --git a/generated/Normalizer/ClientNormalizer.php b/generated/Normalizer/ClientNormalizer.php index 3c4baee..129c219 100644 --- a/generated/Normalizer/ClientNormalizer.php +++ b/generated/Normalizer/ClientNormalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,101 +22,228 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class ClientNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class ClientNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\Client' === $type; - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\Client' === \get_class($data); - } - - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\Client' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\Client' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\Client(); - 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 \JoliCode\Forecast\Api\Model\Client(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('archived', $data) && null !== $data['archived']) { + $object->setArchived($data['archived']); + unset($data['archived']); + } elseif (\array_key_exists('archived', $data) && null === $data['archived']) { + $object->setArchived(null); + } + if (\array_key_exists('harvest_id', $data) && null !== $data['harvest_id']) { + $object->setHarvestId($data['harvest_id']); + unset($data['harvest_id']); + } elseif (\array_key_exists('harvest_id', $data) && null === $data['harvest_id']) { + $object->setHarvestId(null); + } + if (\array_key_exists('id', $data) && null !== $data['id']) { + $object->setId($data['id']); + unset($data['id']); + } elseif (\array_key_exists('id', $data) && null === $data['id']) { + $object->setId(null); + } + if (\array_key_exists('name', $data) && null !== $data['name']) { + $object->setName($data['name']); + unset($data['name']); + } elseif (\array_key_exists('name', $data) && null === $data['name']) { + $object->setName(null); + } + if (\array_key_exists('updated_at', $data) && null !== $data['updated_at']) { + $object->setUpdatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s.v\\Z', $data['updated_at'])); + unset($data['updated_at']); + } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { + $object->setUpdatedAt(null); + } + if (\array_key_exists('updated_by_id', $data) && null !== $data['updated_by_id']) { + $object->setUpdatedById($data['updated_by_id']); + unset($data['updated_by_id']); + } elseif (\array_key_exists('updated_by_id', $data) && null === $data['updated_by_id']) { + $object->setUpdatedById(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('archived', $data) && null !== $data['archived']) { - $object->setArchived($data['archived']); - } elseif (\array_key_exists('archived', $data) && null === $data['archived']) { - $object->setArchived(null); - } - if (\array_key_exists('harvest_id', $data) && null !== $data['harvest_id']) { - $object->setHarvestId($data['harvest_id']); - } elseif (\array_key_exists('harvest_id', $data) && null === $data['harvest_id']) { - $object->setHarvestId(null); - } - if (\array_key_exists('id', $data) && null !== $data['id']) { - $object->setId($data['id']); - } elseif (\array_key_exists('id', $data) && null === $data['id']) { - $object->setId(null); - } - if (\array_key_exists('name', $data) && null !== $data['name']) { - $object->setName($data['name']); - } elseif (\array_key_exists('name', $data) && null === $data['name']) { - $object->setName(null); - } - if (\array_key_exists('updated_at', $data) && null !== $data['updated_at']) { - $object->setUpdatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s.v\\Z', $data['updated_at'])); - } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { - $object->setUpdatedAt(null); - } - if (\array_key_exists('updated_by_id', $data) && null !== $data['updated_by_id']) { - $object->setUpdatedById($data['updated_by_id']); - } elseif (\array_key_exists('updated_by_id', $data) && null === $data['updated_by_id']) { - $object->setUpdatedById(null); + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('archived') && null !== $object->getArchived()) { + $data['archived'] = $object->getArchived(); + } + if ($object->isInitialized('harvestId') && null !== $object->getHarvestId()) { + $data['harvest_id'] = $object->getHarvestId(); + } + if ($object->isInitialized('id') && null !== $object->getId()) { + $data['id'] = $object->getId(); + } + $data['name'] = $object->getName(); + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { + $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s.v\\Z'); + } + if ($object->isInitialized('updatedById') && null !== $object->getUpdatedById()) { + $data['updated_by_id'] = $object->getUpdatedById(); + } + 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 ['JoliCode\\Forecast\\Api\\Model\\Client' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class ClientNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if (null !== $object->getArchived()) { - $data['archived'] = $object->getArchived(); - } - if (null !== $object->getHarvestId()) { - $data['harvest_id'] = $object->getHarvestId(); + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\Client' === $type; } - if (null !== $object->getId()) { - $data['id'] = $object->getId(); + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\Client' === $data::class; } - $data['name'] = $object->getName(); - if (null !== $object->getUpdatedAt()) { - $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s.v\\Z'); + + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\Client(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('archived', $data) && null !== $data['archived']) { + $object->setArchived($data['archived']); + unset($data['archived']); + } elseif (\array_key_exists('archived', $data) && null === $data['archived']) { + $object->setArchived(null); + } + if (\array_key_exists('harvest_id', $data) && null !== $data['harvest_id']) { + $object->setHarvestId($data['harvest_id']); + unset($data['harvest_id']); + } elseif (\array_key_exists('harvest_id', $data) && null === $data['harvest_id']) { + $object->setHarvestId(null); + } + if (\array_key_exists('id', $data) && null !== $data['id']) { + $object->setId($data['id']); + unset($data['id']); + } elseif (\array_key_exists('id', $data) && null === $data['id']) { + $object->setId(null); + } + if (\array_key_exists('name', $data) && null !== $data['name']) { + $object->setName($data['name']); + unset($data['name']); + } elseif (\array_key_exists('name', $data) && null === $data['name']) { + $object->setName(null); + } + if (\array_key_exists('updated_at', $data) && null !== $data['updated_at']) { + $object->setUpdatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s.v\\Z', $data['updated_at'])); + unset($data['updated_at']); + } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { + $object->setUpdatedAt(null); + } + if (\array_key_exists('updated_by_id', $data) && null !== $data['updated_by_id']) { + $object->setUpdatedById($data['updated_by_id']); + unset($data['updated_by_id']); + } elseif (\array_key_exists('updated_by_id', $data) && null === $data['updated_by_id']) { + $object->setUpdatedById(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; } - if (null !== $object->getUpdatedById()) { - $data['updated_by_id'] = $object->getUpdatedById(); + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('archived') && null !== $object->getArchived()) { + $data['archived'] = $object->getArchived(); + } + if ($object->isInitialized('harvestId') && null !== $object->getHarvestId()) { + $data['harvest_id'] = $object->getHarvestId(); + } + if ($object->isInitialized('id') && null !== $object->getId()) { + $data['id'] = $object->getId(); + } + $data['name'] = $object->getName(); + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { + $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s.v\\Z'); + } + if ($object->isInitialized('updatedById') && null !== $object->getUpdatedById()) { + $data['updated_by_id'] = $object->getUpdatedById(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\Client' => false]; + } } } diff --git a/generated/Normalizer/ClientsIdGetResponse200Normalizer.php b/generated/Normalizer/ClientsIdGetResponse200Normalizer.php index 63ff49e..13d1d95 100644 --- a/generated/Normalizer/ClientsIdGetResponse200Normalizer.php +++ b/generated/Normalizer/ClientsIdGetResponse200Normalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,61 +22,138 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class ClientsIdGetResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class ClientsIdGetResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\ClientsIdGetResponse200' === $type; - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\ClientsIdGetResponse200' === \get_class($data); - } - - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\ClientsIdGetResponse200' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\ClientsIdGetResponse200' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\ClientsIdGetResponse200(); - 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 \JoliCode\Forecast\Api\Model\ClientsIdGetResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('client', $data) && null !== $data['client']) { + $object->setClient($this->denormalizer->denormalize($data['client'], 'JoliCode\\Forecast\\Api\\Model\\Client', 'json', $context)); + unset($data['client']); + } elseif (\array_key_exists('client', $data) && null === $data['client']) { + $object->setClient(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('client', $data) && null !== $data['client']) { - $object->setClient($this->denormalizer->denormalize($data['client'], 'JoliCode\\Forecast\\Api\\Model\\Client', 'json', $context)); - } elseif (\array_key_exists('client', $data) && null === $data['client']) { - $object->setClient(null); + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['client'] = $this->normalizer->normalize($object->getClient(), '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 ['JoliCode\\Forecast\\Api\\Model\\ClientsIdGetResponse200' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class ClientsIdGetResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - $data['client'] = $this->normalizer->normalize($object->getClient(), 'json', $context); + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - return $data; + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\ClientsIdGetResponse200' === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\ClientsIdGetResponse200' === $data::class; + } + + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\ClientsIdGetResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('client', $data) && null !== $data['client']) { + $object->setClient($this->denormalizer->denormalize($data['client'], 'JoliCode\\Forecast\\Api\\Model\\Client', 'json', $context)); + unset($data['client']); + } elseif (\array_key_exists('client', $data) && null === $data['client']) { + $object->setClient(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['client'] = $this->normalizer->normalize($object->getClient(), 'json', $context); + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\ClientsIdGetResponse200' => false]; + } } } diff --git a/generated/Normalizer/ClientsNormalizer.php b/generated/Normalizer/ClientsNormalizer.php index 44ea47a..0d0eb30 100644 --- a/generated/Normalizer/ClientsNormalizer.php +++ b/generated/Normalizer/ClientsNormalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,69 +22,154 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class ClientsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class ClientsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\Clients' === $type; - } - - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\Clients' === \get_class($data); - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\Clients' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\Clients' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\Clients(); - 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 \JoliCode\Forecast\Api\Model\Clients(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('clients', $data) && null !== $data['clients']) { + $values = []; + foreach ($data['clients'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Forecast\\Api\\Model\\Client', 'json', $context); + } + $object->setClients($values); + unset($data['clients']); + } elseif (\array_key_exists('clients', $data) && null === $data['clients']) { + $object->setClients(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('clients', $data) && null !== $data['clients']) { + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; $values = []; - foreach ($data['clients'] as $value) { - $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Forecast\\Api\\Model\\Client', 'json', $context); + foreach ($object->getClients() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); } - $object->setClients($values); - } elseif (\array_key_exists('clients', $data) && null === $data['clients']) { - $object->setClients(null); + $data['clients'] = $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 ['JoliCode\\Forecast\\Api\\Model\\Clients' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class ClientsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - $values = []; - foreach ($object->getClients() as $value) { - $values[] = $this->normalizer->normalize($value, 'json', $context); + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\Clients' === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\Clients' === $data::class; } - $data['clients'] = $values; - return $data; + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\Clients(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('clients', $data) && null !== $data['clients']) { + $values = []; + foreach ($data['clients'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Forecast\\Api\\Model\\Client', 'json', $context); + } + $object->setClients($values); + unset($data['clients']); + } elseif (\array_key_exists('clients', $data) && null === $data['clients']) { + $object->setClients(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + + return $object; + } + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $values = []; + foreach ($object->getClients() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['clients'] = $values; + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\Clients' => false]; + } } } diff --git a/generated/Normalizer/ErrorNormalizer.php b/generated/Normalizer/ErrorNormalizer.php index 0df4d05..79f7a94 100644 --- a/generated/Normalizer/ErrorNormalizer.php +++ b/generated/Normalizer/ErrorNormalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,71 +22,158 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class ErrorNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class ErrorNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\Error' === $type; - } - - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\Error' === \get_class($data); - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\Error' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\Error' === $data::class; } - $object = new \JoliCode\Forecast\Api\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 \JoliCode\Forecast\Api\Model\Error(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('errors', $data) && null !== $data['errors']) { + $values = []; + foreach ($data['errors'] as $value) { + $values[] = $value; + } + $object->setErrors($values); + unset($data['errors']); + } elseif (\array_key_exists('errors', $data) && null === $data['errors']) { + $object->setErrors(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('errors', $data) && null !== $data['errors']) { - $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('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; + } } - $object->setErrors($values); - } elseif (\array_key_exists('errors', $data) && null === $data['errors']) { - $object->setErrors(null); + + return $data; } - return $object; + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\Error' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @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 (null !== $object->getErrors()) { - $values = []; - foreach ($object->getErrors() as $value) { - $values[] = $value; + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\Error' === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\Error' === $data::class; + } + + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\Error(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('errors', $data) && null !== $data['errors']) { + $values = []; + foreach ($data['errors'] as $value) { + $values[] = $value; + } + $object->setErrors($values); + unset($data['errors']); + } elseif (\array_key_exists('errors', $data) && null === $data['errors']) { + $object->setErrors(null); } - $data['errors'] = $values; + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + + return $object; } - return $data; + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + 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; + } + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\Error' => false]; + } } } diff --git a/generated/Normalizer/FutureScheduledHourNormalizer.php b/generated/Normalizer/FutureScheduledHourNormalizer.php index 0c1de80..94005b6 100644 --- a/generated/Normalizer/FutureScheduledHourNormalizer.php +++ b/generated/Normalizer/FutureScheduledHourNormalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,83 +22,188 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class FutureScheduledHourNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool - { - return 'JoliCode\\Forecast\\Api\\Model\\FutureScheduledHour' === $type; - } - - public function supportsNormalization($data, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class FutureScheduledHourNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\FutureScheduledHour' === \get_class($data); - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\FutureScheduledHour' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\FutureScheduledHour' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\FutureScheduledHour(); - 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 \JoliCode\Forecast\Api\Model\FutureScheduledHour(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('allocation', $data) && null !== $data['allocation']) { + $object->setAllocation($data['allocation']); + unset($data['allocation']); + } elseif (\array_key_exists('allocation', $data) && null === $data['allocation']) { + $object->setAllocation(null); + } + if (\array_key_exists('person_id', $data) && null !== $data['person_id']) { + $object->setPersonId($data['person_id']); + unset($data['person_id']); + } elseif (\array_key_exists('person_id', $data) && null === $data['person_id']) { + $object->setPersonId(null); + } + if (\array_key_exists('placeholder_id', $data) && null !== $data['placeholder_id']) { + $object->setPlaceholderId($data['placeholder_id']); + unset($data['placeholder_id']); + } elseif (\array_key_exists('placeholder_id', $data) && null === $data['placeholder_id']) { + $object->setPlaceholderId(null); + } + if (\array_key_exists('project_id', $data) && null !== $data['project_id']) { + $object->setProjectId($data['project_id']); + unset($data['project_id']); + } elseif (\array_key_exists('project_id', $data) && null === $data['project_id']) { + $object->setProjectId(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('allocation', $data) && null !== $data['allocation']) { - $object->setAllocation($data['allocation']); - } elseif (\array_key_exists('allocation', $data) && null === $data['allocation']) { - $object->setAllocation(null); + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['allocation'] = $object->getAllocation(); + if ($object->isInitialized('personId') && null !== $object->getPersonId()) { + $data['person_id'] = $object->getPersonId(); + } + if ($object->isInitialized('placeholderId') && null !== $object->getPlaceholderId()) { + $data['placeholder_id'] = $object->getPlaceholderId(); + } + $data['project_id'] = $object->getProjectId(); + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - if (\array_key_exists('person_id', $data) && null !== $data['person_id']) { - $object->setPersonId($data['person_id']); - } elseif (\array_key_exists('person_id', $data) && null === $data['person_id']) { - $object->setPersonId(null); + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\FutureScheduledHour' => false]; } - if (\array_key_exists('placeholder_id', $data) && null !== $data['placeholder_id']) { - $object->setPlaceholderId($data['placeholder_id']); - } elseif (\array_key_exists('placeholder_id', $data) && null === $data['placeholder_id']) { - $object->setPlaceholderId(null); + } +} else { + class FutureScheduledHourNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\FutureScheduledHour' === $type; } - if (\array_key_exists('project_id', $data) && null !== $data['project_id']) { - $object->setProjectId($data['project_id']); - } elseif (\array_key_exists('project_id', $data) && null === $data['project_id']) { - $object->setProjectId(null); + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\FutureScheduledHour' === $data::class; } - return $object; - } + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\FutureScheduledHour(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('allocation', $data) && null !== $data['allocation']) { + $object->setAllocation($data['allocation']); + unset($data['allocation']); + } elseif (\array_key_exists('allocation', $data) && null === $data['allocation']) { + $object->setAllocation(null); + } + if (\array_key_exists('person_id', $data) && null !== $data['person_id']) { + $object->setPersonId($data['person_id']); + unset($data['person_id']); + } elseif (\array_key_exists('person_id', $data) && null === $data['person_id']) { + $object->setPersonId(null); + } + if (\array_key_exists('placeholder_id', $data) && null !== $data['placeholder_id']) { + $object->setPlaceholderId($data['placeholder_id']); + unset($data['placeholder_id']); + } elseif (\array_key_exists('placeholder_id', $data) && null === $data['placeholder_id']) { + $object->setPlaceholderId(null); + } + if (\array_key_exists('project_id', $data) && null !== $data['project_id']) { + $object->setProjectId($data['project_id']); + unset($data['project_id']); + } elseif (\array_key_exists('project_id', $data) && null === $data['project_id']) { + $object->setProjectId(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) - { - $data = []; - $data['allocation'] = $object->getAllocation(); - if (null !== $object->getPersonId()) { - $data['person_id'] = $object->getPersonId(); + return $object; } - if (null !== $object->getPlaceholderId()) { - $data['placeholder_id'] = $object->getPlaceholderId(); + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['allocation'] = $object->getAllocation(); + if ($object->isInitialized('personId') && null !== $object->getPersonId()) { + $data['person_id'] = $object->getPersonId(); + } + if ($object->isInitialized('placeholderId') && null !== $object->getPlaceholderId()) { + $data['placeholder_id'] = $object->getPlaceholderId(); + } + $data['project_id'] = $object->getProjectId(); + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - $data['project_id'] = $object->getProjectId(); - return $data; + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\FutureScheduledHour' => false]; + } } } diff --git a/generated/Normalizer/FutureScheduledHoursNormalizer.php b/generated/Normalizer/FutureScheduledHoursNormalizer.php index 45581c2..1a3134b 100644 --- a/generated/Normalizer/FutureScheduledHoursNormalizer.php +++ b/generated/Normalizer/FutureScheduledHoursNormalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,69 +22,154 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class FutureScheduledHoursNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class FutureScheduledHoursNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\FutureScheduledHours' === $type; - } - - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\FutureScheduledHours' === \get_class($data); - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\FutureScheduledHours' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\FutureScheduledHours' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\FutureScheduledHours(); - 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 \JoliCode\Forecast\Api\Model\FutureScheduledHours(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('future_scheduled_hours', $data) && null !== $data['future_scheduled_hours']) { + $values = []; + foreach ($data['future_scheduled_hours'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Forecast\\Api\\Model\\FutureScheduledHour', 'json', $context); + } + $object->setFutureScheduledHours($values); + unset($data['future_scheduled_hours']); + } elseif (\array_key_exists('future_scheduled_hours', $data) && null === $data['future_scheduled_hours']) { + $object->setFutureScheduledHours(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('future_scheduled_hours', $data) && null !== $data['future_scheduled_hours']) { + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; $values = []; - foreach ($data['future_scheduled_hours'] as $value) { - $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Forecast\\Api\\Model\\FutureScheduledHour', 'json', $context); + foreach ($object->getFutureScheduledHours() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); } - $object->setFutureScheduledHours($values); - } elseif (\array_key_exists('future_scheduled_hours', $data) && null === $data['future_scheduled_hours']) { - $object->setFutureScheduledHours(null); + $data['future_scheduled_hours'] = $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 ['JoliCode\\Forecast\\Api\\Model\\FutureScheduledHours' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class FutureScheduledHoursNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - $values = []; - foreach ($object->getFutureScheduledHours() as $value) { - $values[] = $this->normalizer->normalize($value, 'json', $context); + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\FutureScheduledHours' === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\FutureScheduledHours' === $data::class; } - $data['future_scheduled_hours'] = $values; - return $data; + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\FutureScheduledHours(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('future_scheduled_hours', $data) && null !== $data['future_scheduled_hours']) { + $values = []; + foreach ($data['future_scheduled_hours'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Forecast\\Api\\Model\\FutureScheduledHour', 'json', $context); + } + $object->setFutureScheduledHours($values); + unset($data['future_scheduled_hours']); + } elseif (\array_key_exists('future_scheduled_hours', $data) && null === $data['future_scheduled_hours']) { + $object->setFutureScheduledHours(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + + return $object; + } + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $values = []; + foreach ($object->getFutureScheduledHours() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['future_scheduled_hours'] = $values; + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\FutureScheduledHours' => false]; + } } } diff --git a/generated/Normalizer/JaneObjectNormalizer.php b/generated/Normalizer/JaneObjectNormalizer.php index bf4d331..42007a3 100644 --- a/generated/Normalizer/JaneObjectNormalizer.php +++ b/generated/Normalizer/JaneObjectNormalizer.php @@ -12,6 +12,8 @@ namespace JoliCode\Forecast\Api\Normalizer; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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,65 +21,124 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class JaneObjectNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - protected $normalizers = ['JoliCode\\Forecast\\Api\\Model\\Account' => 'JoliCode\\Forecast\\Api\\Normalizer\\AccountNormalizer', 'JoliCode\\Forecast\\Api\\Model\\AccountAccount' => 'JoliCode\\Forecast\\Api\\Normalizer\\AccountAccountNormalizer', 'JoliCode\\Forecast\\Api\\Model\\AccountAccountColorLabelsItem' => 'JoliCode\\Forecast\\Api\\Normalizer\\AccountAccountColorLabelsItemNormalizer', 'JoliCode\\Forecast\\Api\\Model\\Assignment' => 'JoliCode\\Forecast\\Api\\Normalizer\\AssignmentNormalizer', 'JoliCode\\Forecast\\Api\\Model\\Assignments' => 'JoliCode\\Forecast\\Api\\Normalizer\\AssignmentsNormalizer', 'JoliCode\\Forecast\\Api\\Model\\Client' => 'JoliCode\\Forecast\\Api\\Normalizer\\ClientNormalizer', 'JoliCode\\Forecast\\Api\\Model\\Clients' => 'JoliCode\\Forecast\\Api\\Normalizer\\ClientsNormalizer', 'JoliCode\\Forecast\\Api\\Model\\FutureScheduledHour' => 'JoliCode\\Forecast\\Api\\Normalizer\\FutureScheduledHourNormalizer', 'JoliCode\\Forecast\\Api\\Model\\FutureScheduledHours' => 'JoliCode\\Forecast\\Api\\Normalizer\\FutureScheduledHoursNormalizer', 'JoliCode\\Forecast\\Api\\Model\\People' => 'JoliCode\\Forecast\\Api\\Normalizer\\PeopleNormalizer', 'JoliCode\\Forecast\\Api\\Model\\Person' => 'JoliCode\\Forecast\\Api\\Normalizer\\PersonNormalizer', 'JoliCode\\Forecast\\Api\\Model\\PersonWorkingDays' => 'JoliCode\\Forecast\\Api\\Normalizer\\PersonWorkingDaysNormalizer', 'JoliCode\\Forecast\\Api\\Model\\Placeholder' => 'JoliCode\\Forecast\\Api\\Normalizer\\PlaceholderNormalizer', 'JoliCode\\Forecast\\Api\\Model\\PlaceholderBody' => 'JoliCode\\Forecast\\Api\\Normalizer\\PlaceholderBodyNormalizer', 'JoliCode\\Forecast\\Api\\Model\\PlaceholderBodyPlaceholder' => 'JoliCode\\Forecast\\Api\\Normalizer\\PlaceholderBodyPlaceholderNormalizer', 'JoliCode\\Forecast\\Api\\Model\\Placeholders' => 'JoliCode\\Forecast\\Api\\Normalizer\\PlaceholdersNormalizer', 'JoliCode\\Forecast\\Api\\Model\\Project' => 'JoliCode\\Forecast\\Api\\Normalizer\\ProjectNormalizer', 'JoliCode\\Forecast\\Api\\Model\\Projects' => 'JoliCode\\Forecast\\Api\\Normalizer\\ProjectsNormalizer', 'JoliCode\\Forecast\\Api\\Model\\RemainingBudgetedHour' => 'JoliCode\\Forecast\\Api\\Normalizer\\RemainingBudgetedHourNormalizer', 'JoliCode\\Forecast\\Api\\Model\\RemainingBudgetedHours' => 'JoliCode\\Forecast\\Api\\Normalizer\\RemainingBudgetedHoursNormalizer', 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSet' => 'JoliCode\\Forecast\\Api\\Normalizer\\RepeatedAssignmentSetNormalizer', 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetBody' => 'JoliCode\\Forecast\\Api\\Normalizer\\RepeatedAssignmentSetBodyNormalizer', 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetBodyRepeatedAssignmentSet' => 'JoliCode\\Forecast\\Api\\Normalizer\\RepeatedAssignmentSetBodyRepeatedAssignmentSetNormalizer', 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSets' => 'JoliCode\\Forecast\\Api\\Normalizer\\RepeatedAssignmentSetsNormalizer', 'JoliCode\\Forecast\\Api\\Model\\Role' => 'JoliCode\\Forecast\\Api\\Normalizer\\RoleNormalizer', 'JoliCode\\Forecast\\Api\\Model\\RoleBody' => 'JoliCode\\Forecast\\Api\\Normalizer\\RoleBodyNormalizer', 'JoliCode\\Forecast\\Api\\Model\\RoleBodyRole' => 'JoliCode\\Forecast\\Api\\Normalizer\\RoleBodyRoleNormalizer', 'JoliCode\\Forecast\\Api\\Model\\Roles' => 'JoliCode\\Forecast\\Api\\Normalizer\\RolesNormalizer', 'JoliCode\\Forecast\\Api\\Model\\Subscription' => 'JoliCode\\Forecast\\Api\\Normalizer\\SubscriptionNormalizer', 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscription' => 'JoliCode\\Forecast\\Api\\Normalizer\\SubscriptionSubscriptionNormalizer', 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionDiscounts' => 'JoliCode\\Forecast\\Api\\Normalizer\\SubscriptionSubscriptionDiscountsNormalizer', 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionCard' => 'JoliCode\\Forecast\\Api\\Normalizer\\SubscriptionSubscriptionCardNormalizer', 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionAddress' => 'JoliCode\\Forecast\\Api\\Normalizer\\SubscriptionSubscriptionAddressNormalizer', 'JoliCode\\Forecast\\Api\\Model\\User' => 'JoliCode\\Forecast\\Api\\Normalizer\\UserNormalizer', 'JoliCode\\Forecast\\Api\\Model\\UserCurrentUser' => 'JoliCode\\Forecast\\Api\\Normalizer\\UserCurrentUserNormalizer', 'JoliCode\\Forecast\\Api\\Model\\UserConnection' => 'JoliCode\\Forecast\\Api\\Normalizer\\UserConnectionNormalizer', 'JoliCode\\Forecast\\Api\\Model\\UserConnections' => 'JoliCode\\Forecast\\Api\\Normalizer\\UserConnectionsNormalizer', 'JoliCode\\Forecast\\Api\\Model\\Error' => 'JoliCode\\Forecast\\Api\\Normalizer\\ErrorNormalizer', 'JoliCode\\Forecast\\Api\\Model\\AssignmentsIdGetResponse200' => 'JoliCode\\Forecast\\Api\\Normalizer\\AssignmentsIdGetResponse200Normalizer', 'JoliCode\\Forecast\\Api\\Model\\AssignmentsIdPutBody' => 'JoliCode\\Forecast\\Api\\Normalizer\\AssignmentsIdPutBodyNormalizer', 'JoliCode\\Forecast\\Api\\Model\\AssignmentsIdPutResponse200' => 'JoliCode\\Forecast\\Api\\Normalizer\\AssignmentsIdPutResponse200Normalizer', 'JoliCode\\Forecast\\Api\\Model\\AssignmentsPostBody' => 'JoliCode\\Forecast\\Api\\Normalizer\\AssignmentsPostBodyNormalizer', 'JoliCode\\Forecast\\Api\\Model\\AssignmentsPostResponse201' => 'JoliCode\\Forecast\\Api\\Normalizer\\AssignmentsPostResponse201Normalizer', 'JoliCode\\Forecast\\Api\\Model\\ClientsIdGetResponse200' => 'JoliCode\\Forecast\\Api\\Normalizer\\ClientsIdGetResponse200Normalizer', 'JoliCode\\Forecast\\Api\\Model\\PeopleIdGetResponse200' => 'JoliCode\\Forecast\\Api\\Normalizer\\PeopleIdGetResponse200Normalizer', 'JoliCode\\Forecast\\Api\\Model\\PeopleIdPutBody' => 'JoliCode\\Forecast\\Api\\Normalizer\\PeopleIdPutBodyNormalizer', 'JoliCode\\Forecast\\Api\\Model\\PeopleIdPutResponse200' => 'JoliCode\\Forecast\\Api\\Normalizer\\PeopleIdPutResponse200Normalizer', 'JoliCode\\Forecast\\Api\\Model\\PeoplePostBody' => 'JoliCode\\Forecast\\Api\\Normalizer\\PeoplePostBodyNormalizer', 'JoliCode\\Forecast\\Api\\Model\\PeoplePostResponse201' => 'JoliCode\\Forecast\\Api\\Normalizer\\PeoplePostResponse201Normalizer', 'JoliCode\\Forecast\\Api\\Model\\PlaceholdersIdGetResponse200' => 'JoliCode\\Forecast\\Api\\Normalizer\\PlaceholdersIdGetResponse200Normalizer', 'JoliCode\\Forecast\\Api\\Model\\PlaceholdersIdPutResponse200' => 'JoliCode\\Forecast\\Api\\Normalizer\\PlaceholdersIdPutResponse200Normalizer', 'JoliCode\\Forecast\\Api\\Model\\PlaceholdersPostResponse201' => 'JoliCode\\Forecast\\Api\\Normalizer\\PlaceholdersPostResponse201Normalizer', 'JoliCode\\Forecast\\Api\\Model\\ProjectsIdGetResponse200' => 'JoliCode\\Forecast\\Api\\Normalizer\\ProjectsIdGetResponse200Normalizer', 'JoliCode\\Forecast\\Api\\Model\\RolesIdGetResponse200' => 'JoliCode\\Forecast\\Api\\Normalizer\\RolesIdGetResponse200Normalizer', 'JoliCode\\Forecast\\Api\\Model\\RolesIdPutResponse200' => 'JoliCode\\Forecast\\Api\\Normalizer\\RolesIdPutResponse200Normalizer', 'JoliCode\\Forecast\\Api\\Model\\RolesPostResponse201' => 'JoliCode\\Forecast\\Api\\Normalizer\\RolesPostResponse201Normalizer', 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetsIdGetResponse200' => 'JoliCode\\Forecast\\Api\\Normalizer\\RepeatedAssignmentSetsIdGetResponse200Normalizer', 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetsIdPutResponse200' => 'JoliCode\\Forecast\\Api\\Normalizer\\RepeatedAssignmentSetsIdPutResponse200Normalizer', 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetsPostResponse201' => 'JoliCode\\Forecast\\Api\\Normalizer\\RepeatedAssignmentSetsPostResponse201Normalizer', '\\Jane\\Component\\JsonSchemaRuntime\\Reference' => '\\JoliCode\\Forecast\\Api\\Runtime\\Normalizer\\ReferenceNormalizer']; - protected $normalizersCache = []; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class JaneObjectNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return \array_key_exists($type, $this->normalizers); - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; + protected $normalizers = ['JoliCode\\Forecast\\Api\\Model\\Account' => 'JoliCode\\Forecast\\Api\\Normalizer\\AccountNormalizer', 'JoliCode\\Forecast\\Api\\Model\\AccountAccount' => 'JoliCode\\Forecast\\Api\\Normalizer\\AccountAccountNormalizer', 'JoliCode\\Forecast\\Api\\Model\\AccountAccountColorLabelsItem' => 'JoliCode\\Forecast\\Api\\Normalizer\\AccountAccountColorLabelsItemNormalizer', 'JoliCode\\Forecast\\Api\\Model\\Assignment' => 'JoliCode\\Forecast\\Api\\Normalizer\\AssignmentNormalizer', 'JoliCode\\Forecast\\Api\\Model\\Assignments' => 'JoliCode\\Forecast\\Api\\Normalizer\\AssignmentsNormalizer', 'JoliCode\\Forecast\\Api\\Model\\Client' => 'JoliCode\\Forecast\\Api\\Normalizer\\ClientNormalizer', 'JoliCode\\Forecast\\Api\\Model\\Clients' => 'JoliCode\\Forecast\\Api\\Normalizer\\ClientsNormalizer', 'JoliCode\\Forecast\\Api\\Model\\FutureScheduledHour' => 'JoliCode\\Forecast\\Api\\Normalizer\\FutureScheduledHourNormalizer', 'JoliCode\\Forecast\\Api\\Model\\FutureScheduledHours' => 'JoliCode\\Forecast\\Api\\Normalizer\\FutureScheduledHoursNormalizer', 'JoliCode\\Forecast\\Api\\Model\\People' => 'JoliCode\\Forecast\\Api\\Normalizer\\PeopleNormalizer', 'JoliCode\\Forecast\\Api\\Model\\Person' => 'JoliCode\\Forecast\\Api\\Normalizer\\PersonNormalizer', 'JoliCode\\Forecast\\Api\\Model\\PersonWorkingDays' => 'JoliCode\\Forecast\\Api\\Normalizer\\PersonWorkingDaysNormalizer', 'JoliCode\\Forecast\\Api\\Model\\Placeholder' => 'JoliCode\\Forecast\\Api\\Normalizer\\PlaceholderNormalizer', 'JoliCode\\Forecast\\Api\\Model\\PlaceholderBody' => 'JoliCode\\Forecast\\Api\\Normalizer\\PlaceholderBodyNormalizer', 'JoliCode\\Forecast\\Api\\Model\\PlaceholderBodyPlaceholder' => 'JoliCode\\Forecast\\Api\\Normalizer\\PlaceholderBodyPlaceholderNormalizer', 'JoliCode\\Forecast\\Api\\Model\\Placeholders' => 'JoliCode\\Forecast\\Api\\Normalizer\\PlaceholdersNormalizer', 'JoliCode\\Forecast\\Api\\Model\\Project' => 'JoliCode\\Forecast\\Api\\Normalizer\\ProjectNormalizer', 'JoliCode\\Forecast\\Api\\Model\\Projects' => 'JoliCode\\Forecast\\Api\\Normalizer\\ProjectsNormalizer', 'JoliCode\\Forecast\\Api\\Model\\RemainingBudgetedHour' => 'JoliCode\\Forecast\\Api\\Normalizer\\RemainingBudgetedHourNormalizer', 'JoliCode\\Forecast\\Api\\Model\\RemainingBudgetedHours' => 'JoliCode\\Forecast\\Api\\Normalizer\\RemainingBudgetedHoursNormalizer', 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSet' => 'JoliCode\\Forecast\\Api\\Normalizer\\RepeatedAssignmentSetNormalizer', 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetBody' => 'JoliCode\\Forecast\\Api\\Normalizer\\RepeatedAssignmentSetBodyNormalizer', 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetBodyRepeatedAssignmentSet' => 'JoliCode\\Forecast\\Api\\Normalizer\\RepeatedAssignmentSetBodyRepeatedAssignmentSetNormalizer', 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSets' => 'JoliCode\\Forecast\\Api\\Normalizer\\RepeatedAssignmentSetsNormalizer', 'JoliCode\\Forecast\\Api\\Model\\Role' => 'JoliCode\\Forecast\\Api\\Normalizer\\RoleNormalizer', 'JoliCode\\Forecast\\Api\\Model\\RoleBody' => 'JoliCode\\Forecast\\Api\\Normalizer\\RoleBodyNormalizer', 'JoliCode\\Forecast\\Api\\Model\\RoleBodyRole' => 'JoliCode\\Forecast\\Api\\Normalizer\\RoleBodyRoleNormalizer', 'JoliCode\\Forecast\\Api\\Model\\Roles' => 'JoliCode\\Forecast\\Api\\Normalizer\\RolesNormalizer', 'JoliCode\\Forecast\\Api\\Model\\Subscription' => 'JoliCode\\Forecast\\Api\\Normalizer\\SubscriptionNormalizer', 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscription' => 'JoliCode\\Forecast\\Api\\Normalizer\\SubscriptionSubscriptionNormalizer', 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionDiscounts' => 'JoliCode\\Forecast\\Api\\Normalizer\\SubscriptionSubscriptionDiscountsNormalizer', 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionCard' => 'JoliCode\\Forecast\\Api\\Normalizer\\SubscriptionSubscriptionCardNormalizer', 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionAddress' => 'JoliCode\\Forecast\\Api\\Normalizer\\SubscriptionSubscriptionAddressNormalizer', 'JoliCode\\Forecast\\Api\\Model\\User' => 'JoliCode\\Forecast\\Api\\Normalizer\\UserNormalizer', 'JoliCode\\Forecast\\Api\\Model\\UserCurrentUser' => 'JoliCode\\Forecast\\Api\\Normalizer\\UserCurrentUserNormalizer', 'JoliCode\\Forecast\\Api\\Model\\UserConnection' => 'JoliCode\\Forecast\\Api\\Normalizer\\UserConnectionNormalizer', 'JoliCode\\Forecast\\Api\\Model\\UserConnections' => 'JoliCode\\Forecast\\Api\\Normalizer\\UserConnectionsNormalizer', 'JoliCode\\Forecast\\Api\\Model\\Error' => 'JoliCode\\Forecast\\Api\\Normalizer\\ErrorNormalizer', 'JoliCode\\Forecast\\Api\\Model\\AssignmentsIdGetResponse200' => 'JoliCode\\Forecast\\Api\\Normalizer\\AssignmentsIdGetResponse200Normalizer', 'JoliCode\\Forecast\\Api\\Model\\AssignmentsIdPutBody' => 'JoliCode\\Forecast\\Api\\Normalizer\\AssignmentsIdPutBodyNormalizer', 'JoliCode\\Forecast\\Api\\Model\\AssignmentsIdPutResponse200' => 'JoliCode\\Forecast\\Api\\Normalizer\\AssignmentsIdPutResponse200Normalizer', 'JoliCode\\Forecast\\Api\\Model\\AssignmentsPostBody' => 'JoliCode\\Forecast\\Api\\Normalizer\\AssignmentsPostBodyNormalizer', 'JoliCode\\Forecast\\Api\\Model\\AssignmentsPostResponse201' => 'JoliCode\\Forecast\\Api\\Normalizer\\AssignmentsPostResponse201Normalizer', 'JoliCode\\Forecast\\Api\\Model\\ClientsIdGetResponse200' => 'JoliCode\\Forecast\\Api\\Normalizer\\ClientsIdGetResponse200Normalizer', 'JoliCode\\Forecast\\Api\\Model\\PeopleIdGetResponse200' => 'JoliCode\\Forecast\\Api\\Normalizer\\PeopleIdGetResponse200Normalizer', 'JoliCode\\Forecast\\Api\\Model\\PeopleIdPutBody' => 'JoliCode\\Forecast\\Api\\Normalizer\\PeopleIdPutBodyNormalizer', 'JoliCode\\Forecast\\Api\\Model\\PeopleIdPutResponse200' => 'JoliCode\\Forecast\\Api\\Normalizer\\PeopleIdPutResponse200Normalizer', 'JoliCode\\Forecast\\Api\\Model\\PeoplePostBody' => 'JoliCode\\Forecast\\Api\\Normalizer\\PeoplePostBodyNormalizer', 'JoliCode\\Forecast\\Api\\Model\\PeoplePostResponse201' => 'JoliCode\\Forecast\\Api\\Normalizer\\PeoplePostResponse201Normalizer', 'JoliCode\\Forecast\\Api\\Model\\PlaceholdersIdGetResponse200' => 'JoliCode\\Forecast\\Api\\Normalizer\\PlaceholdersIdGetResponse200Normalizer', 'JoliCode\\Forecast\\Api\\Model\\PlaceholdersIdPutResponse200' => 'JoliCode\\Forecast\\Api\\Normalizer\\PlaceholdersIdPutResponse200Normalizer', 'JoliCode\\Forecast\\Api\\Model\\PlaceholdersPostResponse201' => 'JoliCode\\Forecast\\Api\\Normalizer\\PlaceholdersPostResponse201Normalizer', 'JoliCode\\Forecast\\Api\\Model\\ProjectsIdGetResponse200' => 'JoliCode\\Forecast\\Api\\Normalizer\\ProjectsIdGetResponse200Normalizer', 'JoliCode\\Forecast\\Api\\Model\\RolesIdGetResponse200' => 'JoliCode\\Forecast\\Api\\Normalizer\\RolesIdGetResponse200Normalizer', 'JoliCode\\Forecast\\Api\\Model\\RolesIdPutResponse200' => 'JoliCode\\Forecast\\Api\\Normalizer\\RolesIdPutResponse200Normalizer', 'JoliCode\\Forecast\\Api\\Model\\RolesPostResponse201' => 'JoliCode\\Forecast\\Api\\Normalizer\\RolesPostResponse201Normalizer', 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetsIdGetResponse200' => 'JoliCode\\Forecast\\Api\\Normalizer\\RepeatedAssignmentSetsIdGetResponse200Normalizer', 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetsIdPutResponse200' => 'JoliCode\\Forecast\\Api\\Normalizer\\RepeatedAssignmentSetsIdPutResponse200Normalizer', 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetsPostResponse201' => 'JoliCode\\Forecast\\Api\\Normalizer\\RepeatedAssignmentSetsPostResponse201Normalizer', '\\Jane\\Component\\JsonSchemaRuntime\\Reference' => '\\JoliCode\\Forecast\\Api\\Runtime\\Normalizer\\ReferenceNormalizer']; + protected $normalizersCache = []; - public function supportsNormalization($data, $format = null): 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); + } - /** - * @param mixed $object - * @param mixed|null $format - * - * @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($data::class, $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[$object::class]; + $normalizer = $this->getNormalizer($normalizerClass); - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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); + } + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\Account' => false, 'JoliCode\\Forecast\\Api\\Model\\AccountAccount' => false, 'JoliCode\\Forecast\\Api\\Model\\AccountAccountColorLabelsItem' => false, 'JoliCode\\Forecast\\Api\\Model\\Assignment' => false, 'JoliCode\\Forecast\\Api\\Model\\Assignments' => false, 'JoliCode\\Forecast\\Api\\Model\\Client' => false, 'JoliCode\\Forecast\\Api\\Model\\Clients' => false, 'JoliCode\\Forecast\\Api\\Model\\FutureScheduledHour' => false, 'JoliCode\\Forecast\\Api\\Model\\FutureScheduledHours' => false, 'JoliCode\\Forecast\\Api\\Model\\People' => false, 'JoliCode\\Forecast\\Api\\Model\\Person' => false, 'JoliCode\\Forecast\\Api\\Model\\PersonWorkingDays' => false, 'JoliCode\\Forecast\\Api\\Model\\Placeholder' => false, 'JoliCode\\Forecast\\Api\\Model\\PlaceholderBody' => false, 'JoliCode\\Forecast\\Api\\Model\\PlaceholderBodyPlaceholder' => false, 'JoliCode\\Forecast\\Api\\Model\\Placeholders' => false, 'JoliCode\\Forecast\\Api\\Model\\Project' => false, 'JoliCode\\Forecast\\Api\\Model\\Projects' => false, 'JoliCode\\Forecast\\Api\\Model\\RemainingBudgetedHour' => false, 'JoliCode\\Forecast\\Api\\Model\\RemainingBudgetedHours' => false, 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSet' => false, 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetBody' => false, 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetBodyRepeatedAssignmentSet' => false, 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSets' => false, 'JoliCode\\Forecast\\Api\\Model\\Role' => false, 'JoliCode\\Forecast\\Api\\Model\\RoleBody' => false, 'JoliCode\\Forecast\\Api\\Model\\RoleBodyRole' => false, 'JoliCode\\Forecast\\Api\\Model\\Roles' => false, 'JoliCode\\Forecast\\Api\\Model\\Subscription' => false, 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscription' => false, 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionDiscounts' => false, 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionCard' => false, 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionAddress' => false, 'JoliCode\\Forecast\\Api\\Model\\User' => false, 'JoliCode\\Forecast\\Api\\Model\\UserCurrentUser' => false, 'JoliCode\\Forecast\\Api\\Model\\UserConnection' => false, 'JoliCode\\Forecast\\Api\\Model\\UserConnections' => false, 'JoliCode\\Forecast\\Api\\Model\\Error' => false, 'JoliCode\\Forecast\\Api\\Model\\AssignmentsIdGetResponse200' => false, 'JoliCode\\Forecast\\Api\\Model\\AssignmentsIdPutBody' => false, 'JoliCode\\Forecast\\Api\\Model\\AssignmentsIdPutResponse200' => false, 'JoliCode\\Forecast\\Api\\Model\\AssignmentsPostBody' => false, 'JoliCode\\Forecast\\Api\\Model\\AssignmentsPostResponse201' => false, 'JoliCode\\Forecast\\Api\\Model\\ClientsIdGetResponse200' => false, 'JoliCode\\Forecast\\Api\\Model\\PeopleIdGetResponse200' => false, 'JoliCode\\Forecast\\Api\\Model\\PeopleIdPutBody' => false, 'JoliCode\\Forecast\\Api\\Model\\PeopleIdPutResponse200' => false, 'JoliCode\\Forecast\\Api\\Model\\PeoplePostBody' => false, 'JoliCode\\Forecast\\Api\\Model\\PeoplePostResponse201' => false, 'JoliCode\\Forecast\\Api\\Model\\PlaceholdersIdGetResponse200' => false, 'JoliCode\\Forecast\\Api\\Model\\PlaceholdersIdPutResponse200' => false, 'JoliCode\\Forecast\\Api\\Model\\PlaceholdersPostResponse201' => false, 'JoliCode\\Forecast\\Api\\Model\\ProjectsIdGetResponse200' => false, 'JoliCode\\Forecast\\Api\\Model\\RolesIdGetResponse200' => false, 'JoliCode\\Forecast\\Api\\Model\\RolesIdPutResponse200' => false, 'JoliCode\\Forecast\\Api\\Model\\RolesPostResponse201' => false, 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetsIdGetResponse200' => false, 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetsIdPutResponse200' => false, 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetsPostResponse201' => false, '\\Jane\\Component\\JsonSchemaRuntime\\Reference' => false]; + } + + private function getNormalizer(string $normalizerClass) + { + return $this->normalizersCache[$normalizerClass] ?? $this->initNormalizer($normalizerClass); + } - private function initNormalizer(string $normalizerClass) + private function initNormalizer(string $normalizerClass) + { + $normalizer = new $normalizerClass(); + $normalizer->setNormalizer($this->normalizer); + $normalizer->setDenormalizer($this->denormalizer); + $this->normalizersCache[$normalizerClass] = $normalizer; + + return $normalizer; + } + } +} else { + class JaneObjectNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $normalizer = new $normalizerClass(); - $normalizer->setNormalizer($this->normalizer); - $normalizer->setDenormalizer($this->denormalizer); - $this->normalizersCache[$normalizerClass] = $normalizer; + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; + protected $normalizers = ['JoliCode\\Forecast\\Api\\Model\\Account' => 'JoliCode\\Forecast\\Api\\Normalizer\\AccountNormalizer', 'JoliCode\\Forecast\\Api\\Model\\AccountAccount' => 'JoliCode\\Forecast\\Api\\Normalizer\\AccountAccountNormalizer', 'JoliCode\\Forecast\\Api\\Model\\AccountAccountColorLabelsItem' => 'JoliCode\\Forecast\\Api\\Normalizer\\AccountAccountColorLabelsItemNormalizer', 'JoliCode\\Forecast\\Api\\Model\\Assignment' => 'JoliCode\\Forecast\\Api\\Normalizer\\AssignmentNormalizer', 'JoliCode\\Forecast\\Api\\Model\\Assignments' => 'JoliCode\\Forecast\\Api\\Normalizer\\AssignmentsNormalizer', 'JoliCode\\Forecast\\Api\\Model\\Client' => 'JoliCode\\Forecast\\Api\\Normalizer\\ClientNormalizer', 'JoliCode\\Forecast\\Api\\Model\\Clients' => 'JoliCode\\Forecast\\Api\\Normalizer\\ClientsNormalizer', 'JoliCode\\Forecast\\Api\\Model\\FutureScheduledHour' => 'JoliCode\\Forecast\\Api\\Normalizer\\FutureScheduledHourNormalizer', 'JoliCode\\Forecast\\Api\\Model\\FutureScheduledHours' => 'JoliCode\\Forecast\\Api\\Normalizer\\FutureScheduledHoursNormalizer', 'JoliCode\\Forecast\\Api\\Model\\People' => 'JoliCode\\Forecast\\Api\\Normalizer\\PeopleNormalizer', 'JoliCode\\Forecast\\Api\\Model\\Person' => 'JoliCode\\Forecast\\Api\\Normalizer\\PersonNormalizer', 'JoliCode\\Forecast\\Api\\Model\\PersonWorkingDays' => 'JoliCode\\Forecast\\Api\\Normalizer\\PersonWorkingDaysNormalizer', 'JoliCode\\Forecast\\Api\\Model\\Placeholder' => 'JoliCode\\Forecast\\Api\\Normalizer\\PlaceholderNormalizer', 'JoliCode\\Forecast\\Api\\Model\\PlaceholderBody' => 'JoliCode\\Forecast\\Api\\Normalizer\\PlaceholderBodyNormalizer', 'JoliCode\\Forecast\\Api\\Model\\PlaceholderBodyPlaceholder' => 'JoliCode\\Forecast\\Api\\Normalizer\\PlaceholderBodyPlaceholderNormalizer', 'JoliCode\\Forecast\\Api\\Model\\Placeholders' => 'JoliCode\\Forecast\\Api\\Normalizer\\PlaceholdersNormalizer', 'JoliCode\\Forecast\\Api\\Model\\Project' => 'JoliCode\\Forecast\\Api\\Normalizer\\ProjectNormalizer', 'JoliCode\\Forecast\\Api\\Model\\Projects' => 'JoliCode\\Forecast\\Api\\Normalizer\\ProjectsNormalizer', 'JoliCode\\Forecast\\Api\\Model\\RemainingBudgetedHour' => 'JoliCode\\Forecast\\Api\\Normalizer\\RemainingBudgetedHourNormalizer', 'JoliCode\\Forecast\\Api\\Model\\RemainingBudgetedHours' => 'JoliCode\\Forecast\\Api\\Normalizer\\RemainingBudgetedHoursNormalizer', 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSet' => 'JoliCode\\Forecast\\Api\\Normalizer\\RepeatedAssignmentSetNormalizer', 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetBody' => 'JoliCode\\Forecast\\Api\\Normalizer\\RepeatedAssignmentSetBodyNormalizer', 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetBodyRepeatedAssignmentSet' => 'JoliCode\\Forecast\\Api\\Normalizer\\RepeatedAssignmentSetBodyRepeatedAssignmentSetNormalizer', 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSets' => 'JoliCode\\Forecast\\Api\\Normalizer\\RepeatedAssignmentSetsNormalizer', 'JoliCode\\Forecast\\Api\\Model\\Role' => 'JoliCode\\Forecast\\Api\\Normalizer\\RoleNormalizer', 'JoliCode\\Forecast\\Api\\Model\\RoleBody' => 'JoliCode\\Forecast\\Api\\Normalizer\\RoleBodyNormalizer', 'JoliCode\\Forecast\\Api\\Model\\RoleBodyRole' => 'JoliCode\\Forecast\\Api\\Normalizer\\RoleBodyRoleNormalizer', 'JoliCode\\Forecast\\Api\\Model\\Roles' => 'JoliCode\\Forecast\\Api\\Normalizer\\RolesNormalizer', 'JoliCode\\Forecast\\Api\\Model\\Subscription' => 'JoliCode\\Forecast\\Api\\Normalizer\\SubscriptionNormalizer', 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscription' => 'JoliCode\\Forecast\\Api\\Normalizer\\SubscriptionSubscriptionNormalizer', 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionDiscounts' => 'JoliCode\\Forecast\\Api\\Normalizer\\SubscriptionSubscriptionDiscountsNormalizer', 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionCard' => 'JoliCode\\Forecast\\Api\\Normalizer\\SubscriptionSubscriptionCardNormalizer', 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionAddress' => 'JoliCode\\Forecast\\Api\\Normalizer\\SubscriptionSubscriptionAddressNormalizer', 'JoliCode\\Forecast\\Api\\Model\\User' => 'JoliCode\\Forecast\\Api\\Normalizer\\UserNormalizer', 'JoliCode\\Forecast\\Api\\Model\\UserCurrentUser' => 'JoliCode\\Forecast\\Api\\Normalizer\\UserCurrentUserNormalizer', 'JoliCode\\Forecast\\Api\\Model\\UserConnection' => 'JoliCode\\Forecast\\Api\\Normalizer\\UserConnectionNormalizer', 'JoliCode\\Forecast\\Api\\Model\\UserConnections' => 'JoliCode\\Forecast\\Api\\Normalizer\\UserConnectionsNormalizer', 'JoliCode\\Forecast\\Api\\Model\\Error' => 'JoliCode\\Forecast\\Api\\Normalizer\\ErrorNormalizer', 'JoliCode\\Forecast\\Api\\Model\\AssignmentsIdGetResponse200' => 'JoliCode\\Forecast\\Api\\Normalizer\\AssignmentsIdGetResponse200Normalizer', 'JoliCode\\Forecast\\Api\\Model\\AssignmentsIdPutBody' => 'JoliCode\\Forecast\\Api\\Normalizer\\AssignmentsIdPutBodyNormalizer', 'JoliCode\\Forecast\\Api\\Model\\AssignmentsIdPutResponse200' => 'JoliCode\\Forecast\\Api\\Normalizer\\AssignmentsIdPutResponse200Normalizer', 'JoliCode\\Forecast\\Api\\Model\\AssignmentsPostBody' => 'JoliCode\\Forecast\\Api\\Normalizer\\AssignmentsPostBodyNormalizer', 'JoliCode\\Forecast\\Api\\Model\\AssignmentsPostResponse201' => 'JoliCode\\Forecast\\Api\\Normalizer\\AssignmentsPostResponse201Normalizer', 'JoliCode\\Forecast\\Api\\Model\\ClientsIdGetResponse200' => 'JoliCode\\Forecast\\Api\\Normalizer\\ClientsIdGetResponse200Normalizer', 'JoliCode\\Forecast\\Api\\Model\\PeopleIdGetResponse200' => 'JoliCode\\Forecast\\Api\\Normalizer\\PeopleIdGetResponse200Normalizer', 'JoliCode\\Forecast\\Api\\Model\\PeopleIdPutBody' => 'JoliCode\\Forecast\\Api\\Normalizer\\PeopleIdPutBodyNormalizer', 'JoliCode\\Forecast\\Api\\Model\\PeopleIdPutResponse200' => 'JoliCode\\Forecast\\Api\\Normalizer\\PeopleIdPutResponse200Normalizer', 'JoliCode\\Forecast\\Api\\Model\\PeoplePostBody' => 'JoliCode\\Forecast\\Api\\Normalizer\\PeoplePostBodyNormalizer', 'JoliCode\\Forecast\\Api\\Model\\PeoplePostResponse201' => 'JoliCode\\Forecast\\Api\\Normalizer\\PeoplePostResponse201Normalizer', 'JoliCode\\Forecast\\Api\\Model\\PlaceholdersIdGetResponse200' => 'JoliCode\\Forecast\\Api\\Normalizer\\PlaceholdersIdGetResponse200Normalizer', 'JoliCode\\Forecast\\Api\\Model\\PlaceholdersIdPutResponse200' => 'JoliCode\\Forecast\\Api\\Normalizer\\PlaceholdersIdPutResponse200Normalizer', 'JoliCode\\Forecast\\Api\\Model\\PlaceholdersPostResponse201' => 'JoliCode\\Forecast\\Api\\Normalizer\\PlaceholdersPostResponse201Normalizer', 'JoliCode\\Forecast\\Api\\Model\\ProjectsIdGetResponse200' => 'JoliCode\\Forecast\\Api\\Normalizer\\ProjectsIdGetResponse200Normalizer', 'JoliCode\\Forecast\\Api\\Model\\RolesIdGetResponse200' => 'JoliCode\\Forecast\\Api\\Normalizer\\RolesIdGetResponse200Normalizer', 'JoliCode\\Forecast\\Api\\Model\\RolesIdPutResponse200' => 'JoliCode\\Forecast\\Api\\Normalizer\\RolesIdPutResponse200Normalizer', 'JoliCode\\Forecast\\Api\\Model\\RolesPostResponse201' => 'JoliCode\\Forecast\\Api\\Normalizer\\RolesPostResponse201Normalizer', 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetsIdGetResponse200' => 'JoliCode\\Forecast\\Api\\Normalizer\\RepeatedAssignmentSetsIdGetResponse200Normalizer', 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetsIdPutResponse200' => 'JoliCode\\Forecast\\Api\\Normalizer\\RepeatedAssignmentSetsIdPutResponse200Normalizer', 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetsPostResponse201' => 'JoliCode\\Forecast\\Api\\Normalizer\\RepeatedAssignmentSetsPostResponse201Normalizer', '\\Jane\\Component\\JsonSchemaRuntime\\Reference' => '\\JoliCode\\Forecast\\Api\\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($data::class, $this->normalizers); + } + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $normalizerClass = $this->normalizers[$object::class]; + $normalizer = $this->getNormalizer($normalizerClass); + + return $normalizer->normalize($object, $format, $context); + } + + /** + * @param mixed|null $format + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + $denormalizerClass = $this->normalizers[$type]; + $denormalizer = $this->getNormalizer($denormalizerClass); + + return $denormalizer->denormalize($data, $type, $format, $context); + } + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\Account' => false, 'JoliCode\\Forecast\\Api\\Model\\AccountAccount' => false, 'JoliCode\\Forecast\\Api\\Model\\AccountAccountColorLabelsItem' => false, 'JoliCode\\Forecast\\Api\\Model\\Assignment' => false, 'JoliCode\\Forecast\\Api\\Model\\Assignments' => false, 'JoliCode\\Forecast\\Api\\Model\\Client' => false, 'JoliCode\\Forecast\\Api\\Model\\Clients' => false, 'JoliCode\\Forecast\\Api\\Model\\FutureScheduledHour' => false, 'JoliCode\\Forecast\\Api\\Model\\FutureScheduledHours' => false, 'JoliCode\\Forecast\\Api\\Model\\People' => false, 'JoliCode\\Forecast\\Api\\Model\\Person' => false, 'JoliCode\\Forecast\\Api\\Model\\PersonWorkingDays' => false, 'JoliCode\\Forecast\\Api\\Model\\Placeholder' => false, 'JoliCode\\Forecast\\Api\\Model\\PlaceholderBody' => false, 'JoliCode\\Forecast\\Api\\Model\\PlaceholderBodyPlaceholder' => false, 'JoliCode\\Forecast\\Api\\Model\\Placeholders' => false, 'JoliCode\\Forecast\\Api\\Model\\Project' => false, 'JoliCode\\Forecast\\Api\\Model\\Projects' => false, 'JoliCode\\Forecast\\Api\\Model\\RemainingBudgetedHour' => false, 'JoliCode\\Forecast\\Api\\Model\\RemainingBudgetedHours' => false, 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSet' => false, 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetBody' => false, 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetBodyRepeatedAssignmentSet' => false, 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSets' => false, 'JoliCode\\Forecast\\Api\\Model\\Role' => false, 'JoliCode\\Forecast\\Api\\Model\\RoleBody' => false, 'JoliCode\\Forecast\\Api\\Model\\RoleBodyRole' => false, 'JoliCode\\Forecast\\Api\\Model\\Roles' => false, 'JoliCode\\Forecast\\Api\\Model\\Subscription' => false, 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscription' => false, 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionDiscounts' => false, 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionCard' => false, 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionAddress' => false, 'JoliCode\\Forecast\\Api\\Model\\User' => false, 'JoliCode\\Forecast\\Api\\Model\\UserCurrentUser' => false, 'JoliCode\\Forecast\\Api\\Model\\UserConnection' => false, 'JoliCode\\Forecast\\Api\\Model\\UserConnections' => false, 'JoliCode\\Forecast\\Api\\Model\\Error' => false, 'JoliCode\\Forecast\\Api\\Model\\AssignmentsIdGetResponse200' => false, 'JoliCode\\Forecast\\Api\\Model\\AssignmentsIdPutBody' => false, 'JoliCode\\Forecast\\Api\\Model\\AssignmentsIdPutResponse200' => false, 'JoliCode\\Forecast\\Api\\Model\\AssignmentsPostBody' => false, 'JoliCode\\Forecast\\Api\\Model\\AssignmentsPostResponse201' => false, 'JoliCode\\Forecast\\Api\\Model\\ClientsIdGetResponse200' => false, 'JoliCode\\Forecast\\Api\\Model\\PeopleIdGetResponse200' => false, 'JoliCode\\Forecast\\Api\\Model\\PeopleIdPutBody' => false, 'JoliCode\\Forecast\\Api\\Model\\PeopleIdPutResponse200' => false, 'JoliCode\\Forecast\\Api\\Model\\PeoplePostBody' => false, 'JoliCode\\Forecast\\Api\\Model\\PeoplePostResponse201' => false, 'JoliCode\\Forecast\\Api\\Model\\PlaceholdersIdGetResponse200' => false, 'JoliCode\\Forecast\\Api\\Model\\PlaceholdersIdPutResponse200' => false, 'JoliCode\\Forecast\\Api\\Model\\PlaceholdersPostResponse201' => false, 'JoliCode\\Forecast\\Api\\Model\\ProjectsIdGetResponse200' => false, 'JoliCode\\Forecast\\Api\\Model\\RolesIdGetResponse200' => false, 'JoliCode\\Forecast\\Api\\Model\\RolesIdPutResponse200' => false, 'JoliCode\\Forecast\\Api\\Model\\RolesPostResponse201' => false, 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetsIdGetResponse200' => false, 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetsIdPutResponse200' => false, 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetsPostResponse201' => false, '\\Jane\\Component\\JsonSchemaRuntime\\Reference' => false]; + } + + 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; + return $normalizer; + } } } diff --git a/generated/Normalizer/PeopleIdGetResponse200Normalizer.php b/generated/Normalizer/PeopleIdGetResponse200Normalizer.php index 37b9ccc..daa7e3c 100644 --- a/generated/Normalizer/PeopleIdGetResponse200Normalizer.php +++ b/generated/Normalizer/PeopleIdGetResponse200Normalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,61 +22,138 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class PeopleIdGetResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class PeopleIdGetResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\PeopleIdGetResponse200' === $type; - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\PeopleIdGetResponse200' === \get_class($data); - } - - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\PeopleIdGetResponse200' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\PeopleIdGetResponse200' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\PeopleIdGetResponse200(); - 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 \JoliCode\Forecast\Api\Model\PeopleIdGetResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('person', $data) && null !== $data['person']) { + $object->setPerson($this->denormalizer->denormalize($data['person'], 'JoliCode\\Forecast\\Api\\Model\\Person', 'json', $context)); + unset($data['person']); + } elseif (\array_key_exists('person', $data) && null === $data['person']) { + $object->setPerson(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('person', $data) && null !== $data['person']) { - $object->setPerson($this->denormalizer->denormalize($data['person'], 'JoliCode\\Forecast\\Api\\Model\\Person', 'json', $context)); - } elseif (\array_key_exists('person', $data) && null === $data['person']) { - $object->setPerson(null); + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['person'] = $this->normalizer->normalize($object->getPerson(), '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 ['JoliCode\\Forecast\\Api\\Model\\PeopleIdGetResponse200' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class PeopleIdGetResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - $data['person'] = $this->normalizer->normalize($object->getPerson(), 'json', $context); + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - return $data; + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\PeopleIdGetResponse200' === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\PeopleIdGetResponse200' === $data::class; + } + + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\PeopleIdGetResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('person', $data) && null !== $data['person']) { + $object->setPerson($this->denormalizer->denormalize($data['person'], 'JoliCode\\Forecast\\Api\\Model\\Person', 'json', $context)); + unset($data['person']); + } elseif (\array_key_exists('person', $data) && null === $data['person']) { + $object->setPerson(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['person'] = $this->normalizer->normalize($object->getPerson(), 'json', $context); + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\PeopleIdGetResponse200' => false]; + } } } diff --git a/generated/Normalizer/PeopleIdPutBodyNormalizer.php b/generated/Normalizer/PeopleIdPutBodyNormalizer.php index 83be911..abcf29d 100644 --- a/generated/Normalizer/PeopleIdPutBodyNormalizer.php +++ b/generated/Normalizer/PeopleIdPutBodyNormalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,61 +22,138 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class PeopleIdPutBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class PeopleIdPutBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\PeopleIdPutBody' === $type; - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\PeopleIdPutBody' === \get_class($data); - } - - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\PeopleIdPutBody' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\PeopleIdPutBody' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\PeopleIdPutBody(); - 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 \JoliCode\Forecast\Api\Model\PeopleIdPutBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('person', $data) && null !== $data['person']) { + $object->setPerson($this->denormalizer->denormalize($data['person'], 'JoliCode\\Forecast\\Api\\Model\\Person', 'json', $context)); + unset($data['person']); + } elseif (\array_key_exists('person', $data) && null === $data['person']) { + $object->setPerson(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('person', $data) && null !== $data['person']) { - $object->setPerson($this->denormalizer->denormalize($data['person'], 'JoliCode\\Forecast\\Api\\Model\\Person', 'json', $context)); - } elseif (\array_key_exists('person', $data) && null === $data['person']) { - $object->setPerson(null); + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['person'] = $this->normalizer->normalize($object->getPerson(), '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 ['JoliCode\\Forecast\\Api\\Model\\PeopleIdPutBody' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class PeopleIdPutBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - $data['person'] = $this->normalizer->normalize($object->getPerson(), 'json', $context); + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - return $data; + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\PeopleIdPutBody' === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\PeopleIdPutBody' === $data::class; + } + + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\PeopleIdPutBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('person', $data) && null !== $data['person']) { + $object->setPerson($this->denormalizer->denormalize($data['person'], 'JoliCode\\Forecast\\Api\\Model\\Person', 'json', $context)); + unset($data['person']); + } elseif (\array_key_exists('person', $data) && null === $data['person']) { + $object->setPerson(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['person'] = $this->normalizer->normalize($object->getPerson(), 'json', $context); + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\PeopleIdPutBody' => false]; + } } } diff --git a/generated/Normalizer/PeopleIdPutResponse200Normalizer.php b/generated/Normalizer/PeopleIdPutResponse200Normalizer.php index 806b094..f8b98f5 100644 --- a/generated/Normalizer/PeopleIdPutResponse200Normalizer.php +++ b/generated/Normalizer/PeopleIdPutResponse200Normalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,61 +22,138 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class PeopleIdPutResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class PeopleIdPutResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\PeopleIdPutResponse200' === $type; - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\PeopleIdPutResponse200' === \get_class($data); - } - - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\PeopleIdPutResponse200' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\PeopleIdPutResponse200' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\PeopleIdPutResponse200(); - 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 \JoliCode\Forecast\Api\Model\PeopleIdPutResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('person', $data) && null !== $data['person']) { + $object->setPerson($this->denormalizer->denormalize($data['person'], 'JoliCode\\Forecast\\Api\\Model\\Person', 'json', $context)); + unset($data['person']); + } elseif (\array_key_exists('person', $data) && null === $data['person']) { + $object->setPerson(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('person', $data) && null !== $data['person']) { - $object->setPerson($this->denormalizer->denormalize($data['person'], 'JoliCode\\Forecast\\Api\\Model\\Person', 'json', $context)); - } elseif (\array_key_exists('person', $data) && null === $data['person']) { - $object->setPerson(null); + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['person'] = $this->normalizer->normalize($object->getPerson(), '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 ['JoliCode\\Forecast\\Api\\Model\\PeopleIdPutResponse200' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class PeopleIdPutResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - $data['person'] = $this->normalizer->normalize($object->getPerson(), 'json', $context); + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - return $data; + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\PeopleIdPutResponse200' === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\PeopleIdPutResponse200' === $data::class; + } + + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\PeopleIdPutResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('person', $data) && null !== $data['person']) { + $object->setPerson($this->denormalizer->denormalize($data['person'], 'JoliCode\\Forecast\\Api\\Model\\Person', 'json', $context)); + unset($data['person']); + } elseif (\array_key_exists('person', $data) && null === $data['person']) { + $object->setPerson(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['person'] = $this->normalizer->normalize($object->getPerson(), 'json', $context); + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\PeopleIdPutResponse200' => false]; + } } } diff --git a/generated/Normalizer/PeopleNormalizer.php b/generated/Normalizer/PeopleNormalizer.php index e08a366..3d0ff4d 100644 --- a/generated/Normalizer/PeopleNormalizer.php +++ b/generated/Normalizer/PeopleNormalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,69 +22,154 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class PeopleNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class PeopleNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\People' === $type; - } - - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\People' === \get_class($data); - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\People' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\People' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\People(); - 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 \JoliCode\Forecast\Api\Model\People(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('people', $data) && null !== $data['people']) { + $values = []; + foreach ($data['people'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Forecast\\Api\\Model\\Person', 'json', $context); + } + $object->setPeople($values); + unset($data['people']); + } elseif (\array_key_exists('people', $data) && null === $data['people']) { + $object->setPeople(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('people', $data) && null !== $data['people']) { + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; $values = []; - foreach ($data['people'] as $value) { - $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Forecast\\Api\\Model\\Person', 'json', $context); + foreach ($object->getPeople() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); } - $object->setPeople($values); - } elseif (\array_key_exists('people', $data) && null === $data['people']) { - $object->setPeople(null); + $data['people'] = $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 ['JoliCode\\Forecast\\Api\\Model\\People' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class PeopleNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - $values = []; - foreach ($object->getPeople() as $value) { - $values[] = $this->normalizer->normalize($value, 'json', $context); + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\People' === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\People' === $data::class; } - $data['people'] = $values; - return $data; + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\People(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('people', $data) && null !== $data['people']) { + $values = []; + foreach ($data['people'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Forecast\\Api\\Model\\Person', 'json', $context); + } + $object->setPeople($values); + unset($data['people']); + } elseif (\array_key_exists('people', $data) && null === $data['people']) { + $object->setPeople(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + + return $object; + } + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $values = []; + foreach ($object->getPeople() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['people'] = $values; + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\People' => false]; + } } } diff --git a/generated/Normalizer/PeoplePostBodyNormalizer.php b/generated/Normalizer/PeoplePostBodyNormalizer.php index 8ed8d9c..20fb015 100644 --- a/generated/Normalizer/PeoplePostBodyNormalizer.php +++ b/generated/Normalizer/PeoplePostBodyNormalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,61 +22,138 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class PeoplePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class PeoplePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\PeoplePostBody' === $type; - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\PeoplePostBody' === \get_class($data); - } - - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\PeoplePostBody' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\PeoplePostBody' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\PeoplePostBody(); - 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 \JoliCode\Forecast\Api\Model\PeoplePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('person', $data) && null !== $data['person']) { + $object->setPerson($this->denormalizer->denormalize($data['person'], 'JoliCode\\Forecast\\Api\\Model\\Person', 'json', $context)); + unset($data['person']); + } elseif (\array_key_exists('person', $data) && null === $data['person']) { + $object->setPerson(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('person', $data) && null !== $data['person']) { - $object->setPerson($this->denormalizer->denormalize($data['person'], 'JoliCode\\Forecast\\Api\\Model\\Person', 'json', $context)); - } elseif (\array_key_exists('person', $data) && null === $data['person']) { - $object->setPerson(null); + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['person'] = $this->normalizer->normalize($object->getPerson(), '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 ['JoliCode\\Forecast\\Api\\Model\\PeoplePostBody' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class PeoplePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - $data['person'] = $this->normalizer->normalize($object->getPerson(), 'json', $context); + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - return $data; + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\PeoplePostBody' === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\PeoplePostBody' === $data::class; + } + + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\PeoplePostBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('person', $data) && null !== $data['person']) { + $object->setPerson($this->denormalizer->denormalize($data['person'], 'JoliCode\\Forecast\\Api\\Model\\Person', 'json', $context)); + unset($data['person']); + } elseif (\array_key_exists('person', $data) && null === $data['person']) { + $object->setPerson(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['person'] = $this->normalizer->normalize($object->getPerson(), 'json', $context); + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\PeoplePostBody' => false]; + } } } diff --git a/generated/Normalizer/PeoplePostResponse201Normalizer.php b/generated/Normalizer/PeoplePostResponse201Normalizer.php index e750ddc..6d1817b 100644 --- a/generated/Normalizer/PeoplePostResponse201Normalizer.php +++ b/generated/Normalizer/PeoplePostResponse201Normalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,61 +22,138 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class PeoplePostResponse201Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class PeoplePostResponse201Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\PeoplePostResponse201' === $type; - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\PeoplePostResponse201' === \get_class($data); - } - - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\PeoplePostResponse201' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\PeoplePostResponse201' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\PeoplePostResponse201(); - 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 \JoliCode\Forecast\Api\Model\PeoplePostResponse201(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('person', $data) && null !== $data['person']) { + $object->setPerson($this->denormalizer->denormalize($data['person'], 'JoliCode\\Forecast\\Api\\Model\\Person', 'json', $context)); + unset($data['person']); + } elseif (\array_key_exists('person', $data) && null === $data['person']) { + $object->setPerson(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('person', $data) && null !== $data['person']) { - $object->setPerson($this->denormalizer->denormalize($data['person'], 'JoliCode\\Forecast\\Api\\Model\\Person', 'json', $context)); - } elseif (\array_key_exists('person', $data) && null === $data['person']) { - $object->setPerson(null); + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['person'] = $this->normalizer->normalize($object->getPerson(), '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 ['JoliCode\\Forecast\\Api\\Model\\PeoplePostResponse201' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class PeoplePostResponse201Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - $data['person'] = $this->normalizer->normalize($object->getPerson(), 'json', $context); + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - return $data; + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\PeoplePostResponse201' === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\PeoplePostResponse201' === $data::class; + } + + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\PeoplePostResponse201(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('person', $data) && null !== $data['person']) { + $object->setPerson($this->denormalizer->denormalize($data['person'], 'JoliCode\\Forecast\\Api\\Model\\Person', 'json', $context)); + unset($data['person']); + } elseif (\array_key_exists('person', $data) && null === $data['person']) { + $object->setPerson(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['person'] = $this->normalizer->normalize($object->getPerson(), 'json', $context); + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\PeoplePostResponse201' => false]; + } } } diff --git a/generated/Normalizer/PersonNormalizer.php b/generated/Normalizer/PersonNormalizer.php index 3ff3d59..bbd1c99 100644 --- a/generated/Normalizer/PersonNormalizer.php +++ b/generated/Normalizer/PersonNormalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,193 +22,434 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class PersonNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool - { - return 'JoliCode\\Forecast\\Api\\Model\\Person' === $type; - } - - public function supportsNormalization($data, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class PersonNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\Person' === \get_class($data); - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\Person' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\Person' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\Person(); - 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 \JoliCode\Forecast\Api\Model\Person(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('id', $data) && null !== $data['id']) { + $object->setId($data['id']); + unset($data['id']); + } elseif (\array_key_exists('id', $data) && null === $data['id']) { + $object->setId(null); + } + if (\array_key_exists('first_name', $data) && null !== $data['first_name']) { + $object->setFirstName($data['first_name']); + unset($data['first_name']); + } elseif (\array_key_exists('first_name', $data) && null === $data['first_name']) { + $object->setFirstName(null); + } + if (\array_key_exists('last_name', $data) && null !== $data['last_name']) { + $object->setLastName($data['last_name']); + unset($data['last_name']); + } elseif (\array_key_exists('last_name', $data) && null === $data['last_name']) { + $object->setLastName(null); + } + if (\array_key_exists('email', $data) && null !== $data['email']) { + $object->setEmail($data['email']); + unset($data['email']); + } elseif (\array_key_exists('email', $data) && null === $data['email']) { + $object->setEmail(null); + } + if (\array_key_exists('login', $data) && null !== $data['login']) { + $object->setLogin($data['login']); + unset($data['login']); + } elseif (\array_key_exists('login', $data) && null === $data['login']) { + $object->setLogin(null); + } + if (\array_key_exists('admin', $data) && null !== $data['admin']) { + $object->setAdmin($data['admin']); + unset($data['admin']); + } elseif (\array_key_exists('admin', $data) && null === $data['admin']) { + $object->setAdmin(null); + } + if (\array_key_exists('archived', $data) && null !== $data['archived']) { + $object->setArchived($data['archived']); + unset($data['archived']); + } elseif (\array_key_exists('archived', $data) && null === $data['archived']) { + $object->setArchived(null); + } + if (\array_key_exists('subscribed', $data) && null !== $data['subscribed']) { + $object->setSubscribed($data['subscribed']); + unset($data['subscribed']); + } elseif (\array_key_exists('subscribed', $data) && null === $data['subscribed']) { + $object->setSubscribed(null); + } + if (\array_key_exists('avatar_url', $data) && null !== $data['avatar_url']) { + $object->setAvatarUrl($data['avatar_url']); + unset($data['avatar_url']); + } elseif (\array_key_exists('avatar_url', $data) && null === $data['avatar_url']) { + $object->setAvatarUrl(null); + } + if (\array_key_exists('roles', $data) && null !== $data['roles']) { + $values = []; + foreach ($data['roles'] as $value) { + $values[] = $value; + } + $object->setRoles($values); + unset($data['roles']); + } elseif (\array_key_exists('roles', $data) && null === $data['roles']) { + $object->setRoles(null); + } + if (\array_key_exists('updated_at', $data) && null !== $data['updated_at']) { + $object->setUpdatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s.v\\Z', $data['updated_at'])); + unset($data['updated_at']); + } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { + $object->setUpdatedAt(null); + } + if (\array_key_exists('updated_by_id', $data) && null !== $data['updated_by_id']) { + $object->setUpdatedById($data['updated_by_id']); + unset($data['updated_by_id']); + } elseif (\array_key_exists('updated_by_id', $data) && null === $data['updated_by_id']) { + $object->setUpdatedById(null); + } + if (\array_key_exists('harvest_user_id', $data) && null !== $data['harvest_user_id']) { + $object->setHarvestUserId($data['harvest_user_id']); + unset($data['harvest_user_id']); + } elseif (\array_key_exists('harvest_user_id', $data) && null === $data['harvest_user_id']) { + $object->setHarvestUserId(null); + } + if (\array_key_exists('weekly_capacity', $data) && null !== $data['weekly_capacity']) { + $object->setWeeklyCapacity($data['weekly_capacity']); + unset($data['weekly_capacity']); + } elseif (\array_key_exists('weekly_capacity', $data) && null === $data['weekly_capacity']) { + $object->setWeeklyCapacity(null); + } + if (\array_key_exists('working_days', $data) && null !== $data['working_days']) { + $object->setWorkingDays($this->denormalizer->denormalize($data['working_days'], 'JoliCode\\Forecast\\Api\\Model\\PersonWorkingDays', 'json', $context)); + unset($data['working_days']); + } elseif (\array_key_exists('working_days', $data) && null === $data['working_days']) { + $object->setWorkingDays(null); + } + if (\array_key_exists('color_blind', $data) && null !== $data['color_blind']) { + $object->setColorBlind($data['color_blind']); + unset($data['color_blind']); + } elseif (\array_key_exists('color_blind', $data) && null === $data['color_blind']) { + $object->setColorBlind(null); + } + if (\array_key_exists('personal_feed_token_id', $data) && null !== $data['personal_feed_token_id']) { + $object->setPersonalFeedTokenId($data['personal_feed_token_id']); + unset($data['personal_feed_token_id']); + } elseif (\array_key_exists('personal_feed_token_id', $data) && null === $data['personal_feed_token_id']) { + $object->setPersonalFeedTokenId(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('id', $data) && null !== $data['id']) { - $object->setId($data['id']); - } elseif (\array_key_exists('id', $data) && null === $data['id']) { - $object->setId(null); - } - if (\array_key_exists('first_name', $data) && null !== $data['first_name']) { - $object->setFirstName($data['first_name']); - } elseif (\array_key_exists('first_name', $data) && null === $data['first_name']) { - $object->setFirstName(null); - } - if (\array_key_exists('last_name', $data) && null !== $data['last_name']) { - $object->setLastName($data['last_name']); - } elseif (\array_key_exists('last_name', $data) && null === $data['last_name']) { - $object->setLastName(null); - } - if (\array_key_exists('email', $data) && null !== $data['email']) { - $object->setEmail($data['email']); - } elseif (\array_key_exists('email', $data) && null === $data['email']) { - $object->setEmail(null); - } - if (\array_key_exists('login', $data) && null !== $data['login']) { - $object->setLogin($data['login']); - } elseif (\array_key_exists('login', $data) && null === $data['login']) { - $object->setLogin(null); - } - if (\array_key_exists('admin', $data) && null !== $data['admin']) { - $object->setAdmin($data['admin']); - } elseif (\array_key_exists('admin', $data) && null === $data['admin']) { - $object->setAdmin(null); - } - if (\array_key_exists('archived', $data) && null !== $data['archived']) { - $object->setArchived($data['archived']); - } elseif (\array_key_exists('archived', $data) && null === $data['archived']) { - $object->setArchived(null); - } - if (\array_key_exists('subscribed', $data) && null !== $data['subscribed']) { - $object->setSubscribed($data['subscribed']); - } elseif (\array_key_exists('subscribed', $data) && null === $data['subscribed']) { - $object->setSubscribed(null); - } - if (\array_key_exists('avatar_url', $data) && null !== $data['avatar_url']) { - $object->setAvatarUrl($data['avatar_url']); - } elseif (\array_key_exists('avatar_url', $data) && null === $data['avatar_url']) { - $object->setAvatarUrl(null); - } - if (\array_key_exists('roles', $data) && null !== $data['roles']) { - $values = []; - foreach ($data['roles'] as $value) { - $values[] = $value; - } - $object->setRoles($values); - } elseif (\array_key_exists('roles', $data) && null === $data['roles']) { - $object->setRoles(null); - } - if (\array_key_exists('updated_at', $data) && null !== $data['updated_at']) { - $object->setUpdatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s.v\\Z', $data['updated_at'])); - } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { - $object->setUpdatedAt(null); - } - if (\array_key_exists('updated_by_id', $data) && null !== $data['updated_by_id']) { - $object->setUpdatedById($data['updated_by_id']); - } elseif (\array_key_exists('updated_by_id', $data) && null === $data['updated_by_id']) { - $object->setUpdatedById(null); - } - if (\array_key_exists('harvest_user_id', $data) && null !== $data['harvest_user_id']) { - $object->setHarvestUserId($data['harvest_user_id']); - } elseif (\array_key_exists('harvest_user_id', $data) && null === $data['harvest_user_id']) { - $object->setHarvestUserId(null); - } - if (\array_key_exists('weekly_capacity', $data) && null !== $data['weekly_capacity']) { - $object->setWeeklyCapacity($data['weekly_capacity']); - } elseif (\array_key_exists('weekly_capacity', $data) && null === $data['weekly_capacity']) { - $object->setWeeklyCapacity(null); - } - if (\array_key_exists('working_days', $data) && null !== $data['working_days']) { - $object->setWorkingDays($this->denormalizer->denormalize($data['working_days'], 'JoliCode\\Forecast\\Api\\Model\\PersonWorkingDays', 'json', $context)); - } elseif (\array_key_exists('working_days', $data) && null === $data['working_days']) { - $object->setWorkingDays(null); - } - if (\array_key_exists('color_blind', $data) && null !== $data['color_blind']) { - $object->setColorBlind($data['color_blind']); - } elseif (\array_key_exists('color_blind', $data) && null === $data['color_blind']) { - $object->setColorBlind(null); - } - if (\array_key_exists('personal_feed_token_id', $data) && null !== $data['personal_feed_token_id']) { - $object->setPersonalFeedTokenId($data['personal_feed_token_id']); - } elseif (\array_key_exists('personal_feed_token_id', $data) && null === $data['personal_feed_token_id']) { - $object->setPersonalFeedTokenId(null); - } - return $object; - } + 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(); + } + $data['first_name'] = $object->getFirstName(); + $data['last_name'] = $object->getLastName(); + $data['email'] = $object->getEmail(); + if ($object->isInitialized('login') && null !== $object->getLogin()) { + $data['login'] = $object->getLogin(); + } + if ($object->isInitialized('admin') && null !== $object->getAdmin()) { + $data['admin'] = $object->getAdmin(); + } + if ($object->isInitialized('archived') && null !== $object->getArchived()) { + $data['archived'] = $object->getArchived(); + } + if ($object->isInitialized('subscribed') && null !== $object->getSubscribed()) { + $data['subscribed'] = $object->getSubscribed(); + } + if ($object->isInitialized('avatarUrl') && null !== $object->getAvatarUrl()) { + $data['avatar_url'] = $object->getAvatarUrl(); + } + if ($object->isInitialized('roles') && null !== $object->getRoles()) { + $values = []; + foreach ($object->getRoles() as $value) { + $values[] = $value; + } + $data['roles'] = $values; + } + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { + $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s.v\\Z'); + } + if ($object->isInitialized('updatedById') && null !== $object->getUpdatedById()) { + $data['updated_by_id'] = $object->getUpdatedById(); + } + if ($object->isInitialized('harvestUserId') && null !== $object->getHarvestUserId()) { + $data['harvest_user_id'] = $object->getHarvestUserId(); + } + if ($object->isInitialized('weeklyCapacity') && null !== $object->getWeeklyCapacity()) { + $data['weekly_capacity'] = $object->getWeeklyCapacity(); + } + if ($object->isInitialized('workingDays') && null !== $object->getWorkingDays()) { + $data['working_days'] = $this->normalizer->normalize($object->getWorkingDays(), 'json', $context); + } + if ($object->isInitialized('colorBlind') && null !== $object->getColorBlind()) { + $data['color_blind'] = $object->getColorBlind(); + } + if ($object->isInitialized('personalFeedTokenId') && null !== $object->getPersonalFeedTokenId()) { + $data['personal_feed_token_id'] = $object->getPersonalFeedTokenId(); + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) - { - $data = []; - if (null !== $object->getId()) { - $data['id'] = $object->getId(); - } - $data['first_name'] = $object->getFirstName(); - $data['last_name'] = $object->getLastName(); - $data['email'] = $object->getEmail(); - if (null !== $object->getLogin()) { - $data['login'] = $object->getLogin(); + return $data; } - if (null !== $object->getAdmin()) { - $data['admin'] = $object->getAdmin(); - } - if (null !== $object->getArchived()) { - $data['archived'] = $object->getArchived(); + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\Person' => false]; } - if (null !== $object->getSubscribed()) { - $data['subscribed'] = $object->getSubscribed(); + } +} else { + class PersonNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\Person' === $type; } - if (null !== $object->getAvatarUrl()) { - $data['avatar_url'] = $object->getAvatarUrl(); + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\Person' === $data::class; } - if (null !== $object->getRoles()) { - $values = []; - foreach ($object->getRoles() as $value) { - $values[] = $value; + + /** + * @param mixed|null $format + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - $data['roles'] = $values; - } - if (null !== $object->getUpdatedAt()) { - $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s.v\\Z'); - } - if (null !== $object->getUpdatedById()) { - $data['updated_by_id'] = $object->getUpdatedById(); - } - if (null !== $object->getHarvestUserId()) { - $data['harvest_user_id'] = $object->getHarvestUserId(); - } - if (null !== $object->getWeeklyCapacity()) { - $data['weekly_capacity'] = $object->getWeeklyCapacity(); - } - if (null !== $object->getWorkingDays()) { - $data['working_days'] = $this->normalizer->normalize($object->getWorkingDays(), 'json', $context); - } - if (null !== $object->getColorBlind()) { - $data['color_blind'] = $object->getColorBlind(); + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \JoliCode\Forecast\Api\Model\Person(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('id', $data) && null !== $data['id']) { + $object->setId($data['id']); + unset($data['id']); + } elseif (\array_key_exists('id', $data) && null === $data['id']) { + $object->setId(null); + } + if (\array_key_exists('first_name', $data) && null !== $data['first_name']) { + $object->setFirstName($data['first_name']); + unset($data['first_name']); + } elseif (\array_key_exists('first_name', $data) && null === $data['first_name']) { + $object->setFirstName(null); + } + if (\array_key_exists('last_name', $data) && null !== $data['last_name']) { + $object->setLastName($data['last_name']); + unset($data['last_name']); + } elseif (\array_key_exists('last_name', $data) && null === $data['last_name']) { + $object->setLastName(null); + } + if (\array_key_exists('email', $data) && null !== $data['email']) { + $object->setEmail($data['email']); + unset($data['email']); + } elseif (\array_key_exists('email', $data) && null === $data['email']) { + $object->setEmail(null); + } + if (\array_key_exists('login', $data) && null !== $data['login']) { + $object->setLogin($data['login']); + unset($data['login']); + } elseif (\array_key_exists('login', $data) && null === $data['login']) { + $object->setLogin(null); + } + if (\array_key_exists('admin', $data) && null !== $data['admin']) { + $object->setAdmin($data['admin']); + unset($data['admin']); + } elseif (\array_key_exists('admin', $data) && null === $data['admin']) { + $object->setAdmin(null); + } + if (\array_key_exists('archived', $data) && null !== $data['archived']) { + $object->setArchived($data['archived']); + unset($data['archived']); + } elseif (\array_key_exists('archived', $data) && null === $data['archived']) { + $object->setArchived(null); + } + if (\array_key_exists('subscribed', $data) && null !== $data['subscribed']) { + $object->setSubscribed($data['subscribed']); + unset($data['subscribed']); + } elseif (\array_key_exists('subscribed', $data) && null === $data['subscribed']) { + $object->setSubscribed(null); + } + if (\array_key_exists('avatar_url', $data) && null !== $data['avatar_url']) { + $object->setAvatarUrl($data['avatar_url']); + unset($data['avatar_url']); + } elseif (\array_key_exists('avatar_url', $data) && null === $data['avatar_url']) { + $object->setAvatarUrl(null); + } + if (\array_key_exists('roles', $data) && null !== $data['roles']) { + $values = []; + foreach ($data['roles'] as $value) { + $values[] = $value; + } + $object->setRoles($values); + unset($data['roles']); + } elseif (\array_key_exists('roles', $data) && null === $data['roles']) { + $object->setRoles(null); + } + if (\array_key_exists('updated_at', $data) && null !== $data['updated_at']) { + $object->setUpdatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s.v\\Z', $data['updated_at'])); + unset($data['updated_at']); + } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { + $object->setUpdatedAt(null); + } + if (\array_key_exists('updated_by_id', $data) && null !== $data['updated_by_id']) { + $object->setUpdatedById($data['updated_by_id']); + unset($data['updated_by_id']); + } elseif (\array_key_exists('updated_by_id', $data) && null === $data['updated_by_id']) { + $object->setUpdatedById(null); + } + if (\array_key_exists('harvest_user_id', $data) && null !== $data['harvest_user_id']) { + $object->setHarvestUserId($data['harvest_user_id']); + unset($data['harvest_user_id']); + } elseif (\array_key_exists('harvest_user_id', $data) && null === $data['harvest_user_id']) { + $object->setHarvestUserId(null); + } + if (\array_key_exists('weekly_capacity', $data) && null !== $data['weekly_capacity']) { + $object->setWeeklyCapacity($data['weekly_capacity']); + unset($data['weekly_capacity']); + } elseif (\array_key_exists('weekly_capacity', $data) && null === $data['weekly_capacity']) { + $object->setWeeklyCapacity(null); + } + if (\array_key_exists('working_days', $data) && null !== $data['working_days']) { + $object->setWorkingDays($this->denormalizer->denormalize($data['working_days'], 'JoliCode\\Forecast\\Api\\Model\\PersonWorkingDays', 'json', $context)); + unset($data['working_days']); + } elseif (\array_key_exists('working_days', $data) && null === $data['working_days']) { + $object->setWorkingDays(null); + } + if (\array_key_exists('color_blind', $data) && null !== $data['color_blind']) { + $object->setColorBlind($data['color_blind']); + unset($data['color_blind']); + } elseif (\array_key_exists('color_blind', $data) && null === $data['color_blind']) { + $object->setColorBlind(null); + } + if (\array_key_exists('personal_feed_token_id', $data) && null !== $data['personal_feed_token_id']) { + $object->setPersonalFeedTokenId($data['personal_feed_token_id']); + unset($data['personal_feed_token_id']); + } elseif (\array_key_exists('personal_feed_token_id', $data) && null === $data['personal_feed_token_id']) { + $object->setPersonalFeedTokenId(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + + return $object; } - if (null !== $object->getPersonalFeedTokenId()) { - $data['personal_feed_token_id'] = $object->getPersonalFeedTokenId(); + + /** + * @param mixed|null $format + * + * @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(); + } + $data['first_name'] = $object->getFirstName(); + $data['last_name'] = $object->getLastName(); + $data['email'] = $object->getEmail(); + if ($object->isInitialized('login') && null !== $object->getLogin()) { + $data['login'] = $object->getLogin(); + } + if ($object->isInitialized('admin') && null !== $object->getAdmin()) { + $data['admin'] = $object->getAdmin(); + } + if ($object->isInitialized('archived') && null !== $object->getArchived()) { + $data['archived'] = $object->getArchived(); + } + if ($object->isInitialized('subscribed') && null !== $object->getSubscribed()) { + $data['subscribed'] = $object->getSubscribed(); + } + if ($object->isInitialized('avatarUrl') && null !== $object->getAvatarUrl()) { + $data['avatar_url'] = $object->getAvatarUrl(); + } + if ($object->isInitialized('roles') && null !== $object->getRoles()) { + $values = []; + foreach ($object->getRoles() as $value) { + $values[] = $value; + } + $data['roles'] = $values; + } + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { + $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s.v\\Z'); + } + if ($object->isInitialized('updatedById') && null !== $object->getUpdatedById()) { + $data['updated_by_id'] = $object->getUpdatedById(); + } + if ($object->isInitialized('harvestUserId') && null !== $object->getHarvestUserId()) { + $data['harvest_user_id'] = $object->getHarvestUserId(); + } + if ($object->isInitialized('weeklyCapacity') && null !== $object->getWeeklyCapacity()) { + $data['weekly_capacity'] = $object->getWeeklyCapacity(); + } + if ($object->isInitialized('workingDays') && null !== $object->getWorkingDays()) { + $data['working_days'] = $this->normalizer->normalize($object->getWorkingDays(), 'json', $context); + } + if ($object->isInitialized('colorBlind') && null !== $object->getColorBlind()) { + $data['color_blind'] = $object->getColorBlind(); + } + if ($object->isInitialized('personalFeedTokenId') && null !== $object->getPersonalFeedTokenId()) { + $data['personal_feed_token_id'] = $object->getPersonalFeedTokenId(); + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } + + return $data; } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\Person' => false]; + } } } diff --git a/generated/Normalizer/PersonWorkingDaysNormalizer.php b/generated/Normalizer/PersonWorkingDaysNormalizer.php index e5d52df..532dde1 100644 --- a/generated/Normalizer/PersonWorkingDaysNormalizer.php +++ b/generated/Normalizer/PersonWorkingDaysNormalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,111 +22,250 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class PersonWorkingDaysNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool - { - return 'JoliCode\\Forecast\\Api\\Model\\PersonWorkingDays' === $type; - } - - public function supportsNormalization($data, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class PersonWorkingDaysNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\PersonWorkingDays' === \get_class($data); - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\PersonWorkingDays' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\PersonWorkingDays' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\PersonWorkingDays(); - 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 \JoliCode\Forecast\Api\Model\PersonWorkingDays(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('monday', $data) && null !== $data['monday']) { + $object->setMonday($data['monday']); + unset($data['monday']); + } elseif (\array_key_exists('monday', $data) && null === $data['monday']) { + $object->setMonday(null); + } + if (\array_key_exists('tuesday', $data) && null !== $data['tuesday']) { + $object->setTuesday($data['tuesday']); + unset($data['tuesday']); + } elseif (\array_key_exists('tuesday', $data) && null === $data['tuesday']) { + $object->setTuesday(null); + } + if (\array_key_exists('wednesday', $data) && null !== $data['wednesday']) { + $object->setWednesday($data['wednesday']); + unset($data['wednesday']); + } elseif (\array_key_exists('wednesday', $data) && null === $data['wednesday']) { + $object->setWednesday(null); + } + if (\array_key_exists('thursday', $data) && null !== $data['thursday']) { + $object->setThursday($data['thursday']); + unset($data['thursday']); + } elseif (\array_key_exists('thursday', $data) && null === $data['thursday']) { + $object->setThursday(null); + } + if (\array_key_exists('friday', $data) && null !== $data['friday']) { + $object->setFriday($data['friday']); + unset($data['friday']); + } elseif (\array_key_exists('friday', $data) && null === $data['friday']) { + $object->setFriday(null); + } + if (\array_key_exists('saturday', $data) && null !== $data['saturday']) { + $object->setSaturday($data['saturday']); + unset($data['saturday']); + } elseif (\array_key_exists('saturday', $data) && null === $data['saturday']) { + $object->setSaturday(null); + } + if (\array_key_exists('sunday', $data) && null !== $data['sunday']) { + $object->setSunday($data['sunday']); + unset($data['sunday']); + } elseif (\array_key_exists('sunday', $data) && null === $data['sunday']) { + $object->setSunday(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('monday', $data) && null !== $data['monday']) { - $object->setMonday($data['monday']); - } elseif (\array_key_exists('monday', $data) && null === $data['monday']) { - $object->setMonday(null); - } - if (\array_key_exists('tuesday', $data) && null !== $data['tuesday']) { - $object->setTuesday($data['tuesday']); - } elseif (\array_key_exists('tuesday', $data) && null === $data['tuesday']) { - $object->setTuesday(null); - } - if (\array_key_exists('wednesday', $data) && null !== $data['wednesday']) { - $object->setWednesday($data['wednesday']); - } elseif (\array_key_exists('wednesday', $data) && null === $data['wednesday']) { - $object->setWednesday(null); - } - if (\array_key_exists('thursday', $data) && null !== $data['thursday']) { - $object->setThursday($data['thursday']); - } elseif (\array_key_exists('thursday', $data) && null === $data['thursday']) { - $object->setThursday(null); - } - if (\array_key_exists('friday', $data) && null !== $data['friday']) { - $object->setFriday($data['friday']); - } elseif (\array_key_exists('friday', $data) && null === $data['friday']) { - $object->setFriday(null); - } - if (\array_key_exists('saturday', $data) && null !== $data['saturday']) { - $object->setSaturday($data['saturday']); - } elseif (\array_key_exists('saturday', $data) && null === $data['saturday']) { - $object->setSaturday(null); - } - if (\array_key_exists('sunday', $data) && null !== $data['sunday']) { - $object->setSunday($data['sunday']); - } elseif (\array_key_exists('sunday', $data) && null === $data['sunday']) { - $object->setSunday(null); - } - return $object; - } + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('monday') && null !== $object->getMonday()) { + $data['monday'] = $object->getMonday(); + } + if ($object->isInitialized('tuesday') && null !== $object->getTuesday()) { + $data['tuesday'] = $object->getTuesday(); + } + if ($object->isInitialized('wednesday') && null !== $object->getWednesday()) { + $data['wednesday'] = $object->getWednesday(); + } + if ($object->isInitialized('thursday') && null !== $object->getThursday()) { + $data['thursday'] = $object->getThursday(); + } + if ($object->isInitialized('friday') && null !== $object->getFriday()) { + $data['friday'] = $object->getFriday(); + } + if ($object->isInitialized('saturday') && null !== $object->getSaturday()) { + $data['saturday'] = $object->getSaturday(); + } + if ($object->isInitialized('sunday') && null !== $object->getSunday()) { + $data['sunday'] = $object->getSunday(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) - { - $data = []; - if (null !== $object->getMonday()) { - $data['monday'] = $object->getMonday(); - } - if (null !== $object->getTuesday()) { - $data['tuesday'] = $object->getTuesday(); + return $data; } - if (null !== $object->getWednesday()) { - $data['wednesday'] = $object->getWednesday(); + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\PersonWorkingDays' => false]; } - if (null !== $object->getThursday()) { - $data['thursday'] = $object->getThursday(); + } +} else { + class PersonWorkingDaysNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\PersonWorkingDays' === $type; } - if (null !== $object->getFriday()) { - $data['friday'] = $object->getFriday(); + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\PersonWorkingDays' === $data::class; } - if (null !== $object->getSaturday()) { - $data['saturday'] = $object->getSaturday(); + + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\PersonWorkingDays(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('monday', $data) && null !== $data['monday']) { + $object->setMonday($data['monday']); + unset($data['monday']); + } elseif (\array_key_exists('monday', $data) && null === $data['monday']) { + $object->setMonday(null); + } + if (\array_key_exists('tuesday', $data) && null !== $data['tuesday']) { + $object->setTuesday($data['tuesday']); + unset($data['tuesday']); + } elseif (\array_key_exists('tuesday', $data) && null === $data['tuesday']) { + $object->setTuesday(null); + } + if (\array_key_exists('wednesday', $data) && null !== $data['wednesday']) { + $object->setWednesday($data['wednesday']); + unset($data['wednesday']); + } elseif (\array_key_exists('wednesday', $data) && null === $data['wednesday']) { + $object->setWednesday(null); + } + if (\array_key_exists('thursday', $data) && null !== $data['thursday']) { + $object->setThursday($data['thursday']); + unset($data['thursday']); + } elseif (\array_key_exists('thursday', $data) && null === $data['thursday']) { + $object->setThursday(null); + } + if (\array_key_exists('friday', $data) && null !== $data['friday']) { + $object->setFriday($data['friday']); + unset($data['friday']); + } elseif (\array_key_exists('friday', $data) && null === $data['friday']) { + $object->setFriday(null); + } + if (\array_key_exists('saturday', $data) && null !== $data['saturday']) { + $object->setSaturday($data['saturday']); + unset($data['saturday']); + } elseif (\array_key_exists('saturday', $data) && null === $data['saturday']) { + $object->setSaturday(null); + } + if (\array_key_exists('sunday', $data) && null !== $data['sunday']) { + $object->setSunday($data['sunday']); + unset($data['sunday']); + } elseif (\array_key_exists('sunday', $data) && null === $data['sunday']) { + $object->setSunday(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; } - if (null !== $object->getSunday()) { - $data['sunday'] = $object->getSunday(); + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('monday') && null !== $object->getMonday()) { + $data['monday'] = $object->getMonday(); + } + if ($object->isInitialized('tuesday') && null !== $object->getTuesday()) { + $data['tuesday'] = $object->getTuesday(); + } + if ($object->isInitialized('wednesday') && null !== $object->getWednesday()) { + $data['wednesday'] = $object->getWednesday(); + } + if ($object->isInitialized('thursday') && null !== $object->getThursday()) { + $data['thursday'] = $object->getThursday(); + } + if ($object->isInitialized('friday') && null !== $object->getFriday()) { + $data['friday'] = $object->getFriday(); + } + if ($object->isInitialized('saturday') && null !== $object->getSaturday()) { + $data['saturday'] = $object->getSaturday(); + } + if ($object->isInitialized('sunday') && null !== $object->getSunday()) { + $data['sunday'] = $object->getSunday(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\PersonWorkingDays' => false]; + } } } diff --git a/generated/Normalizer/PlaceholderBodyNormalizer.php b/generated/Normalizer/PlaceholderBodyNormalizer.php index 1850ec8..208cceb 100644 --- a/generated/Normalizer/PlaceholderBodyNormalizer.php +++ b/generated/Normalizer/PlaceholderBodyNormalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,61 +22,138 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class PlaceholderBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class PlaceholderBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\PlaceholderBody' === $type; - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\PlaceholderBody' === \get_class($data); - } - - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\PlaceholderBody' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\PlaceholderBody' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\PlaceholderBody(); - 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 \JoliCode\Forecast\Api\Model\PlaceholderBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('placeholder', $data) && null !== $data['placeholder']) { + $object->setPlaceholder($this->denormalizer->denormalize($data['placeholder'], 'JoliCode\\Forecast\\Api\\Model\\PlaceholderBodyPlaceholder', 'json', $context)); + unset($data['placeholder']); + } elseif (\array_key_exists('placeholder', $data) && null === $data['placeholder']) { + $object->setPlaceholder(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('placeholder', $data) && null !== $data['placeholder']) { - $object->setPlaceholder($this->denormalizer->denormalize($data['placeholder'], 'JoliCode\\Forecast\\Api\\Model\\PlaceholderBodyPlaceholder', 'json', $context)); - } elseif (\array_key_exists('placeholder', $data) && null === $data['placeholder']) { - $object->setPlaceholder(null); + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['placeholder'] = $this->normalizer->normalize($object->getPlaceholder(), '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 ['JoliCode\\Forecast\\Api\\Model\\PlaceholderBody' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class PlaceholderBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - $data['placeholder'] = $this->normalizer->normalize($object->getPlaceholder(), 'json', $context); + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - return $data; + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\PlaceholderBody' === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\PlaceholderBody' === $data::class; + } + + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\PlaceholderBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('placeholder', $data) && null !== $data['placeholder']) { + $object->setPlaceholder($this->denormalizer->denormalize($data['placeholder'], 'JoliCode\\Forecast\\Api\\Model\\PlaceholderBodyPlaceholder', 'json', $context)); + unset($data['placeholder']); + } elseif (\array_key_exists('placeholder', $data) && null === $data['placeholder']) { + $object->setPlaceholder(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['placeholder'] = $this->normalizer->normalize($object->getPlaceholder(), 'json', $context); + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\PlaceholderBody' => false]; + } } } diff --git a/generated/Normalizer/PlaceholderBodyPlaceholderNormalizer.php b/generated/Normalizer/PlaceholderBodyPlaceholderNormalizer.php index 86eadc6..41935ef 100644 --- a/generated/Normalizer/PlaceholderBodyPlaceholderNormalizer.php +++ b/generated/Normalizer/PlaceholderBodyPlaceholderNormalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,81 +22,182 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class PlaceholderBodyPlaceholderNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool - { - return 'JoliCode\\Forecast\\Api\\Model\\PlaceholderBodyPlaceholder' === $type; - } - - public function supportsNormalization($data, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class PlaceholderBodyPlaceholderNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\PlaceholderBodyPlaceholder' === \get_class($data); - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\PlaceholderBodyPlaceholder' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\PlaceholderBodyPlaceholder' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\PlaceholderBodyPlaceholder(); - 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 \JoliCode\Forecast\Api\Model\PlaceholderBodyPlaceholder(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('archived', $data) && null !== $data['archived']) { + $object->setArchived($data['archived']); + unset($data['archived']); + } elseif (\array_key_exists('archived', $data) && null === $data['archived']) { + $object->setArchived(null); + } + if (\array_key_exists('name', $data) && null !== $data['name']) { + $object->setName($data['name']); + unset($data['name']); + } elseif (\array_key_exists('name', $data) && null === $data['name']) { + $object->setName(null); + } + if (\array_key_exists('roles', $data) && null !== $data['roles']) { + $values = []; + foreach ($data['roles'] as $value) { + $values[] = $value; + } + $object->setRoles($values); + unset($data['roles']); + } elseif (\array_key_exists('roles', $data) && null === $data['roles']) { + $object->setRoles(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('archived', $data) && null !== $data['archived']) { - $object->setArchived($data['archived']); - } elseif (\array_key_exists('archived', $data) && null === $data['archived']) { - $object->setArchived(null); - } - if (\array_key_exists('name', $data) && null !== $data['name']) { - $object->setName($data['name']); - } elseif (\array_key_exists('name', $data) && null === $data['name']) { - $object->setName(null); - } - if (\array_key_exists('roles', $data) && null !== $data['roles']) { + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['archived'] = $object->getArchived(); + $data['name'] = $object->getName(); $values = []; - foreach ($data['roles'] as $value) { + foreach ($object->getRoles() as $value) { $values[] = $value; } - $object->setRoles($values); - } elseif (\array_key_exists('roles', $data) && null === $data['roles']) { - $object->setRoles(null); + $data['roles'] = $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 ['JoliCode\\Forecast\\Api\\Model\\PlaceholderBodyPlaceholder' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class PlaceholderBodyPlaceholderNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - $data['archived'] = $object->getArchived(); - $data['name'] = $object->getName(); - $values = []; - foreach ($object->getRoles() as $value) { - $values[] = $value; + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\PlaceholderBodyPlaceholder' === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\PlaceholderBodyPlaceholder' === $data::class; + } + + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\PlaceholderBodyPlaceholder(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('archived', $data) && null !== $data['archived']) { + $object->setArchived($data['archived']); + unset($data['archived']); + } elseif (\array_key_exists('archived', $data) && null === $data['archived']) { + $object->setArchived(null); + } + if (\array_key_exists('name', $data) && null !== $data['name']) { + $object->setName($data['name']); + unset($data['name']); + } elseif (\array_key_exists('name', $data) && null === $data['name']) { + $object->setName(null); + } + if (\array_key_exists('roles', $data) && null !== $data['roles']) { + $values = []; + foreach ($data['roles'] as $value) { + $values[] = $value; + } + $object->setRoles($values); + unset($data['roles']); + } elseif (\array_key_exists('roles', $data) && null === $data['roles']) { + $object->setRoles(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + + return $object; } - $data['roles'] = $values; - return $data; + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['archived'] = $object->getArchived(); + $data['name'] = $object->getName(); + $values = []; + foreach ($object->getRoles() as $value) { + $values[] = $value; + } + $data['roles'] = $values; + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\PlaceholderBodyPlaceholder' => false]; + } } } diff --git a/generated/Normalizer/PlaceholderNormalizer.php b/generated/Normalizer/PlaceholderNormalizer.php index cac92ef..d9f7477 100644 --- a/generated/Normalizer/PlaceholderNormalizer.php +++ b/generated/Normalizer/PlaceholderNormalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,109 +22,244 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class PlaceholderNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool - { - return 'JoliCode\\Forecast\\Api\\Model\\Placeholder' === $type; - } - - public function supportsNormalization($data, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class PlaceholderNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\Placeholder' === \get_class($data); - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\Placeholder' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\Placeholder' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\Placeholder(); - 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 \JoliCode\Forecast\Api\Model\Placeholder(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('archived', $data) && null !== $data['archived']) { + $object->setArchived($data['archived']); + unset($data['archived']); + } elseif (\array_key_exists('archived', $data) && null === $data['archived']) { + $object->setArchived(null); + } + if (\array_key_exists('id', $data) && null !== $data['id']) { + $object->setId($data['id']); + unset($data['id']); + } elseif (\array_key_exists('id', $data) && null === $data['id']) { + $object->setId(null); + } + if (\array_key_exists('name', $data) && null !== $data['name']) { + $object->setName($data['name']); + unset($data['name']); + } elseif (\array_key_exists('name', $data) && null === $data['name']) { + $object->setName(null); + } + if (\array_key_exists('roles', $data) && null !== $data['roles']) { + $values = []; + foreach ($data['roles'] as $value) { + $values[] = $value; + } + $object->setRoles($values); + unset($data['roles']); + } elseif (\array_key_exists('roles', $data) && null === $data['roles']) { + $object->setRoles(null); + } + if (\array_key_exists('updated_at', $data) && null !== $data['updated_at']) { + $object->setUpdatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s.v\\Z', $data['updated_at'])); + unset($data['updated_at']); + } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { + $object->setUpdatedAt(null); + } + if (\array_key_exists('updated_by_id', $data) && null !== $data['updated_by_id']) { + $object->setUpdatedById($data['updated_by_id']); + unset($data['updated_by_id']); + } elseif (\array_key_exists('updated_by_id', $data) && null === $data['updated_by_id']) { + $object->setUpdatedById(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('archived', $data) && null !== $data['archived']) { - $object->setArchived($data['archived']); - } elseif (\array_key_exists('archived', $data) && null === $data['archived']) { - $object->setArchived(null); - } - if (\array_key_exists('id', $data) && null !== $data['id']) { - $object->setId($data['id']); - } elseif (\array_key_exists('id', $data) && null === $data['id']) { - $object->setId(null); - } - if (\array_key_exists('name', $data) && null !== $data['name']) { - $object->setName($data['name']); - } elseif (\array_key_exists('name', $data) && null === $data['name']) { - $object->setName(null); - } - if (\array_key_exists('roles', $data) && null !== $data['roles']) { - $values = []; - foreach ($data['roles'] as $value) { - $values[] = $value; - } - $object->setRoles($values); - } elseif (\array_key_exists('roles', $data) && null === $data['roles']) { - $object->setRoles(null); - } - if (\array_key_exists('updated_at', $data) && null !== $data['updated_at']) { - $object->setUpdatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s.v\\Z', $data['updated_at'])); - } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { - $object->setUpdatedAt(null); - } - if (\array_key_exists('updated_by_id', $data) && null !== $data['updated_by_id']) { - $object->setUpdatedById($data['updated_by_id']); - } elseif (\array_key_exists('updated_by_id', $data) && null === $data['updated_by_id']) { - $object->setUpdatedById(null); + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('archived') && null !== $object->getArchived()) { + $data['archived'] = $object->getArchived(); + } + if ($object->isInitialized('id') && null !== $object->getId()) { + $data['id'] = $object->getId(); + } + $data['name'] = $object->getName(); + if ($object->isInitialized('roles') && null !== $object->getRoles()) { + $values = []; + foreach ($object->getRoles() as $value) { + $values[] = $value; + } + $data['roles'] = $values; + } + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { + $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s.v\\Z'); + } + if ($object->isInitialized('updatedById') && null !== $object->getUpdatedById()) { + $data['updated_by_id'] = $object->getUpdatedById(); + } + 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 ['JoliCode\\Forecast\\Api\\Model\\Placeholder' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class PlaceholderNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if (null !== $object->getArchived()) { - $data['archived'] = $object->getArchived(); + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\Placeholder' === $type; } - if (null !== $object->getId()) { - $data['id'] = $object->getId(); + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\Placeholder' === $data::class; } - $data['name'] = $object->getName(); - if (null !== $object->getRoles()) { - $values = []; - foreach ($object->getRoles() as $value) { - $values[] = $value; + + /** + * @param mixed|null $format + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - $data['roles'] = $values; - } - if (null !== $object->getUpdatedAt()) { - $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s.v\\Z'); + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \JoliCode\Forecast\Api\Model\Placeholder(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('archived', $data) && null !== $data['archived']) { + $object->setArchived($data['archived']); + unset($data['archived']); + } elseif (\array_key_exists('archived', $data) && null === $data['archived']) { + $object->setArchived(null); + } + if (\array_key_exists('id', $data) && null !== $data['id']) { + $object->setId($data['id']); + unset($data['id']); + } elseif (\array_key_exists('id', $data) && null === $data['id']) { + $object->setId(null); + } + if (\array_key_exists('name', $data) && null !== $data['name']) { + $object->setName($data['name']); + unset($data['name']); + } elseif (\array_key_exists('name', $data) && null === $data['name']) { + $object->setName(null); + } + if (\array_key_exists('roles', $data) && null !== $data['roles']) { + $values = []; + foreach ($data['roles'] as $value) { + $values[] = $value; + } + $object->setRoles($values); + unset($data['roles']); + } elseif (\array_key_exists('roles', $data) && null === $data['roles']) { + $object->setRoles(null); + } + if (\array_key_exists('updated_at', $data) && null !== $data['updated_at']) { + $object->setUpdatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s.v\\Z', $data['updated_at'])); + unset($data['updated_at']); + } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { + $object->setUpdatedAt(null); + } + if (\array_key_exists('updated_by_id', $data) && null !== $data['updated_by_id']) { + $object->setUpdatedById($data['updated_by_id']); + unset($data['updated_by_id']); + } elseif (\array_key_exists('updated_by_id', $data) && null === $data['updated_by_id']) { + $object->setUpdatedById(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + + return $object; } - if (null !== $object->getUpdatedById()) { - $data['updated_by_id'] = $object->getUpdatedById(); + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('archived') && null !== $object->getArchived()) { + $data['archived'] = $object->getArchived(); + } + if ($object->isInitialized('id') && null !== $object->getId()) { + $data['id'] = $object->getId(); + } + $data['name'] = $object->getName(); + if ($object->isInitialized('roles') && null !== $object->getRoles()) { + $values = []; + foreach ($object->getRoles() as $value) { + $values[] = $value; + } + $data['roles'] = $values; + } + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { + $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s.v\\Z'); + } + if ($object->isInitialized('updatedById') && null !== $object->getUpdatedById()) { + $data['updated_by_id'] = $object->getUpdatedById(); + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } + + return $data; } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\Placeholder' => false]; + } } } diff --git a/generated/Normalizer/PlaceholdersIdGetResponse200Normalizer.php b/generated/Normalizer/PlaceholdersIdGetResponse200Normalizer.php index c066e3e..7135355 100644 --- a/generated/Normalizer/PlaceholdersIdGetResponse200Normalizer.php +++ b/generated/Normalizer/PlaceholdersIdGetResponse200Normalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,61 +22,138 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class PlaceholdersIdGetResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class PlaceholdersIdGetResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\PlaceholdersIdGetResponse200' === $type; - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\PlaceholdersIdGetResponse200' === \get_class($data); - } - - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\PlaceholdersIdGetResponse200' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\PlaceholdersIdGetResponse200' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\PlaceholdersIdGetResponse200(); - 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 \JoliCode\Forecast\Api\Model\PlaceholdersIdGetResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('placeholder', $data) && null !== $data['placeholder']) { + $object->setPlaceholder($this->denormalizer->denormalize($data['placeholder'], 'JoliCode\\Forecast\\Api\\Model\\Placeholder', 'json', $context)); + unset($data['placeholder']); + } elseif (\array_key_exists('placeholder', $data) && null === $data['placeholder']) { + $object->setPlaceholder(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('placeholder', $data) && null !== $data['placeholder']) { - $object->setPlaceholder($this->denormalizer->denormalize($data['placeholder'], 'JoliCode\\Forecast\\Api\\Model\\Placeholder', 'json', $context)); - } elseif (\array_key_exists('placeholder', $data) && null === $data['placeholder']) { - $object->setPlaceholder(null); + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['placeholder'] = $this->normalizer->normalize($object->getPlaceholder(), '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 ['JoliCode\\Forecast\\Api\\Model\\PlaceholdersIdGetResponse200' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class PlaceholdersIdGetResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - $data['placeholder'] = $this->normalizer->normalize($object->getPlaceholder(), 'json', $context); + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - return $data; + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\PlaceholdersIdGetResponse200' === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\PlaceholdersIdGetResponse200' === $data::class; + } + + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\PlaceholdersIdGetResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('placeholder', $data) && null !== $data['placeholder']) { + $object->setPlaceholder($this->denormalizer->denormalize($data['placeholder'], 'JoliCode\\Forecast\\Api\\Model\\Placeholder', 'json', $context)); + unset($data['placeholder']); + } elseif (\array_key_exists('placeholder', $data) && null === $data['placeholder']) { + $object->setPlaceholder(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['placeholder'] = $this->normalizer->normalize($object->getPlaceholder(), 'json', $context); + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\PlaceholdersIdGetResponse200' => false]; + } } } diff --git a/generated/Normalizer/PlaceholdersIdPutResponse200Normalizer.php b/generated/Normalizer/PlaceholdersIdPutResponse200Normalizer.php index eb884a8..fa87572 100644 --- a/generated/Normalizer/PlaceholdersIdPutResponse200Normalizer.php +++ b/generated/Normalizer/PlaceholdersIdPutResponse200Normalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,61 +22,138 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class PlaceholdersIdPutResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class PlaceholdersIdPutResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\PlaceholdersIdPutResponse200' === $type; - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\PlaceholdersIdPutResponse200' === \get_class($data); - } - - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\PlaceholdersIdPutResponse200' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\PlaceholdersIdPutResponse200' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\PlaceholdersIdPutResponse200(); - 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 \JoliCode\Forecast\Api\Model\PlaceholdersIdPutResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('placeholder', $data) && null !== $data['placeholder']) { + $object->setPlaceholder($this->denormalizer->denormalize($data['placeholder'], 'JoliCode\\Forecast\\Api\\Model\\Placeholder', 'json', $context)); + unset($data['placeholder']); + } elseif (\array_key_exists('placeholder', $data) && null === $data['placeholder']) { + $object->setPlaceholder(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('placeholder', $data) && null !== $data['placeholder']) { - $object->setPlaceholder($this->denormalizer->denormalize($data['placeholder'], 'JoliCode\\Forecast\\Api\\Model\\Placeholder', 'json', $context)); - } elseif (\array_key_exists('placeholder', $data) && null === $data['placeholder']) { - $object->setPlaceholder(null); + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['placeholder'] = $this->normalizer->normalize($object->getPlaceholder(), '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 ['JoliCode\\Forecast\\Api\\Model\\PlaceholdersIdPutResponse200' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class PlaceholdersIdPutResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - $data['placeholder'] = $this->normalizer->normalize($object->getPlaceholder(), 'json', $context); + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - return $data; + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\PlaceholdersIdPutResponse200' === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\PlaceholdersIdPutResponse200' === $data::class; + } + + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\PlaceholdersIdPutResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('placeholder', $data) && null !== $data['placeholder']) { + $object->setPlaceholder($this->denormalizer->denormalize($data['placeholder'], 'JoliCode\\Forecast\\Api\\Model\\Placeholder', 'json', $context)); + unset($data['placeholder']); + } elseif (\array_key_exists('placeholder', $data) && null === $data['placeholder']) { + $object->setPlaceholder(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['placeholder'] = $this->normalizer->normalize($object->getPlaceholder(), 'json', $context); + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\PlaceholdersIdPutResponse200' => false]; + } } } diff --git a/generated/Normalizer/PlaceholdersNormalizer.php b/generated/Normalizer/PlaceholdersNormalizer.php index 24eecdc..53819ab 100644 --- a/generated/Normalizer/PlaceholdersNormalizer.php +++ b/generated/Normalizer/PlaceholdersNormalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,69 +22,154 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class PlaceholdersNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class PlaceholdersNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\Placeholders' === $type; - } - - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\Placeholders' === \get_class($data); - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\Placeholders' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\Placeholders' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\Placeholders(); - 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 \JoliCode\Forecast\Api\Model\Placeholders(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('placeholders', $data) && null !== $data['placeholders']) { + $values = []; + foreach ($data['placeholders'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Forecast\\Api\\Model\\Placeholder', 'json', $context); + } + $object->setPlaceholders($values); + unset($data['placeholders']); + } elseif (\array_key_exists('placeholders', $data) && null === $data['placeholders']) { + $object->setPlaceholders(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('placeholders', $data) && null !== $data['placeholders']) { + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; $values = []; - foreach ($data['placeholders'] as $value) { - $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Forecast\\Api\\Model\\Placeholder', 'json', $context); + foreach ($object->getPlaceholders() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); } - $object->setPlaceholders($values); - } elseif (\array_key_exists('placeholders', $data) && null === $data['placeholders']) { - $object->setPlaceholders(null); + $data['placeholders'] = $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 ['JoliCode\\Forecast\\Api\\Model\\Placeholders' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class PlaceholdersNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - $values = []; - foreach ($object->getPlaceholders() as $value) { - $values[] = $this->normalizer->normalize($value, 'json', $context); + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\Placeholders' === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\Placeholders' === $data::class; } - $data['placeholders'] = $values; - return $data; + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\Placeholders(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('placeholders', $data) && null !== $data['placeholders']) { + $values = []; + foreach ($data['placeholders'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Forecast\\Api\\Model\\Placeholder', 'json', $context); + } + $object->setPlaceholders($values); + unset($data['placeholders']); + } elseif (\array_key_exists('placeholders', $data) && null === $data['placeholders']) { + $object->setPlaceholders(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + + return $object; + } + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $values = []; + foreach ($object->getPlaceholders() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['placeholders'] = $values; + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\Placeholders' => false]; + } } } diff --git a/generated/Normalizer/PlaceholdersPostResponse201Normalizer.php b/generated/Normalizer/PlaceholdersPostResponse201Normalizer.php index 566a77b..ced46d8 100644 --- a/generated/Normalizer/PlaceholdersPostResponse201Normalizer.php +++ b/generated/Normalizer/PlaceholdersPostResponse201Normalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,61 +22,138 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class PlaceholdersPostResponse201Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class PlaceholdersPostResponse201Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\PlaceholdersPostResponse201' === $type; - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\PlaceholdersPostResponse201' === \get_class($data); - } - - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\PlaceholdersPostResponse201' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\PlaceholdersPostResponse201' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\PlaceholdersPostResponse201(); - 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 \JoliCode\Forecast\Api\Model\PlaceholdersPostResponse201(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('placeholder', $data) && null !== $data['placeholder']) { + $object->setPlaceholder($this->denormalizer->denormalize($data['placeholder'], 'JoliCode\\Forecast\\Api\\Model\\Placeholder', 'json', $context)); + unset($data['placeholder']); + } elseif (\array_key_exists('placeholder', $data) && null === $data['placeholder']) { + $object->setPlaceholder(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('placeholder', $data) && null !== $data['placeholder']) { - $object->setPlaceholder($this->denormalizer->denormalize($data['placeholder'], 'JoliCode\\Forecast\\Api\\Model\\Placeholder', 'json', $context)); - } elseif (\array_key_exists('placeholder', $data) && null === $data['placeholder']) { - $object->setPlaceholder(null); + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['placeholder'] = $this->normalizer->normalize($object->getPlaceholder(), '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 ['JoliCode\\Forecast\\Api\\Model\\PlaceholdersPostResponse201' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class PlaceholdersPostResponse201Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - $data['placeholder'] = $this->normalizer->normalize($object->getPlaceholder(), 'json', $context); + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - return $data; + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\PlaceholdersPostResponse201' === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\PlaceholdersPostResponse201' === $data::class; + } + + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\PlaceholdersPostResponse201(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('placeholder', $data) && null !== $data['placeholder']) { + $object->setPlaceholder($this->denormalizer->denormalize($data['placeholder'], 'JoliCode\\Forecast\\Api\\Model\\Placeholder', 'json', $context)); + unset($data['placeholder']); + } elseif (\array_key_exists('placeholder', $data) && null === $data['placeholder']) { + $object->setPlaceholder(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['placeholder'] = $this->normalizer->normalize($object->getPlaceholder(), 'json', $context); + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\PlaceholdersPostResponse201' => false]; + } } } diff --git a/generated/Normalizer/ProjectNormalizer.php b/generated/Normalizer/ProjectNormalizer.php index c9974ea..161a19a 100644 --- a/generated/Normalizer/ProjectNormalizer.php +++ b/generated/Normalizer/ProjectNormalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,165 +22,370 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class ProjectNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class ProjectNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\Project' === $type; - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\Project' === \get_class($data); - } - - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\Project' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\Project' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\Project(); - 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 \JoliCode\Forecast\Api\Model\Project(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('archived', $data) && null !== $data['archived']) { + $object->setArchived($data['archived']); + unset($data['archived']); + } elseif (\array_key_exists('archived', $data) && null === $data['archived']) { + $object->setArchived(null); + } + if (\array_key_exists('client_id', $data) && null !== $data['client_id']) { + $object->setClientId($data['client_id']); + unset($data['client_id']); + } elseif (\array_key_exists('client_id', $data) && null === $data['client_id']) { + $object->setClientId(null); + } + if (\array_key_exists('code', $data) && null !== $data['code']) { + $object->setCode($data['code']); + unset($data['code']); + } elseif (\array_key_exists('code', $data) && null === $data['code']) { + $object->setCode(null); + } + if (\array_key_exists('color', $data) && null !== $data['color']) { + $object->setColor($data['color']); + unset($data['color']); + } elseif (\array_key_exists('color', $data) && null === $data['color']) { + $object->setColor(null); + } + if (\array_key_exists('end_date', $data) && null !== $data['end_date']) { + $object->setEndDate(\DateTime::createFromFormat('Y-m-d', $data['end_date'])->setTime(0, 0, 0)); + unset($data['end_date']); + } elseif (\array_key_exists('end_date', $data) && null === $data['end_date']) { + $object->setEndDate(null); + } + if (\array_key_exists('harvest_id', $data) && null !== $data['harvest_id']) { + $object->setHarvestId($data['harvest_id']); + unset($data['harvest_id']); + } elseif (\array_key_exists('harvest_id', $data) && null === $data['harvest_id']) { + $object->setHarvestId(null); + } + if (\array_key_exists('id', $data) && null !== $data['id']) { + $object->setId($data['id']); + unset($data['id']); + } elseif (\array_key_exists('id', $data) && null === $data['id']) { + $object->setId(null); + } + if (\array_key_exists('name', $data) && null !== $data['name']) { + $object->setName($data['name']); + unset($data['name']); + } elseif (\array_key_exists('name', $data) && null === $data['name']) { + $object->setName(null); + } + if (\array_key_exists('notes', $data) && null !== $data['notes']) { + $object->setNotes($data['notes']); + unset($data['notes']); + } elseif (\array_key_exists('notes', $data) && null === $data['notes']) { + $object->setNotes(null); + } + if (\array_key_exists('start_date', $data) && null !== $data['start_date']) { + $object->setStartDate(\DateTime::createFromFormat('Y-m-d', $data['start_date'])->setTime(0, 0, 0)); + unset($data['start_date']); + } elseif (\array_key_exists('start_date', $data) && null === $data['start_date']) { + $object->setStartDate(null); + } + if (\array_key_exists('tags', $data) && null !== $data['tags']) { + $values = []; + foreach ($data['tags'] as $value) { + $values[] = $value; + } + $object->setTags($values); + unset($data['tags']); + } elseif (\array_key_exists('tags', $data) && null === $data['tags']) { + $object->setTags(null); + } + if (\array_key_exists('updated_at', $data) && null !== $data['updated_at']) { + $object->setUpdatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s.v\\Z', $data['updated_at'])); + unset($data['updated_at']); + } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { + $object->setUpdatedAt(null); + } + if (\array_key_exists('updated_by_id', $data) && null !== $data['updated_by_id']) { + $object->setUpdatedById($data['updated_by_id']); + unset($data['updated_by_id']); + } elseif (\array_key_exists('updated_by_id', $data) && null === $data['updated_by_id']) { + $object->setUpdatedById(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('archived', $data) && null !== $data['archived']) { - $object->setArchived($data['archived']); - } elseif (\array_key_exists('archived', $data) && null === $data['archived']) { - $object->setArchived(null); - } - if (\array_key_exists('client_id', $data) && null !== $data['client_id']) { - $object->setClientId($data['client_id']); - } elseif (\array_key_exists('client_id', $data) && null === $data['client_id']) { - $object->setClientId(null); - } - if (\array_key_exists('code', $data) && null !== $data['code']) { - $object->setCode($data['code']); - } elseif (\array_key_exists('code', $data) && null === $data['code']) { - $object->setCode(null); - } - if (\array_key_exists('color', $data) && null !== $data['color']) { - $object->setColor($data['color']); - } elseif (\array_key_exists('color', $data) && null === $data['color']) { - $object->setColor(null); - } - if (\array_key_exists('end_date', $data) && null !== $data['end_date']) { - $object->setEndDate(\DateTime::createFromFormat('Y-m-d', $data['end_date'])->setTime(0, 0, 0)); - } elseif (\array_key_exists('end_date', $data) && null === $data['end_date']) { - $object->setEndDate(null); - } - if (\array_key_exists('harvest_id', $data) && null !== $data['harvest_id']) { - $object->setHarvestId($data['harvest_id']); - } elseif (\array_key_exists('harvest_id', $data) && null === $data['harvest_id']) { - $object->setHarvestId(null); - } - if (\array_key_exists('id', $data) && null !== $data['id']) { - $object->setId($data['id']); - } elseif (\array_key_exists('id', $data) && null === $data['id']) { - $object->setId(null); - } - if (\array_key_exists('name', $data) && null !== $data['name']) { - $object->setName($data['name']); - } elseif (\array_key_exists('name', $data) && null === $data['name']) { - $object->setName(null); - } - if (\array_key_exists('notes', $data) && null !== $data['notes']) { - $object->setNotes($data['notes']); - } elseif (\array_key_exists('notes', $data) && null === $data['notes']) { - $object->setNotes(null); - } - if (\array_key_exists('start_date', $data) && null !== $data['start_date']) { - $object->setStartDate(\DateTime::createFromFormat('Y-m-d', $data['start_date'])->setTime(0, 0, 0)); - } elseif (\array_key_exists('start_date', $data) && null === $data['start_date']) { - $object->setStartDate(null); - } - if (\array_key_exists('tags', $data) && null !== $data['tags']) { - $values = []; - foreach ($data['tags'] as $value) { - $values[] = $value; - } - $object->setTags($values); - } elseif (\array_key_exists('tags', $data) && null === $data['tags']) { - $object->setTags(null); - } - if (\array_key_exists('updated_at', $data) && null !== $data['updated_at']) { - $object->setUpdatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s.v\\Z', $data['updated_at'])); - } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { - $object->setUpdatedAt(null); - } - if (\array_key_exists('updated_by_id', $data) && null !== $data['updated_by_id']) { - $object->setUpdatedById($data['updated_by_id']); - } elseif (\array_key_exists('updated_by_id', $data) && null === $data['updated_by_id']) { - $object->setUpdatedById(null); - } - return $object; - } + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('archived') && null !== $object->getArchived()) { + $data['archived'] = $object->getArchived(); + } + if ($object->isInitialized('clientId') && null !== $object->getClientId()) { + $data['client_id'] = $object->getClientId(); + } + if ($object->isInitialized('code') && null !== $object->getCode()) { + $data['code'] = $object->getCode(); + } + if ($object->isInitialized('color') && null !== $object->getColor()) { + $data['color'] = $object->getColor(); + } + if ($object->isInitialized('endDate') && null !== $object->getEndDate()) { + $data['end_date'] = $object->getEndDate()->format('Y-m-d'); + } + if ($object->isInitialized('harvestId') && null !== $object->getHarvestId()) { + $data['harvest_id'] = $object->getHarvestId(); + } + if ($object->isInitialized('id') && null !== $object->getId()) { + $data['id'] = $object->getId(); + } + $data['name'] = $object->getName(); + if ($object->isInitialized('notes') && null !== $object->getNotes()) { + $data['notes'] = $object->getNotes(); + } + if ($object->isInitialized('startDate') && null !== $object->getStartDate()) { + $data['start_date'] = $object->getStartDate()->format('Y-m-d'); + } + if ($object->isInitialized('tags') && null !== $object->getTags()) { + $values = []; + foreach ($object->getTags() as $value) { + $values[] = $value; + } + $data['tags'] = $values; + } + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { + $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s.v\\Z'); + } + if ($object->isInitialized('updatedById') && null !== $object->getUpdatedById()) { + $data['updated_by_id'] = $object->getUpdatedById(); + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) - { - $data = []; - if (null !== $object->getArchived()) { - $data['archived'] = $object->getArchived(); - } - if (null !== $object->getClientId()) { - $data['client_id'] = $object->getClientId(); - } - if (null !== $object->getCode()) { - $data['code'] = $object->getCode(); - } - if (null !== $object->getColor()) { - $data['color'] = $object->getColor(); + return $data; } - if (null !== $object->getEndDate()) { - $data['end_date'] = $object->getEndDate()->format('Y-m-d'); - } - if (null !== $object->getHarvestId()) { - $data['harvest_id'] = $object->getHarvestId(); - } - if (null !== $object->getId()) { - $data['id'] = $object->getId(); + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\Project' => false]; } - $data['name'] = $object->getName(); - if (null !== $object->getNotes()) { - $data['notes'] = $object->getNotes(); + } +} else { + class ProjectNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\Project' === $type; } - if (null !== $object->getStartDate()) { - $data['start_date'] = $object->getStartDate()->format('Y-m-d'); + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\Project' === $data::class; } - if (null !== $object->getTags()) { - $values = []; - foreach ($object->getTags() as $value) { - $values[] = $value; + + /** + * @param mixed|null $format + */ + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - $data['tags'] = $values; - } - if (null !== $object->getUpdatedAt()) { - $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s.v\\Z'); + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \JoliCode\Forecast\Api\Model\Project(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('archived', $data) && null !== $data['archived']) { + $object->setArchived($data['archived']); + unset($data['archived']); + } elseif (\array_key_exists('archived', $data) && null === $data['archived']) { + $object->setArchived(null); + } + if (\array_key_exists('client_id', $data) && null !== $data['client_id']) { + $object->setClientId($data['client_id']); + unset($data['client_id']); + } elseif (\array_key_exists('client_id', $data) && null === $data['client_id']) { + $object->setClientId(null); + } + if (\array_key_exists('code', $data) && null !== $data['code']) { + $object->setCode($data['code']); + unset($data['code']); + } elseif (\array_key_exists('code', $data) && null === $data['code']) { + $object->setCode(null); + } + if (\array_key_exists('color', $data) && null !== $data['color']) { + $object->setColor($data['color']); + unset($data['color']); + } elseif (\array_key_exists('color', $data) && null === $data['color']) { + $object->setColor(null); + } + if (\array_key_exists('end_date', $data) && null !== $data['end_date']) { + $object->setEndDate(\DateTime::createFromFormat('Y-m-d', $data['end_date'])->setTime(0, 0, 0)); + unset($data['end_date']); + } elseif (\array_key_exists('end_date', $data) && null === $data['end_date']) { + $object->setEndDate(null); + } + if (\array_key_exists('harvest_id', $data) && null !== $data['harvest_id']) { + $object->setHarvestId($data['harvest_id']); + unset($data['harvest_id']); + } elseif (\array_key_exists('harvest_id', $data) && null === $data['harvest_id']) { + $object->setHarvestId(null); + } + if (\array_key_exists('id', $data) && null !== $data['id']) { + $object->setId($data['id']); + unset($data['id']); + } elseif (\array_key_exists('id', $data) && null === $data['id']) { + $object->setId(null); + } + if (\array_key_exists('name', $data) && null !== $data['name']) { + $object->setName($data['name']); + unset($data['name']); + } elseif (\array_key_exists('name', $data) && null === $data['name']) { + $object->setName(null); + } + if (\array_key_exists('notes', $data) && null !== $data['notes']) { + $object->setNotes($data['notes']); + unset($data['notes']); + } elseif (\array_key_exists('notes', $data) && null === $data['notes']) { + $object->setNotes(null); + } + if (\array_key_exists('start_date', $data) && null !== $data['start_date']) { + $object->setStartDate(\DateTime::createFromFormat('Y-m-d', $data['start_date'])->setTime(0, 0, 0)); + unset($data['start_date']); + } elseif (\array_key_exists('start_date', $data) && null === $data['start_date']) { + $object->setStartDate(null); + } + if (\array_key_exists('tags', $data) && null !== $data['tags']) { + $values = []; + foreach ($data['tags'] as $value) { + $values[] = $value; + } + $object->setTags($values); + unset($data['tags']); + } elseif (\array_key_exists('tags', $data) && null === $data['tags']) { + $object->setTags(null); + } + if (\array_key_exists('updated_at', $data) && null !== $data['updated_at']) { + $object->setUpdatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s.v\\Z', $data['updated_at'])); + unset($data['updated_at']); + } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { + $object->setUpdatedAt(null); + } + if (\array_key_exists('updated_by_id', $data) && null !== $data['updated_by_id']) { + $object->setUpdatedById($data['updated_by_id']); + unset($data['updated_by_id']); + } elseif (\array_key_exists('updated_by_id', $data) && null === $data['updated_by_id']) { + $object->setUpdatedById(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + + return $object; } - if (null !== $object->getUpdatedById()) { - $data['updated_by_id'] = $object->getUpdatedById(); + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('archived') && null !== $object->getArchived()) { + $data['archived'] = $object->getArchived(); + } + if ($object->isInitialized('clientId') && null !== $object->getClientId()) { + $data['client_id'] = $object->getClientId(); + } + if ($object->isInitialized('code') && null !== $object->getCode()) { + $data['code'] = $object->getCode(); + } + if ($object->isInitialized('color') && null !== $object->getColor()) { + $data['color'] = $object->getColor(); + } + if ($object->isInitialized('endDate') && null !== $object->getEndDate()) { + $data['end_date'] = $object->getEndDate()->format('Y-m-d'); + } + if ($object->isInitialized('harvestId') && null !== $object->getHarvestId()) { + $data['harvest_id'] = $object->getHarvestId(); + } + if ($object->isInitialized('id') && null !== $object->getId()) { + $data['id'] = $object->getId(); + } + $data['name'] = $object->getName(); + if ($object->isInitialized('notes') && null !== $object->getNotes()) { + $data['notes'] = $object->getNotes(); + } + if ($object->isInitialized('startDate') && null !== $object->getStartDate()) { + $data['start_date'] = $object->getStartDate()->format('Y-m-d'); + } + if ($object->isInitialized('tags') && null !== $object->getTags()) { + $values = []; + foreach ($object->getTags() as $value) { + $values[] = $value; + } + $data['tags'] = $values; + } + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { + $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s.v\\Z'); + } + if ($object->isInitialized('updatedById') && null !== $object->getUpdatedById()) { + $data['updated_by_id'] = $object->getUpdatedById(); + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } + + return $data; } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\Project' => false]; + } } } diff --git a/generated/Normalizer/ProjectsIdGetResponse200Normalizer.php b/generated/Normalizer/ProjectsIdGetResponse200Normalizer.php index 73ae104..30cd7ef 100644 --- a/generated/Normalizer/ProjectsIdGetResponse200Normalizer.php +++ b/generated/Normalizer/ProjectsIdGetResponse200Normalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,61 +22,138 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class ProjectsIdGetResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class ProjectsIdGetResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\ProjectsIdGetResponse200' === $type; - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\ProjectsIdGetResponse200' === \get_class($data); - } - - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\ProjectsIdGetResponse200' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\ProjectsIdGetResponse200' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\ProjectsIdGetResponse200(); - 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 \JoliCode\Forecast\Api\Model\ProjectsIdGetResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('project', $data) && null !== $data['project']) { + $object->setProject($this->denormalizer->denormalize($data['project'], 'JoliCode\\Forecast\\Api\\Model\\Project', 'json', $context)); + unset($data['project']); + } elseif (\array_key_exists('project', $data) && null === $data['project']) { + $object->setProject(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('project', $data) && null !== $data['project']) { - $object->setProject($this->denormalizer->denormalize($data['project'], 'JoliCode\\Forecast\\Api\\Model\\Project', 'json', $context)); - } elseif (\array_key_exists('project', $data) && null === $data['project']) { - $object->setProject(null); + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['project'] = $this->normalizer->normalize($object->getProject(), '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 ['JoliCode\\Forecast\\Api\\Model\\ProjectsIdGetResponse200' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class ProjectsIdGetResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - $data['project'] = $this->normalizer->normalize($object->getProject(), 'json', $context); + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - return $data; + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\ProjectsIdGetResponse200' === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\ProjectsIdGetResponse200' === $data::class; + } + + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\ProjectsIdGetResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('project', $data) && null !== $data['project']) { + $object->setProject($this->denormalizer->denormalize($data['project'], 'JoliCode\\Forecast\\Api\\Model\\Project', 'json', $context)); + unset($data['project']); + } elseif (\array_key_exists('project', $data) && null === $data['project']) { + $object->setProject(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['project'] = $this->normalizer->normalize($object->getProject(), 'json', $context); + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\ProjectsIdGetResponse200' => false]; + } } } diff --git a/generated/Normalizer/ProjectsNormalizer.php b/generated/Normalizer/ProjectsNormalizer.php index b134657..4fb468f 100644 --- a/generated/Normalizer/ProjectsNormalizer.php +++ b/generated/Normalizer/ProjectsNormalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,69 +22,154 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class ProjectsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class ProjectsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\Projects' === $type; - } - - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\Projects' === \get_class($data); - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\Projects' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\Projects' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\Projects(); - 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 \JoliCode\Forecast\Api\Model\Projects(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('projects', $data) && null !== $data['projects']) { + $values = []; + foreach ($data['projects'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Forecast\\Api\\Model\\Project', 'json', $context); + } + $object->setProjects($values); + unset($data['projects']); + } elseif (\array_key_exists('projects', $data) && null === $data['projects']) { + $object->setProjects(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('projects', $data) && null !== $data['projects']) { + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; $values = []; - foreach ($data['projects'] as $value) { - $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Forecast\\Api\\Model\\Project', 'json', $context); + foreach ($object->getProjects() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); } - $object->setProjects($values); - } elseif (\array_key_exists('projects', $data) && null === $data['projects']) { - $object->setProjects(null); + $data['projects'] = $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 ['JoliCode\\Forecast\\Api\\Model\\Projects' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class ProjectsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - $values = []; - foreach ($object->getProjects() as $value) { - $values[] = $this->normalizer->normalize($value, 'json', $context); + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\Projects' === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\Projects' === $data::class; } - $data['projects'] = $values; - return $data; + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\Projects(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('projects', $data) && null !== $data['projects']) { + $values = []; + foreach ($data['projects'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Forecast\\Api\\Model\\Project', 'json', $context); + } + $object->setProjects($values); + unset($data['projects']); + } elseif (\array_key_exists('projects', $data) && null === $data['projects']) { + $object->setProjects(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + + return $object; + } + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $values = []; + foreach ($object->getProjects() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['projects'] = $values; + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\Projects' => false]; + } } } diff --git a/generated/Normalizer/RemainingBudgetedHourNormalizer.php b/generated/Normalizer/RemainingBudgetedHourNormalizer.php index b936ccd..3e9c5e4 100644 --- a/generated/Normalizer/RemainingBudgetedHourNormalizer.php +++ b/generated/Normalizer/RemainingBudgetedHourNormalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,91 +22,206 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class RemainingBudgetedHourNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool - { - return 'JoliCode\\Forecast\\Api\\Model\\RemainingBudgetedHour' === $type; - } - - public function supportsNormalization($data, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class RemainingBudgetedHourNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\RemainingBudgetedHour' === \get_class($data); - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\RemainingBudgetedHour' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\RemainingBudgetedHour' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\RemainingBudgetedHour(); - 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 \JoliCode\Forecast\Api\Model\RemainingBudgetedHour(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('budget_by', $data) && null !== $data['budget_by']) { + $object->setBudgetBy($data['budget_by']); + unset($data['budget_by']); + } elseif (\array_key_exists('budget_by', $data) && null === $data['budget_by']) { + $object->setBudgetBy(null); + } + if (\array_key_exists('budget_is_monthly', $data) && null !== $data['budget_is_monthly']) { + $object->setBudgetIsMonthly($data['budget_is_monthly']); + unset($data['budget_is_monthly']); + } elseif (\array_key_exists('budget_is_monthly', $data) && null === $data['budget_is_monthly']) { + $object->setBudgetIsMonthly(null); + } + if (\array_key_exists('hours', $data) && null !== $data['hours']) { + $object->setHours($data['hours']); + unset($data['hours']); + } elseif (\array_key_exists('hours', $data) && null === $data['hours']) { + $object->setHours(null); + } + if (\array_key_exists('project_id', $data) && null !== $data['project_id']) { + $object->setProjectId($data['project_id']); + unset($data['project_id']); + } elseif (\array_key_exists('project_id', $data) && null === $data['project_id']) { + $object->setProjectId(null); + } + if (\array_key_exists('response_code', $data) && null !== $data['response_code']) { + $object->setResponseCode($data['response_code']); + unset($data['response_code']); + } elseif (\array_key_exists('response_code', $data) && null === $data['response_code']) { + $object->setResponseCode(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('budget_by', $data) && null !== $data['budget_by']) { - $object->setBudgetBy($data['budget_by']); - } elseif (\array_key_exists('budget_by', $data) && null === $data['budget_by']) { - $object->setBudgetBy(null); - } - if (\array_key_exists('budget_is_monthly', $data) && null !== $data['budget_is_monthly']) { - $object->setBudgetIsMonthly($data['budget_is_monthly']); - } elseif (\array_key_exists('budget_is_monthly', $data) && null === $data['budget_is_monthly']) { - $object->setBudgetIsMonthly(null); + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('budgetBy') && null !== $object->getBudgetBy()) { + $data['budget_by'] = $object->getBudgetBy(); + } + if ($object->isInitialized('budgetIsMonthly') && null !== $object->getBudgetIsMonthly()) { + $data['budget_is_monthly'] = $object->getBudgetIsMonthly(); + } + $data['hours'] = $object->getHours(); + $data['project_id'] = $object->getProjectId(); + if ($object->isInitialized('responseCode') && null !== $object->getResponseCode()) { + $data['response_code'] = $object->getResponseCode(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - if (\array_key_exists('hours', $data) && null !== $data['hours']) { - $object->setHours($data['hours']); - } elseif (\array_key_exists('hours', $data) && null === $data['hours']) { - $object->setHours(null); + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\RemainingBudgetedHour' => false]; } - if (\array_key_exists('project_id', $data) && null !== $data['project_id']) { - $object->setProjectId($data['project_id']); - } elseif (\array_key_exists('project_id', $data) && null === $data['project_id']) { - $object->setProjectId(null); + } +} else { + class RemainingBudgetedHourNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\RemainingBudgetedHour' === $type; } - if (\array_key_exists('response_code', $data) && null !== $data['response_code']) { - $object->setResponseCode($data['response_code']); - } elseif (\array_key_exists('response_code', $data) && null === $data['response_code']) { - $object->setResponseCode(null); + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\RemainingBudgetedHour' === $data::class; } - return $object; - } + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\RemainingBudgetedHour(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('budget_by', $data) && null !== $data['budget_by']) { + $object->setBudgetBy($data['budget_by']); + unset($data['budget_by']); + } elseif (\array_key_exists('budget_by', $data) && null === $data['budget_by']) { + $object->setBudgetBy(null); + } + if (\array_key_exists('budget_is_monthly', $data) && null !== $data['budget_is_monthly']) { + $object->setBudgetIsMonthly($data['budget_is_monthly']); + unset($data['budget_is_monthly']); + } elseif (\array_key_exists('budget_is_monthly', $data) && null === $data['budget_is_monthly']) { + $object->setBudgetIsMonthly(null); + } + if (\array_key_exists('hours', $data) && null !== $data['hours']) { + $object->setHours($data['hours']); + unset($data['hours']); + } elseif (\array_key_exists('hours', $data) && null === $data['hours']) { + $object->setHours(null); + } + if (\array_key_exists('project_id', $data) && null !== $data['project_id']) { + $object->setProjectId($data['project_id']); + unset($data['project_id']); + } elseif (\array_key_exists('project_id', $data) && null === $data['project_id']) { + $object->setProjectId(null); + } + if (\array_key_exists('response_code', $data) && null !== $data['response_code']) { + $object->setResponseCode($data['response_code']); + unset($data['response_code']); + } elseif (\array_key_exists('response_code', $data) && null === $data['response_code']) { + $object->setResponseCode(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) - { - $data = []; - if (null !== $object->getBudgetBy()) { - $data['budget_by'] = $object->getBudgetBy(); - } - if (null !== $object->getBudgetIsMonthly()) { - $data['budget_is_monthly'] = $object->getBudgetIsMonthly(); + return $object; } - $data['hours'] = $object->getHours(); - $data['project_id'] = $object->getProjectId(); - if (null !== $object->getResponseCode()) { - $data['response_code'] = $object->getResponseCode(); + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('budgetBy') && null !== $object->getBudgetBy()) { + $data['budget_by'] = $object->getBudgetBy(); + } + if ($object->isInitialized('budgetIsMonthly') && null !== $object->getBudgetIsMonthly()) { + $data['budget_is_monthly'] = $object->getBudgetIsMonthly(); + } + $data['hours'] = $object->getHours(); + $data['project_id'] = $object->getProjectId(); + if ($object->isInitialized('responseCode') && null !== $object->getResponseCode()) { + $data['response_code'] = $object->getResponseCode(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\RemainingBudgetedHour' => false]; + } } } diff --git a/generated/Normalizer/RemainingBudgetedHoursNormalizer.php b/generated/Normalizer/RemainingBudgetedHoursNormalizer.php index 7a07658..f4c3604 100644 --- a/generated/Normalizer/RemainingBudgetedHoursNormalizer.php +++ b/generated/Normalizer/RemainingBudgetedHoursNormalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,69 +22,154 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class RemainingBudgetedHoursNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class RemainingBudgetedHoursNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\RemainingBudgetedHours' === $type; - } - - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\RemainingBudgetedHours' === \get_class($data); - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\RemainingBudgetedHours' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\RemainingBudgetedHours' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\RemainingBudgetedHours(); - 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 \JoliCode\Forecast\Api\Model\RemainingBudgetedHours(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('remaining_budgeted_hours', $data) && null !== $data['remaining_budgeted_hours']) { + $values = []; + foreach ($data['remaining_budgeted_hours'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Forecast\\Api\\Model\\RemainingBudgetedHour', 'json', $context); + } + $object->setRemainingBudgetedHours($values); + unset($data['remaining_budgeted_hours']); + } elseif (\array_key_exists('remaining_budgeted_hours', $data) && null === $data['remaining_budgeted_hours']) { + $object->setRemainingBudgetedHours(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('remaining_budgeted_hours', $data) && null !== $data['remaining_budgeted_hours']) { + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; $values = []; - foreach ($data['remaining_budgeted_hours'] as $value) { - $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Forecast\\Api\\Model\\RemainingBudgetedHour', 'json', $context); + foreach ($object->getRemainingBudgetedHours() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); } - $object->setRemainingBudgetedHours($values); - } elseif (\array_key_exists('remaining_budgeted_hours', $data) && null === $data['remaining_budgeted_hours']) { - $object->setRemainingBudgetedHours(null); + $data['remaining_budgeted_hours'] = $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 ['JoliCode\\Forecast\\Api\\Model\\RemainingBudgetedHours' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class RemainingBudgetedHoursNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - $values = []; - foreach ($object->getRemainingBudgetedHours() as $value) { - $values[] = $this->normalizer->normalize($value, 'json', $context); + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\RemainingBudgetedHours' === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\RemainingBudgetedHours' === $data::class; } - $data['remaining_budgeted_hours'] = $values; - return $data; + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\RemainingBudgetedHours(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('remaining_budgeted_hours', $data) && null !== $data['remaining_budgeted_hours']) { + $values = []; + foreach ($data['remaining_budgeted_hours'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Forecast\\Api\\Model\\RemainingBudgetedHour', 'json', $context); + } + $object->setRemainingBudgetedHours($values); + unset($data['remaining_budgeted_hours']); + } elseif (\array_key_exists('remaining_budgeted_hours', $data) && null === $data['remaining_budgeted_hours']) { + $object->setRemainingBudgetedHours(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + + return $object; + } + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $values = []; + foreach ($object->getRemainingBudgetedHours() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['remaining_budgeted_hours'] = $values; + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\RemainingBudgetedHours' => false]; + } } } diff --git a/generated/Normalizer/RepeatedAssignmentSetBodyNormalizer.php b/generated/Normalizer/RepeatedAssignmentSetBodyNormalizer.php index f9515b4..1d2328a 100644 --- a/generated/Normalizer/RepeatedAssignmentSetBodyNormalizer.php +++ b/generated/Normalizer/RepeatedAssignmentSetBodyNormalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,61 +22,138 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class RepeatedAssignmentSetBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class RepeatedAssignmentSetBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetBody' === $type; - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetBody' === \get_class($data); - } - - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetBody' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetBody' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\RepeatedAssignmentSetBody(); - 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 \JoliCode\Forecast\Api\Model\RepeatedAssignmentSetBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('repeated_assignment_set', $data) && null !== $data['repeated_assignment_set']) { + $object->setRepeatedAssignmentSet($this->denormalizer->denormalize($data['repeated_assignment_set'], 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetBodyRepeatedAssignmentSet', 'json', $context)); + unset($data['repeated_assignment_set']); + } elseif (\array_key_exists('repeated_assignment_set', $data) && null === $data['repeated_assignment_set']) { + $object->setRepeatedAssignmentSet(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('repeated_assignment_set', $data) && null !== $data['repeated_assignment_set']) { - $object->setRepeatedAssignmentSet($this->denormalizer->denormalize($data['repeated_assignment_set'], 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetBodyRepeatedAssignmentSet', 'json', $context)); - } elseif (\array_key_exists('repeated_assignment_set', $data) && null === $data['repeated_assignment_set']) { - $object->setRepeatedAssignmentSet(null); + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['repeated_assignment_set'] = $this->normalizer->normalize($object->getRepeatedAssignmentSet(), '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 ['JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetBody' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class RepeatedAssignmentSetBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - $data['repeated_assignment_set'] = $this->normalizer->normalize($object->getRepeatedAssignmentSet(), 'json', $context); + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - return $data; + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetBody' === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetBody' === $data::class; + } + + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\RepeatedAssignmentSetBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('repeated_assignment_set', $data) && null !== $data['repeated_assignment_set']) { + $object->setRepeatedAssignmentSet($this->denormalizer->denormalize($data['repeated_assignment_set'], 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetBodyRepeatedAssignmentSet', 'json', $context)); + unset($data['repeated_assignment_set']); + } elseif (\array_key_exists('repeated_assignment_set', $data) && null === $data['repeated_assignment_set']) { + $object->setRepeatedAssignmentSet(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['repeated_assignment_set'] = $this->normalizer->normalize($object->getRepeatedAssignmentSet(), 'json', $context); + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetBody' => false]; + } } } diff --git a/generated/Normalizer/RepeatedAssignmentSetBodyRepeatedAssignmentSetNormalizer.php b/generated/Normalizer/RepeatedAssignmentSetBodyRepeatedAssignmentSetNormalizer.php index f5fa1cb..fd812d4 100644 --- a/generated/Normalizer/RepeatedAssignmentSetBodyRepeatedAssignmentSetNormalizer.php +++ b/generated/Normalizer/RepeatedAssignmentSetBodyRepeatedAssignmentSetNormalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,67 +22,152 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class RepeatedAssignmentSetBodyRepeatedAssignmentSetNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class RepeatedAssignmentSetBodyRepeatedAssignmentSetNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetBodyRepeatedAssignmentSet' === $type; - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetBodyRepeatedAssignmentSet' === \get_class($data); - } - - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetBodyRepeatedAssignmentSet' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetBodyRepeatedAssignmentSet' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\RepeatedAssignmentSetBodyRepeatedAssignmentSet(); - 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 \JoliCode\Forecast\Api\Model\RepeatedAssignmentSetBodyRepeatedAssignmentSet(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('assignment', $data) && null !== $data['assignment']) { + $object->setAssignment($this->denormalizer->denormalize($data['assignment'], 'JoliCode\\Forecast\\Api\\Model\\Assignment', 'json', $context)); + unset($data['assignment']); + } elseif (\array_key_exists('assignment', $data) && null === $data['assignment']) { + $object->setAssignment(null); + } + if (\array_key_exists('weeks', $data) && null !== $data['weeks']) { + $object->setWeeks($data['weeks']); + unset($data['weeks']); + } elseif (\array_key_exists('weeks', $data) && null === $data['weeks']) { + $object->setWeeks(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('assignment', $data) && null !== $data['assignment']) { - $object->setAssignment($this->denormalizer->denormalize($data['assignment'], 'JoliCode\\Forecast\\Api\\Model\\Assignment', 'json', $context)); - } elseif (\array_key_exists('assignment', $data) && null === $data['assignment']) { - $object->setAssignment(null); - } - if (\array_key_exists('weeks', $data) && null !== $data['weeks']) { - $object->setWeeks($data['weeks']); - } elseif (\array_key_exists('weeks', $data) && null === $data['weeks']) { - $object->setWeeks(null); + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['assignment'] = $this->normalizer->normalize($object->getAssignment(), 'json', $context); + $data['weeks'] = $object->getWeeks(); + 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 ['JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetBodyRepeatedAssignmentSet' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class RepeatedAssignmentSetBodyRepeatedAssignmentSetNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - $data['assignment'] = $this->normalizer->normalize($object->getAssignment(), 'json', $context); - $data['weeks'] = $object->getWeeks(); + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetBodyRepeatedAssignmentSet' === $type; + } - return $data; + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetBodyRepeatedAssignmentSet' === $data::class; + } + + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\RepeatedAssignmentSetBodyRepeatedAssignmentSet(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('assignment', $data) && null !== $data['assignment']) { + $object->setAssignment($this->denormalizer->denormalize($data['assignment'], 'JoliCode\\Forecast\\Api\\Model\\Assignment', 'json', $context)); + unset($data['assignment']); + } elseif (\array_key_exists('assignment', $data) && null === $data['assignment']) { + $object->setAssignment(null); + } + if (\array_key_exists('weeks', $data) && null !== $data['weeks']) { + $object->setWeeks($data['weeks']); + unset($data['weeks']); + } elseif (\array_key_exists('weeks', $data) && null === $data['weeks']) { + $object->setWeeks(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['assignment'] = $this->normalizer->normalize($object->getAssignment(), 'json', $context); + $data['weeks'] = $object->getWeeks(); + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetBodyRepeatedAssignmentSet' => false]; + } } } diff --git a/generated/Normalizer/RepeatedAssignmentSetNormalizer.php b/generated/Normalizer/RepeatedAssignmentSetNormalizer.php index 53e16f2..3722e6c 100644 --- a/generated/Normalizer/RepeatedAssignmentSetNormalizer.php +++ b/generated/Normalizer/RepeatedAssignmentSetNormalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,89 +22,200 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class RepeatedAssignmentSetNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool - { - return 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSet' === $type; - } - - public function supportsNormalization($data, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class RepeatedAssignmentSetNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSet' === \get_class($data); - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSet' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSet' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\RepeatedAssignmentSet(); - 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 \JoliCode\Forecast\Api\Model\RepeatedAssignmentSet(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('assignment_ids', $data) && null !== $data['assignment_ids']) { + $values = []; + foreach ($data['assignment_ids'] as $value) { + $values[] = $value; + } + $object->setAssignmentIds($values); + unset($data['assignment_ids']); + } elseif (\array_key_exists('assignment_ids', $data) && null === $data['assignment_ids']) { + $object->setAssignmentIds(null); + } + if (\array_key_exists('first_start_date', $data) && null !== $data['first_start_date']) { + $object->setFirstStartDate(\DateTime::createFromFormat('Y-m-d', $data['first_start_date'])->setTime(0, 0, 0)); + unset($data['first_start_date']); + } elseif (\array_key_exists('first_start_date', $data) && null === $data['first_start_date']) { + $object->setFirstStartDate(null); + } + if (\array_key_exists('id', $data) && null !== $data['id']) { + $object->setId($data['id']); + unset($data['id']); + } elseif (\array_key_exists('id', $data) && null === $data['id']) { + $object->setId(null); + } + if (\array_key_exists('last_end_date', $data) && null !== $data['last_end_date']) { + $object->setLastEndDate(\DateTime::createFromFormat('Y-m-d', $data['last_end_date'])->setTime(0, 0, 0)); + unset($data['last_end_date']); + } elseif (\array_key_exists('last_end_date', $data) && null === $data['last_end_date']) { + $object->setLastEndDate(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('assignment_ids', $data) && null !== $data['assignment_ids']) { + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; $values = []; - foreach ($data['assignment_ids'] as $value) { + foreach ($object->getAssignmentIds() as $value) { $values[] = $value; } - $object->setAssignmentIds($values); - } elseif (\array_key_exists('assignment_ids', $data) && null === $data['assignment_ids']) { - $object->setAssignmentIds(null); + $data['assignment_ids'] = $values; + $data['first_start_date'] = $object->getFirstStartDate()->format('Y-m-d'); + if ($object->isInitialized('id') && null !== $object->getId()) { + $data['id'] = $object->getId(); + } + $data['last_end_date'] = $object->getLastEndDate()->format('Y-m-d'); + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } + + return $data; } - if (\array_key_exists('first_start_date', $data) && null !== $data['first_start_date']) { - $object->setFirstStartDate(\DateTime::createFromFormat('Y-m-d', $data['first_start_date'])->setTime(0, 0, 0)); - } elseif (\array_key_exists('first_start_date', $data) && null === $data['first_start_date']) { - $object->setFirstStartDate(null); + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSet' => false]; } - if (\array_key_exists('id', $data) && null !== $data['id']) { - $object->setId($data['id']); - } elseif (\array_key_exists('id', $data) && null === $data['id']) { - $object->setId(null); + } +} else { + class RepeatedAssignmentSetNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSet' === $type; } - if (\array_key_exists('last_end_date', $data) && null !== $data['last_end_date']) { - $object->setLastEndDate(\DateTime::createFromFormat('Y-m-d', $data['last_end_date'])->setTime(0, 0, 0)); - } elseif (\array_key_exists('last_end_date', $data) && null === $data['last_end_date']) { - $object->setLastEndDate(null); + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSet' === $data::class; } - return $object; - } + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\RepeatedAssignmentSet(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('assignment_ids', $data) && null !== $data['assignment_ids']) { + $values = []; + foreach ($data['assignment_ids'] as $value) { + $values[] = $value; + } + $object->setAssignmentIds($values); + unset($data['assignment_ids']); + } elseif (\array_key_exists('assignment_ids', $data) && null === $data['assignment_ids']) { + $object->setAssignmentIds(null); + } + if (\array_key_exists('first_start_date', $data) && null !== $data['first_start_date']) { + $object->setFirstStartDate(\DateTime::createFromFormat('Y-m-d', $data['first_start_date'])->setTime(0, 0, 0)); + unset($data['first_start_date']); + } elseif (\array_key_exists('first_start_date', $data) && null === $data['first_start_date']) { + $object->setFirstStartDate(null); + } + if (\array_key_exists('id', $data) && null !== $data['id']) { + $object->setId($data['id']); + unset($data['id']); + } elseif (\array_key_exists('id', $data) && null === $data['id']) { + $object->setId(null); + } + if (\array_key_exists('last_end_date', $data) && null !== $data['last_end_date']) { + $object->setLastEndDate(\DateTime::createFromFormat('Y-m-d', $data['last_end_date'])->setTime(0, 0, 0)); + unset($data['last_end_date']); + } elseif (\array_key_exists('last_end_date', $data) && null === $data['last_end_date']) { + $object->setLastEndDate(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) - { - $data = []; - $values = []; - foreach ($object->getAssignmentIds() as $value) { - $values[] = $value; + return $object; } - $data['assignment_ids'] = $values; - $data['first_start_date'] = $object->getFirstStartDate()->format('Y-m-d'); - if (null !== $object->getId()) { - $data['id'] = $object->getId(); + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $values = []; + foreach ($object->getAssignmentIds() as $value) { + $values[] = $value; + } + $data['assignment_ids'] = $values; + $data['first_start_date'] = $object->getFirstStartDate()->format('Y-m-d'); + if ($object->isInitialized('id') && null !== $object->getId()) { + $data['id'] = $object->getId(); + } + $data['last_end_date'] = $object->getLastEndDate()->format('Y-m-d'); + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } + + return $data; } - $data['last_end_date'] = $object->getLastEndDate()->format('Y-m-d'); - return $data; + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSet' => false]; + } } } diff --git a/generated/Normalizer/RepeatedAssignmentSetsIdGetResponse200Normalizer.php b/generated/Normalizer/RepeatedAssignmentSetsIdGetResponse200Normalizer.php index 972ea14..8dfe992 100644 --- a/generated/Normalizer/RepeatedAssignmentSetsIdGetResponse200Normalizer.php +++ b/generated/Normalizer/RepeatedAssignmentSetsIdGetResponse200Normalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,61 +22,138 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class RepeatedAssignmentSetsIdGetResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class RepeatedAssignmentSetsIdGetResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetsIdGetResponse200' === $type; - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetsIdGetResponse200' === \get_class($data); - } - - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetsIdGetResponse200' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetsIdGetResponse200' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\RepeatedAssignmentSetsIdGetResponse200(); - 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 \JoliCode\Forecast\Api\Model\RepeatedAssignmentSetsIdGetResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('repeated_assignment_set', $data) && null !== $data['repeated_assignment_set']) { + $object->setRepeatedAssignmentSet($this->denormalizer->denormalize($data['repeated_assignment_set'], 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSet', 'json', $context)); + unset($data['repeated_assignment_set']); + } elseif (\array_key_exists('repeated_assignment_set', $data) && null === $data['repeated_assignment_set']) { + $object->setRepeatedAssignmentSet(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('repeated_assignment_set', $data) && null !== $data['repeated_assignment_set']) { - $object->setRepeatedAssignmentSet($this->denormalizer->denormalize($data['repeated_assignment_set'], 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSet', 'json', $context)); - } elseif (\array_key_exists('repeated_assignment_set', $data) && null === $data['repeated_assignment_set']) { - $object->setRepeatedAssignmentSet(null); + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['repeated_assignment_set'] = $this->normalizer->normalize($object->getRepeatedAssignmentSet(), '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 ['JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetsIdGetResponse200' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class RepeatedAssignmentSetsIdGetResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - $data['repeated_assignment_set'] = $this->normalizer->normalize($object->getRepeatedAssignmentSet(), 'json', $context); + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - return $data; + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetsIdGetResponse200' === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetsIdGetResponse200' === $data::class; + } + + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\RepeatedAssignmentSetsIdGetResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('repeated_assignment_set', $data) && null !== $data['repeated_assignment_set']) { + $object->setRepeatedAssignmentSet($this->denormalizer->denormalize($data['repeated_assignment_set'], 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSet', 'json', $context)); + unset($data['repeated_assignment_set']); + } elseif (\array_key_exists('repeated_assignment_set', $data) && null === $data['repeated_assignment_set']) { + $object->setRepeatedAssignmentSet(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['repeated_assignment_set'] = $this->normalizer->normalize($object->getRepeatedAssignmentSet(), 'json', $context); + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetsIdGetResponse200' => false]; + } } } diff --git a/generated/Normalizer/RepeatedAssignmentSetsIdPutResponse200Normalizer.php b/generated/Normalizer/RepeatedAssignmentSetsIdPutResponse200Normalizer.php index b6ce625..6cb5c94 100644 --- a/generated/Normalizer/RepeatedAssignmentSetsIdPutResponse200Normalizer.php +++ b/generated/Normalizer/RepeatedAssignmentSetsIdPutResponse200Normalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,61 +22,138 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class RepeatedAssignmentSetsIdPutResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class RepeatedAssignmentSetsIdPutResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetsIdPutResponse200' === $type; - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetsIdPutResponse200' === \get_class($data); - } - - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetsIdPutResponse200' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetsIdPutResponse200' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\RepeatedAssignmentSetsIdPutResponse200(); - 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 \JoliCode\Forecast\Api\Model\RepeatedAssignmentSetsIdPutResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('repeated_assignment_set', $data) && null !== $data['repeated_assignment_set']) { + $object->setRepeatedAssignmentSet($this->denormalizer->denormalize($data['repeated_assignment_set'], 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSet', 'json', $context)); + unset($data['repeated_assignment_set']); + } elseif (\array_key_exists('repeated_assignment_set', $data) && null === $data['repeated_assignment_set']) { + $object->setRepeatedAssignmentSet(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('repeated_assignment_set', $data) && null !== $data['repeated_assignment_set']) { - $object->setRepeatedAssignmentSet($this->denormalizer->denormalize($data['repeated_assignment_set'], 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSet', 'json', $context)); - } elseif (\array_key_exists('repeated_assignment_set', $data) && null === $data['repeated_assignment_set']) { - $object->setRepeatedAssignmentSet(null); + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['repeated_assignment_set'] = $this->normalizer->normalize($object->getRepeatedAssignmentSet(), '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 ['JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetsIdPutResponse200' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class RepeatedAssignmentSetsIdPutResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - $data['repeated_assignment_set'] = $this->normalizer->normalize($object->getRepeatedAssignmentSet(), 'json', $context); + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - return $data; + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetsIdPutResponse200' === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetsIdPutResponse200' === $data::class; + } + + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\RepeatedAssignmentSetsIdPutResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('repeated_assignment_set', $data) && null !== $data['repeated_assignment_set']) { + $object->setRepeatedAssignmentSet($this->denormalizer->denormalize($data['repeated_assignment_set'], 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSet', 'json', $context)); + unset($data['repeated_assignment_set']); + } elseif (\array_key_exists('repeated_assignment_set', $data) && null === $data['repeated_assignment_set']) { + $object->setRepeatedAssignmentSet(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['repeated_assignment_set'] = $this->normalizer->normalize($object->getRepeatedAssignmentSet(), 'json', $context); + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetsIdPutResponse200' => false]; + } } } diff --git a/generated/Normalizer/RepeatedAssignmentSetsNormalizer.php b/generated/Normalizer/RepeatedAssignmentSetsNormalizer.php index f80cb96..df6df57 100644 --- a/generated/Normalizer/RepeatedAssignmentSetsNormalizer.php +++ b/generated/Normalizer/RepeatedAssignmentSetsNormalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,69 +22,154 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class RepeatedAssignmentSetsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class RepeatedAssignmentSetsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSets' === $type; - } - - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSets' === \get_class($data); - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSets' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSets' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\RepeatedAssignmentSets(); - 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 \JoliCode\Forecast\Api\Model\RepeatedAssignmentSets(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('repeated_assignment_sets', $data) && null !== $data['repeated_assignment_sets']) { + $values = []; + foreach ($data['repeated_assignment_sets'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSet', 'json', $context); + } + $object->setRepeatedAssignmentSets($values); + unset($data['repeated_assignment_sets']); + } elseif (\array_key_exists('repeated_assignment_sets', $data) && null === $data['repeated_assignment_sets']) { + $object->setRepeatedAssignmentSets(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('repeated_assignment_sets', $data) && null !== $data['repeated_assignment_sets']) { + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; $values = []; - foreach ($data['repeated_assignment_sets'] as $value) { - $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSet', 'json', $context); + foreach ($object->getRepeatedAssignmentSets() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); } - $object->setRepeatedAssignmentSets($values); - } elseif (\array_key_exists('repeated_assignment_sets', $data) && null === $data['repeated_assignment_sets']) { - $object->setRepeatedAssignmentSets(null); + $data['repeated_assignment_sets'] = $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 ['JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSets' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class RepeatedAssignmentSetsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - $values = []; - foreach ($object->getRepeatedAssignmentSets() as $value) { - $values[] = $this->normalizer->normalize($value, 'json', $context); + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSets' === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSets' === $data::class; } - $data['repeated_assignment_sets'] = $values; - return $data; + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\RepeatedAssignmentSets(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('repeated_assignment_sets', $data) && null !== $data['repeated_assignment_sets']) { + $values = []; + foreach ($data['repeated_assignment_sets'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSet', 'json', $context); + } + $object->setRepeatedAssignmentSets($values); + unset($data['repeated_assignment_sets']); + } elseif (\array_key_exists('repeated_assignment_sets', $data) && null === $data['repeated_assignment_sets']) { + $object->setRepeatedAssignmentSets(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + + return $object; + } + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $values = []; + foreach ($object->getRepeatedAssignmentSets() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['repeated_assignment_sets'] = $values; + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSets' => false]; + } } } diff --git a/generated/Normalizer/RepeatedAssignmentSetsPostResponse201Normalizer.php b/generated/Normalizer/RepeatedAssignmentSetsPostResponse201Normalizer.php index 5c4309e..fe87eb0 100644 --- a/generated/Normalizer/RepeatedAssignmentSetsPostResponse201Normalizer.php +++ b/generated/Normalizer/RepeatedAssignmentSetsPostResponse201Normalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,61 +22,138 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class RepeatedAssignmentSetsPostResponse201Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class RepeatedAssignmentSetsPostResponse201Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetsPostResponse201' === $type; - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetsPostResponse201' === \get_class($data); - } - - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetsPostResponse201' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetsPostResponse201' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\RepeatedAssignmentSetsPostResponse201(); - 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 \JoliCode\Forecast\Api\Model\RepeatedAssignmentSetsPostResponse201(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('repeated_assignment_set', $data) && null !== $data['repeated_assignment_set']) { + $object->setRepeatedAssignmentSet($this->denormalizer->denormalize($data['repeated_assignment_set'], 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSet', 'json', $context)); + unset($data['repeated_assignment_set']); + } elseif (\array_key_exists('repeated_assignment_set', $data) && null === $data['repeated_assignment_set']) { + $object->setRepeatedAssignmentSet(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('repeated_assignment_set', $data) && null !== $data['repeated_assignment_set']) { - $object->setRepeatedAssignmentSet($this->denormalizer->denormalize($data['repeated_assignment_set'], 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSet', 'json', $context)); - } elseif (\array_key_exists('repeated_assignment_set', $data) && null === $data['repeated_assignment_set']) { - $object->setRepeatedAssignmentSet(null); + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['repeated_assignment_set'] = $this->normalizer->normalize($object->getRepeatedAssignmentSet(), '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 ['JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetsPostResponse201' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class RepeatedAssignmentSetsPostResponse201Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - $data['repeated_assignment_set'] = $this->normalizer->normalize($object->getRepeatedAssignmentSet(), 'json', $context); + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - return $data; + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetsPostResponse201' === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetsPostResponse201' === $data::class; + } + + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\RepeatedAssignmentSetsPostResponse201(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('repeated_assignment_set', $data) && null !== $data['repeated_assignment_set']) { + $object->setRepeatedAssignmentSet($this->denormalizer->denormalize($data['repeated_assignment_set'], 'JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSet', 'json', $context)); + unset($data['repeated_assignment_set']); + } elseif (\array_key_exists('repeated_assignment_set', $data) && null === $data['repeated_assignment_set']) { + $object->setRepeatedAssignmentSet(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['repeated_assignment_set'] = $this->normalizer->normalize($object->getRepeatedAssignmentSet(), 'json', $context); + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\RepeatedAssignmentSetsPostResponse201' => false]; + } } } diff --git a/generated/Normalizer/RoleBodyNormalizer.php b/generated/Normalizer/RoleBodyNormalizer.php index 5ace8b5..85d9fbe 100644 --- a/generated/Normalizer/RoleBodyNormalizer.php +++ b/generated/Normalizer/RoleBodyNormalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,61 +22,138 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class RoleBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class RoleBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\RoleBody' === $type; - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\RoleBody' === \get_class($data); - } - - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\RoleBody' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\RoleBody' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\RoleBody(); - 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 \JoliCode\Forecast\Api\Model\RoleBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('role', $data) && null !== $data['role']) { + $object->setRole($this->denormalizer->denormalize($data['role'], 'JoliCode\\Forecast\\Api\\Model\\RoleBodyRole', 'json', $context)); + unset($data['role']); + } elseif (\array_key_exists('role', $data) && null === $data['role']) { + $object->setRole(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('role', $data) && null !== $data['role']) { - $object->setRole($this->denormalizer->denormalize($data['role'], 'JoliCode\\Forecast\\Api\\Model\\RoleBodyRole', 'json', $context)); - } elseif (\array_key_exists('role', $data) && null === $data['role']) { - $object->setRole(null); + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['role'] = $this->normalizer->normalize($object->getRole(), '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 ['JoliCode\\Forecast\\Api\\Model\\RoleBody' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class RoleBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - $data['role'] = $this->normalizer->normalize($object->getRole(), 'json', $context); + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - return $data; + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\RoleBody' === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\RoleBody' === $data::class; + } + + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\RoleBody(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('role', $data) && null !== $data['role']) { + $object->setRole($this->denormalizer->denormalize($data['role'], 'JoliCode\\Forecast\\Api\\Model\\RoleBodyRole', 'json', $context)); + unset($data['role']); + } elseif (\array_key_exists('role', $data) && null === $data['role']) { + $object->setRole(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['role'] = $this->normalizer->normalize($object->getRole(), 'json', $context); + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\RoleBody' => false]; + } } } diff --git a/generated/Normalizer/RoleBodyRoleNormalizer.php b/generated/Normalizer/RoleBodyRoleNormalizer.php index 7fbd81b..69b1187 100644 --- a/generated/Normalizer/RoleBodyRoleNormalizer.php +++ b/generated/Normalizer/RoleBodyRoleNormalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,75 +22,168 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class RoleBodyRoleNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool - { - return 'JoliCode\\Forecast\\Api\\Model\\RoleBodyRole' === $type; - } - - public function supportsNormalization($data, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class RoleBodyRoleNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\RoleBodyRole' === \get_class($data); - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\RoleBodyRole' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\RoleBodyRole' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\RoleBodyRole(); - 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 \JoliCode\Forecast\Api\Model\RoleBodyRole(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('name', $data) && null !== $data['name']) { + $object->setName($data['name']); + unset($data['name']); + } elseif (\array_key_exists('name', $data) && null === $data['name']) { + $object->setName(null); + } + if (\array_key_exists('person_ids', $data) && null !== $data['person_ids']) { + $values = []; + foreach ($data['person_ids'] as $value) { + $values[] = $value; + } + $object->setPersonIds($values); + unset($data['person_ids']); + } elseif (\array_key_exists('person_ids', $data) && null === $data['person_ids']) { + $object->setPersonIds(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('name', $data) && null !== $data['name']) { - $object->setName($data['name']); - } elseif (\array_key_exists('name', $data) && null === $data['name']) { - $object->setName(null); - } - if (\array_key_exists('person_ids', $data) && null !== $data['person_ids']) { + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['name'] = $object->getName(); $values = []; - foreach ($data['person_ids'] as $value) { + foreach ($object->getPersonIds() as $value) { $values[] = $value; } - $object->setPersonIds($values); - } elseif (\array_key_exists('person_ids', $data) && null === $data['person_ids']) { - $object->setPersonIds(null); + $data['person_ids'] = $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 ['JoliCode\\Forecast\\Api\\Model\\RoleBodyRole' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class RoleBodyRoleNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - $data['name'] = $object->getName(); - $values = []; - foreach ($object->getPersonIds() as $value) { - $values[] = $value; + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\RoleBodyRole' === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\RoleBodyRole' === $data::class; } - $data['person_ids'] = $values; - return $data; + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\RoleBodyRole(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('name', $data) && null !== $data['name']) { + $object->setName($data['name']); + unset($data['name']); + } elseif (\array_key_exists('name', $data) && null === $data['name']) { + $object->setName(null); + } + if (\array_key_exists('person_ids', $data) && null !== $data['person_ids']) { + $values = []; + foreach ($data['person_ids'] as $value) { + $values[] = $value; + } + $object->setPersonIds($values); + unset($data['person_ids']); + } elseif (\array_key_exists('person_ids', $data) && null === $data['person_ids']) { + $object->setPersonIds(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + + return $object; + } + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['name'] = $object->getName(); + $values = []; + foreach ($object->getPersonIds() as $value) { + $values[] = $value; + } + $data['person_ids'] = $values; + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\RoleBodyRole' => false]; + } } } diff --git a/generated/Normalizer/RoleNormalizer.php b/generated/Normalizer/RoleNormalizer.php index 88dbed1..7ceae11 100644 --- a/generated/Normalizer/RoleNormalizer.php +++ b/generated/Normalizer/RoleNormalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,109 +22,242 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class RoleNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class RoleNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\Role' === $type; - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\Role' === \get_class($data); - } - - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\Role' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\Role' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\Role(); - 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 \JoliCode\Forecast\Api\Model\Role(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('id', $data) && null !== $data['id']) { + $object->setId($data['id']); + unset($data['id']); + } elseif (\array_key_exists('id', $data) && null === $data['id']) { + $object->setId(null); + } + if (\array_key_exists('name', $data) && null !== $data['name']) { + $object->setName($data['name']); + unset($data['name']); + } elseif (\array_key_exists('name', $data) && null === $data['name']) { + $object->setName(null); + } + if (\array_key_exists('placeholder_ids', $data) && null !== $data['placeholder_ids']) { + $values = []; + foreach ($data['placeholder_ids'] as $value) { + $values[] = $value; + } + $object->setPlaceholderIds($values); + unset($data['placeholder_ids']); + } elseif (\array_key_exists('placeholder_ids', $data) && null === $data['placeholder_ids']) { + $object->setPlaceholderIds(null); + } + if (\array_key_exists('person_ids', $data) && null !== $data['person_ids']) { + $values_1 = []; + foreach ($data['person_ids'] as $value_1) { + $values_1[] = $value_1; + } + $object->setPersonIds($values_1); + unset($data['person_ids']); + } elseif (\array_key_exists('person_ids', $data) && null === $data['person_ids']) { + $object->setPersonIds(null); + } + if (\array_key_exists('harvest_role_id', $data) && null !== $data['harvest_role_id']) { + $object->setHarvestRoleId($data['harvest_role_id']); + unset($data['harvest_role_id']); + } elseif (\array_key_exists('harvest_role_id', $data) && null === $data['harvest_role_id']) { + $object->setHarvestRoleId(null); + } + foreach ($data as $key => $value_2) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_2; + } + } + return $object; } - if (\array_key_exists('id', $data) && null !== $data['id']) { - $object->setId($data['id']); - } elseif (\array_key_exists('id', $data) && null === $data['id']) { - $object->setId(null); - } - if (\array_key_exists('name', $data) && null !== $data['name']) { - $object->setName($data['name']); - } elseif (\array_key_exists('name', $data) && null === $data['name']) { - $object->setName(null); + + 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(); + } + $data['name'] = $object->getName(); + if ($object->isInitialized('placeholderIds') && null !== $object->getPlaceholderIds()) { + $values = []; + foreach ($object->getPlaceholderIds() as $value) { + $values[] = $value; + } + $data['placeholder_ids'] = $values; + } + if ($object->isInitialized('personIds') && null !== $object->getPersonIds()) { + $values_1 = []; + foreach ($object->getPersonIds() as $value_1) { + $values_1[] = $value_1; + } + $data['person_ids'] = $values_1; + } + if ($object->isInitialized('harvestRoleId') && null !== $object->getHarvestRoleId()) { + $data['harvest_role_id'] = $object->getHarvestRoleId(); + } + foreach ($object as $key => $value_2) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_2; + } + } + + return $data; } - if (\array_key_exists('placeholder_ids', $data) && null !== $data['placeholder_ids']) { - $values = []; - foreach ($data['placeholder_ids'] as $value) { - $values[] = $value; - } - $object->setPlaceholderIds($values); - } elseif (\array_key_exists('placeholder_ids', $data) && null === $data['placeholder_ids']) { - $object->setPlaceholderIds(null); + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\Role' => false]; } - if (\array_key_exists('person_ids', $data) && null !== $data['person_ids']) { - $values_1 = []; - foreach ($data['person_ids'] as $value_1) { - $values_1[] = $value_1; - } - $object->setPersonIds($values_1); - } elseif (\array_key_exists('person_ids', $data) && null === $data['person_ids']) { - $object->setPersonIds(null); + } +} else { + class RoleNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\Role' === $type; } - if (\array_key_exists('harvest_role_id', $data) && null !== $data['harvest_role_id']) { - $object->setHarvestRoleId($data['harvest_role_id']); - } elseif (\array_key_exists('harvest_role_id', $data) && null === $data['harvest_role_id']) { - $object->setHarvestRoleId(null); + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\Role' === $data::class; } - return $object; - } + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\Role(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('id', $data) && null !== $data['id']) { + $object->setId($data['id']); + unset($data['id']); + } elseif (\array_key_exists('id', $data) && null === $data['id']) { + $object->setId(null); + } + if (\array_key_exists('name', $data) && null !== $data['name']) { + $object->setName($data['name']); + unset($data['name']); + } elseif (\array_key_exists('name', $data) && null === $data['name']) { + $object->setName(null); + } + if (\array_key_exists('placeholder_ids', $data) && null !== $data['placeholder_ids']) { + $values = []; + foreach ($data['placeholder_ids'] as $value) { + $values[] = $value; + } + $object->setPlaceholderIds($values); + unset($data['placeholder_ids']); + } elseif (\array_key_exists('placeholder_ids', $data) && null === $data['placeholder_ids']) { + $object->setPlaceholderIds(null); + } + if (\array_key_exists('person_ids', $data) && null !== $data['person_ids']) { + $values_1 = []; + foreach ($data['person_ids'] as $value_1) { + $values_1[] = $value_1; + } + $object->setPersonIds($values_1); + unset($data['person_ids']); + } elseif (\array_key_exists('person_ids', $data) && null === $data['person_ids']) { + $object->setPersonIds(null); + } + if (\array_key_exists('harvest_role_id', $data) && null !== $data['harvest_role_id']) { + $object->setHarvestRoleId($data['harvest_role_id']); + unset($data['harvest_role_id']); + } elseif (\array_key_exists('harvest_role_id', $data) && null === $data['harvest_role_id']) { + $object->setHarvestRoleId(null); + } + foreach ($data as $key => $value_2) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_2; + } + } - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) - { - $data = []; - if (null !== $object->getId()) { - $data['id'] = $object->getId(); + return $object; } - $data['name'] = $object->getName(); - if (null !== $object->getPlaceholderIds()) { - $values = []; - foreach ($object->getPlaceholderIds() as $value) { - $values[] = $value; + + /** + * @param mixed|null $format + * + * @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(); } - $data['placeholder_ids'] = $values; - } - if (null !== $object->getPersonIds()) { - $values_1 = []; - foreach ($object->getPersonIds() as $value_1) { - $values_1[] = $value_1; + $data['name'] = $object->getName(); + if ($object->isInitialized('placeholderIds') && null !== $object->getPlaceholderIds()) { + $values = []; + foreach ($object->getPlaceholderIds() as $value) { + $values[] = $value; + } + $data['placeholder_ids'] = $values; } - $data['person_ids'] = $values_1; - } - if (null !== $object->getHarvestRoleId()) { - $data['harvest_role_id'] = $object->getHarvestRoleId(); + if ($object->isInitialized('personIds') && null !== $object->getPersonIds()) { + $values_1 = []; + foreach ($object->getPersonIds() as $value_1) { + $values_1[] = $value_1; + } + $data['person_ids'] = $values_1; + } + if ($object->isInitialized('harvestRoleId') && null !== $object->getHarvestRoleId()) { + $data['harvest_role_id'] = $object->getHarvestRoleId(); + } + foreach ($object as $key => $value_2) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_2; + } + } + + return $data; } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\Role' => false]; + } } } diff --git a/generated/Normalizer/RolesIdGetResponse200Normalizer.php b/generated/Normalizer/RolesIdGetResponse200Normalizer.php index 7205c3a..726d9f9 100644 --- a/generated/Normalizer/RolesIdGetResponse200Normalizer.php +++ b/generated/Normalizer/RolesIdGetResponse200Normalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,61 +22,138 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class RolesIdGetResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class RolesIdGetResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\RolesIdGetResponse200' === $type; - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\RolesIdGetResponse200' === \get_class($data); - } - - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\RolesIdGetResponse200' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\RolesIdGetResponse200' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\RolesIdGetResponse200(); - 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 \JoliCode\Forecast\Api\Model\RolesIdGetResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('role', $data) && null !== $data['role']) { + $object->setRole($this->denormalizer->denormalize($data['role'], 'JoliCode\\Forecast\\Api\\Model\\Role', 'json', $context)); + unset($data['role']); + } elseif (\array_key_exists('role', $data) && null === $data['role']) { + $object->setRole(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('role', $data) && null !== $data['role']) { - $object->setRole($this->denormalizer->denormalize($data['role'], 'JoliCode\\Forecast\\Api\\Model\\Role', 'json', $context)); - } elseif (\array_key_exists('role', $data) && null === $data['role']) { - $object->setRole(null); + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['role'] = $this->normalizer->normalize($object->getRole(), '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 ['JoliCode\\Forecast\\Api\\Model\\RolesIdGetResponse200' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class RolesIdGetResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - $data['role'] = $this->normalizer->normalize($object->getRole(), 'json', $context); + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - return $data; + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\RolesIdGetResponse200' === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\RolesIdGetResponse200' === $data::class; + } + + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\RolesIdGetResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('role', $data) && null !== $data['role']) { + $object->setRole($this->denormalizer->denormalize($data['role'], 'JoliCode\\Forecast\\Api\\Model\\Role', 'json', $context)); + unset($data['role']); + } elseif (\array_key_exists('role', $data) && null === $data['role']) { + $object->setRole(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['role'] = $this->normalizer->normalize($object->getRole(), 'json', $context); + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\RolesIdGetResponse200' => false]; + } } } diff --git a/generated/Normalizer/RolesIdPutResponse200Normalizer.php b/generated/Normalizer/RolesIdPutResponse200Normalizer.php index d29a996..d5bed32 100644 --- a/generated/Normalizer/RolesIdPutResponse200Normalizer.php +++ b/generated/Normalizer/RolesIdPutResponse200Normalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,61 +22,138 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class RolesIdPutResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class RolesIdPutResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\RolesIdPutResponse200' === $type; - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\RolesIdPutResponse200' === \get_class($data); - } - - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\RolesIdPutResponse200' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\RolesIdPutResponse200' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\RolesIdPutResponse200(); - 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 \JoliCode\Forecast\Api\Model\RolesIdPutResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('role', $data) && null !== $data['role']) { + $object->setRole($this->denormalizer->denormalize($data['role'], 'JoliCode\\Forecast\\Api\\Model\\Role', 'json', $context)); + unset($data['role']); + } elseif (\array_key_exists('role', $data) && null === $data['role']) { + $object->setRole(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('role', $data) && null !== $data['role']) { - $object->setRole($this->denormalizer->denormalize($data['role'], 'JoliCode\\Forecast\\Api\\Model\\Role', 'json', $context)); - } elseif (\array_key_exists('role', $data) && null === $data['role']) { - $object->setRole(null); + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['role'] = $this->normalizer->normalize($object->getRole(), '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 ['JoliCode\\Forecast\\Api\\Model\\RolesIdPutResponse200' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class RolesIdPutResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - $data['role'] = $this->normalizer->normalize($object->getRole(), 'json', $context); + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - return $data; + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\RolesIdPutResponse200' === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\RolesIdPutResponse200' === $data::class; + } + + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\RolesIdPutResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('role', $data) && null !== $data['role']) { + $object->setRole($this->denormalizer->denormalize($data['role'], 'JoliCode\\Forecast\\Api\\Model\\Role', 'json', $context)); + unset($data['role']); + } elseif (\array_key_exists('role', $data) && null === $data['role']) { + $object->setRole(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['role'] = $this->normalizer->normalize($object->getRole(), 'json', $context); + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\RolesIdPutResponse200' => false]; + } } } diff --git a/generated/Normalizer/RolesNormalizer.php b/generated/Normalizer/RolesNormalizer.php index acdd0d9..4ac8f7e 100644 --- a/generated/Normalizer/RolesNormalizer.php +++ b/generated/Normalizer/RolesNormalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,69 +22,154 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class RolesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class RolesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\Roles' === $type; - } - - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\Roles' === \get_class($data); - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\Roles' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\Roles' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\Roles(); - 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 \JoliCode\Forecast\Api\Model\Roles(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('roles', $data) && null !== $data['roles']) { + $values = []; + foreach ($data['roles'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Forecast\\Api\\Model\\Role', 'json', $context); + } + $object->setRoles($values); + unset($data['roles']); + } elseif (\array_key_exists('roles', $data) && null === $data['roles']) { + $object->setRoles(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('roles', $data) && null !== $data['roles']) { + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; $values = []; - foreach ($data['roles'] as $value) { - $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Forecast\\Api\\Model\\Role', 'json', $context); + foreach ($object->getRoles() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); } - $object->setRoles($values); - } elseif (\array_key_exists('roles', $data) && null === $data['roles']) { - $object->setRoles(null); + $data['roles'] = $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 ['JoliCode\\Forecast\\Api\\Model\\Roles' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class RolesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - $values = []; - foreach ($object->getRoles() as $value) { - $values[] = $this->normalizer->normalize($value, 'json', $context); + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\Roles' === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\Roles' === $data::class; } - $data['roles'] = $values; - return $data; + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\Roles(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('roles', $data) && null !== $data['roles']) { + $values = []; + foreach ($data['roles'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Forecast\\Api\\Model\\Role', 'json', $context); + } + $object->setRoles($values); + unset($data['roles']); + } elseif (\array_key_exists('roles', $data) && null === $data['roles']) { + $object->setRoles(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + + return $object; + } + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $values = []; + foreach ($object->getRoles() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['roles'] = $values; + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\Roles' => false]; + } } } diff --git a/generated/Normalizer/RolesPostResponse201Normalizer.php b/generated/Normalizer/RolesPostResponse201Normalizer.php index 93909e4..d4f5d1e 100644 --- a/generated/Normalizer/RolesPostResponse201Normalizer.php +++ b/generated/Normalizer/RolesPostResponse201Normalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,61 +22,138 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class RolesPostResponse201Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class RolesPostResponse201Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\RolesPostResponse201' === $type; - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\RolesPostResponse201' === \get_class($data); - } - - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\RolesPostResponse201' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\RolesPostResponse201' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\RolesPostResponse201(); - 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 \JoliCode\Forecast\Api\Model\RolesPostResponse201(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('role', $data) && null !== $data['role']) { + $object->setRole($this->denormalizer->denormalize($data['role'], 'JoliCode\\Forecast\\Api\\Model\\Role', 'json', $context)); + unset($data['role']); + } elseif (\array_key_exists('role', $data) && null === $data['role']) { + $object->setRole(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('role', $data) && null !== $data['role']) { - $object->setRole($this->denormalizer->denormalize($data['role'], 'JoliCode\\Forecast\\Api\\Model\\Role', 'json', $context)); - } elseif (\array_key_exists('role', $data) && null === $data['role']) { - $object->setRole(null); + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['role'] = $this->normalizer->normalize($object->getRole(), '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 ['JoliCode\\Forecast\\Api\\Model\\RolesPostResponse201' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class RolesPostResponse201Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - $data['role'] = $this->normalizer->normalize($object->getRole(), 'json', $context); + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - return $data; + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\RolesPostResponse201' === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\RolesPostResponse201' === $data::class; + } + + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\RolesPostResponse201(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('role', $data) && null !== $data['role']) { + $object->setRole($this->denormalizer->denormalize($data['role'], 'JoliCode\\Forecast\\Api\\Model\\Role', 'json', $context)); + unset($data['role']); + } elseif (\array_key_exists('role', $data) && null === $data['role']) { + $object->setRole(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['role'] = $this->normalizer->normalize($object->getRole(), 'json', $context); + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\RolesPostResponse201' => false]; + } } } diff --git a/generated/Normalizer/SubscriptionNormalizer.php b/generated/Normalizer/SubscriptionNormalizer.php index aa2892f..35c0688 100644 --- a/generated/Normalizer/SubscriptionNormalizer.php +++ b/generated/Normalizer/SubscriptionNormalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,61 +22,138 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class SubscriptionNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class SubscriptionNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\Subscription' === $type; - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\Subscription' === \get_class($data); - } - - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\Subscription' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\Subscription' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\Subscription(); - 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 \JoliCode\Forecast\Api\Model\Subscription(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('subscription', $data) && null !== $data['subscription']) { + $object->setSubscription($this->denormalizer->denormalize($data['subscription'], 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscription', 'json', $context)); + unset($data['subscription']); + } elseif (\array_key_exists('subscription', $data) && null === $data['subscription']) { + $object->setSubscription(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('subscription', $data) && null !== $data['subscription']) { - $object->setSubscription($this->denormalizer->denormalize($data['subscription'], 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscription', 'json', $context)); - } elseif (\array_key_exists('subscription', $data) && null === $data['subscription']) { - $object->setSubscription(null); + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['subscription'] = $this->normalizer->normalize($object->getSubscription(), '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 ['JoliCode\\Forecast\\Api\\Model\\Subscription' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class SubscriptionNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - $data['subscription'] = $this->normalizer->normalize($object->getSubscription(), 'json', $context); + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - return $data; + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\Subscription' === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\Subscription' === $data::class; + } + + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\Subscription(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('subscription', $data) && null !== $data['subscription']) { + $object->setSubscription($this->denormalizer->denormalize($data['subscription'], 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscription', 'json', $context)); + unset($data['subscription']); + } elseif (\array_key_exists('subscription', $data) && null === $data['subscription']) { + $object->setSubscription(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['subscription'] = $this->normalizer->normalize($object->getSubscription(), 'json', $context); + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\Subscription' => false]; + } } } diff --git a/generated/Normalizer/SubscriptionSubscriptionAddressNormalizer.php b/generated/Normalizer/SubscriptionSubscriptionAddressNormalizer.php index b59ab25..cab872a 100644 --- a/generated/Normalizer/SubscriptionSubscriptionAddressNormalizer.php +++ b/generated/Normalizer/SubscriptionSubscriptionAddressNormalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,103 +22,232 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class SubscriptionSubscriptionAddressNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class SubscriptionSubscriptionAddressNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionAddress' === $type; - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionAddress' === \get_class($data); - } - - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionAddress' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionAddress' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\SubscriptionSubscriptionAddress(); - 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 \JoliCode\Forecast\Api\Model\SubscriptionSubscriptionAddress(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('line_1', $data) && null !== $data['line_1']) { + $object->setLine1($data['line_1']); + unset($data['line_1']); + } elseif (\array_key_exists('line_1', $data) && null === $data['line_1']) { + $object->setLine1(null); + } + if (\array_key_exists('line_2', $data) && null !== $data['line_2']) { + $object->setLine2($data['line_2']); + unset($data['line_2']); + } elseif (\array_key_exists('line_2', $data) && null === $data['line_2']) { + $object->setLine2(null); + } + if (\array_key_exists('city', $data) && null !== $data['city']) { + $object->setCity($data['city']); + unset($data['city']); + } elseif (\array_key_exists('city', $data) && null === $data['city']) { + $object->setCity(null); + } + if (\array_key_exists('state', $data) && null !== $data['state']) { + $object->setState($data['state']); + unset($data['state']); + } elseif (\array_key_exists('state', $data) && null === $data['state']) { + $object->setState(null); + } + if (\array_key_exists('postal_code', $data) && null !== $data['postal_code']) { + $object->setPostalCode($data['postal_code']); + unset($data['postal_code']); + } elseif (\array_key_exists('postal_code', $data) && null === $data['postal_code']) { + $object->setPostalCode(null); + } + if (\array_key_exists('country', $data) && null !== $data['country']) { + $object->setCountry($data['country']); + unset($data['country']); + } elseif (\array_key_exists('country', $data) && null === $data['country']) { + $object->setCountry(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('line_1', $data) && null !== $data['line_1']) { - $object->setLine1($data['line_1']); - } elseif (\array_key_exists('line_1', $data) && null === $data['line_1']) { - $object->setLine1(null); - } - if (\array_key_exists('line_2', $data) && null !== $data['line_2']) { - $object->setLine2($data['line_2']); - } elseif (\array_key_exists('line_2', $data) && null === $data['line_2']) { - $object->setLine2(null); - } - if (\array_key_exists('city', $data) && null !== $data['city']) { - $object->setCity($data['city']); - } elseif (\array_key_exists('city', $data) && null === $data['city']) { - $object->setCity(null); - } - if (\array_key_exists('state', $data) && null !== $data['state']) { - $object->setState($data['state']); - } elseif (\array_key_exists('state', $data) && null === $data['state']) { - $object->setState(null); - } - if (\array_key_exists('postal_code', $data) && null !== $data['postal_code']) { - $object->setPostalCode($data['postal_code']); - } elseif (\array_key_exists('postal_code', $data) && null === $data['postal_code']) { - $object->setPostalCode(null); - } - if (\array_key_exists('country', $data) && null !== $data['country']) { - $object->setCountry($data['country']); - } elseif (\array_key_exists('country', $data) && null === $data['country']) { - $object->setCountry(null); - } - return $object; - } + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('line1') && null !== $object->getLine1()) { + $data['line_1'] = $object->getLine1(); + } + if ($object->isInitialized('line2') && null !== $object->getLine2()) { + $data['line_2'] = $object->getLine2(); + } + if ($object->isInitialized('city') && null !== $object->getCity()) { + $data['city'] = $object->getCity(); + } + if ($object->isInitialized('state') && null !== $object->getState()) { + $data['state'] = $object->getState(); + } + if ($object->isInitialized('postalCode') && null !== $object->getPostalCode()) { + $data['postal_code'] = $object->getPostalCode(); + } + if ($object->isInitialized('country') && null !== $object->getCountry()) { + $data['country'] = $object->getCountry(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) - { - $data = []; - if (null !== $object->getLine1()) { - $data['line_1'] = $object->getLine1(); + return $data; } - if (null !== $object->getLine2()) { - $data['line_2'] = $object->getLine2(); + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionAddress' => false]; } - if (null !== $object->getCity()) { - $data['city'] = $object->getCity(); + } +} else { + class SubscriptionSubscriptionAddressNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionAddress' === $type; } - if (null !== $object->getState()) { - $data['state'] = $object->getState(); + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionAddress' === $data::class; } - if (null !== $object->getPostalCode()) { - $data['postal_code'] = $object->getPostalCode(); + + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\SubscriptionSubscriptionAddress(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('line_1', $data) && null !== $data['line_1']) { + $object->setLine1($data['line_1']); + unset($data['line_1']); + } elseif (\array_key_exists('line_1', $data) && null === $data['line_1']) { + $object->setLine1(null); + } + if (\array_key_exists('line_2', $data) && null !== $data['line_2']) { + $object->setLine2($data['line_2']); + unset($data['line_2']); + } elseif (\array_key_exists('line_2', $data) && null === $data['line_2']) { + $object->setLine2(null); + } + if (\array_key_exists('city', $data) && null !== $data['city']) { + $object->setCity($data['city']); + unset($data['city']); + } elseif (\array_key_exists('city', $data) && null === $data['city']) { + $object->setCity(null); + } + if (\array_key_exists('state', $data) && null !== $data['state']) { + $object->setState($data['state']); + unset($data['state']); + } elseif (\array_key_exists('state', $data) && null === $data['state']) { + $object->setState(null); + } + if (\array_key_exists('postal_code', $data) && null !== $data['postal_code']) { + $object->setPostalCode($data['postal_code']); + unset($data['postal_code']); + } elseif (\array_key_exists('postal_code', $data) && null === $data['postal_code']) { + $object->setPostalCode(null); + } + if (\array_key_exists('country', $data) && null !== $data['country']) { + $object->setCountry($data['country']); + unset($data['country']); + } elseif (\array_key_exists('country', $data) && null === $data['country']) { + $object->setCountry(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; } - if (null !== $object->getCountry()) { - $data['country'] = $object->getCountry(); + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('line1') && null !== $object->getLine1()) { + $data['line_1'] = $object->getLine1(); + } + if ($object->isInitialized('line2') && null !== $object->getLine2()) { + $data['line_2'] = $object->getLine2(); + } + if ($object->isInitialized('city') && null !== $object->getCity()) { + $data['city'] = $object->getCity(); + } + if ($object->isInitialized('state') && null !== $object->getState()) { + $data['state'] = $object->getState(); + } + if ($object->isInitialized('postalCode') && null !== $object->getPostalCode()) { + $data['postal_code'] = $object->getPostalCode(); + } + if ($object->isInitialized('country') && null !== $object->getCountry()) { + $data['country'] = $object->getCountry(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionAddress' => false]; + } } } diff --git a/generated/Normalizer/SubscriptionSubscriptionCardNormalizer.php b/generated/Normalizer/SubscriptionSubscriptionCardNormalizer.php index 6d0bc29..0dcdf98 100644 --- a/generated/Normalizer/SubscriptionSubscriptionCardNormalizer.php +++ b/generated/Normalizer/SubscriptionSubscriptionCardNormalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,87 +22,196 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class SubscriptionSubscriptionCardNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool - { - return 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionCard' === $type; - } - - public function supportsNormalization($data, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class SubscriptionSubscriptionCardNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionCard' === \get_class($data); - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionCard' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionCard' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\SubscriptionSubscriptionCard(); - 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 \JoliCode\Forecast\Api\Model\SubscriptionSubscriptionCard(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('brand', $data) && null !== $data['brand']) { + $object->setBrand($data['brand']); + unset($data['brand']); + } elseif (\array_key_exists('brand', $data) && null === $data['brand']) { + $object->setBrand(null); + } + if (\array_key_exists('last_four', $data) && null !== $data['last_four']) { + $object->setLastFour($data['last_four']); + unset($data['last_four']); + } elseif (\array_key_exists('last_four', $data) && null === $data['last_four']) { + $object->setLastFour(null); + } + if (\array_key_exists('expiry_month', $data) && null !== $data['expiry_month']) { + $object->setExpiryMonth($data['expiry_month']); + unset($data['expiry_month']); + } elseif (\array_key_exists('expiry_month', $data) && null === $data['expiry_month']) { + $object->setExpiryMonth(null); + } + if (\array_key_exists('expiry_year', $data) && null !== $data['expiry_year']) { + $object->setExpiryYear($data['expiry_year']); + unset($data['expiry_year']); + } elseif (\array_key_exists('expiry_year', $data) && null === $data['expiry_year']) { + $object->setExpiryYear(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('brand', $data) && null !== $data['brand']) { - $object->setBrand($data['brand']); - } elseif (\array_key_exists('brand', $data) && null === $data['brand']) { - $object->setBrand(null); - } - if (\array_key_exists('last_four', $data) && null !== $data['last_four']) { - $object->setLastFour($data['last_four']); - } elseif (\array_key_exists('last_four', $data) && null === $data['last_four']) { - $object->setLastFour(null); - } - if (\array_key_exists('expiry_month', $data) && null !== $data['expiry_month']) { - $object->setExpiryMonth($data['expiry_month']); - } elseif (\array_key_exists('expiry_month', $data) && null === $data['expiry_month']) { - $object->setExpiryMonth(null); - } - if (\array_key_exists('expiry_year', $data) && null !== $data['expiry_year']) { - $object->setExpiryYear($data['expiry_year']); - } elseif (\array_key_exists('expiry_year', $data) && null === $data['expiry_year']) { - $object->setExpiryYear(null); + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('brand') && null !== $object->getBrand()) { + $data['brand'] = $object->getBrand(); + } + if ($object->isInitialized('lastFour') && null !== $object->getLastFour()) { + $data['last_four'] = $object->getLastFour(); + } + if ($object->isInitialized('expiryMonth') && null !== $object->getExpiryMonth()) { + $data['expiry_month'] = $object->getExpiryMonth(); + } + if ($object->isInitialized('expiryYear') && null !== $object->getExpiryYear()) { + $data['expiry_year'] = $object->getExpiryYear(); + } + 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 ['JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionCard' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class SubscriptionSubscriptionCardNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if (null !== $object->getBrand()) { - $data['brand'] = $object->getBrand(); + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionCard' === $type; } - if (null !== $object->getLastFour()) { - $data['last_four'] = $object->getLastFour(); + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionCard' === $data::class; } - if (null !== $object->getExpiryMonth()) { - $data['expiry_month'] = $object->getExpiryMonth(); + + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\SubscriptionSubscriptionCard(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('brand', $data) && null !== $data['brand']) { + $object->setBrand($data['brand']); + unset($data['brand']); + } elseif (\array_key_exists('brand', $data) && null === $data['brand']) { + $object->setBrand(null); + } + if (\array_key_exists('last_four', $data) && null !== $data['last_four']) { + $object->setLastFour($data['last_four']); + unset($data['last_four']); + } elseif (\array_key_exists('last_four', $data) && null === $data['last_four']) { + $object->setLastFour(null); + } + if (\array_key_exists('expiry_month', $data) && null !== $data['expiry_month']) { + $object->setExpiryMonth($data['expiry_month']); + unset($data['expiry_month']); + } elseif (\array_key_exists('expiry_month', $data) && null === $data['expiry_month']) { + $object->setExpiryMonth(null); + } + if (\array_key_exists('expiry_year', $data) && null !== $data['expiry_year']) { + $object->setExpiryYear($data['expiry_year']); + unset($data['expiry_year']); + } elseif (\array_key_exists('expiry_year', $data) && null === $data['expiry_year']) { + $object->setExpiryYear(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; } - if (null !== $object->getExpiryYear()) { - $data['expiry_year'] = $object->getExpiryYear(); + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('brand') && null !== $object->getBrand()) { + $data['brand'] = $object->getBrand(); + } + if ($object->isInitialized('lastFour') && null !== $object->getLastFour()) { + $data['last_four'] = $object->getLastFour(); + } + if ($object->isInitialized('expiryMonth') && null !== $object->getExpiryMonth()) { + $data['expiry_month'] = $object->getExpiryMonth(); + } + if ($object->isInitialized('expiryYear') && null !== $object->getExpiryYear()) { + $data['expiry_year'] = $object->getExpiryYear(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionCard' => false]; + } } } diff --git a/generated/Normalizer/SubscriptionSubscriptionDiscountsNormalizer.php b/generated/Normalizer/SubscriptionSubscriptionDiscountsNormalizer.php index 0e3bdf6..d91a222 100644 --- a/generated/Normalizer/SubscriptionSubscriptionDiscountsNormalizer.php +++ b/generated/Normalizer/SubscriptionSubscriptionDiscountsNormalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,71 +22,160 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class SubscriptionSubscriptionDiscountsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool - { - return 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionDiscounts' === $type; - } - - public function supportsNormalization($data, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class SubscriptionSubscriptionDiscountsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionDiscounts' === \get_class($data); - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionDiscounts' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionDiscounts' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\SubscriptionSubscriptionDiscounts(); - 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 \JoliCode\Forecast\Api\Model\SubscriptionSubscriptionDiscounts(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('monthly_percentage', $data) && null !== $data['monthly_percentage']) { + $object->setMonthlyPercentage($data['monthly_percentage']); + unset($data['monthly_percentage']); + } elseif (\array_key_exists('monthly_percentage', $data) && null === $data['monthly_percentage']) { + $object->setMonthlyPercentage(null); + } + if (\array_key_exists('yearly_percentage', $data) && null !== $data['yearly_percentage']) { + $object->setYearlyPercentage($data['yearly_percentage']); + unset($data['yearly_percentage']); + } elseif (\array_key_exists('yearly_percentage', $data) && null === $data['yearly_percentage']) { + $object->setYearlyPercentage(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('monthly_percentage', $data) && null !== $data['monthly_percentage']) { - $object->setMonthlyPercentage($data['monthly_percentage']); - } elseif (\array_key_exists('monthly_percentage', $data) && null === $data['monthly_percentage']) { - $object->setMonthlyPercentage(null); - } - if (\array_key_exists('yearly_percentage', $data) && null !== $data['yearly_percentage']) { - $object->setYearlyPercentage($data['yearly_percentage']); - } elseif (\array_key_exists('yearly_percentage', $data) && null === $data['yearly_percentage']) { - $object->setYearlyPercentage(null); + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('monthlyPercentage') && null !== $object->getMonthlyPercentage()) { + $data['monthly_percentage'] = $object->getMonthlyPercentage(); + } + if ($object->isInitialized('yearlyPercentage') && null !== $object->getYearlyPercentage()) { + $data['yearly_percentage'] = $object->getYearlyPercentage(); + } + 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 ['JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionDiscounts' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class SubscriptionSubscriptionDiscountsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if (null !== $object->getMonthlyPercentage()) { - $data['monthly_percentage'] = $object->getMonthlyPercentage(); + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionDiscounts' === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionDiscounts' === $data::class; + } + + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\SubscriptionSubscriptionDiscounts(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('monthly_percentage', $data) && null !== $data['monthly_percentage']) { + $object->setMonthlyPercentage($data['monthly_percentage']); + unset($data['monthly_percentage']); + } elseif (\array_key_exists('monthly_percentage', $data) && null === $data['monthly_percentage']) { + $object->setMonthlyPercentage(null); + } + if (\array_key_exists('yearly_percentage', $data) && null !== $data['yearly_percentage']) { + $object->setYearlyPercentage($data['yearly_percentage']); + unset($data['yearly_percentage']); + } elseif (\array_key_exists('yearly_percentage', $data) && null === $data['yearly_percentage']) { + $object->setYearlyPercentage(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; } - if (null !== $object->getYearlyPercentage()) { - $data['yearly_percentage'] = $object->getYearlyPercentage(); + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('monthlyPercentage') && null !== $object->getMonthlyPercentage()) { + $data['monthly_percentage'] = $object->getMonthlyPercentage(); + } + if ($object->isInitialized('yearlyPercentage') && null !== $object->getYearlyPercentage()) { + $data['yearly_percentage'] = $object->getYearlyPercentage(); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionDiscounts' => false]; + } } } diff --git a/generated/Normalizer/SubscriptionSubscriptionNormalizer.php b/generated/Normalizer/SubscriptionSubscriptionNormalizer.php index ae60ca9..8a8c5e7 100644 --- a/generated/Normalizer/SubscriptionSubscriptionNormalizer.php +++ b/generated/Normalizer/SubscriptionSubscriptionNormalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,167 +22,376 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class SubscriptionSubscriptionNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool - { - return 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscription' === $type; - } - - public function supportsNormalization($data, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class SubscriptionSubscriptionNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscription' === \get_class($data); - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscription' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscription' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\SubscriptionSubscription(); - 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 \JoliCode\Forecast\Api\Model\SubscriptionSubscription(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('id', $data) && null !== $data['id']) { + $object->setId($data['id']); + unset($data['id']); + } elseif (\array_key_exists('id', $data) && null === $data['id']) { + $object->setId(null); + } + if (\array_key_exists('next_billing_date', $data) && null !== $data['next_billing_date']) { + $object->setNextBillingDate(\DateTime::createFromFormat('Y-m-d', $data['next_billing_date'])->setTime(0, 0, 0)); + unset($data['next_billing_date']); + } elseif (\array_key_exists('next_billing_date', $data) && null === $data['next_billing_date']) { + $object->setNextBillingDate(null); + } + if (\array_key_exists('days_until_next_billing_date', $data) && null !== $data['days_until_next_billing_date']) { + $object->setDaysUntilNextBillingDate($data['days_until_next_billing_date']); + unset($data['days_until_next_billing_date']); + } elseif (\array_key_exists('days_until_next_billing_date', $data) && null === $data['days_until_next_billing_date']) { + $object->setDaysUntilNextBillingDate(null); + } + if (\array_key_exists('amount', $data) && null !== $data['amount']) { + $object->setAmount($data['amount']); + unset($data['amount']); + } elseif (\array_key_exists('amount', $data) && null === $data['amount']) { + $object->setAmount(null); + } + if (\array_key_exists('amount_per_person', $data) && null !== $data['amount_per_person']) { + $object->setAmountPerPerson($data['amount_per_person']); + unset($data['amount_per_person']); + } elseif (\array_key_exists('amount_per_person', $data) && null === $data['amount_per_person']) { + $object->setAmountPerPerson(null); + } + if (\array_key_exists('receipt_recipient', $data) && null !== $data['receipt_recipient']) { + $object->setReceiptRecipient($data['receipt_recipient']); + unset($data['receipt_recipient']); + } elseif (\array_key_exists('receipt_recipient', $data) && null === $data['receipt_recipient']) { + $object->setReceiptRecipient(null); + } + if (\array_key_exists('status', $data) && null !== $data['status']) { + $object->setStatus($data['status']); + unset($data['status']); + } elseif (\array_key_exists('status', $data) && null === $data['status']) { + $object->setStatus(null); + } + if (\array_key_exists('purchased_people', $data) && null !== $data['purchased_people']) { + $object->setPurchasedPeople($data['purchased_people']); + unset($data['purchased_people']); + } elseif (\array_key_exists('purchased_people', $data) && null === $data['purchased_people']) { + $object->setPurchasedPeople(null); + } + if (\array_key_exists('interval', $data) && null !== $data['interval']) { + $object->setInterval($data['interval']); + unset($data['interval']); + } elseif (\array_key_exists('interval', $data) && null === $data['interval']) { + $object->setInterval(null); + } + if (\array_key_exists('paid_by_invoice', $data) && null !== $data['paid_by_invoice']) { + $object->setPaidByInvoice($data['paid_by_invoice']); + unset($data['paid_by_invoice']); + } elseif (\array_key_exists('paid_by_invoice', $data) && null === $data['paid_by_invoice']) { + $object->setPaidByInvoice(null); + } + if (\array_key_exists('discounts', $data) && null !== $data['discounts']) { + $object->setDiscounts($this->denormalizer->denormalize($data['discounts'], 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionDiscounts', 'json', $context)); + unset($data['discounts']); + } elseif (\array_key_exists('discounts', $data) && null === $data['discounts']) { + $object->setDiscounts(null); + } + if (\array_key_exists('placeholder_limit', $data) && null !== $data['placeholder_limit']) { + $object->setPlaceholderLimit($data['placeholder_limit']); + unset($data['placeholder_limit']); + } elseif (\array_key_exists('placeholder_limit', $data) && null === $data['placeholder_limit']) { + $object->setPlaceholderLimit(null); + } + if (\array_key_exists('card', $data) && null !== $data['card']) { + $object->setCard($this->denormalizer->denormalize($data['card'], 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionCard', 'json', $context)); + unset($data['card']); + } elseif (\array_key_exists('card', $data) && null === $data['card']) { + $object->setCard(null); + } + if (\array_key_exists('address', $data) && null !== $data['address']) { + $object->setAddress($this->denormalizer->denormalize($data['address'], 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionAddress', 'json', $context)); + unset($data['address']); + } elseif (\array_key_exists('address', $data) && null === $data['address']) { + $object->setAddress(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('id', $data) && null !== $data['id']) { - $object->setId($data['id']); - } elseif (\array_key_exists('id', $data) && null === $data['id']) { - $object->setId(null); - } - if (\array_key_exists('next_billing_date', $data) && null !== $data['next_billing_date']) { - $object->setNextBillingDate(\DateTime::createFromFormat('Y-m-d', $data['next_billing_date'])->setTime(0, 0, 0)); - } elseif (\array_key_exists('next_billing_date', $data) && null === $data['next_billing_date']) { - $object->setNextBillingDate(null); - } - if (\array_key_exists('days_until_next_billing_date', $data) && null !== $data['days_until_next_billing_date']) { - $object->setDaysUntilNextBillingDate($data['days_until_next_billing_date']); - } elseif (\array_key_exists('days_until_next_billing_date', $data) && null === $data['days_until_next_billing_date']) { - $object->setDaysUntilNextBillingDate(null); - } - if (\array_key_exists('amount', $data) && null !== $data['amount']) { - $object->setAmount($data['amount']); - } elseif (\array_key_exists('amount', $data) && null === $data['amount']) { - $object->setAmount(null); - } - if (\array_key_exists('amount_per_person', $data) && null !== $data['amount_per_person']) { - $object->setAmountPerPerson($data['amount_per_person']); - } elseif (\array_key_exists('amount_per_person', $data) && null === $data['amount_per_person']) { - $object->setAmountPerPerson(null); - } - if (\array_key_exists('receipt_recipient', $data) && null !== $data['receipt_recipient']) { - $object->setReceiptRecipient($data['receipt_recipient']); - } elseif (\array_key_exists('receipt_recipient', $data) && null === $data['receipt_recipient']) { - $object->setReceiptRecipient(null); - } - if (\array_key_exists('status', $data) && null !== $data['status']) { - $object->setStatus($data['status']); - } elseif (\array_key_exists('status', $data) && null === $data['status']) { - $object->setStatus(null); - } - if (\array_key_exists('purchased_people', $data) && null !== $data['purchased_people']) { - $object->setPurchasedPeople($data['purchased_people']); - } elseif (\array_key_exists('purchased_people', $data) && null === $data['purchased_people']) { - $object->setPurchasedPeople(null); - } - if (\array_key_exists('interval', $data) && null !== $data['interval']) { - $object->setInterval($data['interval']); - } elseif (\array_key_exists('interval', $data) && null === $data['interval']) { - $object->setInterval(null); - } - if (\array_key_exists('paid_by_invoice', $data) && null !== $data['paid_by_invoice']) { - $object->setPaidByInvoice($data['paid_by_invoice']); - } elseif (\array_key_exists('paid_by_invoice', $data) && null === $data['paid_by_invoice']) { - $object->setPaidByInvoice(null); - } - if (\array_key_exists('discounts', $data) && null !== $data['discounts']) { - $object->setDiscounts($this->denormalizer->denormalize($data['discounts'], 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionDiscounts', 'json', $context)); - } elseif (\array_key_exists('discounts', $data) && null === $data['discounts']) { - $object->setDiscounts(null); - } - if (\array_key_exists('placeholder_limit', $data) && null !== $data['placeholder_limit']) { - $object->setPlaceholderLimit($data['placeholder_limit']); - } elseif (\array_key_exists('placeholder_limit', $data) && null === $data['placeholder_limit']) { - $object->setPlaceholderLimit(null); - } - if (\array_key_exists('card', $data) && null !== $data['card']) { - $object->setCard($this->denormalizer->denormalize($data['card'], 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionCard', 'json', $context)); - } elseif (\array_key_exists('card', $data) && null === $data['card']) { - $object->setCard(null); - } - if (\array_key_exists('address', $data) && null !== $data['address']) { - $object->setAddress($this->denormalizer->denormalize($data['address'], 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionAddress', 'json', $context)); - } elseif (\array_key_exists('address', $data) && null === $data['address']) { - $object->setAddress(null); - } - return $object; - } + 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(); + } + if ($object->isInitialized('nextBillingDate') && null !== $object->getNextBillingDate()) { + $data['next_billing_date'] = $object->getNextBillingDate()->format('Y-m-d'); + } + if ($object->isInitialized('daysUntilNextBillingDate') && null !== $object->getDaysUntilNextBillingDate()) { + $data['days_until_next_billing_date'] = $object->getDaysUntilNextBillingDate(); + } + if ($object->isInitialized('amount') && null !== $object->getAmount()) { + $data['amount'] = $object->getAmount(); + } + if ($object->isInitialized('amountPerPerson') && null !== $object->getAmountPerPerson()) { + $data['amount_per_person'] = $object->getAmountPerPerson(); + } + if ($object->isInitialized('receiptRecipient') && null !== $object->getReceiptRecipient()) { + $data['receipt_recipient'] = $object->getReceiptRecipient(); + } + if ($object->isInitialized('status') && null !== $object->getStatus()) { + $data['status'] = $object->getStatus(); + } + if ($object->isInitialized('purchasedPeople') && null !== $object->getPurchasedPeople()) { + $data['purchased_people'] = $object->getPurchasedPeople(); + } + if ($object->isInitialized('interval') && null !== $object->getInterval()) { + $data['interval'] = $object->getInterval(); + } + if ($object->isInitialized('paidByInvoice') && null !== $object->getPaidByInvoice()) { + $data['paid_by_invoice'] = $object->getPaidByInvoice(); + } + if ($object->isInitialized('discounts') && null !== $object->getDiscounts()) { + $data['discounts'] = $this->normalizer->normalize($object->getDiscounts(), 'json', $context); + } + if ($object->isInitialized('placeholderLimit') && null !== $object->getPlaceholderLimit()) { + $data['placeholder_limit'] = $object->getPlaceholderLimit(); + } + if ($object->isInitialized('card') && null !== $object->getCard()) { + $data['card'] = $this->normalizer->normalize($object->getCard(), 'json', $context); + } + if ($object->isInitialized('address') && null !== $object->getAddress()) { + $data['address'] = $this->normalizer->normalize($object->getAddress(), 'json', $context); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) - { - $data = []; - if (null !== $object->getId()) { - $data['id'] = $object->getId(); - } - if (null !== $object->getNextBillingDate()) { - $data['next_billing_date'] = $object->getNextBillingDate()->format('Y-m-d'); - } - if (null !== $object->getDaysUntilNextBillingDate()) { - $data['days_until_next_billing_date'] = $object->getDaysUntilNextBillingDate(); - } - if (null !== $object->getAmount()) { - $data['amount'] = $object->getAmount(); - } - if (null !== $object->getAmountPerPerson()) { - $data['amount_per_person'] = $object->getAmountPerPerson(); - } - if (null !== $object->getReceiptRecipient()) { - $data['receipt_recipient'] = $object->getReceiptRecipient(); - } - if (null !== $object->getStatus()) { - $data['status'] = $object->getStatus(); - } - if (null !== $object->getPurchasedPeople()) { - $data['purchased_people'] = $object->getPurchasedPeople(); - } - if (null !== $object->getInterval()) { - $data['interval'] = $object->getInterval(); + return $data; } - if (null !== $object->getPaidByInvoice()) { - $data['paid_by_invoice'] = $object->getPaidByInvoice(); + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscription' => false]; } - if (null !== $object->getDiscounts()) { - $data['discounts'] = $this->normalizer->normalize($object->getDiscounts(), 'json', $context); + } +} else { + class SubscriptionSubscriptionNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscription' === $type; } - if (null !== $object->getPlaceholderLimit()) { - $data['placeholder_limit'] = $object->getPlaceholderLimit(); + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscription' === $data::class; } - if (null !== $object->getCard()) { - $data['card'] = $this->normalizer->normalize($object->getCard(), 'json', $context); + + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\SubscriptionSubscription(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('id', $data) && null !== $data['id']) { + $object->setId($data['id']); + unset($data['id']); + } elseif (\array_key_exists('id', $data) && null === $data['id']) { + $object->setId(null); + } + if (\array_key_exists('next_billing_date', $data) && null !== $data['next_billing_date']) { + $object->setNextBillingDate(\DateTime::createFromFormat('Y-m-d', $data['next_billing_date'])->setTime(0, 0, 0)); + unset($data['next_billing_date']); + } elseif (\array_key_exists('next_billing_date', $data) && null === $data['next_billing_date']) { + $object->setNextBillingDate(null); + } + if (\array_key_exists('days_until_next_billing_date', $data) && null !== $data['days_until_next_billing_date']) { + $object->setDaysUntilNextBillingDate($data['days_until_next_billing_date']); + unset($data['days_until_next_billing_date']); + } elseif (\array_key_exists('days_until_next_billing_date', $data) && null === $data['days_until_next_billing_date']) { + $object->setDaysUntilNextBillingDate(null); + } + if (\array_key_exists('amount', $data) && null !== $data['amount']) { + $object->setAmount($data['amount']); + unset($data['amount']); + } elseif (\array_key_exists('amount', $data) && null === $data['amount']) { + $object->setAmount(null); + } + if (\array_key_exists('amount_per_person', $data) && null !== $data['amount_per_person']) { + $object->setAmountPerPerson($data['amount_per_person']); + unset($data['amount_per_person']); + } elseif (\array_key_exists('amount_per_person', $data) && null === $data['amount_per_person']) { + $object->setAmountPerPerson(null); + } + if (\array_key_exists('receipt_recipient', $data) && null !== $data['receipt_recipient']) { + $object->setReceiptRecipient($data['receipt_recipient']); + unset($data['receipt_recipient']); + } elseif (\array_key_exists('receipt_recipient', $data) && null === $data['receipt_recipient']) { + $object->setReceiptRecipient(null); + } + if (\array_key_exists('status', $data) && null !== $data['status']) { + $object->setStatus($data['status']); + unset($data['status']); + } elseif (\array_key_exists('status', $data) && null === $data['status']) { + $object->setStatus(null); + } + if (\array_key_exists('purchased_people', $data) && null !== $data['purchased_people']) { + $object->setPurchasedPeople($data['purchased_people']); + unset($data['purchased_people']); + } elseif (\array_key_exists('purchased_people', $data) && null === $data['purchased_people']) { + $object->setPurchasedPeople(null); + } + if (\array_key_exists('interval', $data) && null !== $data['interval']) { + $object->setInterval($data['interval']); + unset($data['interval']); + } elseif (\array_key_exists('interval', $data) && null === $data['interval']) { + $object->setInterval(null); + } + if (\array_key_exists('paid_by_invoice', $data) && null !== $data['paid_by_invoice']) { + $object->setPaidByInvoice($data['paid_by_invoice']); + unset($data['paid_by_invoice']); + } elseif (\array_key_exists('paid_by_invoice', $data) && null === $data['paid_by_invoice']) { + $object->setPaidByInvoice(null); + } + if (\array_key_exists('discounts', $data) && null !== $data['discounts']) { + $object->setDiscounts($this->denormalizer->denormalize($data['discounts'], 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionDiscounts', 'json', $context)); + unset($data['discounts']); + } elseif (\array_key_exists('discounts', $data) && null === $data['discounts']) { + $object->setDiscounts(null); + } + if (\array_key_exists('placeholder_limit', $data) && null !== $data['placeholder_limit']) { + $object->setPlaceholderLimit($data['placeholder_limit']); + unset($data['placeholder_limit']); + } elseif (\array_key_exists('placeholder_limit', $data) && null === $data['placeholder_limit']) { + $object->setPlaceholderLimit(null); + } + if (\array_key_exists('card', $data) && null !== $data['card']) { + $object->setCard($this->denormalizer->denormalize($data['card'], 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionCard', 'json', $context)); + unset($data['card']); + } elseif (\array_key_exists('card', $data) && null === $data['card']) { + $object->setCard(null); + } + if (\array_key_exists('address', $data) && null !== $data['address']) { + $object->setAddress($this->denormalizer->denormalize($data['address'], 'JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscriptionAddress', 'json', $context)); + unset($data['address']); + } elseif (\array_key_exists('address', $data) && null === $data['address']) { + $object->setAddress(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; } - if (null !== $object->getAddress()) { - $data['address'] = $this->normalizer->normalize($object->getAddress(), 'json', $context); + + /** + * @param mixed|null $format + * + * @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(); + } + if ($object->isInitialized('nextBillingDate') && null !== $object->getNextBillingDate()) { + $data['next_billing_date'] = $object->getNextBillingDate()->format('Y-m-d'); + } + if ($object->isInitialized('daysUntilNextBillingDate') && null !== $object->getDaysUntilNextBillingDate()) { + $data['days_until_next_billing_date'] = $object->getDaysUntilNextBillingDate(); + } + if ($object->isInitialized('amount') && null !== $object->getAmount()) { + $data['amount'] = $object->getAmount(); + } + if ($object->isInitialized('amountPerPerson') && null !== $object->getAmountPerPerson()) { + $data['amount_per_person'] = $object->getAmountPerPerson(); + } + if ($object->isInitialized('receiptRecipient') && null !== $object->getReceiptRecipient()) { + $data['receipt_recipient'] = $object->getReceiptRecipient(); + } + if ($object->isInitialized('status') && null !== $object->getStatus()) { + $data['status'] = $object->getStatus(); + } + if ($object->isInitialized('purchasedPeople') && null !== $object->getPurchasedPeople()) { + $data['purchased_people'] = $object->getPurchasedPeople(); + } + if ($object->isInitialized('interval') && null !== $object->getInterval()) { + $data['interval'] = $object->getInterval(); + } + if ($object->isInitialized('paidByInvoice') && null !== $object->getPaidByInvoice()) { + $data['paid_by_invoice'] = $object->getPaidByInvoice(); + } + if ($object->isInitialized('discounts') && null !== $object->getDiscounts()) { + $data['discounts'] = $this->normalizer->normalize($object->getDiscounts(), 'json', $context); + } + if ($object->isInitialized('placeholderLimit') && null !== $object->getPlaceholderLimit()) { + $data['placeholder_limit'] = $object->getPlaceholderLimit(); + } + if ($object->isInitialized('card') && null !== $object->getCard()) { + $data['card'] = $this->normalizer->normalize($object->getCard(), 'json', $context); + } + if ($object->isInitialized('address') && null !== $object->getAddress()) { + $data['address'] = $this->normalizer->normalize($object->getAddress(), 'json', $context); + } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\SubscriptionSubscription' => false]; + } } } diff --git a/generated/Normalizer/UserConnectionNormalizer.php b/generated/Normalizer/UserConnectionNormalizer.php index 8ed7861..fe35c6f 100644 --- a/generated/Normalizer/UserConnectionNormalizer.php +++ b/generated/Normalizer/UserConnectionNormalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,75 +22,170 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class UserConnectionNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool - { - return 'JoliCode\\Forecast\\Api\\Model\\UserConnection' === $type; - } - - public function supportsNormalization($data, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class UserConnectionNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\UserConnection' === \get_class($data); - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\UserConnection' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\UserConnection' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\UserConnection(); - 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 \JoliCode\Forecast\Api\Model\UserConnection(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('id', $data) && null !== $data['id']) { + $object->setId($data['id']); + unset($data['id']); + } elseif (\array_key_exists('id', $data) && null === $data['id']) { + $object->setId(null); + } + if (\array_key_exists('last_active_at', $data) && null !== $data['last_active_at']) { + $object->setLastActiveAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s.v\\Z', $data['last_active_at'])); + unset($data['last_active_at']); + } elseif (\array_key_exists('last_active_at', $data) && null === $data['last_active_at']) { + $object->setLastActiveAt(null); + } + if (\array_key_exists('person_id', $data) && null !== $data['person_id']) { + $object->setPersonId($data['person_id']); + unset($data['person_id']); + } elseif (\array_key_exists('person_id', $data) && null === $data['person_id']) { + $object->setPersonId(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('id', $data) && null !== $data['id']) { - $object->setId($data['id']); - } elseif (\array_key_exists('id', $data) && null === $data['id']) { - $object->setId(null); + + 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(); + } + $data['last_active_at'] = $object->getLastActiveAt()->format('Y-m-d\\TH:i:s.v\\Z'); + $data['person_id'] = $object->getPersonId(); + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\UserConnection' => false]; } - if (\array_key_exists('last_active_at', $data) && null !== $data['last_active_at']) { - $object->setLastActiveAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s.v\\Z', $data['last_active_at'])); - } elseif (\array_key_exists('last_active_at', $data) && null === $data['last_active_at']) { - $object->setLastActiveAt(null); + } +} else { + class UserConnectionNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\UserConnection' === $type; } - if (\array_key_exists('person_id', $data) && null !== $data['person_id']) { - $object->setPersonId($data['person_id']); - } elseif (\array_key_exists('person_id', $data) && null === $data['person_id']) { - $object->setPersonId(null); + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\UserConnection' === $data::class; } - return $object; - } + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\UserConnection(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('id', $data) && null !== $data['id']) { + $object->setId($data['id']); + unset($data['id']); + } elseif (\array_key_exists('id', $data) && null === $data['id']) { + $object->setId(null); + } + if (\array_key_exists('last_active_at', $data) && null !== $data['last_active_at']) { + $object->setLastActiveAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s.v\\Z', $data['last_active_at'])); + unset($data['last_active_at']); + } elseif (\array_key_exists('last_active_at', $data) && null === $data['last_active_at']) { + $object->setLastActiveAt(null); + } + if (\array_key_exists('person_id', $data) && null !== $data['person_id']) { + $object->setPersonId($data['person_id']); + unset($data['person_id']); + } elseif (\array_key_exists('person_id', $data) && null === $data['person_id']) { + $object->setPersonId(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) - { - $data = []; - if (null !== $object->getId()) { - $data['id'] = $object->getId(); + return $object; + } + + /** + * @param mixed|null $format + * + * @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(); + } + $data['last_active_at'] = $object->getLastActiveAt()->format('Y-m-d\\TH:i:s.v\\Z'); + $data['person_id'] = $object->getPersonId(); + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; } - $data['last_active_at'] = $object->getLastActiveAt()->format('Y-m-d\\TH:i:s.v\\Z'); - $data['person_id'] = $object->getPersonId(); - return $data; + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\UserConnection' => false]; + } } } diff --git a/generated/Normalizer/UserConnectionsNormalizer.php b/generated/Normalizer/UserConnectionsNormalizer.php index 5cf5e8d..4d18b8f 100644 --- a/generated/Normalizer/UserConnectionsNormalizer.php +++ b/generated/Normalizer/UserConnectionsNormalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,69 +22,154 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class UserConnectionsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class UserConnectionsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\UserConnections' === $type; - } - - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\UserConnections' === \get_class($data); - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\UserConnections' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\UserConnections' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\UserConnections(); - 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 \JoliCode\Forecast\Api\Model\UserConnections(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('user_connections', $data) && null !== $data['user_connections']) { + $values = []; + foreach ($data['user_connections'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Forecast\\Api\\Model\\UserConnection', 'json', $context); + } + $object->setUserConnections($values); + unset($data['user_connections']); + } elseif (\array_key_exists('user_connections', $data) && null === $data['user_connections']) { + $object->setUserConnections(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('user_connections', $data) && null !== $data['user_connections']) { + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; $values = []; - foreach ($data['user_connections'] as $value) { - $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Forecast\\Api\\Model\\UserConnection', 'json', $context); + foreach ($object->getUserConnections() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); } - $object->setUserConnections($values); - } elseif (\array_key_exists('user_connections', $data) && null === $data['user_connections']) { - $object->setUserConnections(null); + $data['user_connections'] = $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 ['JoliCode\\Forecast\\Api\\Model\\UserConnections' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class UserConnectionsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - $values = []; - foreach ($object->getUserConnections() as $value) { - $values[] = $this->normalizer->normalize($value, 'json', $context); + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\UserConnections' === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\UserConnections' === $data::class; } - $data['user_connections'] = $values; - return $data; + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\UserConnections(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('user_connections', $data) && null !== $data['user_connections']) { + $values = []; + foreach ($data['user_connections'] as $value) { + $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Forecast\\Api\\Model\\UserConnection', 'json', $context); + } + $object->setUserConnections($values); + unset($data['user_connections']); + } elseif (\array_key_exists('user_connections', $data) && null === $data['user_connections']) { + $object->setUserConnections(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + + return $object; + } + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $values = []; + foreach ($object->getUserConnections() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['user_connections'] = $values; + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\UserConnections' => false]; + } } } diff --git a/generated/Normalizer/UserCurrentUserNormalizer.php b/generated/Normalizer/UserCurrentUserNormalizer.php index 773a197..0e460a7 100644 --- a/generated/Normalizer/UserCurrentUserNormalizer.php +++ b/generated/Normalizer/UserCurrentUserNormalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,79 +22,176 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class UserCurrentUserNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool - { - return 'JoliCode\\Forecast\\Api\\Model\\UserCurrentUser' === $type; - } - - public function supportsNormalization($data, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class UserCurrentUserNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\UserCurrentUser' === \get_class($data); - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\UserCurrentUser' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\UserCurrentUser' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\UserCurrentUser(); - 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 \JoliCode\Forecast\Api\Model\UserCurrentUser(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('id', $data) && null !== $data['id']) { + $object->setId($data['id']); + unset($data['id']); + } elseif (\array_key_exists('id', $data) && null === $data['id']) { + $object->setId(null); + } + if (\array_key_exists('account_ids', $data) && null !== $data['account_ids']) { + $values = []; + foreach ($data['account_ids'] as $value) { + $values[] = $value; + } + $object->setAccountIds($values); + unset($data['account_ids']); + } elseif (\array_key_exists('account_ids', $data) && null === $data['account_ids']) { + $object->setAccountIds(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + return $object; } - if (\array_key_exists('id', $data) && null !== $data['id']) { - $object->setId($data['id']); - } elseif (\array_key_exists('id', $data) && null === $data['id']) { - $object->setId(null); - } - if (\array_key_exists('account_ids', $data) && null !== $data['account_ids']) { - $values = []; - foreach ($data['account_ids'] as $value) { - $values[] = $value; - } - $object->setAccountIds($values); - } elseif (\array_key_exists('account_ids', $data) && null === $data['account_ids']) { - $object->setAccountIds(null); + + 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(); + } + if ($object->isInitialized('accountIds') && null !== $object->getAccountIds()) { + $values = []; + foreach ($object->getAccountIds() as $value) { + $values[] = $value; + } + $data['account_ids'] = $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 ['JoliCode\\Forecast\\Api\\Model\\UserCurrentUser' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class UserCurrentUserNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - if (null !== $object->getId()) { - $data['id'] = $object->getId(); + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\UserCurrentUser' === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\UserCurrentUser' === $data::class; + } + + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\UserCurrentUser(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('id', $data) && null !== $data['id']) { + $object->setId($data['id']); + unset($data['id']); + } elseif (\array_key_exists('id', $data) && null === $data['id']) { + $object->setId(null); + } + if (\array_key_exists('account_ids', $data) && null !== $data['account_ids']) { + $values = []; + foreach ($data['account_ids'] as $value) { + $values[] = $value; + } + $object->setAccountIds($values); + unset($data['account_ids']); + } elseif (\array_key_exists('account_ids', $data) && null === $data['account_ids']) { + $object->setAccountIds(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + + return $object; } - if (null !== $object->getAccountIds()) { - $values = []; - foreach ($object->getAccountIds() as $value) { - $values[] = $value; + + /** + * @param mixed|null $format + * + * @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(); + } + if ($object->isInitialized('accountIds') && null !== $object->getAccountIds()) { + $values = []; + foreach ($object->getAccountIds() as $value) { + $values[] = $value; + } + $data['account_ids'] = $values; + } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } } - $data['account_ids'] = $values; + + return $data; } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\UserCurrentUser' => false]; + } } } diff --git a/generated/Normalizer/UserNormalizer.php b/generated/Normalizer/UserNormalizer.php index e952625..8d2d7f8 100644 --- a/generated/Normalizer/UserNormalizer.php +++ b/generated/Normalizer/UserNormalizer.php @@ -13,6 +13,8 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Forecast\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Forecast\Api\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; @@ -20,61 +22,138 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class UserNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface -{ - use CheckArray; - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - - public function supportsDenormalization($data, $type, $format = null): bool +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class UserNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - return 'JoliCode\\Forecast\\Api\\Model\\User' === $type; - } + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsNormalization($data, $format = null): bool - { - return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\User' === \get_class($data); - } - - /** - * @param mixed $data - * @param mixed $class - * @param mixed|null $format - * - * @return mixed - */ - 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 'JoliCode\\Forecast\\Api\\Model\\User' === $type; } - 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) && 'JoliCode\\Forecast\\Api\\Model\\User' === $data::class; } - $object = new \JoliCode\Forecast\Api\Model\User(); - 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 \JoliCode\Forecast\Api\Model\User(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('current_user', $data) && null !== $data['current_user']) { + $object->setCurrentUser($this->denormalizer->denormalize($data['current_user'], 'JoliCode\\Forecast\\Api\\Model\\UserCurrentUser', 'json', $context)); + unset($data['current_user']); + } elseif (\array_key_exists('current_user', $data) && null === $data['current_user']) { + $object->setCurrentUser(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + return $object; } - if (\array_key_exists('current_user', $data) && null !== $data['current_user']) { - $object->setCurrentUser($this->denormalizer->denormalize($data['current_user'], 'JoliCode\\Forecast\\Api\\Model\\UserCurrentUser', 'json', $context)); - } elseif (\array_key_exists('current_user', $data) && null === $data['current_user']) { - $object->setCurrentUser(null); + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['current_user'] = $this->normalizer->normalize($object->getCurrentUser(), '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 ['JoliCode\\Forecast\\Api\\Model\\User' => false]; + } } - - /** - * @param mixed $object - * @param mixed|null $format - * - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) +} else { + class UserNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { - $data = []; - $data['current_user'] = $this->normalizer->normalize($object->getCurrentUser(), 'json', $context); + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; - return $data; + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return 'JoliCode\\Forecast\\Api\\Model\\User' === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && 'JoliCode\\Forecast\\Api\\Model\\User' === $data::class; + } + + /** + * @param mixed|null $format + */ + 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 \JoliCode\Forecast\Api\Model\User(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('current_user', $data) && null !== $data['current_user']) { + $object->setCurrentUser($this->denormalizer->denormalize($data['current_user'], 'JoliCode\\Forecast\\Api\\Model\\UserCurrentUser', 'json', $context)); + unset($data['current_user']); + } elseif (\array_key_exists('current_user', $data) && null === $data['current_user']) { + $object->setCurrentUser(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + /** + * @param mixed|null $format + * + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['current_user'] = $this->normalizer->normalize($object->getCurrentUser(), 'json', $context); + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return ['JoliCode\\Forecast\\Api\\Model\\User' => false]; + } } } diff --git a/generated/Runtime/Client/BaseEndpoint.php b/generated/Runtime/Client/BaseEndpoint.php index ca21332..2ceceb7 100644 --- a/generated/Runtime/Client/BaseEndpoint.php +++ b/generated/Runtime/Client/BaseEndpoint.php @@ -12,11 +12,13 @@ namespace JoliCode\Forecast\Api\Runtime\Client; use Http\Message\MultipartStream\MultipartStreamBuilder; +use Psr\Http\Message\ResponseInterface; use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\Serializer\SerializerInterface; abstract class BaseEndpoint implements Endpoint { + protected $formParameters = []; protected $queryParameters = []; protected $headerParameters = []; protected $body; @@ -44,7 +46,7 @@ public function getHeaders(array $baseHeaders = []): array return array_merge($this->getExtraHeaders(), $baseHeaders, $this->getHeadersOptionsResolver()->resolve($this->headerParameters)); } - abstract protected function transformResponseBody(string $body, int $status, SerializerInterface $serializer, ?string $contentType = null); + abstract protected function transformResponseBody(ResponseInterface $response, SerializerInterface $serializer, ?string $contentType = null); protected function getExtraHeaders(): array { diff --git a/generated/Runtime/Client/Client.php b/generated/Runtime/Client/Client.php index 451c671..62d6f61 100644 --- a/generated/Runtime/Client/Client.php +++ b/generated/Runtime/Client/Client.php @@ -68,7 +68,7 @@ private function processEndpoint(Endpoint $endpoint): ResponseInterface { [$bodyHeaders, $body] = $endpoint->getBody($this->serializer, $this->streamFactory); $queryString = $endpoint->getQueryString(); - $uriGlue = false === strpos($endpoint->getUri(), '?') ? '?' : '&'; + $uriGlue = !str_contains($endpoint->getUri(), '?') ? '?' : '&'; $uri = '' !== $queryString ? $endpoint->getUri().$uriGlue.$queryString : $endpoint->getUri(); $request = $this->requestFactory->createRequest($endpoint->getMethod(), $uri); if ($body) { @@ -84,7 +84,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/generated/Runtime/Client/EndpointTrait.php b/generated/Runtime/Client/EndpointTrait.php index 00fe111..41d6068 100644 --- a/generated/Runtime/Client/EndpointTrait.php +++ b/generated/Runtime/Client/EndpointTrait.php @@ -20,8 +20,8 @@ public function parseResponse(ResponseInterface $response, SerializerInterface $ { $contentType = $response->hasHeader('Content-Type') ? current($response->getHeader('Content-Type')) : null; - return $this->transformResponseBody((string) $response->getBody(), $response->getStatusCode(), $serializer, $contentType); + return $this->transformResponseBody($response, $serializer, $contentType); } - abstract protected function transformResponseBody(string $body, int $status, SerializerInterface $serializer, ?string $contentType = null); + abstract protected function transformResponseBody(ResponseInterface $response, SerializerInterface $serializer, ?string $contentType = null); } diff --git a/generated/Runtime/Normalizer/ReferenceNormalizer.php b/generated/Runtime/Normalizer/ReferenceNormalizer.php index 45827bf..bb31d8a 100644 --- a/generated/Runtime/Normalizer/ReferenceNormalizer.php +++ b/generated/Runtime/Normalizer/ReferenceNormalizer.php @@ -12,26 +12,39 @@ namespace JoliCode\Forecast\Api\Runtime\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class ReferenceNormalizer implements NormalizerInterface -{ - /** - * {@inheritdoc} - */ - 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; + } - /** - * {@inheritdoc} - */ - 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/generated/Runtime/Normalizer/ValidationException.php b/generated/Runtime/Normalizer/ValidationException.php new file mode 100644 index 0000000..4e2130f --- /dev/null +++ b/generated/Runtime/Normalizer/ValidationException.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace JoliCode\Forecast\Api\Runtime\Normalizer; + +use Symfony\Component\Validator\ConstraintViolationListInterface; + +class ValidationException extends \RuntimeException +{ + /** @var ConstraintViolationListInterface */ + private $violationList; + + public function __construct(ConstraintViolationListInterface $violationList) + { + $this->violationList = $violationList; + parent::__construct(sprintf('Model validation failed with %d errors.', $violationList->count()), 400); + } + + public function getViolationList(): ConstraintViolationListInterface + { + return $this->violationList; + } +} diff --git a/generated/Runtime/Normalizer/ValidatorTrait.php b/generated/Runtime/Normalizer/ValidatorTrait.php new file mode 100644 index 0000000..4262758 --- /dev/null +++ b/generated/Runtime/Normalizer/ValidatorTrait.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace JoliCode\Forecast\Api\Runtime\Normalizer; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Validation; + +trait ValidatorTrait +{ + protected function validate(array $data, Constraint $constraint): void + { + $validator = Validation::createValidator(); + $violations = $validator->validate($data, $constraint); + if ($violations->count() > 0) { + throw new ValidationException($violations); + } + } +} diff --git a/src/Client.php b/src/Client.php index 07e9106..3f536dd 100644 --- a/src/Client.php +++ b/src/Client.php @@ -30,9 +30,9 @@ public function listAssignments(array $queryParameters = [], string $fetch = sel foreach ($intervals as $interval) { $queryParameters['start_date'] = $interval['start_date']->format('Y-m-d'); $queryParameters['end_date'] = $interval['end_date']->format('Y-m-d'); - $response = $this->executeEndpoint(new \JoliCode\Forecast\Api\Endpoint\ListAssignments($queryParameters), $fetch); + $response = $this->executeEndpoint(new Api\Endpoint\ListAssignments($queryParameters), $fetch); - if (Error::class !== \get_class($response)) { + if (Error::class !== $response::class) { $assignments = array_merge( $assignments, $response->getAssignments() diff --git a/src/ClientFactory.php b/src/ClientFactory.php index b2efe93..f88d3e7 100644 --- a/src/ClientFactory.php +++ b/src/ClientFactory.php @@ -19,7 +19,7 @@ class ClientFactory { - public static function create(string $token, string $accountId, ClientInterface $httpClient = null): Client + public static function create(string $token, string $accountId, ?ClientInterface $httpClient = null): Client { return Client::create($httpClient, [ new HeaderAppendPlugin([ From 5056f82cb19b7ffc56459e046403cd4b8feae204 Mon Sep 17 00:00:00 2001 From: Xavier Lacot Date: Fri, 29 Mar 2024 11:57:05 +0100 Subject: [PATCH 3/5] update ci actions --- .github/workflows/tests.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0bd733f..d07a1eb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,7 +11,7 @@ jobs: uses: actions/checkout@v2 - name: Cache composer - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ~/.composer/cache/ key: composer-ubuntu-${{ github.sha }} @@ -19,13 +19,15 @@ jobs: - name: Setup uses: shivammathur/setup-php@2.9.0 with: - php-version: 8.0 + php-version: 8.3 extensions: mbstring, fileinfo, json, intl, dom + tools: castor - name: Run composer install run: composer install -n --prefer-dist - - name: 'php-cs-fixer check' - run: 'vendor/bin/php-cs-fixer fix --dry-run --diff' - env: - PHP_CS_FIXER_IGNORE_ENV: 1 + - name: Install qa tooling + run: castor qa:update + + - name: Check coding standards + run: castor qa:cs --dry-run From c3cba712ee8d8781b7eee7ec7e1fb5dec6d85293 Mon Sep 17 00:00:00 2001 From: Xavier Lacot Date: Fri, 29 Mar 2024 11:58:06 +0100 Subject: [PATCH 4/5] update ci actions --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d07a1eb..ebac0ee 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,7 +17,7 @@ jobs: key: composer-ubuntu-${{ github.sha }} - name: Setup - uses: shivammathur/setup-php@2.9.0 + uses: shivammathur/setup-php@v2 with: php-version: 8.3 extensions: mbstring, fileinfo, json, intl, dom From a26144b5950db0b931e1b3cab77ff666bda1f7c8 Mon Sep 17 00:00:00 2001 From: Xavier Lacot Date: Fri, 29 Mar 2024 12:07:06 +0100 Subject: [PATCH 5/5] CHANGELOG update for the upcoming v7.0.0 --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 32192ba..3f2bef1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changes between versions +## 7.0.0 (2024-03-29) + + * upgrade to `janephp/open-api` 7.6 + * drop support for PHP <8.1 + * switch to [Castor](https://castor.jolicode.com/) for the project tooling + +## 6.0.1 (2022-10-06) + +* fixed the `updated_by_id` property name in the `Assignment` model (see https://github.com/jolicode/forecast-php-api/pull/23) + ## 6.0.0 (2022-08-03) * upgrade to `janephp/open-api` 7.3