diff --git a/CHANGELOG.md b/CHANGELOG.md index e69de29b..47720b61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -0,0 +1,164 @@ +# Change Log + +## [0.12.4](https://github.com/bunq/sdk_php/tree/0.12.4) (2017-12-21) +[Full Changelog](https://github.com/bunq/sdk_php/compare/0.12.3...0.12.4) + +**Implemented enhancements:** + +- Introduce fromJson method.  [\#84](https://github.com/bunq/sdk_php/issues/84) +- Make sure received signatures headers are correctly cased [\#75](https://github.com/bunq/sdk_php/issues/75) +- Return base class from createFromJsonString [\#73](https://github.com/bunq/sdk_php/issues/73) +- CHANGELOG.md is empty [\#71](https://github.com/bunq/sdk_php/issues/71) +- Improve decoder to recognise child objects [\#68](https://github.com/bunq/sdk_php/issues/68) +- Return static. \(bunq/sdk\_php\#73\) [\#74](https://github.com/bunq/sdk_php/pull/74) ([OGKevin](https://github.com/OGKevin)) +- Generated CHANGELOG.md :clap:. \(bunq/sdk\_php\#71\) [\#72](https://github.com/bunq/sdk_php/pull/72) ([OGKevin](https://github.com/OGKevin)) + +**Fixed bugs:** + +- Fatal error in the interactive installer when no allowed IP is given [\#79](https://github.com/bunq/sdk_php/issues/79) +- Fatal when using MonetaryAccountBank class [\#38](https://github.com/bunq/sdk_php/issues/38) +- Add specific php version to composer. \(bunq/sdk\_php\#38\) [\#77](https://github.com/bunq/sdk_php/pull/77) ([OGKevin](https://github.com/OGKevin)) + +**Merged pull requests:** + +- Feature/make sure headers are correctly cased bunq/sdk php\#75 [\#85](https://github.com/bunq/sdk_php/pull/85) ([OGKevin](https://github.com/OGKevin)) +- Feature/decode child object in parent object bunq/sdk php\#68 [\#83](https://github.com/bunq/sdk_php/pull/83) ([OGKevin](https://github.com/OGKevin)) +- Allow permitted IPs to be null in the interactive installer [\#78](https://github.com/bunq/sdk_php/pull/78) ([mbernson](https://github.com/mbernson)) + +## [0.12.3](https://github.com/bunq/sdk_php/tree/0.12.3) (2017-11-15) +[Full Changelog](https://github.com/bunq/sdk_php/compare/0.12.2...0.12.3) + +**Implemented enhancements:** + +- Callback models for holding callback data. [\#67](https://github.com/bunq/sdk_php/issues/67) + +**Fixed bugs:** + +- Scheduled payments are not decoded because of a typo [\#70](https://github.com/bunq/sdk_php/issues/70) + +**Merged pull requests:** + +- Feature/callback models \#67 [\#69](https://github.com/bunq/sdk_php/pull/69) ([OGKevin](https://github.com/OGKevin)) + +## [0.12.2](https://github.com/bunq/sdk_php/tree/0.12.2) (2017-11-08) +[Full Changelog](https://github.com/bunq/sdk_php/compare/0.12.1...0.12.2) + +**Implemented enhancements:** + +- Add missing fields for cvc endpoint [\#64](https://github.com/bunq/sdk_php/issues/64) +- Missing CARD GENERATED CVC2 endpoint [\#61](https://github.com/bunq/sdk_php/issues/61) +- More flexibility for sessionContext handling [\#58](https://github.com/bunq/sdk_php/issues/58) +- Added cvc\_endpoint. \#61 [\#62](https://github.com/bunq/sdk_php/pull/62) ([OGKevin](https://github.com/OGKevin)) +- Feature/is expired\#58 [\#59](https://github.com/bunq/sdk_php/pull/59) ([OGKevin](https://github.com/OGKevin)) + +**Fixed bugs:** + +- Getting a DraftPayment that has been ACCEPTED results in an error [\#63](https://github.com/bunq/sdk_php/issues/63) + +**Merged pull requests:** + +- Feature/fix draft payment object \#63 [\#66](https://github.com/bunq/sdk_php/pull/66) ([OGKevin](https://github.com/OGKevin)) +- Feature/add missing cvc fields \#64 [\#65](https://github.com/bunq/sdk_php/pull/65) ([OGKevin](https://github.com/OGKevin)) + +## [0.12.1](https://github.com/bunq/sdk_php/tree/0.12.1) (2017-10-11) +[Full Changelog](https://github.com/bunq/sdk_php/compare/0.12.0...0.12.1) + +**Fixed bugs:** + +- toJson\(\) fails on ApiContext of an user person due to session context [\#56](https://github.com/bunq/sdk_php/issues/56) + +**Merged pull requests:** + +- toJson\(\) fails on ApiContext of an user person due to session context [\#57](https://github.com/bunq/sdk_php/pull/57) ([DennisSnijder](https://github.com/DennisSnijder)) + +## [0.12.0](https://github.com/bunq/sdk_php/tree/0.12.0) (2017-10-11) +[Full Changelog](https://github.com/bunq/sdk_php/compare/0.11.0...0.12.0) + +**Implemented enhancements:** + +- Add strictly typed BunqResponses [\#52](https://github.com/bunq/sdk_php/issues/52) +- Better error handling [\#49](https://github.com/bunq/sdk_php/issues/49) +- End support for PHP 5.6 [\#44](https://github.com/bunq/sdk_php/issues/44) +- Add strictly typed responses; fix GET in extended models \[\#52\] [\#53](https://github.com/bunq/sdk_php/pull/53) ([dnl-blkv](https://github.com/dnl-blkv)) +- Feature/exception factory [\#50](https://github.com/bunq/sdk_php/pull/50) ([OGKevin](https://github.com/OGKevin)) +- Marked all files in generated dir as generated code. [\#47](https://github.com/bunq/sdk_php/pull/47) ([OGKevin](https://github.com/OGKevin)) + +**Fixed bugs:** + +- User::get returns empty object? [\#51](https://github.com/bunq/sdk_php/issues/51) +- Error retrieving pinned certificates [\#14](https://github.com/bunq/sdk_php/issues/14) + +**Merged pull requests:** + +- cleanup after 52-strict-response [\#55](https://github.com/bunq/sdk_php/pull/55) ([dnl-blkv](https://github.com/dnl-blkv)) +- !== instead of != [\#54](https://github.com/bunq/sdk_php/pull/54) ([OGKevin](https://github.com/OGKevin)) +- Added PHPStan and script to run "composer phpstan" [\#48](https://github.com/bunq/sdk_php/pull/48) ([holtkamp](https://github.com/holtkamp)) + +## [0.11.0](https://github.com/bunq/sdk_php/tree/0.11.0) (2017-09-06) +[Full Changelog](https://github.com/bunq/sdk_php/compare/0.10.0...0.11.0) + +**Implemented enhancements:** + +- Ignore generated code for reviews [\#45](https://github.com/bunq/sdk_php/issues/45) +- Pagination and limit is missing for listing methods [\#15](https://github.com/bunq/sdk_php/issues/15) +- Updated git attributes. [\#46](https://github.com/bunq/sdk_php/pull/46) ([OGKevin](https://github.com/OGKevin)) +- Add Pagination and missing fields/endpoints \[\#15\] [\#43](https://github.com/bunq/sdk_php/pull/43) ([dnl-blkv](https://github.com/dnl-blkv)) + +## [0.10.0](https://github.com/bunq/sdk_php/tree/0.10.0) (2017-08-22) +[Full Changelog](https://github.com/bunq/sdk_php/compare/0.9.1...0.10.0) + +**Implemented enhancements:** + +- Allow saving context to JSON and restoring from it [\#39](https://github.com/bunq/sdk_php/issues/39) +- Response is missing response headers and pagination [\#33](https://github.com/bunq/sdk_php/issues/33) +- Allow to configure Guzzle options / use a proxy to ensure static IP address [\#5](https://github.com/bunq/sdk_php/issues/5) +- Cleanup; add toJson and fromJson to ApiContext \[\#39\] [\#40](https://github.com/bunq/sdk_php/pull/40) ([dnl-blkv](https://github.com/dnl-blkv)) +- \#33 bunq response [\#34](https://github.com/bunq/sdk_php/pull/34) ([dnl-blkv](https://github.com/dnl-blkv)) +- \#5 Allow setting a proxy [\#27](https://github.com/bunq/sdk_php/pull/27) ([qurben](https://github.com/qurben)) +- Introduction of Grumphp [\#24](https://github.com/bunq/sdk_php/pull/24) ([cafferata](https://github.com/cafferata)) + +**Fixed bugs:** + +- Error in api context script [\#36](https://github.com/bunq/sdk_php/issues/36) + +**Merged pull requests:** + +- Fixes \#36 on php5.6 [\#37](https://github.com/bunq/sdk_php/pull/37) ([OGKevin](https://github.com/OGKevin)) +- Added an .gitattributes file. [\#20](https://github.com/bunq/sdk_php/pull/20) ([cafferata](https://github.com/cafferata)) + +## [0.9.1](https://github.com/bunq/sdk_php/tree/0.9.1) (2017-08-07) +**Implemented enhancements:** + +- Remove phpstan [\#28](https://github.com/bunq/sdk_php/issues/28) +- Suggestion: use Objects instead of arrays [\#22](https://github.com/bunq/sdk_php/issues/22) +- Changes the composer PHP requirement [\#19](https://github.com/bunq/sdk_php/pull/19) ([cafferata](https://github.com/cafferata)) +- Removed the default PHPStorm constructor header\(s\) [\#18](https://github.com/bunq/sdk_php/pull/18) ([cafferata](https://github.com/cafferata)) +- Add readme for tests. [\#16](https://github.com/bunq/sdk_php/pull/16) ([OGKevin](https://github.com/OGKevin)) +- Restructure project [\#12](https://github.com/bunq/sdk_php/pull/12) ([LauLaman](https://github.com/LauLaman)) +- Add PHP-CS and PHPStan dependencies and scripts to execute [\#3](https://github.com/bunq/sdk_php/pull/3) ([holtkamp](https://github.com/holtkamp)) +- Add first series of unit-tests [\#1](https://github.com/bunq/sdk_php/pull/1) ([OGKevin](https://github.com/OGKevin)) + +**Fixed bugs:** + +- User Agent header generation is broken in ApiClient [\#30](https://github.com/bunq/sdk_php/issues/30) +- Scripts in composer.json are broken [\#25](https://github.com/bunq/sdk_php/issues/25) +- public.api.bunq.com is using wrong certificate [\#11](https://github.com/bunq/sdk_php/issues/11) +- SessionContext is missing timeout for UserPerson [\#10](https://github.com/bunq/sdk_php/issues/10) +- SDK not working on Windows \(XAMPP\) [\#8](https://github.com/bunq/sdk_php/issues/8) +- Curl error "Invalid certificate chain" when running `vendor/bin/bunq-install` [\#6](https://github.com/bunq/sdk_php/issues/6) + +**Closed issues:** + +- Incorrect composer.json / authors sections [\#2](https://github.com/bunq/sdk_php/issues/2) + +**Merged pull requests:** + +- Fix user agent generation in ApiClient [\#31](https://github.com/bunq/sdk_php/pull/31) ([dnl-blkv](https://github.com/dnl-blkv)) +- \#28 remove phpstan as it does not support php 5.6 [\#29](https://github.com/bunq/sdk_php/pull/29) ([qurben](https://github.com/qurben)) +- \#25 Update directory for composer scripts, also omit version. [\#26](https://github.com/bunq/sdk_php/pull/26) ([qurben](https://github.com/qurben)) +- Updated composer.lock [\#23](https://github.com/bunq/sdk_php/pull/23) ([cafferata](https://github.com/cafferata)) +- Fixed signature newline handling \(Windows\) [\#9](https://github.com/bunq/sdk_php/pull/9) ([BabyDino](https://github.com/BabyDino)) + + + +\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)* \ No newline at end of file diff --git a/composer.json b/composer.json index 11b82d18..9c45ded0 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ } ], "require": { - "php": "^7.0", + "php": "^7.0.13", "ext-curl": "*", "ext-json": "*", "ext-mbstring": "*", diff --git a/src/Http/ApiClient.php b/src/Http/ApiClient.php index a01fa1f3..1060f534 100644 --- a/src/Http/ApiClient.php +++ b/src/Http/ApiClient.php @@ -71,7 +71,7 @@ class ApiClient /** * User agent constants. */ - const HEADER_USER_AGENT_BUNQ_SDK_DEFAULT = 'bunq-sdk-php/0.11.0'; + const HEADER_USER_AGENT_BUNQ_SDK_DEFAULT = 'bunq-sdk-php/0.12.4'; /** * Binary request constants. diff --git a/src/Http/Handler/ResponseHandlerSignature.php b/src/Http/Handler/ResponseHandlerSignature.php index 3a33c62e..7ca69f5b 100644 --- a/src/Http/Handler/ResponseHandlerSignature.php +++ b/src/Http/Handler/ResponseHandlerSignature.php @@ -23,6 +23,18 @@ class ResponseHandlerSignature extends ResponseHandlerBase const HEADER_SEPARATOR = ', '; const FORMAT_HEADER = '%s: %s'; + /** + * Regex constants. + */ + const REGEX_FOR_LOWERCASE_HEADERS = '/-([a-z])/'; + const REGEX_REPLACE = '/%s/'; + const REGEX_CHECK_FAILED = '0'; + + /** + * The index of the first item in an array. + */ + const INDEX_FIRST = 0; + /** * Http status constants. */ @@ -95,6 +107,8 @@ private function determineHeaderStringForSignedResponse(array $headers) foreach ($headers as $headerName => $headerValue) { // All headers with the prefix 'X-Bunq-' except 'Server-Signature' need to be signed. + $headerName = $this->ensureHeaderIsCorrectlyCased($headerName); + if ($headerName === self::HEADER_SERVER_SIGNATURE) { // Skip this header } elseif (strpos($headerName, self::HEADER_PREFIX) === self::HEADER_PREFIX_START) { @@ -105,6 +119,26 @@ private function determineHeaderStringForSignedResponse(array $headers) return implode(self::NEWLINE, $signedDataHeaders); } + /** + * @param string $headerName + * + * @return string + */ + private function ensureHeaderIsCorrectlyCased(string $headerName) + { + $headerName = ucfirst($headerName); + $regexResult = preg_match_all(self::REGEX_FOR_LOWERCASE_HEADERS, $headerName, $matches); + + if ($regexResult != self::REGEX_CHECK_FAILED) { + foreach ($matches[self::INDEX_FIRST] as $match) { + $matchUpper = strtoupper($match); + $headerName = preg_replace(vsprintf(self::REGEX_REPLACE, $match), $matchUpper, $headerName); + } + } + + return $headerName; + } + /** * @param string $headerName * @param string[] $headerValue diff --git a/src/Model/Core/AnchorObjectInterface.php b/src/Model/Core/AnchorObjectInterface.php new file mode 100644 index 00000000..eaf2a6a7 --- /dev/null +++ b/src/Model/Core/AnchorObjectInterface.php @@ -0,0 +1,9 @@ +isAllFieldNull() && $depthCounter < self::DEPTH_COUNTER_MAX) { + $model = self::decodeInsideModelFields($responseArray, $model, $depthCounter); + } + + return $model; + } + + /** + * @param mixed[] $responseArray + * @param BunqModel $model + * @param int $depthCounter + * + * @return BunqModel + */ + private static function decodeInsideModelFields(array $responseArray, BunqModel $model, int $depthCounter) + { + $modelFields = (array_keys(get_object_vars($model))); + + foreach ($modelFields as $field) { + $fieldClass = ModelUtil::getModelClassNameQualifiedOrNull($field); + + if (is_null($fieldClass)) { + continue; + } + + $reflectionClass = new ReflectionClass($fieldClass); + /** @var BunqModel $bunqModelSubClass */ + $bunqModelSubClass = $reflectionClass->newInstanceWithoutConstructor(); + $fieldContents = $bunqModelSubClass::createFromResponseArrayAnchorObject( + $responseArray, + $depthCounter + self::DEPTH_COUNTER_INCREMENTER + ); + + if ($fieldContents->isAllFieldNull()) { + $model->{$field} = null; + } else { + $model->{$field} = $fieldContents; + } + } + + return $model; } /** diff --git a/src/Model/Core/Id.php b/src/Model/Core/Id.php index e8f41eaa..a055e527 100644 --- a/src/Model/Core/Id.php +++ b/src/Model/Core/Id.php @@ -17,4 +17,16 @@ public function getId(): int { return $this->id; } + + /** + * @return bool + */ + protected function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + return true; + } } diff --git a/src/Model/Core/Installation.php b/src/Model/Core/Installation.php index 15bb284b..97171139 100644 --- a/src/Model/Core/Installation.php +++ b/src/Model/Core/Installation.php @@ -105,4 +105,28 @@ public function jsonSerialize(): array self::FIELD_CLIENT_PUBLIC_KEY => $this->clientPublicKey, ]; } + + /** + * @return bool + */ + protected function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->token)) { + return false; + } + + if (!is_null($this->serverPublicKey)) { + return false; + } + + if (!is_null($this->clientPublicKey)) { + return false; + } + + return true; + } } diff --git a/src/Model/Core/ServerPublicKey.php b/src/Model/Core/ServerPublicKey.php index 9eaaa071..883563f2 100644 --- a/src/Model/Core/ServerPublicKey.php +++ b/src/Model/Core/ServerPublicKey.php @@ -39,8 +39,24 @@ public function getServerPublicKey(): PublicKey * * @return static */ - public static function createFromResponseArray(array $responseArray, string $wrapper = null): ServerPublicKey - { + protected static function createFromResponseArray( + array $responseArray, + string $wrapper = null + ) { return new static($responseArray[self::FIELD_SERVER_PUBLIC_KEY]); } + + + + /** + * @return bool + */ + protected function isAllFieldNull() + { + if (!is_null($this->serverPublicKey)) { + return false; + } + + return true; + } } diff --git a/src/Model/Core/SessionServer.php b/src/Model/Core/SessionServer.php index 9afeae67..add38743 100644 --- a/src/Model/Core/SessionServer.php +++ b/src/Model/Core/SessionServer.php @@ -86,4 +86,28 @@ public function getUserPerson() { return $this->userPerson; } + + /** + * @return bool + */ + protected function isAllFieldNull() + { + if (!is_null($this->token)) { + return false; + } + + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->userCompany)) { + return false; + } + + if (!is_null($this->userPerson)) { + return false; + } + + return true; + } } diff --git a/src/Model/Core/Token.php b/src/Model/Core/Token.php index 3069c414..9cda22af 100644 --- a/src/Model/Core/Token.php +++ b/src/Model/Core/Token.php @@ -40,4 +40,28 @@ public function getToken(): string { return $this->token; } + + /** + * @return bool + */ + protected function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->created)) { + return false; + } + + if (!is_null($this->updated)) { + return false; + } + + if (!is_null($this->token)) { + return false; + } + + return true; + } } diff --git a/src/Model/Core/Uuid.php b/src/Model/Core/Uuid.php index a9c5e304..b7fe6b39 100644 --- a/src/Model/Core/Uuid.php +++ b/src/Model/Core/Uuid.php @@ -17,4 +17,16 @@ public function getUuid(): string { return $this->uuid; } + + /** + * @return bool + */ + protected function isAllFieldNull() + { + if (!is_null($this->uuid)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/AttachmentConversationContent.php b/src/Model/Generated/Endpoint/AttachmentConversationContent.php index 0afbb69d..a7f5c19d 100644 --- a/src/Model/Generated/Endpoint/AttachmentConversationContent.php +++ b/src/Model/Generated/Endpoint/AttachmentConversationContent.php @@ -54,4 +54,12 @@ public static function listing(ApiContext $apiContext, int $userId, int $chatCon new BunqResponse($responseRaw->getBodyString(), $responseRaw->getHeaders()) ); } + + /** + * @return bool + */ + public function isAllFieldNull() + { + return true; + } } diff --git a/src/Model/Generated/Endpoint/AttachmentMonetaryAccount.php b/src/Model/Generated/Endpoint/AttachmentMonetaryAccount.php index 6fe59326..96a2c10d 100644 --- a/src/Model/Generated/Endpoint/AttachmentMonetaryAccount.php +++ b/src/Model/Generated/Endpoint/AttachmentMonetaryAccount.php @@ -115,4 +115,20 @@ public function setId($id) { $this->id = $id; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->attachment)) { + return false; + } + + if (!is_null($this->id)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/AttachmentPublic.php b/src/Model/Generated/Endpoint/AttachmentPublic.php index f0732bb8..3239cb8f 100644 --- a/src/Model/Generated/Endpoint/AttachmentPublic.php +++ b/src/Model/Generated/Endpoint/AttachmentPublic.php @@ -192,4 +192,28 @@ public function setAttachment($attachment) { $this->attachment = $attachment; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->uuid)) { + return false; + } + + if (!is_null($this->created)) { + return false; + } + + if (!is_null($this->updated)) { + return false; + } + + if (!is_null($this->attachment)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/AttachmentPublicContent.php b/src/Model/Generated/Endpoint/AttachmentPublicContent.php index f8c25da2..e810c5ef 100644 --- a/src/Model/Generated/Endpoint/AttachmentPublicContent.php +++ b/src/Model/Generated/Endpoint/AttachmentPublicContent.php @@ -53,4 +53,12 @@ public static function listing(ApiContext $apiContext, string $attachmentPublicU new BunqResponse($responseRaw->getBodyString(), $responseRaw->getHeaders()) ); } + + /** + * @return bool + */ + public function isAllFieldNull() + { + return true; + } } diff --git a/src/Model/Generated/Endpoint/AttachmentTab.php b/src/Model/Generated/Endpoint/AttachmentTab.php index a050a1c7..4a1373ed 100644 --- a/src/Model/Generated/Endpoint/AttachmentTab.php +++ b/src/Model/Generated/Endpoint/AttachmentTab.php @@ -196,4 +196,28 @@ public function setAttachment($attachment) { $this->attachment = $attachment; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->created)) { + return false; + } + + if (!is_null($this->updated)) { + return false; + } + + if (!is_null($this->attachment)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/AttachmentTabContent.php b/src/Model/Generated/Endpoint/AttachmentTabContent.php index cb2f0049..9fc20684 100644 --- a/src/Model/Generated/Endpoint/AttachmentTabContent.php +++ b/src/Model/Generated/Endpoint/AttachmentTabContent.php @@ -54,4 +54,12 @@ public static function listing(ApiContext $apiContext, int $userId, int $monetar new BunqResponse($responseRaw->getBodyString(), $responseRaw->getHeaders()) ); } + + /** + * @return bool + */ + public function isAllFieldNull() + { + return true; + } } diff --git a/src/Model/Generated/Endpoint/Avatar.php b/src/Model/Generated/Endpoint/Avatar.php index 2ae97b87..668c188b 100644 --- a/src/Model/Generated/Endpoint/Avatar.php +++ b/src/Model/Generated/Endpoint/Avatar.php @@ -133,4 +133,20 @@ public function setImage($image) { $this->image = $image; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->uuid)) { + return false; + } + + if (!is_null($this->image)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/BillingContractSubscription.php b/src/Model/Generated/Endpoint/BillingContractSubscription.php index 39630169..342b6ca3 100644 --- a/src/Model/Generated/Endpoint/BillingContractSubscription.php +++ b/src/Model/Generated/Endpoint/BillingContractSubscription.php @@ -262,4 +262,40 @@ public function setSubscriptionType($subscriptionType) { $this->subscriptionType = $subscriptionType; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->created)) { + return false; + } + + if (!is_null($this->updated)) { + return false; + } + + if (!is_null($this->contractDateStart)) { + return false; + } + + if (!is_null($this->contractDateEnd)) { + return false; + } + + if (!is_null($this->contractVersion)) { + return false; + } + + if (!is_null($this->subscriptionType)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/BunqMeFundraiserProfile.php b/src/Model/Generated/Endpoint/BunqMeFundraiserProfile.php new file mode 100644 index 00000000..3961d8de --- /dev/null +++ b/src/Model/Generated/Endpoint/BunqMeFundraiserProfile.php @@ -0,0 +1,244 @@ +color; + } + + /** + * @param string $color + */ + public function setColor($color) + { + $this->color = $color; + } + + /** + * The LabelMonetaryAccount with the public information of the User and the + * MonetaryAccount that created the bunq.me fundraiser profile. + * + * @return LabelMonetaryAccount + */ + public function getAlias() + { + return $this->alias; + } + + /** + * @param LabelMonetaryAccount $alias + */ + public function setAlias($alias) + { + $this->alias = $alias; + } + + /** + * The description of the bunq.me fundraiser profile. + * + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * @param string $description + */ + public function setDescription($description) + { + $this->description = $description; + } + + /** + * The attachments attached to the fundraiser profile. + * + * @return AttachmentPublic[] + */ + public function getAttachment() + { + return $this->attachment; + } + + /** + * @param AttachmentPublic[] $attachment + */ + public function setAttachment($attachment) + { + $this->attachment = $attachment; + } + + /** + * The pointer (url) which will be used to access the bunq.me fundraiser + * profile. + * + * @return Pointer + */ + public function getPointer() + { + return $this->pointer; + } + + /** + * @param Pointer $pointer + */ + public function setPointer($pointer) + { + $this->pointer = $pointer; + } + + /** + * The status of the bunq.me fundraiser profile, can be ACTIVE or + * DEACTIVATED. + * + * @return string + */ + public function getStatus() + { + return $this->status; + } + + /** + * @param string $status + */ + public function setStatus($status) + { + $this->status = $status; + } + + /** + * The URL which the user is sent to when a payment is completed. + * + * @return string + */ + public function getRedirectUrl() + { + return $this->redirectUrl; + } + + /** + * @param string $redirectUrl + */ + public function setRedirectUrl($redirectUrl) + { + $this->redirectUrl = $redirectUrl; + } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->color)) { + return false; + } + + if (!is_null($this->alias)) { + return false; + } + + if (!is_null($this->description)) { + return false; + } + + if (!is_null($this->attachment)) { + return false; + } + + if (!is_null($this->pointer)) { + return false; + } + + if (!is_null($this->status)) { + return false; + } + + if (!is_null($this->redirectUrl)) { + return false; + } + + return true; + } +} diff --git a/src/Model/Generated/Endpoint/BunqMeFundraiserResult.php b/src/Model/Generated/Endpoint/BunqMeFundraiserResult.php new file mode 100644 index 00000000..e6796b31 --- /dev/null +++ b/src/Model/Generated/Endpoint/BunqMeFundraiserResult.php @@ -0,0 +1,170 @@ +id; + } + + /** + * @param int $id + */ + public function setId($id) + { + $this->id = $id; + } + + /** + * The timestamp when the bunq.me was created. + * + * @return string + */ + public function getCreated() + { + return $this->created; + } + + /** + * @param string $created + */ + public function setCreated($created) + { + $this->created = $created; + } + + /** + * The timestamp when the bunq.me was last updated. + * + * @return string + */ + public function getUpdated() + { + return $this->updated; + } + + /** + * @param string $updated + */ + public function setUpdated($updated) + { + $this->updated = $updated; + } + + /** + * The bunq.me fundraiser profile. + * + * @return BunqMeFundraiserProfile + */ + public function getBunqmeFundraiserProfile() + { + return $this->bunqmeFundraiserProfile; + } + + /** + * @param BunqMeFundraiserProfile $bunqmeFundraiserProfile + */ + public function setBunqmeFundraiserProfile($bunqmeFundraiserProfile) + { + $this->bunqmeFundraiserProfile = $bunqmeFundraiserProfile; + } + + /** + * The list of payments, paid to the bunq.me fundraiser profile. + * + * @return Payment[] + */ + public function getPayments() + { + return $this->payments; + } + + /** + * @param Payment[] $payments + */ + public function setPayments($payments) + { + $this->payments = $payments; + } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->created)) { + return false; + } + + if (!is_null($this->updated)) { + return false; + } + + if (!is_null($this->bunqmeFundraiserProfile)) { + return false; + } + + if (!is_null($this->payments)) { + return false; + } + + return true; + } +} diff --git a/src/Model/Generated/Endpoint/BunqMeTab.php b/src/Model/Generated/Endpoint/BunqMeTab.php index 86c79044..61532f1a 100644 --- a/src/Model/Generated/Endpoint/BunqMeTab.php +++ b/src/Model/Generated/Endpoint/BunqMeTab.php @@ -368,4 +368,48 @@ public function setResultInquiries($resultInquiries) { $this->resultInquiries = $resultInquiries; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->created)) { + return false; + } + + if (!is_null($this->updated)) { + return false; + } + + if (!is_null($this->timeExpiry)) { + return false; + } + + if (!is_null($this->monetaryAccountId)) { + return false; + } + + if (!is_null($this->status)) { + return false; + } + + if (!is_null($this->bunqmeTabShareUrl)) { + return false; + } + + if (!is_null($this->bunqmeTabEntry)) { + return false; + } + + if (!is_null($this->resultInquiries)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/BunqMeTabEntry.php b/src/Model/Generated/Endpoint/BunqMeTabEntry.php index 9bff0fff..2fac81d2 100644 --- a/src/Model/Generated/Endpoint/BunqMeTabEntry.php +++ b/src/Model/Generated/Endpoint/BunqMeTabEntry.php @@ -205,4 +205,40 @@ public function setMerchantAvailable($merchantAvailable) { $this->merchantAvailable = $merchantAvailable; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->uuid)) { + return false; + } + + if (!is_null($this->amountInquired)) { + return false; + } + + if (!is_null($this->alias)) { + return false; + } + + if (!is_null($this->description)) { + return false; + } + + if (!is_null($this->status)) { + return false; + } + + if (!is_null($this->redirectUrl)) { + return false; + } + + if (!is_null($this->merchantAvailable)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/BunqMeTabResultInquiry.php b/src/Model/Generated/Endpoint/BunqMeTabResultInquiry.php index cfeacb4d..8f152b77 100644 --- a/src/Model/Generated/Endpoint/BunqMeTabResultInquiry.php +++ b/src/Model/Generated/Endpoint/BunqMeTabResultInquiry.php @@ -41,4 +41,16 @@ public function setPayment($payment) { $this->payment = $payment; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->payment)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/BunqMeTabResultResponse.php b/src/Model/Generated/Endpoint/BunqMeTabResultResponse.php index 30518190..053e7b27 100644 --- a/src/Model/Generated/Endpoint/BunqMeTabResultResponse.php +++ b/src/Model/Generated/Endpoint/BunqMeTabResultResponse.php @@ -41,4 +41,16 @@ public function setPayment($payment) { $this->payment = $payment; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->payment)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/Card.php b/src/Model/Generated/Endpoint/Card.php index 097595f6..133c363c 100644 --- a/src/Model/Generated/Endpoint/Card.php +++ b/src/Model/Generated/Endpoint/Card.php @@ -674,4 +674,96 @@ public function setCountry($country) { $this->country = $country; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->created)) { + return false; + } + + if (!is_null($this->updated)) { + return false; + } + + if (!is_null($this->publicUuid)) { + return false; + } + + if (!is_null($this->type)) { + return false; + } + + if (!is_null($this->subType)) { + return false; + } + + if (!is_null($this->secondLine)) { + return false; + } + + if (!is_null($this->status)) { + return false; + } + + if (!is_null($this->subStatus)) { + return false; + } + + if (!is_null($this->orderStatus)) { + return false; + } + + if (!is_null($this->expiryDate)) { + return false; + } + + if (!is_null($this->nameOnCard)) { + return false; + } + + if (!is_null($this->primaryAccountNumberFourDigit)) { + return false; + } + + if (!is_null($this->limit)) { + return false; + } + + if (!is_null($this->magStripePermission)) { + return false; + } + + if (!is_null($this->countryPermission)) { + return false; + } + + if (!is_null($this->labelMonetaryAccountOrdered)) { + return false; + } + + if (!is_null($this->labelMonetaryAccountCurrent)) { + return false; + } + + if (!is_null($this->pinCodeAssignment)) { + return false; + } + + if (!is_null($this->monetaryAccountIdFallback)) { + return false; + } + + if (!is_null($this->country)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/CardDebit.php b/src/Model/Generated/Endpoint/CardDebit.php index 5f5df7d0..22a74521 100644 --- a/src/Model/Generated/Endpoint/CardDebit.php +++ b/src/Model/Generated/Endpoint/CardDebit.php @@ -583,4 +583,92 @@ public function setCountry($country) { $this->country = $country; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->created)) { + return false; + } + + if (!is_null($this->updated)) { + return false; + } + + if (!is_null($this->publicUuid)) { + return false; + } + + if (!is_null($this->type)) { + return false; + } + + if (!is_null($this->subType)) { + return false; + } + + if (!is_null($this->secondLine)) { + return false; + } + + if (!is_null($this->nameOnCard)) { + return false; + } + + if (!is_null($this->primaryAccountNumberFourDigit)) { + return false; + } + + if (!is_null($this->status)) { + return false; + } + + if (!is_null($this->orderStatus)) { + return false; + } + + if (!is_null($this->expiryDate)) { + return false; + } + + if (!is_null($this->limit)) { + return false; + } + + if (!is_null($this->countryPermission)) { + return false; + } + + if (!is_null($this->labelMonetaryAccountOrdered)) { + return false; + } + + if (!is_null($this->labelMonetaryAccountCurrent)) { + return false; + } + + if (!is_null($this->alias)) { + return false; + } + + if (!is_null($this->pinCodeAssignment)) { + return false; + } + + if (!is_null($this->monetaryAccountIdFallback)) { + return false; + } + + if (!is_null($this->country)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/CardGeneratedCvc2.php b/src/Model/Generated/Endpoint/CardGeneratedCvc2.php index bdd8f54b..c6b72dce 100644 --- a/src/Model/Generated/Endpoint/CardGeneratedCvc2.php +++ b/src/Model/Generated/Endpoint/CardGeneratedCvc2.php @@ -262,4 +262,36 @@ public function setExpiryTime($expiryTime) { $this->expiryTime = $expiryTime; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->created)) { + return false; + } + + if (!is_null($this->updated)) { + return false; + } + + if (!is_null($this->cvc2)) { + return false; + } + + if (!is_null($this->status)) { + return false; + } + + if (!is_null($this->expiryTime)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/CardName.php b/src/Model/Generated/Endpoint/CardName.php index 19d999ff..f342e8b5 100644 --- a/src/Model/Generated/Endpoint/CardName.php +++ b/src/Model/Generated/Endpoint/CardName.php @@ -82,4 +82,16 @@ public function setPossibleCardNameArray($possibleCardNameArray) { $this->possibleCardNameArray = $possibleCardNameArray; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->possibleCardNameArray)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/CardPinChange.php b/src/Model/Generated/Endpoint/CardPinChange.php index 4606f30f..0a19b094 100644 --- a/src/Model/Generated/Endpoint/CardPinChange.php +++ b/src/Model/Generated/Endpoint/CardPinChange.php @@ -234,4 +234,36 @@ public function setStatus($status) { $this->status = $status; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->labelCard)) { + return false; + } + + if (!is_null($this->labelMonetaryAccountCurrent)) { + return false; + } + + if (!is_null($this->timeRequest)) { + return false; + } + + if (!is_null($this->timeAccept)) { + return false; + } + + if (!is_null($this->status)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/CardReplace.php b/src/Model/Generated/Endpoint/CardReplace.php index a07be4e1..05f63477 100644 --- a/src/Model/Generated/Endpoint/CardReplace.php +++ b/src/Model/Generated/Endpoint/CardReplace.php @@ -87,4 +87,16 @@ public function setId($id) { $this->id = $id; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/CardResult.php b/src/Model/Generated/Endpoint/CardResult.php index f2d3d819..67ac8ff1 100644 --- a/src/Model/Generated/Endpoint/CardResult.php +++ b/src/Model/Generated/Endpoint/CardResult.php @@ -485,4 +485,76 @@ public function setReservationExpiryTime($reservationExpiryTime) { $this->reservationExpiryTime = $reservationExpiryTime; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->monetaryAccountId)) { + return false; + } + + if (!is_null($this->cardId)) { + return false; + } + + if (!is_null($this->amountOriginal)) { + return false; + } + + if (!is_null($this->amountFinal)) { + return false; + } + + if (!is_null($this->decision)) { + return false; + } + + if (!is_null($this->decisionDescription)) { + return false; + } + + if (!is_null($this->decisionDescriptionTranslated)) { + return false; + } + + if (!is_null($this->description)) { + return false; + } + + if (!is_null($this->messageType)) { + return false; + } + + if (!is_null($this->authorisationType)) { + return false; + } + + if (!is_null($this->city)) { + return false; + } + + if (!is_null($this->alias)) { + return false; + } + + if (!is_null($this->counterpartyAlias)) { + return false; + } + + if (!is_null($this->labelCard)) { + return false; + } + + if (!is_null($this->reservationStatus)) { + return false; + } + + if (!is_null($this->reservationExpiryTime)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/CashRegister.php b/src/Model/Generated/Endpoint/CashRegister.php index c8df8b72..10109ba6 100644 --- a/src/Model/Generated/Endpoint/CashRegister.php +++ b/src/Model/Generated/Endpoint/CashRegister.php @@ -397,4 +397,48 @@ public function setTabTextWaitingScreen($tabTextWaitingScreen) { $this->tabTextWaitingScreen = $tabTextWaitingScreen; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->created)) { + return false; + } + + if (!is_null($this->updated)) { + return false; + } + + if (!is_null($this->name)) { + return false; + } + + if (!is_null($this->status)) { + return false; + } + + if (!is_null($this->avatar)) { + return false; + } + + if (!is_null($this->location)) { + return false; + } + + if (!is_null($this->notificationFilters)) { + return false; + } + + if (!is_null($this->tabTextWaitingScreen)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/CashRegisterQrCode.php b/src/Model/Generated/Endpoint/CashRegisterQrCode.php index 9a9649cf..01b07b3b 100644 --- a/src/Model/Generated/Endpoint/CashRegisterQrCode.php +++ b/src/Model/Generated/Endpoint/CashRegisterQrCode.php @@ -312,4 +312,36 @@ public function setTabObject($tabObject) { $this->tabObject = $tabObject; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->created)) { + return false; + } + + if (!is_null($this->updated)) { + return false; + } + + if (!is_null($this->status)) { + return false; + } + + if (!is_null($this->cashRegister)) { + return false; + } + + if (!is_null($this->tabObject)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/CashRegisterQrCodeContent.php b/src/Model/Generated/Endpoint/CashRegisterQrCodeContent.php index 234a06f0..44668124 100644 --- a/src/Model/Generated/Endpoint/CashRegisterQrCodeContent.php +++ b/src/Model/Generated/Endpoint/CashRegisterQrCodeContent.php @@ -55,4 +55,12 @@ public static function listing(ApiContext $apiContext, int $userId, int $monetar new BunqResponse($responseRaw->getBodyString(), $responseRaw->getHeaders()) ); } + + /** + * @return bool + */ + public function isAllFieldNull() + { + return true; + } } diff --git a/src/Model/Generated/Endpoint/CertificatePinned.php b/src/Model/Generated/Endpoint/CertificatePinned.php index d318112d..a68f02cf 100644 --- a/src/Model/Generated/Endpoint/CertificatePinned.php +++ b/src/Model/Generated/Endpoint/CertificatePinned.php @@ -194,4 +194,20 @@ public function setId($id) { $this->id = $id; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->certificateChain)) { + return false; + } + + if (!is_null($this->id)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/ChatConversation.php b/src/Model/Generated/Endpoint/ChatConversation.php index 14968735..f61455a1 100644 --- a/src/Model/Generated/Endpoint/ChatConversation.php +++ b/src/Model/Generated/Endpoint/ChatConversation.php @@ -5,6 +5,7 @@ use bunq\exception\BunqException; use bunq\Http\ApiClient; use bunq\Http\BunqResponse; +use bunq\Model\Core\AnchorObjectInterface; use bunq\Model\Core\BunqModel; /** @@ -12,7 +13,7 @@ * * @generated */ -class ChatConversation extends BunqModel +class ChatConversation extends BunqModel implements AnchorObjectInterface { /** * Error constants. @@ -141,4 +142,20 @@ public function getReferencedObject() throw new BunqException(self::ERROR_NULL_FIELDS); } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->supportConversationExternal)) { + return false; + } + + if (!is_null($this->chatConversationReference)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/ChatConversationReference.php b/src/Model/Generated/Endpoint/ChatConversationReference.php index c8e57fae..b28e8ac1 100644 --- a/src/Model/Generated/Endpoint/ChatConversationReference.php +++ b/src/Model/Generated/Endpoint/ChatConversationReference.php @@ -89,4 +89,24 @@ public function setUpdated($updated) { $this->updated = $updated; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->created)) { + return false; + } + + if (!is_null($this->updated)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/ChatConversationSupportExternal.php b/src/Model/Generated/Endpoint/ChatConversationSupportExternal.php index 6f9981dc..cd392d8e 100644 --- a/src/Model/Generated/Endpoint/ChatConversationSupportExternal.php +++ b/src/Model/Generated/Endpoint/ChatConversationSupportExternal.php @@ -114,4 +114,28 @@ public function setLastMessage($lastMessage) { $this->lastMessage = $lastMessage; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->created)) { + return false; + } + + if (!is_null($this->updated)) { + return false; + } + + if (!is_null($this->lastMessage)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/ChatMessage.php b/src/Model/Generated/Endpoint/ChatMessage.php index 8a4950d8..dd3a04f4 100644 --- a/src/Model/Generated/Endpoint/ChatMessage.php +++ b/src/Model/Generated/Endpoint/ChatMessage.php @@ -5,6 +5,7 @@ use bunq\exception\BunqException; use bunq\Http\ApiClient; use bunq\Http\BunqResponse; +use bunq\Model\Core\AnchorObjectInterface; use bunq\Model\Core\BunqModel; /** @@ -12,7 +13,7 @@ * * @generated */ -class ChatMessage extends BunqModel +class ChatMessage extends BunqModel implements AnchorObjectInterface { /** * Error constants. @@ -143,4 +144,24 @@ public function getReferencedObject() throw new BunqException(self::ERROR_NULL_FIELDS); } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->chatMessageAnnouncement)) { + return false; + } + + if (!is_null($this->chatMessageStatus)) { + return false; + } + + if (!is_null($this->chatMessageUser)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/ChatMessageAnnouncement.php b/src/Model/Generated/Endpoint/ChatMessageAnnouncement.php index 7e978347..0e56fabf 100644 --- a/src/Model/Generated/Endpoint/ChatMessageAnnouncement.php +++ b/src/Model/Generated/Endpoint/ChatMessageAnnouncement.php @@ -166,4 +166,36 @@ public function setContent($content) { $this->content = $content; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->created)) { + return false; + } + + if (!is_null($this->updated)) { + return false; + } + + if (!is_null($this->conversationId)) { + return false; + } + + if (!is_null($this->creator)) { + return false; + } + + if (!is_null($this->content)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/ChatMessageAttachment.php b/src/Model/Generated/Endpoint/ChatMessageAttachment.php index 8eda118f..ef1da508 100644 --- a/src/Model/Generated/Endpoint/ChatMessageAttachment.php +++ b/src/Model/Generated/Endpoint/ChatMessageAttachment.php @@ -82,4 +82,16 @@ public function setId($id) { $this->id = $id; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/ChatMessageStatus.php b/src/Model/Generated/Endpoint/ChatMessageStatus.php index 1d8c9a34..1b58e381 100644 --- a/src/Model/Generated/Endpoint/ChatMessageStatus.php +++ b/src/Model/Generated/Endpoint/ChatMessageStatus.php @@ -166,4 +166,36 @@ public function setContent($content) { $this->content = $content; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->created)) { + return false; + } + + if (!is_null($this->updated)) { + return false; + } + + if (!is_null($this->conversationId)) { + return false; + } + + if (!is_null($this->creator)) { + return false; + } + + if (!is_null($this->content)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/ChatMessageText.php b/src/Model/Generated/Endpoint/ChatMessageText.php index b7358390..5c06fb6a 100644 --- a/src/Model/Generated/Endpoint/ChatMessageText.php +++ b/src/Model/Generated/Endpoint/ChatMessageText.php @@ -81,4 +81,16 @@ public function setId($id) { $this->id = $id; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/ChatMessageUser.php b/src/Model/Generated/Endpoint/ChatMessageUser.php index a543b07c..d77441e1 100644 --- a/src/Model/Generated/Endpoint/ChatMessageUser.php +++ b/src/Model/Generated/Endpoint/ChatMessageUser.php @@ -191,4 +191,40 @@ public function setContent($content) { $this->content = $content; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->created)) { + return false; + } + + if (!is_null($this->updated)) { + return false; + } + + if (!is_null($this->conversationId)) { + return false; + } + + if (!is_null($this->creator)) { + return false; + } + + if (!is_null($this->displayedSender)) { + return false; + } + + if (!is_null($this->content)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/Customer.php b/src/Model/Generated/Endpoint/Customer.php index 88bbdf3b..4f25d881 100644 --- a/src/Model/Generated/Endpoint/Customer.php +++ b/src/Model/Generated/Endpoint/Customer.php @@ -208,4 +208,28 @@ public function setBillingAccountId($billingAccountId) { $this->billingAccountId = $billingAccountId; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->created)) { + return false; + } + + if (!is_null($this->updated)) { + return false; + } + + if (!is_null($this->billingAccountId)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/CustomerLimit.php b/src/Model/Generated/Endpoint/CustomerLimit.php index 6e58584f..1c5c6303 100644 --- a/src/Model/Generated/Endpoint/CustomerLimit.php +++ b/src/Model/Generated/Endpoint/CustomerLimit.php @@ -177,4 +177,32 @@ public function setLimitCardDebitReplacement($limitCardDebitReplacement) { $this->limitCardDebitReplacement = $limitCardDebitReplacement; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->limitMonetaryAccount)) { + return false; + } + + if (!is_null($this->limitCardDebitMaestro)) { + return false; + } + + if (!is_null($this->limitCardDebitMastercard)) { + return false; + } + + if (!is_null($this->limitCardDebitWildcard)) { + return false; + } + + if (!is_null($this->limitCardDebitReplacement)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/CustomerStatementExport.php b/src/Model/Generated/Endpoint/CustomerStatementExport.php index 6248d590..8279fa9f 100644 --- a/src/Model/Generated/Endpoint/CustomerStatementExport.php +++ b/src/Model/Generated/Endpoint/CustomerStatementExport.php @@ -391,4 +391,52 @@ public function setAliasMonetaryAccount($aliasMonetaryAccount) { $this->aliasMonetaryAccount = $aliasMonetaryAccount; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->created)) { + return false; + } + + if (!is_null($this->updated)) { + return false; + } + + if (!is_null($this->dateStart)) { + return false; + } + + if (!is_null($this->dateEnd)) { + return false; + } + + if (!is_null($this->status)) { + return false; + } + + if (!is_null($this->statementNumber)) { + return false; + } + + if (!is_null($this->statementFormat)) { + return false; + } + + if (!is_null($this->regionalFormat)) { + return false; + } + + if (!is_null($this->aliasMonetaryAccount)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/CustomerStatementExportContent.php b/src/Model/Generated/Endpoint/CustomerStatementExportContent.php index acf815fd..9e849581 100644 --- a/src/Model/Generated/Endpoint/CustomerStatementExportContent.php +++ b/src/Model/Generated/Endpoint/CustomerStatementExportContent.php @@ -54,4 +54,12 @@ public static function listing(ApiContext $apiContext, int $userId, int $monetar new BunqResponse($responseRaw->getBodyString(), $responseRaw->getHeaders()) ); } + + /** + * @return bool + */ + public function isAllFieldNull() + { + return true; + } } diff --git a/src/Model/Generated/Endpoint/Device.php b/src/Model/Generated/Endpoint/Device.php index 46659a43..8ff92e5f 100644 --- a/src/Model/Generated/Endpoint/Device.php +++ b/src/Model/Generated/Endpoint/Device.php @@ -5,6 +5,7 @@ use bunq\exception\BunqException; use bunq\Http\ApiClient; use bunq\Http\BunqResponse; +use bunq\Model\Core\AnchorObjectInterface; use bunq\Model\Core\BunqModel; /** @@ -13,7 +14,7 @@ * * @generated */ -class Device extends BunqModel +class Device extends BunqModel implements AnchorObjectInterface { /** * Error constants. @@ -120,4 +121,16 @@ public function getReferencedObject() throw new BunqException(self::ERROR_NULL_FIELDS); } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->deviceServer)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/DeviceServer.php b/src/Model/Generated/Endpoint/DeviceServer.php index 4ab64a13..3d9c12dc 100644 --- a/src/Model/Generated/Endpoint/DeviceServer.php +++ b/src/Model/Generated/Endpoint/DeviceServer.php @@ -272,4 +272,36 @@ public function setStatus($status) { $this->status = $status; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->created)) { + return false; + } + + if (!is_null($this->updated)) { + return false; + } + + if (!is_null($this->description)) { + return false; + } + + if (!is_null($this->ip)) { + return false; + } + + if (!is_null($this->status)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/DraftPayment.php b/src/Model/Generated/Endpoint/DraftPayment.php index afaafd0c..9d06550c 100644 --- a/src/Model/Generated/Endpoint/DraftPayment.php +++ b/src/Model/Generated/Endpoint/DraftPayment.php @@ -356,4 +356,44 @@ public function setObject($object) { $this->object = $object; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->monetaryAccountId)) { + return false; + } + + if (!is_null($this->userAliasCreated)) { + return false; + } + + if (!is_null($this->responses)) { + return false; + } + + if (!is_null($this->status)) { + return false; + } + + if (!is_null($this->type)) { + return false; + } + + if (!is_null($this->entries)) { + return false; + } + + if (!is_null($this->object)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/DraftShareInviteBank.php b/src/Model/Generated/Endpoint/DraftShareInviteBank.php index ce51a8d9..6df5a1e7 100644 --- a/src/Model/Generated/Endpoint/DraftShareInviteBank.php +++ b/src/Model/Generated/Endpoint/DraftShareInviteBank.php @@ -323,4 +323,40 @@ public function setId($id) { $this->id = $id; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->userAliasCreated)) { + return false; + } + + if (!is_null($this->status)) { + return false; + } + + if (!is_null($this->expiration)) { + return false; + } + + if (!is_null($this->shareInviteBankResponseId)) { + return false; + } + + if (!is_null($this->draftShareUrl)) { + return false; + } + + if (!is_null($this->draftShareSettings)) { + return false; + } + + if (!is_null($this->id)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/DraftShareInviteBankQrCodeContent.php b/src/Model/Generated/Endpoint/DraftShareInviteBankQrCodeContent.php index 10cee91a..d4c1df62 100644 --- a/src/Model/Generated/Endpoint/DraftShareInviteBankQrCodeContent.php +++ b/src/Model/Generated/Endpoint/DraftShareInviteBankQrCodeContent.php @@ -56,4 +56,12 @@ public static function listing(ApiContext $apiContext, int $userId, int $draftSh new BunqResponse($responseRaw->getBodyString(), $responseRaw->getHeaders()) ); } + + /** + * @return bool + */ + public function isAllFieldNull() + { + return true; + } } diff --git a/src/Model/Generated/Endpoint/ExportAnnualOverview.php b/src/Model/Generated/Endpoint/ExportAnnualOverview.php index de5fac8b..8252d3c7 100644 --- a/src/Model/Generated/Endpoint/ExportAnnualOverview.php +++ b/src/Model/Generated/Endpoint/ExportAnnualOverview.php @@ -242,4 +242,32 @@ public function setAliasUser($aliasUser) { $this->aliasUser = $aliasUser; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->created)) { + return false; + } + + if (!is_null($this->updated)) { + return false; + } + + if (!is_null($this->year)) { + return false; + } + + if (!is_null($this->aliasUser)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/ExportAnnualOverviewContent.php b/src/Model/Generated/Endpoint/ExportAnnualOverviewContent.php index f904f426..d3aa9491 100644 --- a/src/Model/Generated/Endpoint/ExportAnnualOverviewContent.php +++ b/src/Model/Generated/Endpoint/ExportAnnualOverviewContent.php @@ -54,4 +54,12 @@ public static function listing(ApiContext $apiContext, int $userId, int $exportA new BunqResponse($responseRaw->getBodyString(), $responseRaw->getHeaders()) ); } + + /** + * @return bool + */ + public function isAllFieldNull() + { + return true; + } } diff --git a/src/Model/Generated/Endpoint/IdealMerchantTransaction.php b/src/Model/Generated/Endpoint/IdealMerchantTransaction.php index 1eaf6704..a7f58ae2 100644 --- a/src/Model/Generated/Endpoint/IdealMerchantTransaction.php +++ b/src/Model/Generated/Endpoint/IdealMerchantTransaction.php @@ -465,4 +465,68 @@ public function setAllowChat($allowChat) { $this->allowChat = $allowChat; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->monetaryAccountId)) { + return false; + } + + if (!is_null($this->alias)) { + return false; + } + + if (!is_null($this->counterpartyAlias)) { + return false; + } + + if (!is_null($this->amountGuaranteed)) { + return false; + } + + if (!is_null($this->amountRequested)) { + return false; + } + + if (!is_null($this->expiration)) { + return false; + } + + if (!is_null($this->issuer)) { + return false; + } + + if (!is_null($this->issuerName)) { + return false; + } + + if (!is_null($this->issuerAuthenticationUrl)) { + return false; + } + + if (!is_null($this->purchaseIdentifier)) { + return false; + } + + if (!is_null($this->status)) { + return false; + } + + if (!is_null($this->statusTimestamp)) { + return false; + } + + if (!is_null($this->transactionIdentifier)) { + return false; + } + + if (!is_null($this->allowChat)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/InstallationServerPublicKey.php b/src/Model/Generated/Endpoint/InstallationServerPublicKey.php index f62294df..ec77d621 100644 --- a/src/Model/Generated/Endpoint/InstallationServerPublicKey.php +++ b/src/Model/Generated/Endpoint/InstallationServerPublicKey.php @@ -79,4 +79,16 @@ public function setServerPublicKey($serverPublicKey) { $this->serverPublicKey = $serverPublicKey; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->serverPublicKey)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/Invoice.php b/src/Model/Generated/Endpoint/Invoice.php index bba343d3..7ab32142 100644 --- a/src/Model/Generated/Endpoint/Invoice.php +++ b/src/Model/Generated/Endpoint/Invoice.php @@ -491,4 +491,76 @@ public function setVatNumber($vatNumber) { $this->vatNumber = $vatNumber; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->created)) { + return false; + } + + if (!is_null($this->updated)) { + return false; + } + + if (!is_null($this->invoiceDate)) { + return false; + } + + if (!is_null($this->invoiceNumber)) { + return false; + } + + if (!is_null($this->status)) { + return false; + } + + if (!is_null($this->group)) { + return false; + } + + if (!is_null($this->totalVatInclusive)) { + return false; + } + + if (!is_null($this->totalVatExclusive)) { + return false; + } + + if (!is_null($this->totalVat)) { + return false; + } + + if (!is_null($this->alias)) { + return false; + } + + if (!is_null($this->address)) { + return false; + } + + if (!is_null($this->counterpartyAlias)) { + return false; + } + + if (!is_null($this->counterpartyAddress)) { + return false; + } + + if (!is_null($this->chamberOfCommerceNumber)) { + return false; + } + + if (!is_null($this->vatNumber)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/InvoiceByUser.php b/src/Model/Generated/Endpoint/InvoiceByUser.php index e8967a7e..87bb6ab7 100644 --- a/src/Model/Generated/Endpoint/InvoiceByUser.php +++ b/src/Model/Generated/Endpoint/InvoiceByUser.php @@ -482,4 +482,76 @@ public function setVatNumber($vatNumber) { $this->vatNumber = $vatNumber; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->created)) { + return false; + } + + if (!is_null($this->updated)) { + return false; + } + + if (!is_null($this->invoiceDate)) { + return false; + } + + if (!is_null($this->invoiceNumber)) { + return false; + } + + if (!is_null($this->status)) { + return false; + } + + if (!is_null($this->group)) { + return false; + } + + if (!is_null($this->totalVatInclusive)) { + return false; + } + + if (!is_null($this->totalVatExclusive)) { + return false; + } + + if (!is_null($this->totalVat)) { + return false; + } + + if (!is_null($this->alias)) { + return false; + } + + if (!is_null($this->address)) { + return false; + } + + if (!is_null($this->counterpartyAlias)) { + return false; + } + + if (!is_null($this->counterpartyAddress)) { + return false; + } + + if (!is_null($this->chamberOfCommerceNumber)) { + return false; + } + + if (!is_null($this->vatNumber)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/MasterCardAction.php b/src/Model/Generated/Endpoint/MasterCardAction.php index a5accdd6..a8efce6e 100644 --- a/src/Model/Generated/Endpoint/MasterCardAction.php +++ b/src/Model/Generated/Endpoint/MasterCardAction.php @@ -666,4 +666,104 @@ public function setEligibleWhitelistId($eligibleWhitelistId) { $this->eligibleWhitelistId = $eligibleWhitelistId; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->monetaryAccountId)) { + return false; + } + + if (!is_null($this->cardId)) { + return false; + } + + if (!is_null($this->amountLocal)) { + return false; + } + + if (!is_null($this->amountBilling)) { + return false; + } + + if (!is_null($this->amountOriginalLocal)) { + return false; + } + + if (!is_null($this->amountOriginalBilling)) { + return false; + } + + if (!is_null($this->amountFee)) { + return false; + } + + if (!is_null($this->decision)) { + return false; + } + + if (!is_null($this->decisionDescription)) { + return false; + } + + if (!is_null($this->decisionDescriptionTranslated)) { + return false; + } + + if (!is_null($this->description)) { + return false; + } + + if (!is_null($this->authorisationStatus)) { + return false; + } + + if (!is_null($this->authorisationType)) { + return false; + } + + if (!is_null($this->panEntryModeUser)) { + return false; + } + + if (!is_null($this->city)) { + return false; + } + + if (!is_null($this->alias)) { + return false; + } + + if (!is_null($this->counterpartyAlias)) { + return false; + } + + if (!is_null($this->labelCard)) { + return false; + } + + if (!is_null($this->tokenStatus)) { + return false; + } + + if (!is_null($this->reservationExpiryTime)) { + return false; + } + + if (!is_null($this->appliedLimit)) { + return false; + } + + if (!is_null($this->allowChat)) { + return false; + } + + if (!is_null($this->eligibleWhitelistId)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/MonetaryAccount.php b/src/Model/Generated/Endpoint/MonetaryAccount.php index 0587e034..b0b4f397 100644 --- a/src/Model/Generated/Endpoint/MonetaryAccount.php +++ b/src/Model/Generated/Endpoint/MonetaryAccount.php @@ -5,6 +5,7 @@ use bunq\exception\BunqException; use bunq\Http\ApiClient; use bunq\Http\BunqResponse; +use bunq\Model\Core\AnchorObjectInterface; use bunq\Model\Core\BunqModel; /** @@ -16,7 +17,7 @@ * * @generated */ -class MonetaryAccount extends BunqModel +class MonetaryAccount extends BunqModel implements AnchorObjectInterface { /** * Error constants. @@ -124,4 +125,16 @@ public function getReferencedObject() throw new BunqException(self::ERROR_NULL_FIELDS); } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->monetaryAccountBank)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/MonetaryAccountBank.php b/src/Model/Generated/Endpoint/MonetaryAccountBank.php index dc732896..9a62785f 100644 --- a/src/Model/Generated/Endpoint/MonetaryAccountBank.php +++ b/src/Model/Generated/Endpoint/MonetaryAccountBank.php @@ -685,4 +685,92 @@ public function setSetting($setting) { $this->setting = $setting; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->created)) { + return false; + } + + if (!is_null($this->updated)) { + return false; + } + + if (!is_null($this->avatar)) { + return false; + } + + if (!is_null($this->currency)) { + return false; + } + + if (!is_null($this->description)) { + return false; + } + + if (!is_null($this->dailyLimit)) { + return false; + } + + if (!is_null($this->dailySpent)) { + return false; + } + + if (!is_null($this->overdraftLimit)) { + return false; + } + + if (!is_null($this->balance)) { + return false; + } + + if (!is_null($this->alias)) { + return false; + } + + if (!is_null($this->publicUuid)) { + return false; + } + + if (!is_null($this->status)) { + return false; + } + + if (!is_null($this->subStatus)) { + return false; + } + + if (!is_null($this->reason)) { + return false; + } + + if (!is_null($this->reasonDescription)) { + return false; + } + + if (!is_null($this->userId)) { + return false; + } + + if (!is_null($this->monetaryAccountProfile)) { + return false; + } + + if (!is_null($this->notificationFilters)) { + return false; + } + + if (!is_null($this->setting)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/MonetaryAccountProfile.php b/src/Model/Generated/Endpoint/MonetaryAccountProfile.php index 624b4039..cbdc9eee 100644 --- a/src/Model/Generated/Endpoint/MonetaryAccountProfile.php +++ b/src/Model/Generated/Endpoint/MonetaryAccountProfile.php @@ -73,4 +73,20 @@ public function setProfileDrain($profileDrain) { $this->profileDrain = $profileDrain; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->profileFill)) { + return false; + } + + if (!is_null($this->profileDrain)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/Payment.php b/src/Model/Generated/Endpoint/Payment.php index 6a657b71..47891a0f 100644 --- a/src/Model/Generated/Endpoint/Payment.php +++ b/src/Model/Generated/Endpoint/Payment.php @@ -728,4 +728,104 @@ public function setAllowChat($allowChat) { $this->allowChat = $allowChat; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->created)) { + return false; + } + + if (!is_null($this->updated)) { + return false; + } + + if (!is_null($this->monetaryAccountId)) { + return false; + } + + if (!is_null($this->amount)) { + return false; + } + + if (!is_null($this->alias)) { + return false; + } + + if (!is_null($this->counterpartyAlias)) { + return false; + } + + if (!is_null($this->description)) { + return false; + } + + if (!is_null($this->type)) { + return false; + } + + if (!is_null($this->subType)) { + return false; + } + + if (!is_null($this->bunqtoStatus)) { + return false; + } + + if (!is_null($this->bunqtoSubStatus)) { + return false; + } + + if (!is_null($this->bunqtoShareUrl)) { + return false; + } + + if (!is_null($this->bunqtoExpiry)) { + return false; + } + + if (!is_null($this->bunqtoTimeResponded)) { + return false; + } + + if (!is_null($this->attachment)) { + return false; + } + + if (!is_null($this->merchantReference)) { + return false; + } + + if (!is_null($this->batchId)) { + return false; + } + + if (!is_null($this->scheduledId)) { + return false; + } + + if (!is_null($this->addressShipping)) { + return false; + } + + if (!is_null($this->addressBilling)) { + return false; + } + + if (!is_null($this->geolocation)) { + return false; + } + + if (!is_null($this->allowChat)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/PaymentBatch.php b/src/Model/Generated/Endpoint/PaymentBatch.php index d93fb4ee..750a97e7 100644 --- a/src/Model/Generated/Endpoint/PaymentBatch.php +++ b/src/Model/Generated/Endpoint/PaymentBatch.php @@ -175,4 +175,16 @@ public function setPayments($payments) { $this->payments = $payments; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->payments)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/PaymentChat.php b/src/Model/Generated/Endpoint/PaymentChat.php index 378d0e5d..cfbc9d30 100644 --- a/src/Model/Generated/Endpoint/PaymentChat.php +++ b/src/Model/Generated/Endpoint/PaymentChat.php @@ -220,4 +220,28 @@ public function setUnreadMessageCount($unreadMessageCount) { $this->unreadMessageCount = $unreadMessageCount; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->created)) { + return false; + } + + if (!is_null($this->updated)) { + return false; + } + + if (!is_null($this->unreadMessageCount)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/PermittedIp.php b/src/Model/Generated/Endpoint/PermittedIp.php index f3288067..dc91b46a 100644 --- a/src/Model/Generated/Endpoint/PermittedIp.php +++ b/src/Model/Generated/Endpoint/PermittedIp.php @@ -194,4 +194,20 @@ public function setStatus($status) { $this->status = $status; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->ip)) { + return false; + } + + if (!is_null($this->status)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/PromotionDisplay.php b/src/Model/Generated/Endpoint/PromotionDisplay.php index 7efd7ce0..5e0ea07a 100644 --- a/src/Model/Generated/Endpoint/PromotionDisplay.php +++ b/src/Model/Generated/Endpoint/PromotionDisplay.php @@ -181,4 +181,28 @@ public function setStatus($status) { $this->status = $status; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->counterpartyAlias)) { + return false; + } + + if (!is_null($this->eventDescription)) { + return false; + } + + if (!is_null($this->status)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/RequestInquiry.php b/src/Model/Generated/Endpoint/RequestInquiry.php index 0b614a91..e0ed4fa7 100644 --- a/src/Model/Generated/Endpoint/RequestInquiry.php +++ b/src/Model/Generated/Endpoint/RequestInquiry.php @@ -808,4 +808,112 @@ public function setAllowChat($allowChat) { $this->allowChat = $allowChat; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->created)) { + return false; + } + + if (!is_null($this->updated)) { + return false; + } + + if (!is_null($this->timeResponded)) { + return false; + } + + if (!is_null($this->timeExpiry)) { + return false; + } + + if (!is_null($this->monetaryAccountId)) { + return false; + } + + if (!is_null($this->amountInquired)) { + return false; + } + + if (!is_null($this->amountResponded)) { + return false; + } + + if (!is_null($this->userAliasCreated)) { + return false; + } + + if (!is_null($this->userAliasRevoked)) { + return false; + } + + if (!is_null($this->counterpartyAlias)) { + return false; + } + + if (!is_null($this->description)) { + return false; + } + + if (!is_null($this->merchantReference)) { + return false; + } + + if (!is_null($this->attachment)) { + return false; + } + + if (!is_null($this->status)) { + return false; + } + + if (!is_null($this->batchId)) { + return false; + } + + if (!is_null($this->scheduledId)) { + return false; + } + + if (!is_null($this->minimumAge)) { + return false; + } + + if (!is_null($this->requireAddress)) { + return false; + } + + if (!is_null($this->bunqmeShareUrl)) { + return false; + } + + if (!is_null($this->redirectUrl)) { + return false; + } + + if (!is_null($this->addressShipping)) { + return false; + } + + if (!is_null($this->addressBilling)) { + return false; + } + + if (!is_null($this->geolocation)) { + return false; + } + + if (!is_null($this->allowChat)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/RequestInquiryBatch.php b/src/Model/Generated/Endpoint/RequestInquiryBatch.php index ed9f109e..f5ad5c89 100644 --- a/src/Model/Generated/Endpoint/RequestInquiryBatch.php +++ b/src/Model/Generated/Endpoint/RequestInquiryBatch.php @@ -202,4 +202,20 @@ public function setTotalAmountInquired($totalAmountInquired) { $this->totalAmountInquired = $totalAmountInquired; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->requestInquiries)) { + return false; + } + + if (!is_null($this->totalAmountInquired)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/RequestInquiryChat.php b/src/Model/Generated/Endpoint/RequestInquiryChat.php index 6723767e..f9bd6000 100644 --- a/src/Model/Generated/Endpoint/RequestInquiryChat.php +++ b/src/Model/Generated/Endpoint/RequestInquiryChat.php @@ -224,4 +224,28 @@ public function setUnreadMessageCount($unreadMessageCount) { $this->unreadMessageCount = $unreadMessageCount; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->created)) { + return false; + } + + if (!is_null($this->updated)) { + return false; + } + + if (!is_null($this->unreadMessageCount)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/RequestResponse.php b/src/Model/Generated/Endpoint/RequestResponse.php index 113f34d9..f0f45a50 100644 --- a/src/Model/Generated/Endpoint/RequestResponse.php +++ b/src/Model/Generated/Endpoint/RequestResponse.php @@ -776,4 +776,112 @@ public function setEligibleWhitelistId($eligibleWhitelistId) { $this->eligibleWhitelistId = $eligibleWhitelistId; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->created)) { + return false; + } + + if (!is_null($this->updated)) { + return false; + } + + if (!is_null($this->timeResponded)) { + return false; + } + + if (!is_null($this->timeExpiry)) { + return false; + } + + if (!is_null($this->monetaryAccountId)) { + return false; + } + + if (!is_null($this->amountInquired)) { + return false; + } + + if (!is_null($this->amountResponded)) { + return false; + } + + if (!is_null($this->status)) { + return false; + } + + if (!is_null($this->description)) { + return false; + } + + if (!is_null($this->alias)) { + return false; + } + + if (!is_null($this->counterpartyAlias)) { + return false; + } + + if (!is_null($this->attachment)) { + return false; + } + + if (!is_null($this->minimumAge)) { + return false; + } + + if (!is_null($this->requireAddress)) { + return false; + } + + if (!is_null($this->geolocation)) { + return false; + } + + if (!is_null($this->type)) { + return false; + } + + if (!is_null($this->subType)) { + return false; + } + + if (!is_null($this->redirectUrl)) { + return false; + } + + if (!is_null($this->addressBilling)) { + return false; + } + + if (!is_null($this->addressShipping)) { + return false; + } + + if (!is_null($this->allowChat)) { + return false; + } + + if (!is_null($this->creditSchemeIdentifier)) { + return false; + } + + if (!is_null($this->mandateIdentifier)) { + return false; + } + + if (!is_null($this->eligibleWhitelistId)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/RequestResponseChat.php b/src/Model/Generated/Endpoint/RequestResponseChat.php index 2e06ca51..98bfb4a2 100644 --- a/src/Model/Generated/Endpoint/RequestResponseChat.php +++ b/src/Model/Generated/Endpoint/RequestResponseChat.php @@ -224,4 +224,28 @@ public function setUnreadMessageCount($unreadMessageCount) { $this->unreadMessageCount = $unreadMessageCount; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->created)) { + return false; + } + + if (!is_null($this->updated)) { + return false; + } + + if (!is_null($this->unreadMessageCount)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/Schedule.php b/src/Model/Generated/Endpoint/Schedule.php index 8f213bad..78eb4037 100644 --- a/src/Model/Generated/Endpoint/Schedule.php +++ b/src/Model/Generated/Endpoint/Schedule.php @@ -249,4 +249,36 @@ public function setObject($object) { $this->object = $object; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->timeStart)) { + return false; + } + + if (!is_null($this->timeEnd)) { + return false; + } + + if (!is_null($this->recurrenceUnit)) { + return false; + } + + if (!is_null($this->recurrenceSize)) { + return false; + } + + if (!is_null($this->status)) { + return false; + } + + if (!is_null($this->object)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/ScheduleInstance.php b/src/Model/Generated/Endpoint/ScheduleInstance.php index 2384ba04..48f41204 100644 --- a/src/Model/Generated/Endpoint/ScheduleInstance.php +++ b/src/Model/Generated/Endpoint/ScheduleInstance.php @@ -271,4 +271,36 @@ public function setResultObject($resultObject) { $this->resultObject = $resultObject; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->state)) { + return false; + } + + if (!is_null($this->timeStart)) { + return false; + } + + if (!is_null($this->timeEnd)) { + return false; + } + + if (!is_null($this->errorMessage)) { + return false; + } + + if (!is_null($this->scheduledObject)) { + return false; + } + + if (!is_null($this->resultObject)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/SchedulePayment.php b/src/Model/Generated/Endpoint/SchedulePayment.php index 794e42ad..59057587 100644 --- a/src/Model/Generated/Endpoint/SchedulePayment.php +++ b/src/Model/Generated/Endpoint/SchedulePayment.php @@ -216,4 +216,20 @@ public function setSchedule($schedule) { $this->schedule = $schedule; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->payment)) { + return false; + } + + if (!is_null($this->schedule)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/SchedulePaymentBatch.php b/src/Model/Generated/Endpoint/SchedulePaymentBatch.php index e5403844..e0116ffb 100644 --- a/src/Model/Generated/Endpoint/SchedulePaymentBatch.php +++ b/src/Model/Generated/Endpoint/SchedulePaymentBatch.php @@ -159,4 +159,20 @@ public function setSchedule($schedule) { $this->schedule = $schedule; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->payments)) { + return false; + } + + if (!is_null($this->schedule)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/ScheduleUser.php b/src/Model/Generated/Endpoint/ScheduleUser.php index 5e57971f..e40fedfc 100644 --- a/src/Model/Generated/Endpoint/ScheduleUser.php +++ b/src/Model/Generated/Endpoint/ScheduleUser.php @@ -57,4 +57,12 @@ public static function listing(ApiContext $apiContext, int $userId, array $param static::fromJsonList($responseRaw, self::OBJECT_TYPE) ); } + + /** + * @return bool + */ + public function isAllFieldNull() + { + return true; + } } diff --git a/src/Model/Generated/Endpoint/Session.php b/src/Model/Generated/Endpoint/Session.php index 8025a1a4..034c92ab 100644 --- a/src/Model/Generated/Endpoint/Session.php +++ b/src/Model/Generated/Endpoint/Session.php @@ -47,4 +47,12 @@ public static function delete(ApiContext $apiContext, int $sessionId, array $cus new BunqResponse(null, $responseRaw->getHeaders()) ); } + + /** + * @return bool + */ + public function isAllFieldNull() + { + return true; + } } diff --git a/src/Model/Generated/Endpoint/ShareInviteBankAmountUsed.php b/src/Model/Generated/Endpoint/ShareInviteBankAmountUsed.php index f077d90b..7db9c0cc 100644 --- a/src/Model/Generated/Endpoint/ShareInviteBankAmountUsed.php +++ b/src/Model/Generated/Endpoint/ShareInviteBankAmountUsed.php @@ -55,4 +55,12 @@ public static function delete(ApiContext $apiContext, int $userId, int $monetary new BunqResponse(null, $responseRaw->getHeaders()) ); } + + /** + * @return bool + */ + public function isAllFieldNull() + { + return true; + } } diff --git a/src/Model/Generated/Endpoint/ShareInviteBankInquiry.php b/src/Model/Generated/Endpoint/ShareInviteBankInquiry.php index e92c7002..38405792 100644 --- a/src/Model/Generated/Endpoint/ShareInviteBankInquiry.php +++ b/src/Model/Generated/Endpoint/ShareInviteBankInquiry.php @@ -468,4 +468,60 @@ public function setId($id) { $this->id = $id; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->alias)) { + return false; + } + + if (!is_null($this->userAliasCreated)) { + return false; + } + + if (!is_null($this->userAliasRevoked)) { + return false; + } + + if (!is_null($this->counterUserAlias)) { + return false; + } + + if (!is_null($this->monetaryAccountId)) { + return false; + } + + if (!is_null($this->draftShareInviteBankId)) { + return false; + } + + if (!is_null($this->shareDetail)) { + return false; + } + + if (!is_null($this->status)) { + return false; + } + + if (!is_null($this->shareType)) { + return false; + } + + if (!is_null($this->startDate)) { + return false; + } + + if (!is_null($this->endDate)) { + return false; + } + + if (!is_null($this->id)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/ShareInviteBankResponse.php b/src/Model/Generated/Endpoint/ShareInviteBankResponse.php index 64be6cb6..449e82e0 100644 --- a/src/Model/Generated/Endpoint/ShareInviteBankResponse.php +++ b/src/Model/Generated/Endpoint/ShareInviteBankResponse.php @@ -379,4 +379,52 @@ public function setDescription($description) { $this->description = $description; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->counterAlias)) { + return false; + } + + if (!is_null($this->userAliasCancelled)) { + return false; + } + + if (!is_null($this->monetaryAccountId)) { + return false; + } + + if (!is_null($this->draftShareInviteBankId)) { + return false; + } + + if (!is_null($this->shareDetail)) { + return false; + } + + if (!is_null($this->status)) { + return false; + } + + if (!is_null($this->shareType)) { + return false; + } + + if (!is_null($this->startDate)) { + return false; + } + + if (!is_null($this->endDate)) { + return false; + } + + if (!is_null($this->description)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/Tab.php b/src/Model/Generated/Endpoint/Tab.php index c890c247..5fb37b6a 100644 --- a/src/Model/Generated/Endpoint/Tab.php +++ b/src/Model/Generated/Endpoint/Tab.php @@ -5,6 +5,7 @@ use bunq\exception\BunqException; use bunq\Http\ApiClient; use bunq\Http\BunqResponse; +use bunq\Model\Core\AnchorObjectInterface; use bunq\Model\Core\BunqModel; /** @@ -18,7 +19,7 @@ * * @generated */ -class Tab extends BunqModel +class Tab extends BunqModel implements AnchorObjectInterface { /** * Error constants. @@ -155,4 +156,20 @@ public function getReferencedObject() throw new BunqException(self::ERROR_NULL_FIELDS); } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->tabUsageSingle)) { + return false; + } + + if (!is_null($this->tabUsageMultiple)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/TabAttachmentTab.php b/src/Model/Generated/Endpoint/TabAttachmentTab.php index ec01af97..80bad5e1 100644 --- a/src/Model/Generated/Endpoint/TabAttachmentTab.php +++ b/src/Model/Generated/Endpoint/TabAttachmentTab.php @@ -151,4 +151,28 @@ public function setAttachment($attachment) { $this->attachment = $attachment; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->created)) { + return false; + } + + if (!is_null($this->updated)) { + return false; + } + + if (!is_null($this->attachment)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/TabAttachmentTabContent.php b/src/Model/Generated/Endpoint/TabAttachmentTabContent.php index 5252bd5d..b2757137 100644 --- a/src/Model/Generated/Endpoint/TabAttachmentTabContent.php +++ b/src/Model/Generated/Endpoint/TabAttachmentTabContent.php @@ -53,4 +53,12 @@ public static function listing(ApiContext $apiContext, string $tabUuid, int $att new BunqResponse($responseRaw->getBodyString(), $responseRaw->getHeaders()) ); } + + /** + * @return bool + */ + public function isAllFieldNull() + { + return true; + } } diff --git a/src/Model/Generated/Endpoint/TabItem.php b/src/Model/Generated/Endpoint/TabItem.php index e2bec03f..a0aac48b 100644 --- a/src/Model/Generated/Endpoint/TabItem.php +++ b/src/Model/Generated/Endpoint/TabItem.php @@ -196,4 +196,40 @@ public function setAmount($amount) { $this->amount = $amount; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->description)) { + return false; + } + + if (!is_null($this->eanCode)) { + return false; + } + + if (!is_null($this->avatarAttachment)) { + return false; + } + + if (!is_null($this->tabAttachment)) { + return false; + } + + if (!is_null($this->quantity)) { + return false; + } + + if (!is_null($this->amount)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/TabItemShop.php b/src/Model/Generated/Endpoint/TabItemShop.php index 0d124c47..45d55f52 100644 --- a/src/Model/Generated/Endpoint/TabItemShop.php +++ b/src/Model/Generated/Endpoint/TabItemShop.php @@ -376,4 +376,40 @@ public function setAmount($amount) { $this->amount = $amount; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->description)) { + return false; + } + + if (!is_null($this->eanCode)) { + return false; + } + + if (!is_null($this->avatarAttachment)) { + return false; + } + + if (!is_null($this->tabAttachment)) { + return false; + } + + if (!is_null($this->quantity)) { + return false; + } + + if (!is_null($this->amount)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/TabItemShopBatch.php b/src/Model/Generated/Endpoint/TabItemShopBatch.php index b8e1ed7f..8c2a3d73 100644 --- a/src/Model/Generated/Endpoint/TabItemShopBatch.php +++ b/src/Model/Generated/Endpoint/TabItemShopBatch.php @@ -82,4 +82,16 @@ public function setTabItems($tabItems) { $this->tabItems = $tabItems; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->tabItems)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/TabQrCodeContent.php b/src/Model/Generated/Endpoint/TabQrCodeContent.php index 824186c8..d9c10648 100644 --- a/src/Model/Generated/Endpoint/TabQrCodeContent.php +++ b/src/Model/Generated/Endpoint/TabQrCodeContent.php @@ -58,4 +58,12 @@ public static function listing(ApiContext $apiContext, int $userId, int $monetar new BunqResponse($responseRaw->getBodyString(), $responseRaw->getHeaders()) ); } + + /** + * @return bool + */ + public function isAllFieldNull() + { + return true; + } } diff --git a/src/Model/Generated/Endpoint/TabResultInquiry.php b/src/Model/Generated/Endpoint/TabResultInquiry.php index b0189f8e..c02dd3fb 100644 --- a/src/Model/Generated/Endpoint/TabResultInquiry.php +++ b/src/Model/Generated/Endpoint/TabResultInquiry.php @@ -138,4 +138,20 @@ public function setPayment($payment) { $this->payment = $payment; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->tab)) { + return false; + } + + if (!is_null($this->payment)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/TabResultResponse.php b/src/Model/Generated/Endpoint/TabResultResponse.php index b134ab33..2938a023 100644 --- a/src/Model/Generated/Endpoint/TabResultResponse.php +++ b/src/Model/Generated/Endpoint/TabResultResponse.php @@ -134,4 +134,20 @@ public function setPayment($payment) { $this->payment = $payment; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->tab)) { + return false; + } + + if (!is_null($this->payment)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/TabUsageMultiple.php b/src/Model/Generated/Endpoint/TabUsageMultiple.php index 963b7a55..37ac71f0 100644 --- a/src/Model/Generated/Endpoint/TabUsageMultiple.php +++ b/src/Model/Generated/Endpoint/TabUsageMultiple.php @@ -644,4 +644,80 @@ public function setTabAttachment($tabAttachment) { $this->tabAttachment = $tabAttachment; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->uuid)) { + return false; + } + + if (!is_null($this->created)) { + return false; + } + + if (!is_null($this->updated)) { + return false; + } + + if (!is_null($this->description)) { + return false; + } + + if (!is_null($this->status)) { + return false; + } + + if (!is_null($this->amountTotal)) { + return false; + } + + if (!is_null($this->qrCodeToken)) { + return false; + } + + if (!is_null($this->tabUrl)) { + return false; + } + + if (!is_null($this->visibility)) { + return false; + } + + if (!is_null($this->minimumAge)) { + return false; + } + + if (!is_null($this->requireAddress)) { + return false; + } + + if (!is_null($this->redirectUrl)) { + return false; + } + + if (!is_null($this->expiration)) { + return false; + } + + if (!is_null($this->alias)) { + return false; + } + + if (!is_null($this->cashRegisterLocation)) { + return false; + } + + if (!is_null($this->tabItem)) { + return false; + } + + if (!is_null($this->tabAttachment)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/TabUsageSingle.php b/src/Model/Generated/Endpoint/TabUsageSingle.php index b9de3deb..a56f0b59 100644 --- a/src/Model/Generated/Endpoint/TabUsageSingle.php +++ b/src/Model/Generated/Endpoint/TabUsageSingle.php @@ -694,4 +694,88 @@ public function setTabAttachment($tabAttachment) { $this->tabAttachment = $tabAttachment; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->uuid)) { + return false; + } + + if (!is_null($this->created)) { + return false; + } + + if (!is_null($this->updated)) { + return false; + } + + if (!is_null($this->merchantReference)) { + return false; + } + + if (!is_null($this->description)) { + return false; + } + + if (!is_null($this->status)) { + return false; + } + + if (!is_null($this->amountTotal)) { + return false; + } + + if (!is_null($this->amountPaid)) { + return false; + } + + if (!is_null($this->qrCodeToken)) { + return false; + } + + if (!is_null($this->tabUrl)) { + return false; + } + + if (!is_null($this->visibility)) { + return false; + } + + if (!is_null($this->minimumAge)) { + return false; + } + + if (!is_null($this->requireAddress)) { + return false; + } + + if (!is_null($this->redirectUrl)) { + return false; + } + + if (!is_null($this->expiration)) { + return false; + } + + if (!is_null($this->alias)) { + return false; + } + + if (!is_null($this->cashRegisterLocation)) { + return false; + } + + if (!is_null($this->tabItem)) { + return false; + } + + if (!is_null($this->tabAttachment)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/TokenQrRequestIdeal.php b/src/Model/Generated/Endpoint/TokenQrRequestIdeal.php index def7294e..a6d4b48e 100644 --- a/src/Model/Generated/Endpoint/TokenQrRequestIdeal.php +++ b/src/Model/Generated/Endpoint/TokenQrRequestIdeal.php @@ -576,4 +576,92 @@ public function setEligibleWhitelistId($eligibleWhitelistId) { $this->eligibleWhitelistId = $eligibleWhitelistId; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->timeResponded)) { + return false; + } + + if (!is_null($this->timeExpiry)) { + return false; + } + + if (!is_null($this->monetaryAccountId)) { + return false; + } + + if (!is_null($this->amountInquired)) { + return false; + } + + if (!is_null($this->amountResponded)) { + return false; + } + + if (!is_null($this->alias)) { + return false; + } + + if (!is_null($this->counterpartyAlias)) { + return false; + } + + if (!is_null($this->description)) { + return false; + } + + if (!is_null($this->attachment)) { + return false; + } + + if (!is_null($this->status)) { + return false; + } + + if (!is_null($this->minimumAge)) { + return false; + } + + if (!is_null($this->requireAddress)) { + return false; + } + + if (!is_null($this->addressShipping)) { + return false; + } + + if (!is_null($this->addressBilling)) { + return false; + } + + if (!is_null($this->geolocation)) { + return false; + } + + if (!is_null($this->redirectUrl)) { + return false; + } + + if (!is_null($this->type)) { + return false; + } + + if (!is_null($this->subType)) { + return false; + } + + if (!is_null($this->allowChat)) { + return false; + } + + if (!is_null($this->eligibleWhitelistId)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/User.php b/src/Model/Generated/Endpoint/User.php index b2d5ac61..d2a56f90 100644 --- a/src/Model/Generated/Endpoint/User.php +++ b/src/Model/Generated/Endpoint/User.php @@ -5,6 +5,7 @@ use bunq\exception\BunqException; use bunq\Http\ApiClient; use bunq\Http\BunqResponse; +use bunq\Model\Core\AnchorObjectInterface; use bunq\Model\Core\BunqModel; /** @@ -13,7 +14,7 @@ * * @generated */ -class User extends BunqModel +class User extends BunqModel implements AnchorObjectInterface { /** * Error constants. @@ -169,4 +170,24 @@ public function getReferencedObject() throw new BunqException(self::ERROR_NULL_FIELDS); } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->userLight)) { + return false; + } + + if (!is_null($this->userPerson)) { + return false; + } + + if (!is_null($this->userCompany)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/UserCompany.php b/src/Model/Generated/Endpoint/UserCompany.php index f6dda727..c7ed3d88 100644 --- a/src/Model/Generated/Endpoint/UserCompany.php +++ b/src/Model/Generated/Endpoint/UserCompany.php @@ -845,4 +845,128 @@ public function setBillingContract($billingContract) { $this->billingContract = $billingContract; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->created)) { + return false; + } + + if (!is_null($this->updated)) { + return false; + } + + if (!is_null($this->publicUuid)) { + return false; + } + + if (!is_null($this->name)) { + return false; + } + + if (!is_null($this->displayName)) { + return false; + } + + if (!is_null($this->publicNickName)) { + return false; + } + + if (!is_null($this->alias)) { + return false; + } + + if (!is_null($this->chamberOfCommerceNumber)) { + return false; + } + + if (!is_null($this->typeOfBusinessEntity)) { + return false; + } + + if (!is_null($this->sectorOfIndustry)) { + return false; + } + + if (!is_null($this->counterBankIban)) { + return false; + } + + if (!is_null($this->avatar)) { + return false; + } + + if (!is_null($this->addressMain)) { + return false; + } + + if (!is_null($this->addressPostal)) { + return false; + } + + if (!is_null($this->versionTermsOfService)) { + return false; + } + + if (!is_null($this->directorAlias)) { + return false; + } + + if (!is_null($this->language)) { + return false; + } + + if (!is_null($this->country)) { + return false; + } + + if (!is_null($this->region)) { + return false; + } + + if (!is_null($this->ubo)) { + return false; + } + + if (!is_null($this->status)) { + return false; + } + + if (!is_null($this->subStatus)) { + return false; + } + + if (!is_null($this->sessionTimeout)) { + return false; + } + + if (!is_null($this->dailyLimitWithoutConfirmationLogin)) { + return false; + } + + if (!is_null($this->notificationFilters)) { + return false; + } + + if (!is_null($this->customer)) { + return false; + } + + if (!is_null($this->customerLimit)) { + return false; + } + + if (!is_null($this->billingContract)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/UserCredentialPasswordIp.php b/src/Model/Generated/Endpoint/UserCredentialPasswordIp.php index 3f002fc3..4260f7c7 100644 --- a/src/Model/Generated/Endpoint/UserCredentialPasswordIp.php +++ b/src/Model/Generated/Endpoint/UserCredentialPasswordIp.php @@ -255,4 +255,40 @@ public function setPermittedDevice($permittedDevice) { $this->permittedDevice = $permittedDevice; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->created)) { + return false; + } + + if (!is_null($this->updated)) { + return false; + } + + if (!is_null($this->status)) { + return false; + } + + if (!is_null($this->expiryTime)) { + return false; + } + + if (!is_null($this->tokenValue)) { + return false; + } + + if (!is_null($this->permittedDevice)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/UserLight.php b/src/Model/Generated/Endpoint/UserLight.php index 6fad6844..dfb451ea 100644 --- a/src/Model/Generated/Endpoint/UserLight.php +++ b/src/Model/Generated/Endpoint/UserLight.php @@ -902,4 +902,140 @@ public function setNotificationFilters($notificationFilters) { $this->notificationFilters = $notificationFilters; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->created)) { + return false; + } + + if (!is_null($this->updated)) { + return false; + } + + if (!is_null($this->publicUuid)) { + return false; + } + + if (!is_null($this->firstName)) { + return false; + } + + if (!is_null($this->middleName)) { + return false; + } + + if (!is_null($this->lastName)) { + return false; + } + + if (!is_null($this->legalName)) { + return false; + } + + if (!is_null($this->displayName)) { + return false; + } + + if (!is_null($this->publicNickName)) { + return false; + } + + if (!is_null($this->alias)) { + return false; + } + + if (!is_null($this->socialSecurityNumber)) { + return false; + } + + if (!is_null($this->taxResident)) { + return false; + } + + if (!is_null($this->documentType)) { + return false; + } + + if (!is_null($this->documentNumber)) { + return false; + } + + if (!is_null($this->documentCountryOfIssuance)) { + return false; + } + + if (!is_null($this->addressMain)) { + return false; + } + + if (!is_null($this->addressPostal)) { + return false; + } + + if (!is_null($this->dateOfBirth)) { + return false; + } + + if (!is_null($this->placeOfBirth)) { + return false; + } + + if (!is_null($this->countryOfBirth)) { + return false; + } + + if (!is_null($this->nationality)) { + return false; + } + + if (!is_null($this->language)) { + return false; + } + + if (!is_null($this->region)) { + return false; + } + + if (!is_null($this->gender)) { + return false; + } + + if (!is_null($this->avatar)) { + return false; + } + + if (!is_null($this->versionTermsOfService)) { + return false; + } + + if (!is_null($this->status)) { + return false; + } + + if (!is_null($this->subStatus)) { + return false; + } + + if (!is_null($this->sessionTimeout)) { + return false; + } + + if (!is_null($this->dailyLimitWithoutConfirmationLogin)) { + return false; + } + + if (!is_null($this->notificationFilters)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Endpoint/UserPerson.php b/src/Model/Generated/Endpoint/UserPerson.php index f3d7ef03..34a60a70 100644 --- a/src/Model/Generated/Endpoint/UserPerson.php +++ b/src/Model/Generated/Endpoint/UserPerson.php @@ -909,4 +909,136 @@ public function setNotificationFilters($notificationFilters) { $this->notificationFilters = $notificationFilters; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->created)) { + return false; + } + + if (!is_null($this->updated)) { + return false; + } + + if (!is_null($this->publicUuid)) { + return false; + } + + if (!is_null($this->firstName)) { + return false; + } + + if (!is_null($this->middleName)) { + return false; + } + + if (!is_null($this->lastName)) { + return false; + } + + if (!is_null($this->legalName)) { + return false; + } + + if (!is_null($this->displayName)) { + return false; + } + + if (!is_null($this->publicNickName)) { + return false; + } + + if (!is_null($this->alias)) { + return false; + } + + if (!is_null($this->taxResident)) { + return false; + } + + if (!is_null($this->documentType)) { + return false; + } + + if (!is_null($this->documentNumber)) { + return false; + } + + if (!is_null($this->documentCountryOfIssuance)) { + return false; + } + + if (!is_null($this->addressMain)) { + return false; + } + + if (!is_null($this->addressPostal)) { + return false; + } + + if (!is_null($this->dateOfBirth)) { + return false; + } + + if (!is_null($this->placeOfBirth)) { + return false; + } + + if (!is_null($this->countryOfBirth)) { + return false; + } + + if (!is_null($this->nationality)) { + return false; + } + + if (!is_null($this->language)) { + return false; + } + + if (!is_null($this->region)) { + return false; + } + + if (!is_null($this->gender)) { + return false; + } + + if (!is_null($this->avatar)) { + return false; + } + + if (!is_null($this->versionTermsOfService)) { + return false; + } + + if (!is_null($this->status)) { + return false; + } + + if (!is_null($this->subStatus)) { + return false; + } + + if (!is_null($this->sessionTimeout)) { + return false; + } + + if (!is_null($this->dailyLimitWithoutConfirmationLogin)) { + return false; + } + + if (!is_null($this->notificationFilters)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/Address.php b/src/Model/Generated/Object/Address.php index 7a6d6197..8cc7ae0c 100644 --- a/src/Model/Generated/Object/Address.php +++ b/src/Model/Generated/Object/Address.php @@ -198,4 +198,40 @@ public function setProvince($province) { $this->province = $province; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->street)) { + return false; + } + + if (!is_null($this->houseNumber)) { + return false; + } + + if (!is_null($this->poBox)) { + return false; + } + + if (!is_null($this->postalCode)) { + return false; + } + + if (!is_null($this->city)) { + return false; + } + + if (!is_null($this->country)) { + return false; + } + + if (!is_null($this->province)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/Amount.php b/src/Model/Generated/Object/Amount.php index f698f5b2..b2cd8329 100644 --- a/src/Model/Generated/Object/Amount.php +++ b/src/Model/Generated/Object/Amount.php @@ -67,4 +67,20 @@ public function setCurrency($currency) { $this->currency = $currency; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->value)) { + return false; + } + + if (!is_null($this->currency)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/AnchoredObject.php b/src/Model/Generated/Object/AnchoredObject.php index 86cac134..2edbde97 100644 --- a/src/Model/Generated/Object/AnchoredObject.php +++ b/src/Model/Generated/Object/AnchoredObject.php @@ -2,6 +2,7 @@ namespace bunq\Model\Generated\Object; use bunq\exception\BunqException; +use bunq\Model\Core\AnchorObjectInterface; use bunq\Model\Core\BunqModel; use bunq\Model\Generated\Endpoint\CardDebit; use bunq\Model\Generated\Endpoint\CardPinChange; @@ -25,7 +26,7 @@ /** * @generated */ -class AnchoredObject extends BunqModel +class AnchoredObject extends BunqModel implements AnchorObjectInterface { /** * Error constants. @@ -490,4 +491,84 @@ public function getReferencedObject() throw new BunqException(self::ERROR_NULL_FIELDS); } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->cardDebit)) { + return false; + } + + if (!is_null($this->cardPinChange)) { + return false; + } + + if (!is_null($this->cardResult)) { + return false; + } + + if (!is_null($this->draftPayment)) { + return false; + } + + if (!is_null($this->idealMerchantTransaction)) { + return false; + } + + if (!is_null($this->invoice)) { + return false; + } + + if (!is_null($this->payment)) { + return false; + } + + if (!is_null($this->paymentBatch)) { + return false; + } + + if (!is_null($this->promotionDisplay)) { + return false; + } + + if (!is_null($this->requestInquiryBatch)) { + return false; + } + + if (!is_null($this->requestInquiry)) { + return false; + } + + if (!is_null($this->requestResponse)) { + return false; + } + + if (!is_null($this->scheduledPaymentBatch)) { + return false; + } + + if (!is_null($this->scheduledPayment)) { + return false; + } + + if (!is_null($this->scheduledInstance)) { + return false; + } + + if (!is_null($this->shareInviteBankInquiry)) { + return false; + } + + if (!is_null($this->shareInviteBankResponse)) { + return false; + } + + if (!is_null($this->userCredentialPasswordIp)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/Attachment.php b/src/Model/Generated/Object/Attachment.php index 35be5570..85ba6dbe 100644 --- a/src/Model/Generated/Object/Attachment.php +++ b/src/Model/Generated/Object/Attachment.php @@ -57,4 +57,20 @@ public function setContentType($contentType) { $this->contentType = $contentType; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->description)) { + return false; + } + + if (!is_null($this->contentType)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/AttachmentMonetaryAccountPayment.php b/src/Model/Generated/Object/AttachmentMonetaryAccountPayment.php index 691fe3da..62e69ace 100644 --- a/src/Model/Generated/Object/AttachmentMonetaryAccountPayment.php +++ b/src/Model/Generated/Object/AttachmentMonetaryAccountPayment.php @@ -65,4 +65,20 @@ public function setMonetaryAccountId($monetaryAccountId) { $this->monetaryAccountId = $monetaryAccountId; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->monetaryAccountId)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/AttachmentPublic.php b/src/Model/Generated/Object/AttachmentPublic.php index c037d283..ac292eb0 100644 --- a/src/Model/Generated/Object/AttachmentPublic.php +++ b/src/Model/Generated/Object/AttachmentPublic.php @@ -82,4 +82,24 @@ public function setContentType($contentType) { $this->contentType = $contentType; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->uuid)) { + return false; + } + + if (!is_null($this->description)) { + return false; + } + + if (!is_null($this->contentType)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/AttachmentTab.php b/src/Model/Generated/Object/AttachmentTab.php index cd685600..c6981bb7 100644 --- a/src/Model/Generated/Object/AttachmentTab.php +++ b/src/Model/Generated/Object/AttachmentTab.php @@ -82,4 +82,24 @@ public function setContentType($contentType) { $this->contentType = $contentType; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->description)) { + return false; + } + + if (!is_null($this->contentType)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/Avatar.php b/src/Model/Generated/Object/Avatar.php index 6f5c9bc5..e63a1c87 100644 --- a/src/Model/Generated/Object/Avatar.php +++ b/src/Model/Generated/Object/Avatar.php @@ -90,4 +90,24 @@ public function setImage($image) { $this->image = $image; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->uuid)) { + return false; + } + + if (!is_null($this->anchorUuid)) { + return false; + } + + if (!is_null($this->image)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/BudgetRestriction.php b/src/Model/Generated/Object/BudgetRestriction.php index f2475813..3b3ee1cd 100644 --- a/src/Model/Generated/Object/BudgetRestriction.php +++ b/src/Model/Generated/Object/BudgetRestriction.php @@ -59,4 +59,20 @@ public function setFrequency($frequency) { $this->frequency = $frequency; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->amount)) { + return false; + } + + if (!is_null($this->frequency)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/BunqId.php b/src/Model/Generated/Object/BunqId.php index f3051b51..18e20112 100644 --- a/src/Model/Generated/Object/BunqId.php +++ b/src/Model/Generated/Object/BunqId.php @@ -40,4 +40,16 @@ public function setId($id) { $this->id = $id; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/BunqMeMerchantAvailable.php b/src/Model/Generated/Object/BunqMeMerchantAvailable.php index e02da794..56b874b3 100644 --- a/src/Model/Generated/Object/BunqMeMerchantAvailable.php +++ b/src/Model/Generated/Object/BunqMeMerchantAvailable.php @@ -57,4 +57,20 @@ public function setAvailable($available) { $this->available = $available; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->merchantType)) { + return false; + } + + if (!is_null($this->available)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/CardCountryPermission.php b/src/Model/Generated/Object/CardCountryPermission.php index de24dc85..5af4e47e 100644 --- a/src/Model/Generated/Object/CardCountryPermission.php +++ b/src/Model/Generated/Object/CardCountryPermission.php @@ -90,4 +90,24 @@ public function setExpiryTime($expiryTime) { $this->expiryTime = $expiryTime; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->country)) { + return false; + } + + if (!is_null($this->expiryTime)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/CardLimit.php b/src/Model/Generated/Object/CardLimit.php index e513468e..5a96284e 100644 --- a/src/Model/Generated/Object/CardLimit.php +++ b/src/Model/Generated/Object/CardLimit.php @@ -121,4 +121,28 @@ public function setType($type) { $this->type = $type; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->dailyLimit)) { + return false; + } + + if (!is_null($this->currency)) { + return false; + } + + if (!is_null($this->type)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/CardMagStripePermission.php b/src/Model/Generated/Object/CardMagStripePermission.php index 71230a01..518383a1 100644 --- a/src/Model/Generated/Object/CardMagStripePermission.php +++ b/src/Model/Generated/Object/CardMagStripePermission.php @@ -32,4 +32,16 @@ public function setExpiryTime($expiryTime) { $this->expiryTime = $expiryTime; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->expiryTime)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/CardPinAssignment.php b/src/Model/Generated/Object/CardPinAssignment.php index f0010a10..2cc67db8 100644 --- a/src/Model/Generated/Object/CardPinAssignment.php +++ b/src/Model/Generated/Object/CardPinAssignment.php @@ -72,4 +72,20 @@ public function setMonetaryAccountId($monetaryAccountId) { $this->monetaryAccountId = $monetaryAccountId; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->type)) { + return false; + } + + if (!is_null($this->monetaryAccountId)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/Certificate.php b/src/Model/Generated/Object/Certificate.php index 190bca18..659d2121 100644 --- a/src/Model/Generated/Object/Certificate.php +++ b/src/Model/Generated/Object/Certificate.php @@ -40,4 +40,16 @@ public function setCertificate($certificate) { $this->certificate = $certificate; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->certificate)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/ChatMessageContent.php b/src/Model/Generated/Object/ChatMessageContent.php index 7108b651..6ae43e2e 100644 --- a/src/Model/Generated/Object/ChatMessageContent.php +++ b/src/Model/Generated/Object/ChatMessageContent.php @@ -2,12 +2,13 @@ namespace bunq\Model\Generated\Object; use bunq\exception\BunqException; +use bunq\Model\Core\AnchorObjectInterface; use bunq\Model\Core\BunqModel; /** * @generated */ -class ChatMessageContent extends BunqModel +class ChatMessageContent extends BunqModel implements AnchorObjectInterface { /** * Error constants. @@ -200,4 +201,40 @@ public function getReferencedObject() throw new BunqException(self::ERROR_NULL_FIELDS); } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->chatMessageContentAnchorEvent)) { + return false; + } + + if (!is_null($this->chatMessageContentAttachment)) { + return false; + } + + if (!is_null($this->chatMessageContentGeolocation)) { + return false; + } + + if (!is_null($this->chatMessageContentStatusConversationTitle)) { + return false; + } + + if (!is_null($this->chatMessageContentStatusConversation)) { + return false; + } + + if (!is_null($this->chatMessageContentStatusMembership)) { + return false; + } + + if (!is_null($this->chatMessageContentText)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/ChatMessageContentAnchorEvent.php b/src/Model/Generated/Object/ChatMessageContentAnchorEvent.php index 824d660b..118621fc 100644 --- a/src/Model/Generated/Object/ChatMessageContentAnchorEvent.php +++ b/src/Model/Generated/Object/ChatMessageContentAnchorEvent.php @@ -42,4 +42,16 @@ public function setAnchoredObject($anchoredObject) { $this->anchoredObject = $anchoredObject; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->anchoredObject)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/ChatMessageContentAttachment.php b/src/Model/Generated/Object/ChatMessageContentAttachment.php index 86884bbd..81b0d0a0 100644 --- a/src/Model/Generated/Object/ChatMessageContentAttachment.php +++ b/src/Model/Generated/Object/ChatMessageContentAttachment.php @@ -32,4 +32,16 @@ public function setAttachment($attachment) { $this->attachment = $attachment; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->attachment)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/ChatMessageContentGeolocation.php b/src/Model/Generated/Object/ChatMessageContentGeolocation.php index 43ae6088..c3d99029 100644 --- a/src/Model/Generated/Object/ChatMessageContentGeolocation.php +++ b/src/Model/Generated/Object/ChatMessageContentGeolocation.php @@ -32,4 +32,16 @@ public function setGeolocation($geolocation) { $this->geolocation = $geolocation; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->geolocation)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/ChatMessageContentStatusConversation.php b/src/Model/Generated/Object/ChatMessageContentStatusConversation.php index 3ba3e96e..165ee3fc 100644 --- a/src/Model/Generated/Object/ChatMessageContentStatusConversation.php +++ b/src/Model/Generated/Object/ChatMessageContentStatusConversation.php @@ -32,4 +32,16 @@ public function setAction($action) { $this->action = $action; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->action)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/ChatMessageContentStatusConversationTitle.php b/src/Model/Generated/Object/ChatMessageContentStatusConversationTitle.php index a124407f..1fae3877 100644 --- a/src/Model/Generated/Object/ChatMessageContentStatusConversationTitle.php +++ b/src/Model/Generated/Object/ChatMessageContentStatusConversationTitle.php @@ -32,4 +32,16 @@ public function setTitle($title) { $this->title = $title; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->title)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/ChatMessageContentStatusMembership.php b/src/Model/Generated/Object/ChatMessageContentStatusMembership.php index d4519c74..a264ddfe 100644 --- a/src/Model/Generated/Object/ChatMessageContentStatusMembership.php +++ b/src/Model/Generated/Object/ChatMessageContentStatusMembership.php @@ -59,4 +59,20 @@ public function setMember($member) { $this->member = $member; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->action)) { + return false; + } + + if (!is_null($this->member)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/ChatMessageContentText.php b/src/Model/Generated/Object/ChatMessageContentText.php index 4128ee4c..fa71b002 100644 --- a/src/Model/Generated/Object/ChatMessageContentText.php +++ b/src/Model/Generated/Object/ChatMessageContentText.php @@ -32,4 +32,16 @@ public function setText($text) { $this->text = $text; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->text)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/DraftPaymentAnchorObject.php b/src/Model/Generated/Object/DraftPaymentAnchorObject.php index 8a7b3bbd..5b06ddf2 100644 --- a/src/Model/Generated/Object/DraftPaymentAnchorObject.php +++ b/src/Model/Generated/Object/DraftPaymentAnchorObject.php @@ -2,6 +2,7 @@ namespace bunq\Model\Generated\Object; use bunq\exception\BunqException; +use bunq\Model\Core\AnchorObjectInterface; use bunq\Model\Core\BunqModel; use bunq\Model\Generated\Endpoint\Payment; use bunq\Model\Generated\Endpoint\PaymentBatch; @@ -9,7 +10,7 @@ /** * @generated */ -class DraftPaymentAnchorObject extends BunqModel +class DraftPaymentAnchorObject extends BunqModel implements AnchorObjectInterface { /** * Error constants. @@ -74,4 +75,20 @@ public function getReferencedObject() throw new BunqException(self::ERROR_NULL_FIELDS); } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->payment)) { + return false; + } + + if (!is_null($this->paymentBatch)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/DraftPaymentEntry.php b/src/Model/Generated/Object/DraftPaymentEntry.php index 97b1c812..532caf24 100644 --- a/src/Model/Generated/Object/DraftPaymentEntry.php +++ b/src/Model/Generated/Object/DraftPaymentEntry.php @@ -234,4 +234,44 @@ public function setAttachment($attachment) { $this->attachment = $attachment; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->amount)) { + return false; + } + + if (!is_null($this->alias)) { + return false; + } + + if (!is_null($this->counterpartyAlias)) { + return false; + } + + if (!is_null($this->description)) { + return false; + } + + if (!is_null($this->merchantReference)) { + return false; + } + + if (!is_null($this->type)) { + return false; + } + + if (!is_null($this->attachment)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/DraftPaymentResponse.php b/src/Model/Generated/Object/DraftPaymentResponse.php index a648d0f3..b178f8fd 100644 --- a/src/Model/Generated/Object/DraftPaymentResponse.php +++ b/src/Model/Generated/Object/DraftPaymentResponse.php @@ -57,4 +57,20 @@ public function setUserAliasCreated($userAliasCreated) { $this->userAliasCreated = $userAliasCreated; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->status)) { + return false; + } + + if (!is_null($this->userAliasCreated)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/DraftShareInviteBankEntry.php b/src/Model/Generated/Object/DraftShareInviteBankEntry.php index 80d0bc66..c9f5ac16 100644 --- a/src/Model/Generated/Object/DraftShareInviteBankEntry.php +++ b/src/Model/Generated/Object/DraftShareInviteBankEntry.php @@ -90,4 +90,24 @@ public function setEndDate($endDate) { $this->endDate = $endDate; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->shareDetail)) { + return false; + } + + if (!is_null($this->startDate)) { + return false; + } + + if (!is_null($this->endDate)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/Error.php b/src/Model/Generated/Object/Error.php index d494edff..2f73bbdd 100644 --- a/src/Model/Generated/Object/Error.php +++ b/src/Model/Generated/Object/Error.php @@ -57,4 +57,20 @@ public function setErrorDescriptionTranslated($errorDescriptionTranslated) { $this->errorDescriptionTranslated = $errorDescriptionTranslated; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->errorDescription)) { + return false; + } + + if (!is_null($this->errorDescriptionTranslated)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/Geolocation.php b/src/Model/Generated/Object/Geolocation.php index 571c9b24..6a3e85e9 100644 --- a/src/Model/Generated/Object/Geolocation.php +++ b/src/Model/Generated/Object/Geolocation.php @@ -107,4 +107,28 @@ public function setRadius($radius) { $this->radius = $radius; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->latitude)) { + return false; + } + + if (!is_null($this->longitude)) { + return false; + } + + if (!is_null($this->altitude)) { + return false; + } + + if (!is_null($this->radius)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/Image.php b/src/Model/Generated/Object/Image.php index 65eb0c87..ea5993cd 100644 --- a/src/Model/Generated/Object/Image.php +++ b/src/Model/Generated/Object/Image.php @@ -107,4 +107,28 @@ public function setWidth($width) { $this->width = $width; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->attachmentPublicUuid)) { + return false; + } + + if (!is_null($this->contentType)) { + return false; + } + + if (!is_null($this->height)) { + return false; + } + + if (!is_null($this->width)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/InvoiceItem.php b/src/Model/Generated/Object/InvoiceItem.php index 75d23ae4..4ff32ca9 100644 --- a/src/Model/Generated/Object/InvoiceItem.php +++ b/src/Model/Generated/Object/InvoiceItem.php @@ -232,4 +232,48 @@ public function setTotalVatInclusive($totalVatInclusive) { $this->totalVatInclusive = $totalVatInclusive; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->billingDate)) { + return false; + } + + if (!is_null($this->typeDescription)) { + return false; + } + + if (!is_null($this->typeDescriptionTranslated)) { + return false; + } + + if (!is_null($this->unitVatExclusive)) { + return false; + } + + if (!is_null($this->unitVatInclusive)) { + return false; + } + + if (!is_null($this->vat)) { + return false; + } + + if (!is_null($this->quantity)) { + return false; + } + + if (!is_null($this->totalVatExclusive)) { + return false; + } + + if (!is_null($this->totalVatInclusive)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/InvoiceItemGroup.php b/src/Model/Generated/Object/InvoiceItemGroup.php index 68a0cd71..2403f379 100644 --- a/src/Model/Generated/Object/InvoiceItemGroup.php +++ b/src/Model/Generated/Object/InvoiceItemGroup.php @@ -182,4 +182,40 @@ public function setItem($item) { $this->item = $item; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->type)) { + return false; + } + + if (!is_null($this->typeDescription)) { + return false; + } + + if (!is_null($this->typeDescriptionTranslated)) { + return false; + } + + if (!is_null($this->instanceDescription)) { + return false; + } + + if (!is_null($this->productVatExclusive)) { + return false; + } + + if (!is_null($this->productVatInclusive)) { + return false; + } + + if (!is_null($this->item)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/Issuer.php b/src/Model/Generated/Object/Issuer.php index 178ebc51..739b84ce 100644 --- a/src/Model/Generated/Object/Issuer.php +++ b/src/Model/Generated/Object/Issuer.php @@ -65,4 +65,20 @@ public function setName($name) { $this->name = $name; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->bic)) { + return false; + } + + if (!is_null($this->name)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/LabelCard.php b/src/Model/Generated/Object/LabelCard.php index e075d0f5..824aa79b 100644 --- a/src/Model/Generated/Object/LabelCard.php +++ b/src/Model/Generated/Object/LabelCard.php @@ -157,4 +157,36 @@ public function setLabelUser($labelUser) { $this->labelUser = $labelUser; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->uuid)) { + return false; + } + + if (!is_null($this->type)) { + return false; + } + + if (!is_null($this->secondLine)) { + return false; + } + + if (!is_null($this->expiryDate)) { + return false; + } + + if (!is_null($this->status)) { + return false; + } + + if (!is_null($this->labelUser)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/LabelMonetaryAccount.php b/src/Model/Generated/Object/LabelMonetaryAccount.php index dc3b7151..9f5f9052 100644 --- a/src/Model/Generated/Object/LabelMonetaryAccount.php +++ b/src/Model/Generated/Object/LabelMonetaryAccount.php @@ -232,4 +232,48 @@ public function setSwiftAccountNumber($swiftAccountNumber) { $this->swiftAccountNumber = $swiftAccountNumber; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->iban)) { + return false; + } + + if (!is_null($this->displayName)) { + return false; + } + + if (!is_null($this->avatar)) { + return false; + } + + if (!is_null($this->labelUser)) { + return false; + } + + if (!is_null($this->country)) { + return false; + } + + if (!is_null($this->bunqMe)) { + return false; + } + + if (!is_null($this->isLight)) { + return false; + } + + if (!is_null($this->swiftBic)) { + return false; + } + + if (!is_null($this->swiftAccountNumber)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/LabelUser.php b/src/Model/Generated/Object/LabelUser.php index 3815d634..a0187428 100644 --- a/src/Model/Generated/Object/LabelUser.php +++ b/src/Model/Generated/Object/LabelUser.php @@ -144,4 +144,32 @@ public function setCountry($country) { $this->country = $country; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->uuid)) { + return false; + } + + if (!is_null($this->avatar)) { + return false; + } + + if (!is_null($this->publicNickName)) { + return false; + } + + if (!is_null($this->displayName)) { + return false; + } + + if (!is_null($this->country)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/MonetaryAccountProfileDrain.php b/src/Model/Generated/Object/MonetaryAccountProfileDrain.php index f8c5b9e9..a471ab2a 100644 --- a/src/Model/Generated/Object/MonetaryAccountProfileDrain.php +++ b/src/Model/Generated/Object/MonetaryAccountProfileDrain.php @@ -121,4 +121,28 @@ public function setSavingsAccountAlias($savingsAccountAlias) { $this->savingsAccountAlias = $savingsAccountAlias; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->status)) { + return false; + } + + if (!is_null($this->balancePreferred)) { + return false; + } + + if (!is_null($this->balanceThresholdHigh)) { + return false; + } + + if (!is_null($this->savingsAccountAlias)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/MonetaryAccountProfileFill.php b/src/Model/Generated/Object/MonetaryAccountProfileFill.php index 24639659..26861b03 100644 --- a/src/Model/Generated/Object/MonetaryAccountProfileFill.php +++ b/src/Model/Generated/Object/MonetaryAccountProfileFill.php @@ -148,4 +148,32 @@ public function setIssuer($issuer) { $this->issuer = $issuer; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->status)) { + return false; + } + + if (!is_null($this->balancePreferred)) { + return false; + } + + if (!is_null($this->balanceThresholdLow)) { + return false; + } + + if (!is_null($this->methodFill)) { + return false; + } + + if (!is_null($this->issuer)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/MonetaryAccountSetting.php b/src/Model/Generated/Object/MonetaryAccountSetting.php index a04d4229..fdf21441 100644 --- a/src/Model/Generated/Object/MonetaryAccountSetting.php +++ b/src/Model/Generated/Object/MonetaryAccountSetting.php @@ -86,4 +86,24 @@ public function setRestrictionChat($restrictionChat) { $this->restrictionChat = $restrictionChat; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->color)) { + return false; + } + + if (!is_null($this->defaultAvatarStatus)) { + return false; + } + + if (!is_null($this->restrictionChat)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/NotificationAnchorObject.php b/src/Model/Generated/Object/NotificationAnchorObject.php index 2ba5d2b2..fc283423 100644 --- a/src/Model/Generated/Object/NotificationAnchorObject.php +++ b/src/Model/Generated/Object/NotificationAnchorObject.php @@ -2,18 +2,18 @@ namespace bunq\Model\Generated\Object; use bunq\exception\BunqException; +use bunq\Model\Core\AnchorObjectInterface; use bunq\Model\Core\BunqModel; +use bunq\Model\Generated\Endpoint\BunqMeFundraiserResult; use bunq\Model\Generated\Endpoint\BunqMeTab; use bunq\Model\Generated\Endpoint\BunqMeTabResultInquiry; use bunq\Model\Generated\Endpoint\BunqMeTabResultResponse; -use bunq\Model\Generated\Endpoint\ChatMessageAnnouncement; -use bunq\Model\Generated\Endpoint\ChatMessageStatus; -use bunq\Model\Generated\Endpoint\ChatMessageUser; +use bunq\Model\Generated\Endpoint\ChatMessage; use bunq\Model\Generated\Endpoint\DraftPayment; use bunq\Model\Generated\Endpoint\IdealMerchantTransaction; use bunq\Model\Generated\Endpoint\Invoice; use bunq\Model\Generated\Endpoint\MasterCardAction; -use bunq\Model\Generated\Endpoint\MonetaryAccountBank; +use bunq\Model\Generated\Endpoint\MonetaryAccount; use bunq\Model\Generated\Endpoint\Payment; use bunq\Model\Generated\Endpoint\PaymentBatch; use bunq\Model\Generated\Endpoint\RequestInquiry; @@ -25,19 +25,23 @@ use bunq\Model\Generated\Endpoint\ShareInviteBankResponse; use bunq\Model\Generated\Endpoint\TabResultInquiry; use bunq\Model\Generated\Endpoint\TabResultResponse; -use bunq\Model\Generated\Endpoint\UserCompany; -use bunq\Model\Generated\Endpoint\UserPerson; +use bunq\Model\Generated\Endpoint\User; /** * @generated */ -class NotificationAnchorObject extends BunqModel +class NotificationAnchorObject extends BunqModel implements AnchorObjectInterface { /** * Error constants. */ const ERROR_NULL_FIELDS = 'All fields of an extended model or object are null.'; + /** + * @var BunqMeFundraiserResult + */ + protected $bunqMeFundraiserResult; + /** * @var BunqMeTab */ @@ -54,19 +58,9 @@ class NotificationAnchorObject extends BunqModel protected $bunqMeTabResultResponse; /** - * @var ChatMessageStatus - */ - protected $chatMessageStatus; - - /** - * @var ChatMessageUser + * @var ChatMessage */ - protected $chatMessageUser; - - /** - * @var ChatMessageAnnouncement - */ - protected $chatMessageAnnouncement; + protected $chatMessage; /** * @var DraftPayment @@ -89,9 +83,9 @@ class NotificationAnchorObject extends BunqModel protected $masterCardAction; /** - * @var MonetaryAccountBank + * @var MonetaryAccount */ - protected $monetaryAccountBank; + protected $monetaryAccount; /** * @var Payment @@ -149,14 +143,25 @@ class NotificationAnchorObject extends BunqModel protected $tabResultResponse; /** - * @var UserPerson + * @var User */ - protected $userPerson; + protected $user; /** - * @var UserCompany + * @return BunqMeFundraiserResult */ - protected $userCompany; + public function getBunqMeFundraiserResult() + { + return $this->bunqMeFundraiserResult; + } + + /** + * @param BunqMeFundraiserResult $bunqMeFundraiserResult + */ + public function setBunqMeFundraiserResult($bunqMeFundraiserResult) + { + $this->bunqMeFundraiserResult = $bunqMeFundraiserResult; + } /** * @return BunqMeTab @@ -207,51 +212,19 @@ public function setBunqMeTabResultResponse($bunqMeTabResultResponse) } /** - * @return ChatMessageStatus - */ - public function getChatMessageStatus() - { - return $this->chatMessageStatus; - } - - /** - * @param ChatMessageStatus $chatMessageStatus - */ - public function setChatMessageStatus($chatMessageStatus) - { - $this->chatMessageStatus = $chatMessageStatus; - } - - /** - * @return ChatMessageUser - */ - public function getChatMessageUser() - { - return $this->chatMessageUser; - } - - /** - * @param ChatMessageUser $chatMessageUser - */ - public function setChatMessageUser($chatMessageUser) - { - $this->chatMessageUser = $chatMessageUser; - } - - /** - * @return ChatMessageAnnouncement + * @return ChatMessage */ - public function getChatMessageAnnouncement() + public function getChatMessage() { - return $this->chatMessageAnnouncement; + return $this->chatMessage; } /** - * @param ChatMessageAnnouncement $chatMessageAnnouncement + * @param ChatMessage $chatMessage */ - public function setChatMessageAnnouncement($chatMessageAnnouncement) + public function setChatMessage($chatMessage) { - $this->chatMessageAnnouncement = $chatMessageAnnouncement; + $this->chatMessage = $chatMessage; } /** @@ -319,19 +292,19 @@ public function setMasterCardAction($masterCardAction) } /** - * @return MonetaryAccountBank + * @return MonetaryAccount */ - public function getMonetaryAccountBank() + public function getMonetaryAccount() { - return $this->monetaryAccountBank; + return $this->monetaryAccount; } /** - * @param MonetaryAccountBank $monetaryAccountBank + * @param MonetaryAccount $monetaryAccount */ - public function setMonetaryAccountBank($monetaryAccountBank) + public function setMonetaryAccount($monetaryAccount) { - $this->monetaryAccountBank = $monetaryAccountBank; + $this->monetaryAccount = $monetaryAccount; } /** @@ -511,35 +484,19 @@ public function setTabResultResponse($tabResultResponse) } /** - * @return UserPerson - */ - public function getUserPerson() - { - return $this->userPerson; - } - - /** - * @param UserPerson $userPerson - */ - public function setUserPerson($userPerson) - { - $this->userPerson = $userPerson; - } - - /** - * @return UserCompany + * @return User */ - public function getUserCompany() + public function getUser() { - return $this->userCompany; + return $this->user; } /** - * @param UserCompany $userCompany + * @param User $user */ - public function setUserCompany($userCompany) + public function setUser($user) { - $this->userCompany = $userCompany; + $this->user = $user; } /** @@ -548,6 +505,10 @@ public function setUserCompany($userCompany) */ public function getReferencedObject() { + if (!is_null($this->bunqMeFundraiserResult)) { + return $this->bunqMeFundraiserResult; + } + if (!is_null($this->bunqMeTab)) { return $this->bunqMeTab; } @@ -560,16 +521,8 @@ public function getReferencedObject() return $this->bunqMeTabResultResponse; } - if (!is_null($this->chatMessageStatus)) { - return $this->chatMessageStatus; - } - - if (!is_null($this->chatMessageUser)) { - return $this->chatMessageUser; - } - - if (!is_null($this->chatMessageAnnouncement)) { - return $this->chatMessageAnnouncement; + if (!is_null($this->chatMessage)) { + return $this->chatMessage; } if (!is_null($this->draftPayment)) { @@ -588,8 +541,8 @@ public function getReferencedObject() return $this->masterCardAction; } - if (!is_null($this->monetaryAccountBank)) { - return $this->monetaryAccountBank; + if (!is_null($this->monetaryAccount)) { + return $this->monetaryAccount; } if (!is_null($this->payment)) { @@ -636,14 +589,106 @@ public function getReferencedObject() return $this->tabResultResponse; } - if (!is_null($this->userPerson)) { - return $this->userPerson; + if (!is_null($this->user)) { + return $this->user; } - if (!is_null($this->userCompany)) { - return $this->userCompany; + throw new BunqException(self::ERROR_NULL_FIELDS); + } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->bunqMeFundraiserResult)) { + return false; } - throw new BunqException(self::ERROR_NULL_FIELDS); + if (!is_null($this->bunqMeTab)) { + return false; + } + + if (!is_null($this->bunqMeTabResultInquiry)) { + return false; + } + + if (!is_null($this->bunqMeTabResultResponse)) { + return false; + } + + if (!is_null($this->chatMessage)) { + return false; + } + + if (!is_null($this->draftPayment)) { + return false; + } + + if (!is_null($this->idealMerchantTransaction)) { + return false; + } + + if (!is_null($this->invoice)) { + return false; + } + + if (!is_null($this->masterCardAction)) { + return false; + } + + if (!is_null($this->monetaryAccount)) { + return false; + } + + if (!is_null($this->payment)) { + return false; + } + + if (!is_null($this->paymentBatch)) { + return false; + } + + if (!is_null($this->requestInquiry)) { + return false; + } + + if (!is_null($this->requestInquiryBatch)) { + return false; + } + + if (!is_null($this->requestResponse)) { + return false; + } + + if (!is_null($this->shareInviteBankInquiry)) { + return false; + } + + if (!is_null($this->shareInviteBankResponse)) { + return false; + } + + if (!is_null($this->scheduledPayment)) { + return false; + } + + if (!is_null($this->scheduledInstance)) { + return false; + } + + if (!is_null($this->tabResultInquiry)) { + return false; + } + + if (!is_null($this->tabResultResponse)) { + return false; + } + + if (!is_null($this->user)) { + return false; + } + + return true; } } diff --git a/src/Model/Generated/Object/NotificationFilter.php b/src/Model/Generated/Object/NotificationFilter.php index 343ca6a4..6f408c02 100644 --- a/src/Model/Generated/Object/NotificationFilter.php +++ b/src/Model/Generated/Object/NotificationFilter.php @@ -112,4 +112,24 @@ public function setCategory($category) { $this->category = $category; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->notificationDeliveryMethod)) { + return false; + } + + if (!is_null($this->notificationTarget)) { + return false; + } + + if (!is_null($this->category)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/NotificationUrl.php b/src/Model/Generated/Object/NotificationUrl.php index 5b7238d2..dfc80982 100644 --- a/src/Model/Generated/Object/NotificationUrl.php +++ b/src/Model/Generated/Object/NotificationUrl.php @@ -91,4 +91,28 @@ public function setObject($object) { $this->object = $object; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->targetUrl)) { + return false; + } + + if (!is_null($this->category)) { + return false; + } + + if (!is_null($this->eventType)) { + return false; + } + + if (!is_null($this->object)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/PermittedDevice.php b/src/Model/Generated/Object/PermittedDevice.php index 022ce1e1..95e99c97 100644 --- a/src/Model/Generated/Object/PermittedDevice.php +++ b/src/Model/Generated/Object/PermittedDevice.php @@ -57,4 +57,20 @@ public function setIp($ip) { $this->ip = $ip; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->description)) { + return false; + } + + if (!is_null($this->ip)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/Pointer.php b/src/Model/Generated/Object/Pointer.php index 904d3e2f..c3d31983 100644 --- a/src/Model/Generated/Object/Pointer.php +++ b/src/Model/Generated/Object/Pointer.php @@ -92,4 +92,24 @@ public function setName($name) { $this->name = $name; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->type)) { + return false; + } + + if (!is_null($this->value)) { + return false; + } + + if (!is_null($this->name)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/ScheduleAnchorObject.php b/src/Model/Generated/Object/ScheduleAnchorObject.php index 33323ff6..3fa55f76 100644 --- a/src/Model/Generated/Object/ScheduleAnchorObject.php +++ b/src/Model/Generated/Object/ScheduleAnchorObject.php @@ -2,6 +2,7 @@ namespace bunq\Model\Generated\Object; use bunq\exception\BunqException; +use bunq\Model\Core\AnchorObjectInterface; use bunq\Model\Core\BunqModel; use bunq\Model\Generated\Endpoint\Payment; use bunq\Model\Generated\Endpoint\PaymentBatch; @@ -9,7 +10,7 @@ /** * @generated */ -class ScheduleAnchorObject extends BunqModel +class ScheduleAnchorObject extends BunqModel implements AnchorObjectInterface { /** * Error constants. @@ -74,4 +75,20 @@ public function getReferencedObject() throw new BunqException(self::ERROR_NULL_FIELDS); } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->payment)) { + return false; + } + + if (!is_null($this->paymentBatch)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/ScheduleInstanceAnchorObject.php b/src/Model/Generated/Object/ScheduleInstanceAnchorObject.php index 620d799a..93046628 100644 --- a/src/Model/Generated/Object/ScheduleInstanceAnchorObject.php +++ b/src/Model/Generated/Object/ScheduleInstanceAnchorObject.php @@ -2,6 +2,7 @@ namespace bunq\Model\Generated\Object; use bunq\exception\BunqException; +use bunq\Model\Core\AnchorObjectInterface; use bunq\Model\Core\BunqModel; use bunq\Model\Generated\Endpoint\Payment; use bunq\Model\Generated\Endpoint\PaymentBatch; @@ -9,7 +10,7 @@ /** * @generated */ -class ScheduleInstanceAnchorObject extends BunqModel +class ScheduleInstanceAnchorObject extends BunqModel implements AnchorObjectInterface { /** * Error constants. @@ -74,4 +75,20 @@ public function getReferencedObject() throw new BunqException(self::ERROR_NULL_FIELDS); } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->payment)) { + return false; + } + + if (!is_null($this->paymentBatch)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/SchedulePaymentEntry.php b/src/Model/Generated/Object/SchedulePaymentEntry.php index 3e894c7e..946c2507 100644 --- a/src/Model/Generated/Object/SchedulePaymentEntry.php +++ b/src/Model/Generated/Object/SchedulePaymentEntry.php @@ -189,4 +189,36 @@ public function setMerchantReference($merchantReference) { $this->merchantReference = $merchantReference; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->amount)) { + return false; + } + + if (!is_null($this->alias)) { + return false; + } + + if (!is_null($this->counterpartyAlias)) { + return false; + } + + if (!is_null($this->description)) { + return false; + } + + if (!is_null($this->attachment)) { + return false; + } + + if (!is_null($this->merchantReference)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/ShareDetail.php b/src/Model/Generated/Object/ShareDetail.php index f6514067..b17f9a48 100644 --- a/src/Model/Generated/Object/ShareDetail.php +++ b/src/Model/Generated/Object/ShareDetail.php @@ -98,4 +98,24 @@ public function setDraftPayment($draftPayment) { $this->draftPayment = $draftPayment; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->payment)) { + return false; + } + + if (!is_null($this->readOnly)) { + return false; + } + + if (!is_null($this->draftPayment)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/ShareDetailDraftPayment.php b/src/Model/Generated/Object/ShareDetailDraftPayment.php index de24ac00..832b4f86 100644 --- a/src/Model/Generated/Object/ShareDetailDraftPayment.php +++ b/src/Model/Generated/Object/ShareDetailDraftPayment.php @@ -129,4 +129,28 @@ public function setViewNewEvents($viewNewEvents) { $this->viewNewEvents = $viewNewEvents; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->makeDraftPayments)) { + return false; + } + + if (!is_null($this->viewBalance)) { + return false; + } + + if (!is_null($this->viewOldEvents)) { + return false; + } + + if (!is_null($this->viewNewEvents)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/ShareDetailPayment.php b/src/Model/Generated/Object/ShareDetailPayment.php index 222abd91..ad697c27 100644 --- a/src/Model/Generated/Object/ShareDetailPayment.php +++ b/src/Model/Generated/Object/ShareDetailPayment.php @@ -181,4 +181,36 @@ public function setBudget($budget) { $this->budget = $budget; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->makePayments)) { + return false; + } + + if (!is_null($this->makeDraftPayments)) { + return false; + } + + if (!is_null($this->viewBalance)) { + return false; + } + + if (!is_null($this->viewOldEvents)) { + return false; + } + + if (!is_null($this->viewNewEvents)) { + return false; + } + + if (!is_null($this->budget)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/ShareDetailReadOnly.php b/src/Model/Generated/Object/ShareDetailReadOnly.php index 41fdc5fa..7a9fb1ba 100644 --- a/src/Model/Generated/Object/ShareDetailReadOnly.php +++ b/src/Model/Generated/Object/ShareDetailReadOnly.php @@ -100,4 +100,24 @@ public function setViewNewEvents($viewNewEvents) { $this->viewNewEvents = $viewNewEvents; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->viewBalance)) { + return false; + } + + if (!is_null($this->viewOldEvents)) { + return false; + } + + if (!is_null($this->viewNewEvents)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/TabTextWaitingScreen.php b/src/Model/Generated/Object/TabTextWaitingScreen.php index 32f8b674..71d1cc82 100644 --- a/src/Model/Generated/Object/TabTextWaitingScreen.php +++ b/src/Model/Generated/Object/TabTextWaitingScreen.php @@ -67,4 +67,20 @@ public function setDescription($description) { $this->description = $description; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->language)) { + return false; + } + + if (!is_null($this->description)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/TabVisibility.php b/src/Model/Generated/Object/TabVisibility.php index 6683561e..3c8e2caa 100644 --- a/src/Model/Generated/Object/TabVisibility.php +++ b/src/Model/Generated/Object/TabVisibility.php @@ -94,4 +94,24 @@ public function setLocation($location) { $this->location = $location; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->cashRegisterQrCode)) { + return false; + } + + if (!is_null($this->tabQrCode)) { + return false; + } + + if (!is_null($this->location)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/TaxResident.php b/src/Model/Generated/Object/TaxResident.php index 71468d3e..2c64c0a3 100644 --- a/src/Model/Generated/Object/TaxResident.php +++ b/src/Model/Generated/Object/TaxResident.php @@ -67,4 +67,20 @@ public function setTaxNumber($taxNumber) { $this->taxNumber = $taxNumber; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->country)) { + return false; + } + + if (!is_null($this->taxNumber)) { + return false; + } + + return true; + } } diff --git a/src/Model/Generated/Object/Ubo.php b/src/Model/Generated/Object/Ubo.php index d32aa891..222388a0 100644 --- a/src/Model/Generated/Object/Ubo.php +++ b/src/Model/Generated/Object/Ubo.php @@ -82,4 +82,24 @@ public function setNationality($nationality) { $this->nationality = $nationality; } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->name)) { + return false; + } + + if (!is_null($this->dateOfBirth)) { + return false; + } + + if (!is_null($this->nationality)) { + return false; + } + + return true; + } } diff --git a/src/Util/InstallationUtil.php b/src/Util/InstallationUtil.php index 6f2cd614..f7c89e11 100644 --- a/src/Util/InstallationUtil.php +++ b/src/Util/InstallationUtil.php @@ -190,7 +190,7 @@ private static function createAccessibleReflectionMethod(string $class, string $ * * @return string[] */ - private static function formatIps(string $permittedIpsInput): array + private static function formatIps(string $permittedIpsInput = null): array { if (is_null($permittedIpsInput)) { $permittedIps = []; diff --git a/src/Util/ModelUtil.php b/src/Util/ModelUtil.php index 5855a369..9694321e 100644 --- a/src/Util/ModelUtil.php +++ b/src/Util/ModelUtil.php @@ -45,6 +45,22 @@ public static function deserializeResponseArray(string $json): array * @throws BunqException when the model is not defined. */ public static function determineModelClassNameQualified(string $model): string + { + $classNameModel = static::getModelClassNameQualifiedOrNull($model); + + if (is_null($classNameModel)) { + throw new BunqException(self::ERROR_MODEL_NOT_DEFINED, [$model]); + } + + return $classNameModel; + } + + /** + * @param string $model + * + * @return null|string + */ + public static function getModelClassNameQualifiedOrNull(string $model) { $classNameOverride = vsprintf(self::FORMAT_QUALIFIED_OVERRIDE_TYPE, [$model]); $classNameModel = vsprintf(self::FORMAT_QUALIFIED_MODEL_TYPE, [$model]); @@ -57,7 +73,7 @@ public static function determineModelClassNameQualified(string $model): string } elseif (static::isClassSubClassOfBunqModel($classNameObject)) { return $classNameObject; } else { - throw new BunqException(self::ERROR_MODEL_NOT_DEFINED, [$model]); + return null; } } diff --git a/tests/Model/Generated/Object/NotificationUrlTest.php b/tests/Model/Generated/Object/NotificationUrlTest.php index 8f9190b4..8547fb60 100644 --- a/tests/Model/Generated/Object/NotificationUrlTest.php +++ b/tests/Model/Generated/Object/NotificationUrlTest.php @@ -1,12 +1,13 @@ executeNotificationUrlTest( self::JSON_PATH_MONETARY_ACCOUNT_BANK_MODEL, - MonetaryAccountBank::class, - self::GETTER_MONETARY_ACCOUNT_BANK + MonetaryAccount::class, + self::GETTER_MONETARY_ACCOUNT, + self::GETTER_MONETARY_ACCOUNT_BANK, + MonetaryAccountBank::class ); } @@ -199,8 +204,10 @@ public function testChatMessageAnnouncementModel() { $this->executeNotificationUrlTest( self::JSON_PATH_CHAT_MESSAGE_ANNOUNCEMENT_MODEL, - ChatMessageAnnouncement::class, - self::GETTER_CHAT_MESSAGE_ANNOUNCEMENT + ChatMessage::class, + self::GETTER_CHAT_MESSAGE, + self::GETTER_CHAT_MESSAGE_ANNOUNCEMENT, + ChatMessageAnnouncement::class ); } @@ -219,11 +226,15 @@ public function testDraftPaymentModel() * @param string $expectedJsonFileName * @param string $classNameExpected * @param string $referencedObjectGetterName + * @param string|null $subClassObjectGetterName + * @param string|null $subClassNameExpected */ private function executeNotificationUrlTest( string $expectedJsonFileName, string $classNameExpected, - string $referencedObjectGetterName + string $referencedObjectGetterName, + string $subClassObjectGetterName = null, + string $subClassNameExpected = null ) { $jsonExpectedString = FileUtil::getFileContents($expectedJsonFileName); $notificationUrl = $this->getNotificationUrlFromJson($jsonExpectedString); @@ -234,6 +245,13 @@ private function executeNotificationUrlTest( static::assertNotNull($model); static::assertNotNull($referencedModel); static::assertInstanceOf($classNameExpected, $referencedModel); + + if (!is_null($subClassObjectGetterName)) { + $subClassModel = $referencedModel->$subClassObjectGetterName(); + + static::assertNotNull($subClassModel); + static::assertInstanceOf($subClassNameExpected, $subClassModel); + } } /**