From 01d78743b0f61af25a83141577821638cbdc48bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20R=C3=A4ni?= Date: Mon, 29 Jul 2019 16:49:46 +0300 Subject: [PATCH] 1.0.4 (#6) Fix nullable problems --- .openapi-generator/VERSION | 2 +- README.md | 2 +- composer.json | 2 +- lib/Api/BlacklistApi.php | 2 +- lib/Api/ContactsApi.php | 3 +- lib/Api/DeliveryReportApi.php | 2 +- lib/Api/GroupsApi.php | 2 +- lib/Api/OmnimessageApi.php | 2 +- lib/ApiException.php | 2 +- lib/Configuration.php | 6 +- lib/HeaderSelector.php | 2 +- lib/Model/Channel.php | 2 +- lib/Model/ContactEnvelope.php | 91 ++++++- lib/Model/ContactFields.php | 235 +++++++++++++++++- lib/Model/ContactListEnvelope.php | 91 ++++++- lib/Model/ContactUpdateFields.php | 226 ++++++++++++++++- lib/Model/DeliveryReportResponse.php | 109 +++++++- lib/Model/DeliveryResult.php | 136 +++++++++- lib/Model/ErrorCodeOmnichannel.php | 2 +- lib/Model/ErrorCodeOmnichannelMachine.php | 2 +- lib/Model/ErrorCodePhonebook.php | 2 +- lib/Model/ErrorItemOmnichannel.php | 118 ++++++++- lib/Model/ErrorItemPhonebook.php | 109 +++++++- lib/Model/ErrorOmnichannel.php | 91 ++++++- lib/Model/ErrorPhonebook.php | 91 ++++++- lib/Model/ErrorTitleOmnichannel.php | 2 +- lib/Model/ErrorTitlePhonebook.php | 2 +- lib/Model/FetchBlacklistSuccess.php | 91 ++++++- lib/Model/GroupEnvelope.php | 91 ++++++- lib/Model/GroupListEnvelope.php | 91 ++++++- lib/Model/GroupName.php | 91 ++++++- lib/Model/GroupResponseFields.php | 125 +++++++++- lib/Model/MessageResult.php | 109 +++++++- lib/Model/ModelInterface.php | 2 +- lib/Model/NumberToBlacklist.php | 91 ++++++- .../OmniMessageCreateSuccessResponse.php | 109 +++++++- lib/Model/Omnimessage.php | 127 +++++++++- lib/Model/SMS.php | 136 +++++++++- lib/Model/Status.php | 2 +- lib/Model/TextStore.php | 2 +- lib/Model/Viber.php | 145 ++++++++++- lib/Model/WhatsApp.php | 145 ++++++++++- lib/Model/WhatsAppAudio.php | 91 ++++++- lib/Model/WhatsAppDocument.php | 100 +++++++- lib/Model/WhatsAppImage.php | 100 +++++++- lib/Model/WhatsAppText.php | 100 +++++++- lib/ObjectSerializer.php | 11 +- phpunit.xml.dist | 4 +- 48 files changed, 2960 insertions(+), 139 deletions(-) diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index 0c89fc9..aa31e71 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0 \ No newline at end of file +4.0.3 \ No newline at end of file diff --git a/README.md b/README.md index 9fafab9..919cbee 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Messente API Library - Messente API version: 1.0.2 -- PHP artifact version: 1.0.3 +- PHP artifact version: 1.0.4 [Messente](https://messente.com) is a global provider of messaging and user verification services. Use Messente API library to send and receive SMS, Viber and WhatsApp messages, blacklist phone numbers to make sure you're not sending any unwanted messages, manage contacts and groups. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. diff --git a/composer.json b/composer.json index 5199d2d..957361a 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "messente/messente-api-php", - "version": "1.0.3", + "version": "1.0.4", "description": "[Messente](https://messente.com) is a global provider of messaging and user verification services. Use Messente API library to send and receive SMS, Viber and WhatsApp messages, blacklist phone numbers to make sure you're not sending any unwanted messages, manage contacts and groups. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world.", "keywords": ["viber", "sms", "whatsapp", "phonebook", "openapitools", "openapi-generator", diff --git a/lib/Api/BlacklistApi.php b/lib/Api/BlacklistApi.php index 7283764..ca41829 100644 --- a/lib/Api/BlacklistApi.php +++ b/lib/Api/BlacklistApi.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.2 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.0 + * OpenAPI Generator version: 4.0.3 */ /** diff --git a/lib/Api/ContactsApi.php b/lib/Api/ContactsApi.php index 6a38f33..488c1c4 100644 --- a/lib/Api/ContactsApi.php +++ b/lib/Api/ContactsApi.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.2 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -2048,7 +2048,6 @@ protected function fetchContactsRequest($groupIds = null) // query params $queryParams['groupIds'] = $groupIds; - // body params $_tempBody = null; diff --git a/lib/Api/DeliveryReportApi.php b/lib/Api/DeliveryReportApi.php index a52048b..d421539 100644 --- a/lib/Api/DeliveryReportApi.php +++ b/lib/Api/DeliveryReportApi.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.2 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.0 + * OpenAPI Generator version: 4.0.3 */ /** diff --git a/lib/Api/GroupsApi.php b/lib/Api/GroupsApi.php index 937bfd6..a5426bb 100644 --- a/lib/Api/GroupsApi.php +++ b/lib/Api/GroupsApi.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.2 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.0 + * OpenAPI Generator version: 4.0.3 */ /** diff --git a/lib/Api/OmnimessageApi.php b/lib/Api/OmnimessageApi.php index 90201f1..f950a94 100644 --- a/lib/Api/OmnimessageApi.php +++ b/lib/Api/OmnimessageApi.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.2 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.0 + * OpenAPI Generator version: 4.0.3 */ /** diff --git a/lib/ApiException.php b/lib/ApiException.php index f315f92..f992c03 100644 --- a/lib/ApiException.php +++ b/lib/ApiException.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.2 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.0 + * OpenAPI Generator version: 4.0.3 */ /** diff --git a/lib/Configuration.php b/lib/Configuration.php index 5a38b95..615e53c 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.2 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -88,7 +88,7 @@ class Configuration * * @var string */ - protected $userAgent = 'OpenAPI-Generator/1.0.3/PHP'; + protected $userAgent = 'OpenAPI-Generator/1.0.4/PHP'; /** * Debug switch (default set to false) @@ -397,7 +397,7 @@ public static function toDebugReport() $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; $report .= ' The version of the OpenAPI document: 1.0.2' . PHP_EOL; - $report .= ' SDK Package Version: 1.0.3' . PHP_EOL; + $report .= ' SDK Package Version: 1.0.4' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/lib/HeaderSelector.php b/lib/HeaderSelector.php index c608890..60e42c3 100644 --- a/lib/HeaderSelector.php +++ b/lib/HeaderSelector.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.2 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.0 + * OpenAPI Generator version: 4.0.3 */ /** diff --git a/lib/Model/Channel.php b/lib/Model/Channel.php index b71a3b8..d0087cd 100644 --- a/lib/Model/Channel.php +++ b/lib/Model/Channel.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.2 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.0 + * OpenAPI Generator version: 4.0.3 */ /** diff --git a/lib/Model/ContactEnvelope.php b/lib/Model/ContactEnvelope.php index ae7c3b6..034cf5f 100644 --- a/lib/Model/ContactEnvelope.php +++ b/lib/Model/ContactEnvelope.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.2 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -70,6 +70,22 @@ class ContactEnvelope implements ModelInterface, ArrayAccess 'contact' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'contact' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -90,6 +106,60 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of property to nullable mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPINullables() + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + public function getOpenAPINullablesSetToNull() + { + return $this->openAPINullablesSetToNull; + } + + public function setOpenAPINullablesSetToNull($nullablesSetToNull) + { + $this->openAPINullablesSetToNull=$nullablesSetToNull; + + return $this; + } + + /** + * Checks if a property is nullable + * + * @return bool + */ + public static function isNullable(string $property): bool + { + if (isset(self::$openAPINullables[$property])) { + return self::$openAPINullables[$property]; + } + + return false; + } + + /** + * Checks if a nullable property is set to null. + * + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + if (in_array($property, $this->getOpenAPINullablesSetToNull())) { + return true; + } + return false; + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -178,7 +248,18 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['contact'] = isset($data['contact']) ? $data['contact'] : null; + $this->setIfExists('contact', $data, null); + } + + public function setIfExists(string $variableName, $fields, $defaultValue) + { + if (is_array($fields) && array_key_exists($variableName, $fields) && is_null($fields[$variableName]) && self::isNullable($variableName)) { + array_push($this->openAPINullablesSetToNull, $variableName); + } + + $this->container[$variableName] = isset($fields[$variableName]) ? $fields[$variableName] : $defaultValue; + + return $this; } /** @@ -224,6 +305,12 @@ public function getContact() */ public function setContact($contact) { + + + if (is_null($contact)) { + throw new \InvalidArgumentException('non-nullable contact cannot be null'); + } + $this->container['contact'] = $contact; return $this; diff --git a/lib/Model/ContactFields.php b/lib/Model/ContactFields.php index f65eb17..17ee130 100644 --- a/lib/Model/ContactFields.php +++ b/lib/Model/ContactFields.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.2 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -88,6 +88,31 @@ class ContactFields implements ModelInterface, ArrayAccess 'custom4' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'phoneNumber' => false, + 'email' => true, + 'firstName' => true, + 'lastName' => true, + 'company' => true, + 'title' => true, + 'custom' => true, + 'custom2' => true, + 'custom3' => true, + 'custom4' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -108,6 +133,60 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of property to nullable mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPINullables() + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + public function getOpenAPINullablesSetToNull() + { + return $this->openAPINullablesSetToNull; + } + + public function setOpenAPINullablesSetToNull($nullablesSetToNull) + { + $this->openAPINullablesSetToNull=$nullablesSetToNull; + + return $this; + } + + /** + * Checks if a property is nullable + * + * @return bool + */ + public static function isNullable(string $property): bool + { + if (isset(self::$openAPINullables[$property])) { + return self::$openAPINullables[$property]; + } + + return false; + } + + /** + * Checks if a nullable property is set to null. + * + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + if (in_array($property, $this->getOpenAPINullablesSetToNull())) { + return true; + } + return false; + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -223,16 +302,27 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['phoneNumber'] = isset($data['phoneNumber']) ? $data['phoneNumber'] : null; - $this->container['email'] = isset($data['email']) ? $data['email'] : null; - $this->container['firstName'] = isset($data['firstName']) ? $data['firstName'] : null; - $this->container['lastName'] = isset($data['lastName']) ? $data['lastName'] : null; - $this->container['company'] = isset($data['company']) ? $data['company'] : null; - $this->container['title'] = isset($data['title']) ? $data['title'] : null; - $this->container['custom'] = isset($data['custom']) ? $data['custom'] : null; - $this->container['custom2'] = isset($data['custom2']) ? $data['custom2'] : null; - $this->container['custom3'] = isset($data['custom3']) ? $data['custom3'] : null; - $this->container['custom4'] = isset($data['custom4']) ? $data['custom4'] : null; + $this->setIfExists('phoneNumber', $data, null); + $this->setIfExists('email', $data, null); + $this->setIfExists('firstName', $data, null); + $this->setIfExists('lastName', $data, null); + $this->setIfExists('company', $data, null); + $this->setIfExists('title', $data, null); + $this->setIfExists('custom', $data, null); + $this->setIfExists('custom2', $data, null); + $this->setIfExists('custom3', $data, null); + $this->setIfExists('custom4', $data, null); + } + + public function setIfExists(string $variableName, $fields, $defaultValue) + { + if (is_array($fields) && array_key_exists($variableName, $fields) && is_null($fields[$variableName]) && self::isNullable($variableName)) { + array_push($this->openAPINullablesSetToNull, $variableName); + } + + $this->container[$variableName] = isset($fields[$variableName]) ? $fields[$variableName] : $defaultValue; + + return $this; } /** @@ -281,6 +371,12 @@ public function getPhoneNumber() */ public function setPhoneNumber($phoneNumber) { + + + if (is_null($phoneNumber)) { + throw new \InvalidArgumentException('non-nullable phoneNumber cannot be null'); + } + $this->container['phoneNumber'] = $phoneNumber; return $this; @@ -305,6 +401,19 @@ public function getEmail() */ public function setEmail($email) { + + if (is_null($email)) { + array_push($this->openAPINullablesSetToNull, 'email'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('email', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['email'] = $email; return $this; @@ -329,6 +438,19 @@ public function getFirstName() */ public function setFirstName($firstName) { + + if (is_null($firstName)) { + array_push($this->openAPINullablesSetToNull, 'firstName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('firstName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['firstName'] = $firstName; return $this; @@ -353,6 +475,19 @@ public function getLastName() */ public function setLastName($lastName) { + + if (is_null($lastName)) { + array_push($this->openAPINullablesSetToNull, 'lastName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lastName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['lastName'] = $lastName; return $this; @@ -377,6 +512,19 @@ public function getCompany() */ public function setCompany($company) { + + if (is_null($company)) { + array_push($this->openAPINullablesSetToNull, 'company'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('company', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['company'] = $company; return $this; @@ -401,6 +549,19 @@ public function getTitle() */ public function setTitle($title) { + + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['title'] = $title; return $this; @@ -425,6 +586,19 @@ public function getCustom() */ public function setCustom($custom) { + + if (is_null($custom)) { + array_push($this->openAPINullablesSetToNull, 'custom'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('custom', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['custom'] = $custom; return $this; @@ -449,6 +623,19 @@ public function getCustom2() */ public function setCustom2($custom2) { + + if (is_null($custom2)) { + array_push($this->openAPINullablesSetToNull, 'custom2'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('custom2', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['custom2'] = $custom2; return $this; @@ -473,6 +660,19 @@ public function getCustom3() */ public function setCustom3($custom3) { + + if (is_null($custom3)) { + array_push($this->openAPINullablesSetToNull, 'custom3'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('custom3', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['custom3'] = $custom3; return $this; @@ -497,6 +697,19 @@ public function getCustom4() */ public function setCustom4($custom4) { + + if (is_null($custom4)) { + array_push($this->openAPINullablesSetToNull, 'custom4'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('custom4', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['custom4'] = $custom4; return $this; diff --git a/lib/Model/ContactListEnvelope.php b/lib/Model/ContactListEnvelope.php index 4d414a3..896dfec 100644 --- a/lib/Model/ContactListEnvelope.php +++ b/lib/Model/ContactListEnvelope.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.2 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -70,6 +70,22 @@ class ContactListEnvelope implements ModelInterface, ArrayAccess 'contacts' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'contacts' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -90,6 +106,60 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of property to nullable mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPINullables() + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + public function getOpenAPINullablesSetToNull() + { + return $this->openAPINullablesSetToNull; + } + + public function setOpenAPINullablesSetToNull($nullablesSetToNull) + { + $this->openAPINullablesSetToNull=$nullablesSetToNull; + + return $this; + } + + /** + * Checks if a property is nullable + * + * @return bool + */ + public static function isNullable(string $property): bool + { + if (isset(self::$openAPINullables[$property])) { + return self::$openAPINullables[$property]; + } + + return false; + } + + /** + * Checks if a nullable property is set to null. + * + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + if (in_array($property, $this->getOpenAPINullablesSetToNull())) { + return true; + } + return false; + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -178,7 +248,18 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['contacts'] = isset($data['contacts']) ? $data['contacts'] : null; + $this->setIfExists('contacts', $data, null); + } + + public function setIfExists(string $variableName, $fields, $defaultValue) + { + if (is_array($fields) && array_key_exists($variableName, $fields) && is_null($fields[$variableName]) && self::isNullable($variableName)) { + array_push($this->openAPINullablesSetToNull, $variableName); + } + + $this->container[$variableName] = isset($fields[$variableName]) ? $fields[$variableName] : $defaultValue; + + return $this; } /** @@ -224,6 +305,12 @@ public function getContacts() */ public function setContacts($contacts) { + + + if (is_null($contacts)) { + throw new \InvalidArgumentException('non-nullable contacts cannot be null'); + } + $this->container['contacts'] = $contacts; return $this; diff --git a/lib/Model/ContactUpdateFields.php b/lib/Model/ContactUpdateFields.php index 956f7d7..8f7c3ac 100644 --- a/lib/Model/ContactUpdateFields.php +++ b/lib/Model/ContactUpdateFields.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.2 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -86,6 +86,30 @@ class ContactUpdateFields implements ModelInterface, ArrayAccess 'custom4' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'email' => true, + 'firstName' => true, + 'lastName' => true, + 'company' => true, + 'title' => true, + 'custom' => true, + 'custom2' => true, + 'custom3' => true, + 'custom4' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -106,6 +130,60 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of property to nullable mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPINullables() + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + public function getOpenAPINullablesSetToNull() + { + return $this->openAPINullablesSetToNull; + } + + public function setOpenAPINullablesSetToNull($nullablesSetToNull) + { + $this->openAPINullablesSetToNull=$nullablesSetToNull; + + return $this; + } + + /** + * Checks if a property is nullable + * + * @return bool + */ + public static function isNullable(string $property): bool + { + if (isset(self::$openAPINullables[$property])) { + return self::$openAPINullables[$property]; + } + + return false; + } + + /** + * Checks if a nullable property is set to null. + * + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + if (in_array($property, $this->getOpenAPINullablesSetToNull())) { + return true; + } + return false; + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -218,15 +296,26 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['email'] = isset($data['email']) ? $data['email'] : null; - $this->container['firstName'] = isset($data['firstName']) ? $data['firstName'] : null; - $this->container['lastName'] = isset($data['lastName']) ? $data['lastName'] : null; - $this->container['company'] = isset($data['company']) ? $data['company'] : null; - $this->container['title'] = isset($data['title']) ? $data['title'] : null; - $this->container['custom'] = isset($data['custom']) ? $data['custom'] : null; - $this->container['custom2'] = isset($data['custom2']) ? $data['custom2'] : null; - $this->container['custom3'] = isset($data['custom3']) ? $data['custom3'] : null; - $this->container['custom4'] = isset($data['custom4']) ? $data['custom4'] : null; + $this->setIfExists('email', $data, null); + $this->setIfExists('firstName', $data, null); + $this->setIfExists('lastName', $data, null); + $this->setIfExists('company', $data, null); + $this->setIfExists('title', $data, null); + $this->setIfExists('custom', $data, null); + $this->setIfExists('custom2', $data, null); + $this->setIfExists('custom3', $data, null); + $this->setIfExists('custom4', $data, null); + } + + public function setIfExists(string $variableName, $fields, $defaultValue) + { + if (is_array($fields) && array_key_exists($variableName, $fields) && is_null($fields[$variableName]) && self::isNullable($variableName)) { + array_push($this->openAPINullablesSetToNull, $variableName); + } + + $this->container[$variableName] = isset($fields[$variableName]) ? $fields[$variableName] : $defaultValue; + + return $this; } /** @@ -272,6 +361,19 @@ public function getEmail() */ public function setEmail($email) { + + if (is_null($email)) { + array_push($this->openAPINullablesSetToNull, 'email'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('email', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['email'] = $email; return $this; @@ -296,6 +398,19 @@ public function getFirstName() */ public function setFirstName($firstName) { + + if (is_null($firstName)) { + array_push($this->openAPINullablesSetToNull, 'firstName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('firstName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['firstName'] = $firstName; return $this; @@ -320,6 +435,19 @@ public function getLastName() */ public function setLastName($lastName) { + + if (is_null($lastName)) { + array_push($this->openAPINullablesSetToNull, 'lastName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lastName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['lastName'] = $lastName; return $this; @@ -344,6 +472,19 @@ public function getCompany() */ public function setCompany($company) { + + if (is_null($company)) { + array_push($this->openAPINullablesSetToNull, 'company'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('company', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['company'] = $company; return $this; @@ -368,6 +509,19 @@ public function getTitle() */ public function setTitle($title) { + + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['title'] = $title; return $this; @@ -392,6 +546,19 @@ public function getCustom() */ public function setCustom($custom) { + + if (is_null($custom)) { + array_push($this->openAPINullablesSetToNull, 'custom'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('custom', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['custom'] = $custom; return $this; @@ -416,6 +583,19 @@ public function getCustom2() */ public function setCustom2($custom2) { + + if (is_null($custom2)) { + array_push($this->openAPINullablesSetToNull, 'custom2'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('custom2', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['custom2'] = $custom2; return $this; @@ -440,6 +620,19 @@ public function getCustom3() */ public function setCustom3($custom3) { + + if (is_null($custom3)) { + array_push($this->openAPINullablesSetToNull, 'custom3'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('custom3', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['custom3'] = $custom3; return $this; @@ -464,6 +657,19 @@ public function getCustom4() */ public function setCustom4($custom4) { + + if (is_null($custom4)) { + array_push($this->openAPINullablesSetToNull, 'custom4'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('custom4', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['custom4'] = $custom4; return $this; diff --git a/lib/Model/DeliveryReportResponse.php b/lib/Model/DeliveryReportResponse.php index 28cc654..6514a6d 100644 --- a/lib/Model/DeliveryReportResponse.php +++ b/lib/Model/DeliveryReportResponse.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.2 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -74,6 +74,24 @@ class DeliveryReportResponse implements ModelInterface, ArrayAccess 'omnimessageId' => 'UUID' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'statuses' => false, + 'to' => false, + 'omnimessageId' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -94,6 +112,60 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of property to nullable mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPINullables() + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + public function getOpenAPINullablesSetToNull() + { + return $this->openAPINullablesSetToNull; + } + + public function setOpenAPINullablesSetToNull($nullablesSetToNull) + { + $this->openAPINullablesSetToNull=$nullablesSetToNull; + + return $this; + } + + /** + * Checks if a property is nullable + * + * @return bool + */ + public static function isNullable(string $property): bool + { + if (isset(self::$openAPINullables[$property])) { + return self::$openAPINullables[$property]; + } + + return false; + } + + /** + * Checks if a nullable property is set to null. + * + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + if (in_array($property, $this->getOpenAPINullablesSetToNull())) { + return true; + } + return false; + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -188,9 +260,20 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['statuses'] = isset($data['statuses']) ? $data['statuses'] : null; - $this->container['to'] = isset($data['to']) ? $data['to'] : null; - $this->container['omnimessageId'] = isset($data['omnimessageId']) ? $data['omnimessageId'] : null; + $this->setIfExists('statuses', $data, null); + $this->setIfExists('to', $data, null); + $this->setIfExists('omnimessageId', $data, null); + } + + public function setIfExists(string $variableName, $fields, $defaultValue) + { + if (is_array($fields) && array_key_exists($variableName, $fields) && is_null($fields[$variableName]) && self::isNullable($variableName)) { + array_push($this->openAPINullablesSetToNull, $variableName); + } + + $this->container[$variableName] = isset($fields[$variableName]) ? $fields[$variableName] : $defaultValue; + + return $this; } /** @@ -245,6 +328,12 @@ public function getStatuses() */ public function setStatuses($statuses) { + + + if (is_null($statuses)) { + throw new \InvalidArgumentException('non-nullable statuses cannot be null'); + } + $this->container['statuses'] = $statuses; return $this; @@ -269,6 +358,12 @@ public function getTo() */ public function setTo($to) { + + + if (is_null($to)) { + throw new \InvalidArgumentException('non-nullable to cannot be null'); + } + $this->container['to'] = $to; return $this; @@ -293,6 +388,12 @@ public function getOmnimessageId() */ public function setOmnimessageId($omnimessageId) { + + + if (is_null($omnimessageId)) { + throw new \InvalidArgumentException('non-nullable omnimessageId cannot be null'); + } + $this->container['omnimessageId'] = $omnimessageId; return $this; diff --git a/lib/Model/DeliveryResult.php b/lib/Model/DeliveryResult.php index 580bf61..adc4054 100644 --- a/lib/Model/DeliveryResult.php +++ b/lib/Model/DeliveryResult.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.2 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -80,6 +80,27 @@ class DeliveryResult implements ModelInterface, ArrayAccess 'timestamp' => 'date-time' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'status' => false, + 'channel' => false, + 'messageId' => false, + 'error' => false, + 'err' => false, + 'timestamp' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -100,6 +121,60 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of property to nullable mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPINullables() + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + public function getOpenAPINullablesSetToNull() + { + return $this->openAPINullablesSetToNull; + } + + public function setOpenAPINullablesSetToNull($nullablesSetToNull) + { + $this->openAPINullablesSetToNull=$nullablesSetToNull; + + return $this; + } + + /** + * Checks if a property is nullable + * + * @return bool + */ + public static function isNullable(string $property): bool + { + if (isset(self::$openAPINullables[$property])) { + return self::$openAPINullables[$property]; + } + + return false; + } + + /** + * Checks if a nullable property is set to null. + * + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + if (in_array($property, $this->getOpenAPINullablesSetToNull())) { + return true; + } + return false; + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -203,12 +278,23 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['status'] = isset($data['status']) ? $data['status'] : null; - $this->container['channel'] = isset($data['channel']) ? $data['channel'] : null; - $this->container['messageId'] = isset($data['messageId']) ? $data['messageId'] : null; - $this->container['error'] = isset($data['error']) ? $data['error'] : null; - $this->container['err'] = isset($data['err']) ? $data['err'] : null; - $this->container['timestamp'] = isset($data['timestamp']) ? $data['timestamp'] : null; + $this->setIfExists('status', $data, null); + $this->setIfExists('channel', $data, null); + $this->setIfExists('messageId', $data, null); + $this->setIfExists('error', $data, null); + $this->setIfExists('err', $data, null); + $this->setIfExists('timestamp', $data, null); + } + + public function setIfExists(string $variableName, $fields, $defaultValue) + { + if (is_array($fields) && array_key_exists($variableName, $fields) && is_null($fields[$variableName]) && self::isNullable($variableName)) { + array_push($this->openAPINullablesSetToNull, $variableName); + } + + $this->container[$variableName] = isset($fields[$variableName]) ? $fields[$variableName] : $defaultValue; + + return $this; } /** @@ -254,6 +340,12 @@ public function getStatus() */ public function setStatus($status) { + + + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; return $this; @@ -278,6 +370,12 @@ public function getChannel() */ public function setChannel($channel) { + + + if (is_null($channel)) { + throw new \InvalidArgumentException('non-nullable channel cannot be null'); + } + $this->container['channel'] = $channel; return $this; @@ -302,6 +400,12 @@ public function getMessageId() */ public function setMessageId($messageId) { + + + if (is_null($messageId)) { + throw new \InvalidArgumentException('non-nullable messageId cannot be null'); + } + $this->container['messageId'] = $messageId; return $this; @@ -326,6 +430,12 @@ public function getError() */ public function setError($error) { + + + if (is_null($error)) { + throw new \InvalidArgumentException('non-nullable error cannot be null'); + } + $this->container['error'] = $error; return $this; @@ -350,6 +460,12 @@ public function getErr() */ public function setErr($err) { + + + if (is_null($err)) { + throw new \InvalidArgumentException('non-nullable err cannot be null'); + } + $this->container['err'] = $err; return $this; @@ -374,6 +490,12 @@ public function getTimestamp() */ public function setTimestamp($timestamp) { + + + if (is_null($timestamp)) { + throw new \InvalidArgumentException('non-nullable timestamp cannot be null'); + } + $this->container['timestamp'] = $timestamp; return $this; diff --git a/lib/Model/ErrorCodeOmnichannel.php b/lib/Model/ErrorCodeOmnichannel.php index 48cd27a..dcb8203 100644 --- a/lib/Model/ErrorCodeOmnichannel.php +++ b/lib/Model/ErrorCodeOmnichannel.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.2 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.0 + * OpenAPI Generator version: 4.0.3 */ /** diff --git a/lib/Model/ErrorCodeOmnichannelMachine.php b/lib/Model/ErrorCodeOmnichannelMachine.php index de208da..3f94748 100644 --- a/lib/Model/ErrorCodeOmnichannelMachine.php +++ b/lib/Model/ErrorCodeOmnichannelMachine.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.2 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.0 + * OpenAPI Generator version: 4.0.3 */ /** diff --git a/lib/Model/ErrorCodePhonebook.php b/lib/Model/ErrorCodePhonebook.php index 54b5423..f6e6dec 100644 --- a/lib/Model/ErrorCodePhonebook.php +++ b/lib/Model/ErrorCodePhonebook.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.2 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.0 + * OpenAPI Generator version: 4.0.3 */ /** diff --git a/lib/Model/ErrorItemOmnichannel.php b/lib/Model/ErrorItemOmnichannel.php index c3d2ad1..40f2460 100644 --- a/lib/Model/ErrorItemOmnichannel.php +++ b/lib/Model/ErrorItemOmnichannel.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.2 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -76,6 +76,25 @@ class ErrorItemOmnichannel implements ModelInterface, ArrayAccess 'source' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'title' => false, + 'detail' => false, + 'code' => false, + 'source' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -96,6 +115,60 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of property to nullable mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPINullables() + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + public function getOpenAPINullablesSetToNull() + { + return $this->openAPINullablesSetToNull; + } + + public function setOpenAPINullablesSetToNull($nullablesSetToNull) + { + $this->openAPINullablesSetToNull=$nullablesSetToNull; + + return $this; + } + + /** + * Checks if a property is nullable + * + * @return bool + */ + public static function isNullable(string $property): bool + { + if (isset(self::$openAPINullables[$property])) { + return self::$openAPINullables[$property]; + } + + return false; + } + + /** + * Checks if a nullable property is set to null. + * + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + if (in_array($property, $this->getOpenAPINullablesSetToNull())) { + return true; + } + return false; + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -193,10 +266,21 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = isset($data['title']) ? $data['title'] : null; - $this->container['detail'] = isset($data['detail']) ? $data['detail'] : null; - $this->container['code'] = isset($data['code']) ? $data['code'] : null; - $this->container['source'] = isset($data['source']) ? $data['source'] : null; + $this->setIfExists('title', $data, null); + $this->setIfExists('detail', $data, null); + $this->setIfExists('code', $data, null); + $this->setIfExists('source', $data, null); + } + + public function setIfExists(string $variableName, $fields, $defaultValue) + { + if (is_array($fields) && array_key_exists($variableName, $fields) && is_null($fields[$variableName]) && self::isNullable($variableName)) { + array_push($this->openAPINullablesSetToNull, $variableName); + } + + $this->container[$variableName] = isset($fields[$variableName]) ? $fields[$variableName] : $defaultValue; + + return $this; } /** @@ -254,6 +338,12 @@ public function getTitle() */ public function setTitle($title) { + + + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } + $this->container['title'] = $title; return $this; @@ -278,6 +368,12 @@ public function getDetail() */ public function setDetail($detail) { + + + if (is_null($detail)) { + throw new \InvalidArgumentException('non-nullable detail cannot be null'); + } + $this->container['detail'] = $detail; return $this; @@ -302,6 +398,12 @@ public function getCode() */ public function setCode($code) { + + + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); + } + $this->container['code'] = $code; return $this; @@ -326,6 +428,12 @@ public function getSource() */ public function setSource($source) { + + + if (is_null($source)) { + throw new \InvalidArgumentException('non-nullable source cannot be null'); + } + $this->container['source'] = $source; return $this; diff --git a/lib/Model/ErrorItemPhonebook.php b/lib/Model/ErrorItemPhonebook.php index 3fce8bb..d59ba4f 100644 --- a/lib/Model/ErrorItemPhonebook.php +++ b/lib/Model/ErrorItemPhonebook.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.2 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -74,6 +74,24 @@ class ErrorItemPhonebook implements ModelInterface, ArrayAccess 'code' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'title' => false, + 'detail' => false, + 'code' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -94,6 +112,60 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of property to nullable mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPINullables() + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + public function getOpenAPINullablesSetToNull() + { + return $this->openAPINullablesSetToNull; + } + + public function setOpenAPINullablesSetToNull($nullablesSetToNull) + { + $this->openAPINullablesSetToNull=$nullablesSetToNull; + + return $this; + } + + /** + * Checks if a property is nullable + * + * @return bool + */ + public static function isNullable(string $property): bool + { + if (isset(self::$openAPINullables[$property])) { + return self::$openAPINullables[$property]; + } + + return false; + } + + /** + * Checks if a nullable property is set to null. + * + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + if (in_array($property, $this->getOpenAPINullablesSetToNull())) { + return true; + } + return false; + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -188,9 +260,20 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = isset($data['title']) ? $data['title'] : null; - $this->container['detail'] = isset($data['detail']) ? $data['detail'] : null; - $this->container['code'] = isset($data['code']) ? $data['code'] : null; + $this->setIfExists('title', $data, null); + $this->setIfExists('detail', $data, null); + $this->setIfExists('code', $data, null); + } + + public function setIfExists(string $variableName, $fields, $defaultValue) + { + if (is_array($fields) && array_key_exists($variableName, $fields) && is_null($fields[$variableName]) && self::isNullable($variableName)) { + array_push($this->openAPINullablesSetToNull, $variableName); + } + + $this->container[$variableName] = isset($fields[$variableName]) ? $fields[$variableName] : $defaultValue; + + return $this; } /** @@ -245,6 +328,12 @@ public function getTitle() */ public function setTitle($title) { + + + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } + $this->container['title'] = $title; return $this; @@ -269,6 +358,12 @@ public function getDetail() */ public function setDetail($detail) { + + + if (is_null($detail)) { + throw new \InvalidArgumentException('non-nullable detail cannot be null'); + } + $this->container['detail'] = $detail; return $this; @@ -293,6 +388,12 @@ public function getCode() */ public function setCode($code) { + + + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); + } + $this->container['code'] = $code; return $this; diff --git a/lib/Model/ErrorOmnichannel.php b/lib/Model/ErrorOmnichannel.php index 25219d7..0f5fd41 100644 --- a/lib/Model/ErrorOmnichannel.php +++ b/lib/Model/ErrorOmnichannel.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.2 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -70,6 +70,22 @@ class ErrorOmnichannel implements ModelInterface, ArrayAccess 'errors' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'errors' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -90,6 +106,60 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of property to nullable mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPINullables() + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + public function getOpenAPINullablesSetToNull() + { + return $this->openAPINullablesSetToNull; + } + + public function setOpenAPINullablesSetToNull($nullablesSetToNull) + { + $this->openAPINullablesSetToNull=$nullablesSetToNull; + + return $this; + } + + /** + * Checks if a property is nullable + * + * @return bool + */ + public static function isNullable(string $property): bool + { + if (isset(self::$openAPINullables[$property])) { + return self::$openAPINullables[$property]; + } + + return false; + } + + /** + * Checks if a nullable property is set to null. + * + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + if (in_array($property, $this->getOpenAPINullablesSetToNull())) { + return true; + } + return false; + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -178,7 +248,18 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['errors'] = isset($data['errors']) ? $data['errors'] : null; + $this->setIfExists('errors', $data, null); + } + + public function setIfExists(string $variableName, $fields, $defaultValue) + { + if (is_array($fields) && array_key_exists($variableName, $fields) && is_null($fields[$variableName]) && self::isNullable($variableName)) { + array_push($this->openAPINullablesSetToNull, $variableName); + } + + $this->container[$variableName] = isset($fields[$variableName]) ? $fields[$variableName] : $defaultValue; + + return $this; } /** @@ -227,6 +308,12 @@ public function getErrors() */ public function setErrors($errors) { + + + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); + } + $this->container['errors'] = $errors; return $this; diff --git a/lib/Model/ErrorPhonebook.php b/lib/Model/ErrorPhonebook.php index 9b4c196..9aaa0f8 100644 --- a/lib/Model/ErrorPhonebook.php +++ b/lib/Model/ErrorPhonebook.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.2 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -70,6 +70,22 @@ class ErrorPhonebook implements ModelInterface, ArrayAccess 'errors' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'errors' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -90,6 +106,60 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of property to nullable mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPINullables() + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + public function getOpenAPINullablesSetToNull() + { + return $this->openAPINullablesSetToNull; + } + + public function setOpenAPINullablesSetToNull($nullablesSetToNull) + { + $this->openAPINullablesSetToNull=$nullablesSetToNull; + + return $this; + } + + /** + * Checks if a property is nullable + * + * @return bool + */ + public static function isNullable(string $property): bool + { + if (isset(self::$openAPINullables[$property])) { + return self::$openAPINullables[$property]; + } + + return false; + } + + /** + * Checks if a nullable property is set to null. + * + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + if (in_array($property, $this->getOpenAPINullablesSetToNull())) { + return true; + } + return false; + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -178,7 +248,18 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['errors'] = isset($data['errors']) ? $data['errors'] : null; + $this->setIfExists('errors', $data, null); + } + + public function setIfExists(string $variableName, $fields, $defaultValue) + { + if (is_array($fields) && array_key_exists($variableName, $fields) && is_null($fields[$variableName]) && self::isNullable($variableName)) { + array_push($this->openAPINullablesSetToNull, $variableName); + } + + $this->container[$variableName] = isset($fields[$variableName]) ? $fields[$variableName] : $defaultValue; + + return $this; } /** @@ -227,6 +308,12 @@ public function getErrors() */ public function setErrors($errors) { + + + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); + } + $this->container['errors'] = $errors; return $this; diff --git a/lib/Model/ErrorTitleOmnichannel.php b/lib/Model/ErrorTitleOmnichannel.php index 46a6937..023f2c7 100644 --- a/lib/Model/ErrorTitleOmnichannel.php +++ b/lib/Model/ErrorTitleOmnichannel.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.2 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.0 + * OpenAPI Generator version: 4.0.3 */ /** diff --git a/lib/Model/ErrorTitlePhonebook.php b/lib/Model/ErrorTitlePhonebook.php index e041730..89fc139 100644 --- a/lib/Model/ErrorTitlePhonebook.php +++ b/lib/Model/ErrorTitlePhonebook.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.2 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.0 + * OpenAPI Generator version: 4.0.3 */ /** diff --git a/lib/Model/FetchBlacklistSuccess.php b/lib/Model/FetchBlacklistSuccess.php index 0d70a1e..086e6ca 100644 --- a/lib/Model/FetchBlacklistSuccess.php +++ b/lib/Model/FetchBlacklistSuccess.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.2 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -70,6 +70,22 @@ class FetchBlacklistSuccess implements ModelInterface, ArrayAccess 'phoneNumbers' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'phoneNumbers' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -90,6 +106,60 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of property to nullable mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPINullables() + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + public function getOpenAPINullablesSetToNull() + { + return $this->openAPINullablesSetToNull; + } + + public function setOpenAPINullablesSetToNull($nullablesSetToNull) + { + $this->openAPINullablesSetToNull=$nullablesSetToNull; + + return $this; + } + + /** + * Checks if a property is nullable + * + * @return bool + */ + public static function isNullable(string $property): bool + { + if (isset(self::$openAPINullables[$property])) { + return self::$openAPINullables[$property]; + } + + return false; + } + + /** + * Checks if a nullable property is set to null. + * + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + if (in_array($property, $this->getOpenAPINullablesSetToNull())) { + return true; + } + return false; + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -178,7 +248,18 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['phoneNumbers'] = isset($data['phoneNumbers']) ? $data['phoneNumbers'] : null; + $this->setIfExists('phoneNumbers', $data, null); + } + + public function setIfExists(string $variableName, $fields, $defaultValue) + { + if (is_array($fields) && array_key_exists($variableName, $fields) && is_null($fields[$variableName]) && self::isNullable($variableName)) { + array_push($this->openAPINullablesSetToNull, $variableName); + } + + $this->container[$variableName] = isset($fields[$variableName]) ? $fields[$variableName] : $defaultValue; + + return $this; } /** @@ -224,6 +305,12 @@ public function getPhoneNumbers() */ public function setPhoneNumbers($phoneNumbers) { + + + if (is_null($phoneNumbers)) { + throw new \InvalidArgumentException('non-nullable phoneNumbers cannot be null'); + } + $this->container['phoneNumbers'] = $phoneNumbers; return $this; diff --git a/lib/Model/GroupEnvelope.php b/lib/Model/GroupEnvelope.php index 2f934ce..6feee56 100644 --- a/lib/Model/GroupEnvelope.php +++ b/lib/Model/GroupEnvelope.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.2 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -70,6 +70,22 @@ class GroupEnvelope implements ModelInterface, ArrayAccess 'group' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'group' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -90,6 +106,60 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of property to nullable mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPINullables() + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + public function getOpenAPINullablesSetToNull() + { + return $this->openAPINullablesSetToNull; + } + + public function setOpenAPINullablesSetToNull($nullablesSetToNull) + { + $this->openAPINullablesSetToNull=$nullablesSetToNull; + + return $this; + } + + /** + * Checks if a property is nullable + * + * @return bool + */ + public static function isNullable(string $property): bool + { + if (isset(self::$openAPINullables[$property])) { + return self::$openAPINullables[$property]; + } + + return false; + } + + /** + * Checks if a nullable property is set to null. + * + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + if (in_array($property, $this->getOpenAPINullablesSetToNull())) { + return true; + } + return false; + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -178,7 +248,18 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['group'] = isset($data['group']) ? $data['group'] : null; + $this->setIfExists('group', $data, null); + } + + public function setIfExists(string $variableName, $fields, $defaultValue) + { + if (is_array($fields) && array_key_exists($variableName, $fields) && is_null($fields[$variableName]) && self::isNullable($variableName)) { + array_push($this->openAPINullablesSetToNull, $variableName); + } + + $this->container[$variableName] = isset($fields[$variableName]) ? $fields[$variableName] : $defaultValue; + + return $this; } /** @@ -224,6 +305,12 @@ public function getGroup() */ public function setGroup($group) { + + + if (is_null($group)) { + throw new \InvalidArgumentException('non-nullable group cannot be null'); + } + $this->container['group'] = $group; return $this; diff --git a/lib/Model/GroupListEnvelope.php b/lib/Model/GroupListEnvelope.php index e40c385..7f9c29e 100644 --- a/lib/Model/GroupListEnvelope.php +++ b/lib/Model/GroupListEnvelope.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.2 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -70,6 +70,22 @@ class GroupListEnvelope implements ModelInterface, ArrayAccess 'groups' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'groups' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -90,6 +106,60 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of property to nullable mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPINullables() + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + public function getOpenAPINullablesSetToNull() + { + return $this->openAPINullablesSetToNull; + } + + public function setOpenAPINullablesSetToNull($nullablesSetToNull) + { + $this->openAPINullablesSetToNull=$nullablesSetToNull; + + return $this; + } + + /** + * Checks if a property is nullable + * + * @return bool + */ + public static function isNullable(string $property): bool + { + if (isset(self::$openAPINullables[$property])) { + return self::$openAPINullables[$property]; + } + + return false; + } + + /** + * Checks if a nullable property is set to null. + * + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + if (in_array($property, $this->getOpenAPINullablesSetToNull())) { + return true; + } + return false; + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -178,7 +248,18 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['groups'] = isset($data['groups']) ? $data['groups'] : null; + $this->setIfExists('groups', $data, null); + } + + public function setIfExists(string $variableName, $fields, $defaultValue) + { + if (is_array($fields) && array_key_exists($variableName, $fields) && is_null($fields[$variableName]) && self::isNullable($variableName)) { + array_push($this->openAPINullablesSetToNull, $variableName); + } + + $this->container[$variableName] = isset($fields[$variableName]) ? $fields[$variableName] : $defaultValue; + + return $this; } /** @@ -224,6 +305,12 @@ public function getGroups() */ public function setGroups($groups) { + + + if (is_null($groups)) { + throw new \InvalidArgumentException('non-nullable groups cannot be null'); + } + $this->container['groups'] = $groups; return $this; diff --git a/lib/Model/GroupName.php b/lib/Model/GroupName.php index 4f7a9a6..b70c52a 100644 --- a/lib/Model/GroupName.php +++ b/lib/Model/GroupName.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.2 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -70,6 +70,22 @@ class GroupName implements ModelInterface, ArrayAccess 'name' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'name' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -90,6 +106,60 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of property to nullable mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPINullables() + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + public function getOpenAPINullablesSetToNull() + { + return $this->openAPINullablesSetToNull; + } + + public function setOpenAPINullablesSetToNull($nullablesSetToNull) + { + $this->openAPINullablesSetToNull=$nullablesSetToNull; + + return $this; + } + + /** + * Checks if a property is nullable + * + * @return bool + */ + public static function isNullable(string $property): bool + { + if (isset(self::$openAPINullables[$property])) { + return self::$openAPINullables[$property]; + } + + return false; + } + + /** + * Checks if a nullable property is set to null. + * + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + if (in_array($property, $this->getOpenAPINullablesSetToNull())) { + return true; + } + return false; + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -178,7 +248,18 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->setIfExists('name', $data, null); + } + + public function setIfExists(string $variableName, $fields, $defaultValue) + { + if (is_array($fields) && array_key_exists($variableName, $fields) && is_null($fields[$variableName]) && self::isNullable($variableName)) { + array_push($this->openAPINullablesSetToNull, $variableName); + } + + $this->container[$variableName] = isset($fields[$variableName]) ? $fields[$variableName] : $defaultValue; + + return $this; } /** @@ -236,6 +317,12 @@ public function setName($name) throw new \InvalidArgumentException('invalid length for $name when calling GroupName., must be bigger than or equal to 1.'); } + + + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; return $this; diff --git a/lib/Model/GroupResponseFields.php b/lib/Model/GroupResponseFields.php index 6e074b7..750c127 100644 --- a/lib/Model/GroupResponseFields.php +++ b/lib/Model/GroupResponseFields.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.2 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -76,6 +76,25 @@ class GroupResponseFields implements ModelInterface, ArrayAccess 'contactsCount' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'id' => false, + 'name' => false, + 'createdOn' => true, + 'contactsCount' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -96,6 +115,60 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of property to nullable mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPINullables() + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + public function getOpenAPINullablesSetToNull() + { + return $this->openAPINullablesSetToNull; + } + + public function setOpenAPINullablesSetToNull($nullablesSetToNull) + { + $this->openAPINullablesSetToNull=$nullablesSetToNull; + + return $this; + } + + /** + * Checks if a property is nullable + * + * @return bool + */ + public static function isNullable(string $property): bool + { + if (isset(self::$openAPINullables[$property])) { + return self::$openAPINullables[$property]; + } + + return false; + } + + /** + * Checks if a nullable property is set to null. + * + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + if (in_array($property, $this->getOpenAPINullablesSetToNull())) { + return true; + } + return false; + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -193,10 +266,21 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['createdOn'] = isset($data['createdOn']) ? $data['createdOn'] : null; - $this->container['contactsCount'] = isset($data['contactsCount']) ? $data['contactsCount'] : null; + $this->setIfExists('id', $data, null); + $this->setIfExists('name', $data, null); + $this->setIfExists('createdOn', $data, null); + $this->setIfExists('contactsCount', $data, null); + } + + public function setIfExists(string $variableName, $fields, $defaultValue) + { + if (is_array($fields) && array_key_exists($variableName, $fields) && is_null($fields[$variableName]) && self::isNullable($variableName)) { + array_push($this->openAPINullablesSetToNull, $variableName); + } + + $this->container[$variableName] = isset($fields[$variableName]) ? $fields[$variableName] : $defaultValue; + + return $this; } /** @@ -251,6 +335,12 @@ public function getId() */ public function setId($id) { + + + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; return $this; @@ -275,6 +365,12 @@ public function getName() */ public function setName($name) { + + + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; return $this; @@ -299,6 +395,19 @@ public function getCreatedOn() */ public function setCreatedOn($createdOn) { + + if (is_null($createdOn)) { + array_push($this->openAPINullablesSetToNull, 'createdOn'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('createdOn', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['createdOn'] = $createdOn; return $this; @@ -323,6 +432,12 @@ public function getContactsCount() */ public function setContactsCount($contactsCount) { + + + if (is_null($contactsCount)) { + throw new \InvalidArgumentException('non-nullable contactsCount cannot be null'); + } + $this->container['contactsCount'] = $contactsCount; return $this; diff --git a/lib/Model/MessageResult.php b/lib/Model/MessageResult.php index 70ddd0e..6290166 100644 --- a/lib/Model/MessageResult.php +++ b/lib/Model/MessageResult.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.2 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -74,6 +74,24 @@ class MessageResult implements ModelInterface, ArrayAccess 'sender' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'messageId' => false, + 'channel' => false, + 'sender' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -94,6 +112,60 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of property to nullable mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPINullables() + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + public function getOpenAPINullablesSetToNull() + { + return $this->openAPINullablesSetToNull; + } + + public function setOpenAPINullablesSetToNull($nullablesSetToNull) + { + $this->openAPINullablesSetToNull=$nullablesSetToNull; + + return $this; + } + + /** + * Checks if a property is nullable + * + * @return bool + */ + public static function isNullable(string $property): bool + { + if (isset(self::$openAPINullables[$property])) { + return self::$openAPINullables[$property]; + } + + return false; + } + + /** + * Checks if a nullable property is set to null. + * + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + if (in_array($property, $this->getOpenAPINullablesSetToNull())) { + return true; + } + return false; + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -188,9 +260,20 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['messageId'] = isset($data['messageId']) ? $data['messageId'] : null; - $this->container['channel'] = isset($data['channel']) ? $data['channel'] : null; - $this->container['sender'] = isset($data['sender']) ? $data['sender'] : null; + $this->setIfExists('messageId', $data, null); + $this->setIfExists('channel', $data, null); + $this->setIfExists('sender', $data, null); + } + + public function setIfExists(string $variableName, $fields, $defaultValue) + { + if (is_array($fields) && array_key_exists($variableName, $fields) && is_null($fields[$variableName]) && self::isNullable($variableName)) { + array_push($this->openAPINullablesSetToNull, $variableName); + } + + $this->container[$variableName] = isset($fields[$variableName]) ? $fields[$variableName] : $defaultValue; + + return $this; } /** @@ -245,6 +328,12 @@ public function getMessageId() */ public function setMessageId($messageId) { + + + if (is_null($messageId)) { + throw new \InvalidArgumentException('non-nullable messageId cannot be null'); + } + $this->container['messageId'] = $messageId; return $this; @@ -269,6 +358,12 @@ public function getChannel() */ public function setChannel($channel) { + + + if (is_null($channel)) { + throw new \InvalidArgumentException('non-nullable channel cannot be null'); + } + $this->container['channel'] = $channel; return $this; @@ -293,6 +388,12 @@ public function getSender() */ public function setSender($sender) { + + + if (is_null($sender)) { + throw new \InvalidArgumentException('non-nullable sender cannot be null'); + } + $this->container['sender'] = $sender; return $this; diff --git a/lib/Model/ModelInterface.php b/lib/Model/ModelInterface.php index 7ff91c9..328cb31 100644 --- a/lib/Model/ModelInterface.php +++ b/lib/Model/ModelInterface.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.2 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.0 + * OpenAPI Generator version: 4.0.3 */ /** diff --git a/lib/Model/NumberToBlacklist.php b/lib/Model/NumberToBlacklist.php index e472dd6..2283a9f 100644 --- a/lib/Model/NumberToBlacklist.php +++ b/lib/Model/NumberToBlacklist.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.2 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -70,6 +70,22 @@ class NumberToBlacklist implements ModelInterface, ArrayAccess 'phoneNumber' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'phoneNumber' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -90,6 +106,60 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of property to nullable mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPINullables() + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + public function getOpenAPINullablesSetToNull() + { + return $this->openAPINullablesSetToNull; + } + + public function setOpenAPINullablesSetToNull($nullablesSetToNull) + { + $this->openAPINullablesSetToNull=$nullablesSetToNull; + + return $this; + } + + /** + * Checks if a property is nullable + * + * @return bool + */ + public static function isNullable(string $property): bool + { + if (isset(self::$openAPINullables[$property])) { + return self::$openAPINullables[$property]; + } + + return false; + } + + /** + * Checks if a nullable property is set to null. + * + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + if (in_array($property, $this->getOpenAPINullablesSetToNull())) { + return true; + } + return false; + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -178,7 +248,18 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['phoneNumber'] = isset($data['phoneNumber']) ? $data['phoneNumber'] : null; + $this->setIfExists('phoneNumber', $data, null); + } + + public function setIfExists(string $variableName, $fields, $defaultValue) + { + if (is_array($fields) && array_key_exists($variableName, $fields) && is_null($fields[$variableName]) && self::isNullable($variableName)) { + array_push($this->openAPINullablesSetToNull, $variableName); + } + + $this->container[$variableName] = isset($fields[$variableName]) ? $fields[$variableName] : $defaultValue; + + return $this; } /** @@ -227,6 +308,12 @@ public function getPhoneNumber() */ public function setPhoneNumber($phoneNumber) { + + + if (is_null($phoneNumber)) { + throw new \InvalidArgumentException('non-nullable phoneNumber cannot be null'); + } + $this->container['phoneNumber'] = $phoneNumber; return $this; diff --git a/lib/Model/OmniMessageCreateSuccessResponse.php b/lib/Model/OmniMessageCreateSuccessResponse.php index d22b061..c8f7bc4 100644 --- a/lib/Model/OmniMessageCreateSuccessResponse.php +++ b/lib/Model/OmniMessageCreateSuccessResponse.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.2 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -74,6 +74,24 @@ class OmniMessageCreateSuccessResponse implements ModelInterface, ArrayAccess 'omnimessageId' => 'UUID' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'messages' => false, + 'to' => false, + 'omnimessageId' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -94,6 +112,60 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of property to nullable mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPINullables() + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + public function getOpenAPINullablesSetToNull() + { + return $this->openAPINullablesSetToNull; + } + + public function setOpenAPINullablesSetToNull($nullablesSetToNull) + { + $this->openAPINullablesSetToNull=$nullablesSetToNull; + + return $this; + } + + /** + * Checks if a property is nullable + * + * @return bool + */ + public static function isNullable(string $property): bool + { + if (isset(self::$openAPINullables[$property])) { + return self::$openAPINullables[$property]; + } + + return false; + } + + /** + * Checks if a nullable property is set to null. + * + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + if (in_array($property, $this->getOpenAPINullablesSetToNull())) { + return true; + } + return false; + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -188,9 +260,20 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['messages'] = isset($data['messages']) ? $data['messages'] : null; - $this->container['to'] = isset($data['to']) ? $data['to'] : null; - $this->container['omnimessageId'] = isset($data['omnimessageId']) ? $data['omnimessageId'] : null; + $this->setIfExists('messages', $data, null); + $this->setIfExists('to', $data, null); + $this->setIfExists('omnimessageId', $data, null); + } + + public function setIfExists(string $variableName, $fields, $defaultValue) + { + if (is_array($fields) && array_key_exists($variableName, $fields) && is_null($fields[$variableName]) && self::isNullable($variableName)) { + array_push($this->openAPINullablesSetToNull, $variableName); + } + + $this->container[$variableName] = isset($fields[$variableName]) ? $fields[$variableName] : $defaultValue; + + return $this; } /** @@ -245,6 +328,12 @@ public function getMessages() */ public function setMessages($messages) { + + + if (is_null($messages)) { + throw new \InvalidArgumentException('non-nullable messages cannot be null'); + } + $this->container['messages'] = $messages; return $this; @@ -269,6 +358,12 @@ public function getTo() */ public function setTo($to) { + + + if (is_null($to)) { + throw new \InvalidArgumentException('non-nullable to cannot be null'); + } + $this->container['to'] = $to; return $this; @@ -293,6 +388,12 @@ public function getOmnimessageId() */ public function setOmnimessageId($omnimessageId) { + + + if (is_null($omnimessageId)) { + throw new \InvalidArgumentException('non-nullable omnimessageId cannot be null'); + } + $this->container['omnimessageId'] = $omnimessageId; return $this; diff --git a/lib/Model/Omnimessage.php b/lib/Model/Omnimessage.php index aafe7aa..b776205 100644 --- a/lib/Model/Omnimessage.php +++ b/lib/Model/Omnimessage.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.2 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -78,6 +78,26 @@ class Omnimessage implements ModelInterface, ArrayAccess 'timeToSend' => 'date-time' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'to' => false, + 'messages' => false, + 'dlrUrl' => false, + 'textStore' => false, + 'timeToSend' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -98,6 +118,60 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of property to nullable mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPINullables() + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + public function getOpenAPINullablesSetToNull() + { + return $this->openAPINullablesSetToNull; + } + + public function setOpenAPINullablesSetToNull($nullablesSetToNull) + { + $this->openAPINullablesSetToNull=$nullablesSetToNull; + + return $this; + } + + /** + * Checks if a property is nullable + * + * @return bool + */ + public static function isNullable(string $property): bool + { + if (isset(self::$openAPINullables[$property])) { + return self::$openAPINullables[$property]; + } + + return false; + } + + /** + * Checks if a nullable property is set to null. + * + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + if (in_array($property, $this->getOpenAPINullablesSetToNull())) { + return true; + } + return false; + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -198,11 +272,22 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['to'] = isset($data['to']) ? $data['to'] : null; - $this->container['messages'] = isset($data['messages']) ? $data['messages'] : null; - $this->container['dlrUrl'] = isset($data['dlrUrl']) ? $data['dlrUrl'] : null; - $this->container['textStore'] = isset($data['textStore']) ? $data['textStore'] : null; - $this->container['timeToSend'] = isset($data['timeToSend']) ? $data['timeToSend'] : null; + $this->setIfExists('to', $data, null); + $this->setIfExists('messages', $data, null); + $this->setIfExists('dlrUrl', $data, null); + $this->setIfExists('textStore', $data, null); + $this->setIfExists('timeToSend', $data, null); + } + + public function setIfExists(string $variableName, $fields, $defaultValue) + { + if (is_array($fields) && array_key_exists($variableName, $fields) && is_null($fields[$variableName]) && self::isNullable($variableName)) { + array_push($this->openAPINullablesSetToNull, $variableName); + } + + $this->container[$variableName] = isset($fields[$variableName]) ? $fields[$variableName] : $defaultValue; + + return $this; } /** @@ -254,6 +339,12 @@ public function getTo() */ public function setTo($to) { + + + if (is_null($to)) { + throw new \InvalidArgumentException('non-nullable to cannot be null'); + } + $this->container['to'] = $to; return $this; @@ -278,6 +369,12 @@ public function getMessages() */ public function setMessages($messages) { + + + if (is_null($messages)) { + throw new \InvalidArgumentException('non-nullable messages cannot be null'); + } + $this->container['messages'] = $messages; return $this; @@ -302,6 +399,12 @@ public function getDlrUrl() */ public function setDlrUrl($dlrUrl) { + + + if (is_null($dlrUrl)) { + throw new \InvalidArgumentException('non-nullable dlrUrl cannot be null'); + } + $this->container['dlrUrl'] = $dlrUrl; return $this; @@ -326,6 +429,12 @@ public function getTextStore() */ public function setTextStore($textStore) { + + + if (is_null($textStore)) { + throw new \InvalidArgumentException('non-nullable textStore cannot be null'); + } + $this->container['textStore'] = $textStore; return $this; @@ -350,6 +459,12 @@ public function getTimeToSend() */ public function setTimeToSend($timeToSend) { + + + if (is_null($timeToSend)) { + throw new \InvalidArgumentException('non-nullable timeToSend cannot be null'); + } + $this->container['timeToSend'] = $timeToSend; return $this; diff --git a/lib/Model/SMS.php b/lib/Model/SMS.php index 5aa97eb..24babe7 100644 --- a/lib/Model/SMS.php +++ b/lib/Model/SMS.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.2 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -80,6 +80,27 @@ class SMS implements ModelInterface, ArrayAccess 'channel' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'text' => false, + 'sender' => false, + 'validity' => false, + 'autoconvert' => false, + 'udh' => false, + 'channel' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -100,6 +121,60 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of property to nullable mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPINullables() + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + public function getOpenAPINullablesSetToNull() + { + return $this->openAPINullablesSetToNull; + } + + public function setOpenAPINullablesSetToNull($nullablesSetToNull) + { + $this->openAPINullablesSetToNull=$nullablesSetToNull; + + return $this; + } + + /** + * Checks if a property is nullable + * + * @return bool + */ + public static function isNullable(string $property): bool + { + if (isset(self::$openAPINullables[$property])) { + return self::$openAPINullables[$property]; + } + + return false; + } + + /** + * Checks if a nullable property is set to null. + * + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + if (in_array($property, $this->getOpenAPINullablesSetToNull())) { + return true; + } + return false; + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -233,12 +308,23 @@ public function getChannelAllowableValues() */ public function __construct(array $data = null) { - $this->container['text'] = isset($data['text']) ? $data['text'] : null; - $this->container['sender'] = isset($data['sender']) ? $data['sender'] : null; - $this->container['validity'] = isset($data['validity']) ? $data['validity'] : null; - $this->container['autoconvert'] = isset($data['autoconvert']) ? $data['autoconvert'] : null; - $this->container['udh'] = isset($data['udh']) ? $data['udh'] : null; - $this->container['channel'] = isset($data['channel']) ? $data['channel'] : 'sms'; + $this->setIfExists('text', $data, null); + $this->setIfExists('sender', $data, null); + $this->setIfExists('validity', $data, null); + $this->setIfExists('autoconvert', $data, null); + $this->setIfExists('udh', $data, null); + $this->setIfExists('channel', $data, 'sms'); + } + + public function setIfExists(string $variableName, $fields, $defaultValue) + { + if (is_array($fields) && array_key_exists($variableName, $fields) && is_null($fields[$variableName]) && self::isNullable($variableName)) { + array_push($this->openAPINullablesSetToNull, $variableName); + } + + $this->container[$variableName] = isset($fields[$variableName]) ? $fields[$variableName] : $defaultValue; + + return $this; } /** @@ -303,6 +389,12 @@ public function getText() */ public function setText($text) { + + + if (is_null($text)) { + throw new \InvalidArgumentException('non-nullable text cannot be null'); + } + $this->container['text'] = $text; return $this; @@ -327,6 +419,12 @@ public function getSender() */ public function setSender($sender) { + + + if (is_null($sender)) { + throw new \InvalidArgumentException('non-nullable sender cannot be null'); + } + $this->container['sender'] = $sender; return $this; @@ -351,6 +449,12 @@ public function getValidity() */ public function setValidity($validity) { + + + if (is_null($validity)) { + throw new \InvalidArgumentException('non-nullable validity cannot be null'); + } + $this->container['validity'] = $validity; return $this; @@ -384,6 +488,12 @@ public function setAutoconvert($autoconvert) ) ); } + + + if (is_null($autoconvert)) { + throw new \InvalidArgumentException('non-nullable autoconvert cannot be null'); + } + $this->container['autoconvert'] = $autoconvert; return $this; @@ -408,6 +518,12 @@ public function getUdh() */ public function setUdh($udh) { + + + if (is_null($udh)) { + throw new \InvalidArgumentException('non-nullable udh cannot be null'); + } + $this->container['udh'] = $udh; return $this; @@ -441,6 +557,12 @@ public function setChannel($channel) ) ); } + + + if (is_null($channel)) { + throw new \InvalidArgumentException('non-nullable channel cannot be null'); + } + $this->container['channel'] = $channel; return $this; diff --git a/lib/Model/Status.php b/lib/Model/Status.php index bf12639..e7bfc1d 100644 --- a/lib/Model/Status.php +++ b/lib/Model/Status.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.2 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.0 + * OpenAPI Generator version: 4.0.3 */ /** diff --git a/lib/Model/TextStore.php b/lib/Model/TextStore.php index fc20ff3..a799634 100644 --- a/lib/Model/TextStore.php +++ b/lib/Model/TextStore.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.2 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.0 + * OpenAPI Generator version: 4.0.3 */ /** diff --git a/lib/Model/Viber.php b/lib/Model/Viber.php index 1ab9ffe..3f5ec4b 100644 --- a/lib/Model/Viber.php +++ b/lib/Model/Viber.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.2 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -82,6 +82,28 @@ class Viber implements ModelInterface, ArrayAccess 'channel' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'sender' => false, + 'validity' => false, + 'text' => false, + 'imageUrl' => false, + 'buttonUrl' => false, + 'buttonText' => false, + 'channel' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -102,6 +124,60 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of property to nullable mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPINullables() + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + public function getOpenAPINullablesSetToNull() + { + return $this->openAPINullablesSetToNull; + } + + public function setOpenAPINullablesSetToNull($nullablesSetToNull) + { + $this->openAPINullablesSetToNull=$nullablesSetToNull; + + return $this; + } + + /** + * Checks if a property is nullable + * + * @return bool + */ + public static function isNullable(string $property): bool + { + if (isset(self::$openAPINullables[$property])) { + return self::$openAPINullables[$property]; + } + + return false; + } + + /** + * Checks if a nullable property is set to null. + * + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + if (in_array($property, $this->getOpenAPINullablesSetToNull())) { + return true; + } + return false; + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -221,13 +297,24 @@ public function getChannelAllowableValues() */ public function __construct(array $data = null) { - $this->container['sender'] = isset($data['sender']) ? $data['sender'] : null; - $this->container['validity'] = isset($data['validity']) ? $data['validity'] : null; - $this->container['text'] = isset($data['text']) ? $data['text'] : null; - $this->container['imageUrl'] = isset($data['imageUrl']) ? $data['imageUrl'] : null; - $this->container['buttonUrl'] = isset($data['buttonUrl']) ? $data['buttonUrl'] : null; - $this->container['buttonText'] = isset($data['buttonText']) ? $data['buttonText'] : null; - $this->container['channel'] = isset($data['channel']) ? $data['channel'] : 'viber'; + $this->setIfExists('sender', $data, null); + $this->setIfExists('validity', $data, null); + $this->setIfExists('text', $data, null); + $this->setIfExists('imageUrl', $data, null); + $this->setIfExists('buttonUrl', $data, null); + $this->setIfExists('buttonText', $data, null); + $this->setIfExists('channel', $data, 'viber'); + } + + public function setIfExists(string $variableName, $fields, $defaultValue) + { + if (is_array($fields) && array_key_exists($variableName, $fields) && is_null($fields[$variableName]) && self::isNullable($variableName)) { + array_push($this->openAPINullablesSetToNull, $variableName); + } + + $this->container[$variableName] = isset($fields[$variableName]) ? $fields[$variableName] : $defaultValue; + + return $this; } /** @@ -281,6 +368,12 @@ public function getSender() */ public function setSender($sender) { + + + if (is_null($sender)) { + throw new \InvalidArgumentException('non-nullable sender cannot be null'); + } + $this->container['sender'] = $sender; return $this; @@ -305,6 +398,12 @@ public function getValidity() */ public function setValidity($validity) { + + + if (is_null($validity)) { + throw new \InvalidArgumentException('non-nullable validity cannot be null'); + } + $this->container['validity'] = $validity; return $this; @@ -329,6 +428,12 @@ public function getText() */ public function setText($text) { + + + if (is_null($text)) { + throw new \InvalidArgumentException('non-nullable text cannot be null'); + } + $this->container['text'] = $text; return $this; @@ -353,6 +458,12 @@ public function getImageUrl() */ public function setImageUrl($imageUrl) { + + + if (is_null($imageUrl)) { + throw new \InvalidArgumentException('non-nullable imageUrl cannot be null'); + } + $this->container['imageUrl'] = $imageUrl; return $this; @@ -377,6 +488,12 @@ public function getButtonUrl() */ public function setButtonUrl($buttonUrl) { + + + if (is_null($buttonUrl)) { + throw new \InvalidArgumentException('non-nullable buttonUrl cannot be null'); + } + $this->container['buttonUrl'] = $buttonUrl; return $this; @@ -401,6 +518,12 @@ public function getButtonText() */ public function setButtonText($buttonText) { + + + if (is_null($buttonText)) { + throw new \InvalidArgumentException('non-nullable buttonText cannot be null'); + } + $this->container['buttonText'] = $buttonText; return $this; @@ -434,6 +557,12 @@ public function setChannel($channel) ) ); } + + + if (is_null($channel)) { + throw new \InvalidArgumentException('non-nullable channel cannot be null'); + } + $this->container['channel'] = $channel; return $this; diff --git a/lib/Model/WhatsApp.php b/lib/Model/WhatsApp.php index c32db95..f1fce1d 100644 --- a/lib/Model/WhatsApp.php +++ b/lib/Model/WhatsApp.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.2 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -82,6 +82,28 @@ class WhatsApp implements ModelInterface, ArrayAccess 'channel' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'sender' => false, + 'validity' => false, + 'text' => false, + 'image' => false, + 'document' => false, + 'audio' => false, + 'channel' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -102,6 +124,60 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of property to nullable mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPINullables() + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + public function getOpenAPINullablesSetToNull() + { + return $this->openAPINullablesSetToNull; + } + + public function setOpenAPINullablesSetToNull($nullablesSetToNull) + { + $this->openAPINullablesSetToNull=$nullablesSetToNull; + + return $this; + } + + /** + * Checks if a property is nullable + * + * @return bool + */ + public static function isNullable(string $property): bool + { + if (isset(self::$openAPINullables[$property])) { + return self::$openAPINullables[$property]; + } + + return false; + } + + /** + * Checks if a nullable property is set to null. + * + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + if (in_array($property, $this->getOpenAPINullablesSetToNull())) { + return true; + } + return false; + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -221,13 +297,24 @@ public function getChannelAllowableValues() */ public function __construct(array $data = null) { - $this->container['sender'] = isset($data['sender']) ? $data['sender'] : null; - $this->container['validity'] = isset($data['validity']) ? $data['validity'] : null; - $this->container['text'] = isset($data['text']) ? $data['text'] : null; - $this->container['image'] = isset($data['image']) ? $data['image'] : null; - $this->container['document'] = isset($data['document']) ? $data['document'] : null; - $this->container['audio'] = isset($data['audio']) ? $data['audio'] : null; - $this->container['channel'] = isset($data['channel']) ? $data['channel'] : 'whatsapp'; + $this->setIfExists('sender', $data, null); + $this->setIfExists('validity', $data, null); + $this->setIfExists('text', $data, null); + $this->setIfExists('image', $data, null); + $this->setIfExists('document', $data, null); + $this->setIfExists('audio', $data, null); + $this->setIfExists('channel', $data, 'whatsapp'); + } + + public function setIfExists(string $variableName, $fields, $defaultValue) + { + if (is_array($fields) && array_key_exists($variableName, $fields) && is_null($fields[$variableName]) && self::isNullable($variableName)) { + array_push($this->openAPINullablesSetToNull, $variableName); + } + + $this->container[$variableName] = isset($fields[$variableName]) ? $fields[$variableName] : $defaultValue; + + return $this; } /** @@ -281,6 +368,12 @@ public function getSender() */ public function setSender($sender) { + + + if (is_null($sender)) { + throw new \InvalidArgumentException('non-nullable sender cannot be null'); + } + $this->container['sender'] = $sender; return $this; @@ -305,6 +398,12 @@ public function getValidity() */ public function setValidity($validity) { + + + if (is_null($validity)) { + throw new \InvalidArgumentException('non-nullable validity cannot be null'); + } + $this->container['validity'] = $validity; return $this; @@ -329,6 +428,12 @@ public function getText() */ public function setText($text) { + + + if (is_null($text)) { + throw new \InvalidArgumentException('non-nullable text cannot be null'); + } + $this->container['text'] = $text; return $this; @@ -353,6 +458,12 @@ public function getImage() */ public function setImage($image) { + + + if (is_null($image)) { + throw new \InvalidArgumentException('non-nullable image cannot be null'); + } + $this->container['image'] = $image; return $this; @@ -377,6 +488,12 @@ public function getDocument() */ public function setDocument($document) { + + + if (is_null($document)) { + throw new \InvalidArgumentException('non-nullable document cannot be null'); + } + $this->container['document'] = $document; return $this; @@ -401,6 +518,12 @@ public function getAudio() */ public function setAudio($audio) { + + + if (is_null($audio)) { + throw new \InvalidArgumentException('non-nullable audio cannot be null'); + } + $this->container['audio'] = $audio; return $this; @@ -434,6 +557,12 @@ public function setChannel($channel) ) ); } + + + if (is_null($channel)) { + throw new \InvalidArgumentException('non-nullable channel cannot be null'); + } + $this->container['channel'] = $channel; return $this; diff --git a/lib/Model/WhatsAppAudio.php b/lib/Model/WhatsAppAudio.php index 780d954..d4c70db 100644 --- a/lib/Model/WhatsAppAudio.php +++ b/lib/Model/WhatsAppAudio.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.2 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -70,6 +70,22 @@ class WhatsAppAudio implements ModelInterface, ArrayAccess 'content' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'content' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -90,6 +106,60 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of property to nullable mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPINullables() + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + public function getOpenAPINullablesSetToNull() + { + return $this->openAPINullablesSetToNull; + } + + public function setOpenAPINullablesSetToNull($nullablesSetToNull) + { + $this->openAPINullablesSetToNull=$nullablesSetToNull; + + return $this; + } + + /** + * Checks if a property is nullable + * + * @return bool + */ + public static function isNullable(string $property): bool + { + if (isset(self::$openAPINullables[$property])) { + return self::$openAPINullables[$property]; + } + + return false; + } + + /** + * Checks if a nullable property is set to null. + * + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + if (in_array($property, $this->getOpenAPINullablesSetToNull())) { + return true; + } + return false; + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -178,7 +248,18 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['content'] = isset($data['content']) ? $data['content'] : null; + $this->setIfExists('content', $data, null); + } + + public function setIfExists(string $variableName, $fields, $defaultValue) + { + if (is_array($fields) && array_key_exists($variableName, $fields) && is_null($fields[$variableName]) && self::isNullable($variableName)) { + array_push($this->openAPINullablesSetToNull, $variableName); + } + + $this->container[$variableName] = isset($fields[$variableName]) ? $fields[$variableName] : $defaultValue; + + return $this; } /** @@ -227,6 +308,12 @@ public function getContent() */ public function setContent($content) { + + + if (is_null($content)) { + throw new \InvalidArgumentException('non-nullable content cannot be null'); + } + $this->container['content'] = $content; return $this; diff --git a/lib/Model/WhatsAppDocument.php b/lib/Model/WhatsAppDocument.php index a9bbce7..513632c 100644 --- a/lib/Model/WhatsAppDocument.php +++ b/lib/Model/WhatsAppDocument.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.2 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -72,6 +72,23 @@ class WhatsAppDocument implements ModelInterface, ArrayAccess 'content' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'caption' => false, + 'content' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -92,6 +109,60 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of property to nullable mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPINullables() + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + public function getOpenAPINullablesSetToNull() + { + return $this->openAPINullablesSetToNull; + } + + public function setOpenAPINullablesSetToNull($nullablesSetToNull) + { + $this->openAPINullablesSetToNull=$nullablesSetToNull; + + return $this; + } + + /** + * Checks if a property is nullable + * + * @return bool + */ + public static function isNullable(string $property): bool + { + if (isset(self::$openAPINullables[$property])) { + return self::$openAPINullables[$property]; + } + + return false; + } + + /** + * Checks if a nullable property is set to null. + * + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + if (in_array($property, $this->getOpenAPINullablesSetToNull())) { + return true; + } + return false; + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -183,8 +254,19 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['caption'] = isset($data['caption']) ? $data['caption'] : null; - $this->container['content'] = isset($data['content']) ? $data['content'] : null; + $this->setIfExists('caption', $data, null); + $this->setIfExists('content', $data, null); + } + + public function setIfExists(string $variableName, $fields, $defaultValue) + { + if (is_array($fields) && array_key_exists($variableName, $fields) && is_null($fields[$variableName]) && self::isNullable($variableName)) { + array_push($this->openAPINullablesSetToNull, $variableName); + } + + $this->container[$variableName] = isset($fields[$variableName]) ? $fields[$variableName] : $defaultValue; + + return $this; } /** @@ -233,6 +315,12 @@ public function getCaption() */ public function setCaption($caption) { + + + if (is_null($caption)) { + throw new \InvalidArgumentException('non-nullable caption cannot be null'); + } + $this->container['caption'] = $caption; return $this; @@ -257,6 +345,12 @@ public function getContent() */ public function setContent($content) { + + + if (is_null($content)) { + throw new \InvalidArgumentException('non-nullable content cannot be null'); + } + $this->container['content'] = $content; return $this; diff --git a/lib/Model/WhatsAppImage.php b/lib/Model/WhatsAppImage.php index 95d37bf..31d835d 100644 --- a/lib/Model/WhatsAppImage.php +++ b/lib/Model/WhatsAppImage.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.2 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -72,6 +72,23 @@ class WhatsAppImage implements ModelInterface, ArrayAccess 'content' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'caption' => false, + 'content' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -92,6 +109,60 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of property to nullable mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPINullables() + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + public function getOpenAPINullablesSetToNull() + { + return $this->openAPINullablesSetToNull; + } + + public function setOpenAPINullablesSetToNull($nullablesSetToNull) + { + $this->openAPINullablesSetToNull=$nullablesSetToNull; + + return $this; + } + + /** + * Checks if a property is nullable + * + * @return bool + */ + public static function isNullable(string $property): bool + { + if (isset(self::$openAPINullables[$property])) { + return self::$openAPINullables[$property]; + } + + return false; + } + + /** + * Checks if a nullable property is set to null. + * + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + if (in_array($property, $this->getOpenAPINullablesSetToNull())) { + return true; + } + return false; + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -183,8 +254,19 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['caption'] = isset($data['caption']) ? $data['caption'] : null; - $this->container['content'] = isset($data['content']) ? $data['content'] : null; + $this->setIfExists('caption', $data, null); + $this->setIfExists('content', $data, null); + } + + public function setIfExists(string $variableName, $fields, $defaultValue) + { + if (is_array($fields) && array_key_exists($variableName, $fields) && is_null($fields[$variableName]) && self::isNullable($variableName)) { + array_push($this->openAPINullablesSetToNull, $variableName); + } + + $this->container[$variableName] = isset($fields[$variableName]) ? $fields[$variableName] : $defaultValue; + + return $this; } /** @@ -233,6 +315,12 @@ public function getCaption() */ public function setCaption($caption) { + + + if (is_null($caption)) { + throw new \InvalidArgumentException('non-nullable caption cannot be null'); + } + $this->container['caption'] = $caption; return $this; @@ -257,6 +345,12 @@ public function getContent() */ public function setContent($content) { + + + if (is_null($content)) { + throw new \InvalidArgumentException('non-nullable content cannot be null'); + } + $this->container['content'] = $content; return $this; diff --git a/lib/Model/WhatsAppText.php b/lib/Model/WhatsAppText.php index 1ad17f2..62d3381 100644 --- a/lib/Model/WhatsAppText.php +++ b/lib/Model/WhatsAppText.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.2 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -72,6 +72,23 @@ class WhatsAppText implements ModelInterface, ArrayAccess 'body' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'previewUrl' => false, + 'body' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -92,6 +109,60 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of property to nullable mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPINullables() + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + public function getOpenAPINullablesSetToNull() + { + return $this->openAPINullablesSetToNull; + } + + public function setOpenAPINullablesSetToNull($nullablesSetToNull) + { + $this->openAPINullablesSetToNull=$nullablesSetToNull; + + return $this; + } + + /** + * Checks if a property is nullable + * + * @return bool + */ + public static function isNullable(string $property): bool + { + if (isset(self::$openAPINullables[$property])) { + return self::$openAPINullables[$property]; + } + + return false; + } + + /** + * Checks if a nullable property is set to null. + * + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + if (in_array($property, $this->getOpenAPINullablesSetToNull())) { + return true; + } + return false; + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -183,8 +254,19 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['previewUrl'] = isset($data['previewUrl']) ? $data['previewUrl'] : true; - $this->container['body'] = isset($data['body']) ? $data['body'] : null; + $this->setIfExists('previewUrl', $data, true); + $this->setIfExists('body', $data, null); + } + + public function setIfExists(string $variableName, $fields, $defaultValue) + { + if (is_array($fields) && array_key_exists($variableName, $fields) && is_null($fields[$variableName]) && self::isNullable($variableName)) { + array_push($this->openAPINullablesSetToNull, $variableName); + } + + $this->container[$variableName] = isset($fields[$variableName]) ? $fields[$variableName] : $defaultValue; + + return $this; } /** @@ -233,6 +315,12 @@ public function getPreviewUrl() */ public function setPreviewUrl($previewUrl) { + + + if (is_null($previewUrl)) { + throw new \InvalidArgumentException('non-nullable previewUrl cannot be null'); + } + $this->container['previewUrl'] = $previewUrl; return $this; @@ -257,6 +345,12 @@ public function getBody() */ public function setBody($body) { + + + if (is_null($body)) { + throw new \InvalidArgumentException('non-nullable body cannot be null'); + } + $this->container['body'] = $body; return $this; diff --git a/lib/ObjectSerializer.php b/lib/ObjectSerializer.php index 8b9d7db..00d2556 100644 --- a/lib/ObjectSerializer.php +++ b/lib/ObjectSerializer.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.2 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -75,7 +75,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n $imploded = implode("', '", $openAPIType::getAllowableEnumValues()); throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); } - if ($value !== null) { + if ($data::isNullable($property) && $data->isNullableSetToNull($property) || $value !== null) { $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]); } } @@ -317,7 +317,12 @@ public static function deserialize($data, $class, $httpHeaders = null) foreach ($instance::openAPITypes() as $property => $type) { $propertySetter = $instance::setters()[$property]; - if (!isset($propertySetter) || !isset($data->{$instance::attributeMap()[$property]})) { + if (!isset($propertySetter)) { + continue; + } + + if (!isset($data->{$instance::attributeMap()[$property]})) { + $instance->$propertySetter(null); continue; } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 08f78fa..3dd90bb 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -11,11 +11,13 @@ ./test/Model - ./lib/Api ./lib/Model + + +