From cc08fa2b472efdcc0ed47a89e92a36bf9427d0e2 Mon Sep 17 00:00:00 2001 From: api-librarian Date: Fri, 29 Oct 2021 11:54:09 +0000 Subject: [PATCH 1/8] Travis update: Oct 2021 (Build 686) [skip ci] --- .gitignore | 14 - .openapi-generator/FILES | 184 ------ .openapi-generator/VERSION | 2 +- .travis.yml | 11 +- README.md | 4 +- composer.json | 2 +- docs/Api/BlacklistApi.md | 72 ++- docs/Api/ContactsApi.md | 147 ++--- docs/Api/DeliveryReportApi.md | 20 +- docs/Api/GroupsApi.md | 95 +-- docs/Api/NumberLookupApi.md | 22 +- docs/Api/OmnimessageApi.md | 39 +- docs/Api/StatisticsApi.md | 22 +- docs/Model/Channel.md | 4 +- docs/Model/ContactEnvelope.md | 6 +- docs/Model/ContactFields.md | 24 +- docs/Model/ContactListEnvelope.md | 6 +- docs/Model/ContactResponseFields.md | 26 +- docs/Model/ContactUpdateFields.md | 22 +- docs/Model/DeliveryReportResponse.md | 10 +- docs/Model/DeliveryResult.md | 18 +- docs/Model/ErrorCodeOmnichannel.md | 4 +- docs/Model/ErrorCodeOmnichannelMachine.md | 4 +- docs/Model/ErrorCodePhonebook.md | 4 +- docs/Model/ErrorCodeStatistics.md | 4 +- docs/Model/ErrorItemNumberLookup.md | 6 +- docs/Model/ErrorItemNumberLookupError.md | 8 +- docs/Model/ErrorItemOmnichannel.md | 12 +- docs/Model/ErrorItemPhonebook.md | 10 +- docs/Model/ErrorItemStatistics.md | 10 +- docs/Model/ErrorNumberLookup.md | 6 +- docs/Model/ErrorOmnichannel.md | 6 +- docs/Model/ErrorPhonebook.md | 6 +- docs/Model/ErrorStatistics.md | 6 +- docs/Model/ErrorTitleOmnichannel.md | 4 +- docs/Model/ErrorTitlePhonebook.md | 4 +- docs/Model/FetchBlacklistSuccess.md | 6 +- docs/Model/GroupEnvelope.md | 6 +- docs/Model/GroupListEnvelope.md | 6 +- docs/Model/GroupName.md | 6 +- docs/Model/GroupResponseFields.md | 12 +- docs/Model/MessageResult.md | 10 +- docs/Model/MobileNetwork.md | 14 +- docs/Model/NumberToBlacklist.md | 6 +- docs/Model/NumbersToInvestigate.md | 6 +- .../Model/OmniMessageCreateSuccessResponse.md | 10 +- docs/Model/Omnimessage.md | 18 +- docs/Model/Priority.md | 4 +- docs/Model/SMS.md | 14 +- docs/Model/StatisticsReport.md | 10 +- docs/Model/StatisticsReportSettings.md | 10 +- docs/Model/StatisticsReportSuccess.md | 6 +- docs/Model/Status.md | 4 +- docs/Model/SyncNumberLookupResult.md | 22 +- docs/Model/SyncNumberLookupSuccess.md | 8 +- docs/Model/Telegram.md | 16 +- docs/Model/TextStore.md | 4 +- docs/Model/Viber.md | 16 +- docs/Model/WhatsApp.md | 16 +- docs/Model/WhatsAppAudio.md | 6 +- docs/Model/WhatsAppDocument.md | 8 +- docs/Model/WhatsAppImage.md | 8 +- docs/Model/WhatsAppText.md | 6 +- git_push.sh | 17 +- lib/Api/BlacklistApi.php | 229 ++++--- lib/Api/ContactsApi.php | 581 +++++++++--------- lib/Api/DeliveryReportApi.php | 86 +-- lib/Api/GroupsApi.php | 357 ++++++----- lib/Api/NumberLookupApi.php | 95 ++- lib/Api/OmnimessageApi.php | 152 +++-- lib/Api/StatisticsApi.php | 99 ++- lib/ApiException.php | 24 +- lib/Configuration.php | 51 +- lib/HeaderSelector.php | 13 +- lib/Model/Channel.php | 13 +- lib/Model/ContactEnvelope.php | 139 +++-- lib/Model/ContactFields.php | 301 +++++++-- lib/Model/ContactListEnvelope.php | 137 +++-- lib/Model/ContactResponseFields.php | 319 ++++++++-- lib/Model/ContactUpdateFields.php | 290 +++++++-- lib/Model/DeliveryReportResponse.php | 161 +++-- lib/Model/DeliveryResult.php | 194 ++++-- lib/Model/ErrorCodeOmnichannel.php | 16 +- lib/Model/ErrorCodeOmnichannelMachine.php | 67 +- lib/Model/ErrorCodePhonebook.php | 15 +- lib/Model/ErrorCodeStatistics.php | 13 +- lib/Model/ErrorItemNumberLookup.php | 139 +++-- lib/Model/ErrorItemNumberLookupError.php | 150 +++-- lib/Model/ErrorItemOmnichannel.php | 179 ++++-- lib/Model/ErrorItemPhonebook.php | 161 +++-- lib/Model/ErrorItemStatistics.php | 161 +++-- lib/Model/ErrorNumberLookup.php | 139 +++-- lib/Model/ErrorOmnichannel.php | 139 +++-- lib/Model/ErrorPhonebook.php | 139 +++-- lib/Model/ErrorStatistics.php | 139 +++-- lib/Model/ErrorTitleOmnichannel.php | 16 +- lib/Model/ErrorTitlePhonebook.php | 15 +- lib/Model/FetchBlacklistSuccess.php | 137 +++-- lib/Model/GroupEnvelope.php | 139 +++-- lib/Model/GroupListEnvelope.php | 137 +++-- lib/Model/GroupName.php | 139 +++-- lib/Model/GroupResponseFields.php | 179 ++++-- lib/Model/MessageResult.php | 161 +++-- lib/Model/MobileNetwork.php | 183 ++++-- lib/Model/ModelInterface.php | 6 +- lib/Model/NumberToBlacklist.php | 139 +++-- lib/Model/NumbersToInvestigate.php | 152 +++-- .../OmniMessageCreateSuccessResponse.php | 161 +++-- lib/Model/Omnimessage.php | 194 ++++-- lib/Model/Priority.php | 12 +- lib/Model/SMS.php | 208 +++++-- lib/Model/StatisticsReport.php | 161 +++-- lib/Model/StatisticsReportSettings.php | 161 +++-- lib/Model/StatisticsReportSuccess.php | 139 +++-- lib/Model/Status.php | 20 +- lib/Model/SyncNumberLookupResult.php | 281 +++++++-- lib/Model/SyncNumberLookupSuccess.php | 150 +++-- lib/Model/Telegram.php | 211 +++++-- lib/Model/TextStore.php | 12 +- lib/Model/Viber.php | 211 +++++-- lib/Model/WhatsApp.php | 211 +++++-- lib/Model/WhatsAppAudio.php | 139 +++-- lib/Model/WhatsAppDocument.php | 150 +++-- lib/Model/WhatsAppImage.php | 150 +++-- lib/Model/WhatsAppText.php | 150 +++-- lib/ObjectSerializer.php | 143 ++--- phpunit.xml.dist | 37 +- test/Api/BlacklistApiTest.php | 122 ---- test/Api/ContactsApiTest.php | 170 ----- test/Api/DeliveryReportApiTest.php | 86 --- test/Api/GroupsApiTest.php | 134 ---- test/Api/NumberLookupApiTest.php | 86 --- test/Api/OmnimessageApiTest.php | 98 --- test/Api/StatisticsApiTest.php | 86 --- test/Model/ChannelTest.php | 82 --- test/Model/ContactEnvelopeTest.php | 91 --- test/Model/ContactFieldsTest.php | 172 ------ test/Model/ContactListEnvelopeTest.php | 91 --- test/Model/ContactResponseFieldsTest.php | 181 ------ test/Model/ContactUpdateFieldsTest.php | 163 ----- test/Model/DeliveryReportResponseTest.php | 109 ---- test/Model/DeliveryResultTest.php | 136 ---- .../Model/ErrorCodeOmnichannelMachineTest.php | 82 --- test/Model/ErrorCodeOmnichannelTest.php | 82 --- test/Model/ErrorCodePhonebookTest.php | 82 --- test/Model/ErrorCodeStatisticsTest.php | 82 --- test/Model/ErrorItemNumberLookupErrorTest.php | 100 --- test/Model/ErrorItemNumberLookupTest.php | 91 --- test/Model/ErrorItemOmnichannelTest.php | 118 ---- test/Model/ErrorItemPhonebookTest.php | 109 ---- test/Model/ErrorItemStatisticsTest.php | 109 ---- test/Model/ErrorNumberLookupTest.php | 91 --- test/Model/ErrorOmnichannelTest.php | 91 --- test/Model/ErrorPhonebookTest.php | 91 --- test/Model/ErrorStatisticsTest.php | 91 --- test/Model/ErrorTitleOmnichannelTest.php | 82 --- test/Model/ErrorTitlePhonebookTest.php | 82 --- test/Model/FetchBlacklistSuccessTest.php | 91 --- test/Model/GroupEnvelopeTest.php | 91 --- test/Model/GroupListEnvelopeTest.php | 91 --- test/Model/GroupNameTest.php | 91 --- test/Model/GroupResponseFieldsTest.php | 118 ---- test/Model/MessageResultTest.php | 109 ---- test/Model/MobileNetworkTest.php | 127 ---- test/Model/NumberToBlacklistTest.php | 91 --- test/Model/NumbersToInvestigateTest.php | 91 --- .../OmniMessageCreateSuccessResponseTest.php | 109 ---- test/Model/OmnimessageTest.php | 136 ---- test/Model/PriorityTest.php | 82 --- test/Model/SMSTest.php | 136 ---- test/Model/StatisticsReportSettingsTest.php | 109 ---- test/Model/StatisticsReportSuccessTest.php | 91 --- test/Model/StatisticsReportTest.php | 109 ---- test/Model/StatusTest.php | 82 --- test/Model/SyncNumberLookupResultTest.php | 163 ----- test/Model/SyncNumberLookupSuccessTest.php | 100 --- test/Model/TelegramTest.php | 145 ----- test/Model/TextStoreTest.php | 82 --- test/Model/ViberTest.php | 145 ----- test/Model/WhatsAppAudioTest.php | 91 --- test/Model/WhatsAppDocumentTest.php | 100 --- test/Model/WhatsAppImageTest.php | 100 --- test/Model/WhatsAppTest.php | 145 ----- test/Model/WhatsAppTextTest.php | 100 --- 184 files changed, 6663 insertions(+), 9573 deletions(-) delete mode 100644 .gitignore delete mode 100644 .openapi-generator/FILES delete mode 100644 test/Api/BlacklistApiTest.php delete mode 100644 test/Api/ContactsApiTest.php delete mode 100644 test/Api/DeliveryReportApiTest.php delete mode 100644 test/Api/GroupsApiTest.php delete mode 100644 test/Api/NumberLookupApiTest.php delete mode 100644 test/Api/OmnimessageApiTest.php delete mode 100644 test/Api/StatisticsApiTest.php delete mode 100644 test/Model/ChannelTest.php delete mode 100644 test/Model/ContactEnvelopeTest.php delete mode 100644 test/Model/ContactFieldsTest.php delete mode 100644 test/Model/ContactListEnvelopeTest.php delete mode 100644 test/Model/ContactResponseFieldsTest.php delete mode 100644 test/Model/ContactUpdateFieldsTest.php delete mode 100644 test/Model/DeliveryReportResponseTest.php delete mode 100644 test/Model/DeliveryResultTest.php delete mode 100644 test/Model/ErrorCodeOmnichannelMachineTest.php delete mode 100644 test/Model/ErrorCodeOmnichannelTest.php delete mode 100644 test/Model/ErrorCodePhonebookTest.php delete mode 100644 test/Model/ErrorCodeStatisticsTest.php delete mode 100644 test/Model/ErrorItemNumberLookupErrorTest.php delete mode 100644 test/Model/ErrorItemNumberLookupTest.php delete mode 100644 test/Model/ErrorItemOmnichannelTest.php delete mode 100644 test/Model/ErrorItemPhonebookTest.php delete mode 100644 test/Model/ErrorItemStatisticsTest.php delete mode 100644 test/Model/ErrorNumberLookupTest.php delete mode 100644 test/Model/ErrorOmnichannelTest.php delete mode 100644 test/Model/ErrorPhonebookTest.php delete mode 100644 test/Model/ErrorStatisticsTest.php delete mode 100644 test/Model/ErrorTitleOmnichannelTest.php delete mode 100644 test/Model/ErrorTitlePhonebookTest.php delete mode 100644 test/Model/FetchBlacklistSuccessTest.php delete mode 100644 test/Model/GroupEnvelopeTest.php delete mode 100644 test/Model/GroupListEnvelopeTest.php delete mode 100644 test/Model/GroupNameTest.php delete mode 100644 test/Model/GroupResponseFieldsTest.php delete mode 100644 test/Model/MessageResultTest.php delete mode 100644 test/Model/MobileNetworkTest.php delete mode 100644 test/Model/NumberToBlacklistTest.php delete mode 100644 test/Model/NumbersToInvestigateTest.php delete mode 100644 test/Model/OmniMessageCreateSuccessResponseTest.php delete mode 100644 test/Model/OmnimessageTest.php delete mode 100644 test/Model/PriorityTest.php delete mode 100644 test/Model/SMSTest.php delete mode 100644 test/Model/StatisticsReportSettingsTest.php delete mode 100644 test/Model/StatisticsReportSuccessTest.php delete mode 100644 test/Model/StatisticsReportTest.php delete mode 100644 test/Model/StatusTest.php delete mode 100644 test/Model/SyncNumberLookupResultTest.php delete mode 100644 test/Model/SyncNumberLookupSuccessTest.php delete mode 100644 test/Model/TelegramTest.php delete mode 100644 test/Model/TextStoreTest.php delete mode 100644 test/Model/ViberTest.php delete mode 100644 test/Model/WhatsAppAudioTest.php delete mode 100644 test/Model/WhatsAppDocumentTest.php delete mode 100644 test/Model/WhatsAppImageTest.php delete mode 100644 test/Model/WhatsAppTest.php delete mode 100644 test/Model/WhatsAppTextTest.php diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 92f7fde..0000000 --- a/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -# ref: https://github.com/github/gitignore/blob/master/Composer.gitignore - -composer.phar -/vendor/ - -# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control -# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file -# composer.lock - -# php-cs-fixer cache -.php_cs.cache - -# PHPUnit cache -.phpunit.result.cache diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES deleted file mode 100644 index 274bcd7..0000000 --- a/.openapi-generator/FILES +++ /dev/null @@ -1,184 +0,0 @@ -.gitignore -.openapi-generator-ignore -.php_cs -.travis.yml -README.md -composer.json -docs/Api/BlacklistApi.md -docs/Api/ContactsApi.md -docs/Api/DeliveryReportApi.md -docs/Api/GroupsApi.md -docs/Api/NumberLookupApi.md -docs/Api/OmnimessageApi.md -docs/Api/StatisticsApi.md -docs/Model/Channel.md -docs/Model/ContactEnvelope.md -docs/Model/ContactFields.md -docs/Model/ContactListEnvelope.md -docs/Model/ContactResponseFields.md -docs/Model/ContactUpdateFields.md -docs/Model/DeliveryReportResponse.md -docs/Model/DeliveryResult.md -docs/Model/ErrorCodeOmnichannel.md -docs/Model/ErrorCodeOmnichannelMachine.md -docs/Model/ErrorCodePhonebook.md -docs/Model/ErrorCodeStatistics.md -docs/Model/ErrorItemNumberLookup.md -docs/Model/ErrorItemNumberLookupError.md -docs/Model/ErrorItemOmnichannel.md -docs/Model/ErrorItemPhonebook.md -docs/Model/ErrorItemStatistics.md -docs/Model/ErrorNumberLookup.md -docs/Model/ErrorOmnichannel.md -docs/Model/ErrorPhonebook.md -docs/Model/ErrorStatistics.md -docs/Model/ErrorTitleOmnichannel.md -docs/Model/ErrorTitlePhonebook.md -docs/Model/FetchBlacklistSuccess.md -docs/Model/GroupEnvelope.md -docs/Model/GroupListEnvelope.md -docs/Model/GroupName.md -docs/Model/GroupResponseFields.md -docs/Model/MessageResult.md -docs/Model/MobileNetwork.md -docs/Model/NumberToBlacklist.md -docs/Model/NumbersToInvestigate.md -docs/Model/OmniMessageCreateSuccessResponse.md -docs/Model/Omnimessage.md -docs/Model/Priority.md -docs/Model/SMS.md -docs/Model/StatisticsReport.md -docs/Model/StatisticsReportSettings.md -docs/Model/StatisticsReportSuccess.md -docs/Model/Status.md -docs/Model/SyncNumberLookupResult.md -docs/Model/SyncNumberLookupSuccess.md -docs/Model/Telegram.md -docs/Model/TextStore.md -docs/Model/Viber.md -docs/Model/WhatsApp.md -docs/Model/WhatsAppAudio.md -docs/Model/WhatsAppDocument.md -docs/Model/WhatsAppImage.md -docs/Model/WhatsAppText.md -git_push.sh -lib/Api/BlacklistApi.php -lib/Api/ContactsApi.php -lib/Api/DeliveryReportApi.php -lib/Api/GroupsApi.php -lib/Api/NumberLookupApi.php -lib/Api/OmnimessageApi.php -lib/Api/StatisticsApi.php -lib/ApiException.php -lib/Configuration.php -lib/HeaderSelector.php -lib/Model/Channel.php -lib/Model/ContactEnvelope.php -lib/Model/ContactFields.php -lib/Model/ContactListEnvelope.php -lib/Model/ContactResponseFields.php -lib/Model/ContactUpdateFields.php -lib/Model/DeliveryReportResponse.php -lib/Model/DeliveryResult.php -lib/Model/ErrorCodeOmnichannel.php -lib/Model/ErrorCodeOmnichannelMachine.php -lib/Model/ErrorCodePhonebook.php -lib/Model/ErrorCodeStatistics.php -lib/Model/ErrorItemNumberLookup.php -lib/Model/ErrorItemNumberLookupError.php -lib/Model/ErrorItemOmnichannel.php -lib/Model/ErrorItemPhonebook.php -lib/Model/ErrorItemStatistics.php -lib/Model/ErrorNumberLookup.php -lib/Model/ErrorOmnichannel.php -lib/Model/ErrorPhonebook.php -lib/Model/ErrorStatistics.php -lib/Model/ErrorTitleOmnichannel.php -lib/Model/ErrorTitlePhonebook.php -lib/Model/FetchBlacklistSuccess.php -lib/Model/GroupEnvelope.php -lib/Model/GroupListEnvelope.php -lib/Model/GroupName.php -lib/Model/GroupResponseFields.php -lib/Model/MessageResult.php -lib/Model/MobileNetwork.php -lib/Model/ModelInterface.php -lib/Model/NumberToBlacklist.php -lib/Model/NumbersToInvestigate.php -lib/Model/OmniMessageCreateSuccessResponse.php -lib/Model/Omnimessage.php -lib/Model/Priority.php -lib/Model/SMS.php -lib/Model/StatisticsReport.php -lib/Model/StatisticsReportSettings.php -lib/Model/StatisticsReportSuccess.php -lib/Model/Status.php -lib/Model/SyncNumberLookupResult.php -lib/Model/SyncNumberLookupSuccess.php -lib/Model/Telegram.php -lib/Model/TextStore.php -lib/Model/Viber.php -lib/Model/WhatsApp.php -lib/Model/WhatsAppAudio.php -lib/Model/WhatsAppDocument.php -lib/Model/WhatsAppImage.php -lib/Model/WhatsAppText.php -lib/ObjectSerializer.php -phpunit.xml.dist -test/Api/BlacklistApiTest.php -test/Api/ContactsApiTest.php -test/Api/DeliveryReportApiTest.php -test/Api/GroupsApiTest.php -test/Api/NumberLookupApiTest.php -test/Api/OmnimessageApiTest.php -test/Api/StatisticsApiTest.php -test/Model/ChannelTest.php -test/Model/ContactEnvelopeTest.php -test/Model/ContactFieldsTest.php -test/Model/ContactListEnvelopeTest.php -test/Model/ContactResponseFieldsTest.php -test/Model/ContactUpdateFieldsTest.php -test/Model/DeliveryReportResponseTest.php -test/Model/DeliveryResultTest.php -test/Model/ErrorCodeOmnichannelMachineTest.php -test/Model/ErrorCodeOmnichannelTest.php -test/Model/ErrorCodePhonebookTest.php -test/Model/ErrorCodeStatisticsTest.php -test/Model/ErrorItemNumberLookupErrorTest.php -test/Model/ErrorItemNumberLookupTest.php -test/Model/ErrorItemOmnichannelTest.php -test/Model/ErrorItemPhonebookTest.php -test/Model/ErrorItemStatisticsTest.php -test/Model/ErrorNumberLookupTest.php -test/Model/ErrorOmnichannelTest.php -test/Model/ErrorPhonebookTest.php -test/Model/ErrorStatisticsTest.php -test/Model/ErrorTitleOmnichannelTest.php -test/Model/ErrorTitlePhonebookTest.php -test/Model/FetchBlacklistSuccessTest.php -test/Model/GroupEnvelopeTest.php -test/Model/GroupListEnvelopeTest.php -test/Model/GroupNameTest.php -test/Model/GroupResponseFieldsTest.php -test/Model/MessageResultTest.php -test/Model/MobileNetworkTest.php -test/Model/NumberToBlacklistTest.php -test/Model/NumbersToInvestigateTest.php -test/Model/OmniMessageCreateSuccessResponseTest.php -test/Model/OmnimessageTest.php -test/Model/PriorityTest.php -test/Model/SMSTest.php -test/Model/StatisticsReportSettingsTest.php -test/Model/StatisticsReportSuccessTest.php -test/Model/StatisticsReportTest.php -test/Model/StatusTest.php -test/Model/SyncNumberLookupResultTest.php -test/Model/SyncNumberLookupSuccessTest.php -test/Model/TelegramTest.php -test/Model/TextStoreTest.php -test/Model/ViberTest.php -test/Model/WhatsAppAudioTest.php -test/Model/WhatsAppDocumentTest.php -test/Model/WhatsAppImageTest.php -test/Model/WhatsAppTest.php -test/Model/WhatsAppTextTest.php diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index e230c83..aa31e71 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.0 \ No newline at end of file +4.0.3 \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 714772e..d77f382 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,10 @@ language: php -# Bionic environment has preinstalled PHP from 7.1 to 7.4 -# https://docs.travis-ci.com/user/reference/bionic/#php-support -dist: bionic +sudo: false php: - - 7.3 - - 7.4 + - 5.4 + - 5.5 + - 5.6 + - 7.0 + - hhvm before_install: "composer install" script: "vendor/bin/phpunit" diff --git a/README.md b/README.md index b8b1fcc..903f149 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Messente API Library -- Messente API version: 2.0.0 -- PHP artifact version: 2.0.0 +- Messente API version: 1.4.0 +- PHP artifact version: 1.4.0 [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. 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 78b3564..ff0e769 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "messente/messente-api-php", - "version": "2.0.0", + "version": "1.4.0", "description": "[Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world.", "keywords": ["viber", "telegram", "sms", "whatsapp", "phonebook", "openapitools", "openapi-generator", diff --git a/docs/Api/BlacklistApi.md b/docs/Api/BlacklistApi.md index 7bd8656..1018d6b 100644 --- a/docs/Api/BlacklistApi.md +++ b/docs/Api/BlacklistApi.md @@ -1,20 +1,19 @@ # Messente\Api\BlacklistApi -All URIs are relative to https://api.messente.com/v1. +All URIs are relative to *https://api.messente.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**addToBlacklist()**](BlacklistApi.md#addToBlacklist) | **POST** /phonebook/blacklist | Adds a phone number to the blacklist -[**deleteFromBlacklist()**](BlacklistApi.md#deleteFromBlacklist) | **DELETE** /phonebook/blacklist/{phone} | Deletes a phone number from the blacklist -[**fetchBlacklist()**](BlacklistApi.md#fetchBlacklist) | **GET** /phonebook/blacklist | Returns all blacklisted phone numbers -[**isBlacklisted()**](BlacklistApi.md#isBlacklisted) | **GET** /phonebook/blacklist/{phone} | Checks if a phone number is blacklisted +[**addToBlacklist**](BlacklistApi.md#addToBlacklist) | **POST** /phonebook/blacklist | Adds a phone number to the blacklist +[**deleteFromBlacklist**](BlacklistApi.md#deleteFromBlacklist) | **DELETE** /phonebook/blacklist/{phone} | Deletes a phone number from the blacklist +[**fetchBlacklist**](BlacklistApi.md#fetchBlacklist) | **GET** /phonebook/blacklist | Returns all blacklisted phone numbers +[**isBlacklisted**](BlacklistApi.md#isBlacklisted) | **GET** /phonebook/blacklist/{phone} | Checks if a phone number is blacklisted -## `addToBlacklist()` -```php -addToBlacklist($numberToBlacklist) -``` +## addToBlacklist + +> addToBlacklist($numberToBlacklist) Adds a phone number to the blacklist @@ -44,10 +43,12 @@ try { } catch (Exception $e) { echo 'Exception when calling BlacklistApi->addToBlacklist: ', $e->getMessage(), PHP_EOL; } +?> ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **numberToBlacklist** | [**\Messente\Api\Model\NumberToBlacklist**](../Model/NumberToBlacklist.md)| Phone number to be blacklisted | @@ -62,18 +63,17 @@ void (empty response body) ### HTTP request headers -- **Content-Type**: `application/json` -- **Accept**: `application/json` +- **Content-Type**: application/json +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -## `deleteFromBlacklist()` -```php -deleteFromBlacklist($phone) -``` +## deleteFromBlacklist + +> deleteFromBlacklist($phone) Deletes a phone number from the blacklist @@ -103,10 +103,12 @@ try { } catch (Exception $e) { echo 'Exception when calling BlacklistApi->deleteFromBlacklist: ', $e->getMessage(), PHP_EOL; } +?> ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **phone** | **string**| A phone number | @@ -122,17 +124,16 @@ void (empty response body) ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: `application/json` +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -## `fetchBlacklist()` -```php -fetchBlacklist(): \Messente\Api\Model\FetchBlacklistSuccess -``` +## fetchBlacklist + +> \Messente\Api\Model\FetchBlacklistSuccess fetchBlacklist() Returns all blacklisted phone numbers @@ -162,6 +163,7 @@ try { } catch (Exception $e) { echo 'Exception when calling BlacklistApi->fetchBlacklist: ', $e->getMessage(), PHP_EOL; } +?> ``` ### Parameters @@ -179,17 +181,16 @@ This endpoint does not need any parameter. ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: `application/json` +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -## `isBlacklisted()` -```php -isBlacklisted($phone) -``` +## isBlacklisted + +> isBlacklisted($phone) Checks if a phone number is blacklisted @@ -219,10 +220,12 @@ try { } catch (Exception $e) { echo 'Exception when calling BlacklistApi->isBlacklisted: ', $e->getMessage(), PHP_EOL; } +?> ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **phone** | **string**| A phone number | @@ -238,8 +241,9 @@ void (empty response body) ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: `application/json` +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/docs/Api/ContactsApi.md b/docs/Api/ContactsApi.md index 970e008..4bf5349 100644 --- a/docs/Api/ContactsApi.md +++ b/docs/Api/ContactsApi.md @@ -1,24 +1,23 @@ # Messente\Api\ContactsApi -All URIs are relative to https://api.messente.com/v1. +All URIs are relative to *https://api.messente.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**addContactToGroup()**](ContactsApi.md#addContactToGroup) | **POST** /phonebook/groups/{groupId}/contacts/{phone} | Adds a contact to a group -[**createContact()**](ContactsApi.md#createContact) | **POST** /phonebook/contacts | Creates a new contact -[**deleteContact()**](ContactsApi.md#deleteContact) | **DELETE** /phonebook/contacts/{phone} | Deletes a contact -[**fetchContact()**](ContactsApi.md#fetchContact) | **GET** /phonebook/contacts/{phone} | Lists a contact -[**fetchContactGroups()**](ContactsApi.md#fetchContactGroups) | **GET** /phonebook/contacts/{phone}/groups | Lists groups of a contact -[**fetchContacts()**](ContactsApi.md#fetchContacts) | **GET** /phonebook/contacts | Returns all contacts -[**removeContactFromGroup()**](ContactsApi.md#removeContactFromGroup) | **DELETE** /phonebook/groups/{groupId}/contacts/{phone} | Removes a contact from a group -[**updateContact()**](ContactsApi.md#updateContact) | **PATCH** /phonebook/contacts/{phone} | Updates a contact +[**addContactToGroup**](ContactsApi.md#addContactToGroup) | **POST** /phonebook/groups/{groupId}/contacts/{phone} | Adds a contact to a group +[**createContact**](ContactsApi.md#createContact) | **POST** /phonebook/contacts | Creates a new contact +[**deleteContact**](ContactsApi.md#deleteContact) | **DELETE** /phonebook/contacts/{phone} | Deletes a contact +[**fetchContact**](ContactsApi.md#fetchContact) | **GET** /phonebook/contacts/{phone} | Lists a contact +[**fetchContactGroups**](ContactsApi.md#fetchContactGroups) | **GET** /phonebook/contacts/{phone}/groups | Lists groups of a contact +[**fetchContacts**](ContactsApi.md#fetchContacts) | **GET** /phonebook/contacts | Returns all contacts +[**removeContactFromGroup**](ContactsApi.md#removeContactFromGroup) | **DELETE** /phonebook/groups/{groupId}/contacts/{phone} | Removes a contact from a group +[**updateContact**](ContactsApi.md#updateContact) | **PATCH** /phonebook/contacts/{phone} | Updates a contact -## `addContactToGroup()` -```php -addContactToGroup($groupId, $phone): object -``` +## addContactToGroup + +> object addContactToGroup($groupId, $phone) Adds a contact to a group @@ -50,10 +49,12 @@ try { } catch (Exception $e) { echo 'Exception when calling ContactsApi->addContactToGroup: ', $e->getMessage(), PHP_EOL; } +?> ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **groupId** | **string**| String in UUID format | @@ -70,17 +71,16 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: `application/json` +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -## `createContact()` -```php -createContact($contactFields): \Messente\Api\Model\ContactEnvelope -``` +## createContact + +> \Messente\Api\Model\ContactEnvelope createContact($contactFields) Creates a new contact @@ -103,7 +103,7 @@ $apiInstance = new Messente\Api\Api\ContactsApi( new GuzzleHttp\Client(), $config ); -$contactFields = {"phoneNumber":"+37251000000","email":"anyone@messente.com","firstName":"Any","lastName":"One","company":"Messente","title":"Sir","custom":"Any custom","custom2":"Any custom two","custom3":"Any custom three","custom4":"Any custom four"}; // \Messente\Api\Model\ContactFields +$contactFields = {"phoneNumber":"+37251000000","email":"anyone@messente.com","firstName":"Any","lastName":"One","company":"Messente","title":"Sir","custom":"Any custom","custom2":"Any custom two","custom3":"Any custom three","custom4":"Any custom four"}; // \Messente\Api\Model\ContactFields | try { $result = $apiInstance->createContact($contactFields); @@ -111,10 +111,12 @@ try { } catch (Exception $e) { echo 'Exception when calling ContactsApi->createContact: ', $e->getMessage(), PHP_EOL; } +?> ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **contactFields** | [**\Messente\Api\Model\ContactFields**](../Model/ContactFields.md)| | @@ -129,18 +131,17 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: `application/json` -- **Accept**: `application/json` +- **Content-Type**: application/json +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -## `deleteContact()` -```php -deleteContact($phone) -``` +## deleteContact + +> deleteContact($phone) Deletes a contact @@ -170,10 +171,12 @@ try { } catch (Exception $e) { echo 'Exception when calling ContactsApi->deleteContact: ', $e->getMessage(), PHP_EOL; } +?> ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **phone** | **string**| A phone number | @@ -189,17 +192,16 @@ void (empty response body) ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: `application/json` +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -## `fetchContact()` -```php -fetchContact($phone): \Messente\Api\Model\ContactEnvelope -``` +## fetchContact + +> \Messente\Api\Model\ContactEnvelope fetchContact($phone) Lists a contact @@ -230,10 +232,12 @@ try { } catch (Exception $e) { echo 'Exception when calling ContactsApi->fetchContact: ', $e->getMessage(), PHP_EOL; } +?> ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **phone** | **string**| A phone number | @@ -249,17 +253,16 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: `application/json` +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -## `fetchContactGroups()` -```php -fetchContactGroups($phone): \Messente\Api\Model\GroupListEnvelope -``` +## fetchContactGroups + +> \Messente\Api\Model\GroupListEnvelope fetchContactGroups($phone) Lists groups of a contact @@ -290,10 +293,12 @@ try { } catch (Exception $e) { echo 'Exception when calling ContactsApi->fetchContactGroups: ', $e->getMessage(), PHP_EOL; } +?> ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **phone** | **string**| A phone number | @@ -309,17 +314,16 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: `application/json` +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -## `fetchContacts()` -```php -fetchContacts($groupIds): \Messente\Api\Model\ContactListEnvelope -``` +## fetchContacts + +> \Messente\Api\Model\ContactListEnvelope fetchContacts($groupIds) Returns all contacts @@ -350,10 +354,12 @@ try { } catch (Exception $e) { echo 'Exception when calling ContactsApi->fetchContacts: ', $e->getMessage(), PHP_EOL; } +?> ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **groupIds** | [**string[]**](../Model/string.md)| Optional one or many group id strings in UUID format. For example: \"/contacts?groupIds=group_id_one&groupIds=group_id_two\" | [optional] @@ -369,17 +375,16 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: `application/json` +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -## `removeContactFromGroup()` -```php -removeContactFromGroup($groupId, $phone) -``` +## removeContactFromGroup + +> removeContactFromGroup($groupId, $phone) Removes a contact from a group @@ -410,10 +415,12 @@ try { } catch (Exception $e) { echo 'Exception when calling ContactsApi->removeContactFromGroup: ', $e->getMessage(), PHP_EOL; } +?> ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **groupId** | **string**| String in UUID format | @@ -430,17 +437,16 @@ void (empty response body) ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: `application/json` +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -## `updateContact()` -```php -updateContact($phone, $contactUpdateFields): \Messente\Api\Model\ContactEnvelope -``` +## updateContact + +> \Messente\Api\Model\ContactEnvelope updateContact($phone, $contactUpdateFields) Updates a contact @@ -464,7 +470,7 @@ $apiInstance = new Messente\Api\Api\ContactsApi( $config ); $phone = +37251000000; // string | A phone number -$contactUpdateFields = {"email":"anyone@messente.com","firstName":"Any","lastName":"One","company":"Messente","title":"Sir","custom":"Any custom","custom2":"Any custom two","custom3":"Any custom three","custom4":"Any custom four"}; // \Messente\Api\Model\ContactUpdateFields +$contactUpdateFields = {"email":"anyone@messente.com","firstName":"Any","lastName":"One","company":"Messente","title":"Sir","custom":"Any custom","custom2":"Any custom two","custom3":"Any custom three","custom4":"Any custom four"}; // \Messente\Api\Model\ContactUpdateFields | try { $result = $apiInstance->updateContact($phone, $contactUpdateFields); @@ -472,10 +478,12 @@ try { } catch (Exception $e) { echo 'Exception when calling ContactsApi->updateContact: ', $e->getMessage(), PHP_EOL; } +?> ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **phone** | **string**| A phone number | @@ -491,9 +499,10 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: `application/json` -- **Accept**: `application/json` +- **Content-Type**: application/json +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/docs/Api/DeliveryReportApi.md b/docs/Api/DeliveryReportApi.md index ef62c6f..7c2d10e 100644 --- a/docs/Api/DeliveryReportApi.md +++ b/docs/Api/DeliveryReportApi.md @@ -1,17 +1,16 @@ # Messente\Api\DeliveryReportApi -All URIs are relative to https://api.messente.com/v1. +All URIs are relative to *https://api.messente.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**retrieveDeliveryReport()**](DeliveryReportApi.md#retrieveDeliveryReport) | **GET** /omnimessage/{omnimessageId}/status | Retrieves the delivery report for the Omnimessage +[**retrieveDeliveryReport**](DeliveryReportApi.md#retrieveDeliveryReport) | **GET** /omnimessage/{omnimessageId}/status | Retrieves the delivery report for the Omnimessage -## `retrieveDeliveryReport()` -```php -retrieveDeliveryReport($omnimessageId): \Messente\Api\Model\DeliveryReportResponse -``` +## retrieveDeliveryReport + +> \Messente\Api\Model\DeliveryReportResponse retrieveDeliveryReport($omnimessageId) Retrieves the delivery report for the Omnimessage @@ -42,10 +41,12 @@ try { } catch (Exception $e) { echo 'Exception when calling DeliveryReportApi->retrieveDeliveryReport: ', $e->getMessage(), PHP_EOL; } +?> ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **omnimessageId** | **string**| UUID of the omnimessage to for which the delivery report is to be retrieved | @@ -61,8 +62,9 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: `application/json` +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/docs/Api/GroupsApi.md b/docs/Api/GroupsApi.md index f511a0e..5e910c5 100644 --- a/docs/Api/GroupsApi.md +++ b/docs/Api/GroupsApi.md @@ -1,21 +1,20 @@ # Messente\Api\GroupsApi -All URIs are relative to https://api.messente.com/v1. +All URIs are relative to *https://api.messente.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**createGroup()**](GroupsApi.md#createGroup) | **POST** /phonebook/groups | Creates a new group with the provided name -[**deleteGroup()**](GroupsApi.md#deleteGroup) | **DELETE** /phonebook/groups/{groupId} | Deletes a group -[**fetchGroup()**](GroupsApi.md#fetchGroup) | **GET** /phonebook/groups/{groupId} | Lists a group -[**fetchGroups()**](GroupsApi.md#fetchGroups) | **GET** /phonebook/groups | Returns all groups -[**updateGroup()**](GroupsApi.md#updateGroup) | **PUT** /phonebook/groups/{groupId} | Updates a group with the provided name +[**createGroup**](GroupsApi.md#createGroup) | **POST** /phonebook/groups | Creates a new group with the provided name +[**deleteGroup**](GroupsApi.md#deleteGroup) | **DELETE** /phonebook/groups/{groupId} | Deletes a group +[**fetchGroup**](GroupsApi.md#fetchGroup) | **GET** /phonebook/groups/{groupId} | Lists a group +[**fetchGroups**](GroupsApi.md#fetchGroups) | **GET** /phonebook/groups | Returns all groups +[**updateGroup**](GroupsApi.md#updateGroup) | **PUT** /phonebook/groups/{groupId} | Updates a group with the provided name -## `createGroup()` -```php -createGroup($groupName): \Messente\Api\Model\GroupEnvelope -``` +## createGroup + +> \Messente\Api\Model\GroupEnvelope createGroup($groupName) Creates a new group with the provided name @@ -38,7 +37,7 @@ $apiInstance = new Messente\Api\Api\GroupsApi( new GuzzleHttp\Client(), $config ); -$groupName = {"name":"Any group name"}; // \Messente\Api\Model\GroupName +$groupName = {"name":"Any group name"}; // \Messente\Api\Model\GroupName | try { $result = $apiInstance->createGroup($groupName); @@ -46,10 +45,12 @@ try { } catch (Exception $e) { echo 'Exception when calling GroupsApi->createGroup: ', $e->getMessage(), PHP_EOL; } +?> ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **groupName** | [**\Messente\Api\Model\GroupName**](../Model/GroupName.md)| | @@ -64,18 +65,17 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: `application/json` -- **Accept**: `application/json` +- **Content-Type**: application/json +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -## `deleteGroup()` -```php -deleteGroup($groupId) -``` +## deleteGroup + +> deleteGroup($groupId) Deletes a group @@ -105,10 +105,12 @@ try { } catch (Exception $e) { echo 'Exception when calling GroupsApi->deleteGroup: ', $e->getMessage(), PHP_EOL; } +?> ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **groupId** | **string**| String in UUID format | @@ -124,17 +126,16 @@ void (empty response body) ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: `application/json` +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -## `fetchGroup()` -```php -fetchGroup($groupId): \Messente\Api\Model\GroupEnvelope -``` +## fetchGroup + +> \Messente\Api\Model\GroupEnvelope fetchGroup($groupId) Lists a group @@ -165,10 +166,12 @@ try { } catch (Exception $e) { echo 'Exception when calling GroupsApi->fetchGroup: ', $e->getMessage(), PHP_EOL; } +?> ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **groupId** | **string**| String in UUID format | @@ -184,17 +187,16 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: `application/json` +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -## `fetchGroups()` -```php -fetchGroups(): \Messente\Api\Model\GroupListEnvelope -``` +## fetchGroups + +> \Messente\Api\Model\GroupListEnvelope fetchGroups() Returns all groups @@ -224,6 +226,7 @@ try { } catch (Exception $e) { echo 'Exception when calling GroupsApi->fetchGroups: ', $e->getMessage(), PHP_EOL; } +?> ``` ### Parameters @@ -241,17 +244,16 @@ This endpoint does not need any parameter. ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: `application/json` +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -## `updateGroup()` -```php -updateGroup($groupId, $groupName): \Messente\Api\Model\GroupEnvelope -``` +## updateGroup + +> \Messente\Api\Model\GroupEnvelope updateGroup($groupId, $groupName) Updates a group with the provided name @@ -275,7 +277,7 @@ $apiInstance = new Messente\Api\Api\GroupsApi( $config ); $groupId = 5792a02a-e5c2-422b-a0a0-0ae65d814663; // string | String in UUID format -$groupName = {"name":"Any group name"}; // \Messente\Api\Model\GroupName +$groupName = {"name":"Any group name"}; // \Messente\Api\Model\GroupName | try { $result = $apiInstance->updateGroup($groupId, $groupName); @@ -283,10 +285,12 @@ try { } catch (Exception $e) { echo 'Exception when calling GroupsApi->updateGroup: ', $e->getMessage(), PHP_EOL; } +?> ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **groupId** | **string**| String in UUID format | @@ -302,9 +306,10 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: `application/json` -- **Accept**: `application/json` +- **Content-Type**: application/json +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/docs/Api/NumberLookupApi.md b/docs/Api/NumberLookupApi.md index c671dfe..4b3088d 100644 --- a/docs/Api/NumberLookupApi.md +++ b/docs/Api/NumberLookupApi.md @@ -1,17 +1,16 @@ # Messente\Api\NumberLookupApi -All URIs are relative to https://api.messente.com/v1. +All URIs are relative to *https://api.messente.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**fetchInfo()**](NumberLookupApi.md#fetchInfo) | **POST** /hlr/sync | Requests info about phone numbers +[**fetchInfo**](NumberLookupApi.md#fetchInfo) | **POST** /hlr/sync | Requests info about phone numbers -## `fetchInfo()` -```php -fetchInfo($numbersToInvestigate): \Messente\Api\Model\SyncNumberLookupSuccess -``` +## fetchInfo + +> \Messente\Api\Model\SyncNumberLookupSuccess fetchInfo($numbersToInvestigate) Requests info about phone numbers @@ -42,10 +41,12 @@ try { } catch (Exception $e) { echo 'Exception when calling NumberLookupApi->fetchInfo: ', $e->getMessage(), PHP_EOL; } +?> ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **numbersToInvestigate** | [**\Messente\Api\Model\NumbersToInvestigate**](../Model/NumbersToInvestigate.md)| Numbers for lookup | @@ -60,9 +61,10 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: `application/json` -- **Accept**: `application/json` +- **Content-Type**: application/json +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/docs/Api/OmnimessageApi.md b/docs/Api/OmnimessageApi.md index c07dc9b..95c84e9 100644 --- a/docs/Api/OmnimessageApi.md +++ b/docs/Api/OmnimessageApi.md @@ -1,18 +1,17 @@ # Messente\Api\OmnimessageApi -All URIs are relative to https://api.messente.com/v1. +All URIs are relative to *https://api.messente.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**cancelScheduledMessage()**](OmnimessageApi.md#cancelScheduledMessage) | **DELETE** /omnimessage/{omnimessageId} | Cancels a scheduled Omnimessage -[**sendOmnimessage()**](OmnimessageApi.md#sendOmnimessage) | **POST** /omnimessage | Sends an Omnimessage +[**cancelScheduledMessage**](OmnimessageApi.md#cancelScheduledMessage) | **DELETE** /omnimessage/{omnimessageId} | Cancels a scheduled Omnimessage +[**sendOmnimessage**](OmnimessageApi.md#sendOmnimessage) | **POST** /omnimessage | Sends an Omnimessage -## `cancelScheduledMessage()` -```php -cancelScheduledMessage($omnimessageId): object -``` +## cancelScheduledMessage + +> object cancelScheduledMessage($omnimessageId) Cancels a scheduled Omnimessage @@ -43,10 +42,12 @@ try { } catch (Exception $e) { echo 'Exception when calling OmnimessageApi->cancelScheduledMessage: ', $e->getMessage(), PHP_EOL; } +?> ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **omnimessageId** | **string**| UUID of the scheduled omnimessage to be cancelled | @@ -62,17 +63,16 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: `application/json` +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -## `sendOmnimessage()` -```php -sendOmnimessage($omnimessage): \Messente\Api\Model\OmniMessageCreateSuccessResponse -``` +## sendOmnimessage + +> \Messente\Api\Model\OmniMessageCreateSuccessResponse sendOmnimessage($omnimessage) Sends an Omnimessage @@ -103,10 +103,12 @@ try { } catch (Exception $e) { echo 'Exception when calling OmnimessageApi->sendOmnimessage: ', $e->getMessage(), PHP_EOL; } +?> ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **omnimessage** | [**\Messente\Api\Model\Omnimessage**](../Model/Omnimessage.md)| Omnimessage to be sent | @@ -121,9 +123,10 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: `application/json` -- **Accept**: `application/json` +- **Content-Type**: application/json +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/docs/Api/StatisticsApi.md b/docs/Api/StatisticsApi.md index 4cfe438..c6cd0a4 100644 --- a/docs/Api/StatisticsApi.md +++ b/docs/Api/StatisticsApi.md @@ -1,17 +1,16 @@ # Messente\Api\StatisticsApi -All URIs are relative to https://api.messente.com/v1. +All URIs are relative to *https://api.messente.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**createStatisticsReport()**](StatisticsApi.md#createStatisticsReport) | **POST** /statistics/reports | Requests statistics reports for each country +[**createStatisticsReport**](StatisticsApi.md#createStatisticsReport) | **POST** /statistics/reports | Requests statistics reports for each country -## `createStatisticsReport()` -```php -createStatisticsReport($statisticsReportSettings): \Messente\Api\Model\StatisticsReportSuccess -``` +## createStatisticsReport + +> \Messente\Api\Model\StatisticsReportSuccess createStatisticsReport($statisticsReportSettings) Requests statistics reports for each country @@ -42,10 +41,12 @@ try { } catch (Exception $e) { echo 'Exception when calling StatisticsApi->createStatisticsReport: ', $e->getMessage(), PHP_EOL; } +?> ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **statisticsReportSettings** | [**\Messente\Api\Model\StatisticsReportSettings**](../Model/StatisticsReportSettings.md)| Settings for statistics report | @@ -60,9 +61,10 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: `application/json` -- **Accept**: `application/json` +- **Content-Type**: application/json +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/docs/Model/Channel.md b/docs/Model/Channel.md index 866cd4a..7028070 100644 --- a/docs/Model/Channel.md +++ b/docs/Model/Channel.md @@ -5,4 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ContactEnvelope.md b/docs/Model/ContactEnvelope.md index c86b00d..65a43bc 100644 --- a/docs/Model/ContactEnvelope.md +++ b/docs/Model/ContactEnvelope.md @@ -4,6 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**contact** | [**\Messente\Api\Model\ContactResponseFields**](ContactResponseFields.md) | | [optional] +**contact** | [**\Messente\Api\Model\ContactResponseFields**](ContactResponseFields.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContactFields.md b/docs/Model/ContactFields.md index 5f5e1a3..70e6c2f 100644 --- a/docs/Model/ContactFields.md +++ b/docs/Model/ContactFields.md @@ -4,15 +4,17 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**phoneNumber** | **string** | Phone number in e.164 format | -**email** | **string** | The email of the contact | [optional] -**firstName** | **string** | The first name of the contact | [optional] -**lastName** | **string** | The last name of the contact | [optional] -**company** | **string** | The company of the contact | [optional] -**title** | **string** | The title of the contact | [optional] -**custom** | **string** | The first custom field | [optional] -**custom2** | **string** | The second custom field | [optional] -**custom3** | **string** | The third custom field | [optional] -**custom4** | **string** | The fourth custom field | [optional] +**phoneNumber** | **string** | Phone number in e.164 format | +**email** | **string** | The email of the contact | [optional] +**firstName** | **string** | The first name of the contact | [optional] +**lastName** | **string** | The last name of the contact | [optional] +**company** | **string** | The company of the contact | [optional] +**title** | **string** | The title of the contact | [optional] +**custom** | **string** | The first custom field | [optional] +**custom2** | **string** | The second custom field | [optional] +**custom3** | **string** | The third custom field | [optional] +**custom4** | **string** | The fourth custom field | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContactListEnvelope.md b/docs/Model/ContactListEnvelope.md index 0ad220a..ed0764f 100644 --- a/docs/Model/ContactListEnvelope.md +++ b/docs/Model/ContactListEnvelope.md @@ -4,6 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**contacts** | [**\Messente\Api\Model\ContactResponseFields[]**](ContactResponseFields.md) | An array of contacts | [optional] +**contacts** | [**\Messente\Api\Model\ContactResponseFields[]**](ContactResponseFields.md) | An array of contacts | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContactResponseFields.md b/docs/Model/ContactResponseFields.md index d9ed0a8..c0b42b2 100644 --- a/docs/Model/ContactResponseFields.md +++ b/docs/Model/ContactResponseFields.md @@ -4,16 +4,18 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**phoneNumber** | **string** | Phone number in e.164 format | [optional] -**email** | **string** | The email of the contact | [optional] -**firstName** | **string** | The first name of the contact | [optional] -**lastName** | **string** | The last name of the contact | [optional] -**company** | **string** | The company of the contact | [optional] -**title** | **string** | The title of the contact | [optional] -**custom** | **string** | The first custom field | [optional] -**custom2** | **string** | The second custom field | [optional] -**custom3** | **string** | The third custom field | [optional] -**custom4** | **string** | The fourth custom field | [optional] -**scheduledDeletionDate** | **\DateTime** | The date in ISO 8601 format, YYYY-MM-DD, on which the contact is going to be deleted because it has not belonged to a group for 30 days | [optional] +**phoneNumber** | **string** | Phone number in e.164 format | [optional] +**email** | **string** | The email of the contact | [optional] +**firstName** | **string** | The first name of the contact | [optional] +**lastName** | **string** | The last name of the contact | [optional] +**company** | **string** | The company of the contact | [optional] +**title** | **string** | The title of the contact | [optional] +**custom** | **string** | The first custom field | [optional] +**custom2** | **string** | The second custom field | [optional] +**custom3** | **string** | The third custom field | [optional] +**custom4** | **string** | The fourth custom field | [optional] +**scheduledDeletionDate** | [**\DateTime**](\DateTime.md) | The date in ISO 8601 format, YYYY-MM-DD, on which the contact is going to be deleted because it has not belonged to a group for 30 days | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContactUpdateFields.md b/docs/Model/ContactUpdateFields.md index 1110f27..2d004cc 100644 --- a/docs/Model/ContactUpdateFields.md +++ b/docs/Model/ContactUpdateFields.md @@ -4,14 +4,16 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**email** | **string** | The email of the contact | [optional] -**firstName** | **string** | The first name of the contact | [optional] -**lastName** | **string** | The last name of the contact | [optional] -**company** | **string** | The company of the contact | [optional] -**title** | **string** | The title of the contact | [optional] -**custom** | **string** | The first custom field | [optional] -**custom2** | **string** | The second custom field | [optional] -**custom3** | **string** | The third custom field | [optional] -**custom4** | **string** | The fourth custom field | [optional] +**email** | **string** | The email of the contact | [optional] +**firstName** | **string** | The first name of the contact | [optional] +**lastName** | **string** | The last name of the contact | [optional] +**company** | **string** | The company of the contact | [optional] +**title** | **string** | The title of the contact | [optional] +**custom** | **string** | The first custom field | [optional] +**custom2** | **string** | The second custom field | [optional] +**custom3** | **string** | The third custom field | [optional] +**custom4** | **string** | The fourth custom field | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeliveryReportResponse.md b/docs/Model/DeliveryReportResponse.md index 0dc0688..8d5a0cd 100644 --- a/docs/Model/DeliveryReportResponse.md +++ b/docs/Model/DeliveryReportResponse.md @@ -4,8 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**statuses** | [**\Messente\Api\Model\DeliveryResult[]**](DeliveryResult.md) | Contains the delivery reports for each channel, ordered by send order | -**to** | **string** | Phone number in e.164 format | -**omnimessageId** | **string** | Unique identifier for the omnimessage | +**statuses** | [**\Messente\Api\Model\DeliveryResult[]**](DeliveryResult.md) | Contains the delivery reports for each channel, ordered by send order | +**to** | **string** | Phone number in e.164 format | +**omnimessageId** | **string** | Unique identifier for the omnimessage | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeliveryResult.md b/docs/Model/DeliveryResult.md index 427c9f2..7274a16 100644 --- a/docs/Model/DeliveryResult.md +++ b/docs/Model/DeliveryResult.md @@ -4,11 +4,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**status** | [**\Messente\Api\Model\Status**](Status.md) | | [optional] -**channel** | [**\Messente\Api\Model\Channel**](Channel.md) | | [optional] -**messageId** | **string** | Unique identifier for the message | [optional] -**error** | **string** | Human-readable description of what went wrong, *null* in case of success or if the message has not been processed yet | [optional] -**err** | [**\Messente\Api\Model\ErrorCodeOmnichannelMachine**](ErrorCodeOmnichannelMachine.md) | | [optional] -**timestamp** | **\DateTime** | When this status was received by Omnichannel API | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) +**status** | [**\Messente\Api\Model\Status**](Status.md) | | [optional] +**channel** | [**\Messente\Api\Model\Channel**](Channel.md) | | [optional] +**messageId** | **string** | Unique identifier for the message | [optional] +**error** | **string** | Human-readable description of what went wrong, *null* in case of success or if the message has not been processed yet | [optional] +**err** | [**\Messente\Api\Model\ErrorCodeOmnichannelMachine**](ErrorCodeOmnichannelMachine.md) | | [optional] +**timestamp** | [**\DateTime**](\DateTime.md) | When this status was received by Omnichannel API | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ErrorCodeOmnichannel.md b/docs/Model/ErrorCodeOmnichannel.md index 667281b..a8d3477 100644 --- a/docs/Model/ErrorCodeOmnichannel.md +++ b/docs/Model/ErrorCodeOmnichannel.md @@ -5,4 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ErrorCodeOmnichannelMachine.md b/docs/Model/ErrorCodeOmnichannelMachine.md index da84b2d..9269270 100644 --- a/docs/Model/ErrorCodeOmnichannelMachine.md +++ b/docs/Model/ErrorCodeOmnichannelMachine.md @@ -5,4 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ErrorCodePhonebook.md b/docs/Model/ErrorCodePhonebook.md index d7fe431..0718169 100644 --- a/docs/Model/ErrorCodePhonebook.md +++ b/docs/Model/ErrorCodePhonebook.md @@ -5,4 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ErrorCodeStatistics.md b/docs/Model/ErrorCodeStatistics.md index 3ba4cf6..a362880 100644 --- a/docs/Model/ErrorCodeStatistics.md +++ b/docs/Model/ErrorCodeStatistics.md @@ -5,4 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ErrorItemNumberLookup.md b/docs/Model/ErrorItemNumberLookup.md index c923237..e47dbb7 100644 --- a/docs/Model/ErrorItemNumberLookup.md +++ b/docs/Model/ErrorItemNumberLookup.md @@ -4,6 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**error** | [**\Messente\Api\Model\ErrorItemNumberLookupError**](ErrorItemNumberLookupError.md) | | +**error** | [**\Messente\Api\Model\ErrorItemNumberLookupError**](ErrorItemNumberLookupError.md) | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorItemNumberLookupError.md b/docs/Model/ErrorItemNumberLookupError.md index dab852b..a05e7ab 100644 --- a/docs/Model/ErrorItemNumberLookupError.md +++ b/docs/Model/ErrorItemNumberLookupError.md @@ -4,7 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**description** | **string** | Error description | -**code** | **int** | Matches the following error title. This field is a constant * 101 - Unauthorized * 102 - Invalid arguments or parameters * 103 - Server error * 104 - Crediting error #1 * 105 - Crediting error #2 * 106 - Client error | +**description** | **string** | Error description | +**code** | **int** | Matches the following error title. This field is a constant * 101 - Unauthorized * 102 - Invalid arguments or parameters * 103 - Server error * 104 - Crediting error #1 * 105 - Crediting error #2 * 106 - Client error | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorItemOmnichannel.md b/docs/Model/ErrorItemOmnichannel.md index 64aec57..0cafabb 100644 --- a/docs/Model/ErrorItemOmnichannel.md +++ b/docs/Model/ErrorItemOmnichannel.md @@ -4,9 +4,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**title** | [**\Messente\Api\Model\ErrorTitleOmnichannel**](ErrorTitleOmnichannel.md) | | -**detail** | **string** | Free form more detailed description of the error | -**code** | [**\Messente\Api\Model\ErrorCodeOmnichannel**](ErrorCodeOmnichannel.md) | | -**source** | **string** | Describes which field is causing the issue in the payload, null for non 400 status code responses | +**title** | [**\Messente\Api\Model\ErrorTitleOmnichannel**](ErrorTitleOmnichannel.md) | | +**detail** | **string** | Free form more detailed description of the error | +**code** | [**\Messente\Api\Model\ErrorCodeOmnichannel**](ErrorCodeOmnichannel.md) | | +**source** | **string** | Describes which field is causing the issue in the payload, null for non 400 status code responses | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorItemPhonebook.md b/docs/Model/ErrorItemPhonebook.md index 8ca8880..73efe06 100644 --- a/docs/Model/ErrorItemPhonebook.md +++ b/docs/Model/ErrorItemPhonebook.md @@ -4,8 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**title** | [**\Messente\Api\Model\ErrorTitlePhonebook**](ErrorTitlePhonebook.md) | | -**detail** | **string** | Free form more detailed description of the error | -**code** | [**\Messente\Api\Model\ErrorCodePhonebook**](ErrorCodePhonebook.md) | | +**title** | [**\Messente\Api\Model\ErrorTitlePhonebook**](ErrorTitlePhonebook.md) | | +**detail** | **string** | Free form more detailed description of the error | +**code** | [**\Messente\Api\Model\ErrorCodePhonebook**](ErrorCodePhonebook.md) | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorItemStatistics.md b/docs/Model/ErrorItemStatistics.md index 62d0e8a..6a73f02 100644 --- a/docs/Model/ErrorItemStatistics.md +++ b/docs/Model/ErrorItemStatistics.md @@ -4,8 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**title** | **string** | Error title | -**details** | **string** | Error details | -**code** | [**\Messente\Api\Model\ErrorCodeStatistics**](ErrorCodeStatistics.md) | | +**title** | **string** | Error title | +**details** | **string** | Error details | +**code** | [**\Messente\Api\Model\ErrorCodeStatistics**](ErrorCodeStatistics.md) | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorNumberLookup.md b/docs/Model/ErrorNumberLookup.md index d8116b4..4e7f7a3 100644 --- a/docs/Model/ErrorNumberLookup.md +++ b/docs/Model/ErrorNumberLookup.md @@ -4,6 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**errors** | [**\Messente\Api\Model\ErrorItemNumberLookup[]**](ErrorItemNumberLookup.md) | An array of errors | +**errors** | [**\Messente\Api\Model\ErrorItemNumberLookup[]**](ErrorItemNumberLookup.md) | An array of errors | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorOmnichannel.md b/docs/Model/ErrorOmnichannel.md index fe59aea..9136d9a 100644 --- a/docs/Model/ErrorOmnichannel.md +++ b/docs/Model/ErrorOmnichannel.md @@ -4,6 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**errors** | [**\Messente\Api\Model\ErrorItemOmnichannel[]**](ErrorItemOmnichannel.md) | An array of errors | +**errors** | [**\Messente\Api\Model\ErrorItemOmnichannel[]**](ErrorItemOmnichannel.md) | An array of errors | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorPhonebook.md b/docs/Model/ErrorPhonebook.md index 0345c9e..49e33b6 100644 --- a/docs/Model/ErrorPhonebook.md +++ b/docs/Model/ErrorPhonebook.md @@ -4,6 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**errors** | [**\Messente\Api\Model\ErrorItemPhonebook[]**](ErrorItemPhonebook.md) | An array of errors | +**errors** | [**\Messente\Api\Model\ErrorItemPhonebook[]**](ErrorItemPhonebook.md) | An array of errors | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorStatistics.md b/docs/Model/ErrorStatistics.md index 3dba2a6..83cc5f9 100644 --- a/docs/Model/ErrorStatistics.md +++ b/docs/Model/ErrorStatistics.md @@ -4,6 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**errors** | [**\Messente\Api\Model\ErrorItemStatistics[]**](ErrorItemStatistics.md) | An array of errors | +**errors** | [**\Messente\Api\Model\ErrorItemStatistics[]**](ErrorItemStatistics.md) | An array of errors | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorTitleOmnichannel.md b/docs/Model/ErrorTitleOmnichannel.md index 25938a8..b17deca 100644 --- a/docs/Model/ErrorTitleOmnichannel.md +++ b/docs/Model/ErrorTitleOmnichannel.md @@ -5,4 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ErrorTitlePhonebook.md b/docs/Model/ErrorTitlePhonebook.md index 9f4f024..1efae0b 100644 --- a/docs/Model/ErrorTitlePhonebook.md +++ b/docs/Model/ErrorTitlePhonebook.md @@ -5,4 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/FetchBlacklistSuccess.md b/docs/Model/FetchBlacklistSuccess.md index 36a7fef..29d467f 100644 --- a/docs/Model/FetchBlacklistSuccess.md +++ b/docs/Model/FetchBlacklistSuccess.md @@ -4,6 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**phoneNumbers** | **string[]** | Array of unique phone numbers | [optional] +**phoneNumbers** | **string[]** | Array of unique phone numbers | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GroupEnvelope.md b/docs/Model/GroupEnvelope.md index ed34926..421db2c 100644 --- a/docs/Model/GroupEnvelope.md +++ b/docs/Model/GroupEnvelope.md @@ -4,6 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**group** | [**\Messente\Api\Model\GroupResponseFields**](GroupResponseFields.md) | | [optional] +**group** | [**\Messente\Api\Model\GroupResponseFields**](GroupResponseFields.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GroupListEnvelope.md b/docs/Model/GroupListEnvelope.md index 7244a7a..41a078f 100644 --- a/docs/Model/GroupListEnvelope.md +++ b/docs/Model/GroupListEnvelope.md @@ -4,6 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**groups** | [**\Messente\Api\Model\GroupResponseFields[]**](GroupResponseFields.md) | An array of groups | [optional] +**groups** | [**\Messente\Api\Model\GroupResponseFields[]**](GroupResponseFields.md) | An array of groups | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GroupName.md b/docs/Model/GroupName.md index d97a1f0..b4ababf 100644 --- a/docs/Model/GroupName.md +++ b/docs/Model/GroupName.md @@ -4,6 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | **string** | The name of the group | +**name** | **string** | The name of the group | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GroupResponseFields.md b/docs/Model/GroupResponseFields.md index c08e03e..8bcc09d 100644 --- a/docs/Model/GroupResponseFields.md +++ b/docs/Model/GroupResponseFields.md @@ -4,9 +4,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **string** | Id string in UUID format | -**name** | **string** | The name of the group | -**createdOn** | **string** | When the group was created | [optional] -**contactsCount** | **int** | The count of contacts in the group | +**id** | **string** | Id string in UUID format | +**name** | **string** | The name of the group | +**createdOn** | **string** | When the group was created | [optional] +**contactsCount** | **int** | The count of contacts in the group | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MessageResult.md b/docs/Model/MessageResult.md index b8a4036..291b60c 100644 --- a/docs/Model/MessageResult.md +++ b/docs/Model/MessageResult.md @@ -4,8 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**messageId** | **string** | Unique identifier for the message | -**channel** | [**\Messente\Api\Model\Channel**](Channel.md) | | -**sender** | **string** | Sender that was used for the message | +**messageId** | **string** | Unique identifier for the message | +**channel** | [**\Messente\Api\Model\Channel**](Channel.md) | | +**sender** | **string** | Sender that was used for the message | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MobileNetwork.md b/docs/Model/MobileNetwork.md index f0529f2..9f98e1c 100644 --- a/docs/Model/MobileNetwork.md +++ b/docs/Model/MobileNetwork.md @@ -4,10 +4,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**mccmnc** | **string** | Mobile country and mobile network code | [optional] -**networkName** | **string** | Mobile network name | [optional] -**countryName** | **string** | Country name | [optional] -**countryPrefix** | **string** | Country prefix | [optional] -**countryCode** | **string** | Country code | [optional] +**mccmnc** | **string** | Mobile country and mobile network code | [optional] +**networkName** | **string** | Mobile network name | [optional] +**countryName** | **string** | Country name | [optional] +**countryPrefix** | **string** | Country prefix | [optional] +**countryCode** | **string** | Country code | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NumberToBlacklist.md b/docs/Model/NumberToBlacklist.md index 6b1906a..15862b1 100644 --- a/docs/Model/NumberToBlacklist.md +++ b/docs/Model/NumberToBlacklist.md @@ -4,6 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**phoneNumber** | **string** | Phone number in e.164 format | +**phoneNumber** | **string** | Phone number in e.164 format | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NumbersToInvestigate.md b/docs/Model/NumbersToInvestigate.md index e1d6cca..2533c4f 100644 --- a/docs/Model/NumbersToInvestigate.md +++ b/docs/Model/NumbersToInvestigate.md @@ -4,6 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**numbers** | **string[]** | Array of phone numbers | +**numbers** | **string[]** | A list of phone numbers. Max 10 numbers per request | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OmniMessageCreateSuccessResponse.md b/docs/Model/OmniMessageCreateSuccessResponse.md index 6177048..1b3daa4 100644 --- a/docs/Model/OmniMessageCreateSuccessResponse.md +++ b/docs/Model/OmniMessageCreateSuccessResponse.md @@ -4,8 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**messages** | [**\Messente\Api\Model\MessageResult[]**](MessageResult.md) | List of messages that compose the omnimessage | -**to** | **string** | Phone number in e.164 format | -**omnimessageId** | **string** | Unique identifier for the omnimessage | +**messages** | [**\Messente\Api\Model\MessageResult[]**](MessageResult.md) | List of messages that compose the omnimessage | +**to** | **string** | Phone number in e.164 format | +**omnimessageId** | **string** | Unique identifier for the omnimessage | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Omnimessage.md b/docs/Model/Omnimessage.md index 9f218f0..f2e25fb 100644 --- a/docs/Model/Omnimessage.md +++ b/docs/Model/Omnimessage.md @@ -4,11 +4,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**to** | **string** | Phone number in e.164 format | -**messages** | [**OneOfViberSMSWhatsAppTelegram[]**](OneOfViberSMSWhatsAppTelegram.md) | An array of messages | -**dlrUrl** | **string** | URL where the delivery report will be sent | [optional] -**textStore** | [**\Messente\Api\Model\TextStore**](TextStore.md) | | [optional] -**timeToSend** | **\DateTime** | Optional parameter for sending messages at some specific time in the future. Time must be specified in the ISO-8601 format. If no timezone is specified, then the timezone is assumed to be UTC Examples: * Time specified with timezone: 2018-06-22T09:05:07+00:00 Time specified in UTC: 2018-06-22T09:05:07Z * Time specified without timezone: 2018-06-22T09:05 (equivalent to 2018-06-22T09:05+00:00) | [optional] -**priority** | [**\Messente\Api\Model\Priority**](Priority.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) +**to** | **string** | Phone number in e.164 format | +**messages** | [**OneOfViberSMSWhatsAppTelegram[]**](OneOfViberSMSWhatsAppTelegram.md) | An array of messages | +**dlrUrl** | **string** | URL where the delivery report will be sent | [optional] +**textStore** | [**\Messente\Api\Model\TextStore**](TextStore.md) | | [optional] +**timeToSend** | [**\DateTime**](\DateTime.md) | Optional parameter for sending messages at some specific time in the future. Time must be specified in the ISO-8601 format. If no timezone is specified, then the timezone is assumed to be UTC Examples: * Time specified with timezone: 2018-06-22T09:05:07+00:00 Time specified in UTC: 2018-06-22T09:05:07Z * Time specified without timezone: 2018-06-22T09:05 (equivalent to 2018-06-22T09:05+00:00) | [optional] +**priority** | [**\Messente\Api\Model\Priority**](Priority.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/Priority.md b/docs/Model/Priority.md index 552ead2..4a8cbe8 100644 --- a/docs/Model/Priority.md +++ b/docs/Model/Priority.md @@ -5,4 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/SMS.md b/docs/Model/SMS.md index f0d4c91..c25d31f 100644 --- a/docs/Model/SMS.md +++ b/docs/Model/SMS.md @@ -4,11 +4,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**text** | **string** | Text content of the SMS | -**sender** | **string** | Phone number or alphanumeric sender name | [optional] -**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted | [optional] -**autoconvert** | **string** | Defines how non-GSM characters will be treated: - \"on\" Use replacement settings from the account's [API Auto Replace settings page](https://dashboard.messente.com/api-settings/auto-replace) (default) - \"full\" All non GSM 03.38 characters will be replaced with suitable alternatives - \"off\" Message content is not modified in any way | [optional] -**udh** | **string** | hex-encoded string containing SMS UDH | [optional] +**text** | **string** | Text content of the SMS | +**sender** | **string** | Phone number or alphanumeric sender name | [optional] +**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted | [optional] +**autoconvert** | **string** | Defines how non-GSM characters will be treated: - \"on\" Use replacement settings from the account's [API Auto Replace settings page](https://dashboard.messente.com/api-settings/auto-replace) (default) - \"full\" All non GSM 03.38 characters will be replaced with suitable alternatives - \"off\" Message content is not modified in any way | [optional] +**udh** | **string** | hex-encoded string containing SMS UDH | [optional] **channel** | **string** | The channel used to deliver the message | [optional] [default to 'sms'] -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/StatisticsReport.md b/docs/Model/StatisticsReport.md index 283b6b7..b646314 100644 --- a/docs/Model/StatisticsReport.md +++ b/docs/Model/StatisticsReport.md @@ -4,8 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**totalMessages** | **int** | Sum of all messages | -**totalPrice** | **string** | Price for all messages | -**country** | **string** | Target country of all messages | +**totalMessages** | **int** | Sum of all messages | +**totalPrice** | **string** | Price for all messages | +**country** | **string** | Target country of all messages | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StatisticsReportSettings.md b/docs/Model/StatisticsReportSettings.md index dc51d8b..ad54c58 100644 --- a/docs/Model/StatisticsReportSettings.md +++ b/docs/Model/StatisticsReportSettings.md @@ -4,8 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**startDate** | **\DateTime** | Start date for the report | -**endDate** | **\DateTime** | End date for the report | -**messageTypes** | **string[]** | Optional list of message types (sms, viber, whatsapp, hlr, telegram) | [optional] +**startDate** | [**\DateTime**](\DateTime.md) | Start date for the report | +**endDate** | [**\DateTime**](\DateTime.md) | End date for the report | +**messageTypes** | **string[]** | Optional list of message types (sms, viber, whatsapp, hlr, telegram) | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StatisticsReportSuccess.md b/docs/Model/StatisticsReportSuccess.md index 0f78d80..cd98a66 100644 --- a/docs/Model/StatisticsReportSuccess.md +++ b/docs/Model/StatisticsReportSuccess.md @@ -4,6 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**reports** | [**\Messente\Api\Model\StatisticsReport[]**](StatisticsReport.md) | Array of report objects | +**reports** | [**\Messente\Api\Model\StatisticsReport[]**](StatisticsReport.md) | Array of report objects | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Status.md b/docs/Model/Status.md index c462142..fb7c6c7 100644 --- a/docs/Model/Status.md +++ b/docs/Model/Status.md @@ -5,4 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/SyncNumberLookupResult.md b/docs/Model/SyncNumberLookupResult.md index 38ba91f..3db52c2 100644 --- a/docs/Model/SyncNumberLookupResult.md +++ b/docs/Model/SyncNumberLookupResult.md @@ -4,14 +4,16 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**number** | **string** | Phone number in e.164 format | -**roaming** | **bool** | Indicates if a number is roaming | [optional] -**ported** | **bool** | Indicates if a number is ported | [optional] -**roamingNetwork** | [**\Messente\Api\Model\MobileNetwork**](MobileNetwork.md) | | [optional] -**currentNetwork** | [**\Messente\Api\Model\MobileNetwork**](MobileNetwork.md) | | [optional] -**originalNetwork** | [**\Messente\Api\Model\MobileNetwork**](MobileNetwork.md) | | [optional] -**portedNetwork** | [**\Messente\Api\Model\MobileNetwork**](MobileNetwork.md) | | [optional] -**status** | **string** | Status of the phone number | [optional] -**error** | **mixed** | Indicates if any error occurred while handling the request | [optional] +**number** | **string** | Phone number in e.164 format | +**roaming** | **bool** | Indicates if a number is roaming | [optional] +**ported** | **bool** | Indicates if a number is ported | [optional] +**roamingNetwork** | [**\Messente\Api\Model\MobileNetwork**](MobileNetwork.md) | | [optional] +**currentNetwork** | [**\Messente\Api\Model\MobileNetwork**](MobileNetwork.md) | | [optional] +**originalNetwork** | [**\Messente\Api\Model\MobileNetwork**](MobileNetwork.md) | | [optional] +**portedNetwork** | [**\Messente\Api\Model\MobileNetwork**](MobileNetwork.md) | | [optional] +**status** | **string** | Status of the phone number | [optional] +**error** | **object** | Indicates if any error occurred while handling the request | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SyncNumberLookupSuccess.md b/docs/Model/SyncNumberLookupSuccess.md index debed8f..9b8eae7 100644 --- a/docs/Model/SyncNumberLookupSuccess.md +++ b/docs/Model/SyncNumberLookupSuccess.md @@ -4,7 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**requestId** | **string** | ID of the request | -**result** | [**\Messente\Api\Model\SyncNumberLookupResult[]**](SyncNumberLookupResult.md) | A container for phone number info objects | +**requestId** | **string** | ID of the request | +**result** | [**\Messente\Api\Model\SyncNumberLookupResult[]**](SyncNumberLookupResult.md) | A container for phone number info objects | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Telegram.md b/docs/Model/Telegram.md index 1debeb9..ee778a0 100644 --- a/docs/Model/Telegram.md +++ b/docs/Model/Telegram.md @@ -4,12 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**sender** | **string** | Phone number or alphanumeric sender name | [optional] -**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted | [optional] -**text** | **string** | Plaintext content for Telegram | [optional] -**imageUrl** | **string** | URL for the embedded image. Mutually exclusive with \"document_url\" and \"audio_url\" | [optional] -**documentUrl** | **string** | URL for the embedded image. Mutually exclusive with \"audio_url\" and \"image_url\" | [optional] -**audioUrl** | **string** | URL for the embedded image. Mutually exclusive with \"document_url\" and \"image_url\" | [optional] +**sender** | **string** | Phone number or alphanumeric sender name | [optional] +**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted | [optional] +**text** | **string** | Plaintext content for Telegram | [optional] +**imageUrl** | **string** | URL for the embedded image. Mutually exclusive with \"document_url\" and \"audio_url\" | [optional] +**documentUrl** | **string** | URL for the embedded image. Mutually exclusive with \"audio_url\" and \"image_url\" | [optional] +**audioUrl** | **string** | URL for the embedded image. Mutually exclusive with \"document_url\" and \"image_url\" | [optional] **channel** | **string** | The channel used to deliver the message | [optional] [default to 'telegram'] -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/TextStore.md b/docs/Model/TextStore.md index 3b2f6f1..8fc3b29 100644 --- a/docs/Model/TextStore.md +++ b/docs/Model/TextStore.md @@ -5,4 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/Viber.md b/docs/Model/Viber.md index 688a035..2a353f2 100644 --- a/docs/Model/Viber.md +++ b/docs/Model/Viber.md @@ -4,12 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**sender** | **string** | Phone number or alphanumeric sender name | [optional] -**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted | [optional] -**text** | **string** | Plaintext content for Viber | [optional] -**imageUrl** | **string** | URL for the embedded image Valid combinations: 1) image_url, 2) text, image_url, button_url, button_text | [optional] -**buttonUrl** | **string** | URL of the button, must be specified along with ''text'', ''button_text'' and ''image_url'' (optional) | [optional] -**buttonText** | **string** | Must be specified along with ''text'', ''button_url'', ''button_text'', ''image_url'' (optional) | [optional] +**sender** | **string** | Phone number or alphanumeric sender name | [optional] +**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted | [optional] +**text** | **string** | Plaintext content for Viber | [optional] +**imageUrl** | **string** | URL for the embedded image Valid combinations: 1) image_url, 2) text, image_url, button_url, button_text | [optional] +**buttonUrl** | **string** | URL of the button, must be specified along with ''text'', ''button_text'' and ''image_url'' (optional) | [optional] +**buttonText** | **string** | Must be specified along with ''text'', ''button_url'', ''button_text'', ''image_url'' (optional) | [optional] **channel** | **string** | The channel used to deliver the message | [optional] [default to 'viber'] -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/WhatsApp.md b/docs/Model/WhatsApp.md index 6ce50dd..5b3dff7 100644 --- a/docs/Model/WhatsApp.md +++ b/docs/Model/WhatsApp.md @@ -4,12 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**sender** | **string** | Phone number or alphanumeric sender name | [optional] -**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted | [optional] -**text** | [**\Messente\Api\Model\WhatsAppText**](WhatsAppText.md) | | [optional] -**image** | [**\Messente\Api\Model\WhatsAppImage**](WhatsAppImage.md) | | [optional] -**document** | [**\Messente\Api\Model\WhatsAppDocument**](WhatsAppDocument.md) | | [optional] -**audio** | [**\Messente\Api\Model\WhatsAppAudio**](WhatsAppAudio.md) | | [optional] +**sender** | **string** | Phone number or alphanumeric sender name | [optional] +**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted | [optional] +**text** | [**\Messente\Api\Model\WhatsAppText**](WhatsAppText.md) | | [optional] +**image** | [**\Messente\Api\Model\WhatsAppImage**](WhatsAppImage.md) | | [optional] +**document** | [**\Messente\Api\Model\WhatsAppDocument**](WhatsAppDocument.md) | | [optional] +**audio** | [**\Messente\Api\Model\WhatsAppAudio**](WhatsAppAudio.md) | | [optional] **channel** | **string** | The channel used to deliver the message | [optional] [default to 'whatsapp'] -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/WhatsAppAudio.md b/docs/Model/WhatsAppAudio.md index ff0e201..9be0439 100644 --- a/docs/Model/WhatsAppAudio.md +++ b/docs/Model/WhatsAppAudio.md @@ -4,6 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**content** | **string** | Base64-encoded audio | +**content** | **string** | Base64-encoded audio | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WhatsAppDocument.md b/docs/Model/WhatsAppDocument.md index 1183cd3..5d5dc71 100644 --- a/docs/Model/WhatsAppDocument.md +++ b/docs/Model/WhatsAppDocument.md @@ -4,7 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**caption** | **string** | Description for the document | [optional] -**content** | **string** | Base64-encoded image | +**caption** | **string** | Description for the document | [optional] +**content** | **string** | Base64-encoded image | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WhatsAppImage.md b/docs/Model/WhatsAppImage.md index fff678f..2c578d1 100644 --- a/docs/Model/WhatsAppImage.md +++ b/docs/Model/WhatsAppImage.md @@ -4,7 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**caption** | **string** | Description for the image | [optional] -**content** | **string** | Base64-encoded image | +**caption** | **string** | Description for the image | [optional] +**content** | **string** | Base64-encoded image | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WhatsAppText.md b/docs/Model/WhatsAppText.md index 5a801c0..0c1fad1 100644 --- a/docs/Model/WhatsAppText.md +++ b/docs/Model/WhatsAppText.md @@ -5,6 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **previewUrl** | **bool** | Whether to display link preview if the message contains a hyperlink | [optional] [default to true] -**body** | **string** | Plaintext content for WhatsApp, can contain URLs, emojis and formatting | +**body** | **string** | Plaintext content for WhatsApp, can contain URLs, emojis and formatting | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/git_push.sh b/git_push.sh index 14bad7f..7a23503 100644 --- a/git_push.sh +++ b/git_push.sh @@ -1,17 +1,11 @@ #!/bin/sh # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ # -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" git_user_id=$1 git_repo_id=$2 release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi if [ "$git_user_id" = "" ]; then git_user_id="messente" @@ -38,14 +32,14 @@ git add . git commit -m "$release_note" # Sets the new remote -git_remote=$(git remote) +git_remote=`git remote` if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git fi fi @@ -53,5 +47,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' + diff --git a/lib/Api/BlacklistApi.php b/lib/Api/BlacklistApi.php index dfa0ecd..70ec8b6 100644 --- a/lib/Api/BlacklistApi.php +++ b/lib/Api/BlacklistApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $hostIndex; + $this->hostIndex = $host_index; } /** * Set the host index * - * @param int $hostIndex Host index (required) + * @param int Host index (required) */ - public function setHostIndex($hostIndex): void + public function setHostIndex($host_index) { - $this->hostIndex = $hostIndex; + $this->hostIndex = $host_index; } /** * Get the host index * - * @return int Host index + * @return Host index */ public function getHostIndex() { @@ -154,16 +153,9 @@ public function addToBlacklistWithHttpInfo($numberToBlacklist) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -174,11 +166,11 @@ public function addToBlacklistWithHttpInfo($numberToBlacklist) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + $request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } @@ -275,7 +267,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } ); @@ -289,7 +281,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function addToBlacklistRequest($numberToBlacklist) + protected function addToBlacklistRequest($numberToBlacklist) { // verify the required parameter 'numberToBlacklist' is set if ($numberToBlacklist === null || (is_array($numberToBlacklist) && count($numberToBlacklist) === 0)) { @@ -307,7 +299,11 @@ public function addToBlacklistRequest($numberToBlacklist) - + // body params + $_tempBody = null; + if (isset($numberToBlacklist)) { + $_tempBody = $numberToBlacklist; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -321,23 +317,21 @@ public function addToBlacklistRequest($numberToBlacklist) } // for model (json/xml) - if (isset($numberToBlacklist)) { + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($numberToBlacklist)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { - $httpBody = $numberToBlacklist; + $httpBody = $_tempBody; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -347,7 +341,7 @@ public function addToBlacklistRequest($numberToBlacklist) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -367,7 +361,7 @@ public function addToBlacklistRequest($numberToBlacklist) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -414,16 +408,9 @@ public function deleteFromBlacklistWithHttpInfo($phone) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -434,11 +421,11 @@ public function deleteFromBlacklistWithHttpInfo($phone) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + $request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } @@ -535,7 +522,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } ); @@ -549,7 +536,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteFromBlacklistRequest($phone) + protected function deleteFromBlacklistRequest($phone) { // verify the required parameter 'phone' is set if ($phone === null || (is_array($phone) && count($phone) === 0)) { @@ -566,7 +553,6 @@ public function deleteFromBlacklistRequest($phone) $multipart = false; - // path params if ($phone !== null) { $resourcePath = str_replace( @@ -576,6 +562,8 @@ public function deleteFromBlacklistRequest($phone) ); } + // body params + $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -589,17 +577,21 @@ public function deleteFromBlacklistRequest($phone) } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -609,7 +601,7 @@ public function deleteFromBlacklistRequest($phone) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -629,7 +621,7 @@ public function deleteFromBlacklistRequest($phone) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -675,16 +667,9 @@ public function fetchBlacklistWithHttpInfo() } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -695,20 +680,21 @@ public function fetchBlacklistWithHttpInfo() sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + $request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } + $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Messente\Api\Model\FetchBlacklistSuccess' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -718,9 +704,9 @@ public function fetchBlacklistWithHttpInfo() ]; case 401: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -730,9 +716,9 @@ public function fetchBlacklistWithHttpInfo() ]; default: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -743,10 +729,11 @@ public function fetchBlacklistWithHttpInfo() } $returnType = '\Messente\Api\Model\FetchBlacklistSuccess'; + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -823,10 +810,11 @@ public function fetchBlacklistAsyncWithHttpInfo() ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -846,7 +834,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } ); @@ -859,7 +847,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchBlacklistRequest() + protected function fetchBlacklistRequest() { $resourcePath = '/phonebook/blacklist'; @@ -871,7 +859,8 @@ public function fetchBlacklistRequest() - + // body params + $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -885,17 +874,21 @@ public function fetchBlacklistRequest() } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -905,7 +898,7 @@ public function fetchBlacklistRequest() } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -925,7 +918,7 @@ public function fetchBlacklistRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -972,16 +965,9 @@ public function isBlacklistedWithHttpInfo($phone) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -992,11 +978,11 @@ public function isBlacklistedWithHttpInfo($phone) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + $request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } @@ -1085,7 +1071,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } ); @@ -1099,7 +1085,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function isBlacklistedRequest($phone) + protected function isBlacklistedRequest($phone) { // verify the required parameter 'phone' is set if ($phone === null || (is_array($phone) && count($phone) === 0)) { @@ -1116,7 +1102,6 @@ public function isBlacklistedRequest($phone) $multipart = false; - // path params if ($phone !== null) { $resourcePath = str_replace( @@ -1126,6 +1111,8 @@ public function isBlacklistedRequest($phone) ); } + // body params + $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1139,17 +1126,21 @@ public function isBlacklistedRequest($phone) } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1159,7 +1150,7 @@ public function isBlacklistedRequest($phone) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -1179,7 +1170,7 @@ public function isBlacklistedRequest($phone) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/lib/Api/ContactsApi.php b/lib/Api/ContactsApi.php index 73fc90b..5c8f73c 100644 --- a/lib/Api/ContactsApi.php +++ b/lib/Api/ContactsApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $hostIndex; + $this->hostIndex = $host_index; } /** * Set the host index * - * @param int $hostIndex Host index (required) + * @param int Host index (required) */ - public function setHostIndex($hostIndex): void + public function setHostIndex($host_index) { - $this->hostIndex = $hostIndex; + $this->hostIndex = $host_index; } /** * Get the host index * - * @return int Host index + * @return Host index */ public function getHostIndex() { @@ -157,16 +156,9 @@ public function addContactToGroupWithHttpInfo($groupId, $phone) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -177,20 +169,21 @@ public function addContactToGroupWithHttpInfo($groupId, $phone) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + $request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } + $responseBody = $response->getBody(); switch($statusCode) { case 201: if ('object' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -200,9 +193,9 @@ public function addContactToGroupWithHttpInfo($groupId, $phone) ]; case 400: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -212,9 +205,9 @@ public function addContactToGroupWithHttpInfo($groupId, $phone) ]; case 401: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -224,9 +217,9 @@ public function addContactToGroupWithHttpInfo($groupId, $phone) ]; case 404: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -236,9 +229,9 @@ public function addContactToGroupWithHttpInfo($groupId, $phone) ]; case 409: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -248,9 +241,9 @@ public function addContactToGroupWithHttpInfo($groupId, $phone) ]; default: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -261,10 +254,11 @@ public function addContactToGroupWithHttpInfo($groupId, $phone) } $returnType = 'object'; + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -369,10 +363,11 @@ public function addContactToGroupAsyncWithHttpInfo($groupId, $phone) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -392,7 +387,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } ); @@ -407,7 +402,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function addContactToGroupRequest($groupId, $phone) + protected function addContactToGroupRequest($groupId, $phone) { // verify the required parameter 'groupId' is set if ($groupId === null || (is_array($groupId) && count($groupId) === 0)) { @@ -430,7 +425,6 @@ public function addContactToGroupRequest($groupId, $phone) $multipart = false; - // path params if ($groupId !== null) { $resourcePath = str_replace( @@ -448,6 +442,8 @@ public function addContactToGroupRequest($groupId, $phone) ); } + // body params + $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -461,17 +457,21 @@ public function addContactToGroupRequest($groupId, $phone) } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -481,7 +481,7 @@ public function addContactToGroupRequest($groupId, $phone) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -501,7 +501,7 @@ public function addContactToGroupRequest($groupId, $phone) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -549,16 +549,9 @@ public function createContactWithHttpInfo($contactFields) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -569,20 +562,21 @@ public function createContactWithHttpInfo($contactFields) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + $request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } + $responseBody = $response->getBody(); switch($statusCode) { case 201: if ('\Messente\Api\Model\ContactEnvelope' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -592,9 +586,9 @@ public function createContactWithHttpInfo($contactFields) ]; case 400: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -604,9 +598,9 @@ public function createContactWithHttpInfo($contactFields) ]; case 401: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -616,9 +610,9 @@ public function createContactWithHttpInfo($contactFields) ]; case 409: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -628,9 +622,9 @@ public function createContactWithHttpInfo($contactFields) ]; default: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -641,10 +635,11 @@ public function createContactWithHttpInfo($contactFields) } $returnType = '\Messente\Api\Model\ContactEnvelope'; + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -739,10 +734,11 @@ public function createContactAsyncWithHttpInfo($contactFields) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -762,7 +758,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } ); @@ -776,7 +772,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createContactRequest($contactFields) + protected function createContactRequest($contactFields) { // verify the required parameter 'contactFields' is set if ($contactFields === null || (is_array($contactFields) && count($contactFields) === 0)) { @@ -794,7 +790,11 @@ public function createContactRequest($contactFields) - + // body params + $_tempBody = null; + if (isset($contactFields)) { + $_tempBody = $contactFields; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -808,23 +808,21 @@ public function createContactRequest($contactFields) } // for model (json/xml) - if (isset($contactFields)) { + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($contactFields)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { - $httpBody = $contactFields; + $httpBody = $_tempBody; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -834,7 +832,7 @@ public function createContactRequest($contactFields) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -854,7 +852,7 @@ public function createContactRequest($contactFields) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -901,16 +899,9 @@ public function deleteContactWithHttpInfo($phone) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -921,11 +912,11 @@ public function deleteContactWithHttpInfo($phone) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + $request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } @@ -1022,7 +1013,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } ); @@ -1036,7 +1027,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteContactRequest($phone) + protected function deleteContactRequest($phone) { // verify the required parameter 'phone' is set if ($phone === null || (is_array($phone) && count($phone) === 0)) { @@ -1053,7 +1044,6 @@ public function deleteContactRequest($phone) $multipart = false; - // path params if ($phone !== null) { $resourcePath = str_replace( @@ -1063,6 +1053,8 @@ public function deleteContactRequest($phone) ); } + // body params + $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1076,17 +1068,21 @@ public function deleteContactRequest($phone) } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1096,7 +1092,7 @@ public function deleteContactRequest($phone) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -1116,7 +1112,7 @@ public function deleteContactRequest($phone) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -1164,16 +1160,9 @@ public function fetchContactWithHttpInfo($phone) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -1184,20 +1173,21 @@ public function fetchContactWithHttpInfo($phone) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + $request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } + $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Messente\Api\Model\ContactEnvelope' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1207,9 +1197,9 @@ public function fetchContactWithHttpInfo($phone) ]; case 400: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1219,9 +1209,9 @@ public function fetchContactWithHttpInfo($phone) ]; case 401: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1231,9 +1221,9 @@ public function fetchContactWithHttpInfo($phone) ]; case 404: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1244,10 +1234,11 @@ public function fetchContactWithHttpInfo($phone) } $returnType = '\Messente\Api\Model\ContactEnvelope'; + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1334,10 +1325,11 @@ public function fetchContactAsyncWithHttpInfo($phone) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1357,7 +1349,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } ); @@ -1371,7 +1363,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchContactRequest($phone) + protected function fetchContactRequest($phone) { // verify the required parameter 'phone' is set if ($phone === null || (is_array($phone) && count($phone) === 0)) { @@ -1388,7 +1380,6 @@ public function fetchContactRequest($phone) $multipart = false; - // path params if ($phone !== null) { $resourcePath = str_replace( @@ -1398,6 +1389,8 @@ public function fetchContactRequest($phone) ); } + // body params + $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1411,17 +1404,21 @@ public function fetchContactRequest($phone) } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1431,7 +1428,7 @@ public function fetchContactRequest($phone) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -1451,7 +1448,7 @@ public function fetchContactRequest($phone) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -1499,16 +1496,9 @@ public function fetchContactGroupsWithHttpInfo($phone) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -1519,20 +1509,21 @@ public function fetchContactGroupsWithHttpInfo($phone) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + $request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } + $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Messente\Api\Model\GroupListEnvelope' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1542,9 +1533,9 @@ public function fetchContactGroupsWithHttpInfo($phone) ]; case 400: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1554,9 +1545,9 @@ public function fetchContactGroupsWithHttpInfo($phone) ]; case 401: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1566,9 +1557,9 @@ public function fetchContactGroupsWithHttpInfo($phone) ]; case 404: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1579,10 +1570,11 @@ public function fetchContactGroupsWithHttpInfo($phone) } $returnType = '\Messente\Api\Model\GroupListEnvelope'; + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1669,10 +1661,11 @@ public function fetchContactGroupsAsyncWithHttpInfo($phone) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1692,7 +1685,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } ); @@ -1706,7 +1699,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchContactGroupsRequest($phone) + protected function fetchContactGroupsRequest($phone) { // verify the required parameter 'phone' is set if ($phone === null || (is_array($phone) && count($phone) === 0)) { @@ -1723,7 +1716,6 @@ public function fetchContactGroupsRequest($phone) $multipart = false; - // path params if ($phone !== null) { $resourcePath = str_replace( @@ -1733,6 +1725,8 @@ public function fetchContactGroupsRequest($phone) ); } + // body params + $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1746,17 +1740,21 @@ public function fetchContactGroupsRequest($phone) } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1766,7 +1764,7 @@ public function fetchContactGroupsRequest($phone) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -1786,7 +1784,7 @@ public function fetchContactGroupsRequest($phone) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -1834,16 +1832,9 @@ public function fetchContactsWithHttpInfo($groupIds = null) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -1854,20 +1845,21 @@ public function fetchContactsWithHttpInfo($groupIds = null) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + $request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } + $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Messente\Api\Model\ContactListEnvelope' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1877,9 +1869,9 @@ public function fetchContactsWithHttpInfo($groupIds = null) ]; case 400: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1889,9 +1881,9 @@ public function fetchContactsWithHttpInfo($groupIds = null) ]; case 401: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1901,9 +1893,9 @@ public function fetchContactsWithHttpInfo($groupIds = null) ]; default: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1914,10 +1906,11 @@ public function fetchContactsWithHttpInfo($groupIds = null) } $returnType = '\Messente\Api\Model\ContactListEnvelope'; + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -2004,10 +1997,11 @@ public function fetchContactsAsyncWithHttpInfo($groupIds = null) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -2027,7 +2021,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } ); @@ -2041,7 +2035,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchContactsRequest($groupIds = null) + protected function fetchContactsRequest($groupIds = null) { $resourcePath = '/phonebook/contacts'; @@ -2052,19 +2046,16 @@ public function fetchContactsRequest($groupIds = null) $multipart = false; // query params + if (is_array($groupIds)) { + $groupIds = ObjectSerializer::serializeCollection($groupIds, 'multi', true); + } if ($groupIds !== null) { - if('form' === 'form' && is_array($groupIds)) { - foreach($groupIds as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['groupIds'] = $groupIds; - } + $queryParams['groupIds'] = ObjectSerializer::toQueryValue($groupIds); } - + // body params + $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -2078,17 +2069,21 @@ public function fetchContactsRequest($groupIds = null) } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -2098,7 +2093,7 @@ public function fetchContactsRequest($groupIds = null) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -2118,7 +2113,7 @@ public function fetchContactsRequest($groupIds = null) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -2167,16 +2162,9 @@ public function removeContactFromGroupWithHttpInfo($groupId, $phone) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -2187,11 +2175,11 @@ public function removeContactFromGroupWithHttpInfo($groupId, $phone) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + $request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } @@ -2290,7 +2278,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } ); @@ -2305,7 +2293,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function removeContactFromGroupRequest($groupId, $phone) + protected function removeContactFromGroupRequest($groupId, $phone) { // verify the required parameter 'groupId' is set if ($groupId === null || (is_array($groupId) && count($groupId) === 0)) { @@ -2328,7 +2316,6 @@ public function removeContactFromGroupRequest($groupId, $phone) $multipart = false; - // path params if ($groupId !== null) { $resourcePath = str_replace( @@ -2346,6 +2333,8 @@ public function removeContactFromGroupRequest($groupId, $phone) ); } + // body params + $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -2359,17 +2348,21 @@ public function removeContactFromGroupRequest($groupId, $phone) } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -2379,7 +2372,7 @@ public function removeContactFromGroupRequest($groupId, $phone) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -2399,7 +2392,7 @@ public function removeContactFromGroupRequest($groupId, $phone) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -2449,16 +2442,9 @@ public function updateContactWithHttpInfo($phone, $contactUpdateFields) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -2469,20 +2455,21 @@ public function updateContactWithHttpInfo($phone, $contactUpdateFields) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + $request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } + $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Messente\Api\Model\ContactEnvelope' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -2492,9 +2479,9 @@ public function updateContactWithHttpInfo($phone, $contactUpdateFields) ]; case 400: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -2504,9 +2491,9 @@ public function updateContactWithHttpInfo($phone, $contactUpdateFields) ]; case 401: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -2516,9 +2503,9 @@ public function updateContactWithHttpInfo($phone, $contactUpdateFields) ]; case 404: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -2528,9 +2515,9 @@ public function updateContactWithHttpInfo($phone, $contactUpdateFields) ]; default: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -2541,10 +2528,11 @@ public function updateContactWithHttpInfo($phone, $contactUpdateFields) } $returnType = '\Messente\Api\Model\ContactEnvelope'; + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -2641,10 +2629,11 @@ public function updateContactAsyncWithHttpInfo($phone, $contactUpdateFields) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -2664,7 +2653,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } ); @@ -2679,7 +2668,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateContactRequest($phone, $contactUpdateFields) + protected function updateContactRequest($phone, $contactUpdateFields) { // verify the required parameter 'phone' is set if ($phone === null || (is_array($phone) && count($phone) === 0)) { @@ -2702,7 +2691,6 @@ public function updateContactRequest($phone, $contactUpdateFields) $multipart = false; - // path params if ($phone !== null) { $resourcePath = str_replace( @@ -2712,6 +2700,11 @@ public function updateContactRequest($phone, $contactUpdateFields) ); } + // body params + $_tempBody = null; + if (isset($contactUpdateFields)) { + $_tempBody = $contactUpdateFields; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -2725,23 +2718,21 @@ public function updateContactRequest($phone, $contactUpdateFields) } // for model (json/xml) - if (isset($contactUpdateFields)) { + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($contactUpdateFields)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { - $httpBody = $contactUpdateFields; + $httpBody = $_tempBody; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -2751,7 +2742,7 @@ public function updateContactRequest($phone, $contactUpdateFields) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -2771,7 +2762,7 @@ public function updateContactRequest($phone, $contactUpdateFields) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'PATCH', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/lib/Api/DeliveryReportApi.php b/lib/Api/DeliveryReportApi.php index 02d348b..4b9c9de 100644 --- a/lib/Api/DeliveryReportApi.php +++ b/lib/Api/DeliveryReportApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $hostIndex; + $this->hostIndex = $host_index; } /** * Set the host index * - * @param int $hostIndex Host index (required) + * @param int Host index (required) */ - public function setHostIndex($hostIndex): void + public function setHostIndex($host_index) { - $this->hostIndex = $hostIndex; + $this->hostIndex = $host_index; } /** * Get the host index * - * @return int Host index + * @return Host index */ public function getHostIndex() { @@ -155,16 +154,9 @@ public function retrieveDeliveryReportWithHttpInfo($omnimessageId) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -175,20 +167,21 @@ public function retrieveDeliveryReportWithHttpInfo($omnimessageId) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + $request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } + $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Messente\Api\Model\DeliveryReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -198,9 +191,9 @@ public function retrieveDeliveryReportWithHttpInfo($omnimessageId) ]; case 404: if ('\Messente\Api\Model\ErrorOmnichannel' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -211,10 +204,11 @@ public function retrieveDeliveryReportWithHttpInfo($omnimessageId) } $returnType = '\Messente\Api\Model\DeliveryReportResponse'; + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -285,10 +279,11 @@ public function retrieveDeliveryReportAsyncWithHttpInfo($omnimessageId) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -308,7 +303,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } ); @@ -322,7 +317,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function retrieveDeliveryReportRequest($omnimessageId) + protected function retrieveDeliveryReportRequest($omnimessageId) { // verify the required parameter 'omnimessageId' is set if ($omnimessageId === null || (is_array($omnimessageId) && count($omnimessageId) === 0)) { @@ -339,7 +334,6 @@ public function retrieveDeliveryReportRequest($omnimessageId) $multipart = false; - // path params if ($omnimessageId !== null) { $resourcePath = str_replace( @@ -349,6 +343,8 @@ public function retrieveDeliveryReportRequest($omnimessageId) ); } + // body params + $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -362,17 +358,21 @@ public function retrieveDeliveryReportRequest($omnimessageId) } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -382,7 +382,7 @@ public function retrieveDeliveryReportRequest($omnimessageId) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -402,7 +402,7 @@ public function retrieveDeliveryReportRequest($omnimessageId) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/lib/Api/GroupsApi.php b/lib/Api/GroupsApi.php index 8bfaca6..7188bbb 100644 --- a/lib/Api/GroupsApi.php +++ b/lib/Api/GroupsApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $hostIndex; + $this->hostIndex = $host_index; } /** * Set the host index * - * @param int $hostIndex Host index (required) + * @param int Host index (required) */ - public function setHostIndex($hostIndex): void + public function setHostIndex($host_index) { - $this->hostIndex = $hostIndex; + $this->hostIndex = $host_index; } /** * Get the host index * - * @return int Host index + * @return Host index */ public function getHostIndex() { @@ -155,16 +154,9 @@ public function createGroupWithHttpInfo($groupName) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -175,20 +167,21 @@ public function createGroupWithHttpInfo($groupName) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + $request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } + $responseBody = $response->getBody(); switch($statusCode) { case 201: if ('\Messente\Api\Model\GroupEnvelope' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -198,9 +191,9 @@ public function createGroupWithHttpInfo($groupName) ]; case 400: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -210,9 +203,9 @@ public function createGroupWithHttpInfo($groupName) ]; case 401: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -222,9 +215,9 @@ public function createGroupWithHttpInfo($groupName) ]; default: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -235,10 +228,11 @@ public function createGroupWithHttpInfo($groupName) } $returnType = '\Messente\Api\Model\GroupEnvelope'; + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -325,10 +319,11 @@ public function createGroupAsyncWithHttpInfo($groupName) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -348,7 +343,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } ); @@ -362,7 +357,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createGroupRequest($groupName) + protected function createGroupRequest($groupName) { // verify the required parameter 'groupName' is set if ($groupName === null || (is_array($groupName) && count($groupName) === 0)) { @@ -380,7 +375,11 @@ public function createGroupRequest($groupName) - + // body params + $_tempBody = null; + if (isset($groupName)) { + $_tempBody = $groupName; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -394,23 +393,21 @@ public function createGroupRequest($groupName) } // for model (json/xml) - if (isset($groupName)) { + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($groupName)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { - $httpBody = $groupName; + $httpBody = $_tempBody; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -420,7 +417,7 @@ public function createGroupRequest($groupName) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -440,7 +437,7 @@ public function createGroupRequest($groupName) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -487,16 +484,9 @@ public function deleteGroupWithHttpInfo($groupId) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -507,11 +497,11 @@ public function deleteGroupWithHttpInfo($groupId) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + $request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } @@ -600,7 +590,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } ); @@ -614,7 +604,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteGroupRequest($groupId) + protected function deleteGroupRequest($groupId) { // verify the required parameter 'groupId' is set if ($groupId === null || (is_array($groupId) && count($groupId) === 0)) { @@ -631,7 +621,6 @@ public function deleteGroupRequest($groupId) $multipart = false; - // path params if ($groupId !== null) { $resourcePath = str_replace( @@ -641,6 +630,8 @@ public function deleteGroupRequest($groupId) ); } + // body params + $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -654,17 +645,21 @@ public function deleteGroupRequest($groupId) } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -674,7 +669,7 @@ public function deleteGroupRequest($groupId) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -694,7 +689,7 @@ public function deleteGroupRequest($groupId) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -742,16 +737,9 @@ public function fetchGroupWithHttpInfo($groupId) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -762,20 +750,21 @@ public function fetchGroupWithHttpInfo($groupId) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + $request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } + $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Messente\Api\Model\GroupEnvelope' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -785,9 +774,9 @@ public function fetchGroupWithHttpInfo($groupId) ]; case 401: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -797,9 +786,9 @@ public function fetchGroupWithHttpInfo($groupId) ]; case 404: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -810,10 +799,11 @@ public function fetchGroupWithHttpInfo($groupId) } $returnType = '\Messente\Api\Model\GroupEnvelope'; + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -892,10 +882,11 @@ public function fetchGroupAsyncWithHttpInfo($groupId) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -915,7 +906,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } ); @@ -929,7 +920,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchGroupRequest($groupId) + protected function fetchGroupRequest($groupId) { // verify the required parameter 'groupId' is set if ($groupId === null || (is_array($groupId) && count($groupId) === 0)) { @@ -946,7 +937,6 @@ public function fetchGroupRequest($groupId) $multipart = false; - // path params if ($groupId !== null) { $resourcePath = str_replace( @@ -956,6 +946,8 @@ public function fetchGroupRequest($groupId) ); } + // body params + $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -969,17 +961,21 @@ public function fetchGroupRequest($groupId) } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -989,7 +985,7 @@ public function fetchGroupRequest($groupId) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -1009,7 +1005,7 @@ public function fetchGroupRequest($groupId) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -1055,16 +1051,9 @@ public function fetchGroupsWithHttpInfo() } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -1075,20 +1064,21 @@ public function fetchGroupsWithHttpInfo() sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + $request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } + $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Messente\Api\Model\GroupListEnvelope' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1098,9 +1088,9 @@ public function fetchGroupsWithHttpInfo() ]; case 401: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1110,9 +1100,9 @@ public function fetchGroupsWithHttpInfo() ]; default: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1123,10 +1113,11 @@ public function fetchGroupsWithHttpInfo() } $returnType = '\Messente\Api\Model\GroupListEnvelope'; + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1203,10 +1194,11 @@ public function fetchGroupsAsyncWithHttpInfo() ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1226,7 +1218,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } ); @@ -1239,7 +1231,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchGroupsRequest() + protected function fetchGroupsRequest() { $resourcePath = '/phonebook/groups'; @@ -1251,7 +1243,8 @@ public function fetchGroupsRequest() - + // body params + $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1265,17 +1258,21 @@ public function fetchGroupsRequest() } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1285,7 +1282,7 @@ public function fetchGroupsRequest() } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -1305,7 +1302,7 @@ public function fetchGroupsRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -1355,16 +1352,9 @@ public function updateGroupWithHttpInfo($groupId, $groupName) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -1375,20 +1365,21 @@ public function updateGroupWithHttpInfo($groupId, $groupName) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + $request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } + $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Messente\Api\Model\GroupEnvelope' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1398,9 +1389,9 @@ public function updateGroupWithHttpInfo($groupId, $groupName) ]; case 400: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1410,9 +1401,9 @@ public function updateGroupWithHttpInfo($groupId, $groupName) ]; case 401: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1422,9 +1413,9 @@ public function updateGroupWithHttpInfo($groupId, $groupName) ]; case 404: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1434,9 +1425,9 @@ public function updateGroupWithHttpInfo($groupId, $groupName) ]; default: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1447,10 +1438,11 @@ public function updateGroupWithHttpInfo($groupId, $groupName) } $returnType = '\Messente\Api\Model\GroupEnvelope'; + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1547,10 +1539,11 @@ public function updateGroupAsyncWithHttpInfo($groupId, $groupName) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1570,7 +1563,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } ); @@ -1585,7 +1578,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateGroupRequest($groupId, $groupName) + protected function updateGroupRequest($groupId, $groupName) { // verify the required parameter 'groupId' is set if ($groupId === null || (is_array($groupId) && count($groupId) === 0)) { @@ -1608,7 +1601,6 @@ public function updateGroupRequest($groupId, $groupName) $multipart = false; - // path params if ($groupId !== null) { $resourcePath = str_replace( @@ -1618,6 +1610,11 @@ public function updateGroupRequest($groupId, $groupName) ); } + // body params + $_tempBody = null; + if (isset($groupName)) { + $_tempBody = $groupName; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1631,23 +1628,21 @@ public function updateGroupRequest($groupId, $groupName) } // for model (json/xml) - if (isset($groupName)) { + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($groupName)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { - $httpBody = $groupName; + $httpBody = $_tempBody; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1657,7 +1652,7 @@ public function updateGroupRequest($groupId, $groupName) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -1677,7 +1672,7 @@ public function updateGroupRequest($groupId, $groupName) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'PUT', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/lib/Api/NumberLookupApi.php b/lib/Api/NumberLookupApi.php index 54abbe4..2fd2451 100644 --- a/lib/Api/NumberLookupApi.php +++ b/lib/Api/NumberLookupApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $hostIndex; + $this->hostIndex = $host_index; } /** * Set the host index * - * @param int $hostIndex Host index (required) + * @param int Host index (required) */ - public function setHostIndex($hostIndex): void + public function setHostIndex($host_index) { - $this->hostIndex = $hostIndex; + $this->hostIndex = $host_index; } /** * Get the host index * - * @return int Host index + * @return Host index */ public function getHostIndex() { @@ -155,16 +154,9 @@ public function fetchInfoWithHttpInfo($numbersToInvestigate) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -175,20 +167,21 @@ public function fetchInfoWithHttpInfo($numbersToInvestigate) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + $request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } + $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Messente\Api\Model\SyncNumberLookupSuccess' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -198,9 +191,9 @@ public function fetchInfoWithHttpInfo($numbersToInvestigate) ]; case 400: if ('\Messente\Api\Model\ErrorNumberLookup' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -210,9 +203,9 @@ public function fetchInfoWithHttpInfo($numbersToInvestigate) ]; case 401: if ('\Messente\Api\Model\ErrorNumberLookup' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -222,9 +215,9 @@ public function fetchInfoWithHttpInfo($numbersToInvestigate) ]; case 402: if ('\Messente\Api\Model\ErrorNumberLookup' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -235,10 +228,11 @@ public function fetchInfoWithHttpInfo($numbersToInvestigate) } $returnType = '\Messente\Api\Model\SyncNumberLookupSuccess'; + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -325,10 +319,11 @@ public function fetchInfoAsyncWithHttpInfo($numbersToInvestigate) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -348,7 +343,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } ); @@ -362,7 +357,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchInfoRequest($numbersToInvestigate) + protected function fetchInfoRequest($numbersToInvestigate) { // verify the required parameter 'numbersToInvestigate' is set if ($numbersToInvestigate === null || (is_array($numbersToInvestigate) && count($numbersToInvestigate) === 0)) { @@ -380,7 +375,11 @@ public function fetchInfoRequest($numbersToInvestigate) - + // body params + $_tempBody = null; + if (isset($numbersToInvestigate)) { + $_tempBody = $numbersToInvestigate; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -394,23 +393,21 @@ public function fetchInfoRequest($numbersToInvestigate) } // for model (json/xml) - if (isset($numbersToInvestigate)) { + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($numbersToInvestigate)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { - $httpBody = $numbersToInvestigate; + $httpBody = $_tempBody; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -420,7 +417,7 @@ public function fetchInfoRequest($numbersToInvestigate) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -440,7 +437,7 @@ public function fetchInfoRequest($numbersToInvestigate) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/lib/Api/OmnimessageApi.php b/lib/Api/OmnimessageApi.php index 15867bd..220bbe6 100644 --- a/lib/Api/OmnimessageApi.php +++ b/lib/Api/OmnimessageApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $hostIndex; + $this->hostIndex = $host_index; } /** * Set the host index * - * @param int $hostIndex Host index (required) + * @param int Host index (required) */ - public function setHostIndex($hostIndex): void + public function setHostIndex($host_index) { - $this->hostIndex = $hostIndex; + $this->hostIndex = $host_index; } /** * Get the host index * - * @return int Host index + * @return Host index */ public function getHostIndex() { @@ -155,16 +154,9 @@ public function cancelScheduledMessageWithHttpInfo($omnimessageId) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -175,20 +167,21 @@ public function cancelScheduledMessageWithHttpInfo($omnimessageId) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + $request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } + $responseBody = $response->getBody(); switch($statusCode) { case 202: if ('object' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -198,9 +191,9 @@ public function cancelScheduledMessageWithHttpInfo($omnimessageId) ]; case 404: if ('\Messente\Api\Model\ErrorOmnichannel' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -211,10 +204,11 @@ public function cancelScheduledMessageWithHttpInfo($omnimessageId) } $returnType = 'object'; + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -285,10 +279,11 @@ public function cancelScheduledMessageAsyncWithHttpInfo($omnimessageId) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -308,7 +303,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } ); @@ -322,7 +317,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function cancelScheduledMessageRequest($omnimessageId) + protected function cancelScheduledMessageRequest($omnimessageId) { // verify the required parameter 'omnimessageId' is set if ($omnimessageId === null || (is_array($omnimessageId) && count($omnimessageId) === 0)) { @@ -339,7 +334,6 @@ public function cancelScheduledMessageRequest($omnimessageId) $multipart = false; - // path params if ($omnimessageId !== null) { $resourcePath = str_replace( @@ -349,6 +343,8 @@ public function cancelScheduledMessageRequest($omnimessageId) ); } + // body params + $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -362,17 +358,21 @@ public function cancelScheduledMessageRequest($omnimessageId) } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -382,7 +382,7 @@ public function cancelScheduledMessageRequest($omnimessageId) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -402,7 +402,7 @@ public function cancelScheduledMessageRequest($omnimessageId) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -450,16 +450,9 @@ public function sendOmnimessageWithHttpInfo($omnimessage) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -470,20 +463,21 @@ public function sendOmnimessageWithHttpInfo($omnimessage) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + $request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } + $responseBody = $response->getBody(); switch($statusCode) { case 201: if ('\Messente\Api\Model\OmniMessageCreateSuccessResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -493,9 +487,9 @@ public function sendOmnimessageWithHttpInfo($omnimessage) ]; case 400: if ('\Messente\Api\Model\ErrorOmnichannel' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -506,10 +500,11 @@ public function sendOmnimessageWithHttpInfo($omnimessage) } $returnType = '\Messente\Api\Model\OmniMessageCreateSuccessResponse'; + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -580,10 +575,11 @@ public function sendOmnimessageAsyncWithHttpInfo($omnimessage) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -603,7 +599,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } ); @@ -617,7 +613,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function sendOmnimessageRequest($omnimessage) + protected function sendOmnimessageRequest($omnimessage) { // verify the required parameter 'omnimessage' is set if ($omnimessage === null || (is_array($omnimessage) && count($omnimessage) === 0)) { @@ -635,7 +631,11 @@ public function sendOmnimessageRequest($omnimessage) - + // body params + $_tempBody = null; + if (isset($omnimessage)) { + $_tempBody = $omnimessage; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -649,23 +649,21 @@ public function sendOmnimessageRequest($omnimessage) } // for model (json/xml) - if (isset($omnimessage)) { + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($omnimessage)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { - $httpBody = $omnimessage; + $httpBody = $_tempBody; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -675,7 +673,7 @@ public function sendOmnimessageRequest($omnimessage) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -695,7 +693,7 @@ public function sendOmnimessageRequest($omnimessage) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/lib/Api/StatisticsApi.php b/lib/Api/StatisticsApi.php index a5b109f..8af4d30 100644 --- a/lib/Api/StatisticsApi.php +++ b/lib/Api/StatisticsApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $hostIndex; + $this->hostIndex = $host_index; } /** * Set the host index * - * @param int $hostIndex Host index (required) + * @param int Host index (required) */ - public function setHostIndex($hostIndex): void + public function setHostIndex($host_index) { - $this->hostIndex = $hostIndex; + $this->hostIndex = $host_index; } /** * Get the host index * - * @return int Host index + * @return Host index */ public function getHostIndex() { @@ -155,16 +154,9 @@ public function createStatisticsReportWithHttpInfo($statisticsReportSettings) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -175,20 +167,21 @@ public function createStatisticsReportWithHttpInfo($statisticsReportSettings) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + $request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } + $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Messente\Api\Model\StatisticsReportSuccess' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -198,9 +191,9 @@ public function createStatisticsReportWithHttpInfo($statisticsReportSettings) ]; case 400: if ('\Messente\Api\Model\ErrorStatistics' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -210,9 +203,9 @@ public function createStatisticsReportWithHttpInfo($statisticsReportSettings) ]; case 401: if ('\Messente\Api\Model\ErrorStatistics' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -222,9 +215,9 @@ public function createStatisticsReportWithHttpInfo($statisticsReportSettings) ]; case 422: if ('\Messente\Api\Model\ErrorStatistics' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -234,9 +227,9 @@ public function createStatisticsReportWithHttpInfo($statisticsReportSettings) ]; case 500: if ('\Messente\Api\Model\ErrorStatistics' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -247,10 +240,11 @@ public function createStatisticsReportWithHttpInfo($statisticsReportSettings) } $returnType = '\Messente\Api\Model\StatisticsReportSuccess'; + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -345,10 +339,11 @@ public function createStatisticsReportAsyncWithHttpInfo($statisticsReportSetting ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -368,7 +363,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } ); @@ -382,7 +377,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createStatisticsReportRequest($statisticsReportSettings) + protected function createStatisticsReportRequest($statisticsReportSettings) { // verify the required parameter 'statisticsReportSettings' is set if ($statisticsReportSettings === null || (is_array($statisticsReportSettings) && count($statisticsReportSettings) === 0)) { @@ -400,7 +395,11 @@ public function createStatisticsReportRequest($statisticsReportSettings) - + // body params + $_tempBody = null; + if (isset($statisticsReportSettings)) { + $_tempBody = $statisticsReportSettings; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -414,23 +413,21 @@ public function createStatisticsReportRequest($statisticsReportSettings) } // for model (json/xml) - if (isset($statisticsReportSettings)) { + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($statisticsReportSettings)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { - $httpBody = $statisticsReportSettings; + $httpBody = $_tempBody; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -440,7 +437,7 @@ public function createStatisticsReportRequest($statisticsReportSettings) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -460,7 +457,7 @@ public function createStatisticsReportRequest($statisticsReportSettings) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/lib/ApiException.php b/lib/ApiException.php index 5e918bc..a4fe6e6 100644 --- a/lib/ApiException.php +++ b/lib/ApiException.php @@ -1,7 +1,7 @@ getTempFolderPath() . PHP_EOL; return $report; @@ -411,7 +408,7 @@ public static function toDebugReport() * * @param string $apiKeyIdentifier name of apikey * - * @return null|string API key with the prefix + * @return string API key with the prefix */ public function getApiKeyWithPrefix($apiKeyIdentifier) { @@ -434,29 +431,29 @@ public function getApiKeyWithPrefix($apiKeyIdentifier) /** * Returns an array of host settings * - * @return array an array of host settings + * @return an array of host settings */ public function getHostSettings() { - return [ - [ - "url" => "https://api.messente.com/v1", - "description" => "No description provided", - ] - ]; + return array( + array( + "url" => "https://api.messente.com/v1", + "description" => "No description provided", + ) + ); } /** * Returns URL based on the index and variables * - * @param int $index index of the host settings - * @param array|null $variables hash of variable and the corresponding value (optional) - * @return string URL based on host settings + * @param index array index of the host settings + * @param variables hash of variable and the corresponding value (optional) + * @return URL based on host settings */ public function getHostFromSettings($index, $variables = null) { if (null === $variables) { - $variables = []; + $variables = array(); } $hosts = $this->getHostSettings(); @@ -470,9 +467,9 @@ public function getHostFromSettings($index, $variables = null) $url = $host["url"]; // go through variable and assign a value - foreach ($host["variables"] ?? [] as $name => $variable) { + foreach ($host["variables"] as $name => $variable) { if (array_key_exists($name, $variables)) { // check to see if it's in the variables provided by the user - if (in_array($variables[$name], $variable["enum_values"], true)) { // check to see if the value is in the enum + if (in_array($variables[$name], $variable["enum_values"])) { // check to see if the value is in the enum $url = str_replace("{".$name."}", $variables[$name], $url); } else { throw new \InvalidArgumentException("The variable `$name` in the host URL has invalid value ".$variables[$name].". Must be ".join(',', $variable["enum_values"])."."); diff --git a/lib/HeaderSelector.php b/lib/HeaderSelector.php index a149e1d..05795b9 100644 --- a/lib/HeaderSelector.php +++ b/lib/HeaderSelector.php @@ -1,7 +1,7 @@ - * @template TKey int|null - * @template TValue mixed|null */ -class ContactEnvelope implements ModelInterface, ArrayAccess, \JsonSerializable +class ContactEnvelope implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -68,13 +65,27 @@ class ContactEnvelope implements ModelInterface, ArrayAccess, \JsonSerializable * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -95,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 @@ -164,6 +229,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -180,7 +248,18 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['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; } /** @@ -222,10 +301,16 @@ public function getContact() * * @param \Messente\Api\Model\ContactResponseFields|null $contact contact * - * @return self + * @return $this */ public function setContact($contact) { + + + if (is_null($contact)) { + throw new \InvalidArgumentException('non-nullable contact cannot be null'); + } + $this->container['contact'] = $contact; return $this; @@ -247,18 +332,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -283,18 +368,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -307,16 +380,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/ContactFields.php b/lib/Model/ContactFields.php index 7fc55a0..defdf21 100644 --- a/lib/Model/ContactFields.php +++ b/lib/Model/ContactFields.php @@ -2,7 +2,7 @@ /** * ContactFields * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class ContactFields implements ModelInterface, ArrayAccess, \JsonSerializable +class ContactFields implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -77,8 +74,6 @@ class ContactFields implements ModelInterface, ArrayAccess, \JsonSerializable * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'phoneNumber' => null, @@ -93,6 +88,31 @@ class ContactFields implements ModelInterface, ArrayAccess, \JsonSerializable '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 * @@ -113,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 @@ -209,6 +283,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -225,16 +302,27 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['phoneNumber'] = $data['phoneNumber'] ?? null; - $this->container['email'] = $data['email'] ?? null; - $this->container['firstName'] = $data['firstName'] ?? null; - $this->container['lastName'] = $data['lastName'] ?? null; - $this->container['company'] = $data['company'] ?? null; - $this->container['title'] = $data['title'] ?? null; - $this->container['custom'] = $data['custom'] ?? null; - $this->container['custom2'] = $data['custom2'] ?? null; - $this->container['custom3'] = $data['custom3'] ?? null; - $this->container['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; } /** @@ -279,10 +367,16 @@ public function getPhoneNumber() * * @param string $phoneNumber Phone number in e.164 format * - * @return self + * @return $this */ public function setPhoneNumber($phoneNumber) { + + + if (is_null($phoneNumber)) { + throw new \InvalidArgumentException('non-nullable phoneNumber cannot be null'); + } + $this->container['phoneNumber'] = $phoneNumber; return $this; @@ -303,10 +397,23 @@ public function getEmail() * * @param string|null $email The email of the contact * - * @return self + * @return $this */ 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; @@ -327,10 +434,23 @@ public function getFirstName() * * @param string|null $firstName The first name of the contact * - * @return self + * @return $this */ 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; @@ -351,10 +471,23 @@ public function getLastName() * * @param string|null $lastName The last name of the contact * - * @return self + * @return $this */ 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; @@ -375,10 +508,23 @@ public function getCompany() * * @param string|null $company The company of the contact * - * @return self + * @return $this */ 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; @@ -399,10 +545,23 @@ public function getTitle() * * @param string|null $title The title of the contact * - * @return self + * @return $this */ 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; @@ -423,10 +582,23 @@ public function getCustom() * * @param string|null $custom The first custom field * - * @return self + * @return $this */ 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; @@ -447,10 +619,23 @@ public function getCustom2() * * @param string|null $custom2 The second custom field * - * @return self + * @return $this */ 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; @@ -471,10 +656,23 @@ public function getCustom3() * * @param string|null $custom3 The third custom field * - * @return self + * @return $this */ 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; @@ -495,10 +693,23 @@ public function getCustom4() * * @param string|null $custom4 The fourth custom field * - * @return self + * @return $this */ 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; @@ -520,18 +731,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -556,18 +767,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -580,16 +779,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/ContactListEnvelope.php b/lib/Model/ContactListEnvelope.php index b225830..0b730a5 100644 --- a/lib/Model/ContactListEnvelope.php +++ b/lib/Model/ContactListEnvelope.php @@ -2,7 +2,7 @@ /** * ContactListEnvelope * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class ContactListEnvelope implements ModelInterface, ArrayAccess, \JsonSerializable +class ContactListEnvelope implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -68,13 +65,27 @@ class ContactListEnvelope implements ModelInterface, ArrayAccess, \JsonSerializa * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -95,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 @@ -164,6 +229,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -180,7 +248,18 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['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; } /** @@ -222,12 +301,16 @@ public function getContacts() * * @param \Messente\Api\Model\ContactResponseFields[]|null $contacts An array of contacts * - * @return self + * @return $this */ public function setContacts($contacts) { + if (is_null($contacts)) { + throw new \InvalidArgumentException('non-nullable contacts cannot be null'); + } + $this->container['contacts'] = $contacts; return $this; @@ -249,18 +332,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -285,18 +368,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -309,16 +380,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/ContactResponseFields.php b/lib/Model/ContactResponseFields.php index 1b44998..225a03b 100644 --- a/lib/Model/ContactResponseFields.php +++ b/lib/Model/ContactResponseFields.php @@ -2,7 +2,7 @@ /** * ContactResponseFields * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class ContactResponseFields implements ModelInterface, ArrayAccess, \JsonSerializable +class ContactResponseFields implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -78,8 +75,6 @@ class ContactResponseFields implements ModelInterface, ArrayAccess, \JsonSeriali * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'phoneNumber' => null, @@ -95,6 +90,32 @@ class ContactResponseFields implements ModelInterface, ArrayAccess, \JsonSeriali 'scheduledDeletionDate' => 'date' ]; + /** + * 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, + 'scheduledDeletionDate' => 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 * @@ -115,6 +136,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 @@ -214,6 +289,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -230,17 +308,28 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['phoneNumber'] = $data['phoneNumber'] ?? null; - $this->container['email'] = $data['email'] ?? null; - $this->container['firstName'] = $data['firstName'] ?? null; - $this->container['lastName'] = $data['lastName'] ?? null; - $this->container['company'] = $data['company'] ?? null; - $this->container['title'] = $data['title'] ?? null; - $this->container['custom'] = $data['custom'] ?? null; - $this->container['custom2'] = $data['custom2'] ?? null; - $this->container['custom3'] = $data['custom3'] ?? null; - $this->container['custom4'] = $data['custom4'] ?? null; - $this->container['scheduledDeletionDate'] = $data['scheduledDeletionDate'] ?? 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); + $this->setIfExists('scheduledDeletionDate', $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; } /** @@ -282,10 +371,16 @@ public function getPhoneNumber() * * @param string|null $phoneNumber Phone number in e.164 format * - * @return self + * @return $this */ public function setPhoneNumber($phoneNumber) { + + + if (is_null($phoneNumber)) { + throw new \InvalidArgumentException('non-nullable phoneNumber cannot be null'); + } + $this->container['phoneNumber'] = $phoneNumber; return $this; @@ -306,10 +401,23 @@ public function getEmail() * * @param string|null $email The email of the contact * - * @return self + * @return $this */ 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; @@ -330,10 +438,23 @@ public function getFirstName() * * @param string|null $firstName The first name of the contact * - * @return self + * @return $this */ 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; @@ -354,10 +475,23 @@ public function getLastName() * * @param string|null $lastName The last name of the contact * - * @return self + * @return $this */ 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; @@ -378,10 +512,23 @@ public function getCompany() * * @param string|null $company The company of the contact * - * @return self + * @return $this */ 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; @@ -402,10 +549,23 @@ public function getTitle() * * @param string|null $title The title of the contact * - * @return self + * @return $this */ 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; @@ -426,10 +586,23 @@ public function getCustom() * * @param string|null $custom The first custom field * - * @return self + * @return $this */ 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; @@ -450,10 +623,23 @@ public function getCustom2() * * @param string|null $custom2 The second custom field * - * @return self + * @return $this */ 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; @@ -474,10 +660,23 @@ public function getCustom3() * * @param string|null $custom3 The third custom field * - * @return self + * @return $this */ 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; @@ -498,10 +697,23 @@ public function getCustom4() * * @param string|null $custom4 The fourth custom field * - * @return self + * @return $this */ 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; @@ -522,10 +734,23 @@ public function getScheduledDeletionDate() * * @param \DateTime|null $scheduledDeletionDate The date in ISO 8601 format, YYYY-MM-DD, on which the contact is going to be deleted because it has not belonged to a group for 30 days * - * @return self + * @return $this */ public function setScheduledDeletionDate($scheduledDeletionDate) { + + if (is_null($scheduledDeletionDate)) { + array_push($this->openAPINullablesSetToNull, 'scheduledDeletionDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('scheduledDeletionDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['scheduledDeletionDate'] = $scheduledDeletionDate; return $this; @@ -547,18 +772,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -583,18 +808,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -607,16 +820,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/ContactUpdateFields.php b/lib/Model/ContactUpdateFields.php index 1f4c757..2f731b6 100644 --- a/lib/Model/ContactUpdateFields.php +++ b/lib/Model/ContactUpdateFields.php @@ -2,7 +2,7 @@ /** * ContactUpdateFields * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class ContactUpdateFields implements ModelInterface, ArrayAccess, \JsonSerializable +class ContactUpdateFields implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -76,8 +73,6 @@ class ContactUpdateFields implements ModelInterface, ArrayAccess, \JsonSerializa * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'email' => null, @@ -91,6 +86,30 @@ class ContactUpdateFields implements ModelInterface, ArrayAccess, \JsonSerializa '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 * @@ -111,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 @@ -204,6 +277,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -220,15 +296,26 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['email'] = $data['email'] ?? null; - $this->container['firstName'] = $data['firstName'] ?? null; - $this->container['lastName'] = $data['lastName'] ?? null; - $this->container['company'] = $data['company'] ?? null; - $this->container['title'] = $data['title'] ?? null; - $this->container['custom'] = $data['custom'] ?? null; - $this->container['custom2'] = $data['custom2'] ?? null; - $this->container['custom3'] = $data['custom3'] ?? null; - $this->container['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; } /** @@ -270,10 +357,23 @@ public function getEmail() * * @param string|null $email The email of the contact * - * @return self + * @return $this */ 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; @@ -294,10 +394,23 @@ public function getFirstName() * * @param string|null $firstName The first name of the contact * - * @return self + * @return $this */ 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; @@ -318,10 +431,23 @@ public function getLastName() * * @param string|null $lastName The last name of the contact * - * @return self + * @return $this */ 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; @@ -342,10 +468,23 @@ public function getCompany() * * @param string|null $company The company of the contact * - * @return self + * @return $this */ 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; @@ -366,10 +505,23 @@ public function getTitle() * * @param string|null $title The title of the contact * - * @return self + * @return $this */ 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; @@ -390,10 +542,23 @@ public function getCustom() * * @param string|null $custom The first custom field * - * @return self + * @return $this */ 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; @@ -414,10 +579,23 @@ public function getCustom2() * * @param string|null $custom2 The second custom field * - * @return self + * @return $this */ 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; @@ -438,10 +616,23 @@ public function getCustom3() * * @param string|null $custom3 The third custom field * - * @return self + * @return $this */ 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; @@ -462,10 +653,23 @@ public function getCustom4() * * @param string|null $custom4 The fourth custom field * - * @return self + * @return $this */ 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; @@ -487,18 +691,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -523,18 +727,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -547,16 +739,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/DeliveryReportResponse.php b/lib/Model/DeliveryReportResponse.php index 0ac1bdb..c078fea 100644 --- a/lib/Model/DeliveryReportResponse.php +++ b/lib/Model/DeliveryReportResponse.php @@ -2,7 +2,7 @@ /** * DeliveryReportResponse * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class DeliveryReportResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class DeliveryReportResponse implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -70,8 +67,6 @@ class DeliveryReportResponse implements ModelInterface, ArrayAccess, \JsonSerial * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'statuses' => null, @@ -79,6 +74,24 @@ class DeliveryReportResponse implements ModelInterface, ArrayAccess, \JsonSerial '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 * @@ -99,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 @@ -174,6 +241,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -190,9 +260,20 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['statuses'] = $data['statuses'] ?? null; - $this->container['to'] = $data['to'] ?? null; - $this->container['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; } /** @@ -243,10 +324,16 @@ public function getStatuses() * * @param \Messente\Api\Model\DeliveryResult[] $statuses Contains the delivery reports for each channel, ordered by send order * - * @return self + * @return $this */ public function setStatuses($statuses) { + + + if (is_null($statuses)) { + throw new \InvalidArgumentException('non-nullable statuses cannot be null'); + } + $this->container['statuses'] = $statuses; return $this; @@ -267,10 +354,16 @@ public function getTo() * * @param string $to Phone number in e.164 format * - * @return self + * @return $this */ public function setTo($to) { + + + if (is_null($to)) { + throw new \InvalidArgumentException('non-nullable to cannot be null'); + } + $this->container['to'] = $to; return $this; @@ -291,10 +384,16 @@ public function getOmnimessageId() * * @param string $omnimessageId Unique identifier for the omnimessage * - * @return self + * @return $this */ public function setOmnimessageId($omnimessageId) { + + + if (is_null($omnimessageId)) { + throw new \InvalidArgumentException('non-nullable omnimessageId cannot be null'); + } + $this->container['omnimessageId'] = $omnimessageId; return $this; @@ -316,18 +415,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -352,18 +451,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -376,16 +463,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/DeliveryResult.php b/lib/Model/DeliveryResult.php index 049d5e3..3dd6dde 100644 --- a/lib/Model/DeliveryResult.php +++ b/lib/Model/DeliveryResult.php @@ -2,7 +2,7 @@ /** * DeliveryResult * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class DeliveryResult implements ModelInterface, ArrayAccess, \JsonSerializable +class DeliveryResult implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -73,8 +70,6 @@ class DeliveryResult implements ModelInterface, ArrayAccess, \JsonSerializable * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'status' => null, @@ -85,6 +80,27 @@ class DeliveryResult implements ModelInterface, ArrayAccess, \JsonSerializable '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 * @@ -105,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 @@ -189,6 +259,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -205,12 +278,23 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['status'] = $data['status'] ?? null; - $this->container['channel'] = $data['channel'] ?? null; - $this->container['messageId'] = $data['messageId'] ?? null; - $this->container['error'] = $data['error'] ?? null; - $this->container['err'] = $data['err'] ?? null; - $this->container['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; } /** @@ -252,10 +336,16 @@ public function getStatus() * * @param \Messente\Api\Model\Status|null $status status * - * @return self + * @return $this */ public function setStatus($status) { + + + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; return $this; @@ -276,10 +366,16 @@ public function getChannel() * * @param \Messente\Api\Model\Channel|null $channel channel * - * @return self + * @return $this */ public function setChannel($channel) { + + + if (is_null($channel)) { + throw new \InvalidArgumentException('non-nullable channel cannot be null'); + } + $this->container['channel'] = $channel; return $this; @@ -300,10 +396,16 @@ public function getMessageId() * * @param string|null $messageId Unique identifier for the message * - * @return self + * @return $this */ public function setMessageId($messageId) { + + + if (is_null($messageId)) { + throw new \InvalidArgumentException('non-nullable messageId cannot be null'); + } + $this->container['messageId'] = $messageId; return $this; @@ -324,10 +426,16 @@ public function getError() * * @param string|null $error Human-readable description of what went wrong, *null* in case of success or if the message has not been processed yet * - * @return self + * @return $this */ public function setError($error) { + + + if (is_null($error)) { + throw new \InvalidArgumentException('non-nullable error cannot be null'); + } + $this->container['error'] = $error; return $this; @@ -348,10 +456,16 @@ public function getErr() * * @param \Messente\Api\Model\ErrorCodeOmnichannelMachine|null $err err * - * @return self + * @return $this */ public function setErr($err) { + + + if (is_null($err)) { + throw new \InvalidArgumentException('non-nullable err cannot be null'); + } + $this->container['err'] = $err; return $this; @@ -372,10 +486,16 @@ public function getTimestamp() * * @param \DateTime|null $timestamp When this status was received by Omnichannel API * - * @return self + * @return $this */ public function setTimestamp($timestamp) { + + + if (is_null($timestamp)) { + throw new \InvalidArgumentException('non-nullable timestamp cannot be null'); + } + $this->container['timestamp'] = $timestamp; return $this; @@ -397,18 +517,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -433,18 +553,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -457,16 +565,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/ErrorCodeOmnichannel.php b/lib/Model/ErrorCodeOmnichannel.php index 5f88cd2..64a7750 100644 --- a/lib/Model/ErrorCodeOmnichannel.php +++ b/lib/Model/ErrorCodeOmnichannel.php @@ -2,7 +2,7 @@ /** * ErrorCodeOmnichannel * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -45,19 +45,13 @@ class ErrorCodeOmnichannel * Possible values of this enum */ const _101 = '101'; - const _102 = '102'; - const _103 = '103'; - const _104 = '104'; - const _105 = '105'; - const _106 = '106'; - const _107 = '107'; - + /** * Gets allowable values of the enum * @return string[] @@ -71,7 +65,7 @@ public static function getAllowableEnumValues() self::_104, self::_105, self::_106, - self::_107 + self::_107, ]; } } diff --git a/lib/Model/ErrorCodeOmnichannelMachine.php b/lib/Model/ErrorCodeOmnichannelMachine.php index 50b2f5f..03ae830 100644 --- a/lib/Model/ErrorCodeOmnichannelMachine.php +++ b/lib/Model/ErrorCodeOmnichannelMachine.php @@ -2,7 +2,7 @@ /** * ErrorCodeOmnichannelMachine * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -44,30 +44,19 @@ class ErrorCodeOmnichannelMachine /** * Possible values of this enum */ - const NUMBER_0 = 0; - - const NUMBER_1 = 1; - - const NUMBER_2 = 2; - - const NUMBER_3 = 3; - - const NUMBER_4 = 4; - - const NUMBER_5 = 5; - - const NUMBER_6 = 6; - - const NUMBER_7 = 7; - - const NUMBER_8 = 8; - - const NUMBER_9 = 9; - - const NUMBER_10 = 10; - - const NUMBER_999 = 999; - + const 0 = 0; + const 1 = 1; + const 2 = 2; + const 3 = 3; + const 4 = 4; + const 5 = 5; + const 6 = 6; + const 7 = 7; + const 8 = 8; + const 9 = 9; + const 10 = 10; + const 999 = 999; + /** * Gets allowable values of the enum * @return string[] @@ -75,18 +64,18 @@ class ErrorCodeOmnichannelMachine public static function getAllowableEnumValues() { return [ - self::NUMBER_0, - self::NUMBER_1, - self::NUMBER_2, - self::NUMBER_3, - self::NUMBER_4, - self::NUMBER_5, - self::NUMBER_6, - self::NUMBER_7, - self::NUMBER_8, - self::NUMBER_9, - self::NUMBER_10, - self::NUMBER_999 + self::0, + self::1, + self::2, + self::3, + self::4, + self::5, + self::6, + self::7, + self::8, + self::9, + self::10, + self::999, ]; } } diff --git a/lib/Model/ErrorCodePhonebook.php b/lib/Model/ErrorCodePhonebook.php index 37fdb89..8a980d8 100644 --- a/lib/Model/ErrorCodePhonebook.php +++ b/lib/Model/ErrorCodePhonebook.php @@ -2,7 +2,7 @@ /** * ErrorCodePhonebook * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -45,17 +45,12 @@ class ErrorCodePhonebook * Possible values of this enum */ const _201 = '201'; - const _202 = '202'; - const _203 = '203'; - const _204 = '204'; - const _244 = '244'; - const _205 = '205'; - + /** * Gets allowable values of the enum * @return string[] @@ -68,7 +63,7 @@ public static function getAllowableEnumValues() self::_203, self::_204, self::_244, - self::_205 + self::_205, ]; } } diff --git a/lib/Model/ErrorCodeStatistics.php b/lib/Model/ErrorCodeStatistics.php index 6b082f7..afabc11 100644 --- a/lib/Model/ErrorCodeStatistics.php +++ b/lib/Model/ErrorCodeStatistics.php @@ -2,7 +2,7 @@ /** * ErrorCodeStatistics * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -45,13 +45,10 @@ class ErrorCodeStatistics * Possible values of this enum */ const _100 = '100'; - const _103 = '103'; - const _104 = '104'; - const _105 = '105'; - + /** * Gets allowable values of the enum * @return string[] @@ -62,7 +59,7 @@ public static function getAllowableEnumValues() self::_100, self::_103, self::_104, - self::_105 + self::_105, ]; } } diff --git a/lib/Model/ErrorItemNumberLookup.php b/lib/Model/ErrorItemNumberLookup.php index 1173426..d0eef98 100644 --- a/lib/Model/ErrorItemNumberLookup.php +++ b/lib/Model/ErrorItemNumberLookup.php @@ -2,7 +2,7 @@ /** * ErrorItemNumberLookup * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class ErrorItemNumberLookup implements ModelInterface, ArrayAccess, \JsonSerializable +class ErrorItemNumberLookup implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -68,13 +65,27 @@ class ErrorItemNumberLookup implements ModelInterface, ArrayAccess, \JsonSeriali * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'error' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'error' => 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 * @@ -95,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 @@ -164,6 +229,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -180,7 +248,18 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['error'] = $data['error'] ?? null; + $this->setIfExists('error', $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; } /** @@ -225,10 +304,16 @@ public function getError() * * @param \Messente\Api\Model\ErrorItemNumberLookupError $error error * - * @return self + * @return $this */ public function setError($error) { + + + if (is_null($error)) { + throw new \InvalidArgumentException('non-nullable error cannot be null'); + } + $this->container['error'] = $error; return $this; @@ -250,18 +335,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -286,18 +371,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -310,16 +383,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/ErrorItemNumberLookupError.php b/lib/Model/ErrorItemNumberLookupError.php index b8f6254..e0ad19c 100644 --- a/lib/Model/ErrorItemNumberLookupError.php +++ b/lib/Model/ErrorItemNumberLookupError.php @@ -2,7 +2,7 @@ /** * ErrorItemNumberLookupError * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class ErrorItemNumberLookupError implements ModelInterface, ArrayAccess, \JsonSerializable +class ErrorItemNumberLookupError implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -69,14 +66,29 @@ class ErrorItemNumberLookupError implements ModelInterface, ArrayAccess, \JsonSe * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'description' => null, 'code' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'description' => 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 * @@ -97,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 @@ -169,6 +235,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -185,8 +254,19 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['description'] = $data['description'] ?? null; - $this->container['code'] = $data['code'] ?? null; + $this->setIfExists('description', $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; } /** @@ -242,10 +322,16 @@ public function getDescription() * * @param string $description Error description * - * @return self + * @return $this */ public function setDescription($description) { + + + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; return $this; @@ -266,7 +352,7 @@ public function getCode() * * @param int $code Matches the following error title. This field is a constant * 101 - Unauthorized * 102 - Invalid arguments or parameters * 103 - Server error * 104 - Crediting error #1 * 105 - Crediting error #2 * 106 - Client error * - * @return self + * @return $this */ public function setCode($code) { @@ -278,6 +364,12 @@ public function setCode($code) throw new \InvalidArgumentException('invalid value for $code when calling ErrorItemNumberLookupError., must be bigger than or equal to 101.'); } + + + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); + } + $this->container['code'] = $code; return $this; @@ -299,18 +391,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -335,18 +427,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -359,16 +439,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/ErrorItemOmnichannel.php b/lib/Model/ErrorItemOmnichannel.php index dd1cad6..7bf1027 100644 --- a/lib/Model/ErrorItemOmnichannel.php +++ b/lib/Model/ErrorItemOmnichannel.php @@ -2,7 +2,7 @@ /** * ErrorItemOmnichannel * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class ErrorItemOmnichannel implements ModelInterface, ArrayAccess, \JsonSerializable +class ErrorItemOmnichannel implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -71,8 +68,6 @@ class ErrorItemOmnichannel implements ModelInterface, ArrayAccess, \JsonSerializ * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'title' => null, @@ -81,6 +76,25 @@ class ErrorItemOmnichannel implements ModelInterface, ArrayAccess, \JsonSerializ 'source' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'title' => false, + 'detail' => false, + 'code' => false, + 'source' => 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 * @@ -101,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 @@ -179,6 +247,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -195,10 +266,21 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['detail'] = $data['detail'] ?? null; - $this->container['code'] = $data['code'] ?? null; - $this->container['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; } /** @@ -252,10 +334,16 @@ public function getTitle() * * @param \Messente\Api\Model\ErrorTitleOmnichannel $title title * - * @return self + * @return $this */ public function setTitle($title) { + + + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } + $this->container['title'] = $title; return $this; @@ -276,10 +364,16 @@ public function getDetail() * * @param string $detail Free form more detailed description of the error * - * @return self + * @return $this */ public function setDetail($detail) { + + + if (is_null($detail)) { + throw new \InvalidArgumentException('non-nullable detail cannot be null'); + } + $this->container['detail'] = $detail; return $this; @@ -300,10 +394,16 @@ public function getCode() * * @param \Messente\Api\Model\ErrorCodeOmnichannel $code code * - * @return self + * @return $this */ public function setCode($code) { + + + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); + } + $this->container['code'] = $code; return $this; @@ -324,10 +424,23 @@ public function getSource() * * @param string $source Describes which field is causing the issue in the payload, null for non 400 status code responses * - * @return self + * @return $this */ public function setSource($source) { + + if (is_null($source)) { + array_push($this->openAPINullablesSetToNull, 'source'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('source', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['source'] = $source; return $this; @@ -349,18 +462,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -385,18 +498,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -409,16 +510,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/ErrorItemPhonebook.php b/lib/Model/ErrorItemPhonebook.php index 8e0cb54..0f7f426 100644 --- a/lib/Model/ErrorItemPhonebook.php +++ b/lib/Model/ErrorItemPhonebook.php @@ -2,7 +2,7 @@ /** * ErrorItemPhonebook * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class ErrorItemPhonebook implements ModelInterface, ArrayAccess, \JsonSerializable +class ErrorItemPhonebook implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -70,8 +67,6 @@ class ErrorItemPhonebook implements ModelInterface, ArrayAccess, \JsonSerializab * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'title' => null, @@ -79,6 +74,24 @@ class ErrorItemPhonebook implements ModelInterface, ArrayAccess, \JsonSerializab '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 * @@ -99,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 @@ -174,6 +241,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -190,9 +260,20 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['detail'] = $data['detail'] ?? null; - $this->container['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; } /** @@ -243,10 +324,16 @@ public function getTitle() * * @param \Messente\Api\Model\ErrorTitlePhonebook $title title * - * @return self + * @return $this */ public function setTitle($title) { + + + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } + $this->container['title'] = $title; return $this; @@ -267,10 +354,16 @@ public function getDetail() * * @param string $detail Free form more detailed description of the error * - * @return self + * @return $this */ public function setDetail($detail) { + + + if (is_null($detail)) { + throw new \InvalidArgumentException('non-nullable detail cannot be null'); + } + $this->container['detail'] = $detail; return $this; @@ -291,10 +384,16 @@ public function getCode() * * @param \Messente\Api\Model\ErrorCodePhonebook $code code * - * @return self + * @return $this */ public function setCode($code) { + + + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); + } + $this->container['code'] = $code; return $this; @@ -316,18 +415,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -352,18 +451,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -376,16 +463,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/ErrorItemStatistics.php b/lib/Model/ErrorItemStatistics.php index 1c794d4..278f46c 100644 --- a/lib/Model/ErrorItemStatistics.php +++ b/lib/Model/ErrorItemStatistics.php @@ -2,7 +2,7 @@ /** * ErrorItemStatistics * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class ErrorItemStatistics implements ModelInterface, ArrayAccess, \JsonSerializable +class ErrorItemStatistics implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -70,8 +67,6 @@ class ErrorItemStatistics implements ModelInterface, ArrayAccess, \JsonSerializa * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'title' => null, @@ -79,6 +74,24 @@ class ErrorItemStatistics implements ModelInterface, ArrayAccess, \JsonSerializa 'code' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'title' => false, + 'details' => 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 * @@ -99,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 @@ -174,6 +241,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -190,9 +260,20 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['details'] = $data['details'] ?? null; - $this->container['code'] = $data['code'] ?? null; + $this->setIfExists('title', $data, null); + $this->setIfExists('details', $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; } /** @@ -243,10 +324,16 @@ public function getTitle() * * @param string $title Error title * - * @return self + * @return $this */ public function setTitle($title) { + + + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } + $this->container['title'] = $title; return $this; @@ -267,10 +354,16 @@ public function getDetails() * * @param string $details Error details * - * @return self + * @return $this */ public function setDetails($details) { + + + if (is_null($details)) { + throw new \InvalidArgumentException('non-nullable details cannot be null'); + } + $this->container['details'] = $details; return $this; @@ -291,10 +384,16 @@ public function getCode() * * @param \Messente\Api\Model\ErrorCodeStatistics $code code * - * @return self + * @return $this */ public function setCode($code) { + + + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); + } + $this->container['code'] = $code; return $this; @@ -316,18 +415,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -352,18 +451,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -376,16 +463,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/ErrorNumberLookup.php b/lib/Model/ErrorNumberLookup.php index 1e4d769..f62ff86 100644 --- a/lib/Model/ErrorNumberLookup.php +++ b/lib/Model/ErrorNumberLookup.php @@ -2,7 +2,7 @@ /** * ErrorNumberLookup * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class ErrorNumberLookup implements ModelInterface, ArrayAccess, \JsonSerializable +class ErrorNumberLookup implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -68,13 +65,27 @@ class ErrorNumberLookup implements ModelInterface, ArrayAccess, \JsonSerializabl * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -95,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 @@ -164,6 +229,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -180,7 +248,18 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['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; } /** @@ -225,10 +304,16 @@ public function getErrors() * * @param \Messente\Api\Model\ErrorItemNumberLookup[] $errors An array of errors * - * @return self + * @return $this */ public function setErrors($errors) { + + + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); + } + $this->container['errors'] = $errors; return $this; @@ -250,18 +335,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -286,18 +371,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -310,16 +383,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/ErrorOmnichannel.php b/lib/Model/ErrorOmnichannel.php index ff18c12..d7ffaa8 100644 --- a/lib/Model/ErrorOmnichannel.php +++ b/lib/Model/ErrorOmnichannel.php @@ -2,7 +2,7 @@ /** * ErrorOmnichannel * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class ErrorOmnichannel implements ModelInterface, ArrayAccess, \JsonSerializable +class ErrorOmnichannel implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -68,13 +65,27 @@ class ErrorOmnichannel implements ModelInterface, ArrayAccess, \JsonSerializable * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -95,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 @@ -164,6 +229,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -180,7 +248,18 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['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; } /** @@ -225,10 +304,16 @@ public function getErrors() * * @param \Messente\Api\Model\ErrorItemOmnichannel[] $errors An array of errors * - * @return self + * @return $this */ public function setErrors($errors) { + + + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); + } + $this->container['errors'] = $errors; return $this; @@ -250,18 +335,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -286,18 +371,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -310,16 +383,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/ErrorPhonebook.php b/lib/Model/ErrorPhonebook.php index 6f5f502..fb54b7f 100644 --- a/lib/Model/ErrorPhonebook.php +++ b/lib/Model/ErrorPhonebook.php @@ -2,7 +2,7 @@ /** * ErrorPhonebook * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class ErrorPhonebook implements ModelInterface, ArrayAccess, \JsonSerializable +class ErrorPhonebook implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -68,13 +65,27 @@ class ErrorPhonebook implements ModelInterface, ArrayAccess, \JsonSerializable * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -95,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 @@ -164,6 +229,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -180,7 +248,18 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['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; } /** @@ -225,10 +304,16 @@ public function getErrors() * * @param \Messente\Api\Model\ErrorItemPhonebook[] $errors An array of errors * - * @return self + * @return $this */ public function setErrors($errors) { + + + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); + } + $this->container['errors'] = $errors; return $this; @@ -250,18 +335,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -286,18 +371,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -310,16 +383,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/ErrorStatistics.php b/lib/Model/ErrorStatistics.php index dec3d64..f5c8840 100644 --- a/lib/Model/ErrorStatistics.php +++ b/lib/Model/ErrorStatistics.php @@ -2,7 +2,7 @@ /** * ErrorStatistics * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class ErrorStatistics implements ModelInterface, ArrayAccess, \JsonSerializable +class ErrorStatistics implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -68,13 +65,27 @@ class ErrorStatistics implements ModelInterface, ArrayAccess, \JsonSerializable * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -95,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 @@ -164,6 +229,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -180,7 +248,18 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['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; } /** @@ -225,10 +304,16 @@ public function getErrors() * * @param \Messente\Api\Model\ErrorItemStatistics[] $errors An array of errors * - * @return self + * @return $this */ public function setErrors($errors) { + + + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); + } + $this->container['errors'] = $errors; return $this; @@ -250,18 +335,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -286,18 +371,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -310,16 +383,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/ErrorTitleOmnichannel.php b/lib/Model/ErrorTitleOmnichannel.php index e5a0b6b..f4657c9 100644 --- a/lib/Model/ErrorTitleOmnichannel.php +++ b/lib/Model/ErrorTitleOmnichannel.php @@ -2,7 +2,7 @@ /** * ErrorTitleOmnichannel * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -45,19 +45,13 @@ class ErrorTitleOmnichannel * Possible values of this enum */ const NOT_FOUND = 'Not found'; - const FORBIDDEN = 'Forbidden'; - const UNAUTHORIZED = 'Unauthorized'; - const INVALID_DATA = 'Invalid data'; - const INTERNAL_SERVER_ERROR = 'Internal Server Error'; - const MISSING_DATA = 'Missing data'; - const METHOD_NOT_ALLOWED = 'Method not allowed'; - + /** * Gets allowable values of the enum * @return string[] @@ -71,7 +65,7 @@ public static function getAllowableEnumValues() self::INVALID_DATA, self::INTERNAL_SERVER_ERROR, self::MISSING_DATA, - self::METHOD_NOT_ALLOWED + self::METHOD_NOT_ALLOWED, ]; } } diff --git a/lib/Model/ErrorTitlePhonebook.php b/lib/Model/ErrorTitlePhonebook.php index 5fe8354..c2ca7b0 100644 --- a/lib/Model/ErrorTitlePhonebook.php +++ b/lib/Model/ErrorTitlePhonebook.php @@ -2,7 +2,7 @@ /** * ErrorTitlePhonebook * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -45,17 +45,12 @@ class ErrorTitlePhonebook * Possible values of this enum */ const INVALID_DATA = 'Invalid data'; - const UNAUTHORIZED = 'Unauthorized'; - const MISSING_RESOURCE = 'Missing resource'; - const CONFLICT = 'Conflict'; - const CLIENT_ERROR = 'Client error'; - const GENERAL_ERROR = 'General error'; - + /** * Gets allowable values of the enum * @return string[] @@ -68,7 +63,7 @@ public static function getAllowableEnumValues() self::MISSING_RESOURCE, self::CONFLICT, self::CLIENT_ERROR, - self::GENERAL_ERROR + self::GENERAL_ERROR, ]; } } diff --git a/lib/Model/FetchBlacklistSuccess.php b/lib/Model/FetchBlacklistSuccess.php index 55fe1a5..8d3179f 100644 --- a/lib/Model/FetchBlacklistSuccess.php +++ b/lib/Model/FetchBlacklistSuccess.php @@ -2,7 +2,7 @@ /** * FetchBlacklistSuccess * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class FetchBlacklistSuccess implements ModelInterface, ArrayAccess, \JsonSerializable +class FetchBlacklistSuccess implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -68,13 +65,27 @@ class FetchBlacklistSuccess implements ModelInterface, ArrayAccess, \JsonSeriali * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -95,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 @@ -164,6 +229,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -180,7 +248,18 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['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; } /** @@ -222,12 +301,16 @@ public function getPhoneNumbers() * * @param string[]|null $phoneNumbers Array of unique phone numbers * - * @return self + * @return $this */ public function setPhoneNumbers($phoneNumbers) { + if (is_null($phoneNumbers)) { + throw new \InvalidArgumentException('non-nullable phoneNumbers cannot be null'); + } + $this->container['phoneNumbers'] = $phoneNumbers; return $this; @@ -249,18 +332,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -285,18 +368,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -309,16 +380,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/GroupEnvelope.php b/lib/Model/GroupEnvelope.php index d2fd51c..1ce8f9d 100644 --- a/lib/Model/GroupEnvelope.php +++ b/lib/Model/GroupEnvelope.php @@ -2,7 +2,7 @@ /** * GroupEnvelope * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class GroupEnvelope implements ModelInterface, ArrayAccess, \JsonSerializable +class GroupEnvelope implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -68,13 +65,27 @@ class GroupEnvelope implements ModelInterface, ArrayAccess, \JsonSerializable * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -95,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 @@ -164,6 +229,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -180,7 +248,18 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['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; } /** @@ -222,10 +301,16 @@ public function getGroup() * * @param \Messente\Api\Model\GroupResponseFields|null $group group * - * @return self + * @return $this */ public function setGroup($group) { + + + if (is_null($group)) { + throw new \InvalidArgumentException('non-nullable group cannot be null'); + } + $this->container['group'] = $group; return $this; @@ -247,18 +332,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -283,18 +368,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -307,16 +380,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/GroupListEnvelope.php b/lib/Model/GroupListEnvelope.php index da5982b..f1f7e25 100644 --- a/lib/Model/GroupListEnvelope.php +++ b/lib/Model/GroupListEnvelope.php @@ -2,7 +2,7 @@ /** * GroupListEnvelope * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class GroupListEnvelope implements ModelInterface, ArrayAccess, \JsonSerializable +class GroupListEnvelope implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -68,13 +65,27 @@ class GroupListEnvelope implements ModelInterface, ArrayAccess, \JsonSerializabl * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -95,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 @@ -164,6 +229,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -180,7 +248,18 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['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; } /** @@ -222,12 +301,16 @@ public function getGroups() * * @param \Messente\Api\Model\GroupResponseFields[]|null $groups An array of groups * - * @return self + * @return $this */ public function setGroups($groups) { + if (is_null($groups)) { + throw new \InvalidArgumentException('non-nullable groups cannot be null'); + } + $this->container['groups'] = $groups; return $this; @@ -249,18 +332,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -285,18 +368,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -309,16 +380,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/GroupName.php b/lib/Model/GroupName.php index 5d6f31b..a7b9c41 100644 --- a/lib/Model/GroupName.php +++ b/lib/Model/GroupName.php @@ -2,7 +2,7 @@ /** * GroupName * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class GroupName implements ModelInterface, ArrayAccess, \JsonSerializable +class GroupName implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -68,13 +65,27 @@ class GroupName implements ModelInterface, ArrayAccess, \JsonSerializable * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -95,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 @@ -164,6 +229,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -180,7 +248,18 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['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; } /** @@ -229,7 +308,7 @@ public function getName() * * @param string $name The name of the group * - * @return self + * @return $this */ public function setName($name) { @@ -238,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; @@ -259,18 +344,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -295,18 +380,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -319,16 +392,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/GroupResponseFields.php b/lib/Model/GroupResponseFields.php index 8da8935..1b3781c 100644 --- a/lib/Model/GroupResponseFields.php +++ b/lib/Model/GroupResponseFields.php @@ -2,7 +2,7 @@ /** * GroupResponseFields * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class GroupResponseFields implements ModelInterface, ArrayAccess, \JsonSerializable +class GroupResponseFields implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -71,8 +68,6 @@ class GroupResponseFields implements ModelInterface, ArrayAccess, \JsonSerializa * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'id' => null, @@ -81,6 +76,25 @@ class GroupResponseFields implements ModelInterface, ArrayAccess, \JsonSerializa '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 * @@ -101,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 @@ -179,6 +247,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -195,10 +266,21 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['name'] = $data['name'] ?? null; - $this->container['createdOn'] = $data['createdOn'] ?? null; - $this->container['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; } /** @@ -249,10 +331,16 @@ public function getId() * * @param string $id Id string in UUID format * - * @return self + * @return $this */ public function setId($id) { + + + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; return $this; @@ -273,10 +361,16 @@ public function getName() * * @param string $name The name of the group * - * @return self + * @return $this */ public function setName($name) { + + + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; return $this; @@ -297,10 +391,23 @@ public function getCreatedOn() * * @param string|null $createdOn When the group was created * - * @return self + * @return $this */ 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; @@ -321,10 +428,16 @@ public function getContactsCount() * * @param int $contactsCount The count of contacts in the group * - * @return self + * @return $this */ public function setContactsCount($contactsCount) { + + + if (is_null($contactsCount)) { + throw new \InvalidArgumentException('non-nullable contactsCount cannot be null'); + } + $this->container['contactsCount'] = $contactsCount; return $this; @@ -346,18 +459,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -382,18 +495,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -406,16 +507,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/MessageResult.php b/lib/Model/MessageResult.php index 5955d04..0d70066 100644 --- a/lib/Model/MessageResult.php +++ b/lib/Model/MessageResult.php @@ -2,7 +2,7 @@ /** * MessageResult * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class MessageResult implements ModelInterface, ArrayAccess, \JsonSerializable +class MessageResult implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -70,8 +67,6 @@ class MessageResult implements ModelInterface, ArrayAccess, \JsonSerializable * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'messageId' => 'UUID', @@ -79,6 +74,24 @@ class MessageResult implements ModelInterface, ArrayAccess, \JsonSerializable '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 * @@ -99,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 @@ -174,6 +241,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -190,9 +260,20 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['messageId'] = $data['messageId'] ?? null; - $this->container['channel'] = $data['channel'] ?? null; - $this->container['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; } /** @@ -243,10 +324,16 @@ public function getMessageId() * * @param string $messageId Unique identifier for the message * - * @return self + * @return $this */ public function setMessageId($messageId) { + + + if (is_null($messageId)) { + throw new \InvalidArgumentException('non-nullable messageId cannot be null'); + } + $this->container['messageId'] = $messageId; return $this; @@ -267,10 +354,16 @@ public function getChannel() * * @param \Messente\Api\Model\Channel $channel channel * - * @return self + * @return $this */ public function setChannel($channel) { + + + if (is_null($channel)) { + throw new \InvalidArgumentException('non-nullable channel cannot be null'); + } + $this->container['channel'] = $channel; return $this; @@ -291,10 +384,16 @@ public function getSender() * * @param string $sender Sender that was used for the message * - * @return self + * @return $this */ public function setSender($sender) { + + + if (is_null($sender)) { + throw new \InvalidArgumentException('non-nullable sender cannot be null'); + } + $this->container['sender'] = $sender; return $this; @@ -316,18 +415,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -352,18 +451,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -376,16 +463,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/MobileNetwork.php b/lib/Model/MobileNetwork.php index 8309511..d43e621 100644 --- a/lib/Model/MobileNetwork.php +++ b/lib/Model/MobileNetwork.php @@ -2,7 +2,7 @@ /** * MobileNetwork * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class MobileNetwork implements ModelInterface, ArrayAccess, \JsonSerializable +class MobileNetwork implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -72,8 +69,6 @@ class MobileNetwork implements ModelInterface, ArrayAccess, \JsonSerializable * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'mccmnc' => null, @@ -83,6 +78,26 @@ class MobileNetwork implements ModelInterface, ArrayAccess, \JsonSerializable 'countryCode' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'mccmnc' => false, + 'networkName' => false, + 'countryName' => false, + 'countryPrefix' => false, + 'countryCode' => 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 * @@ -103,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 @@ -184,6 +253,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -200,11 +272,22 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['mccmnc'] = $data['mccmnc'] ?? null; - $this->container['networkName'] = $data['networkName'] ?? null; - $this->container['countryName'] = $data['countryName'] ?? null; - $this->container['countryPrefix'] = $data['countryPrefix'] ?? null; - $this->container['countryCode'] = $data['countryCode'] ?? null; + $this->setIfExists('mccmnc', $data, null); + $this->setIfExists('networkName', $data, null); + $this->setIfExists('countryName', $data, null); + $this->setIfExists('countryPrefix', $data, null); + $this->setIfExists('countryCode', $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; } /** @@ -246,10 +329,16 @@ public function getMccmnc() * * @param string|null $mccmnc Mobile country and mobile network code * - * @return self + * @return $this */ public function setMccmnc($mccmnc) { + + + if (is_null($mccmnc)) { + throw new \InvalidArgumentException('non-nullable mccmnc cannot be null'); + } + $this->container['mccmnc'] = $mccmnc; return $this; @@ -270,10 +359,16 @@ public function getNetworkName() * * @param string|null $networkName Mobile network name * - * @return self + * @return $this */ public function setNetworkName($networkName) { + + + if (is_null($networkName)) { + throw new \InvalidArgumentException('non-nullable networkName cannot be null'); + } + $this->container['networkName'] = $networkName; return $this; @@ -294,10 +389,16 @@ public function getCountryName() * * @param string|null $countryName Country name * - * @return self + * @return $this */ public function setCountryName($countryName) { + + + if (is_null($countryName)) { + throw new \InvalidArgumentException('non-nullable countryName cannot be null'); + } + $this->container['countryName'] = $countryName; return $this; @@ -318,10 +419,16 @@ public function getCountryPrefix() * * @param string|null $countryPrefix Country prefix * - * @return self + * @return $this */ public function setCountryPrefix($countryPrefix) { + + + if (is_null($countryPrefix)) { + throw new \InvalidArgumentException('non-nullable countryPrefix cannot be null'); + } + $this->container['countryPrefix'] = $countryPrefix; return $this; @@ -342,10 +449,16 @@ public function getCountryCode() * * @param string|null $countryCode Country code * - * @return self + * @return $this */ public function setCountryCode($countryCode) { + + + if (is_null($countryCode)) { + throw new \InvalidArgumentException('non-nullable countryCode cannot be null'); + } + $this->container['countryCode'] = $countryCode; return $this; @@ -367,18 +480,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -403,18 +516,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -427,16 +528,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/ModelInterface.php b/lib/Model/ModelInterface.php index 672465c..0256178 100644 --- a/lib/Model/ModelInterface.php +++ b/lib/Model/ModelInterface.php @@ -2,7 +2,7 @@ /** * ModelInterface * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api\Model @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** diff --git a/lib/Model/NumberToBlacklist.php b/lib/Model/NumberToBlacklist.php index 59d996c..59a4407 100644 --- a/lib/Model/NumberToBlacklist.php +++ b/lib/Model/NumberToBlacklist.php @@ -2,7 +2,7 @@ /** * NumberToBlacklist * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class NumberToBlacklist implements ModelInterface, ArrayAccess, \JsonSerializable +class NumberToBlacklist implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -68,13 +65,27 @@ class NumberToBlacklist implements ModelInterface, ArrayAccess, \JsonSerializabl * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -95,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 @@ -164,6 +229,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -180,7 +248,18 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['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; } /** @@ -225,10 +304,16 @@ public function getPhoneNumber() * * @param string $phoneNumber Phone number in e.164 format * - * @return self + * @return $this */ public function setPhoneNumber($phoneNumber) { + + + if (is_null($phoneNumber)) { + throw new \InvalidArgumentException('non-nullable phoneNumber cannot be null'); + } + $this->container['phoneNumber'] = $phoneNumber; return $this; @@ -250,18 +335,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -286,18 +371,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -310,16 +383,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/NumbersToInvestigate.php b/lib/Model/NumbersToInvestigate.php index f3bff0f..054b85d 100644 --- a/lib/Model/NumbersToInvestigate.php +++ b/lib/Model/NumbersToInvestigate.php @@ -2,7 +2,7 @@ /** * NumbersToInvestigate * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class NumbersToInvestigate implements ModelInterface, ArrayAccess, \JsonSerializable +class NumbersToInvestigate implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -68,13 +65,27 @@ class NumbersToInvestigate implements ModelInterface, ArrayAccess, \JsonSerializ * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'numbers' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'numbers' => 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 * @@ -95,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 @@ -164,6 +229,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -180,7 +248,18 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['numbers'] = $data['numbers'] ?? null; + $this->setIfExists('numbers', $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; } /** @@ -195,14 +274,6 @@ public function listInvalidProperties() if ($this->container['numbers'] === null) { $invalidProperties[] = "'numbers' can't be null"; } - if ((count($this->container['numbers']) > 10)) { - $invalidProperties[] = "invalid value for 'numbers', number of items must be less than or equal to 10."; - } - - if ((count($this->container['numbers']) < 1)) { - $invalidProperties[] = "invalid value for 'numbers', number of items must be greater than or equal to 1."; - } - return $invalidProperties; } @@ -231,19 +302,18 @@ public function getNumbers() /** * Sets numbers * - * @param string[] $numbers Array of phone numbers + * @param string[] $numbers A list of phone numbers. Max 10 numbers per request * - * @return self + * @return $this */ public function setNumbers($numbers) { - if ((count($numbers) > 10)) { - throw new \InvalidArgumentException('invalid value for $numbers when calling NumbersToInvestigate., number of items must be less than or equal to 10.'); - } - if ((count($numbers) < 1)) { - throw new \InvalidArgumentException('invalid length for $numbers when calling NumbersToInvestigate., number of items must be greater than or equal to 1.'); + + if (is_null($numbers)) { + throw new \InvalidArgumentException('non-nullable numbers cannot be null'); } + $this->container['numbers'] = $numbers; return $this; @@ -265,18 +335,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -301,18 +371,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -325,16 +383,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/OmniMessageCreateSuccessResponse.php b/lib/Model/OmniMessageCreateSuccessResponse.php index 387711d..c239991 100644 --- a/lib/Model/OmniMessageCreateSuccessResponse.php +++ b/lib/Model/OmniMessageCreateSuccessResponse.php @@ -2,7 +2,7 @@ /** * OmniMessageCreateSuccessResponse * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class OmniMessageCreateSuccessResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class OmniMessageCreateSuccessResponse implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -70,8 +67,6 @@ class OmniMessageCreateSuccessResponse implements ModelInterface, ArrayAccess, \ * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'messages' => null, @@ -79,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 * @@ -99,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 @@ -174,6 +241,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -190,9 +260,20 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['messages'] = $data['messages'] ?? null; - $this->container['to'] = $data['to'] ?? null; - $this->container['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; } /** @@ -243,10 +324,16 @@ public function getMessages() * * @param \Messente\Api\Model\MessageResult[] $messages List of messages that compose the omnimessage * - * @return self + * @return $this */ public function setMessages($messages) { + + + if (is_null($messages)) { + throw new \InvalidArgumentException('non-nullable messages cannot be null'); + } + $this->container['messages'] = $messages; return $this; @@ -267,10 +354,16 @@ public function getTo() * * @param string $to Phone number in e.164 format * - * @return self + * @return $this */ public function setTo($to) { + + + if (is_null($to)) { + throw new \InvalidArgumentException('non-nullable to cannot be null'); + } + $this->container['to'] = $to; return $this; @@ -291,10 +384,16 @@ public function getOmnimessageId() * * @param string $omnimessageId Unique identifier for the omnimessage * - * @return self + * @return $this */ public function setOmnimessageId($omnimessageId) { + + + if (is_null($omnimessageId)) { + throw new \InvalidArgumentException('non-nullable omnimessageId cannot be null'); + } + $this->container['omnimessageId'] = $omnimessageId; return $this; @@ -316,18 +415,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -352,18 +451,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -376,16 +463,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/Omnimessage.php b/lib/Model/Omnimessage.php index f312944..80a2b96 100644 --- a/lib/Model/Omnimessage.php +++ b/lib/Model/Omnimessage.php @@ -2,7 +2,7 @@ /** * Omnimessage * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class Omnimessage implements ModelInterface, ArrayAccess, \JsonSerializable +class Omnimessage implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -73,8 +70,6 @@ class Omnimessage implements ModelInterface, ArrayAccess, \JsonSerializable * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'to' => null, @@ -85,6 +80,27 @@ class Omnimessage implements ModelInterface, ArrayAccess, \JsonSerializable 'priority' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'to' => false, + 'messages' => false, + 'dlrUrl' => false, + 'textStore' => false, + 'timeToSend' => false, + 'priority' => 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 * @@ -105,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 @@ -189,6 +259,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -205,12 +278,23 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['to'] = $data['to'] ?? null; - $this->container['messages'] = $data['messages'] ?? null; - $this->container['dlrUrl'] = $data['dlrUrl'] ?? null; - $this->container['textStore'] = $data['textStore'] ?? null; - $this->container['timeToSend'] = $data['timeToSend'] ?? null; - $this->container['priority'] = $data['priority'] ?? 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); + $this->setIfExists('priority', $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; } /** @@ -258,10 +342,16 @@ public function getTo() * * @param string $to Phone number in e.164 format * - * @return self + * @return $this */ public function setTo($to) { + + + if (is_null($to)) { + throw new \InvalidArgumentException('non-nullable to cannot be null'); + } + $this->container['to'] = $to; return $this; @@ -282,10 +372,16 @@ public function getMessages() * * @param OneOfViberSMSWhatsAppTelegram[] $messages An array of messages * - * @return self + * @return $this */ public function setMessages($messages) { + + + if (is_null($messages)) { + throw new \InvalidArgumentException('non-nullable messages cannot be null'); + } + $this->container['messages'] = $messages; return $this; @@ -306,10 +402,16 @@ public function getDlrUrl() * * @param string|null $dlrUrl URL where the delivery report will be sent * - * @return self + * @return $this */ public function setDlrUrl($dlrUrl) { + + + if (is_null($dlrUrl)) { + throw new \InvalidArgumentException('non-nullable dlrUrl cannot be null'); + } + $this->container['dlrUrl'] = $dlrUrl; return $this; @@ -330,10 +432,16 @@ public function getTextStore() * * @param \Messente\Api\Model\TextStore|null $textStore textStore * - * @return self + * @return $this */ public function setTextStore($textStore) { + + + if (is_null($textStore)) { + throw new \InvalidArgumentException('non-nullable textStore cannot be null'); + } + $this->container['textStore'] = $textStore; return $this; @@ -354,10 +462,16 @@ public function getTimeToSend() * * @param \DateTime|null $timeToSend Optional parameter for sending messages at some specific time in the future. Time must be specified in the ISO-8601 format. If no timezone is specified, then the timezone is assumed to be UTC Examples: * Time specified with timezone: 2018-06-22T09:05:07+00:00 Time specified in UTC: 2018-06-22T09:05:07Z * Time specified without timezone: 2018-06-22T09:05 (equivalent to 2018-06-22T09:05+00:00) * - * @return self + * @return $this */ public function setTimeToSend($timeToSend) { + + + if (is_null($timeToSend)) { + throw new \InvalidArgumentException('non-nullable timeToSend cannot be null'); + } + $this->container['timeToSend'] = $timeToSend; return $this; @@ -378,10 +492,16 @@ public function getPriority() * * @param \Messente\Api\Model\Priority|null $priority priority * - * @return self + * @return $this */ public function setPriority($priority) { + + + if (is_null($priority)) { + throw new \InvalidArgumentException('non-nullable priority cannot be null'); + } + $this->container['priority'] = $priority; return $this; @@ -403,18 +523,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -439,18 +559,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -463,16 +571,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/Priority.php b/lib/Model/Priority.php index 609f6b5..9d2746d 100644 --- a/lib/Model/Priority.php +++ b/lib/Model/Priority.php @@ -2,7 +2,7 @@ /** * Priority * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -45,11 +45,9 @@ class Priority * Possible values of this enum */ const LOW = 'low'; - const REGULAR = 'regular'; - const HIGH = 'high'; - + /** * Gets allowable values of the enum * @return string[] @@ -59,7 +57,7 @@ public static function getAllowableEnumValues() return [ self::LOW, self::REGULAR, - self::HIGH + self::HIGH, ]; } } diff --git a/lib/Model/SMS.php b/lib/Model/SMS.php index 7f3c04d..69317d0 100644 --- a/lib/Model/SMS.php +++ b/lib/Model/SMS.php @@ -2,7 +2,7 @@ /** * SMS * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class SMS implements ModelInterface, ArrayAccess, \JsonSerializable +class SMS implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -73,8 +70,6 @@ class SMS implements ModelInterface, ArrayAccess, \JsonSerializable * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'text' => null, @@ -85,6 +80,27 @@ class SMS implements ModelInterface, ArrayAccess, \JsonSerializable '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 * @@ -105,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 @@ -193,7 +263,9 @@ public function getModelName() const AUTOCONVERT_ON = 'on'; const AUTOCONVERT_OFF = 'off'; const CHANNEL_SMS = 'sms'; + + /** * Gets allowable values of the enum * @@ -207,7 +279,7 @@ public function getAutoconvertAllowableValues() self::AUTOCONVERT_OFF, ]; } - + /** * Gets allowable values of the enum * @@ -219,6 +291,7 @@ public function getChannelAllowableValues() self::CHANNEL_SMS, ]; } + /** * Associative array for storing property values @@ -235,12 +308,23 @@ public function getChannelAllowableValues() */ public function __construct(array $data = null) { - $this->container['text'] = $data['text'] ?? null; - $this->container['sender'] = $data['sender'] ?? null; - $this->container['validity'] = $data['validity'] ?? null; - $this->container['autoconvert'] = $data['autoconvert'] ?? null; - $this->container['udh'] = $data['udh'] ?? null; - $this->container['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; } /** @@ -258,8 +342,7 @@ public function listInvalidProperties() $allowedValues = $this->getAutoconvertAllowableValues(); if (!is_null($this->container['autoconvert']) && !in_array($this->container['autoconvert'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value '%s' for 'autoconvert', must be one of '%s'", - $this->container['autoconvert'], + "invalid value for 'autoconvert', must be one of '%s'", implode("', '", $allowedValues) ); } @@ -267,8 +350,7 @@ public function listInvalidProperties() $allowedValues = $this->getChannelAllowableValues(); if (!is_null($this->container['channel']) && !in_array($this->container['channel'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value '%s' for 'channel', must be one of '%s'", - $this->container['channel'], + "invalid value for 'channel', must be one of '%s'", implode("', '", $allowedValues) ); } @@ -303,10 +385,16 @@ public function getText() * * @param string $text Text content of the SMS * - * @return self + * @return $this */ public function setText($text) { + + + if (is_null($text)) { + throw new \InvalidArgumentException('non-nullable text cannot be null'); + } + $this->container['text'] = $text; return $this; @@ -327,10 +415,16 @@ public function getSender() * * @param string|null $sender Phone number or alphanumeric sender name * - * @return self + * @return $this */ public function setSender($sender) { + + + if (is_null($sender)) { + throw new \InvalidArgumentException('non-nullable sender cannot be null'); + } + $this->container['sender'] = $sender; return $this; @@ -351,10 +445,16 @@ public function getValidity() * * @param int|null $validity After how many minutes this channel is considered as failed and the next channel is attempted * - * @return self + * @return $this */ public function setValidity($validity) { + + + if (is_null($validity)) { + throw new \InvalidArgumentException('non-nullable validity cannot be null'); + } + $this->container['validity'] = $validity; return $this; @@ -375,7 +475,7 @@ public function getAutoconvert() * * @param string|null $autoconvert Defines how non-GSM characters will be treated: - \"on\" Use replacement settings from the account's [API Auto Replace settings page](https://dashboard.messente.com/api-settings/auto-replace) (default) - \"full\" All non GSM 03.38 characters will be replaced with suitable alternatives - \"off\" Message content is not modified in any way * - * @return self + * @return $this */ public function setAutoconvert($autoconvert) { @@ -383,12 +483,17 @@ public function setAutoconvert($autoconvert) if (!is_null($autoconvert) && !in_array($autoconvert, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value '%s' for 'autoconvert', must be one of '%s'", - $autoconvert, + "Invalid value for 'autoconvert', must be one of '%s'", implode("', '", $allowedValues) ) ); } + + + if (is_null($autoconvert)) { + throw new \InvalidArgumentException('non-nullable autoconvert cannot be null'); + } + $this->container['autoconvert'] = $autoconvert; return $this; @@ -409,10 +514,16 @@ public function getUdh() * * @param string|null $udh hex-encoded string containing SMS UDH * - * @return self + * @return $this */ public function setUdh($udh) { + + + if (is_null($udh)) { + throw new \InvalidArgumentException('non-nullable udh cannot be null'); + } + $this->container['udh'] = $udh; return $this; @@ -433,7 +544,7 @@ public function getChannel() * * @param string|null $channel The channel used to deliver the message * - * @return self + * @return $this */ public function setChannel($channel) { @@ -441,12 +552,17 @@ public function setChannel($channel) if (!is_null($channel) && !in_array($channel, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value '%s' for 'channel', must be one of '%s'", - $channel, + "Invalid value for 'channel', must be one of '%s'", implode("', '", $allowedValues) ) ); } + + + if (is_null($channel)) { + throw new \InvalidArgumentException('non-nullable channel cannot be null'); + } + $this->container['channel'] = $channel; return $this; @@ -468,18 +584,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -504,18 +620,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -528,16 +632,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/StatisticsReport.php b/lib/Model/StatisticsReport.php index 3e7d658..53309e5 100644 --- a/lib/Model/StatisticsReport.php +++ b/lib/Model/StatisticsReport.php @@ -2,7 +2,7 @@ /** * StatisticsReport * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class StatisticsReport implements ModelInterface, ArrayAccess, \JsonSerializable +class StatisticsReport implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -70,8 +67,6 @@ class StatisticsReport implements ModelInterface, ArrayAccess, \JsonSerializable * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'totalMessages' => null, @@ -79,6 +74,24 @@ class StatisticsReport implements ModelInterface, ArrayAccess, \JsonSerializable 'country' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'totalMessages' => false, + 'totalPrice' => false, + 'country' => 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 * @@ -99,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 @@ -174,6 +241,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -190,9 +260,20 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['totalMessages'] = $data['totalMessages'] ?? null; - $this->container['totalPrice'] = $data['totalPrice'] ?? null; - $this->container['country'] = $data['country'] ?? null; + $this->setIfExists('totalMessages', $data, null); + $this->setIfExists('totalPrice', $data, null); + $this->setIfExists('country', $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; } /** @@ -243,10 +324,16 @@ public function getTotalMessages() * * @param int $totalMessages Sum of all messages * - * @return self + * @return $this */ public function setTotalMessages($totalMessages) { + + + if (is_null($totalMessages)) { + throw new \InvalidArgumentException('non-nullable totalMessages cannot be null'); + } + $this->container['totalMessages'] = $totalMessages; return $this; @@ -267,10 +354,16 @@ public function getTotalPrice() * * @param string $totalPrice Price for all messages * - * @return self + * @return $this */ public function setTotalPrice($totalPrice) { + + + if (is_null($totalPrice)) { + throw new \InvalidArgumentException('non-nullable totalPrice cannot be null'); + } + $this->container['totalPrice'] = $totalPrice; return $this; @@ -291,10 +384,16 @@ public function getCountry() * * @param string $country Target country of all messages * - * @return self + * @return $this */ public function setCountry($country) { + + + if (is_null($country)) { + throw new \InvalidArgumentException('non-nullable country cannot be null'); + } + $this->container['country'] = $country; return $this; @@ -316,18 +415,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -352,18 +451,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -376,16 +463,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/StatisticsReportSettings.php b/lib/Model/StatisticsReportSettings.php index 74991c1..6ea852e 100644 --- a/lib/Model/StatisticsReportSettings.php +++ b/lib/Model/StatisticsReportSettings.php @@ -2,7 +2,7 @@ /** * StatisticsReportSettings * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class StatisticsReportSettings implements ModelInterface, ArrayAccess, \JsonSerializable +class StatisticsReportSettings implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -70,8 +67,6 @@ class StatisticsReportSettings implements ModelInterface, ArrayAccess, \JsonSeri * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'startDate' => 'date', @@ -79,6 +74,24 @@ class StatisticsReportSettings implements ModelInterface, ArrayAccess, \JsonSeri 'messageTypes' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'startDate' => false, + 'endDate' => false, + 'messageTypes' => 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 * @@ -99,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 @@ -174,6 +241,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -190,9 +260,20 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['startDate'] = $data['startDate'] ?? null; - $this->container['endDate'] = $data['endDate'] ?? null; - $this->container['messageTypes'] = $data['messageTypes'] ?? null; + $this->setIfExists('startDate', $data, null); + $this->setIfExists('endDate', $data, null); + $this->setIfExists('messageTypes', $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; } /** @@ -240,10 +321,16 @@ public function getStartDate() * * @param \DateTime $startDate Start date for the report * - * @return self + * @return $this */ public function setStartDate($startDate) { + + + if (is_null($startDate)) { + throw new \InvalidArgumentException('non-nullable startDate cannot be null'); + } + $this->container['startDate'] = $startDate; return $this; @@ -264,10 +351,16 @@ public function getEndDate() * * @param \DateTime $endDate End date for the report * - * @return self + * @return $this */ public function setEndDate($endDate) { + + + if (is_null($endDate)) { + throw new \InvalidArgumentException('non-nullable endDate cannot be null'); + } + $this->container['endDate'] = $endDate; return $this; @@ -288,10 +381,16 @@ public function getMessageTypes() * * @param string[]|null $messageTypes Optional list of message types (sms, viber, whatsapp, hlr, telegram) * - * @return self + * @return $this */ public function setMessageTypes($messageTypes) { + + + if (is_null($messageTypes)) { + throw new \InvalidArgumentException('non-nullable messageTypes cannot be null'); + } + $this->container['messageTypes'] = $messageTypes; return $this; @@ -313,18 +412,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -349,18 +448,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -373,16 +460,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/StatisticsReportSuccess.php b/lib/Model/StatisticsReportSuccess.php index 0178992..ebbd74f 100644 --- a/lib/Model/StatisticsReportSuccess.php +++ b/lib/Model/StatisticsReportSuccess.php @@ -2,7 +2,7 @@ /** * StatisticsReportSuccess * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class StatisticsReportSuccess implements ModelInterface, ArrayAccess, \JsonSerializable +class StatisticsReportSuccess implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -68,13 +65,27 @@ class StatisticsReportSuccess implements ModelInterface, ArrayAccess, \JsonSeria * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'reports' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'reports' => 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 * @@ -95,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 @@ -164,6 +229,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -180,7 +248,18 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['reports'] = $data['reports'] ?? null; + $this->setIfExists('reports', $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; } /** @@ -225,10 +304,16 @@ public function getReports() * * @param \Messente\Api\Model\StatisticsReport[] $reports Array of report objects * - * @return self + * @return $this */ public function setReports($reports) { + + + if (is_null($reports)) { + throw new \InvalidArgumentException('non-nullable reports cannot be null'); + } + $this->container['reports'] = $reports; return $this; @@ -250,18 +335,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -286,18 +371,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -310,16 +383,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/Status.php b/lib/Model/Status.php index dcfbfeb..854c153 100644 --- a/lib/Model/Status.php +++ b/lib/Model/Status.php @@ -2,7 +2,7 @@ /** * Status * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -45,27 +45,17 @@ class Status * Possible values of this enum */ const ACK = 'ACK'; - const DELIVRD = 'DELIVRD'; - const UNDELIV = 'UNDELIV'; - const FAILED = 'FAILED'; - const UNKNOWN = 'UNKNOWN'; - const ACCEPTD = 'ACCEPTD'; - const REJECTD = 'REJECTD'; - const DELETED = 'DELETED'; - const EXPIRED = 'EXPIRED'; - const NACK = 'NACK'; - const SEEN = 'SEEN'; - + /** * Gets allowable values of the enum * @return string[] @@ -83,7 +73,7 @@ public static function getAllowableEnumValues() self::DELETED, self::EXPIRED, self::NACK, - self::SEEN + self::SEEN, ]; } } diff --git a/lib/Model/SyncNumberLookupResult.php b/lib/Model/SyncNumberLookupResult.php index 15f25c9..9d04da1 100644 --- a/lib/Model/SyncNumberLookupResult.php +++ b/lib/Model/SyncNumberLookupResult.php @@ -2,7 +2,7 @@ /** * SyncNumberLookupResult * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class SyncNumberLookupResult implements ModelInterface, ArrayAccess, \JsonSerializable +class SyncNumberLookupResult implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -69,15 +66,13 @@ class SyncNumberLookupResult implements ModelInterface, ArrayAccess, \JsonSerial 'originalNetwork' => '\Messente\Api\Model\MobileNetwork', 'portedNetwork' => '\Messente\Api\Model\MobileNetwork', 'status' => 'string', - 'error' => 'mixed' + 'error' => 'object' ]; /** * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'number' => null, @@ -91,6 +86,30 @@ class SyncNumberLookupResult implements ModelInterface, ArrayAccess, \JsonSerial 'error' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'number' => false, + 'roaming' => true, + 'ported' => true, + 'roamingNetwork' => true, + 'currentNetwork' => true, + 'originalNetwork' => true, + 'portedNetwork' => true, + 'status' => false, + 'error' => 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 * @@ -111,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 @@ -208,7 +281,9 @@ public function getModelName() const STATUS_OFF = 'OFF'; const STATUS_INVALID = 'INVALID'; const STATUS_UNKNOWN = 'UNKNOWN'; + + /** * Gets allowable values of the enum * @@ -223,6 +298,7 @@ public function getStatusAllowableValues() self::STATUS_UNKNOWN, ]; } + /** * Associative array for storing property values @@ -239,15 +315,26 @@ public function getStatusAllowableValues() */ public function __construct(array $data = null) { - $this->container['number'] = $data['number'] ?? null; - $this->container['roaming'] = $data['roaming'] ?? null; - $this->container['ported'] = $data['ported'] ?? null; - $this->container['roamingNetwork'] = $data['roamingNetwork'] ?? null; - $this->container['currentNetwork'] = $data['currentNetwork'] ?? null; - $this->container['originalNetwork'] = $data['originalNetwork'] ?? null; - $this->container['portedNetwork'] = $data['portedNetwork'] ?? null; - $this->container['status'] = $data['status'] ?? null; - $this->container['error'] = $data['error'] ?? null; + $this->setIfExists('number', $data, null); + $this->setIfExists('roaming', $data, null); + $this->setIfExists('ported', $data, null); + $this->setIfExists('roamingNetwork', $data, null); + $this->setIfExists('currentNetwork', $data, null); + $this->setIfExists('originalNetwork', $data, null); + $this->setIfExists('portedNetwork', $data, null); + $this->setIfExists('status', $data, null); + $this->setIfExists('error', $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; } /** @@ -265,8 +352,7 @@ public function listInvalidProperties() $allowedValues = $this->getStatusAllowableValues(); if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value '%s' for 'status', must be one of '%s'", - $this->container['status'], + "invalid value for 'status', must be one of '%s'", implode("', '", $allowedValues) ); } @@ -301,10 +387,16 @@ public function getNumber() * * @param string $number Phone number in e.164 format * - * @return self + * @return $this */ public function setNumber($number) { + + + if (is_null($number)) { + throw new \InvalidArgumentException('non-nullable number cannot be null'); + } + $this->container['number'] = $number; return $this; @@ -325,10 +417,23 @@ public function getRoaming() * * @param bool|null $roaming Indicates if a number is roaming * - * @return self + * @return $this */ public function setRoaming($roaming) { + + if (is_null($roaming)) { + array_push($this->openAPINullablesSetToNull, 'roaming'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('roaming', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['roaming'] = $roaming; return $this; @@ -349,10 +454,23 @@ public function getPorted() * * @param bool|null $ported Indicates if a number is ported * - * @return self + * @return $this */ public function setPorted($ported) { + + if (is_null($ported)) { + array_push($this->openAPINullablesSetToNull, 'ported'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('ported', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['ported'] = $ported; return $this; @@ -373,10 +491,23 @@ public function getRoamingNetwork() * * @param \Messente\Api\Model\MobileNetwork|null $roamingNetwork roamingNetwork * - * @return self + * @return $this */ public function setRoamingNetwork($roamingNetwork) { + + if (is_null($roamingNetwork)) { + array_push($this->openAPINullablesSetToNull, 'roamingNetwork'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('roamingNetwork', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['roamingNetwork'] = $roamingNetwork; return $this; @@ -397,10 +528,23 @@ public function getCurrentNetwork() * * @param \Messente\Api\Model\MobileNetwork|null $currentNetwork currentNetwork * - * @return self + * @return $this */ public function setCurrentNetwork($currentNetwork) { + + if (is_null($currentNetwork)) { + array_push($this->openAPINullablesSetToNull, 'currentNetwork'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('currentNetwork', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['currentNetwork'] = $currentNetwork; return $this; @@ -421,10 +565,23 @@ public function getOriginalNetwork() * * @param \Messente\Api\Model\MobileNetwork|null $originalNetwork originalNetwork * - * @return self + * @return $this */ public function setOriginalNetwork($originalNetwork) { + + if (is_null($originalNetwork)) { + array_push($this->openAPINullablesSetToNull, 'originalNetwork'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('originalNetwork', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['originalNetwork'] = $originalNetwork; return $this; @@ -445,10 +602,23 @@ public function getPortedNetwork() * * @param \Messente\Api\Model\MobileNetwork|null $portedNetwork portedNetwork * - * @return self + * @return $this */ public function setPortedNetwork($portedNetwork) { + + if (is_null($portedNetwork)) { + array_push($this->openAPINullablesSetToNull, 'portedNetwork'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('portedNetwork', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['portedNetwork'] = $portedNetwork; return $this; @@ -469,7 +639,7 @@ public function getStatus() * * @param string|null $status Status of the phone number * - * @return self + * @return $this */ public function setStatus($status) { @@ -477,12 +647,17 @@ public function setStatus($status) if (!is_null($status) && !in_array($status, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value '%s' for 'status', must be one of '%s'", - $status, + "Invalid value for 'status', must be one of '%s'", implode("', '", $allowedValues) ) ); } + + + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; return $this; @@ -491,7 +666,7 @@ public function setStatus($status) /** * Gets error * - * @return mixed|null + * @return object|null */ public function getError() { @@ -501,12 +676,18 @@ public function getError() /** * Sets error * - * @param mixed|null $error Indicates if any error occurred while handling the request + * @param object|null $error Indicates if any error occurred while handling the request * - * @return self + * @return $this */ public function setError($error) { + + + if (is_null($error)) { + throw new \InvalidArgumentException('non-nullable error cannot be null'); + } + $this->container['error'] = $error; return $this; @@ -528,18 +709,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -564,18 +745,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -588,16 +757,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/SyncNumberLookupSuccess.php b/lib/Model/SyncNumberLookupSuccess.php index c00b889..f6b90bc 100644 --- a/lib/Model/SyncNumberLookupSuccess.php +++ b/lib/Model/SyncNumberLookupSuccess.php @@ -2,7 +2,7 @@ /** * SyncNumberLookupSuccess * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class SyncNumberLookupSuccess implements ModelInterface, ArrayAccess, \JsonSerializable +class SyncNumberLookupSuccess implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -69,14 +66,29 @@ class SyncNumberLookupSuccess implements ModelInterface, ArrayAccess, \JsonSeria * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'requestId' => null, 'result' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'requestId' => false, + 'result' => 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 * @@ -97,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 @@ -169,6 +235,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -185,8 +254,19 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['requestId'] = $data['requestId'] ?? null; - $this->container['result'] = $data['result'] ?? null; + $this->setIfExists('requestId', $data, null); + $this->setIfExists('result', $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; } /** @@ -234,10 +314,16 @@ public function getRequestId() * * @param string $requestId ID of the request * - * @return self + * @return $this */ public function setRequestId($requestId) { + + + if (is_null($requestId)) { + throw new \InvalidArgumentException('non-nullable requestId cannot be null'); + } + $this->container['requestId'] = $requestId; return $this; @@ -258,10 +344,16 @@ public function getResult() * * @param \Messente\Api\Model\SyncNumberLookupResult[] $result A container for phone number info objects * - * @return self + * @return $this */ public function setResult($result) { + + + if (is_null($result)) { + throw new \InvalidArgumentException('non-nullable result cannot be null'); + } + $this->container['result'] = $result; return $this; @@ -283,18 +375,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -319,18 +411,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -343,16 +423,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/Telegram.php b/lib/Model/Telegram.php index f033906..47fee59 100644 --- a/lib/Model/Telegram.php +++ b/lib/Model/Telegram.php @@ -2,7 +2,7 @@ /** * Telegram * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class Telegram implements ModelInterface, ArrayAccess, \JsonSerializable +class Telegram implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -74,8 +71,6 @@ class Telegram implements ModelInterface, ArrayAccess, \JsonSerializable * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'sender' => null, @@ -87,6 +82,28 @@ class Telegram implements ModelInterface, ArrayAccess, \JsonSerializable 'channel' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'sender' => false, + 'validity' => false, + 'text' => false, + 'imageUrl' => false, + 'documentUrl' => false, + 'audioUrl' => 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 * @@ -107,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 @@ -195,7 +266,9 @@ public function getModelName() } const CHANNEL_TELEGRAM = 'telegram'; + + /** * Gets allowable values of the enum * @@ -207,6 +280,7 @@ public function getChannelAllowableValues() self::CHANNEL_TELEGRAM, ]; } + /** * Associative array for storing property values @@ -223,13 +297,24 @@ public function getChannelAllowableValues() */ public function __construct(array $data = null) { - $this->container['sender'] = $data['sender'] ?? null; - $this->container['validity'] = $data['validity'] ?? null; - $this->container['text'] = $data['text'] ?? null; - $this->container['imageUrl'] = $data['imageUrl'] ?? null; - $this->container['documentUrl'] = $data['documentUrl'] ?? null; - $this->container['audioUrl'] = $data['audioUrl'] ?? null; - $this->container['channel'] = $data['channel'] ?? 'telegram'; + $this->setIfExists('sender', $data, null); + $this->setIfExists('validity', $data, null); + $this->setIfExists('text', $data, null); + $this->setIfExists('imageUrl', $data, null); + $this->setIfExists('documentUrl', $data, null); + $this->setIfExists('audioUrl', $data, null); + $this->setIfExists('channel', $data, 'telegram'); + } + + 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; } /** @@ -244,8 +329,7 @@ public function listInvalidProperties() $allowedValues = $this->getChannelAllowableValues(); if (!is_null($this->container['channel']) && !in_array($this->container['channel'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value '%s' for 'channel', must be one of '%s'", - $this->container['channel'], + "invalid value for 'channel', must be one of '%s'", implode("', '", $allowedValues) ); } @@ -280,10 +364,16 @@ public function getSender() * * @param string|null $sender Phone number or alphanumeric sender name * - * @return self + * @return $this */ public function setSender($sender) { + + + if (is_null($sender)) { + throw new \InvalidArgumentException('non-nullable sender cannot be null'); + } + $this->container['sender'] = $sender; return $this; @@ -304,10 +394,16 @@ public function getValidity() * * @param int|null $validity After how many minutes this channel is considered as failed and the next channel is attempted * - * @return self + * @return $this */ public function setValidity($validity) { + + + if (is_null($validity)) { + throw new \InvalidArgumentException('non-nullable validity cannot be null'); + } + $this->container['validity'] = $validity; return $this; @@ -328,10 +424,16 @@ public function getText() * * @param string|null $text Plaintext content for Telegram * - * @return self + * @return $this */ public function setText($text) { + + + if (is_null($text)) { + throw new \InvalidArgumentException('non-nullable text cannot be null'); + } + $this->container['text'] = $text; return $this; @@ -352,10 +454,16 @@ public function getImageUrl() * * @param string|null $imageUrl URL for the embedded image. Mutually exclusive with \"document_url\" and \"audio_url\" * - * @return self + * @return $this */ public function setImageUrl($imageUrl) { + + + if (is_null($imageUrl)) { + throw new \InvalidArgumentException('non-nullable imageUrl cannot be null'); + } + $this->container['imageUrl'] = $imageUrl; return $this; @@ -376,10 +484,16 @@ public function getDocumentUrl() * * @param string|null $documentUrl URL for the embedded image. Mutually exclusive with \"audio_url\" and \"image_url\" * - * @return self + * @return $this */ public function setDocumentUrl($documentUrl) { + + + if (is_null($documentUrl)) { + throw new \InvalidArgumentException('non-nullable documentUrl cannot be null'); + } + $this->container['documentUrl'] = $documentUrl; return $this; @@ -400,10 +514,16 @@ public function getAudioUrl() * * @param string|null $audioUrl URL for the embedded image. Mutually exclusive with \"document_url\" and \"image_url\" * - * @return self + * @return $this */ public function setAudioUrl($audioUrl) { + + + if (is_null($audioUrl)) { + throw new \InvalidArgumentException('non-nullable audioUrl cannot be null'); + } + $this->container['audioUrl'] = $audioUrl; return $this; @@ -424,7 +544,7 @@ public function getChannel() * * @param string|null $channel The channel used to deliver the message * - * @return self + * @return $this */ public function setChannel($channel) { @@ -432,12 +552,17 @@ public function setChannel($channel) if (!is_null($channel) && !in_array($channel, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value '%s' for 'channel', must be one of '%s'", - $channel, + "Invalid value for 'channel', must be one of '%s'", implode("', '", $allowedValues) ) ); } + + + if (is_null($channel)) { + throw new \InvalidArgumentException('non-nullable channel cannot be null'); + } + $this->container['channel'] = $channel; return $this; @@ -459,18 +584,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -495,18 +620,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -519,16 +632,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/TextStore.php b/lib/Model/TextStore.php index e06dd53..dfd65c8 100644 --- a/lib/Model/TextStore.php +++ b/lib/Model/TextStore.php @@ -2,7 +2,7 @@ /** * TextStore * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -45,11 +45,9 @@ class TextStore * Possible values of this enum */ const NOSTORE = 'nostore'; - const PLAINTEXT = 'plaintext'; - const SHA256 = 'sha256'; - + /** * Gets allowable values of the enum * @return string[] @@ -59,7 +57,7 @@ public static function getAllowableEnumValues() return [ self::NOSTORE, self::PLAINTEXT, - self::SHA256 + self::SHA256, ]; } } diff --git a/lib/Model/Viber.php b/lib/Model/Viber.php index e4ac2d9..d61af74 100644 --- a/lib/Model/Viber.php +++ b/lib/Model/Viber.php @@ -2,7 +2,7 @@ /** * Viber * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class Viber implements ModelInterface, ArrayAccess, \JsonSerializable +class Viber implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -74,8 +71,6 @@ class Viber implements ModelInterface, ArrayAccess, \JsonSerializable * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'sender' => null, @@ -87,6 +82,28 @@ class Viber implements ModelInterface, ArrayAccess, \JsonSerializable '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 * @@ -107,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 @@ -195,7 +266,9 @@ public function getModelName() } const CHANNEL_VIBER = 'viber'; + + /** * Gets allowable values of the enum * @@ -207,6 +280,7 @@ public function getChannelAllowableValues() self::CHANNEL_VIBER, ]; } + /** * Associative array for storing property values @@ -223,13 +297,24 @@ public function getChannelAllowableValues() */ public function __construct(array $data = null) { - $this->container['sender'] = $data['sender'] ?? null; - $this->container['validity'] = $data['validity'] ?? null; - $this->container['text'] = $data['text'] ?? null; - $this->container['imageUrl'] = $data['imageUrl'] ?? null; - $this->container['buttonUrl'] = $data['buttonUrl'] ?? null; - $this->container['buttonText'] = $data['buttonText'] ?? null; - $this->container['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; } /** @@ -244,8 +329,7 @@ public function listInvalidProperties() $allowedValues = $this->getChannelAllowableValues(); if (!is_null($this->container['channel']) && !in_array($this->container['channel'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value '%s' for 'channel', must be one of '%s'", - $this->container['channel'], + "invalid value for 'channel', must be one of '%s'", implode("', '", $allowedValues) ); } @@ -280,10 +364,16 @@ public function getSender() * * @param string|null $sender Phone number or alphanumeric sender name * - * @return self + * @return $this */ public function setSender($sender) { + + + if (is_null($sender)) { + throw new \InvalidArgumentException('non-nullable sender cannot be null'); + } + $this->container['sender'] = $sender; return $this; @@ -304,10 +394,16 @@ public function getValidity() * * @param int|null $validity After how many minutes this channel is considered as failed and the next channel is attempted * - * @return self + * @return $this */ public function setValidity($validity) { + + + if (is_null($validity)) { + throw new \InvalidArgumentException('non-nullable validity cannot be null'); + } + $this->container['validity'] = $validity; return $this; @@ -328,10 +424,16 @@ public function getText() * * @param string|null $text Plaintext content for Viber * - * @return self + * @return $this */ public function setText($text) { + + + if (is_null($text)) { + throw new \InvalidArgumentException('non-nullable text cannot be null'); + } + $this->container['text'] = $text; return $this; @@ -352,10 +454,16 @@ public function getImageUrl() * * @param string|null $imageUrl URL for the embedded image Valid combinations: 1) image_url, 2) text, image_url, button_url, button_text * - * @return self + * @return $this */ public function setImageUrl($imageUrl) { + + + if (is_null($imageUrl)) { + throw new \InvalidArgumentException('non-nullable imageUrl cannot be null'); + } + $this->container['imageUrl'] = $imageUrl; return $this; @@ -376,10 +484,16 @@ public function getButtonUrl() * * @param string|null $buttonUrl URL of the button, must be specified along with ''text'', ''button_text'' and ''image_url'' (optional) * - * @return self + * @return $this */ public function setButtonUrl($buttonUrl) { + + + if (is_null($buttonUrl)) { + throw new \InvalidArgumentException('non-nullable buttonUrl cannot be null'); + } + $this->container['buttonUrl'] = $buttonUrl; return $this; @@ -400,10 +514,16 @@ public function getButtonText() * * @param string|null $buttonText Must be specified along with ''text'', ''button_url'', ''button_text'', ''image_url'' (optional) * - * @return self + * @return $this */ public function setButtonText($buttonText) { + + + if (is_null($buttonText)) { + throw new \InvalidArgumentException('non-nullable buttonText cannot be null'); + } + $this->container['buttonText'] = $buttonText; return $this; @@ -424,7 +544,7 @@ public function getChannel() * * @param string|null $channel The channel used to deliver the message * - * @return self + * @return $this */ public function setChannel($channel) { @@ -432,12 +552,17 @@ public function setChannel($channel) if (!is_null($channel) && !in_array($channel, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value '%s' for 'channel', must be one of '%s'", - $channel, + "Invalid value for 'channel', must be one of '%s'", implode("', '", $allowedValues) ) ); } + + + if (is_null($channel)) { + throw new \InvalidArgumentException('non-nullable channel cannot be null'); + } + $this->container['channel'] = $channel; return $this; @@ -459,18 +584,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -495,18 +620,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -519,16 +632,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/WhatsApp.php b/lib/Model/WhatsApp.php index aa14c56..35a2745 100644 --- a/lib/Model/WhatsApp.php +++ b/lib/Model/WhatsApp.php @@ -2,7 +2,7 @@ /** * WhatsApp * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class WhatsApp implements ModelInterface, ArrayAccess, \JsonSerializable +class WhatsApp implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -74,8 +71,6 @@ class WhatsApp implements ModelInterface, ArrayAccess, \JsonSerializable * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'sender' => null, @@ -87,6 +82,28 @@ class WhatsApp implements ModelInterface, ArrayAccess, \JsonSerializable '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 * @@ -107,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 @@ -195,7 +266,9 @@ public function getModelName() } const CHANNEL_WHATSAPP = 'whatsapp'; + + /** * Gets allowable values of the enum * @@ -207,6 +280,7 @@ public function getChannelAllowableValues() self::CHANNEL_WHATSAPP, ]; } + /** * Associative array for storing property values @@ -223,13 +297,24 @@ public function getChannelAllowableValues() */ public function __construct(array $data = null) { - $this->container['sender'] = $data['sender'] ?? null; - $this->container['validity'] = $data['validity'] ?? null; - $this->container['text'] = $data['text'] ?? null; - $this->container['image'] = $data['image'] ?? null; - $this->container['document'] = $data['document'] ?? null; - $this->container['audio'] = $data['audio'] ?? null; - $this->container['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; } /** @@ -244,8 +329,7 @@ public function listInvalidProperties() $allowedValues = $this->getChannelAllowableValues(); if (!is_null($this->container['channel']) && !in_array($this->container['channel'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value '%s' for 'channel', must be one of '%s'", - $this->container['channel'], + "invalid value for 'channel', must be one of '%s'", implode("', '", $allowedValues) ); } @@ -280,10 +364,16 @@ public function getSender() * * @param string|null $sender Phone number or alphanumeric sender name * - * @return self + * @return $this */ public function setSender($sender) { + + + if (is_null($sender)) { + throw new \InvalidArgumentException('non-nullable sender cannot be null'); + } + $this->container['sender'] = $sender; return $this; @@ -304,10 +394,16 @@ public function getValidity() * * @param int|null $validity After how many minutes this channel is considered as failed and the next channel is attempted * - * @return self + * @return $this */ public function setValidity($validity) { + + + if (is_null($validity)) { + throw new \InvalidArgumentException('non-nullable validity cannot be null'); + } + $this->container['validity'] = $validity; return $this; @@ -328,10 +424,16 @@ public function getText() * * @param \Messente\Api\Model\WhatsAppText|null $text text * - * @return self + * @return $this */ public function setText($text) { + + + if (is_null($text)) { + throw new \InvalidArgumentException('non-nullable text cannot be null'); + } + $this->container['text'] = $text; return $this; @@ -352,10 +454,16 @@ public function getImage() * * @param \Messente\Api\Model\WhatsAppImage|null $image image * - * @return self + * @return $this */ public function setImage($image) { + + + if (is_null($image)) { + throw new \InvalidArgumentException('non-nullable image cannot be null'); + } + $this->container['image'] = $image; return $this; @@ -376,10 +484,16 @@ public function getDocument() * * @param \Messente\Api\Model\WhatsAppDocument|null $document document * - * @return self + * @return $this */ public function setDocument($document) { + + + if (is_null($document)) { + throw new \InvalidArgumentException('non-nullable document cannot be null'); + } + $this->container['document'] = $document; return $this; @@ -400,10 +514,16 @@ public function getAudio() * * @param \Messente\Api\Model\WhatsAppAudio|null $audio audio * - * @return self + * @return $this */ public function setAudio($audio) { + + + if (is_null($audio)) { + throw new \InvalidArgumentException('non-nullable audio cannot be null'); + } + $this->container['audio'] = $audio; return $this; @@ -424,7 +544,7 @@ public function getChannel() * * @param string|null $channel The channel used to deliver the message * - * @return self + * @return $this */ public function setChannel($channel) { @@ -432,12 +552,17 @@ public function setChannel($channel) if (!is_null($channel) && !in_array($channel, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value '%s' for 'channel', must be one of '%s'", - $channel, + "Invalid value for 'channel', must be one of '%s'", implode("', '", $allowedValues) ) ); } + + + if (is_null($channel)) { + throw new \InvalidArgumentException('non-nullable channel cannot be null'); + } + $this->container['channel'] = $channel; return $this; @@ -459,18 +584,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -495,18 +620,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -519,16 +632,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/WhatsAppAudio.php b/lib/Model/WhatsAppAudio.php index eb67bc9..c10aa8d 100644 --- a/lib/Model/WhatsAppAudio.php +++ b/lib/Model/WhatsAppAudio.php @@ -2,7 +2,7 @@ /** * WhatsAppAudio * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class WhatsAppAudio implements ModelInterface, ArrayAccess, \JsonSerializable +class WhatsAppAudio implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -68,13 +65,27 @@ class WhatsAppAudio implements ModelInterface, ArrayAccess, \JsonSerializable * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -95,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 @@ -164,6 +229,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -180,7 +248,18 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['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; } /** @@ -225,10 +304,16 @@ public function getContent() * * @param string $content Base64-encoded audio * - * @return self + * @return $this */ public function setContent($content) { + + + if (is_null($content)) { + throw new \InvalidArgumentException('non-nullable content cannot be null'); + } + $this->container['content'] = $content; return $this; @@ -250,18 +335,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -286,18 +371,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -310,16 +383,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/WhatsAppDocument.php b/lib/Model/WhatsAppDocument.php index fe15f48..13f8279 100644 --- a/lib/Model/WhatsAppDocument.php +++ b/lib/Model/WhatsAppDocument.php @@ -2,7 +2,7 @@ /** * WhatsAppDocument * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class WhatsAppDocument implements ModelInterface, ArrayAccess, \JsonSerializable +class WhatsAppDocument implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -69,14 +66,29 @@ class WhatsAppDocument implements ModelInterface, ArrayAccess, \JsonSerializable * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'caption' => null, '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 * @@ -97,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 @@ -169,6 +235,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -185,8 +254,19 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['caption'] = $data['caption'] ?? null; - $this->container['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; } /** @@ -231,10 +311,16 @@ public function getCaption() * * @param string|null $caption Description for the document * - * @return self + * @return $this */ public function setCaption($caption) { + + + if (is_null($caption)) { + throw new \InvalidArgumentException('non-nullable caption cannot be null'); + } + $this->container['caption'] = $caption; return $this; @@ -255,10 +341,16 @@ public function getContent() * * @param string $content Base64-encoded image * - * @return self + * @return $this */ public function setContent($content) { + + + if (is_null($content)) { + throw new \InvalidArgumentException('non-nullable content cannot be null'); + } + $this->container['content'] = $content; return $this; @@ -280,18 +372,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -316,18 +408,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -340,16 +420,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/WhatsAppImage.php b/lib/Model/WhatsAppImage.php index 3e6545b..8a2f952 100644 --- a/lib/Model/WhatsAppImage.php +++ b/lib/Model/WhatsAppImage.php @@ -2,7 +2,7 @@ /** * WhatsAppImage * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class WhatsAppImage implements ModelInterface, ArrayAccess, \JsonSerializable +class WhatsAppImage implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -69,14 +66,29 @@ class WhatsAppImage implements ModelInterface, ArrayAccess, \JsonSerializable * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'caption' => null, '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 * @@ -97,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 @@ -169,6 +235,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -185,8 +254,19 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['caption'] = $data['caption'] ?? null; - $this->container['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; } /** @@ -231,10 +311,16 @@ public function getCaption() * * @param string|null $caption Description for the image * - * @return self + * @return $this */ public function setCaption($caption) { + + + if (is_null($caption)) { + throw new \InvalidArgumentException('non-nullable caption cannot be null'); + } + $this->container['caption'] = $caption; return $this; @@ -255,10 +341,16 @@ public function getContent() * * @param string $content Base64-encoded image * - * @return self + * @return $this */ public function setContent($content) { + + + if (is_null($content)) { + throw new \InvalidArgumentException('non-nullable content cannot be null'); + } + $this->container['content'] = $content; return $this; @@ -280,18 +372,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -316,18 +408,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -340,16 +420,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/WhatsAppText.php b/lib/Model/WhatsAppText.php index c3f257b..6b40520 100644 --- a/lib/Model/WhatsAppText.php +++ b/lib/Model/WhatsAppText.php @@ -2,7 +2,7 @@ /** * WhatsAppText * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class WhatsAppText implements ModelInterface, ArrayAccess, \JsonSerializable +class WhatsAppText implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -69,14 +66,29 @@ class WhatsAppText implements ModelInterface, ArrayAccess, \JsonSerializable * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'previewUrl' => null, '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 * @@ -97,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 @@ -169,6 +235,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -185,8 +254,19 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['previewUrl'] = $data['previewUrl'] ?? true; - $this->container['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; } /** @@ -231,10 +311,16 @@ public function getPreviewUrl() * * @param bool|null $previewUrl Whether to display link preview if the message contains a hyperlink * - * @return self + * @return $this */ public function setPreviewUrl($previewUrl) { + + + if (is_null($previewUrl)) { + throw new \InvalidArgumentException('non-nullable previewUrl cannot be null'); + } + $this->container['previewUrl'] = $previewUrl; return $this; @@ -255,10 +341,16 @@ public function getBody() * * @param string $body Plaintext content for WhatsApp, can contain URLs, emojis and formatting * - * @return self + * @return $this */ public function setBody($body) { + + + if (is_null($body)) { + throw new \InvalidArgumentException('non-nullable body cannot be null'); + } + $this->container['body'] = $body; return $this; @@ -280,18 +372,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -316,18 +408,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -340,16 +420,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/ObjectSerializer.php b/lib/ObjectSerializer.php index 2a1510f..1a17780 100644 --- a/lib/ObjectSerializer.php +++ b/lib/ObjectSerializer.php @@ -2,7 +2,7 @@ /** * ObjectSerializer * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -41,19 +41,6 @@ */ class ObjectSerializer { - /** @var string */ - private static $dateTimeFormat = \DateTime::ATOM; - - /** - * Change the date format - * - * @param string $format the new date format to use - */ - public static function setDateTimeFormat($format) - { - self::$dateTimeFormat = $format; - } - /** * Serialize data * @@ -61,44 +48,34 @@ public static function setDateTimeFormat($format) * @param string $type the OpenAPIToolsType of the data * @param string $format the format of the OpenAPITools type of the data * - * @return scalar|object|array|null serialized form of $data + * @return string|object serialized form of $data */ public static function sanitizeForSerialization($data, $type = null, $format = null) { if (is_scalar($data) || null === $data) { return $data; - } - - if ($data instanceof \DateTime) { - return ($format === 'date') ? $data->format('Y-m-d') : $data->format(self::$dateTimeFormat); - } - - if (is_array($data)) { + } elseif ($data instanceof \DateTime) { + return ($format === 'date') ? $data->format('Y-m-d') : $data->format(\DateTime::ATOM); + } elseif (is_array($data)) { foreach ($data as $property => $value) { $data[$property] = self::sanitizeForSerialization($value); } return $data; - } - - if (is_object($data)) { + } elseif (is_object($data)) { $values = []; if ($data instanceof ModelInterface) { $formats = $data::openAPIFormats(); foreach ($data::openAPITypes() as $property => $openAPIType) { $getter = $data::getters()[$property]; $value = $data->$getter(); - if ($value !== null && !in_array($openAPIType, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { - $callable = [$openAPIType, 'getAllowableEnumValues']; - if (is_callable($callable)) { - /** array $callable */ - $allowedEnumTypes = $callable(); - if (!in_array($value, $allowedEnumTypes, true)) { - $imploded = implode("', '", $allowedEnumTypes); - throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); - } - } + if ($value !== null + && !in_array($openAPIType, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true) + && method_exists($openAPIType, 'getAllowableEnumValues') + && !in_array($value, $openAPIType::getAllowableEnumValues(), true)) { + $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]); } } @@ -173,11 +150,6 @@ public static function toQueryValue($object) */ public static function toHeaderValue($value) { - $callable = [$value, 'toHeaderValue']; - if (is_callable($callable)) { - return $callable(); - } - return self::toString($value); } @@ -212,8 +184,8 @@ public static function toFormValue($value) public static function toString($value) { if ($value instanceof \DateTime) { // datetime in ISO8601 format - return $value->format(self::$dateTimeFormat); - } elseif (is_bool($value)) { + return $value->format(\DateTime::ATOM); + } else if (is_bool($value)) { return $value ? 'true' : 'false'; } else { return $value; @@ -224,32 +196,29 @@ public static function toString($value) * Serialize an array to a string. * * @param array $collection collection to serialize to a string - * @param string $style the format use for serialization (csv, + * @param string $collectionFormat the format use for serialization (csv, * ssv, tsv, pipes, multi) * @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array * * @return string */ - public static function serializeCollection(array $collection, $style, $allowCollectionFormatMulti = false) + public static function serializeCollection(array $collection, $collectionFormat, $allowCollectionFormatMulti = false) { - if ($allowCollectionFormatMulti && ('multi' === $style)) { + if ($allowCollectionFormatMulti && ('multi' === $collectionFormat)) { // http_build_query() almost does the job for us. We just // need to fix the result of multidimensional arrays. return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&')); } - switch ($style) { - case 'pipeDelimited': + switch ($collectionFormat) { case 'pipes': return implode('|', $collection); case 'tsv': return implode("\t", $collection); - case 'spaceDelimited': case 'ssv': return implode(' ', $collection); - case 'simple': case 'csv': // Deliberate fall through. CSV is default format. default: @@ -271,24 +240,7 @@ public static function deserialize($data, $class, $httpHeaders = null) { if (null === $data) { return null; - } - - if (strcasecmp(substr($class, -2), '[]') === 0) { - $data = is_string($data) ? json_decode($data) : $data; - - if (!is_array($data)) { - throw new \InvalidArgumentException("Invalid array '$class'"); - } - - $subClass = substr($class, 0, -2); - $values = []; - foreach ($data as $key => $value) { - $values[] = self::deserialize($value, $subClass, null); - } - return $values; - } - - if (preg_match('/^(array<|map\[)/', $class)) { // for associative array e.g. array + } elseif (substr($class, 0, 4) === 'map[') { // for associative array e.g. map[string,int] $data = is_string($data) ? json_decode($data) : $data; settype($data, 'array'); $inner = substr($class, 4, -1); @@ -301,17 +253,18 @@ public static function deserialize($data, $class, $httpHeaders = null) } } return $deserialized; - } - - if ($class === 'object') { + } elseif (strcasecmp(substr($class, -2), '[]') === 0) { + $data = is_string($data) ? json_decode($data) : $data; + $subClass = substr($class, 0, -2); + $values = []; + foreach ($data as $key => $value) { + $values[] = self::deserialize($value, $subClass, null); + } + return $values; + } elseif ($class === 'object') { settype($data, 'array'); return $data; - } else if ($class === 'mixed') { - settype($data, gettype($data)); - return $data; - } - - if ($class === '\DateTime') { + } elseif ($class === '\DateTime') { // Some API's return an invalid, empty string as a // date-time property. DateTime::__construct() will return // the current time for empty input which is probably not @@ -319,27 +272,14 @@ public static function deserialize($data, $class, $httpHeaders = null) // be interpreted as a missing field/value. Let's handle // this graceful. if (!empty($data)) { - try { - return new \DateTime($data); - } catch (\Exception $exception) { - // Some API's return a date-time with too high nanosecond - // precision for php's DateTime to handle. This conversion - // (string -> unix timestamp -> DateTime) is a workaround - // for the problem. - return (new \DateTime())->setTimestamp(strtotime($data)); - } + return new \DateTime($data); } else { return null; } - } - - /** @psalm-suppress ParadoxicalCondition */ - if (in_array($class, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + } elseif (in_array($class, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { settype($data, $class); return $data; - } - - if ($class === '\SplFileObject') { + } elseif ($class === '\SplFileObject') { /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name @@ -373,18 +313,21 @@ public static function deserialize($data, $class, $httpHeaders = null) $class = $subclass; } } - - /** @var ModelInterface $instance */ $instance = new $class(); 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; } - if (isset($data->{$instance::attributeMap()[$property]})) { - $propertyValue = $data->{$instance::attributeMap()[$property]}; + $propertyValue = $data->{$instance::attributeMap()[$property]}; + if (isset($propertyValue)) { $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); } } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 485899a..3dd90bb 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,18 +1,23 @@ - - - - ./lib/Api - ./lib/Model - - - - - ./test/Api - ./test/Model - - - - - + + + + ./test/Api + ./test/Model + + + + + ./lib/Api + ./lib/Model + + + + + diff --git a/test/Api/BlacklistApiTest.php b/test/Api/BlacklistApiTest.php deleted file mode 100644 index 4a9cd00..0000000 --- a/test/Api/BlacklistApiTest.php +++ /dev/null @@ -1,122 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test case for deleteFromBlacklist - * - * Deletes a phone number from the blacklist. - * - */ - public function testDeleteFromBlacklist() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for fetchBlacklist - * - * Returns all blacklisted phone numbers. - * - */ - public function testFetchBlacklist() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for isBlacklisted - * - * Checks if a phone number is blacklisted. - * - */ - public function testIsBlacklisted() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Api/ContactsApiTest.php b/test/Api/ContactsApiTest.php deleted file mode 100644 index 7cbcd7e..0000000 --- a/test/Api/ContactsApiTest.php +++ /dev/null @@ -1,170 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test case for createContact - * - * Creates a new contact. - * - */ - public function testCreateContact() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for deleteContact - * - * Deletes a contact. - * - */ - public function testDeleteContact() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for fetchContact - * - * Lists a contact. - * - */ - public function testFetchContact() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for fetchContactGroups - * - * Lists groups of a contact. - * - */ - public function testFetchContactGroups() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for fetchContacts - * - * Returns all contacts. - * - */ - public function testFetchContacts() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for removeContactFromGroup - * - * Removes a contact from a group. - * - */ - public function testRemoveContactFromGroup() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for updateContact - * - * Updates a contact. - * - */ - public function testUpdateContact() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Api/DeliveryReportApiTest.php b/test/Api/DeliveryReportApiTest.php deleted file mode 100644 index cce94dd..0000000 --- a/test/Api/DeliveryReportApiTest.php +++ /dev/null @@ -1,86 +0,0 @@ -markTestIncomplete('Not implemented'); - } -} diff --git a/test/Api/GroupsApiTest.php b/test/Api/GroupsApiTest.php deleted file mode 100644 index 3faadc3..0000000 --- a/test/Api/GroupsApiTest.php +++ /dev/null @@ -1,134 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test case for deleteGroup - * - * Deletes a group. - * - */ - public function testDeleteGroup() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for fetchGroup - * - * Lists a group. - * - */ - public function testFetchGroup() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for fetchGroups - * - * Returns all groups. - * - */ - public function testFetchGroups() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for updateGroup - * - * Updates a group with the provided name. - * - */ - public function testUpdateGroup() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Api/NumberLookupApiTest.php b/test/Api/NumberLookupApiTest.php deleted file mode 100644 index f64ee88..0000000 --- a/test/Api/NumberLookupApiTest.php +++ /dev/null @@ -1,86 +0,0 @@ -markTestIncomplete('Not implemented'); - } -} diff --git a/test/Api/OmnimessageApiTest.php b/test/Api/OmnimessageApiTest.php deleted file mode 100644 index 6b61e27..0000000 --- a/test/Api/OmnimessageApiTest.php +++ /dev/null @@ -1,98 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test case for sendOmnimessage - * - * Sends an Omnimessage. - * - */ - public function testSendOmnimessage() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Api/StatisticsApiTest.php b/test/Api/StatisticsApiTest.php deleted file mode 100644 index 10f2646..0000000 --- a/test/Api/StatisticsApiTest.php +++ /dev/null @@ -1,86 +0,0 @@ -markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/ChannelTest.php b/test/Model/ChannelTest.php deleted file mode 100644 index 5d478ad..0000000 --- a/test/Model/ChannelTest.php +++ /dev/null @@ -1,82 +0,0 @@ -markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/ContactEnvelopeTest.php b/test/Model/ContactEnvelopeTest.php deleted file mode 100644 index ad42b6a..0000000 --- a/test/Model/ContactEnvelopeTest.php +++ /dev/null @@ -1,91 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "contact" - */ - public function testPropertyContact() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/ContactFieldsTest.php b/test/Model/ContactFieldsTest.php deleted file mode 100644 index 7fa774d..0000000 --- a/test/Model/ContactFieldsTest.php +++ /dev/null @@ -1,172 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "phoneNumber" - */ - public function testPropertyPhoneNumber() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "email" - */ - public function testPropertyEmail() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "firstName" - */ - public function testPropertyFirstName() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "lastName" - */ - public function testPropertyLastName() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "company" - */ - public function testPropertyCompany() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "title" - */ - public function testPropertyTitle() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "custom" - */ - public function testPropertyCustom() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "custom2" - */ - public function testPropertyCustom2() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "custom3" - */ - public function testPropertyCustom3() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "custom4" - */ - public function testPropertyCustom4() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/ContactListEnvelopeTest.php b/test/Model/ContactListEnvelopeTest.php deleted file mode 100644 index bde0072..0000000 --- a/test/Model/ContactListEnvelopeTest.php +++ /dev/null @@ -1,91 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "contacts" - */ - public function testPropertyContacts() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/ContactResponseFieldsTest.php b/test/Model/ContactResponseFieldsTest.php deleted file mode 100644 index 0709a33..0000000 --- a/test/Model/ContactResponseFieldsTest.php +++ /dev/null @@ -1,181 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "phoneNumber" - */ - public function testPropertyPhoneNumber() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "email" - */ - public function testPropertyEmail() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "firstName" - */ - public function testPropertyFirstName() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "lastName" - */ - public function testPropertyLastName() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "company" - */ - public function testPropertyCompany() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "title" - */ - public function testPropertyTitle() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "custom" - */ - public function testPropertyCustom() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "custom2" - */ - public function testPropertyCustom2() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "custom3" - */ - public function testPropertyCustom3() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "custom4" - */ - public function testPropertyCustom4() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "scheduledDeletionDate" - */ - public function testPropertyScheduledDeletionDate() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/ContactUpdateFieldsTest.php b/test/Model/ContactUpdateFieldsTest.php deleted file mode 100644 index c179501..0000000 --- a/test/Model/ContactUpdateFieldsTest.php +++ /dev/null @@ -1,163 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "email" - */ - public function testPropertyEmail() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "firstName" - */ - public function testPropertyFirstName() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "lastName" - */ - public function testPropertyLastName() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "company" - */ - public function testPropertyCompany() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "title" - */ - public function testPropertyTitle() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "custom" - */ - public function testPropertyCustom() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "custom2" - */ - public function testPropertyCustom2() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "custom3" - */ - public function testPropertyCustom3() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "custom4" - */ - public function testPropertyCustom4() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/DeliveryReportResponseTest.php b/test/Model/DeliveryReportResponseTest.php deleted file mode 100644 index 8bb70a1..0000000 --- a/test/Model/DeliveryReportResponseTest.php +++ /dev/null @@ -1,109 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "statuses" - */ - public function testPropertyStatuses() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "to" - */ - public function testPropertyTo() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "omnimessageId" - */ - public function testPropertyOmnimessageId() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/DeliveryResultTest.php b/test/Model/DeliveryResultTest.php deleted file mode 100644 index a1e207b..0000000 --- a/test/Model/DeliveryResultTest.php +++ /dev/null @@ -1,136 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "status" - */ - public function testPropertyStatus() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "channel" - */ - public function testPropertyChannel() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "messageId" - */ - public function testPropertyMessageId() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "error" - */ - public function testPropertyError() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "err" - */ - public function testPropertyErr() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "timestamp" - */ - public function testPropertyTimestamp() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/ErrorCodeOmnichannelMachineTest.php b/test/Model/ErrorCodeOmnichannelMachineTest.php deleted file mode 100644 index 1cdf214..0000000 --- a/test/Model/ErrorCodeOmnichannelMachineTest.php +++ /dev/null @@ -1,82 +0,0 @@ -markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/ErrorCodeOmnichannelTest.php b/test/Model/ErrorCodeOmnichannelTest.php deleted file mode 100644 index 78fddb5..0000000 --- a/test/Model/ErrorCodeOmnichannelTest.php +++ /dev/null @@ -1,82 +0,0 @@ -markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/ErrorCodePhonebookTest.php b/test/Model/ErrorCodePhonebookTest.php deleted file mode 100644 index 71bc429..0000000 --- a/test/Model/ErrorCodePhonebookTest.php +++ /dev/null @@ -1,82 +0,0 @@ -markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/ErrorCodeStatisticsTest.php b/test/Model/ErrorCodeStatisticsTest.php deleted file mode 100644 index f03468e..0000000 --- a/test/Model/ErrorCodeStatisticsTest.php +++ /dev/null @@ -1,82 +0,0 @@ -markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/ErrorItemNumberLookupErrorTest.php b/test/Model/ErrorItemNumberLookupErrorTest.php deleted file mode 100644 index 8885f53..0000000 --- a/test/Model/ErrorItemNumberLookupErrorTest.php +++ /dev/null @@ -1,100 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "description" - */ - public function testPropertyDescription() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "code" - */ - public function testPropertyCode() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/ErrorItemNumberLookupTest.php b/test/Model/ErrorItemNumberLookupTest.php deleted file mode 100644 index 9246aa1..0000000 --- a/test/Model/ErrorItemNumberLookupTest.php +++ /dev/null @@ -1,91 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "error" - */ - public function testPropertyError() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/ErrorItemOmnichannelTest.php b/test/Model/ErrorItemOmnichannelTest.php deleted file mode 100644 index ae5544a..0000000 --- a/test/Model/ErrorItemOmnichannelTest.php +++ /dev/null @@ -1,118 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "title" - */ - public function testPropertyTitle() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "detail" - */ - public function testPropertyDetail() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "code" - */ - public function testPropertyCode() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "source" - */ - public function testPropertySource() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/ErrorItemPhonebookTest.php b/test/Model/ErrorItemPhonebookTest.php deleted file mode 100644 index 4d28e07..0000000 --- a/test/Model/ErrorItemPhonebookTest.php +++ /dev/null @@ -1,109 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "title" - */ - public function testPropertyTitle() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "detail" - */ - public function testPropertyDetail() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "code" - */ - public function testPropertyCode() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/ErrorItemStatisticsTest.php b/test/Model/ErrorItemStatisticsTest.php deleted file mode 100644 index 24e42b7..0000000 --- a/test/Model/ErrorItemStatisticsTest.php +++ /dev/null @@ -1,109 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "title" - */ - public function testPropertyTitle() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "details" - */ - public function testPropertyDetails() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "code" - */ - public function testPropertyCode() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/ErrorNumberLookupTest.php b/test/Model/ErrorNumberLookupTest.php deleted file mode 100644 index 27b57c4..0000000 --- a/test/Model/ErrorNumberLookupTest.php +++ /dev/null @@ -1,91 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "errors" - */ - public function testPropertyErrors() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/ErrorOmnichannelTest.php b/test/Model/ErrorOmnichannelTest.php deleted file mode 100644 index 5f1e138..0000000 --- a/test/Model/ErrorOmnichannelTest.php +++ /dev/null @@ -1,91 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "errors" - */ - public function testPropertyErrors() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/ErrorPhonebookTest.php b/test/Model/ErrorPhonebookTest.php deleted file mode 100644 index 4e836bf..0000000 --- a/test/Model/ErrorPhonebookTest.php +++ /dev/null @@ -1,91 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "errors" - */ - public function testPropertyErrors() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/ErrorStatisticsTest.php b/test/Model/ErrorStatisticsTest.php deleted file mode 100644 index 4272499..0000000 --- a/test/Model/ErrorStatisticsTest.php +++ /dev/null @@ -1,91 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "errors" - */ - public function testPropertyErrors() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/ErrorTitleOmnichannelTest.php b/test/Model/ErrorTitleOmnichannelTest.php deleted file mode 100644 index c29096a..0000000 --- a/test/Model/ErrorTitleOmnichannelTest.php +++ /dev/null @@ -1,82 +0,0 @@ -markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/ErrorTitlePhonebookTest.php b/test/Model/ErrorTitlePhonebookTest.php deleted file mode 100644 index 2816116..0000000 --- a/test/Model/ErrorTitlePhonebookTest.php +++ /dev/null @@ -1,82 +0,0 @@ -markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/FetchBlacklistSuccessTest.php b/test/Model/FetchBlacklistSuccessTest.php deleted file mode 100644 index a93ea6f..0000000 --- a/test/Model/FetchBlacklistSuccessTest.php +++ /dev/null @@ -1,91 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "phoneNumbers" - */ - public function testPropertyPhoneNumbers() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/GroupEnvelopeTest.php b/test/Model/GroupEnvelopeTest.php deleted file mode 100644 index ac7b3b1..0000000 --- a/test/Model/GroupEnvelopeTest.php +++ /dev/null @@ -1,91 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "group" - */ - public function testPropertyGroup() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/GroupListEnvelopeTest.php b/test/Model/GroupListEnvelopeTest.php deleted file mode 100644 index 47b2f4b..0000000 --- a/test/Model/GroupListEnvelopeTest.php +++ /dev/null @@ -1,91 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "groups" - */ - public function testPropertyGroups() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/GroupNameTest.php b/test/Model/GroupNameTest.php deleted file mode 100644 index 82a5d94..0000000 --- a/test/Model/GroupNameTest.php +++ /dev/null @@ -1,91 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "name" - */ - public function testPropertyName() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/GroupResponseFieldsTest.php b/test/Model/GroupResponseFieldsTest.php deleted file mode 100644 index cd5136a..0000000 --- a/test/Model/GroupResponseFieldsTest.php +++ /dev/null @@ -1,118 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "id" - */ - public function testPropertyId() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "name" - */ - public function testPropertyName() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "createdOn" - */ - public function testPropertyCreatedOn() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "contactsCount" - */ - public function testPropertyContactsCount() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/MessageResultTest.php b/test/Model/MessageResultTest.php deleted file mode 100644 index 778d4dc..0000000 --- a/test/Model/MessageResultTest.php +++ /dev/null @@ -1,109 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "messageId" - */ - public function testPropertyMessageId() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "channel" - */ - public function testPropertyChannel() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "sender" - */ - public function testPropertySender() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/MobileNetworkTest.php b/test/Model/MobileNetworkTest.php deleted file mode 100644 index 6b19db3..0000000 --- a/test/Model/MobileNetworkTest.php +++ /dev/null @@ -1,127 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "mccmnc" - */ - public function testPropertyMccmnc() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "networkName" - */ - public function testPropertyNetworkName() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "countryName" - */ - public function testPropertyCountryName() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "countryPrefix" - */ - public function testPropertyCountryPrefix() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "countryCode" - */ - public function testPropertyCountryCode() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/NumberToBlacklistTest.php b/test/Model/NumberToBlacklistTest.php deleted file mode 100644 index 2b005cd..0000000 --- a/test/Model/NumberToBlacklistTest.php +++ /dev/null @@ -1,91 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "phoneNumber" - */ - public function testPropertyPhoneNumber() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/NumbersToInvestigateTest.php b/test/Model/NumbersToInvestigateTest.php deleted file mode 100644 index 54c17fb..0000000 --- a/test/Model/NumbersToInvestigateTest.php +++ /dev/null @@ -1,91 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "numbers" - */ - public function testPropertyNumbers() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/OmniMessageCreateSuccessResponseTest.php b/test/Model/OmniMessageCreateSuccessResponseTest.php deleted file mode 100644 index 1544f73..0000000 --- a/test/Model/OmniMessageCreateSuccessResponseTest.php +++ /dev/null @@ -1,109 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "messages" - */ - public function testPropertyMessages() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "to" - */ - public function testPropertyTo() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "omnimessageId" - */ - public function testPropertyOmnimessageId() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/OmnimessageTest.php b/test/Model/OmnimessageTest.php deleted file mode 100644 index c498a37..0000000 --- a/test/Model/OmnimessageTest.php +++ /dev/null @@ -1,136 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "to" - */ - public function testPropertyTo() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "messages" - */ - public function testPropertyMessages() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "dlrUrl" - */ - public function testPropertyDlrUrl() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "textStore" - */ - public function testPropertyTextStore() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "timeToSend" - */ - public function testPropertyTimeToSend() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "priority" - */ - public function testPropertyPriority() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/PriorityTest.php b/test/Model/PriorityTest.php deleted file mode 100644 index 124fe12..0000000 --- a/test/Model/PriorityTest.php +++ /dev/null @@ -1,82 +0,0 @@ -markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/SMSTest.php b/test/Model/SMSTest.php deleted file mode 100644 index c8cede3..0000000 --- a/test/Model/SMSTest.php +++ /dev/null @@ -1,136 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "text" - */ - public function testPropertyText() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "sender" - */ - public function testPropertySender() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "validity" - */ - public function testPropertyValidity() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "autoconvert" - */ - public function testPropertyAutoconvert() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "udh" - */ - public function testPropertyUdh() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "channel" - */ - public function testPropertyChannel() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/StatisticsReportSettingsTest.php b/test/Model/StatisticsReportSettingsTest.php deleted file mode 100644 index d73d235..0000000 --- a/test/Model/StatisticsReportSettingsTest.php +++ /dev/null @@ -1,109 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "startDate" - */ - public function testPropertyStartDate() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "endDate" - */ - public function testPropertyEndDate() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "messageTypes" - */ - public function testPropertyMessageTypes() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/StatisticsReportSuccessTest.php b/test/Model/StatisticsReportSuccessTest.php deleted file mode 100644 index f200c05..0000000 --- a/test/Model/StatisticsReportSuccessTest.php +++ /dev/null @@ -1,91 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "reports" - */ - public function testPropertyReports() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/StatisticsReportTest.php b/test/Model/StatisticsReportTest.php deleted file mode 100644 index 8a4021a..0000000 --- a/test/Model/StatisticsReportTest.php +++ /dev/null @@ -1,109 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "totalMessages" - */ - public function testPropertyTotalMessages() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "totalPrice" - */ - public function testPropertyTotalPrice() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "country" - */ - public function testPropertyCountry() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/StatusTest.php b/test/Model/StatusTest.php deleted file mode 100644 index 10530f9..0000000 --- a/test/Model/StatusTest.php +++ /dev/null @@ -1,82 +0,0 @@ -markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/SyncNumberLookupResultTest.php b/test/Model/SyncNumberLookupResultTest.php deleted file mode 100644 index 8eb6dae..0000000 --- a/test/Model/SyncNumberLookupResultTest.php +++ /dev/null @@ -1,163 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "number" - */ - public function testPropertyNumber() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "roaming" - */ - public function testPropertyRoaming() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "ported" - */ - public function testPropertyPorted() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "roamingNetwork" - */ - public function testPropertyRoamingNetwork() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "currentNetwork" - */ - public function testPropertyCurrentNetwork() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "originalNetwork" - */ - public function testPropertyOriginalNetwork() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "portedNetwork" - */ - public function testPropertyPortedNetwork() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "status" - */ - public function testPropertyStatus() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "error" - */ - public function testPropertyError() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/SyncNumberLookupSuccessTest.php b/test/Model/SyncNumberLookupSuccessTest.php deleted file mode 100644 index 1274234..0000000 --- a/test/Model/SyncNumberLookupSuccessTest.php +++ /dev/null @@ -1,100 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "requestId" - */ - public function testPropertyRequestId() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "result" - */ - public function testPropertyResult() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/TelegramTest.php b/test/Model/TelegramTest.php deleted file mode 100644 index 6a88027..0000000 --- a/test/Model/TelegramTest.php +++ /dev/null @@ -1,145 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "sender" - */ - public function testPropertySender() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "validity" - */ - public function testPropertyValidity() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "text" - */ - public function testPropertyText() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "imageUrl" - */ - public function testPropertyImageUrl() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "documentUrl" - */ - public function testPropertyDocumentUrl() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "audioUrl" - */ - public function testPropertyAudioUrl() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "channel" - */ - public function testPropertyChannel() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/TextStoreTest.php b/test/Model/TextStoreTest.php deleted file mode 100644 index 70ff6ca..0000000 --- a/test/Model/TextStoreTest.php +++ /dev/null @@ -1,82 +0,0 @@ -markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/ViberTest.php b/test/Model/ViberTest.php deleted file mode 100644 index bc8daca..0000000 --- a/test/Model/ViberTest.php +++ /dev/null @@ -1,145 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "sender" - */ - public function testPropertySender() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "validity" - */ - public function testPropertyValidity() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "text" - */ - public function testPropertyText() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "imageUrl" - */ - public function testPropertyImageUrl() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "buttonUrl" - */ - public function testPropertyButtonUrl() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "buttonText" - */ - public function testPropertyButtonText() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "channel" - */ - public function testPropertyChannel() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/WhatsAppAudioTest.php b/test/Model/WhatsAppAudioTest.php deleted file mode 100644 index 9d4fec7..0000000 --- a/test/Model/WhatsAppAudioTest.php +++ /dev/null @@ -1,91 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "content" - */ - public function testPropertyContent() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/WhatsAppDocumentTest.php b/test/Model/WhatsAppDocumentTest.php deleted file mode 100644 index 022c0fa..0000000 --- a/test/Model/WhatsAppDocumentTest.php +++ /dev/null @@ -1,100 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "caption" - */ - public function testPropertyCaption() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "content" - */ - public function testPropertyContent() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/WhatsAppImageTest.php b/test/Model/WhatsAppImageTest.php deleted file mode 100644 index e9d384f..0000000 --- a/test/Model/WhatsAppImageTest.php +++ /dev/null @@ -1,100 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "caption" - */ - public function testPropertyCaption() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "content" - */ - public function testPropertyContent() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/WhatsAppTest.php b/test/Model/WhatsAppTest.php deleted file mode 100644 index 462de55..0000000 --- a/test/Model/WhatsAppTest.php +++ /dev/null @@ -1,145 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "sender" - */ - public function testPropertySender() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "validity" - */ - public function testPropertyValidity() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "text" - */ - public function testPropertyText() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "image" - */ - public function testPropertyImage() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "document" - */ - public function testPropertyDocument() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "audio" - */ - public function testPropertyAudio() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "channel" - */ - public function testPropertyChannel() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/WhatsAppTextTest.php b/test/Model/WhatsAppTextTest.php deleted file mode 100644 index a3b7035..0000000 --- a/test/Model/WhatsAppTextTest.php +++ /dev/null @@ -1,100 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "previewUrl" - */ - public function testPropertyPreviewUrl() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "body" - */ - public function testPropertyBody() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} From ef83b830f268311482f6ecde4721ae0b237e530f Mon Sep 17 00:00:00 2001 From: api-librarian Date: Fri, 29 Oct 2021 12:05:36 +0000 Subject: [PATCH 2/8] Travis update: Oct 2021 (Build 687) [skip ci] --- .gitignore | 14 + .openapi-generator/FILES | 184 ++++++ .openapi-generator/VERSION | 2 +- .travis.yml | 11 +- README.md | 4 +- composer.json | 2 +- docs/Api/BlacklistApi.md | 72 +-- docs/Api/ContactsApi.md | 147 +++-- docs/Api/DeliveryReportApi.md | 20 +- docs/Api/GroupsApi.md | 95 ++- docs/Api/NumberLookupApi.md | 22 +- docs/Api/OmnimessageApi.md | 39 +- docs/Api/StatisticsApi.md | 22 +- docs/Model/Channel.md | 4 +- docs/Model/ContactEnvelope.md | 6 +- docs/Model/ContactFields.md | 24 +- docs/Model/ContactListEnvelope.md | 6 +- docs/Model/ContactResponseFields.md | 26 +- docs/Model/ContactUpdateFields.md | 22 +- docs/Model/DeliveryReportResponse.md | 10 +- docs/Model/DeliveryResult.md | 18 +- docs/Model/ErrorCodeOmnichannel.md | 4 +- docs/Model/ErrorCodeOmnichannelMachine.md | 4 +- docs/Model/ErrorCodePhonebook.md | 4 +- docs/Model/ErrorCodeStatistics.md | 4 +- docs/Model/ErrorItemNumberLookup.md | 6 +- docs/Model/ErrorItemNumberLookupError.md | 8 +- docs/Model/ErrorItemOmnichannel.md | 12 +- docs/Model/ErrorItemPhonebook.md | 10 +- docs/Model/ErrorItemStatistics.md | 10 +- docs/Model/ErrorNumberLookup.md | 6 +- docs/Model/ErrorOmnichannel.md | 6 +- docs/Model/ErrorPhonebook.md | 6 +- docs/Model/ErrorStatistics.md | 6 +- docs/Model/ErrorTitleOmnichannel.md | 4 +- docs/Model/ErrorTitlePhonebook.md | 4 +- docs/Model/FetchBlacklistSuccess.md | 6 +- docs/Model/GroupEnvelope.md | 6 +- docs/Model/GroupListEnvelope.md | 6 +- docs/Model/GroupName.md | 6 +- docs/Model/GroupResponseFields.md | 12 +- docs/Model/MessageResult.md | 10 +- docs/Model/MobileNetwork.md | 14 +- docs/Model/NumberToBlacklist.md | 6 +- docs/Model/NumbersToInvestigate.md | 6 +- .../Model/OmniMessageCreateSuccessResponse.md | 10 +- docs/Model/Omnimessage.md | 18 +- docs/Model/Priority.md | 4 +- docs/Model/SMS.md | 14 +- docs/Model/StatisticsReport.md | 10 +- docs/Model/StatisticsReportSettings.md | 10 +- docs/Model/StatisticsReportSuccess.md | 6 +- docs/Model/Status.md | 4 +- docs/Model/SyncNumberLookupResult.md | 22 +- docs/Model/SyncNumberLookupSuccess.md | 8 +- docs/Model/Telegram.md | 16 +- docs/Model/TextStore.md | 4 +- docs/Model/Viber.md | 16 +- docs/Model/WhatsApp.md | 16 +- docs/Model/WhatsAppAudio.md | 6 +- docs/Model/WhatsAppDocument.md | 8 +- docs/Model/WhatsAppImage.md | 8 +- docs/Model/WhatsAppText.md | 6 +- git_push.sh | 17 +- lib/Api/BlacklistApi.php | 229 +++---- lib/Api/ContactsApi.php | 581 +++++++++--------- lib/Api/DeliveryReportApi.php | 86 +-- lib/Api/GroupsApi.php | 357 +++++------ lib/Api/NumberLookupApi.php | 95 +-- lib/Api/OmnimessageApi.php | 152 ++--- lib/Api/StatisticsApi.php | 99 +-- lib/ApiException.php | 24 +- lib/Configuration.php | 51 +- lib/HeaderSelector.php | 13 +- lib/Model/Channel.php | 13 +- lib/Model/ContactEnvelope.php | 139 ++--- lib/Model/ContactFields.php | 301 ++------- lib/Model/ContactListEnvelope.php | 137 ++--- lib/Model/ContactResponseFields.php | 319 ++-------- lib/Model/ContactUpdateFields.php | 290 ++------- lib/Model/DeliveryReportResponse.php | 161 ++--- lib/Model/DeliveryResult.php | 194 ++---- lib/Model/ErrorCodeOmnichannel.php | 16 +- lib/Model/ErrorCodeOmnichannelMachine.php | 67 +- lib/Model/ErrorCodePhonebook.php | 15 +- lib/Model/ErrorCodeStatistics.php | 13 +- lib/Model/ErrorItemNumberLookup.php | 139 ++--- lib/Model/ErrorItemNumberLookupError.php | 150 ++--- lib/Model/ErrorItemOmnichannel.php | 179 ++---- lib/Model/ErrorItemPhonebook.php | 161 ++--- lib/Model/ErrorItemStatistics.php | 161 ++--- lib/Model/ErrorNumberLookup.php | 139 ++--- lib/Model/ErrorOmnichannel.php | 139 ++--- lib/Model/ErrorPhonebook.php | 139 ++--- lib/Model/ErrorStatistics.php | 139 ++--- lib/Model/ErrorTitleOmnichannel.php | 16 +- lib/Model/ErrorTitlePhonebook.php | 15 +- lib/Model/FetchBlacklistSuccess.php | 137 ++--- lib/Model/GroupEnvelope.php | 139 ++--- lib/Model/GroupListEnvelope.php | 137 ++--- lib/Model/GroupName.php | 139 ++--- lib/Model/GroupResponseFields.php | 179 ++---- lib/Model/MessageResult.php | 161 ++--- lib/Model/MobileNetwork.php | 183 ++---- lib/Model/ModelInterface.php | 6 +- lib/Model/NumberToBlacklist.php | 139 ++--- lib/Model/NumbersToInvestigate.php | 150 ++--- .../OmniMessageCreateSuccessResponse.php | 161 ++--- lib/Model/Omnimessage.php | 194 ++---- lib/Model/Priority.php | 12 +- lib/Model/SMS.php | 208 ++----- lib/Model/StatisticsReport.php | 161 ++--- lib/Model/StatisticsReportSettings.php | 161 ++--- lib/Model/StatisticsReportSuccess.php | 139 ++--- lib/Model/Status.php | 20 +- lib/Model/SyncNumberLookupResult.php | 281 ++------- lib/Model/SyncNumberLookupSuccess.php | 150 ++--- lib/Model/Telegram.php | 211 ++----- lib/Model/TextStore.php | 12 +- lib/Model/Viber.php | 211 ++----- lib/Model/WhatsApp.php | 211 ++----- lib/Model/WhatsAppAudio.php | 139 ++--- lib/Model/WhatsAppDocument.php | 150 ++--- lib/Model/WhatsAppImage.php | 150 ++--- lib/Model/WhatsAppText.php | 150 ++--- lib/ObjectSerializer.php | 143 +++-- phpunit.xml.dist | 37 +- test/Api/BlacklistApiTest.php | 122 ++++ test/Api/ContactsApiTest.php | 170 +++++ test/Api/DeliveryReportApiTest.php | 86 +++ test/Api/GroupsApiTest.php | 134 ++++ test/Api/NumberLookupApiTest.php | 86 +++ test/Api/OmnimessageApiTest.php | 98 +++ test/Api/StatisticsApiTest.php | 86 +++ test/Model/ChannelTest.php | 82 +++ test/Model/ContactEnvelopeTest.php | 91 +++ test/Model/ContactFieldsTest.php | 172 ++++++ test/Model/ContactListEnvelopeTest.php | 91 +++ test/Model/ContactResponseFieldsTest.php | 181 ++++++ test/Model/ContactUpdateFieldsTest.php | 163 +++++ test/Model/DeliveryReportResponseTest.php | 109 ++++ test/Model/DeliveryResultTest.php | 136 ++++ .../Model/ErrorCodeOmnichannelMachineTest.php | 82 +++ test/Model/ErrorCodeOmnichannelTest.php | 82 +++ test/Model/ErrorCodePhonebookTest.php | 82 +++ test/Model/ErrorCodeStatisticsTest.php | 82 +++ test/Model/ErrorItemNumberLookupErrorTest.php | 100 +++ test/Model/ErrorItemNumberLookupTest.php | 91 +++ test/Model/ErrorItemOmnichannelTest.php | 118 ++++ test/Model/ErrorItemPhonebookTest.php | 109 ++++ test/Model/ErrorItemStatisticsTest.php | 109 ++++ test/Model/ErrorNumberLookupTest.php | 91 +++ test/Model/ErrorOmnichannelTest.php | 91 +++ test/Model/ErrorPhonebookTest.php | 91 +++ test/Model/ErrorStatisticsTest.php | 91 +++ test/Model/ErrorTitleOmnichannelTest.php | 82 +++ test/Model/ErrorTitlePhonebookTest.php | 82 +++ test/Model/FetchBlacklistSuccessTest.php | 91 +++ test/Model/GroupEnvelopeTest.php | 91 +++ test/Model/GroupListEnvelopeTest.php | 91 +++ test/Model/GroupNameTest.php | 91 +++ test/Model/GroupResponseFieldsTest.php | 118 ++++ test/Model/MessageResultTest.php | 109 ++++ test/Model/MobileNetworkTest.php | 127 ++++ test/Model/NumberToBlacklistTest.php | 91 +++ test/Model/NumbersToInvestigateTest.php | 91 +++ .../OmniMessageCreateSuccessResponseTest.php | 109 ++++ test/Model/OmnimessageTest.php | 136 ++++ test/Model/PriorityTest.php | 82 +++ test/Model/SMSTest.php | 136 ++++ test/Model/StatisticsReportSettingsTest.php | 109 ++++ test/Model/StatisticsReportSuccessTest.php | 91 +++ test/Model/StatisticsReportTest.php | 109 ++++ test/Model/StatusTest.php | 82 +++ test/Model/SyncNumberLookupResultTest.php | 163 +++++ test/Model/SyncNumberLookupSuccessTest.php | 100 +++ test/Model/TelegramTest.php | 145 +++++ test/Model/TextStoreTest.php | 82 +++ test/Model/ViberTest.php | 145 +++++ test/Model/WhatsAppAudioTest.php | 91 +++ test/Model/WhatsAppDocumentTest.php | 100 +++ test/Model/WhatsAppImageTest.php | 100 +++ test/Model/WhatsAppTest.php | 145 +++++ test/Model/WhatsAppTextTest.php | 100 +++ 184 files changed, 9572 insertions(+), 6662 deletions(-) create mode 100644 .gitignore create mode 100644 .openapi-generator/FILES create mode 100644 test/Api/BlacklistApiTest.php create mode 100644 test/Api/ContactsApiTest.php create mode 100644 test/Api/DeliveryReportApiTest.php create mode 100644 test/Api/GroupsApiTest.php create mode 100644 test/Api/NumberLookupApiTest.php create mode 100644 test/Api/OmnimessageApiTest.php create mode 100644 test/Api/StatisticsApiTest.php create mode 100644 test/Model/ChannelTest.php create mode 100644 test/Model/ContactEnvelopeTest.php create mode 100644 test/Model/ContactFieldsTest.php create mode 100644 test/Model/ContactListEnvelopeTest.php create mode 100644 test/Model/ContactResponseFieldsTest.php create mode 100644 test/Model/ContactUpdateFieldsTest.php create mode 100644 test/Model/DeliveryReportResponseTest.php create mode 100644 test/Model/DeliveryResultTest.php create mode 100644 test/Model/ErrorCodeOmnichannelMachineTest.php create mode 100644 test/Model/ErrorCodeOmnichannelTest.php create mode 100644 test/Model/ErrorCodePhonebookTest.php create mode 100644 test/Model/ErrorCodeStatisticsTest.php create mode 100644 test/Model/ErrorItemNumberLookupErrorTest.php create mode 100644 test/Model/ErrorItemNumberLookupTest.php create mode 100644 test/Model/ErrorItemOmnichannelTest.php create mode 100644 test/Model/ErrorItemPhonebookTest.php create mode 100644 test/Model/ErrorItemStatisticsTest.php create mode 100644 test/Model/ErrorNumberLookupTest.php create mode 100644 test/Model/ErrorOmnichannelTest.php create mode 100644 test/Model/ErrorPhonebookTest.php create mode 100644 test/Model/ErrorStatisticsTest.php create mode 100644 test/Model/ErrorTitleOmnichannelTest.php create mode 100644 test/Model/ErrorTitlePhonebookTest.php create mode 100644 test/Model/FetchBlacklistSuccessTest.php create mode 100644 test/Model/GroupEnvelopeTest.php create mode 100644 test/Model/GroupListEnvelopeTest.php create mode 100644 test/Model/GroupNameTest.php create mode 100644 test/Model/GroupResponseFieldsTest.php create mode 100644 test/Model/MessageResultTest.php create mode 100644 test/Model/MobileNetworkTest.php create mode 100644 test/Model/NumberToBlacklistTest.php create mode 100644 test/Model/NumbersToInvestigateTest.php create mode 100644 test/Model/OmniMessageCreateSuccessResponseTest.php create mode 100644 test/Model/OmnimessageTest.php create mode 100644 test/Model/PriorityTest.php create mode 100644 test/Model/SMSTest.php create mode 100644 test/Model/StatisticsReportSettingsTest.php create mode 100644 test/Model/StatisticsReportSuccessTest.php create mode 100644 test/Model/StatisticsReportTest.php create mode 100644 test/Model/StatusTest.php create mode 100644 test/Model/SyncNumberLookupResultTest.php create mode 100644 test/Model/SyncNumberLookupSuccessTest.php create mode 100644 test/Model/TelegramTest.php create mode 100644 test/Model/TextStoreTest.php create mode 100644 test/Model/ViberTest.php create mode 100644 test/Model/WhatsAppAudioTest.php create mode 100644 test/Model/WhatsAppDocumentTest.php create mode 100644 test/Model/WhatsAppImageTest.php create mode 100644 test/Model/WhatsAppTest.php create mode 100644 test/Model/WhatsAppTextTest.php diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..92f7fde --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +# ref: https://github.com/github/gitignore/blob/master/Composer.gitignore + +composer.phar +/vendor/ + +# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control +# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file +# composer.lock + +# php-cs-fixer cache +.php_cs.cache + +# PHPUnit cache +.phpunit.result.cache diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES new file mode 100644 index 0000000..274bcd7 --- /dev/null +++ b/.openapi-generator/FILES @@ -0,0 +1,184 @@ +.gitignore +.openapi-generator-ignore +.php_cs +.travis.yml +README.md +composer.json +docs/Api/BlacklistApi.md +docs/Api/ContactsApi.md +docs/Api/DeliveryReportApi.md +docs/Api/GroupsApi.md +docs/Api/NumberLookupApi.md +docs/Api/OmnimessageApi.md +docs/Api/StatisticsApi.md +docs/Model/Channel.md +docs/Model/ContactEnvelope.md +docs/Model/ContactFields.md +docs/Model/ContactListEnvelope.md +docs/Model/ContactResponseFields.md +docs/Model/ContactUpdateFields.md +docs/Model/DeliveryReportResponse.md +docs/Model/DeliveryResult.md +docs/Model/ErrorCodeOmnichannel.md +docs/Model/ErrorCodeOmnichannelMachine.md +docs/Model/ErrorCodePhonebook.md +docs/Model/ErrorCodeStatistics.md +docs/Model/ErrorItemNumberLookup.md +docs/Model/ErrorItemNumberLookupError.md +docs/Model/ErrorItemOmnichannel.md +docs/Model/ErrorItemPhonebook.md +docs/Model/ErrorItemStatistics.md +docs/Model/ErrorNumberLookup.md +docs/Model/ErrorOmnichannel.md +docs/Model/ErrorPhonebook.md +docs/Model/ErrorStatistics.md +docs/Model/ErrorTitleOmnichannel.md +docs/Model/ErrorTitlePhonebook.md +docs/Model/FetchBlacklistSuccess.md +docs/Model/GroupEnvelope.md +docs/Model/GroupListEnvelope.md +docs/Model/GroupName.md +docs/Model/GroupResponseFields.md +docs/Model/MessageResult.md +docs/Model/MobileNetwork.md +docs/Model/NumberToBlacklist.md +docs/Model/NumbersToInvestigate.md +docs/Model/OmniMessageCreateSuccessResponse.md +docs/Model/Omnimessage.md +docs/Model/Priority.md +docs/Model/SMS.md +docs/Model/StatisticsReport.md +docs/Model/StatisticsReportSettings.md +docs/Model/StatisticsReportSuccess.md +docs/Model/Status.md +docs/Model/SyncNumberLookupResult.md +docs/Model/SyncNumberLookupSuccess.md +docs/Model/Telegram.md +docs/Model/TextStore.md +docs/Model/Viber.md +docs/Model/WhatsApp.md +docs/Model/WhatsAppAudio.md +docs/Model/WhatsAppDocument.md +docs/Model/WhatsAppImage.md +docs/Model/WhatsAppText.md +git_push.sh +lib/Api/BlacklistApi.php +lib/Api/ContactsApi.php +lib/Api/DeliveryReportApi.php +lib/Api/GroupsApi.php +lib/Api/NumberLookupApi.php +lib/Api/OmnimessageApi.php +lib/Api/StatisticsApi.php +lib/ApiException.php +lib/Configuration.php +lib/HeaderSelector.php +lib/Model/Channel.php +lib/Model/ContactEnvelope.php +lib/Model/ContactFields.php +lib/Model/ContactListEnvelope.php +lib/Model/ContactResponseFields.php +lib/Model/ContactUpdateFields.php +lib/Model/DeliveryReportResponse.php +lib/Model/DeliveryResult.php +lib/Model/ErrorCodeOmnichannel.php +lib/Model/ErrorCodeOmnichannelMachine.php +lib/Model/ErrorCodePhonebook.php +lib/Model/ErrorCodeStatistics.php +lib/Model/ErrorItemNumberLookup.php +lib/Model/ErrorItemNumberLookupError.php +lib/Model/ErrorItemOmnichannel.php +lib/Model/ErrorItemPhonebook.php +lib/Model/ErrorItemStatistics.php +lib/Model/ErrorNumberLookup.php +lib/Model/ErrorOmnichannel.php +lib/Model/ErrorPhonebook.php +lib/Model/ErrorStatistics.php +lib/Model/ErrorTitleOmnichannel.php +lib/Model/ErrorTitlePhonebook.php +lib/Model/FetchBlacklistSuccess.php +lib/Model/GroupEnvelope.php +lib/Model/GroupListEnvelope.php +lib/Model/GroupName.php +lib/Model/GroupResponseFields.php +lib/Model/MessageResult.php +lib/Model/MobileNetwork.php +lib/Model/ModelInterface.php +lib/Model/NumberToBlacklist.php +lib/Model/NumbersToInvestigate.php +lib/Model/OmniMessageCreateSuccessResponse.php +lib/Model/Omnimessage.php +lib/Model/Priority.php +lib/Model/SMS.php +lib/Model/StatisticsReport.php +lib/Model/StatisticsReportSettings.php +lib/Model/StatisticsReportSuccess.php +lib/Model/Status.php +lib/Model/SyncNumberLookupResult.php +lib/Model/SyncNumberLookupSuccess.php +lib/Model/Telegram.php +lib/Model/TextStore.php +lib/Model/Viber.php +lib/Model/WhatsApp.php +lib/Model/WhatsAppAudio.php +lib/Model/WhatsAppDocument.php +lib/Model/WhatsAppImage.php +lib/Model/WhatsAppText.php +lib/ObjectSerializer.php +phpunit.xml.dist +test/Api/BlacklistApiTest.php +test/Api/ContactsApiTest.php +test/Api/DeliveryReportApiTest.php +test/Api/GroupsApiTest.php +test/Api/NumberLookupApiTest.php +test/Api/OmnimessageApiTest.php +test/Api/StatisticsApiTest.php +test/Model/ChannelTest.php +test/Model/ContactEnvelopeTest.php +test/Model/ContactFieldsTest.php +test/Model/ContactListEnvelopeTest.php +test/Model/ContactResponseFieldsTest.php +test/Model/ContactUpdateFieldsTest.php +test/Model/DeliveryReportResponseTest.php +test/Model/DeliveryResultTest.php +test/Model/ErrorCodeOmnichannelMachineTest.php +test/Model/ErrorCodeOmnichannelTest.php +test/Model/ErrorCodePhonebookTest.php +test/Model/ErrorCodeStatisticsTest.php +test/Model/ErrorItemNumberLookupErrorTest.php +test/Model/ErrorItemNumberLookupTest.php +test/Model/ErrorItemOmnichannelTest.php +test/Model/ErrorItemPhonebookTest.php +test/Model/ErrorItemStatisticsTest.php +test/Model/ErrorNumberLookupTest.php +test/Model/ErrorOmnichannelTest.php +test/Model/ErrorPhonebookTest.php +test/Model/ErrorStatisticsTest.php +test/Model/ErrorTitleOmnichannelTest.php +test/Model/ErrorTitlePhonebookTest.php +test/Model/FetchBlacklistSuccessTest.php +test/Model/GroupEnvelopeTest.php +test/Model/GroupListEnvelopeTest.php +test/Model/GroupNameTest.php +test/Model/GroupResponseFieldsTest.php +test/Model/MessageResultTest.php +test/Model/MobileNetworkTest.php +test/Model/NumberToBlacklistTest.php +test/Model/NumbersToInvestigateTest.php +test/Model/OmniMessageCreateSuccessResponseTest.php +test/Model/OmnimessageTest.php +test/Model/PriorityTest.php +test/Model/SMSTest.php +test/Model/StatisticsReportSettingsTest.php +test/Model/StatisticsReportSuccessTest.php +test/Model/StatisticsReportTest.php +test/Model/StatusTest.php +test/Model/SyncNumberLookupResultTest.php +test/Model/SyncNumberLookupSuccessTest.php +test/Model/TelegramTest.php +test/Model/TextStoreTest.php +test/Model/ViberTest.php +test/Model/WhatsAppAudioTest.php +test/Model/WhatsAppDocumentTest.php +test/Model/WhatsAppImageTest.php +test/Model/WhatsAppTest.php +test/Model/WhatsAppTextTest.php diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index aa31e71..e230c83 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.3 \ No newline at end of file +5.3.0 \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index d77f382..714772e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,9 @@ language: php -sudo: false +# Bionic environment has preinstalled PHP from 7.1 to 7.4 +# https://docs.travis-ci.com/user/reference/bionic/#php-support +dist: bionic php: - - 5.4 - - 5.5 - - 5.6 - - 7.0 - - hhvm + - 7.3 + - 7.4 before_install: "composer install" script: "vendor/bin/phpunit" diff --git a/README.md b/README.md index 903f149..b8b1fcc 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Messente API Library -- Messente API version: 1.4.0 -- PHP artifact version: 1.4.0 +- Messente API version: 2.0.0 +- PHP artifact version: 2.0.0 [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. 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 ff0e769..78b3564 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "messente/messente-api-php", - "version": "1.4.0", + "version": "2.0.0", "description": "[Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world.", "keywords": ["viber", "telegram", "sms", "whatsapp", "phonebook", "openapitools", "openapi-generator", diff --git a/docs/Api/BlacklistApi.md b/docs/Api/BlacklistApi.md index 1018d6b..7bd8656 100644 --- a/docs/Api/BlacklistApi.md +++ b/docs/Api/BlacklistApi.md @@ -1,19 +1,20 @@ # Messente\Api\BlacklistApi -All URIs are relative to *https://api.messente.com/v1* +All URIs are relative to https://api.messente.com/v1. Method | HTTP request | Description ------------- | ------------- | ------------- -[**addToBlacklist**](BlacklistApi.md#addToBlacklist) | **POST** /phonebook/blacklist | Adds a phone number to the blacklist -[**deleteFromBlacklist**](BlacklistApi.md#deleteFromBlacklist) | **DELETE** /phonebook/blacklist/{phone} | Deletes a phone number from the blacklist -[**fetchBlacklist**](BlacklistApi.md#fetchBlacklist) | **GET** /phonebook/blacklist | Returns all blacklisted phone numbers -[**isBlacklisted**](BlacklistApi.md#isBlacklisted) | **GET** /phonebook/blacklist/{phone} | Checks if a phone number is blacklisted +[**addToBlacklist()**](BlacklistApi.md#addToBlacklist) | **POST** /phonebook/blacklist | Adds a phone number to the blacklist +[**deleteFromBlacklist()**](BlacklistApi.md#deleteFromBlacklist) | **DELETE** /phonebook/blacklist/{phone} | Deletes a phone number from the blacklist +[**fetchBlacklist()**](BlacklistApi.md#fetchBlacklist) | **GET** /phonebook/blacklist | Returns all blacklisted phone numbers +[**isBlacklisted()**](BlacklistApi.md#isBlacklisted) | **GET** /phonebook/blacklist/{phone} | Checks if a phone number is blacklisted +## `addToBlacklist()` -## addToBlacklist - -> addToBlacklist($numberToBlacklist) +```php +addToBlacklist($numberToBlacklist) +``` Adds a phone number to the blacklist @@ -43,12 +44,10 @@ try { } catch (Exception $e) { echo 'Exception when calling BlacklistApi->addToBlacklist: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **numberToBlacklist** | [**\Messente\Api\Model\NumberToBlacklist**](../Model/NumberToBlacklist.md)| Phone number to be blacklisted | @@ -63,17 +62,18 @@ void (empty response body) ### HTTP request headers -- **Content-Type**: application/json -- **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `deleteFromBlacklist()` -## deleteFromBlacklist - -> deleteFromBlacklist($phone) +```php +deleteFromBlacklist($phone) +``` Deletes a phone number from the blacklist @@ -103,12 +103,10 @@ try { } catch (Exception $e) { echo 'Exception when calling BlacklistApi->deleteFromBlacklist: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **phone** | **string**| A phone number | @@ -124,16 +122,17 @@ void (empty response body) ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `fetchBlacklist()` -## fetchBlacklist - -> \Messente\Api\Model\FetchBlacklistSuccess fetchBlacklist() +```php +fetchBlacklist(): \Messente\Api\Model\FetchBlacklistSuccess +``` Returns all blacklisted phone numbers @@ -163,7 +162,6 @@ try { } catch (Exception $e) { echo 'Exception when calling BlacklistApi->fetchBlacklist: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters @@ -181,16 +179,17 @@ This endpoint does not need any parameter. ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `isBlacklisted()` -## isBlacklisted - -> isBlacklisted($phone) +```php +isBlacklisted($phone) +``` Checks if a phone number is blacklisted @@ -220,12 +219,10 @@ try { } catch (Exception $e) { echo 'Exception when calling BlacklistApi->isBlacklisted: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **phone** | **string**| A phone number | @@ -241,9 +238,8 @@ void (empty response body) ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) - diff --git a/docs/Api/ContactsApi.md b/docs/Api/ContactsApi.md index 4bf5349..970e008 100644 --- a/docs/Api/ContactsApi.md +++ b/docs/Api/ContactsApi.md @@ -1,23 +1,24 @@ # Messente\Api\ContactsApi -All URIs are relative to *https://api.messente.com/v1* +All URIs are relative to https://api.messente.com/v1. Method | HTTP request | Description ------------- | ------------- | ------------- -[**addContactToGroup**](ContactsApi.md#addContactToGroup) | **POST** /phonebook/groups/{groupId}/contacts/{phone} | Adds a contact to a group -[**createContact**](ContactsApi.md#createContact) | **POST** /phonebook/contacts | Creates a new contact -[**deleteContact**](ContactsApi.md#deleteContact) | **DELETE** /phonebook/contacts/{phone} | Deletes a contact -[**fetchContact**](ContactsApi.md#fetchContact) | **GET** /phonebook/contacts/{phone} | Lists a contact -[**fetchContactGroups**](ContactsApi.md#fetchContactGroups) | **GET** /phonebook/contacts/{phone}/groups | Lists groups of a contact -[**fetchContacts**](ContactsApi.md#fetchContacts) | **GET** /phonebook/contacts | Returns all contacts -[**removeContactFromGroup**](ContactsApi.md#removeContactFromGroup) | **DELETE** /phonebook/groups/{groupId}/contacts/{phone} | Removes a contact from a group -[**updateContact**](ContactsApi.md#updateContact) | **PATCH** /phonebook/contacts/{phone} | Updates a contact +[**addContactToGroup()**](ContactsApi.md#addContactToGroup) | **POST** /phonebook/groups/{groupId}/contacts/{phone} | Adds a contact to a group +[**createContact()**](ContactsApi.md#createContact) | **POST** /phonebook/contacts | Creates a new contact +[**deleteContact()**](ContactsApi.md#deleteContact) | **DELETE** /phonebook/contacts/{phone} | Deletes a contact +[**fetchContact()**](ContactsApi.md#fetchContact) | **GET** /phonebook/contacts/{phone} | Lists a contact +[**fetchContactGroups()**](ContactsApi.md#fetchContactGroups) | **GET** /phonebook/contacts/{phone}/groups | Lists groups of a contact +[**fetchContacts()**](ContactsApi.md#fetchContacts) | **GET** /phonebook/contacts | Returns all contacts +[**removeContactFromGroup()**](ContactsApi.md#removeContactFromGroup) | **DELETE** /phonebook/groups/{groupId}/contacts/{phone} | Removes a contact from a group +[**updateContact()**](ContactsApi.md#updateContact) | **PATCH** /phonebook/contacts/{phone} | Updates a contact +## `addContactToGroup()` -## addContactToGroup - -> object addContactToGroup($groupId, $phone) +```php +addContactToGroup($groupId, $phone): object +``` Adds a contact to a group @@ -49,12 +50,10 @@ try { } catch (Exception $e) { echo 'Exception when calling ContactsApi->addContactToGroup: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **groupId** | **string**| String in UUID format | @@ -71,16 +70,17 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `createContact()` -## createContact - -> \Messente\Api\Model\ContactEnvelope createContact($contactFields) +```php +createContact($contactFields): \Messente\Api\Model\ContactEnvelope +``` Creates a new contact @@ -103,7 +103,7 @@ $apiInstance = new Messente\Api\Api\ContactsApi( new GuzzleHttp\Client(), $config ); -$contactFields = {"phoneNumber":"+37251000000","email":"anyone@messente.com","firstName":"Any","lastName":"One","company":"Messente","title":"Sir","custom":"Any custom","custom2":"Any custom two","custom3":"Any custom three","custom4":"Any custom four"}; // \Messente\Api\Model\ContactFields | +$contactFields = {"phoneNumber":"+37251000000","email":"anyone@messente.com","firstName":"Any","lastName":"One","company":"Messente","title":"Sir","custom":"Any custom","custom2":"Any custom two","custom3":"Any custom three","custom4":"Any custom four"}; // \Messente\Api\Model\ContactFields try { $result = $apiInstance->createContact($contactFields); @@ -111,12 +111,10 @@ try { } catch (Exception $e) { echo 'Exception when calling ContactsApi->createContact: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **contactFields** | [**\Messente\Api\Model\ContactFields**](../Model/ContactFields.md)| | @@ -131,17 +129,18 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: application/json -- **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `deleteContact()` -## deleteContact - -> deleteContact($phone) +```php +deleteContact($phone) +``` Deletes a contact @@ -171,12 +170,10 @@ try { } catch (Exception $e) { echo 'Exception when calling ContactsApi->deleteContact: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **phone** | **string**| A phone number | @@ -192,16 +189,17 @@ void (empty response body) ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `fetchContact()` -## fetchContact - -> \Messente\Api\Model\ContactEnvelope fetchContact($phone) +```php +fetchContact($phone): \Messente\Api\Model\ContactEnvelope +``` Lists a contact @@ -232,12 +230,10 @@ try { } catch (Exception $e) { echo 'Exception when calling ContactsApi->fetchContact: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **phone** | **string**| A phone number | @@ -253,16 +249,17 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `fetchContactGroups()` -## fetchContactGroups - -> \Messente\Api\Model\GroupListEnvelope fetchContactGroups($phone) +```php +fetchContactGroups($phone): \Messente\Api\Model\GroupListEnvelope +``` Lists groups of a contact @@ -293,12 +290,10 @@ try { } catch (Exception $e) { echo 'Exception when calling ContactsApi->fetchContactGroups: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **phone** | **string**| A phone number | @@ -314,16 +309,17 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `fetchContacts()` -## fetchContacts - -> \Messente\Api\Model\ContactListEnvelope fetchContacts($groupIds) +```php +fetchContacts($groupIds): \Messente\Api\Model\ContactListEnvelope +``` Returns all contacts @@ -354,12 +350,10 @@ try { } catch (Exception $e) { echo 'Exception when calling ContactsApi->fetchContacts: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **groupIds** | [**string[]**](../Model/string.md)| Optional one or many group id strings in UUID format. For example: \"/contacts?groupIds=group_id_one&groupIds=group_id_two\" | [optional] @@ -375,16 +369,17 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `removeContactFromGroup()` -## removeContactFromGroup - -> removeContactFromGroup($groupId, $phone) +```php +removeContactFromGroup($groupId, $phone) +``` Removes a contact from a group @@ -415,12 +410,10 @@ try { } catch (Exception $e) { echo 'Exception when calling ContactsApi->removeContactFromGroup: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **groupId** | **string**| String in UUID format | @@ -437,16 +430,17 @@ void (empty response body) ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `updateContact()` -## updateContact - -> \Messente\Api\Model\ContactEnvelope updateContact($phone, $contactUpdateFields) +```php +updateContact($phone, $contactUpdateFields): \Messente\Api\Model\ContactEnvelope +``` Updates a contact @@ -470,7 +464,7 @@ $apiInstance = new Messente\Api\Api\ContactsApi( $config ); $phone = +37251000000; // string | A phone number -$contactUpdateFields = {"email":"anyone@messente.com","firstName":"Any","lastName":"One","company":"Messente","title":"Sir","custom":"Any custom","custom2":"Any custom two","custom3":"Any custom three","custom4":"Any custom four"}; // \Messente\Api\Model\ContactUpdateFields | +$contactUpdateFields = {"email":"anyone@messente.com","firstName":"Any","lastName":"One","company":"Messente","title":"Sir","custom":"Any custom","custom2":"Any custom two","custom3":"Any custom three","custom4":"Any custom four"}; // \Messente\Api\Model\ContactUpdateFields try { $result = $apiInstance->updateContact($phone, $contactUpdateFields); @@ -478,12 +472,10 @@ try { } catch (Exception $e) { echo 'Exception when calling ContactsApi->updateContact: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **phone** | **string**| A phone number | @@ -499,10 +491,9 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: application/json -- **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) - diff --git a/docs/Api/DeliveryReportApi.md b/docs/Api/DeliveryReportApi.md index 7c2d10e..ef62c6f 100644 --- a/docs/Api/DeliveryReportApi.md +++ b/docs/Api/DeliveryReportApi.md @@ -1,16 +1,17 @@ # Messente\Api\DeliveryReportApi -All URIs are relative to *https://api.messente.com/v1* +All URIs are relative to https://api.messente.com/v1. Method | HTTP request | Description ------------- | ------------- | ------------- -[**retrieveDeliveryReport**](DeliveryReportApi.md#retrieveDeliveryReport) | **GET** /omnimessage/{omnimessageId}/status | Retrieves the delivery report for the Omnimessage +[**retrieveDeliveryReport()**](DeliveryReportApi.md#retrieveDeliveryReport) | **GET** /omnimessage/{omnimessageId}/status | Retrieves the delivery report for the Omnimessage +## `retrieveDeliveryReport()` -## retrieveDeliveryReport - -> \Messente\Api\Model\DeliveryReportResponse retrieveDeliveryReport($omnimessageId) +```php +retrieveDeliveryReport($omnimessageId): \Messente\Api\Model\DeliveryReportResponse +``` Retrieves the delivery report for the Omnimessage @@ -41,12 +42,10 @@ try { } catch (Exception $e) { echo 'Exception when calling DeliveryReportApi->retrieveDeliveryReport: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **omnimessageId** | **string**| UUID of the omnimessage to for which the delivery report is to be retrieved | @@ -62,9 +61,8 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) - diff --git a/docs/Api/GroupsApi.md b/docs/Api/GroupsApi.md index 5e910c5..f511a0e 100644 --- a/docs/Api/GroupsApi.md +++ b/docs/Api/GroupsApi.md @@ -1,20 +1,21 @@ # Messente\Api\GroupsApi -All URIs are relative to *https://api.messente.com/v1* +All URIs are relative to https://api.messente.com/v1. Method | HTTP request | Description ------------- | ------------- | ------------- -[**createGroup**](GroupsApi.md#createGroup) | **POST** /phonebook/groups | Creates a new group with the provided name -[**deleteGroup**](GroupsApi.md#deleteGroup) | **DELETE** /phonebook/groups/{groupId} | Deletes a group -[**fetchGroup**](GroupsApi.md#fetchGroup) | **GET** /phonebook/groups/{groupId} | Lists a group -[**fetchGroups**](GroupsApi.md#fetchGroups) | **GET** /phonebook/groups | Returns all groups -[**updateGroup**](GroupsApi.md#updateGroup) | **PUT** /phonebook/groups/{groupId} | Updates a group with the provided name +[**createGroup()**](GroupsApi.md#createGroup) | **POST** /phonebook/groups | Creates a new group with the provided name +[**deleteGroup()**](GroupsApi.md#deleteGroup) | **DELETE** /phonebook/groups/{groupId} | Deletes a group +[**fetchGroup()**](GroupsApi.md#fetchGroup) | **GET** /phonebook/groups/{groupId} | Lists a group +[**fetchGroups()**](GroupsApi.md#fetchGroups) | **GET** /phonebook/groups | Returns all groups +[**updateGroup()**](GroupsApi.md#updateGroup) | **PUT** /phonebook/groups/{groupId} | Updates a group with the provided name +## `createGroup()` -## createGroup - -> \Messente\Api\Model\GroupEnvelope createGroup($groupName) +```php +createGroup($groupName): \Messente\Api\Model\GroupEnvelope +``` Creates a new group with the provided name @@ -37,7 +38,7 @@ $apiInstance = new Messente\Api\Api\GroupsApi( new GuzzleHttp\Client(), $config ); -$groupName = {"name":"Any group name"}; // \Messente\Api\Model\GroupName | +$groupName = {"name":"Any group name"}; // \Messente\Api\Model\GroupName try { $result = $apiInstance->createGroup($groupName); @@ -45,12 +46,10 @@ try { } catch (Exception $e) { echo 'Exception when calling GroupsApi->createGroup: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **groupName** | [**\Messente\Api\Model\GroupName**](../Model/GroupName.md)| | @@ -65,17 +64,18 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: application/json -- **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `deleteGroup()` -## deleteGroup - -> deleteGroup($groupId) +```php +deleteGroup($groupId) +``` Deletes a group @@ -105,12 +105,10 @@ try { } catch (Exception $e) { echo 'Exception when calling GroupsApi->deleteGroup: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **groupId** | **string**| String in UUID format | @@ -126,16 +124,17 @@ void (empty response body) ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `fetchGroup()` -## fetchGroup - -> \Messente\Api\Model\GroupEnvelope fetchGroup($groupId) +```php +fetchGroup($groupId): \Messente\Api\Model\GroupEnvelope +``` Lists a group @@ -166,12 +165,10 @@ try { } catch (Exception $e) { echo 'Exception when calling GroupsApi->fetchGroup: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **groupId** | **string**| String in UUID format | @@ -187,16 +184,17 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `fetchGroups()` -## fetchGroups - -> \Messente\Api\Model\GroupListEnvelope fetchGroups() +```php +fetchGroups(): \Messente\Api\Model\GroupListEnvelope +``` Returns all groups @@ -226,7 +224,6 @@ try { } catch (Exception $e) { echo 'Exception when calling GroupsApi->fetchGroups: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters @@ -244,16 +241,17 @@ This endpoint does not need any parameter. ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `updateGroup()` -## updateGroup - -> \Messente\Api\Model\GroupEnvelope updateGroup($groupId, $groupName) +```php +updateGroup($groupId, $groupName): \Messente\Api\Model\GroupEnvelope +``` Updates a group with the provided name @@ -277,7 +275,7 @@ $apiInstance = new Messente\Api\Api\GroupsApi( $config ); $groupId = 5792a02a-e5c2-422b-a0a0-0ae65d814663; // string | String in UUID format -$groupName = {"name":"Any group name"}; // \Messente\Api\Model\GroupName | +$groupName = {"name":"Any group name"}; // \Messente\Api\Model\GroupName try { $result = $apiInstance->updateGroup($groupId, $groupName); @@ -285,12 +283,10 @@ try { } catch (Exception $e) { echo 'Exception when calling GroupsApi->updateGroup: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **groupId** | **string**| String in UUID format | @@ -306,10 +302,9 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: application/json -- **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) - diff --git a/docs/Api/NumberLookupApi.md b/docs/Api/NumberLookupApi.md index 4b3088d..c671dfe 100644 --- a/docs/Api/NumberLookupApi.md +++ b/docs/Api/NumberLookupApi.md @@ -1,16 +1,17 @@ # Messente\Api\NumberLookupApi -All URIs are relative to *https://api.messente.com/v1* +All URIs are relative to https://api.messente.com/v1. Method | HTTP request | Description ------------- | ------------- | ------------- -[**fetchInfo**](NumberLookupApi.md#fetchInfo) | **POST** /hlr/sync | Requests info about phone numbers +[**fetchInfo()**](NumberLookupApi.md#fetchInfo) | **POST** /hlr/sync | Requests info about phone numbers +## `fetchInfo()` -## fetchInfo - -> \Messente\Api\Model\SyncNumberLookupSuccess fetchInfo($numbersToInvestigate) +```php +fetchInfo($numbersToInvestigate): \Messente\Api\Model\SyncNumberLookupSuccess +``` Requests info about phone numbers @@ -41,12 +42,10 @@ try { } catch (Exception $e) { echo 'Exception when calling NumberLookupApi->fetchInfo: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **numbersToInvestigate** | [**\Messente\Api\Model\NumbersToInvestigate**](../Model/NumbersToInvestigate.md)| Numbers for lookup | @@ -61,10 +60,9 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: application/json -- **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) - diff --git a/docs/Api/OmnimessageApi.md b/docs/Api/OmnimessageApi.md index 95c84e9..c07dc9b 100644 --- a/docs/Api/OmnimessageApi.md +++ b/docs/Api/OmnimessageApi.md @@ -1,17 +1,18 @@ # Messente\Api\OmnimessageApi -All URIs are relative to *https://api.messente.com/v1* +All URIs are relative to https://api.messente.com/v1. Method | HTTP request | Description ------------- | ------------- | ------------- -[**cancelScheduledMessage**](OmnimessageApi.md#cancelScheduledMessage) | **DELETE** /omnimessage/{omnimessageId} | Cancels a scheduled Omnimessage -[**sendOmnimessage**](OmnimessageApi.md#sendOmnimessage) | **POST** /omnimessage | Sends an Omnimessage +[**cancelScheduledMessage()**](OmnimessageApi.md#cancelScheduledMessage) | **DELETE** /omnimessage/{omnimessageId} | Cancels a scheduled Omnimessage +[**sendOmnimessage()**](OmnimessageApi.md#sendOmnimessage) | **POST** /omnimessage | Sends an Omnimessage +## `cancelScheduledMessage()` -## cancelScheduledMessage - -> object cancelScheduledMessage($omnimessageId) +```php +cancelScheduledMessage($omnimessageId): object +``` Cancels a scheduled Omnimessage @@ -42,12 +43,10 @@ try { } catch (Exception $e) { echo 'Exception when calling OmnimessageApi->cancelScheduledMessage: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **omnimessageId** | **string**| UUID of the scheduled omnimessage to be cancelled | @@ -63,16 +62,17 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `sendOmnimessage()` -## sendOmnimessage - -> \Messente\Api\Model\OmniMessageCreateSuccessResponse sendOmnimessage($omnimessage) +```php +sendOmnimessage($omnimessage): \Messente\Api\Model\OmniMessageCreateSuccessResponse +``` Sends an Omnimessage @@ -103,12 +103,10 @@ try { } catch (Exception $e) { echo 'Exception when calling OmnimessageApi->sendOmnimessage: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **omnimessage** | [**\Messente\Api\Model\Omnimessage**](../Model/Omnimessage.md)| Omnimessage to be sent | @@ -123,10 +121,9 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: application/json -- **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) - diff --git a/docs/Api/StatisticsApi.md b/docs/Api/StatisticsApi.md index c6cd0a4..4cfe438 100644 --- a/docs/Api/StatisticsApi.md +++ b/docs/Api/StatisticsApi.md @@ -1,16 +1,17 @@ # Messente\Api\StatisticsApi -All URIs are relative to *https://api.messente.com/v1* +All URIs are relative to https://api.messente.com/v1. Method | HTTP request | Description ------------- | ------------- | ------------- -[**createStatisticsReport**](StatisticsApi.md#createStatisticsReport) | **POST** /statistics/reports | Requests statistics reports for each country +[**createStatisticsReport()**](StatisticsApi.md#createStatisticsReport) | **POST** /statistics/reports | Requests statistics reports for each country +## `createStatisticsReport()` -## createStatisticsReport - -> \Messente\Api\Model\StatisticsReportSuccess createStatisticsReport($statisticsReportSettings) +```php +createStatisticsReport($statisticsReportSettings): \Messente\Api\Model\StatisticsReportSuccess +``` Requests statistics reports for each country @@ -41,12 +42,10 @@ try { } catch (Exception $e) { echo 'Exception when calling StatisticsApi->createStatisticsReport: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **statisticsReportSettings** | [**\Messente\Api\Model\StatisticsReportSettings**](../Model/StatisticsReportSettings.md)| Settings for statistics report | @@ -61,10 +60,9 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: application/json -- **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) - diff --git a/docs/Model/Channel.md b/docs/Model/Channel.md index 7028070..866cd4a 100644 --- a/docs/Model/Channel.md +++ b/docs/Model/Channel.md @@ -5,6 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContactEnvelope.md b/docs/Model/ContactEnvelope.md index 65a43bc..c86b00d 100644 --- a/docs/Model/ContactEnvelope.md +++ b/docs/Model/ContactEnvelope.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**contact** | [**\Messente\Api\Model\ContactResponseFields**](ContactResponseFields.md) | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**contact** | [**\Messente\Api\Model\ContactResponseFields**](ContactResponseFields.md) | | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContactFields.md b/docs/Model/ContactFields.md index 70e6c2f..5f5e1a3 100644 --- a/docs/Model/ContactFields.md +++ b/docs/Model/ContactFields.md @@ -4,17 +4,15 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**phoneNumber** | **string** | Phone number in e.164 format | -**email** | **string** | The email of the contact | [optional] -**firstName** | **string** | The first name of the contact | [optional] -**lastName** | **string** | The last name of the contact | [optional] -**company** | **string** | The company of the contact | [optional] -**title** | **string** | The title of the contact | [optional] -**custom** | **string** | The first custom field | [optional] -**custom2** | **string** | The second custom field | [optional] -**custom3** | **string** | The third custom field | [optional] -**custom4** | **string** | The fourth custom field | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**phoneNumber** | **string** | Phone number in e.164 format | +**email** | **string** | The email of the contact | [optional] +**firstName** | **string** | The first name of the contact | [optional] +**lastName** | **string** | The last name of the contact | [optional] +**company** | **string** | The company of the contact | [optional] +**title** | **string** | The title of the contact | [optional] +**custom** | **string** | The first custom field | [optional] +**custom2** | **string** | The second custom field | [optional] +**custom3** | **string** | The third custom field | [optional] +**custom4** | **string** | The fourth custom field | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContactListEnvelope.md b/docs/Model/ContactListEnvelope.md index ed0764f..0ad220a 100644 --- a/docs/Model/ContactListEnvelope.md +++ b/docs/Model/ContactListEnvelope.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**contacts** | [**\Messente\Api\Model\ContactResponseFields[]**](ContactResponseFields.md) | An array of contacts | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**contacts** | [**\Messente\Api\Model\ContactResponseFields[]**](ContactResponseFields.md) | An array of contacts | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContactResponseFields.md b/docs/Model/ContactResponseFields.md index c0b42b2..d9ed0a8 100644 --- a/docs/Model/ContactResponseFields.md +++ b/docs/Model/ContactResponseFields.md @@ -4,18 +4,16 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**phoneNumber** | **string** | Phone number in e.164 format | [optional] -**email** | **string** | The email of the contact | [optional] -**firstName** | **string** | The first name of the contact | [optional] -**lastName** | **string** | The last name of the contact | [optional] -**company** | **string** | The company of the contact | [optional] -**title** | **string** | The title of the contact | [optional] -**custom** | **string** | The first custom field | [optional] -**custom2** | **string** | The second custom field | [optional] -**custom3** | **string** | The third custom field | [optional] -**custom4** | **string** | The fourth custom field | [optional] -**scheduledDeletionDate** | [**\DateTime**](\DateTime.md) | The date in ISO 8601 format, YYYY-MM-DD, on which the contact is going to be deleted because it has not belonged to a group for 30 days | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**phoneNumber** | **string** | Phone number in e.164 format | [optional] +**email** | **string** | The email of the contact | [optional] +**firstName** | **string** | The first name of the contact | [optional] +**lastName** | **string** | The last name of the contact | [optional] +**company** | **string** | The company of the contact | [optional] +**title** | **string** | The title of the contact | [optional] +**custom** | **string** | The first custom field | [optional] +**custom2** | **string** | The second custom field | [optional] +**custom3** | **string** | The third custom field | [optional] +**custom4** | **string** | The fourth custom field | [optional] +**scheduledDeletionDate** | **\DateTime** | The date in ISO 8601 format, YYYY-MM-DD, on which the contact is going to be deleted because it has not belonged to a group for 30 days | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContactUpdateFields.md b/docs/Model/ContactUpdateFields.md index 2d004cc..1110f27 100644 --- a/docs/Model/ContactUpdateFields.md +++ b/docs/Model/ContactUpdateFields.md @@ -4,16 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**email** | **string** | The email of the contact | [optional] -**firstName** | **string** | The first name of the contact | [optional] -**lastName** | **string** | The last name of the contact | [optional] -**company** | **string** | The company of the contact | [optional] -**title** | **string** | The title of the contact | [optional] -**custom** | **string** | The first custom field | [optional] -**custom2** | **string** | The second custom field | [optional] -**custom3** | **string** | The third custom field | [optional] -**custom4** | **string** | The fourth custom field | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**email** | **string** | The email of the contact | [optional] +**firstName** | **string** | The first name of the contact | [optional] +**lastName** | **string** | The last name of the contact | [optional] +**company** | **string** | The company of the contact | [optional] +**title** | **string** | The title of the contact | [optional] +**custom** | **string** | The first custom field | [optional] +**custom2** | **string** | The second custom field | [optional] +**custom3** | **string** | The third custom field | [optional] +**custom4** | **string** | The fourth custom field | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeliveryReportResponse.md b/docs/Model/DeliveryReportResponse.md index 8d5a0cd..0dc0688 100644 --- a/docs/Model/DeliveryReportResponse.md +++ b/docs/Model/DeliveryReportResponse.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**statuses** | [**\Messente\Api\Model\DeliveryResult[]**](DeliveryResult.md) | Contains the delivery reports for each channel, ordered by send order | -**to** | **string** | Phone number in e.164 format | -**omnimessageId** | **string** | Unique identifier for the omnimessage | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**statuses** | [**\Messente\Api\Model\DeliveryResult[]**](DeliveryResult.md) | Contains the delivery reports for each channel, ordered by send order | +**to** | **string** | Phone number in e.164 format | +**omnimessageId** | **string** | Unique identifier for the omnimessage | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeliveryResult.md b/docs/Model/DeliveryResult.md index 7274a16..427c9f2 100644 --- a/docs/Model/DeliveryResult.md +++ b/docs/Model/DeliveryResult.md @@ -4,13 +4,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**status** | [**\Messente\Api\Model\Status**](Status.md) | | [optional] -**channel** | [**\Messente\Api\Model\Channel**](Channel.md) | | [optional] -**messageId** | **string** | Unique identifier for the message | [optional] -**error** | **string** | Human-readable description of what went wrong, *null* in case of success or if the message has not been processed yet | [optional] -**err** | [**\Messente\Api\Model\ErrorCodeOmnichannelMachine**](ErrorCodeOmnichannelMachine.md) | | [optional] -**timestamp** | [**\DateTime**](\DateTime.md) | When this status was received by Omnichannel API | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +**status** | [**\Messente\Api\Model\Status**](Status.md) | | [optional] +**channel** | [**\Messente\Api\Model\Channel**](Channel.md) | | [optional] +**messageId** | **string** | Unique identifier for the message | [optional] +**error** | **string** | Human-readable description of what went wrong, *null* in case of success or if the message has not been processed yet | [optional] +**err** | [**\Messente\Api\Model\ErrorCodeOmnichannelMachine**](ErrorCodeOmnichannelMachine.md) | | [optional] +**timestamp** | **\DateTime** | When this status was received by Omnichannel API | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorCodeOmnichannel.md b/docs/Model/ErrorCodeOmnichannel.md index a8d3477..667281b 100644 --- a/docs/Model/ErrorCodeOmnichannel.md +++ b/docs/Model/ErrorCodeOmnichannel.md @@ -5,6 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorCodeOmnichannelMachine.md b/docs/Model/ErrorCodeOmnichannelMachine.md index 9269270..da84b2d 100644 --- a/docs/Model/ErrorCodeOmnichannelMachine.md +++ b/docs/Model/ErrorCodeOmnichannelMachine.md @@ -5,6 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorCodePhonebook.md b/docs/Model/ErrorCodePhonebook.md index 0718169..d7fe431 100644 --- a/docs/Model/ErrorCodePhonebook.md +++ b/docs/Model/ErrorCodePhonebook.md @@ -5,6 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorCodeStatistics.md b/docs/Model/ErrorCodeStatistics.md index a362880..3ba4cf6 100644 --- a/docs/Model/ErrorCodeStatistics.md +++ b/docs/Model/ErrorCodeStatistics.md @@ -5,6 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorItemNumberLookup.md b/docs/Model/ErrorItemNumberLookup.md index e47dbb7..c923237 100644 --- a/docs/Model/ErrorItemNumberLookup.md +++ b/docs/Model/ErrorItemNumberLookup.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**error** | [**\Messente\Api\Model\ErrorItemNumberLookupError**](ErrorItemNumberLookupError.md) | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**error** | [**\Messente\Api\Model\ErrorItemNumberLookupError**](ErrorItemNumberLookupError.md) | | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorItemNumberLookupError.md b/docs/Model/ErrorItemNumberLookupError.md index a05e7ab..dab852b 100644 --- a/docs/Model/ErrorItemNumberLookupError.md +++ b/docs/Model/ErrorItemNumberLookupError.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**description** | **string** | Error description | -**code** | **int** | Matches the following error title. This field is a constant * 101 - Unauthorized * 102 - Invalid arguments or parameters * 103 - Server error * 104 - Crediting error #1 * 105 - Crediting error #2 * 106 - Client error | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**description** | **string** | Error description | +**code** | **int** | Matches the following error title. This field is a constant * 101 - Unauthorized * 102 - Invalid arguments or parameters * 103 - Server error * 104 - Crediting error #1 * 105 - Crediting error #2 * 106 - Client error | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorItemOmnichannel.md b/docs/Model/ErrorItemOmnichannel.md index 0cafabb..64aec57 100644 --- a/docs/Model/ErrorItemOmnichannel.md +++ b/docs/Model/ErrorItemOmnichannel.md @@ -4,11 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**title** | [**\Messente\Api\Model\ErrorTitleOmnichannel**](ErrorTitleOmnichannel.md) | | -**detail** | **string** | Free form more detailed description of the error | -**code** | [**\Messente\Api\Model\ErrorCodeOmnichannel**](ErrorCodeOmnichannel.md) | | -**source** | **string** | Describes which field is causing the issue in the payload, null for non 400 status code responses | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**title** | [**\Messente\Api\Model\ErrorTitleOmnichannel**](ErrorTitleOmnichannel.md) | | +**detail** | **string** | Free form more detailed description of the error | +**code** | [**\Messente\Api\Model\ErrorCodeOmnichannel**](ErrorCodeOmnichannel.md) | | +**source** | **string** | Describes which field is causing the issue in the payload, null for non 400 status code responses | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorItemPhonebook.md b/docs/Model/ErrorItemPhonebook.md index 73efe06..8ca8880 100644 --- a/docs/Model/ErrorItemPhonebook.md +++ b/docs/Model/ErrorItemPhonebook.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**title** | [**\Messente\Api\Model\ErrorTitlePhonebook**](ErrorTitlePhonebook.md) | | -**detail** | **string** | Free form more detailed description of the error | -**code** | [**\Messente\Api\Model\ErrorCodePhonebook**](ErrorCodePhonebook.md) | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**title** | [**\Messente\Api\Model\ErrorTitlePhonebook**](ErrorTitlePhonebook.md) | | +**detail** | **string** | Free form more detailed description of the error | +**code** | [**\Messente\Api\Model\ErrorCodePhonebook**](ErrorCodePhonebook.md) | | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorItemStatistics.md b/docs/Model/ErrorItemStatistics.md index 6a73f02..62d0e8a 100644 --- a/docs/Model/ErrorItemStatistics.md +++ b/docs/Model/ErrorItemStatistics.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**title** | **string** | Error title | -**details** | **string** | Error details | -**code** | [**\Messente\Api\Model\ErrorCodeStatistics**](ErrorCodeStatistics.md) | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**title** | **string** | Error title | +**details** | **string** | Error details | +**code** | [**\Messente\Api\Model\ErrorCodeStatistics**](ErrorCodeStatistics.md) | | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorNumberLookup.md b/docs/Model/ErrorNumberLookup.md index 4e7f7a3..d8116b4 100644 --- a/docs/Model/ErrorNumberLookup.md +++ b/docs/Model/ErrorNumberLookup.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**errors** | [**\Messente\Api\Model\ErrorItemNumberLookup[]**](ErrorItemNumberLookup.md) | An array of errors | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**errors** | [**\Messente\Api\Model\ErrorItemNumberLookup[]**](ErrorItemNumberLookup.md) | An array of errors | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorOmnichannel.md b/docs/Model/ErrorOmnichannel.md index 9136d9a..fe59aea 100644 --- a/docs/Model/ErrorOmnichannel.md +++ b/docs/Model/ErrorOmnichannel.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**errors** | [**\Messente\Api\Model\ErrorItemOmnichannel[]**](ErrorItemOmnichannel.md) | An array of errors | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**errors** | [**\Messente\Api\Model\ErrorItemOmnichannel[]**](ErrorItemOmnichannel.md) | An array of errors | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorPhonebook.md b/docs/Model/ErrorPhonebook.md index 49e33b6..0345c9e 100644 --- a/docs/Model/ErrorPhonebook.md +++ b/docs/Model/ErrorPhonebook.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**errors** | [**\Messente\Api\Model\ErrorItemPhonebook[]**](ErrorItemPhonebook.md) | An array of errors | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**errors** | [**\Messente\Api\Model\ErrorItemPhonebook[]**](ErrorItemPhonebook.md) | An array of errors | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorStatistics.md b/docs/Model/ErrorStatistics.md index 83cc5f9..3dba2a6 100644 --- a/docs/Model/ErrorStatistics.md +++ b/docs/Model/ErrorStatistics.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**errors** | [**\Messente\Api\Model\ErrorItemStatistics[]**](ErrorItemStatistics.md) | An array of errors | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**errors** | [**\Messente\Api\Model\ErrorItemStatistics[]**](ErrorItemStatistics.md) | An array of errors | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorTitleOmnichannel.md b/docs/Model/ErrorTitleOmnichannel.md index b17deca..25938a8 100644 --- a/docs/Model/ErrorTitleOmnichannel.md +++ b/docs/Model/ErrorTitleOmnichannel.md @@ -5,6 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorTitlePhonebook.md b/docs/Model/ErrorTitlePhonebook.md index 1efae0b..9f4f024 100644 --- a/docs/Model/ErrorTitlePhonebook.md +++ b/docs/Model/ErrorTitlePhonebook.md @@ -5,6 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FetchBlacklistSuccess.md b/docs/Model/FetchBlacklistSuccess.md index 29d467f..36a7fef 100644 --- a/docs/Model/FetchBlacklistSuccess.md +++ b/docs/Model/FetchBlacklistSuccess.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**phoneNumbers** | **string[]** | Array of unique phone numbers | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**phoneNumbers** | **string[]** | Array of unique phone numbers | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GroupEnvelope.md b/docs/Model/GroupEnvelope.md index 421db2c..ed34926 100644 --- a/docs/Model/GroupEnvelope.md +++ b/docs/Model/GroupEnvelope.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**group** | [**\Messente\Api\Model\GroupResponseFields**](GroupResponseFields.md) | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**group** | [**\Messente\Api\Model\GroupResponseFields**](GroupResponseFields.md) | | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GroupListEnvelope.md b/docs/Model/GroupListEnvelope.md index 41a078f..7244a7a 100644 --- a/docs/Model/GroupListEnvelope.md +++ b/docs/Model/GroupListEnvelope.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**groups** | [**\Messente\Api\Model\GroupResponseFields[]**](GroupResponseFields.md) | An array of groups | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**groups** | [**\Messente\Api\Model\GroupResponseFields[]**](GroupResponseFields.md) | An array of groups | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GroupName.md b/docs/Model/GroupName.md index b4ababf..d97a1f0 100644 --- a/docs/Model/GroupName.md +++ b/docs/Model/GroupName.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | **string** | The name of the group | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**name** | **string** | The name of the group | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GroupResponseFields.md b/docs/Model/GroupResponseFields.md index 8bcc09d..c08e03e 100644 --- a/docs/Model/GroupResponseFields.md +++ b/docs/Model/GroupResponseFields.md @@ -4,11 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **string** | Id string in UUID format | -**name** | **string** | The name of the group | -**createdOn** | **string** | When the group was created | [optional] -**contactsCount** | **int** | The count of contacts in the group | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**id** | **string** | Id string in UUID format | +**name** | **string** | The name of the group | +**createdOn** | **string** | When the group was created | [optional] +**contactsCount** | **int** | The count of contacts in the group | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MessageResult.md b/docs/Model/MessageResult.md index 291b60c..b8a4036 100644 --- a/docs/Model/MessageResult.md +++ b/docs/Model/MessageResult.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**messageId** | **string** | Unique identifier for the message | -**channel** | [**\Messente\Api\Model\Channel**](Channel.md) | | -**sender** | **string** | Sender that was used for the message | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**messageId** | **string** | Unique identifier for the message | +**channel** | [**\Messente\Api\Model\Channel**](Channel.md) | | +**sender** | **string** | Sender that was used for the message | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MobileNetwork.md b/docs/Model/MobileNetwork.md index 9f98e1c..f0529f2 100644 --- a/docs/Model/MobileNetwork.md +++ b/docs/Model/MobileNetwork.md @@ -4,12 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**mccmnc** | **string** | Mobile country and mobile network code | [optional] -**networkName** | **string** | Mobile network name | [optional] -**countryName** | **string** | Country name | [optional] -**countryPrefix** | **string** | Country prefix | [optional] -**countryCode** | **string** | Country code | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**mccmnc** | **string** | Mobile country and mobile network code | [optional] +**networkName** | **string** | Mobile network name | [optional] +**countryName** | **string** | Country name | [optional] +**countryPrefix** | **string** | Country prefix | [optional] +**countryCode** | **string** | Country code | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NumberToBlacklist.md b/docs/Model/NumberToBlacklist.md index 15862b1..6b1906a 100644 --- a/docs/Model/NumberToBlacklist.md +++ b/docs/Model/NumberToBlacklist.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**phoneNumber** | **string** | Phone number in e.164 format | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**phoneNumber** | **string** | Phone number in e.164 format | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NumbersToInvestigate.md b/docs/Model/NumbersToInvestigate.md index 2533c4f..705faae 100644 --- a/docs/Model/NumbersToInvestigate.md +++ b/docs/Model/NumbersToInvestigate.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**numbers** | **string[]** | A list of phone numbers. Max 10 numbers per request | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**numbers** | **string[]** | A list of phone numbers. Max 10 numbers per request | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OmniMessageCreateSuccessResponse.md b/docs/Model/OmniMessageCreateSuccessResponse.md index 1b3daa4..6177048 100644 --- a/docs/Model/OmniMessageCreateSuccessResponse.md +++ b/docs/Model/OmniMessageCreateSuccessResponse.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**messages** | [**\Messente\Api\Model\MessageResult[]**](MessageResult.md) | List of messages that compose the omnimessage | -**to** | **string** | Phone number in e.164 format | -**omnimessageId** | **string** | Unique identifier for the omnimessage | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**messages** | [**\Messente\Api\Model\MessageResult[]**](MessageResult.md) | List of messages that compose the omnimessage | +**to** | **string** | Phone number in e.164 format | +**omnimessageId** | **string** | Unique identifier for the omnimessage | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Omnimessage.md b/docs/Model/Omnimessage.md index f2e25fb..9f218f0 100644 --- a/docs/Model/Omnimessage.md +++ b/docs/Model/Omnimessage.md @@ -4,13 +4,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**to** | **string** | Phone number in e.164 format | -**messages** | [**OneOfViberSMSWhatsAppTelegram[]**](OneOfViberSMSWhatsAppTelegram.md) | An array of messages | -**dlrUrl** | **string** | URL where the delivery report will be sent | [optional] -**textStore** | [**\Messente\Api\Model\TextStore**](TextStore.md) | | [optional] -**timeToSend** | [**\DateTime**](\DateTime.md) | Optional parameter for sending messages at some specific time in the future. Time must be specified in the ISO-8601 format. If no timezone is specified, then the timezone is assumed to be UTC Examples: * Time specified with timezone: 2018-06-22T09:05:07+00:00 Time specified in UTC: 2018-06-22T09:05:07Z * Time specified without timezone: 2018-06-22T09:05 (equivalent to 2018-06-22T09:05+00:00) | [optional] -**priority** | [**\Messente\Api\Model\Priority**](Priority.md) | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +**to** | **string** | Phone number in e.164 format | +**messages** | [**OneOfViberSMSWhatsAppTelegram[]**](OneOfViberSMSWhatsAppTelegram.md) | An array of messages | +**dlrUrl** | **string** | URL where the delivery report will be sent | [optional] +**textStore** | [**\Messente\Api\Model\TextStore**](TextStore.md) | | [optional] +**timeToSend** | **\DateTime** | Optional parameter for sending messages at some specific time in the future. Time must be specified in the ISO-8601 format. If no timezone is specified, then the timezone is assumed to be UTC Examples: * Time specified with timezone: 2018-06-22T09:05:07+00:00 Time specified in UTC: 2018-06-22T09:05:07Z * Time specified without timezone: 2018-06-22T09:05 (equivalent to 2018-06-22T09:05+00:00) | [optional] +**priority** | [**\Messente\Api\Model\Priority**](Priority.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Priority.md b/docs/Model/Priority.md index 4a8cbe8..552ead2 100644 --- a/docs/Model/Priority.md +++ b/docs/Model/Priority.md @@ -5,6 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SMS.md b/docs/Model/SMS.md index c25d31f..f0d4c91 100644 --- a/docs/Model/SMS.md +++ b/docs/Model/SMS.md @@ -4,13 +4,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**text** | **string** | Text content of the SMS | -**sender** | **string** | Phone number or alphanumeric sender name | [optional] -**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted | [optional] -**autoconvert** | **string** | Defines how non-GSM characters will be treated: - \"on\" Use replacement settings from the account's [API Auto Replace settings page](https://dashboard.messente.com/api-settings/auto-replace) (default) - \"full\" All non GSM 03.38 characters will be replaced with suitable alternatives - \"off\" Message content is not modified in any way | [optional] -**udh** | **string** | hex-encoded string containing SMS UDH | [optional] +**text** | **string** | Text content of the SMS | +**sender** | **string** | Phone number or alphanumeric sender name | [optional] +**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted | [optional] +**autoconvert** | **string** | Defines how non-GSM characters will be treated: - \"on\" Use replacement settings from the account's [API Auto Replace settings page](https://dashboard.messente.com/api-settings/auto-replace) (default) - \"full\" All non GSM 03.38 characters will be replaced with suitable alternatives - \"off\" Message content is not modified in any way | [optional] +**udh** | **string** | hex-encoded string containing SMS UDH | [optional] **channel** | **string** | The channel used to deliver the message | [optional] [default to 'sms'] -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StatisticsReport.md b/docs/Model/StatisticsReport.md index b646314..283b6b7 100644 --- a/docs/Model/StatisticsReport.md +++ b/docs/Model/StatisticsReport.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**totalMessages** | **int** | Sum of all messages | -**totalPrice** | **string** | Price for all messages | -**country** | **string** | Target country of all messages | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**totalMessages** | **int** | Sum of all messages | +**totalPrice** | **string** | Price for all messages | +**country** | **string** | Target country of all messages | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StatisticsReportSettings.md b/docs/Model/StatisticsReportSettings.md index ad54c58..dc51d8b 100644 --- a/docs/Model/StatisticsReportSettings.md +++ b/docs/Model/StatisticsReportSettings.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**startDate** | [**\DateTime**](\DateTime.md) | Start date for the report | -**endDate** | [**\DateTime**](\DateTime.md) | End date for the report | -**messageTypes** | **string[]** | Optional list of message types (sms, viber, whatsapp, hlr, telegram) | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**startDate** | **\DateTime** | Start date for the report | +**endDate** | **\DateTime** | End date for the report | +**messageTypes** | **string[]** | Optional list of message types (sms, viber, whatsapp, hlr, telegram) | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StatisticsReportSuccess.md b/docs/Model/StatisticsReportSuccess.md index cd98a66..0f78d80 100644 --- a/docs/Model/StatisticsReportSuccess.md +++ b/docs/Model/StatisticsReportSuccess.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**reports** | [**\Messente\Api\Model\StatisticsReport[]**](StatisticsReport.md) | Array of report objects | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**reports** | [**\Messente\Api\Model\StatisticsReport[]**](StatisticsReport.md) | Array of report objects | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Status.md b/docs/Model/Status.md index fb7c6c7..c462142 100644 --- a/docs/Model/Status.md +++ b/docs/Model/Status.md @@ -5,6 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SyncNumberLookupResult.md b/docs/Model/SyncNumberLookupResult.md index 3db52c2..38ba91f 100644 --- a/docs/Model/SyncNumberLookupResult.md +++ b/docs/Model/SyncNumberLookupResult.md @@ -4,16 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**number** | **string** | Phone number in e.164 format | -**roaming** | **bool** | Indicates if a number is roaming | [optional] -**ported** | **bool** | Indicates if a number is ported | [optional] -**roamingNetwork** | [**\Messente\Api\Model\MobileNetwork**](MobileNetwork.md) | | [optional] -**currentNetwork** | [**\Messente\Api\Model\MobileNetwork**](MobileNetwork.md) | | [optional] -**originalNetwork** | [**\Messente\Api\Model\MobileNetwork**](MobileNetwork.md) | | [optional] -**portedNetwork** | [**\Messente\Api\Model\MobileNetwork**](MobileNetwork.md) | | [optional] -**status** | **string** | Status of the phone number | [optional] -**error** | **object** | Indicates if any error occurred while handling the request | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**number** | **string** | Phone number in e.164 format | +**roaming** | **bool** | Indicates if a number is roaming | [optional] +**ported** | **bool** | Indicates if a number is ported | [optional] +**roamingNetwork** | [**\Messente\Api\Model\MobileNetwork**](MobileNetwork.md) | | [optional] +**currentNetwork** | [**\Messente\Api\Model\MobileNetwork**](MobileNetwork.md) | | [optional] +**originalNetwork** | [**\Messente\Api\Model\MobileNetwork**](MobileNetwork.md) | | [optional] +**portedNetwork** | [**\Messente\Api\Model\MobileNetwork**](MobileNetwork.md) | | [optional] +**status** | **string** | Status of the phone number | [optional] +**error** | **mixed** | Indicates if any error occurred while handling the request | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SyncNumberLookupSuccess.md b/docs/Model/SyncNumberLookupSuccess.md index 9b8eae7..debed8f 100644 --- a/docs/Model/SyncNumberLookupSuccess.md +++ b/docs/Model/SyncNumberLookupSuccess.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**requestId** | **string** | ID of the request | -**result** | [**\Messente\Api\Model\SyncNumberLookupResult[]**](SyncNumberLookupResult.md) | A container for phone number info objects | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**requestId** | **string** | ID of the request | +**result** | [**\Messente\Api\Model\SyncNumberLookupResult[]**](SyncNumberLookupResult.md) | A container for phone number info objects | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Telegram.md b/docs/Model/Telegram.md index ee778a0..1debeb9 100644 --- a/docs/Model/Telegram.md +++ b/docs/Model/Telegram.md @@ -4,14 +4,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**sender** | **string** | Phone number or alphanumeric sender name | [optional] -**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted | [optional] -**text** | **string** | Plaintext content for Telegram | [optional] -**imageUrl** | **string** | URL for the embedded image. Mutually exclusive with \"document_url\" and \"audio_url\" | [optional] -**documentUrl** | **string** | URL for the embedded image. Mutually exclusive with \"audio_url\" and \"image_url\" | [optional] -**audioUrl** | **string** | URL for the embedded image. Mutually exclusive with \"document_url\" and \"image_url\" | [optional] +**sender** | **string** | Phone number or alphanumeric sender name | [optional] +**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted | [optional] +**text** | **string** | Plaintext content for Telegram | [optional] +**imageUrl** | **string** | URL for the embedded image. Mutually exclusive with \"document_url\" and \"audio_url\" | [optional] +**documentUrl** | **string** | URL for the embedded image. Mutually exclusive with \"audio_url\" and \"image_url\" | [optional] +**audioUrl** | **string** | URL for the embedded image. Mutually exclusive with \"document_url\" and \"image_url\" | [optional] **channel** | **string** | The channel used to deliver the message | [optional] [default to 'telegram'] -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TextStore.md b/docs/Model/TextStore.md index 8fc3b29..3b2f6f1 100644 --- a/docs/Model/TextStore.md +++ b/docs/Model/TextStore.md @@ -5,6 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Viber.md b/docs/Model/Viber.md index 2a353f2..688a035 100644 --- a/docs/Model/Viber.md +++ b/docs/Model/Viber.md @@ -4,14 +4,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**sender** | **string** | Phone number or alphanumeric sender name | [optional] -**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted | [optional] -**text** | **string** | Plaintext content for Viber | [optional] -**imageUrl** | **string** | URL for the embedded image Valid combinations: 1) image_url, 2) text, image_url, button_url, button_text | [optional] -**buttonUrl** | **string** | URL of the button, must be specified along with ''text'', ''button_text'' and ''image_url'' (optional) | [optional] -**buttonText** | **string** | Must be specified along with ''text'', ''button_url'', ''button_text'', ''image_url'' (optional) | [optional] +**sender** | **string** | Phone number or alphanumeric sender name | [optional] +**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted | [optional] +**text** | **string** | Plaintext content for Viber | [optional] +**imageUrl** | **string** | URL for the embedded image Valid combinations: 1) image_url, 2) text, image_url, button_url, button_text | [optional] +**buttonUrl** | **string** | URL of the button, must be specified along with ''text'', ''button_text'' and ''image_url'' (optional) | [optional] +**buttonText** | **string** | Must be specified along with ''text'', ''button_url'', ''button_text'', ''image_url'' (optional) | [optional] **channel** | **string** | The channel used to deliver the message | [optional] [default to 'viber'] -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WhatsApp.md b/docs/Model/WhatsApp.md index 5b3dff7..6ce50dd 100644 --- a/docs/Model/WhatsApp.md +++ b/docs/Model/WhatsApp.md @@ -4,14 +4,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**sender** | **string** | Phone number or alphanumeric sender name | [optional] -**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted | [optional] -**text** | [**\Messente\Api\Model\WhatsAppText**](WhatsAppText.md) | | [optional] -**image** | [**\Messente\Api\Model\WhatsAppImage**](WhatsAppImage.md) | | [optional] -**document** | [**\Messente\Api\Model\WhatsAppDocument**](WhatsAppDocument.md) | | [optional] -**audio** | [**\Messente\Api\Model\WhatsAppAudio**](WhatsAppAudio.md) | | [optional] +**sender** | **string** | Phone number or alphanumeric sender name | [optional] +**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted | [optional] +**text** | [**\Messente\Api\Model\WhatsAppText**](WhatsAppText.md) | | [optional] +**image** | [**\Messente\Api\Model\WhatsAppImage**](WhatsAppImage.md) | | [optional] +**document** | [**\Messente\Api\Model\WhatsAppDocument**](WhatsAppDocument.md) | | [optional] +**audio** | [**\Messente\Api\Model\WhatsAppAudio**](WhatsAppAudio.md) | | [optional] **channel** | **string** | The channel used to deliver the message | [optional] [default to 'whatsapp'] -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WhatsAppAudio.md b/docs/Model/WhatsAppAudio.md index 9be0439..ff0e201 100644 --- a/docs/Model/WhatsAppAudio.md +++ b/docs/Model/WhatsAppAudio.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**content** | **string** | Base64-encoded audio | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**content** | **string** | Base64-encoded audio | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WhatsAppDocument.md b/docs/Model/WhatsAppDocument.md index 5d5dc71..1183cd3 100644 --- a/docs/Model/WhatsAppDocument.md +++ b/docs/Model/WhatsAppDocument.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**caption** | **string** | Description for the document | [optional] -**content** | **string** | Base64-encoded image | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**caption** | **string** | Description for the document | [optional] +**content** | **string** | Base64-encoded image | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WhatsAppImage.md b/docs/Model/WhatsAppImage.md index 2c578d1..fff678f 100644 --- a/docs/Model/WhatsAppImage.md +++ b/docs/Model/WhatsAppImage.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**caption** | **string** | Description for the image | [optional] -**content** | **string** | Base64-encoded image | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**caption** | **string** | Description for the image | [optional] +**content** | **string** | Base64-encoded image | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WhatsAppText.md b/docs/Model/WhatsAppText.md index 0c1fad1..5a801c0 100644 --- a/docs/Model/WhatsAppText.md +++ b/docs/Model/WhatsAppText.md @@ -5,8 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **previewUrl** | **bool** | Whether to display link preview if the message contains a hyperlink | [optional] [default to true] -**body** | **string** | Plaintext content for WhatsApp, can contain URLs, emojis and formatting | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**body** | **string** | Plaintext content for WhatsApp, can contain URLs, emojis and formatting | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/git_push.sh b/git_push.sh index 7a23503..14bad7f 100644 --- a/git_push.sh +++ b/git_push.sh @@ -1,11 +1,17 @@ #!/bin/sh # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ # -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" git_user_id=$1 git_repo_id=$2 release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="messente" @@ -32,14 +38,14 @@ git add . git commit -m "$release_note" # Sets the new remote -git_remote=`git remote` +git_remote=$(git remote) if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,5 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' - diff --git a/lib/Api/BlacklistApi.php b/lib/Api/BlacklistApi.php index 70ec8b6..dfa0ecd 100644 --- a/lib/Api/BlacklistApi.php +++ b/lib/Api/BlacklistApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Set the host index * - * @param int Host index (required) + * @param int $hostIndex Host index (required) */ - public function setHostIndex($host_index) + public function setHostIndex($hostIndex): void { - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Get the host index * - * @return Host index + * @return int Host index */ public function getHostIndex() { @@ -153,9 +154,16 @@ public function addToBlacklistWithHttpInfo($numberToBlacklist) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -166,11 +174,11 @@ public function addToBlacklistWithHttpInfo($numberToBlacklist) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } @@ -267,7 +275,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -281,7 +289,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function addToBlacklistRequest($numberToBlacklist) + public function addToBlacklistRequest($numberToBlacklist) { // verify the required parameter 'numberToBlacklist' is set if ($numberToBlacklist === null || (is_array($numberToBlacklist) && count($numberToBlacklist) === 0)) { @@ -299,11 +307,7 @@ protected function addToBlacklistRequest($numberToBlacklist) - // body params - $_tempBody = null; - if (isset($numberToBlacklist)) { - $_tempBody = $numberToBlacklist; - } + if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -317,21 +321,23 @@ protected function addToBlacklistRequest($numberToBlacklist) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present + if (isset($numberToBlacklist)) { if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($numberToBlacklist)); } else { - $httpBody = $_tempBody; + $httpBody = $numberToBlacklist; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -341,7 +347,7 @@ protected function addToBlacklistRequest($numberToBlacklist) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -361,7 +367,7 @@ protected function addToBlacklistRequest($numberToBlacklist) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -408,9 +414,16 @@ public function deleteFromBlacklistWithHttpInfo($phone) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -421,11 +434,11 @@ public function deleteFromBlacklistWithHttpInfo($phone) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } @@ -522,7 +535,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -536,7 +549,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteFromBlacklistRequest($phone) + public function deleteFromBlacklistRequest($phone) { // verify the required parameter 'phone' is set if ($phone === null || (is_array($phone) && count($phone) === 0)) { @@ -553,6 +566,7 @@ protected function deleteFromBlacklistRequest($phone) $multipart = false; + // path params if ($phone !== null) { $resourcePath = str_replace( @@ -562,8 +576,6 @@ protected function deleteFromBlacklistRequest($phone) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -577,21 +589,17 @@ protected function deleteFromBlacklistRequest($phone) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -601,7 +609,7 @@ protected function deleteFromBlacklistRequest($phone) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -621,7 +629,7 @@ protected function deleteFromBlacklistRequest($phone) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -667,9 +675,16 @@ public function fetchBlacklistWithHttpInfo() } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -680,21 +695,20 @@ public function fetchBlacklistWithHttpInfo() sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Messente\Api\Model\FetchBlacklistSuccess' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -704,9 +718,9 @@ public function fetchBlacklistWithHttpInfo() ]; case 401: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -716,9 +730,9 @@ public function fetchBlacklistWithHttpInfo() ]; default: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -729,11 +743,10 @@ public function fetchBlacklistWithHttpInfo() } $returnType = '\Messente\Api\Model\FetchBlacklistSuccess'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -810,11 +823,10 @@ public function fetchBlacklistAsyncWithHttpInfo() ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -834,7 +846,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -847,7 +859,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function fetchBlacklistRequest() + public function fetchBlacklistRequest() { $resourcePath = '/phonebook/blacklist'; @@ -859,8 +871,7 @@ protected function fetchBlacklistRequest() - // body params - $_tempBody = null; + if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -874,21 +885,17 @@ protected function fetchBlacklistRequest() } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -898,7 +905,7 @@ protected function fetchBlacklistRequest() } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -918,7 +925,7 @@ protected function fetchBlacklistRequest() $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -965,9 +972,16 @@ public function isBlacklistedWithHttpInfo($phone) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -978,11 +992,11 @@ public function isBlacklistedWithHttpInfo($phone) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } @@ -1071,7 +1085,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -1085,7 +1099,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function isBlacklistedRequest($phone) + public function isBlacklistedRequest($phone) { // verify the required parameter 'phone' is set if ($phone === null || (is_array($phone) && count($phone) === 0)) { @@ -1102,6 +1116,7 @@ protected function isBlacklistedRequest($phone) $multipart = false; + // path params if ($phone !== null) { $resourcePath = str_replace( @@ -1111,8 +1126,6 @@ protected function isBlacklistedRequest($phone) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1126,21 +1139,17 @@ protected function isBlacklistedRequest($phone) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1150,7 +1159,7 @@ protected function isBlacklistedRequest($phone) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -1170,7 +1179,7 @@ protected function isBlacklistedRequest($phone) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/lib/Api/ContactsApi.php b/lib/Api/ContactsApi.php index 5c8f73c..73fc90b 100644 --- a/lib/Api/ContactsApi.php +++ b/lib/Api/ContactsApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Set the host index * - * @param int Host index (required) + * @param int $hostIndex Host index (required) */ - public function setHostIndex($host_index) + public function setHostIndex($hostIndex): void { - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Get the host index * - * @return Host index + * @return int Host index */ public function getHostIndex() { @@ -156,9 +157,16 @@ public function addContactToGroupWithHttpInfo($groupId, $phone) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -169,21 +177,20 @@ public function addContactToGroupWithHttpInfo($groupId, $phone) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 201: if ('object' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -193,9 +200,9 @@ public function addContactToGroupWithHttpInfo($groupId, $phone) ]; case 400: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -205,9 +212,9 @@ public function addContactToGroupWithHttpInfo($groupId, $phone) ]; case 401: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -217,9 +224,9 @@ public function addContactToGroupWithHttpInfo($groupId, $phone) ]; case 404: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -229,9 +236,9 @@ public function addContactToGroupWithHttpInfo($groupId, $phone) ]; case 409: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -241,9 +248,9 @@ public function addContactToGroupWithHttpInfo($groupId, $phone) ]; default: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -254,11 +261,10 @@ public function addContactToGroupWithHttpInfo($groupId, $phone) } $returnType = 'object'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -363,11 +369,10 @@ public function addContactToGroupAsyncWithHttpInfo($groupId, $phone) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -387,7 +392,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -402,7 +407,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function addContactToGroupRequest($groupId, $phone) + public function addContactToGroupRequest($groupId, $phone) { // verify the required parameter 'groupId' is set if ($groupId === null || (is_array($groupId) && count($groupId) === 0)) { @@ -425,6 +430,7 @@ protected function addContactToGroupRequest($groupId, $phone) $multipart = false; + // path params if ($groupId !== null) { $resourcePath = str_replace( @@ -442,8 +448,6 @@ protected function addContactToGroupRequest($groupId, $phone) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -457,21 +461,17 @@ protected function addContactToGroupRequest($groupId, $phone) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -481,7 +481,7 @@ protected function addContactToGroupRequest($groupId, $phone) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -501,7 +501,7 @@ protected function addContactToGroupRequest($groupId, $phone) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -549,9 +549,16 @@ public function createContactWithHttpInfo($contactFields) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -562,21 +569,20 @@ public function createContactWithHttpInfo($contactFields) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 201: if ('\Messente\Api\Model\ContactEnvelope' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -586,9 +592,9 @@ public function createContactWithHttpInfo($contactFields) ]; case 400: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -598,9 +604,9 @@ public function createContactWithHttpInfo($contactFields) ]; case 401: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -610,9 +616,9 @@ public function createContactWithHttpInfo($contactFields) ]; case 409: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -622,9 +628,9 @@ public function createContactWithHttpInfo($contactFields) ]; default: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -635,11 +641,10 @@ public function createContactWithHttpInfo($contactFields) } $returnType = '\Messente\Api\Model\ContactEnvelope'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -734,11 +739,10 @@ public function createContactAsyncWithHttpInfo($contactFields) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -758,7 +762,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -772,7 +776,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createContactRequest($contactFields) + public function createContactRequest($contactFields) { // verify the required parameter 'contactFields' is set if ($contactFields === null || (is_array($contactFields) && count($contactFields) === 0)) { @@ -790,11 +794,7 @@ protected function createContactRequest($contactFields) - // body params - $_tempBody = null; - if (isset($contactFields)) { - $_tempBody = $contactFields; - } + if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -808,21 +808,23 @@ protected function createContactRequest($contactFields) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present + if (isset($contactFields)) { if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($contactFields)); } else { - $httpBody = $_tempBody; + $httpBody = $contactFields; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -832,7 +834,7 @@ protected function createContactRequest($contactFields) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -852,7 +854,7 @@ protected function createContactRequest($contactFields) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -899,9 +901,16 @@ public function deleteContactWithHttpInfo($phone) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -912,11 +921,11 @@ public function deleteContactWithHttpInfo($phone) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } @@ -1013,7 +1022,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -1027,7 +1036,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteContactRequest($phone) + public function deleteContactRequest($phone) { // verify the required parameter 'phone' is set if ($phone === null || (is_array($phone) && count($phone) === 0)) { @@ -1044,6 +1053,7 @@ protected function deleteContactRequest($phone) $multipart = false; + // path params if ($phone !== null) { $resourcePath = str_replace( @@ -1053,8 +1063,6 @@ protected function deleteContactRequest($phone) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1068,21 +1076,17 @@ protected function deleteContactRequest($phone) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1092,7 +1096,7 @@ protected function deleteContactRequest($phone) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -1112,7 +1116,7 @@ protected function deleteContactRequest($phone) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -1160,9 +1164,16 @@ public function fetchContactWithHttpInfo($phone) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -1173,21 +1184,20 @@ public function fetchContactWithHttpInfo($phone) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Messente\Api\Model\ContactEnvelope' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1197,9 +1207,9 @@ public function fetchContactWithHttpInfo($phone) ]; case 400: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1209,9 +1219,9 @@ public function fetchContactWithHttpInfo($phone) ]; case 401: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1221,9 +1231,9 @@ public function fetchContactWithHttpInfo($phone) ]; case 404: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1234,11 +1244,10 @@ public function fetchContactWithHttpInfo($phone) } $returnType = '\Messente\Api\Model\ContactEnvelope'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1325,11 +1334,10 @@ public function fetchContactAsyncWithHttpInfo($phone) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1349,7 +1357,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -1363,7 +1371,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function fetchContactRequest($phone) + public function fetchContactRequest($phone) { // verify the required parameter 'phone' is set if ($phone === null || (is_array($phone) && count($phone) === 0)) { @@ -1380,6 +1388,7 @@ protected function fetchContactRequest($phone) $multipart = false; + // path params if ($phone !== null) { $resourcePath = str_replace( @@ -1389,8 +1398,6 @@ protected function fetchContactRequest($phone) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1404,21 +1411,17 @@ protected function fetchContactRequest($phone) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1428,7 +1431,7 @@ protected function fetchContactRequest($phone) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -1448,7 +1451,7 @@ protected function fetchContactRequest($phone) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -1496,9 +1499,16 @@ public function fetchContactGroupsWithHttpInfo($phone) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -1509,21 +1519,20 @@ public function fetchContactGroupsWithHttpInfo($phone) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Messente\Api\Model\GroupListEnvelope' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1533,9 +1542,9 @@ public function fetchContactGroupsWithHttpInfo($phone) ]; case 400: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1545,9 +1554,9 @@ public function fetchContactGroupsWithHttpInfo($phone) ]; case 401: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1557,9 +1566,9 @@ public function fetchContactGroupsWithHttpInfo($phone) ]; case 404: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1570,11 +1579,10 @@ public function fetchContactGroupsWithHttpInfo($phone) } $returnType = '\Messente\Api\Model\GroupListEnvelope'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1661,11 +1669,10 @@ public function fetchContactGroupsAsyncWithHttpInfo($phone) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1685,7 +1692,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -1699,7 +1706,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function fetchContactGroupsRequest($phone) + public function fetchContactGroupsRequest($phone) { // verify the required parameter 'phone' is set if ($phone === null || (is_array($phone) && count($phone) === 0)) { @@ -1716,6 +1723,7 @@ protected function fetchContactGroupsRequest($phone) $multipart = false; + // path params if ($phone !== null) { $resourcePath = str_replace( @@ -1725,8 +1733,6 @@ protected function fetchContactGroupsRequest($phone) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1740,21 +1746,17 @@ protected function fetchContactGroupsRequest($phone) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1764,7 +1766,7 @@ protected function fetchContactGroupsRequest($phone) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -1784,7 +1786,7 @@ protected function fetchContactGroupsRequest($phone) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -1832,9 +1834,16 @@ public function fetchContactsWithHttpInfo($groupIds = null) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -1845,21 +1854,20 @@ public function fetchContactsWithHttpInfo($groupIds = null) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Messente\Api\Model\ContactListEnvelope' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1869,9 +1877,9 @@ public function fetchContactsWithHttpInfo($groupIds = null) ]; case 400: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1881,9 +1889,9 @@ public function fetchContactsWithHttpInfo($groupIds = null) ]; case 401: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1893,9 +1901,9 @@ public function fetchContactsWithHttpInfo($groupIds = null) ]; default: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1906,11 +1914,10 @@ public function fetchContactsWithHttpInfo($groupIds = null) } $returnType = '\Messente\Api\Model\ContactListEnvelope'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1997,11 +2004,10 @@ public function fetchContactsAsyncWithHttpInfo($groupIds = null) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -2021,7 +2027,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -2035,7 +2041,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function fetchContactsRequest($groupIds = null) + public function fetchContactsRequest($groupIds = null) { $resourcePath = '/phonebook/contacts'; @@ -2046,16 +2052,19 @@ protected function fetchContactsRequest($groupIds = null) $multipart = false; // query params - if (is_array($groupIds)) { - $groupIds = ObjectSerializer::serializeCollection($groupIds, 'multi', true); - } if ($groupIds !== null) { - $queryParams['groupIds'] = ObjectSerializer::toQueryValue($groupIds); + if('form' === 'form' && is_array($groupIds)) { + foreach($groupIds as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['groupIds'] = $groupIds; + } } - // body params - $_tempBody = null; + if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -2069,21 +2078,17 @@ protected function fetchContactsRequest($groupIds = null) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -2093,7 +2098,7 @@ protected function fetchContactsRequest($groupIds = null) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -2113,7 +2118,7 @@ protected function fetchContactsRequest($groupIds = null) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -2162,9 +2167,16 @@ public function removeContactFromGroupWithHttpInfo($groupId, $phone) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -2175,11 +2187,11 @@ public function removeContactFromGroupWithHttpInfo($groupId, $phone) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } @@ -2278,7 +2290,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -2293,7 +2305,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function removeContactFromGroupRequest($groupId, $phone) + public function removeContactFromGroupRequest($groupId, $phone) { // verify the required parameter 'groupId' is set if ($groupId === null || (is_array($groupId) && count($groupId) === 0)) { @@ -2316,6 +2328,7 @@ protected function removeContactFromGroupRequest($groupId, $phone) $multipart = false; + // path params if ($groupId !== null) { $resourcePath = str_replace( @@ -2333,8 +2346,6 @@ protected function removeContactFromGroupRequest($groupId, $phone) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -2348,21 +2359,17 @@ protected function removeContactFromGroupRequest($groupId, $phone) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -2372,7 +2379,7 @@ protected function removeContactFromGroupRequest($groupId, $phone) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -2392,7 +2399,7 @@ protected function removeContactFromGroupRequest($groupId, $phone) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -2442,9 +2449,16 @@ public function updateContactWithHttpInfo($phone, $contactUpdateFields) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -2455,21 +2469,20 @@ public function updateContactWithHttpInfo($phone, $contactUpdateFields) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Messente\Api\Model\ContactEnvelope' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -2479,9 +2492,9 @@ public function updateContactWithHttpInfo($phone, $contactUpdateFields) ]; case 400: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -2491,9 +2504,9 @@ public function updateContactWithHttpInfo($phone, $contactUpdateFields) ]; case 401: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -2503,9 +2516,9 @@ public function updateContactWithHttpInfo($phone, $contactUpdateFields) ]; case 404: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -2515,9 +2528,9 @@ public function updateContactWithHttpInfo($phone, $contactUpdateFields) ]; default: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -2528,11 +2541,10 @@ public function updateContactWithHttpInfo($phone, $contactUpdateFields) } $returnType = '\Messente\Api\Model\ContactEnvelope'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -2629,11 +2641,10 @@ public function updateContactAsyncWithHttpInfo($phone, $contactUpdateFields) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -2653,7 +2664,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -2668,7 +2679,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function updateContactRequest($phone, $contactUpdateFields) + public function updateContactRequest($phone, $contactUpdateFields) { // verify the required parameter 'phone' is set if ($phone === null || (is_array($phone) && count($phone) === 0)) { @@ -2691,6 +2702,7 @@ protected function updateContactRequest($phone, $contactUpdateFields) $multipart = false; + // path params if ($phone !== null) { $resourcePath = str_replace( @@ -2700,11 +2712,6 @@ protected function updateContactRequest($phone, $contactUpdateFields) ); } - // body params - $_tempBody = null; - if (isset($contactUpdateFields)) { - $_tempBody = $contactUpdateFields; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -2718,21 +2725,23 @@ protected function updateContactRequest($phone, $contactUpdateFields) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present + if (isset($contactUpdateFields)) { if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($contactUpdateFields)); } else { - $httpBody = $_tempBody; + $httpBody = $contactUpdateFields; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -2742,7 +2751,7 @@ protected function updateContactRequest($phone, $contactUpdateFields) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -2762,7 +2771,7 @@ protected function updateContactRequest($phone, $contactUpdateFields) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'PATCH', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/lib/Api/DeliveryReportApi.php b/lib/Api/DeliveryReportApi.php index 4b9c9de..02d348b 100644 --- a/lib/Api/DeliveryReportApi.php +++ b/lib/Api/DeliveryReportApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Set the host index * - * @param int Host index (required) + * @param int $hostIndex Host index (required) */ - public function setHostIndex($host_index) + public function setHostIndex($hostIndex): void { - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Get the host index * - * @return Host index + * @return int Host index */ public function getHostIndex() { @@ -154,9 +155,16 @@ public function retrieveDeliveryReportWithHttpInfo($omnimessageId) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -167,21 +175,20 @@ public function retrieveDeliveryReportWithHttpInfo($omnimessageId) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Messente\Api\Model\DeliveryReportResponse' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -191,9 +198,9 @@ public function retrieveDeliveryReportWithHttpInfo($omnimessageId) ]; case 404: if ('\Messente\Api\Model\ErrorOmnichannel' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -204,11 +211,10 @@ public function retrieveDeliveryReportWithHttpInfo($omnimessageId) } $returnType = '\Messente\Api\Model\DeliveryReportResponse'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -279,11 +285,10 @@ public function retrieveDeliveryReportAsyncWithHttpInfo($omnimessageId) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -303,7 +308,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -317,7 +322,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function retrieveDeliveryReportRequest($omnimessageId) + public function retrieveDeliveryReportRequest($omnimessageId) { // verify the required parameter 'omnimessageId' is set if ($omnimessageId === null || (is_array($omnimessageId) && count($omnimessageId) === 0)) { @@ -334,6 +339,7 @@ protected function retrieveDeliveryReportRequest($omnimessageId) $multipart = false; + // path params if ($omnimessageId !== null) { $resourcePath = str_replace( @@ -343,8 +349,6 @@ protected function retrieveDeliveryReportRequest($omnimessageId) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -358,21 +362,17 @@ protected function retrieveDeliveryReportRequest($omnimessageId) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -382,7 +382,7 @@ protected function retrieveDeliveryReportRequest($omnimessageId) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -402,7 +402,7 @@ protected function retrieveDeliveryReportRequest($omnimessageId) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/lib/Api/GroupsApi.php b/lib/Api/GroupsApi.php index 7188bbb..8bfaca6 100644 --- a/lib/Api/GroupsApi.php +++ b/lib/Api/GroupsApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Set the host index * - * @param int Host index (required) + * @param int $hostIndex Host index (required) */ - public function setHostIndex($host_index) + public function setHostIndex($hostIndex): void { - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Get the host index * - * @return Host index + * @return int Host index */ public function getHostIndex() { @@ -154,9 +155,16 @@ public function createGroupWithHttpInfo($groupName) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -167,21 +175,20 @@ public function createGroupWithHttpInfo($groupName) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 201: if ('\Messente\Api\Model\GroupEnvelope' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -191,9 +198,9 @@ public function createGroupWithHttpInfo($groupName) ]; case 400: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -203,9 +210,9 @@ public function createGroupWithHttpInfo($groupName) ]; case 401: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -215,9 +222,9 @@ public function createGroupWithHttpInfo($groupName) ]; default: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -228,11 +235,10 @@ public function createGroupWithHttpInfo($groupName) } $returnType = '\Messente\Api\Model\GroupEnvelope'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -319,11 +325,10 @@ public function createGroupAsyncWithHttpInfo($groupName) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -343,7 +348,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -357,7 +362,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createGroupRequest($groupName) + public function createGroupRequest($groupName) { // verify the required parameter 'groupName' is set if ($groupName === null || (is_array($groupName) && count($groupName) === 0)) { @@ -375,11 +380,7 @@ protected function createGroupRequest($groupName) - // body params - $_tempBody = null; - if (isset($groupName)) { - $_tempBody = $groupName; - } + if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -393,21 +394,23 @@ protected function createGroupRequest($groupName) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present + if (isset($groupName)) { if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($groupName)); } else { - $httpBody = $_tempBody; + $httpBody = $groupName; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -417,7 +420,7 @@ protected function createGroupRequest($groupName) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -437,7 +440,7 @@ protected function createGroupRequest($groupName) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -484,9 +487,16 @@ public function deleteGroupWithHttpInfo($groupId) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -497,11 +507,11 @@ public function deleteGroupWithHttpInfo($groupId) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } @@ -590,7 +600,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -604,7 +614,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteGroupRequest($groupId) + public function deleteGroupRequest($groupId) { // verify the required parameter 'groupId' is set if ($groupId === null || (is_array($groupId) && count($groupId) === 0)) { @@ -621,6 +631,7 @@ protected function deleteGroupRequest($groupId) $multipart = false; + // path params if ($groupId !== null) { $resourcePath = str_replace( @@ -630,8 +641,6 @@ protected function deleteGroupRequest($groupId) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -645,21 +654,17 @@ protected function deleteGroupRequest($groupId) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -669,7 +674,7 @@ protected function deleteGroupRequest($groupId) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -689,7 +694,7 @@ protected function deleteGroupRequest($groupId) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -737,9 +742,16 @@ public function fetchGroupWithHttpInfo($groupId) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -750,21 +762,20 @@ public function fetchGroupWithHttpInfo($groupId) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Messente\Api\Model\GroupEnvelope' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -774,9 +785,9 @@ public function fetchGroupWithHttpInfo($groupId) ]; case 401: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -786,9 +797,9 @@ public function fetchGroupWithHttpInfo($groupId) ]; case 404: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -799,11 +810,10 @@ public function fetchGroupWithHttpInfo($groupId) } $returnType = '\Messente\Api\Model\GroupEnvelope'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -882,11 +892,10 @@ public function fetchGroupAsyncWithHttpInfo($groupId) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -906,7 +915,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -920,7 +929,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function fetchGroupRequest($groupId) + public function fetchGroupRequest($groupId) { // verify the required parameter 'groupId' is set if ($groupId === null || (is_array($groupId) && count($groupId) === 0)) { @@ -937,6 +946,7 @@ protected function fetchGroupRequest($groupId) $multipart = false; + // path params if ($groupId !== null) { $resourcePath = str_replace( @@ -946,8 +956,6 @@ protected function fetchGroupRequest($groupId) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -961,21 +969,17 @@ protected function fetchGroupRequest($groupId) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -985,7 +989,7 @@ protected function fetchGroupRequest($groupId) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -1005,7 +1009,7 @@ protected function fetchGroupRequest($groupId) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -1051,9 +1055,16 @@ public function fetchGroupsWithHttpInfo() } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -1064,21 +1075,20 @@ public function fetchGroupsWithHttpInfo() sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Messente\Api\Model\GroupListEnvelope' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1088,9 +1098,9 @@ public function fetchGroupsWithHttpInfo() ]; case 401: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1100,9 +1110,9 @@ public function fetchGroupsWithHttpInfo() ]; default: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1113,11 +1123,10 @@ public function fetchGroupsWithHttpInfo() } $returnType = '\Messente\Api\Model\GroupListEnvelope'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1194,11 +1203,10 @@ public function fetchGroupsAsyncWithHttpInfo() ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1218,7 +1226,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -1231,7 +1239,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function fetchGroupsRequest() + public function fetchGroupsRequest() { $resourcePath = '/phonebook/groups'; @@ -1243,8 +1251,7 @@ protected function fetchGroupsRequest() - // body params - $_tempBody = null; + if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1258,21 +1265,17 @@ protected function fetchGroupsRequest() } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1282,7 +1285,7 @@ protected function fetchGroupsRequest() } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -1302,7 +1305,7 @@ protected function fetchGroupsRequest() $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -1352,9 +1355,16 @@ public function updateGroupWithHttpInfo($groupId, $groupName) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -1365,21 +1375,20 @@ public function updateGroupWithHttpInfo($groupId, $groupName) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Messente\Api\Model\GroupEnvelope' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1389,9 +1398,9 @@ public function updateGroupWithHttpInfo($groupId, $groupName) ]; case 400: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1401,9 +1410,9 @@ public function updateGroupWithHttpInfo($groupId, $groupName) ]; case 401: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1413,9 +1422,9 @@ public function updateGroupWithHttpInfo($groupId, $groupName) ]; case 404: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1425,9 +1434,9 @@ public function updateGroupWithHttpInfo($groupId, $groupName) ]; default: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1438,11 +1447,10 @@ public function updateGroupWithHttpInfo($groupId, $groupName) } $returnType = '\Messente\Api\Model\GroupEnvelope'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1539,11 +1547,10 @@ public function updateGroupAsyncWithHttpInfo($groupId, $groupName) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1563,7 +1570,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -1578,7 +1585,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function updateGroupRequest($groupId, $groupName) + public function updateGroupRequest($groupId, $groupName) { // verify the required parameter 'groupId' is set if ($groupId === null || (is_array($groupId) && count($groupId) === 0)) { @@ -1601,6 +1608,7 @@ protected function updateGroupRequest($groupId, $groupName) $multipart = false; + // path params if ($groupId !== null) { $resourcePath = str_replace( @@ -1610,11 +1618,6 @@ protected function updateGroupRequest($groupId, $groupName) ); } - // body params - $_tempBody = null; - if (isset($groupName)) { - $_tempBody = $groupName; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1628,21 +1631,23 @@ protected function updateGroupRequest($groupId, $groupName) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present + if (isset($groupName)) { if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($groupName)); } else { - $httpBody = $_tempBody; + $httpBody = $groupName; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1652,7 +1657,7 @@ protected function updateGroupRequest($groupId, $groupName) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -1672,7 +1677,7 @@ protected function updateGroupRequest($groupId, $groupName) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'PUT', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/lib/Api/NumberLookupApi.php b/lib/Api/NumberLookupApi.php index 2fd2451..54abbe4 100644 --- a/lib/Api/NumberLookupApi.php +++ b/lib/Api/NumberLookupApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Set the host index * - * @param int Host index (required) + * @param int $hostIndex Host index (required) */ - public function setHostIndex($host_index) + public function setHostIndex($hostIndex): void { - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Get the host index * - * @return Host index + * @return int Host index */ public function getHostIndex() { @@ -154,9 +155,16 @@ public function fetchInfoWithHttpInfo($numbersToInvestigate) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -167,21 +175,20 @@ public function fetchInfoWithHttpInfo($numbersToInvestigate) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Messente\Api\Model\SyncNumberLookupSuccess' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -191,9 +198,9 @@ public function fetchInfoWithHttpInfo($numbersToInvestigate) ]; case 400: if ('\Messente\Api\Model\ErrorNumberLookup' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -203,9 +210,9 @@ public function fetchInfoWithHttpInfo($numbersToInvestigate) ]; case 401: if ('\Messente\Api\Model\ErrorNumberLookup' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -215,9 +222,9 @@ public function fetchInfoWithHttpInfo($numbersToInvestigate) ]; case 402: if ('\Messente\Api\Model\ErrorNumberLookup' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -228,11 +235,10 @@ public function fetchInfoWithHttpInfo($numbersToInvestigate) } $returnType = '\Messente\Api\Model\SyncNumberLookupSuccess'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -319,11 +325,10 @@ public function fetchInfoAsyncWithHttpInfo($numbersToInvestigate) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -343,7 +348,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -357,7 +362,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function fetchInfoRequest($numbersToInvestigate) + public function fetchInfoRequest($numbersToInvestigate) { // verify the required parameter 'numbersToInvestigate' is set if ($numbersToInvestigate === null || (is_array($numbersToInvestigate) && count($numbersToInvestigate) === 0)) { @@ -375,11 +380,7 @@ protected function fetchInfoRequest($numbersToInvestigate) - // body params - $_tempBody = null; - if (isset($numbersToInvestigate)) { - $_tempBody = $numbersToInvestigate; - } + if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -393,21 +394,23 @@ protected function fetchInfoRequest($numbersToInvestigate) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present + if (isset($numbersToInvestigate)) { if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($numbersToInvestigate)); } else { - $httpBody = $_tempBody; + $httpBody = $numbersToInvestigate; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -417,7 +420,7 @@ protected function fetchInfoRequest($numbersToInvestigate) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -437,7 +440,7 @@ protected function fetchInfoRequest($numbersToInvestigate) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/lib/Api/OmnimessageApi.php b/lib/Api/OmnimessageApi.php index 220bbe6..15867bd 100644 --- a/lib/Api/OmnimessageApi.php +++ b/lib/Api/OmnimessageApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Set the host index * - * @param int Host index (required) + * @param int $hostIndex Host index (required) */ - public function setHostIndex($host_index) + public function setHostIndex($hostIndex): void { - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Get the host index * - * @return Host index + * @return int Host index */ public function getHostIndex() { @@ -154,9 +155,16 @@ public function cancelScheduledMessageWithHttpInfo($omnimessageId) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -167,21 +175,20 @@ public function cancelScheduledMessageWithHttpInfo($omnimessageId) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 202: if ('object' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -191,9 +198,9 @@ public function cancelScheduledMessageWithHttpInfo($omnimessageId) ]; case 404: if ('\Messente\Api\Model\ErrorOmnichannel' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -204,11 +211,10 @@ public function cancelScheduledMessageWithHttpInfo($omnimessageId) } $returnType = 'object'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -279,11 +285,10 @@ public function cancelScheduledMessageAsyncWithHttpInfo($omnimessageId) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -303,7 +308,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -317,7 +322,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function cancelScheduledMessageRequest($omnimessageId) + public function cancelScheduledMessageRequest($omnimessageId) { // verify the required parameter 'omnimessageId' is set if ($omnimessageId === null || (is_array($omnimessageId) && count($omnimessageId) === 0)) { @@ -334,6 +339,7 @@ protected function cancelScheduledMessageRequest($omnimessageId) $multipart = false; + // path params if ($omnimessageId !== null) { $resourcePath = str_replace( @@ -343,8 +349,6 @@ protected function cancelScheduledMessageRequest($omnimessageId) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -358,21 +362,17 @@ protected function cancelScheduledMessageRequest($omnimessageId) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -382,7 +382,7 @@ protected function cancelScheduledMessageRequest($omnimessageId) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -402,7 +402,7 @@ protected function cancelScheduledMessageRequest($omnimessageId) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -450,9 +450,16 @@ public function sendOmnimessageWithHttpInfo($omnimessage) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -463,21 +470,20 @@ public function sendOmnimessageWithHttpInfo($omnimessage) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 201: if ('\Messente\Api\Model\OmniMessageCreateSuccessResponse' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -487,9 +493,9 @@ public function sendOmnimessageWithHttpInfo($omnimessage) ]; case 400: if ('\Messente\Api\Model\ErrorOmnichannel' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -500,11 +506,10 @@ public function sendOmnimessageWithHttpInfo($omnimessage) } $returnType = '\Messente\Api\Model\OmniMessageCreateSuccessResponse'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -575,11 +580,10 @@ public function sendOmnimessageAsyncWithHttpInfo($omnimessage) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -599,7 +603,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -613,7 +617,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function sendOmnimessageRequest($omnimessage) + public function sendOmnimessageRequest($omnimessage) { // verify the required parameter 'omnimessage' is set if ($omnimessage === null || (is_array($omnimessage) && count($omnimessage) === 0)) { @@ -631,11 +635,7 @@ protected function sendOmnimessageRequest($omnimessage) - // body params - $_tempBody = null; - if (isset($omnimessage)) { - $_tempBody = $omnimessage; - } + if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -649,21 +649,23 @@ protected function sendOmnimessageRequest($omnimessage) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present + if (isset($omnimessage)) { if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($omnimessage)); } else { - $httpBody = $_tempBody; + $httpBody = $omnimessage; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -673,7 +675,7 @@ protected function sendOmnimessageRequest($omnimessage) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -693,7 +695,7 @@ protected function sendOmnimessageRequest($omnimessage) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/lib/Api/StatisticsApi.php b/lib/Api/StatisticsApi.php index 8af4d30..a5b109f 100644 --- a/lib/Api/StatisticsApi.php +++ b/lib/Api/StatisticsApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Set the host index * - * @param int Host index (required) + * @param int $hostIndex Host index (required) */ - public function setHostIndex($host_index) + public function setHostIndex($hostIndex): void { - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Get the host index * - * @return Host index + * @return int Host index */ public function getHostIndex() { @@ -154,9 +155,16 @@ public function createStatisticsReportWithHttpInfo($statisticsReportSettings) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -167,21 +175,20 @@ public function createStatisticsReportWithHttpInfo($statisticsReportSettings) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Messente\Api\Model\StatisticsReportSuccess' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -191,9 +198,9 @@ public function createStatisticsReportWithHttpInfo($statisticsReportSettings) ]; case 400: if ('\Messente\Api\Model\ErrorStatistics' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -203,9 +210,9 @@ public function createStatisticsReportWithHttpInfo($statisticsReportSettings) ]; case 401: if ('\Messente\Api\Model\ErrorStatistics' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -215,9 +222,9 @@ public function createStatisticsReportWithHttpInfo($statisticsReportSettings) ]; case 422: if ('\Messente\Api\Model\ErrorStatistics' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -227,9 +234,9 @@ public function createStatisticsReportWithHttpInfo($statisticsReportSettings) ]; case 500: if ('\Messente\Api\Model\ErrorStatistics' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -240,11 +247,10 @@ public function createStatisticsReportWithHttpInfo($statisticsReportSettings) } $returnType = '\Messente\Api\Model\StatisticsReportSuccess'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -339,11 +345,10 @@ public function createStatisticsReportAsyncWithHttpInfo($statisticsReportSetting ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -363,7 +368,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -377,7 +382,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createStatisticsReportRequest($statisticsReportSettings) + public function createStatisticsReportRequest($statisticsReportSettings) { // verify the required parameter 'statisticsReportSettings' is set if ($statisticsReportSettings === null || (is_array($statisticsReportSettings) && count($statisticsReportSettings) === 0)) { @@ -395,11 +400,7 @@ protected function createStatisticsReportRequest($statisticsReportSettings) - // body params - $_tempBody = null; - if (isset($statisticsReportSettings)) { - $_tempBody = $statisticsReportSettings; - } + if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -413,21 +414,23 @@ protected function createStatisticsReportRequest($statisticsReportSettings) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present + if (isset($statisticsReportSettings)) { if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($statisticsReportSettings)); } else { - $httpBody = $_tempBody; + $httpBody = $statisticsReportSettings; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -437,7 +440,7 @@ protected function createStatisticsReportRequest($statisticsReportSettings) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -457,7 +460,7 @@ protected function createStatisticsReportRequest($statisticsReportSettings) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/lib/ApiException.php b/lib/ApiException.php index a4fe6e6..5e918bc 100644 --- a/lib/ApiException.php +++ b/lib/ApiException.php @@ -1,7 +1,7 @@ getTempFolderPath() . PHP_EOL; return $report; @@ -408,7 +411,7 @@ public static function toDebugReport() * * @param string $apiKeyIdentifier name of apikey * - * @return string API key with the prefix + * @return null|string API key with the prefix */ public function getApiKeyWithPrefix($apiKeyIdentifier) { @@ -431,29 +434,29 @@ public function getApiKeyWithPrefix($apiKeyIdentifier) /** * Returns an array of host settings * - * @return an array of host settings + * @return array an array of host settings */ public function getHostSettings() { - return array( - array( - "url" => "https://api.messente.com/v1", - "description" => "No description provided", - ) - ); + return [ + [ + "url" => "https://api.messente.com/v1", + "description" => "No description provided", + ] + ]; } /** * Returns URL based on the index and variables * - * @param index array index of the host settings - * @param variables hash of variable and the corresponding value (optional) - * @return URL based on host settings + * @param int $index index of the host settings + * @param array|null $variables hash of variable and the corresponding value (optional) + * @return string URL based on host settings */ public function getHostFromSettings($index, $variables = null) { if (null === $variables) { - $variables = array(); + $variables = []; } $hosts = $this->getHostSettings(); @@ -467,9 +470,9 @@ public function getHostFromSettings($index, $variables = null) $url = $host["url"]; // go through variable and assign a value - foreach ($host["variables"] as $name => $variable) { + foreach ($host["variables"] ?? [] as $name => $variable) { if (array_key_exists($name, $variables)) { // check to see if it's in the variables provided by the user - if (in_array($variables[$name], $variable["enum_values"])) { // check to see if the value is in the enum + if (in_array($variables[$name], $variable["enum_values"], true)) { // check to see if the value is in the enum $url = str_replace("{".$name."}", $variables[$name], $url); } else { throw new \InvalidArgumentException("The variable `$name` in the host URL has invalid value ".$variables[$name].". Must be ".join(',', $variable["enum_values"])."."); diff --git a/lib/HeaderSelector.php b/lib/HeaderSelector.php index 05795b9..a149e1d 100644 --- a/lib/HeaderSelector.php +++ b/lib/HeaderSelector.php @@ -1,7 +1,7 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class ContactEnvelope implements ModelInterface, ArrayAccess +class ContactEnvelope implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -65,27 +68,13 @@ class ContactEnvelope implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -106,60 +95,6 @@ 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 @@ -229,9 +164,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -248,18 +180,7 @@ public function getModelName() */ public function __construct(array $data = 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; + $this->container['contact'] = $data['contact'] ?? null; } /** @@ -301,16 +222,10 @@ public function getContact() * * @param \Messente\Api\Model\ContactResponseFields|null $contact contact * - * @return $this + * @return self */ public function setContact($contact) { - - - if (is_null($contact)) { - throw new \InvalidArgumentException('non-nullable contact cannot be null'); - } - $this->container['contact'] = $contact; return $this; @@ -332,18 +247,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -368,6 +283,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -380,6 +307,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/ContactFields.php b/lib/Model/ContactFields.php index defdf21..7fc55a0 100644 --- a/lib/Model/ContactFields.php +++ b/lib/Model/ContactFields.php @@ -2,7 +2,7 @@ /** * ContactFields * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class ContactFields implements ModelInterface, ArrayAccess +class ContactFields implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -74,6 +77,8 @@ class ContactFields implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'phoneNumber' => null, @@ -88,31 +93,6 @@ 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 * @@ -133,60 +113,6 @@ 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 @@ -283,9 +209,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -302,27 +225,16 @@ public function getModelName() */ public function __construct(array $data = 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; + $this->container['phoneNumber'] = $data['phoneNumber'] ?? null; + $this->container['email'] = $data['email'] ?? null; + $this->container['firstName'] = $data['firstName'] ?? null; + $this->container['lastName'] = $data['lastName'] ?? null; + $this->container['company'] = $data['company'] ?? null; + $this->container['title'] = $data['title'] ?? null; + $this->container['custom'] = $data['custom'] ?? null; + $this->container['custom2'] = $data['custom2'] ?? null; + $this->container['custom3'] = $data['custom3'] ?? null; + $this->container['custom4'] = $data['custom4'] ?? null; } /** @@ -367,16 +279,10 @@ public function getPhoneNumber() * * @param string $phoneNumber Phone number in e.164 format * - * @return $this + * @return self */ public function setPhoneNumber($phoneNumber) { - - - if (is_null($phoneNumber)) { - throw new \InvalidArgumentException('non-nullable phoneNumber cannot be null'); - } - $this->container['phoneNumber'] = $phoneNumber; return $this; @@ -397,23 +303,10 @@ public function getEmail() * * @param string|null $email The email of the contact * - * @return $this + * @return self */ 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; @@ -434,23 +327,10 @@ public function getFirstName() * * @param string|null $firstName The first name of the contact * - * @return $this + * @return self */ 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; @@ -471,23 +351,10 @@ public function getLastName() * * @param string|null $lastName The last name of the contact * - * @return $this + * @return self */ 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; @@ -508,23 +375,10 @@ public function getCompany() * * @param string|null $company The company of the contact * - * @return $this + * @return self */ 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; @@ -545,23 +399,10 @@ public function getTitle() * * @param string|null $title The title of the contact * - * @return $this + * @return self */ 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; @@ -582,23 +423,10 @@ public function getCustom() * * @param string|null $custom The first custom field * - * @return $this + * @return self */ 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; @@ -619,23 +447,10 @@ public function getCustom2() * * @param string|null $custom2 The second custom field * - * @return $this + * @return self */ 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; @@ -656,23 +471,10 @@ public function getCustom3() * * @param string|null $custom3 The third custom field * - * @return $this + * @return self */ 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; @@ -693,23 +495,10 @@ public function getCustom4() * * @param string|null $custom4 The fourth custom field * - * @return $this + * @return self */ 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; @@ -731,18 +520,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -767,6 +556,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -779,6 +580,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/ContactListEnvelope.php b/lib/Model/ContactListEnvelope.php index 0b730a5..b225830 100644 --- a/lib/Model/ContactListEnvelope.php +++ b/lib/Model/ContactListEnvelope.php @@ -2,7 +2,7 @@ /** * ContactListEnvelope * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class ContactListEnvelope implements ModelInterface, ArrayAccess +class ContactListEnvelope implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -65,27 +68,13 @@ class ContactListEnvelope implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -106,60 +95,6 @@ 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 @@ -229,9 +164,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -248,18 +180,7 @@ public function getModelName() */ public function __construct(array $data = 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; + $this->container['contacts'] = $data['contacts'] ?? null; } /** @@ -301,16 +222,12 @@ public function getContacts() * * @param \Messente\Api\Model\ContactResponseFields[]|null $contacts An array of contacts * - * @return $this + * @return self */ public function setContacts($contacts) { - if (is_null($contacts)) { - throw new \InvalidArgumentException('non-nullable contacts cannot be null'); - } - $this->container['contacts'] = $contacts; return $this; @@ -332,18 +249,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -368,6 +285,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -380,6 +309,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/ContactResponseFields.php b/lib/Model/ContactResponseFields.php index 225a03b..1b44998 100644 --- a/lib/Model/ContactResponseFields.php +++ b/lib/Model/ContactResponseFields.php @@ -2,7 +2,7 @@ /** * ContactResponseFields * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class ContactResponseFields implements ModelInterface, ArrayAccess +class ContactResponseFields implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -75,6 +78,8 @@ class ContactResponseFields implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'phoneNumber' => null, @@ -90,32 +95,6 @@ class ContactResponseFields implements ModelInterface, ArrayAccess 'scheduledDeletionDate' => 'date' ]; - /** - * 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, - 'scheduledDeletionDate' => 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 * @@ -136,60 +115,6 @@ 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 @@ -289,9 +214,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -308,28 +230,17 @@ public function getModelName() */ public function __construct(array $data = 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); - $this->setIfExists('scheduledDeletionDate', $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; + $this->container['phoneNumber'] = $data['phoneNumber'] ?? null; + $this->container['email'] = $data['email'] ?? null; + $this->container['firstName'] = $data['firstName'] ?? null; + $this->container['lastName'] = $data['lastName'] ?? null; + $this->container['company'] = $data['company'] ?? null; + $this->container['title'] = $data['title'] ?? null; + $this->container['custom'] = $data['custom'] ?? null; + $this->container['custom2'] = $data['custom2'] ?? null; + $this->container['custom3'] = $data['custom3'] ?? null; + $this->container['custom4'] = $data['custom4'] ?? null; + $this->container['scheduledDeletionDate'] = $data['scheduledDeletionDate'] ?? null; } /** @@ -371,16 +282,10 @@ public function getPhoneNumber() * * @param string|null $phoneNumber Phone number in e.164 format * - * @return $this + * @return self */ public function setPhoneNumber($phoneNumber) { - - - if (is_null($phoneNumber)) { - throw new \InvalidArgumentException('non-nullable phoneNumber cannot be null'); - } - $this->container['phoneNumber'] = $phoneNumber; return $this; @@ -401,23 +306,10 @@ public function getEmail() * * @param string|null $email The email of the contact * - * @return $this + * @return self */ 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; @@ -438,23 +330,10 @@ public function getFirstName() * * @param string|null $firstName The first name of the contact * - * @return $this + * @return self */ 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; @@ -475,23 +354,10 @@ public function getLastName() * * @param string|null $lastName The last name of the contact * - * @return $this + * @return self */ 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; @@ -512,23 +378,10 @@ public function getCompany() * * @param string|null $company The company of the contact * - * @return $this + * @return self */ 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; @@ -549,23 +402,10 @@ public function getTitle() * * @param string|null $title The title of the contact * - * @return $this + * @return self */ 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; @@ -586,23 +426,10 @@ public function getCustom() * * @param string|null $custom The first custom field * - * @return $this + * @return self */ 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; @@ -623,23 +450,10 @@ public function getCustom2() * * @param string|null $custom2 The second custom field * - * @return $this + * @return self */ 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; @@ -660,23 +474,10 @@ public function getCustom3() * * @param string|null $custom3 The third custom field * - * @return $this + * @return self */ 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; @@ -697,23 +498,10 @@ public function getCustom4() * * @param string|null $custom4 The fourth custom field * - * @return $this + * @return self */ 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; @@ -734,23 +522,10 @@ public function getScheduledDeletionDate() * * @param \DateTime|null $scheduledDeletionDate The date in ISO 8601 format, YYYY-MM-DD, on which the contact is going to be deleted because it has not belonged to a group for 30 days * - * @return $this + * @return self */ public function setScheduledDeletionDate($scheduledDeletionDate) { - - if (is_null($scheduledDeletionDate)) { - array_push($this->openAPINullablesSetToNull, 'scheduledDeletionDate'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('scheduledDeletionDate', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - - $this->container['scheduledDeletionDate'] = $scheduledDeletionDate; return $this; @@ -772,18 +547,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -808,6 +583,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -820,6 +607,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/ContactUpdateFields.php b/lib/Model/ContactUpdateFields.php index 2f731b6..1f4c757 100644 --- a/lib/Model/ContactUpdateFields.php +++ b/lib/Model/ContactUpdateFields.php @@ -2,7 +2,7 @@ /** * ContactUpdateFields * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class ContactUpdateFields implements ModelInterface, ArrayAccess +class ContactUpdateFields implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -73,6 +76,8 @@ class ContactUpdateFields implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'email' => null, @@ -86,30 +91,6 @@ 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 * @@ -130,60 +111,6 @@ 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 @@ -277,9 +204,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -296,26 +220,15 @@ public function getModelName() */ public function __construct(array $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; + $this->container['email'] = $data['email'] ?? null; + $this->container['firstName'] = $data['firstName'] ?? null; + $this->container['lastName'] = $data['lastName'] ?? null; + $this->container['company'] = $data['company'] ?? null; + $this->container['title'] = $data['title'] ?? null; + $this->container['custom'] = $data['custom'] ?? null; + $this->container['custom2'] = $data['custom2'] ?? null; + $this->container['custom3'] = $data['custom3'] ?? null; + $this->container['custom4'] = $data['custom4'] ?? null; } /** @@ -357,23 +270,10 @@ public function getEmail() * * @param string|null $email The email of the contact * - * @return $this + * @return self */ 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; @@ -394,23 +294,10 @@ public function getFirstName() * * @param string|null $firstName The first name of the contact * - * @return $this + * @return self */ 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; @@ -431,23 +318,10 @@ public function getLastName() * * @param string|null $lastName The last name of the contact * - * @return $this + * @return self */ 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; @@ -468,23 +342,10 @@ public function getCompany() * * @param string|null $company The company of the contact * - * @return $this + * @return self */ 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; @@ -505,23 +366,10 @@ public function getTitle() * * @param string|null $title The title of the contact * - * @return $this + * @return self */ 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; @@ -542,23 +390,10 @@ public function getCustom() * * @param string|null $custom The first custom field * - * @return $this + * @return self */ 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; @@ -579,23 +414,10 @@ public function getCustom2() * * @param string|null $custom2 The second custom field * - * @return $this + * @return self */ 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; @@ -616,23 +438,10 @@ public function getCustom3() * * @param string|null $custom3 The third custom field * - * @return $this + * @return self */ 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; @@ -653,23 +462,10 @@ public function getCustom4() * * @param string|null $custom4 The fourth custom field * - * @return $this + * @return self */ 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; @@ -691,18 +487,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -727,6 +523,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -739,6 +547,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/DeliveryReportResponse.php b/lib/Model/DeliveryReportResponse.php index c078fea..0ac1bdb 100644 --- a/lib/Model/DeliveryReportResponse.php +++ b/lib/Model/DeliveryReportResponse.php @@ -2,7 +2,7 @@ /** * DeliveryReportResponse * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class DeliveryReportResponse implements ModelInterface, ArrayAccess +class DeliveryReportResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -67,6 +70,8 @@ class DeliveryReportResponse implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'statuses' => null, @@ -74,24 +79,6 @@ 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 * @@ -112,60 +99,6 @@ 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 @@ -241,9 +174,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -260,20 +190,9 @@ public function getModelName() */ public function __construct(array $data = 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; + $this->container['statuses'] = $data['statuses'] ?? null; + $this->container['to'] = $data['to'] ?? null; + $this->container['omnimessageId'] = $data['omnimessageId'] ?? null; } /** @@ -324,16 +243,10 @@ public function getStatuses() * * @param \Messente\Api\Model\DeliveryResult[] $statuses Contains the delivery reports for each channel, ordered by send order * - * @return $this + * @return self */ public function setStatuses($statuses) { - - - if (is_null($statuses)) { - throw new \InvalidArgumentException('non-nullable statuses cannot be null'); - } - $this->container['statuses'] = $statuses; return $this; @@ -354,16 +267,10 @@ public function getTo() * * @param string $to Phone number in e.164 format * - * @return $this + * @return self */ public function setTo($to) { - - - if (is_null($to)) { - throw new \InvalidArgumentException('non-nullable to cannot be null'); - } - $this->container['to'] = $to; return $this; @@ -384,16 +291,10 @@ public function getOmnimessageId() * * @param string $omnimessageId Unique identifier for the omnimessage * - * @return $this + * @return self */ public function setOmnimessageId($omnimessageId) { - - - if (is_null($omnimessageId)) { - throw new \InvalidArgumentException('non-nullable omnimessageId cannot be null'); - } - $this->container['omnimessageId'] = $omnimessageId; return $this; @@ -415,18 +316,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -451,6 +352,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -463,6 +376,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/DeliveryResult.php b/lib/Model/DeliveryResult.php index 3dd6dde..049d5e3 100644 --- a/lib/Model/DeliveryResult.php +++ b/lib/Model/DeliveryResult.php @@ -2,7 +2,7 @@ /** * DeliveryResult * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class DeliveryResult implements ModelInterface, ArrayAccess +class DeliveryResult implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -70,6 +73,8 @@ class DeliveryResult implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'status' => null, @@ -80,27 +85,6 @@ 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 * @@ -121,60 +105,6 @@ 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 @@ -259,9 +189,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -278,23 +205,12 @@ public function getModelName() */ public function __construct(array $data = 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; + $this->container['status'] = $data['status'] ?? null; + $this->container['channel'] = $data['channel'] ?? null; + $this->container['messageId'] = $data['messageId'] ?? null; + $this->container['error'] = $data['error'] ?? null; + $this->container['err'] = $data['err'] ?? null; + $this->container['timestamp'] = $data['timestamp'] ?? null; } /** @@ -336,16 +252,10 @@ public function getStatus() * * @param \Messente\Api\Model\Status|null $status status * - * @return $this + * @return self */ public function setStatus($status) { - - - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; return $this; @@ -366,16 +276,10 @@ public function getChannel() * * @param \Messente\Api\Model\Channel|null $channel channel * - * @return $this + * @return self */ public function setChannel($channel) { - - - if (is_null($channel)) { - throw new \InvalidArgumentException('non-nullable channel cannot be null'); - } - $this->container['channel'] = $channel; return $this; @@ -396,16 +300,10 @@ public function getMessageId() * * @param string|null $messageId Unique identifier for the message * - * @return $this + * @return self */ public function setMessageId($messageId) { - - - if (is_null($messageId)) { - throw new \InvalidArgumentException('non-nullable messageId cannot be null'); - } - $this->container['messageId'] = $messageId; return $this; @@ -426,16 +324,10 @@ public function getError() * * @param string|null $error Human-readable description of what went wrong, *null* in case of success or if the message has not been processed yet * - * @return $this + * @return self */ public function setError($error) { - - - if (is_null($error)) { - throw new \InvalidArgumentException('non-nullable error cannot be null'); - } - $this->container['error'] = $error; return $this; @@ -456,16 +348,10 @@ public function getErr() * * @param \Messente\Api\Model\ErrorCodeOmnichannelMachine|null $err err * - * @return $this + * @return self */ public function setErr($err) { - - - if (is_null($err)) { - throw new \InvalidArgumentException('non-nullable err cannot be null'); - } - $this->container['err'] = $err; return $this; @@ -486,16 +372,10 @@ public function getTimestamp() * * @param \DateTime|null $timestamp When this status was received by Omnichannel API * - * @return $this + * @return self */ public function setTimestamp($timestamp) { - - - if (is_null($timestamp)) { - throw new \InvalidArgumentException('non-nullable timestamp cannot be null'); - } - $this->container['timestamp'] = $timestamp; return $this; @@ -517,18 +397,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -553,6 +433,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -565,6 +457,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/ErrorCodeOmnichannel.php b/lib/Model/ErrorCodeOmnichannel.php index 64a7750..5f88cd2 100644 --- a/lib/Model/ErrorCodeOmnichannel.php +++ b/lib/Model/ErrorCodeOmnichannel.php @@ -2,7 +2,7 @@ /** * ErrorCodeOmnichannel * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -45,13 +45,19 @@ class ErrorCodeOmnichannel * Possible values of this enum */ const _101 = '101'; + const _102 = '102'; + const _103 = '103'; + const _104 = '104'; + const _105 = '105'; + const _106 = '106'; + const _107 = '107'; - + /** * Gets allowable values of the enum * @return string[] @@ -65,7 +71,7 @@ public static function getAllowableEnumValues() self::_104, self::_105, self::_106, - self::_107, + self::_107 ]; } } diff --git a/lib/Model/ErrorCodeOmnichannelMachine.php b/lib/Model/ErrorCodeOmnichannelMachine.php index 03ae830..50b2f5f 100644 --- a/lib/Model/ErrorCodeOmnichannelMachine.php +++ b/lib/Model/ErrorCodeOmnichannelMachine.php @@ -2,7 +2,7 @@ /** * ErrorCodeOmnichannelMachine * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -44,19 +44,30 @@ class ErrorCodeOmnichannelMachine /** * Possible values of this enum */ - const 0 = 0; - const 1 = 1; - const 2 = 2; - const 3 = 3; - const 4 = 4; - const 5 = 5; - const 6 = 6; - const 7 = 7; - const 8 = 8; - const 9 = 9; - const 10 = 10; - const 999 = 999; - + const NUMBER_0 = 0; + + const NUMBER_1 = 1; + + const NUMBER_2 = 2; + + const NUMBER_3 = 3; + + const NUMBER_4 = 4; + + const NUMBER_5 = 5; + + const NUMBER_6 = 6; + + const NUMBER_7 = 7; + + const NUMBER_8 = 8; + + const NUMBER_9 = 9; + + const NUMBER_10 = 10; + + const NUMBER_999 = 999; + /** * Gets allowable values of the enum * @return string[] @@ -64,18 +75,18 @@ class ErrorCodeOmnichannelMachine public static function getAllowableEnumValues() { return [ - self::0, - self::1, - self::2, - self::3, - self::4, - self::5, - self::6, - self::7, - self::8, - self::9, - self::10, - self::999, + self::NUMBER_0, + self::NUMBER_1, + self::NUMBER_2, + self::NUMBER_3, + self::NUMBER_4, + self::NUMBER_5, + self::NUMBER_6, + self::NUMBER_7, + self::NUMBER_8, + self::NUMBER_9, + self::NUMBER_10, + self::NUMBER_999 ]; } } diff --git a/lib/Model/ErrorCodePhonebook.php b/lib/Model/ErrorCodePhonebook.php index 8a980d8..37fdb89 100644 --- a/lib/Model/ErrorCodePhonebook.php +++ b/lib/Model/ErrorCodePhonebook.php @@ -2,7 +2,7 @@ /** * ErrorCodePhonebook * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -45,12 +45,17 @@ class ErrorCodePhonebook * Possible values of this enum */ const _201 = '201'; + const _202 = '202'; + const _203 = '203'; + const _204 = '204'; + const _244 = '244'; + const _205 = '205'; - + /** * Gets allowable values of the enum * @return string[] @@ -63,7 +68,7 @@ public static function getAllowableEnumValues() self::_203, self::_204, self::_244, - self::_205, + self::_205 ]; } } diff --git a/lib/Model/ErrorCodeStatistics.php b/lib/Model/ErrorCodeStatistics.php index afabc11..6b082f7 100644 --- a/lib/Model/ErrorCodeStatistics.php +++ b/lib/Model/ErrorCodeStatistics.php @@ -2,7 +2,7 @@ /** * ErrorCodeStatistics * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -45,10 +45,13 @@ class ErrorCodeStatistics * Possible values of this enum */ const _100 = '100'; + const _103 = '103'; + const _104 = '104'; + const _105 = '105'; - + /** * Gets allowable values of the enum * @return string[] @@ -59,7 +62,7 @@ public static function getAllowableEnumValues() self::_100, self::_103, self::_104, - self::_105, + self::_105 ]; } } diff --git a/lib/Model/ErrorItemNumberLookup.php b/lib/Model/ErrorItemNumberLookup.php index d0eef98..1173426 100644 --- a/lib/Model/ErrorItemNumberLookup.php +++ b/lib/Model/ErrorItemNumberLookup.php @@ -2,7 +2,7 @@ /** * ErrorItemNumberLookup * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class ErrorItemNumberLookup implements ModelInterface, ArrayAccess +class ErrorItemNumberLookup implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -65,27 +68,13 @@ class ErrorItemNumberLookup implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'error' => null ]; - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static $openAPINullables = [ - 'error' => 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 * @@ -106,60 +95,6 @@ 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 @@ -229,9 +164,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -248,18 +180,7 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('error', $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; + $this->container['error'] = $data['error'] ?? null; } /** @@ -304,16 +225,10 @@ public function getError() * * @param \Messente\Api\Model\ErrorItemNumberLookupError $error error * - * @return $this + * @return self */ public function setError($error) { - - - if (is_null($error)) { - throw new \InvalidArgumentException('non-nullable error cannot be null'); - } - $this->container['error'] = $error; return $this; @@ -335,18 +250,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -371,6 +286,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -383,6 +310,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/ErrorItemNumberLookupError.php b/lib/Model/ErrorItemNumberLookupError.php index e0ad19c..b8f6254 100644 --- a/lib/Model/ErrorItemNumberLookupError.php +++ b/lib/Model/ErrorItemNumberLookupError.php @@ -2,7 +2,7 @@ /** * ErrorItemNumberLookupError * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class ErrorItemNumberLookupError implements ModelInterface, ArrayAccess +class ErrorItemNumberLookupError implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -66,29 +69,14 @@ class ErrorItemNumberLookupError implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'description' => null, 'code' => null ]; - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static $openAPINullables = [ - 'description' => 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 * @@ -109,60 +97,6 @@ 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 @@ -235,9 +169,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -254,19 +185,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('description', $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; + $this->container['description'] = $data['description'] ?? null; + $this->container['code'] = $data['code'] ?? null; } /** @@ -322,16 +242,10 @@ public function getDescription() * * @param string $description Error description * - * @return $this + * @return self */ public function setDescription($description) { - - - if (is_null($description)) { - throw new \InvalidArgumentException('non-nullable description cannot be null'); - } - $this->container['description'] = $description; return $this; @@ -352,7 +266,7 @@ public function getCode() * * @param int $code Matches the following error title. This field is a constant * 101 - Unauthorized * 102 - Invalid arguments or parameters * 103 - Server error * 104 - Crediting error #1 * 105 - Crediting error #2 * 106 - Client error * - * @return $this + * @return self */ public function setCode($code) { @@ -364,12 +278,6 @@ public function setCode($code) throw new \InvalidArgumentException('invalid value for $code when calling ErrorItemNumberLookupError., must be bigger than or equal to 101.'); } - - - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; return $this; @@ -391,18 +299,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -427,6 +335,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -439,6 +359,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/ErrorItemOmnichannel.php b/lib/Model/ErrorItemOmnichannel.php index 7bf1027..dd1cad6 100644 --- a/lib/Model/ErrorItemOmnichannel.php +++ b/lib/Model/ErrorItemOmnichannel.php @@ -2,7 +2,7 @@ /** * ErrorItemOmnichannel * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class ErrorItemOmnichannel implements ModelInterface, ArrayAccess +class ErrorItemOmnichannel implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -68,6 +71,8 @@ class ErrorItemOmnichannel implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'title' => null, @@ -76,25 +81,6 @@ 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' => 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 * @@ -115,60 +101,6 @@ 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 @@ -247,9 +179,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -266,21 +195,10 @@ public function getModelName() */ public function __construct(array $data = 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; + $this->container['title'] = $data['title'] ?? null; + $this->container['detail'] = $data['detail'] ?? null; + $this->container['code'] = $data['code'] ?? null; + $this->container['source'] = $data['source'] ?? null; } /** @@ -334,16 +252,10 @@ public function getTitle() * * @param \Messente\Api\Model\ErrorTitleOmnichannel $title title * - * @return $this + * @return self */ public function setTitle($title) { - - - if (is_null($title)) { - throw new \InvalidArgumentException('non-nullable title cannot be null'); - } - $this->container['title'] = $title; return $this; @@ -364,16 +276,10 @@ public function getDetail() * * @param string $detail Free form more detailed description of the error * - * @return $this + * @return self */ public function setDetail($detail) { - - - if (is_null($detail)) { - throw new \InvalidArgumentException('non-nullable detail cannot be null'); - } - $this->container['detail'] = $detail; return $this; @@ -394,16 +300,10 @@ public function getCode() * * @param \Messente\Api\Model\ErrorCodeOmnichannel $code code * - * @return $this + * @return self */ public function setCode($code) { - - - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; return $this; @@ -424,23 +324,10 @@ public function getSource() * * @param string $source Describes which field is causing the issue in the payload, null for non 400 status code responses * - * @return $this + * @return self */ public function setSource($source) { - - if (is_null($source)) { - array_push($this->openAPINullablesSetToNull, 'source'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('source', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - - $this->container['source'] = $source; return $this; @@ -462,18 +349,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -498,6 +385,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -510,6 +409,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/ErrorItemPhonebook.php b/lib/Model/ErrorItemPhonebook.php index 0f7f426..8e0cb54 100644 --- a/lib/Model/ErrorItemPhonebook.php +++ b/lib/Model/ErrorItemPhonebook.php @@ -2,7 +2,7 @@ /** * ErrorItemPhonebook * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class ErrorItemPhonebook implements ModelInterface, ArrayAccess +class ErrorItemPhonebook implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -67,6 +70,8 @@ class ErrorItemPhonebook implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'title' => null, @@ -74,24 +79,6 @@ 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 * @@ -112,60 +99,6 @@ 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 @@ -241,9 +174,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -260,20 +190,9 @@ public function getModelName() */ public function __construct(array $data = 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; + $this->container['title'] = $data['title'] ?? null; + $this->container['detail'] = $data['detail'] ?? null; + $this->container['code'] = $data['code'] ?? null; } /** @@ -324,16 +243,10 @@ public function getTitle() * * @param \Messente\Api\Model\ErrorTitlePhonebook $title title * - * @return $this + * @return self */ public function setTitle($title) { - - - if (is_null($title)) { - throw new \InvalidArgumentException('non-nullable title cannot be null'); - } - $this->container['title'] = $title; return $this; @@ -354,16 +267,10 @@ public function getDetail() * * @param string $detail Free form more detailed description of the error * - * @return $this + * @return self */ public function setDetail($detail) { - - - if (is_null($detail)) { - throw new \InvalidArgumentException('non-nullable detail cannot be null'); - } - $this->container['detail'] = $detail; return $this; @@ -384,16 +291,10 @@ public function getCode() * * @param \Messente\Api\Model\ErrorCodePhonebook $code code * - * @return $this + * @return self */ public function setCode($code) { - - - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; return $this; @@ -415,18 +316,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -451,6 +352,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -463,6 +376,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/ErrorItemStatistics.php b/lib/Model/ErrorItemStatistics.php index 278f46c..1c794d4 100644 --- a/lib/Model/ErrorItemStatistics.php +++ b/lib/Model/ErrorItemStatistics.php @@ -2,7 +2,7 @@ /** * ErrorItemStatistics * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class ErrorItemStatistics implements ModelInterface, ArrayAccess +class ErrorItemStatistics implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -67,6 +70,8 @@ class ErrorItemStatistics implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'title' => null, @@ -74,24 +79,6 @@ class ErrorItemStatistics implements ModelInterface, ArrayAccess 'code' => null ]; - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static $openAPINullables = [ - 'title' => false, - 'details' => 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 * @@ -112,60 +99,6 @@ 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 @@ -241,9 +174,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -260,20 +190,9 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('title', $data, null); - $this->setIfExists('details', $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; + $this->container['title'] = $data['title'] ?? null; + $this->container['details'] = $data['details'] ?? null; + $this->container['code'] = $data['code'] ?? null; } /** @@ -324,16 +243,10 @@ public function getTitle() * * @param string $title Error title * - * @return $this + * @return self */ public function setTitle($title) { - - - if (is_null($title)) { - throw new \InvalidArgumentException('non-nullable title cannot be null'); - } - $this->container['title'] = $title; return $this; @@ -354,16 +267,10 @@ public function getDetails() * * @param string $details Error details * - * @return $this + * @return self */ public function setDetails($details) { - - - if (is_null($details)) { - throw new \InvalidArgumentException('non-nullable details cannot be null'); - } - $this->container['details'] = $details; return $this; @@ -384,16 +291,10 @@ public function getCode() * * @param \Messente\Api\Model\ErrorCodeStatistics $code code * - * @return $this + * @return self */ public function setCode($code) { - - - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; return $this; @@ -415,18 +316,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -451,6 +352,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -463,6 +376,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/ErrorNumberLookup.php b/lib/Model/ErrorNumberLookup.php index f62ff86..1e4d769 100644 --- a/lib/Model/ErrorNumberLookup.php +++ b/lib/Model/ErrorNumberLookup.php @@ -2,7 +2,7 @@ /** * ErrorNumberLookup * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class ErrorNumberLookup implements ModelInterface, ArrayAccess +class ErrorNumberLookup implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -65,27 +68,13 @@ class ErrorNumberLookup implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -106,60 +95,6 @@ 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 @@ -229,9 +164,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -248,18 +180,7 @@ public function getModelName() */ public function __construct(array $data = 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; + $this->container['errors'] = $data['errors'] ?? null; } /** @@ -304,16 +225,10 @@ public function getErrors() * * @param \Messente\Api\Model\ErrorItemNumberLookup[] $errors An array of errors * - * @return $this + * @return self */ public function setErrors($errors) { - - - if (is_null($errors)) { - throw new \InvalidArgumentException('non-nullable errors cannot be null'); - } - $this->container['errors'] = $errors; return $this; @@ -335,18 +250,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -371,6 +286,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -383,6 +310,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/ErrorOmnichannel.php b/lib/Model/ErrorOmnichannel.php index d7ffaa8..ff18c12 100644 --- a/lib/Model/ErrorOmnichannel.php +++ b/lib/Model/ErrorOmnichannel.php @@ -2,7 +2,7 @@ /** * ErrorOmnichannel * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class ErrorOmnichannel implements ModelInterface, ArrayAccess +class ErrorOmnichannel implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -65,27 +68,13 @@ class ErrorOmnichannel implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -106,60 +95,6 @@ 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 @@ -229,9 +164,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -248,18 +180,7 @@ public function getModelName() */ public function __construct(array $data = 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; + $this->container['errors'] = $data['errors'] ?? null; } /** @@ -304,16 +225,10 @@ public function getErrors() * * @param \Messente\Api\Model\ErrorItemOmnichannel[] $errors An array of errors * - * @return $this + * @return self */ public function setErrors($errors) { - - - if (is_null($errors)) { - throw new \InvalidArgumentException('non-nullable errors cannot be null'); - } - $this->container['errors'] = $errors; return $this; @@ -335,18 +250,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -371,6 +286,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -383,6 +310,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/ErrorPhonebook.php b/lib/Model/ErrorPhonebook.php index fb54b7f..6f5f502 100644 --- a/lib/Model/ErrorPhonebook.php +++ b/lib/Model/ErrorPhonebook.php @@ -2,7 +2,7 @@ /** * ErrorPhonebook * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class ErrorPhonebook implements ModelInterface, ArrayAccess +class ErrorPhonebook implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -65,27 +68,13 @@ class ErrorPhonebook implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -106,60 +95,6 @@ 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 @@ -229,9 +164,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -248,18 +180,7 @@ public function getModelName() */ public function __construct(array $data = 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; + $this->container['errors'] = $data['errors'] ?? null; } /** @@ -304,16 +225,10 @@ public function getErrors() * * @param \Messente\Api\Model\ErrorItemPhonebook[] $errors An array of errors * - * @return $this + * @return self */ public function setErrors($errors) { - - - if (is_null($errors)) { - throw new \InvalidArgumentException('non-nullable errors cannot be null'); - } - $this->container['errors'] = $errors; return $this; @@ -335,18 +250,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -371,6 +286,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -383,6 +310,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/ErrorStatistics.php b/lib/Model/ErrorStatistics.php index f5c8840..dec3d64 100644 --- a/lib/Model/ErrorStatistics.php +++ b/lib/Model/ErrorStatistics.php @@ -2,7 +2,7 @@ /** * ErrorStatistics * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class ErrorStatistics implements ModelInterface, ArrayAccess +class ErrorStatistics implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -65,27 +68,13 @@ class ErrorStatistics implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -106,60 +95,6 @@ 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 @@ -229,9 +164,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -248,18 +180,7 @@ public function getModelName() */ public function __construct(array $data = 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; + $this->container['errors'] = $data['errors'] ?? null; } /** @@ -304,16 +225,10 @@ public function getErrors() * * @param \Messente\Api\Model\ErrorItemStatistics[] $errors An array of errors * - * @return $this + * @return self */ public function setErrors($errors) { - - - if (is_null($errors)) { - throw new \InvalidArgumentException('non-nullable errors cannot be null'); - } - $this->container['errors'] = $errors; return $this; @@ -335,18 +250,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -371,6 +286,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -383,6 +310,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/ErrorTitleOmnichannel.php b/lib/Model/ErrorTitleOmnichannel.php index f4657c9..e5a0b6b 100644 --- a/lib/Model/ErrorTitleOmnichannel.php +++ b/lib/Model/ErrorTitleOmnichannel.php @@ -2,7 +2,7 @@ /** * ErrorTitleOmnichannel * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -45,13 +45,19 @@ class ErrorTitleOmnichannel * Possible values of this enum */ const NOT_FOUND = 'Not found'; + const FORBIDDEN = 'Forbidden'; + const UNAUTHORIZED = 'Unauthorized'; + const INVALID_DATA = 'Invalid data'; + const INTERNAL_SERVER_ERROR = 'Internal Server Error'; + const MISSING_DATA = 'Missing data'; + const METHOD_NOT_ALLOWED = 'Method not allowed'; - + /** * Gets allowable values of the enum * @return string[] @@ -65,7 +71,7 @@ public static function getAllowableEnumValues() self::INVALID_DATA, self::INTERNAL_SERVER_ERROR, self::MISSING_DATA, - self::METHOD_NOT_ALLOWED, + self::METHOD_NOT_ALLOWED ]; } } diff --git a/lib/Model/ErrorTitlePhonebook.php b/lib/Model/ErrorTitlePhonebook.php index c2ca7b0..5fe8354 100644 --- a/lib/Model/ErrorTitlePhonebook.php +++ b/lib/Model/ErrorTitlePhonebook.php @@ -2,7 +2,7 @@ /** * ErrorTitlePhonebook * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -45,12 +45,17 @@ class ErrorTitlePhonebook * Possible values of this enum */ const INVALID_DATA = 'Invalid data'; + const UNAUTHORIZED = 'Unauthorized'; + const MISSING_RESOURCE = 'Missing resource'; + const CONFLICT = 'Conflict'; + const CLIENT_ERROR = 'Client error'; + const GENERAL_ERROR = 'General error'; - + /** * Gets allowable values of the enum * @return string[] @@ -63,7 +68,7 @@ public static function getAllowableEnumValues() self::MISSING_RESOURCE, self::CONFLICT, self::CLIENT_ERROR, - self::GENERAL_ERROR, + self::GENERAL_ERROR ]; } } diff --git a/lib/Model/FetchBlacklistSuccess.php b/lib/Model/FetchBlacklistSuccess.php index 8d3179f..55fe1a5 100644 --- a/lib/Model/FetchBlacklistSuccess.php +++ b/lib/Model/FetchBlacklistSuccess.php @@ -2,7 +2,7 @@ /** * FetchBlacklistSuccess * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class FetchBlacklistSuccess implements ModelInterface, ArrayAccess +class FetchBlacklistSuccess implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -65,27 +68,13 @@ class FetchBlacklistSuccess implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -106,60 +95,6 @@ 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 @@ -229,9 +164,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -248,18 +180,7 @@ public function getModelName() */ public function __construct(array $data = 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; + $this->container['phoneNumbers'] = $data['phoneNumbers'] ?? null; } /** @@ -301,16 +222,12 @@ public function getPhoneNumbers() * * @param string[]|null $phoneNumbers Array of unique phone numbers * - * @return $this + * @return self */ public function setPhoneNumbers($phoneNumbers) { - if (is_null($phoneNumbers)) { - throw new \InvalidArgumentException('non-nullable phoneNumbers cannot be null'); - } - $this->container['phoneNumbers'] = $phoneNumbers; return $this; @@ -332,18 +249,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -368,6 +285,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -380,6 +309,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/GroupEnvelope.php b/lib/Model/GroupEnvelope.php index 1ce8f9d..d2fd51c 100644 --- a/lib/Model/GroupEnvelope.php +++ b/lib/Model/GroupEnvelope.php @@ -2,7 +2,7 @@ /** * GroupEnvelope * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class GroupEnvelope implements ModelInterface, ArrayAccess +class GroupEnvelope implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -65,27 +68,13 @@ class GroupEnvelope implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -106,60 +95,6 @@ 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 @@ -229,9 +164,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -248,18 +180,7 @@ public function getModelName() */ public function __construct(array $data = 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; + $this->container['group'] = $data['group'] ?? null; } /** @@ -301,16 +222,10 @@ public function getGroup() * * @param \Messente\Api\Model\GroupResponseFields|null $group group * - * @return $this + * @return self */ public function setGroup($group) { - - - if (is_null($group)) { - throw new \InvalidArgumentException('non-nullable group cannot be null'); - } - $this->container['group'] = $group; return $this; @@ -332,18 +247,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -368,6 +283,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -380,6 +307,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/GroupListEnvelope.php b/lib/Model/GroupListEnvelope.php index f1f7e25..da5982b 100644 --- a/lib/Model/GroupListEnvelope.php +++ b/lib/Model/GroupListEnvelope.php @@ -2,7 +2,7 @@ /** * GroupListEnvelope * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class GroupListEnvelope implements ModelInterface, ArrayAccess +class GroupListEnvelope implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -65,27 +68,13 @@ class GroupListEnvelope implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -106,60 +95,6 @@ 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 @@ -229,9 +164,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -248,18 +180,7 @@ public function getModelName() */ public function __construct(array $data = 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; + $this->container['groups'] = $data['groups'] ?? null; } /** @@ -301,16 +222,12 @@ public function getGroups() * * @param \Messente\Api\Model\GroupResponseFields[]|null $groups An array of groups * - * @return $this + * @return self */ public function setGroups($groups) { - if (is_null($groups)) { - throw new \InvalidArgumentException('non-nullable groups cannot be null'); - } - $this->container['groups'] = $groups; return $this; @@ -332,18 +249,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -368,6 +285,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -380,6 +309,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/GroupName.php b/lib/Model/GroupName.php index a7b9c41..5d6f31b 100644 --- a/lib/Model/GroupName.php +++ b/lib/Model/GroupName.php @@ -2,7 +2,7 @@ /** * GroupName * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class GroupName implements ModelInterface, ArrayAccess +class GroupName implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -65,27 +68,13 @@ class GroupName implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -106,60 +95,6 @@ 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 @@ -229,9 +164,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -248,18 +180,7 @@ public function getModelName() */ public function __construct(array $data = 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; + $this->container['name'] = $data['name'] ?? null; } /** @@ -308,7 +229,7 @@ public function getName() * * @param string $name The name of the group * - * @return $this + * @return self */ public function setName($name) { @@ -317,12 +238,6 @@ 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; @@ -344,18 +259,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -380,6 +295,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -392,6 +319,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/GroupResponseFields.php b/lib/Model/GroupResponseFields.php index 1b3781c..8da8935 100644 --- a/lib/Model/GroupResponseFields.php +++ b/lib/Model/GroupResponseFields.php @@ -2,7 +2,7 @@ /** * GroupResponseFields * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class GroupResponseFields implements ModelInterface, ArrayAccess +class GroupResponseFields implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -68,6 +71,8 @@ class GroupResponseFields implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'id' => null, @@ -76,25 +81,6 @@ 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 * @@ -115,60 +101,6 @@ 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 @@ -247,9 +179,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -266,21 +195,10 @@ public function getModelName() */ public function __construct(array $data = 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; + $this->container['id'] = $data['id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['createdOn'] = $data['createdOn'] ?? null; + $this->container['contactsCount'] = $data['contactsCount'] ?? null; } /** @@ -331,16 +249,10 @@ public function getId() * * @param string $id Id string in UUID format * - * @return $this + * @return self */ public function setId($id) { - - - if (is_null($id)) { - throw new \InvalidArgumentException('non-nullable id cannot be null'); - } - $this->container['id'] = $id; return $this; @@ -361,16 +273,10 @@ public function getName() * * @param string $name The name of the group * - * @return $this + * @return self */ public function setName($name) { - - - if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); - } - $this->container['name'] = $name; return $this; @@ -391,23 +297,10 @@ public function getCreatedOn() * * @param string|null $createdOn When the group was created * - * @return $this + * @return self */ 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; @@ -428,16 +321,10 @@ public function getContactsCount() * * @param int $contactsCount The count of contacts in the group * - * @return $this + * @return self */ public function setContactsCount($contactsCount) { - - - if (is_null($contactsCount)) { - throw new \InvalidArgumentException('non-nullable contactsCount cannot be null'); - } - $this->container['contactsCount'] = $contactsCount; return $this; @@ -459,18 +346,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -495,6 +382,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -507,6 +406,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/MessageResult.php b/lib/Model/MessageResult.php index 0d70066..5955d04 100644 --- a/lib/Model/MessageResult.php +++ b/lib/Model/MessageResult.php @@ -2,7 +2,7 @@ /** * MessageResult * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class MessageResult implements ModelInterface, ArrayAccess +class MessageResult implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -67,6 +70,8 @@ class MessageResult implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'messageId' => 'UUID', @@ -74,24 +79,6 @@ 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 * @@ -112,60 +99,6 @@ 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 @@ -241,9 +174,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -260,20 +190,9 @@ public function getModelName() */ public function __construct(array $data = 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; + $this->container['messageId'] = $data['messageId'] ?? null; + $this->container['channel'] = $data['channel'] ?? null; + $this->container['sender'] = $data['sender'] ?? null; } /** @@ -324,16 +243,10 @@ public function getMessageId() * * @param string $messageId Unique identifier for the message * - * @return $this + * @return self */ public function setMessageId($messageId) { - - - if (is_null($messageId)) { - throw new \InvalidArgumentException('non-nullable messageId cannot be null'); - } - $this->container['messageId'] = $messageId; return $this; @@ -354,16 +267,10 @@ public function getChannel() * * @param \Messente\Api\Model\Channel $channel channel * - * @return $this + * @return self */ public function setChannel($channel) { - - - if (is_null($channel)) { - throw new \InvalidArgumentException('non-nullable channel cannot be null'); - } - $this->container['channel'] = $channel; return $this; @@ -384,16 +291,10 @@ public function getSender() * * @param string $sender Sender that was used for the message * - * @return $this + * @return self */ public function setSender($sender) { - - - if (is_null($sender)) { - throw new \InvalidArgumentException('non-nullable sender cannot be null'); - } - $this->container['sender'] = $sender; return $this; @@ -415,18 +316,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -451,6 +352,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -463,6 +376,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/MobileNetwork.php b/lib/Model/MobileNetwork.php index d43e621..8309511 100644 --- a/lib/Model/MobileNetwork.php +++ b/lib/Model/MobileNetwork.php @@ -2,7 +2,7 @@ /** * MobileNetwork * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class MobileNetwork implements ModelInterface, ArrayAccess +class MobileNetwork implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -69,6 +72,8 @@ class MobileNetwork implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'mccmnc' => null, @@ -78,26 +83,6 @@ class MobileNetwork implements ModelInterface, ArrayAccess 'countryCode' => null ]; - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static $openAPINullables = [ - 'mccmnc' => false, - 'networkName' => false, - 'countryName' => false, - 'countryPrefix' => false, - 'countryCode' => 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 * @@ -118,60 +103,6 @@ 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 @@ -253,9 +184,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -272,22 +200,11 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('mccmnc', $data, null); - $this->setIfExists('networkName', $data, null); - $this->setIfExists('countryName', $data, null); - $this->setIfExists('countryPrefix', $data, null); - $this->setIfExists('countryCode', $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; + $this->container['mccmnc'] = $data['mccmnc'] ?? null; + $this->container['networkName'] = $data['networkName'] ?? null; + $this->container['countryName'] = $data['countryName'] ?? null; + $this->container['countryPrefix'] = $data['countryPrefix'] ?? null; + $this->container['countryCode'] = $data['countryCode'] ?? null; } /** @@ -329,16 +246,10 @@ public function getMccmnc() * * @param string|null $mccmnc Mobile country and mobile network code * - * @return $this + * @return self */ public function setMccmnc($mccmnc) { - - - if (is_null($mccmnc)) { - throw new \InvalidArgumentException('non-nullable mccmnc cannot be null'); - } - $this->container['mccmnc'] = $mccmnc; return $this; @@ -359,16 +270,10 @@ public function getNetworkName() * * @param string|null $networkName Mobile network name * - * @return $this + * @return self */ public function setNetworkName($networkName) { - - - if (is_null($networkName)) { - throw new \InvalidArgumentException('non-nullable networkName cannot be null'); - } - $this->container['networkName'] = $networkName; return $this; @@ -389,16 +294,10 @@ public function getCountryName() * * @param string|null $countryName Country name * - * @return $this + * @return self */ public function setCountryName($countryName) { - - - if (is_null($countryName)) { - throw new \InvalidArgumentException('non-nullable countryName cannot be null'); - } - $this->container['countryName'] = $countryName; return $this; @@ -419,16 +318,10 @@ public function getCountryPrefix() * * @param string|null $countryPrefix Country prefix * - * @return $this + * @return self */ public function setCountryPrefix($countryPrefix) { - - - if (is_null($countryPrefix)) { - throw new \InvalidArgumentException('non-nullable countryPrefix cannot be null'); - } - $this->container['countryPrefix'] = $countryPrefix; return $this; @@ -449,16 +342,10 @@ public function getCountryCode() * * @param string|null $countryCode Country code * - * @return $this + * @return self */ public function setCountryCode($countryCode) { - - - if (is_null($countryCode)) { - throw new \InvalidArgumentException('non-nullable countryCode cannot be null'); - } - $this->container['countryCode'] = $countryCode; return $this; @@ -480,18 +367,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -516,6 +403,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -528,6 +427,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/ModelInterface.php b/lib/Model/ModelInterface.php index 0256178..672465c 100644 --- a/lib/Model/ModelInterface.php +++ b/lib/Model/ModelInterface.php @@ -2,7 +2,7 @@ /** * ModelInterface * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api\Model @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** diff --git a/lib/Model/NumberToBlacklist.php b/lib/Model/NumberToBlacklist.php index 59a4407..59d996c 100644 --- a/lib/Model/NumberToBlacklist.php +++ b/lib/Model/NumberToBlacklist.php @@ -2,7 +2,7 @@ /** * NumberToBlacklist * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class NumberToBlacklist implements ModelInterface, ArrayAccess +class NumberToBlacklist implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -65,27 +68,13 @@ class NumberToBlacklist implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -106,60 +95,6 @@ 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 @@ -229,9 +164,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -248,18 +180,7 @@ public function getModelName() */ public function __construct(array $data = 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; + $this->container['phoneNumber'] = $data['phoneNumber'] ?? null; } /** @@ -304,16 +225,10 @@ public function getPhoneNumber() * * @param string $phoneNumber Phone number in e.164 format * - * @return $this + * @return self */ public function setPhoneNumber($phoneNumber) { - - - if (is_null($phoneNumber)) { - throw new \InvalidArgumentException('non-nullable phoneNumber cannot be null'); - } - $this->container['phoneNumber'] = $phoneNumber; return $this; @@ -335,18 +250,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -371,6 +286,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -383,6 +310,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/NumbersToInvestigate.php b/lib/Model/NumbersToInvestigate.php index 054b85d..5f5b95c 100644 --- a/lib/Model/NumbersToInvestigate.php +++ b/lib/Model/NumbersToInvestigate.php @@ -2,7 +2,7 @@ /** * NumbersToInvestigate * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class NumbersToInvestigate implements ModelInterface, ArrayAccess +class NumbersToInvestigate implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -65,27 +68,13 @@ class NumbersToInvestigate implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'numbers' => null ]; - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static $openAPINullables = [ - 'numbers' => 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 * @@ -106,60 +95,6 @@ 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 @@ -229,9 +164,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -248,18 +180,7 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('numbers', $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; + $this->container['numbers'] = $data['numbers'] ?? null; } /** @@ -274,6 +195,14 @@ public function listInvalidProperties() if ($this->container['numbers'] === null) { $invalidProperties[] = "'numbers' can't be null"; } + if ((count($this->container['numbers']) > 10)) { + $invalidProperties[] = "invalid value for 'numbers', number of items must be less than or equal to 10."; + } + + if ((count($this->container['numbers']) < 1)) { + $invalidProperties[] = "invalid value for 'numbers', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -304,16 +233,17 @@ public function getNumbers() * * @param string[] $numbers A list of phone numbers. Max 10 numbers per request * - * @return $this + * @return self */ public function setNumbers($numbers) { - - if (is_null($numbers)) { - throw new \InvalidArgumentException('non-nullable numbers cannot be null'); + if ((count($numbers) > 10)) { + throw new \InvalidArgumentException('invalid value for $numbers when calling NumbersToInvestigate., number of items must be less than or equal to 10.'); + } + if ((count($numbers) < 1)) { + throw new \InvalidArgumentException('invalid length for $numbers when calling NumbersToInvestigate., number of items must be greater than or equal to 1.'); } - $this->container['numbers'] = $numbers; return $this; @@ -335,18 +265,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -371,6 +301,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -383,6 +325,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/OmniMessageCreateSuccessResponse.php b/lib/Model/OmniMessageCreateSuccessResponse.php index c239991..387711d 100644 --- a/lib/Model/OmniMessageCreateSuccessResponse.php +++ b/lib/Model/OmniMessageCreateSuccessResponse.php @@ -2,7 +2,7 @@ /** * OmniMessageCreateSuccessResponse * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class OmniMessageCreateSuccessResponse implements ModelInterface, ArrayAccess +class OmniMessageCreateSuccessResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -67,6 +70,8 @@ class OmniMessageCreateSuccessResponse implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'messages' => null, @@ -74,24 +79,6 @@ 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 * @@ -112,60 +99,6 @@ 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 @@ -241,9 +174,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -260,20 +190,9 @@ public function getModelName() */ public function __construct(array $data = 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; + $this->container['messages'] = $data['messages'] ?? null; + $this->container['to'] = $data['to'] ?? null; + $this->container['omnimessageId'] = $data['omnimessageId'] ?? null; } /** @@ -324,16 +243,10 @@ public function getMessages() * * @param \Messente\Api\Model\MessageResult[] $messages List of messages that compose the omnimessage * - * @return $this + * @return self */ public function setMessages($messages) { - - - if (is_null($messages)) { - throw new \InvalidArgumentException('non-nullable messages cannot be null'); - } - $this->container['messages'] = $messages; return $this; @@ -354,16 +267,10 @@ public function getTo() * * @param string $to Phone number in e.164 format * - * @return $this + * @return self */ public function setTo($to) { - - - if (is_null($to)) { - throw new \InvalidArgumentException('non-nullable to cannot be null'); - } - $this->container['to'] = $to; return $this; @@ -384,16 +291,10 @@ public function getOmnimessageId() * * @param string $omnimessageId Unique identifier for the omnimessage * - * @return $this + * @return self */ public function setOmnimessageId($omnimessageId) { - - - if (is_null($omnimessageId)) { - throw new \InvalidArgumentException('non-nullable omnimessageId cannot be null'); - } - $this->container['omnimessageId'] = $omnimessageId; return $this; @@ -415,18 +316,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -451,6 +352,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -463,6 +376,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/Omnimessage.php b/lib/Model/Omnimessage.php index 80a2b96..f312944 100644 --- a/lib/Model/Omnimessage.php +++ b/lib/Model/Omnimessage.php @@ -2,7 +2,7 @@ /** * Omnimessage * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class Omnimessage implements ModelInterface, ArrayAccess +class Omnimessage implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -70,6 +73,8 @@ class Omnimessage implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'to' => null, @@ -80,27 +85,6 @@ class Omnimessage implements ModelInterface, ArrayAccess 'priority' => null ]; - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static $openAPINullables = [ - 'to' => false, - 'messages' => false, - 'dlrUrl' => false, - 'textStore' => false, - 'timeToSend' => false, - 'priority' => 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 * @@ -121,60 +105,6 @@ 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 @@ -259,9 +189,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -278,23 +205,12 @@ public function getModelName() */ public function __construct(array $data = 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); - $this->setIfExists('priority', $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; + $this->container['to'] = $data['to'] ?? null; + $this->container['messages'] = $data['messages'] ?? null; + $this->container['dlrUrl'] = $data['dlrUrl'] ?? null; + $this->container['textStore'] = $data['textStore'] ?? null; + $this->container['timeToSend'] = $data['timeToSend'] ?? null; + $this->container['priority'] = $data['priority'] ?? null; } /** @@ -342,16 +258,10 @@ public function getTo() * * @param string $to Phone number in e.164 format * - * @return $this + * @return self */ public function setTo($to) { - - - if (is_null($to)) { - throw new \InvalidArgumentException('non-nullable to cannot be null'); - } - $this->container['to'] = $to; return $this; @@ -372,16 +282,10 @@ public function getMessages() * * @param OneOfViberSMSWhatsAppTelegram[] $messages An array of messages * - * @return $this + * @return self */ public function setMessages($messages) { - - - if (is_null($messages)) { - throw new \InvalidArgumentException('non-nullable messages cannot be null'); - } - $this->container['messages'] = $messages; return $this; @@ -402,16 +306,10 @@ public function getDlrUrl() * * @param string|null $dlrUrl URL where the delivery report will be sent * - * @return $this + * @return self */ public function setDlrUrl($dlrUrl) { - - - if (is_null($dlrUrl)) { - throw new \InvalidArgumentException('non-nullable dlrUrl cannot be null'); - } - $this->container['dlrUrl'] = $dlrUrl; return $this; @@ -432,16 +330,10 @@ public function getTextStore() * * @param \Messente\Api\Model\TextStore|null $textStore textStore * - * @return $this + * @return self */ public function setTextStore($textStore) { - - - if (is_null($textStore)) { - throw new \InvalidArgumentException('non-nullable textStore cannot be null'); - } - $this->container['textStore'] = $textStore; return $this; @@ -462,16 +354,10 @@ public function getTimeToSend() * * @param \DateTime|null $timeToSend Optional parameter for sending messages at some specific time in the future. Time must be specified in the ISO-8601 format. If no timezone is specified, then the timezone is assumed to be UTC Examples: * Time specified with timezone: 2018-06-22T09:05:07+00:00 Time specified in UTC: 2018-06-22T09:05:07Z * Time specified without timezone: 2018-06-22T09:05 (equivalent to 2018-06-22T09:05+00:00) * - * @return $this + * @return self */ public function setTimeToSend($timeToSend) { - - - if (is_null($timeToSend)) { - throw new \InvalidArgumentException('non-nullable timeToSend cannot be null'); - } - $this->container['timeToSend'] = $timeToSend; return $this; @@ -492,16 +378,10 @@ public function getPriority() * * @param \Messente\Api\Model\Priority|null $priority priority * - * @return $this + * @return self */ public function setPriority($priority) { - - - if (is_null($priority)) { - throw new \InvalidArgumentException('non-nullable priority cannot be null'); - } - $this->container['priority'] = $priority; return $this; @@ -523,18 +403,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -559,6 +439,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -571,6 +463,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/Priority.php b/lib/Model/Priority.php index 9d2746d..609f6b5 100644 --- a/lib/Model/Priority.php +++ b/lib/Model/Priority.php @@ -2,7 +2,7 @@ /** * Priority * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -45,9 +45,11 @@ class Priority * Possible values of this enum */ const LOW = 'low'; + const REGULAR = 'regular'; + const HIGH = 'high'; - + /** * Gets allowable values of the enum * @return string[] @@ -57,7 +59,7 @@ public static function getAllowableEnumValues() return [ self::LOW, self::REGULAR, - self::HIGH, + self::HIGH ]; } } diff --git a/lib/Model/SMS.php b/lib/Model/SMS.php index 69317d0..7f3c04d 100644 --- a/lib/Model/SMS.php +++ b/lib/Model/SMS.php @@ -2,7 +2,7 @@ /** * SMS * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class SMS implements ModelInterface, ArrayAccess +class SMS implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -70,6 +73,8 @@ class SMS implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'text' => null, @@ -80,27 +85,6 @@ 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 * @@ -121,60 +105,6 @@ 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 @@ -263,9 +193,7 @@ public function getModelName() const AUTOCONVERT_ON = 'on'; const AUTOCONVERT_OFF = 'off'; const CHANNEL_SMS = 'sms'; - - /** * Gets allowable values of the enum * @@ -279,7 +207,7 @@ public function getAutoconvertAllowableValues() self::AUTOCONVERT_OFF, ]; } - + /** * Gets allowable values of the enum * @@ -291,7 +219,6 @@ public function getChannelAllowableValues() self::CHANNEL_SMS, ]; } - /** * Associative array for storing property values @@ -308,23 +235,12 @@ public function getChannelAllowableValues() */ public function __construct(array $data = null) { - $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; + $this->container['text'] = $data['text'] ?? null; + $this->container['sender'] = $data['sender'] ?? null; + $this->container['validity'] = $data['validity'] ?? null; + $this->container['autoconvert'] = $data['autoconvert'] ?? null; + $this->container['udh'] = $data['udh'] ?? null; + $this->container['channel'] = $data['channel'] ?? 'sms'; } /** @@ -342,7 +258,8 @@ public function listInvalidProperties() $allowedValues = $this->getAutoconvertAllowableValues(); if (!is_null($this->container['autoconvert']) && !in_array($this->container['autoconvert'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'autoconvert', must be one of '%s'", + "invalid value '%s' for 'autoconvert', must be one of '%s'", + $this->container['autoconvert'], implode("', '", $allowedValues) ); } @@ -350,7 +267,8 @@ public function listInvalidProperties() $allowedValues = $this->getChannelAllowableValues(); if (!is_null($this->container['channel']) && !in_array($this->container['channel'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'channel', must be one of '%s'", + "invalid value '%s' for 'channel', must be one of '%s'", + $this->container['channel'], implode("', '", $allowedValues) ); } @@ -385,16 +303,10 @@ public function getText() * * @param string $text Text content of the SMS * - * @return $this + * @return self */ public function setText($text) { - - - if (is_null($text)) { - throw new \InvalidArgumentException('non-nullable text cannot be null'); - } - $this->container['text'] = $text; return $this; @@ -415,16 +327,10 @@ public function getSender() * * @param string|null $sender Phone number or alphanumeric sender name * - * @return $this + * @return self */ public function setSender($sender) { - - - if (is_null($sender)) { - throw new \InvalidArgumentException('non-nullable sender cannot be null'); - } - $this->container['sender'] = $sender; return $this; @@ -445,16 +351,10 @@ public function getValidity() * * @param int|null $validity After how many minutes this channel is considered as failed and the next channel is attempted * - * @return $this + * @return self */ public function setValidity($validity) { - - - if (is_null($validity)) { - throw new \InvalidArgumentException('non-nullable validity cannot be null'); - } - $this->container['validity'] = $validity; return $this; @@ -475,7 +375,7 @@ public function getAutoconvert() * * @param string|null $autoconvert Defines how non-GSM characters will be treated: - \"on\" Use replacement settings from the account's [API Auto Replace settings page](https://dashboard.messente.com/api-settings/auto-replace) (default) - \"full\" All non GSM 03.38 characters will be replaced with suitable alternatives - \"off\" Message content is not modified in any way * - * @return $this + * @return self */ public function setAutoconvert($autoconvert) { @@ -483,17 +383,12 @@ public function setAutoconvert($autoconvert) if (!is_null($autoconvert) && !in_array($autoconvert, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'autoconvert', must be one of '%s'", + "Invalid value '%s' for 'autoconvert', must be one of '%s'", + $autoconvert, implode("', '", $allowedValues) ) ); } - - - if (is_null($autoconvert)) { - throw new \InvalidArgumentException('non-nullable autoconvert cannot be null'); - } - $this->container['autoconvert'] = $autoconvert; return $this; @@ -514,16 +409,10 @@ public function getUdh() * * @param string|null $udh hex-encoded string containing SMS UDH * - * @return $this + * @return self */ public function setUdh($udh) { - - - if (is_null($udh)) { - throw new \InvalidArgumentException('non-nullable udh cannot be null'); - } - $this->container['udh'] = $udh; return $this; @@ -544,7 +433,7 @@ public function getChannel() * * @param string|null $channel The channel used to deliver the message * - * @return $this + * @return self */ public function setChannel($channel) { @@ -552,17 +441,12 @@ public function setChannel($channel) if (!is_null($channel) && !in_array($channel, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'channel', must be one of '%s'", + "Invalid value '%s' for 'channel', must be one of '%s'", + $channel, implode("', '", $allowedValues) ) ); } - - - if (is_null($channel)) { - throw new \InvalidArgumentException('non-nullable channel cannot be null'); - } - $this->container['channel'] = $channel; return $this; @@ -584,18 +468,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -620,6 +504,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -632,6 +528,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/StatisticsReport.php b/lib/Model/StatisticsReport.php index 53309e5..3e7d658 100644 --- a/lib/Model/StatisticsReport.php +++ b/lib/Model/StatisticsReport.php @@ -2,7 +2,7 @@ /** * StatisticsReport * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class StatisticsReport implements ModelInterface, ArrayAccess +class StatisticsReport implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -67,6 +70,8 @@ class StatisticsReport implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'totalMessages' => null, @@ -74,24 +79,6 @@ class StatisticsReport implements ModelInterface, ArrayAccess 'country' => null ]; - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static $openAPINullables = [ - 'totalMessages' => false, - 'totalPrice' => false, - 'country' => 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 * @@ -112,60 +99,6 @@ 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 @@ -241,9 +174,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -260,20 +190,9 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('totalMessages', $data, null); - $this->setIfExists('totalPrice', $data, null); - $this->setIfExists('country', $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; + $this->container['totalMessages'] = $data['totalMessages'] ?? null; + $this->container['totalPrice'] = $data['totalPrice'] ?? null; + $this->container['country'] = $data['country'] ?? null; } /** @@ -324,16 +243,10 @@ public function getTotalMessages() * * @param int $totalMessages Sum of all messages * - * @return $this + * @return self */ public function setTotalMessages($totalMessages) { - - - if (is_null($totalMessages)) { - throw new \InvalidArgumentException('non-nullable totalMessages cannot be null'); - } - $this->container['totalMessages'] = $totalMessages; return $this; @@ -354,16 +267,10 @@ public function getTotalPrice() * * @param string $totalPrice Price for all messages * - * @return $this + * @return self */ public function setTotalPrice($totalPrice) { - - - if (is_null($totalPrice)) { - throw new \InvalidArgumentException('non-nullable totalPrice cannot be null'); - } - $this->container['totalPrice'] = $totalPrice; return $this; @@ -384,16 +291,10 @@ public function getCountry() * * @param string $country Target country of all messages * - * @return $this + * @return self */ public function setCountry($country) { - - - if (is_null($country)) { - throw new \InvalidArgumentException('non-nullable country cannot be null'); - } - $this->container['country'] = $country; return $this; @@ -415,18 +316,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -451,6 +352,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -463,6 +376,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/StatisticsReportSettings.php b/lib/Model/StatisticsReportSettings.php index 6ea852e..74991c1 100644 --- a/lib/Model/StatisticsReportSettings.php +++ b/lib/Model/StatisticsReportSettings.php @@ -2,7 +2,7 @@ /** * StatisticsReportSettings * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class StatisticsReportSettings implements ModelInterface, ArrayAccess +class StatisticsReportSettings implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -67,6 +70,8 @@ class StatisticsReportSettings implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'startDate' => 'date', @@ -74,24 +79,6 @@ class StatisticsReportSettings implements ModelInterface, ArrayAccess 'messageTypes' => null ]; - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static $openAPINullables = [ - 'startDate' => false, - 'endDate' => false, - 'messageTypes' => 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 * @@ -112,60 +99,6 @@ 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 @@ -241,9 +174,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -260,20 +190,9 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('startDate', $data, null); - $this->setIfExists('endDate', $data, null); - $this->setIfExists('messageTypes', $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; + $this->container['startDate'] = $data['startDate'] ?? null; + $this->container['endDate'] = $data['endDate'] ?? null; + $this->container['messageTypes'] = $data['messageTypes'] ?? null; } /** @@ -321,16 +240,10 @@ public function getStartDate() * * @param \DateTime $startDate Start date for the report * - * @return $this + * @return self */ public function setStartDate($startDate) { - - - if (is_null($startDate)) { - throw new \InvalidArgumentException('non-nullable startDate cannot be null'); - } - $this->container['startDate'] = $startDate; return $this; @@ -351,16 +264,10 @@ public function getEndDate() * * @param \DateTime $endDate End date for the report * - * @return $this + * @return self */ public function setEndDate($endDate) { - - - if (is_null($endDate)) { - throw new \InvalidArgumentException('non-nullable endDate cannot be null'); - } - $this->container['endDate'] = $endDate; return $this; @@ -381,16 +288,10 @@ public function getMessageTypes() * * @param string[]|null $messageTypes Optional list of message types (sms, viber, whatsapp, hlr, telegram) * - * @return $this + * @return self */ public function setMessageTypes($messageTypes) { - - - if (is_null($messageTypes)) { - throw new \InvalidArgumentException('non-nullable messageTypes cannot be null'); - } - $this->container['messageTypes'] = $messageTypes; return $this; @@ -412,18 +313,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -448,6 +349,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -460,6 +373,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/StatisticsReportSuccess.php b/lib/Model/StatisticsReportSuccess.php index ebbd74f..0178992 100644 --- a/lib/Model/StatisticsReportSuccess.php +++ b/lib/Model/StatisticsReportSuccess.php @@ -2,7 +2,7 @@ /** * StatisticsReportSuccess * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class StatisticsReportSuccess implements ModelInterface, ArrayAccess +class StatisticsReportSuccess implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -65,27 +68,13 @@ class StatisticsReportSuccess implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'reports' => null ]; - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static $openAPINullables = [ - 'reports' => 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 * @@ -106,60 +95,6 @@ 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 @@ -229,9 +164,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -248,18 +180,7 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('reports', $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; + $this->container['reports'] = $data['reports'] ?? null; } /** @@ -304,16 +225,10 @@ public function getReports() * * @param \Messente\Api\Model\StatisticsReport[] $reports Array of report objects * - * @return $this + * @return self */ public function setReports($reports) { - - - if (is_null($reports)) { - throw new \InvalidArgumentException('non-nullable reports cannot be null'); - } - $this->container['reports'] = $reports; return $this; @@ -335,18 +250,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -371,6 +286,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -383,6 +310,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/Status.php b/lib/Model/Status.php index 854c153..dcfbfeb 100644 --- a/lib/Model/Status.php +++ b/lib/Model/Status.php @@ -2,7 +2,7 @@ /** * Status * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -45,17 +45,27 @@ class Status * Possible values of this enum */ const ACK = 'ACK'; + const DELIVRD = 'DELIVRD'; + const UNDELIV = 'UNDELIV'; + const FAILED = 'FAILED'; + const UNKNOWN = 'UNKNOWN'; + const ACCEPTD = 'ACCEPTD'; + const REJECTD = 'REJECTD'; + const DELETED = 'DELETED'; + const EXPIRED = 'EXPIRED'; + const NACK = 'NACK'; + const SEEN = 'SEEN'; - + /** * Gets allowable values of the enum * @return string[] @@ -73,7 +83,7 @@ public static function getAllowableEnumValues() self::DELETED, self::EXPIRED, self::NACK, - self::SEEN, + self::SEEN ]; } } diff --git a/lib/Model/SyncNumberLookupResult.php b/lib/Model/SyncNumberLookupResult.php index 9d04da1..15f25c9 100644 --- a/lib/Model/SyncNumberLookupResult.php +++ b/lib/Model/SyncNumberLookupResult.php @@ -2,7 +2,7 @@ /** * SyncNumberLookupResult * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class SyncNumberLookupResult implements ModelInterface, ArrayAccess +class SyncNumberLookupResult implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -66,13 +69,15 @@ class SyncNumberLookupResult implements ModelInterface, ArrayAccess 'originalNetwork' => '\Messente\Api\Model\MobileNetwork', 'portedNetwork' => '\Messente\Api\Model\MobileNetwork', 'status' => 'string', - 'error' => 'object' + 'error' => 'mixed' ]; /** * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'number' => null, @@ -86,30 +91,6 @@ class SyncNumberLookupResult implements ModelInterface, ArrayAccess 'error' => null ]; - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static $openAPINullables = [ - 'number' => false, - 'roaming' => true, - 'ported' => true, - 'roamingNetwork' => true, - 'currentNetwork' => true, - 'originalNetwork' => true, - 'portedNetwork' => true, - 'status' => false, - 'error' => 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 * @@ -130,60 +111,6 @@ 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 @@ -281,9 +208,7 @@ public function getModelName() const STATUS_OFF = 'OFF'; const STATUS_INVALID = 'INVALID'; const STATUS_UNKNOWN = 'UNKNOWN'; - - /** * Gets allowable values of the enum * @@ -298,7 +223,6 @@ public function getStatusAllowableValues() self::STATUS_UNKNOWN, ]; } - /** * Associative array for storing property values @@ -315,26 +239,15 @@ public function getStatusAllowableValues() */ public function __construct(array $data = null) { - $this->setIfExists('number', $data, null); - $this->setIfExists('roaming', $data, null); - $this->setIfExists('ported', $data, null); - $this->setIfExists('roamingNetwork', $data, null); - $this->setIfExists('currentNetwork', $data, null); - $this->setIfExists('originalNetwork', $data, null); - $this->setIfExists('portedNetwork', $data, null); - $this->setIfExists('status', $data, null); - $this->setIfExists('error', $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; + $this->container['number'] = $data['number'] ?? null; + $this->container['roaming'] = $data['roaming'] ?? null; + $this->container['ported'] = $data['ported'] ?? null; + $this->container['roamingNetwork'] = $data['roamingNetwork'] ?? null; + $this->container['currentNetwork'] = $data['currentNetwork'] ?? null; + $this->container['originalNetwork'] = $data['originalNetwork'] ?? null; + $this->container['portedNetwork'] = $data['portedNetwork'] ?? null; + $this->container['status'] = $data['status'] ?? null; + $this->container['error'] = $data['error'] ?? null; } /** @@ -352,7 +265,8 @@ public function listInvalidProperties() $allowedValues = $this->getStatusAllowableValues(); if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'status', must be one of '%s'", + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], implode("', '", $allowedValues) ); } @@ -387,16 +301,10 @@ public function getNumber() * * @param string $number Phone number in e.164 format * - * @return $this + * @return self */ public function setNumber($number) { - - - if (is_null($number)) { - throw new \InvalidArgumentException('non-nullable number cannot be null'); - } - $this->container['number'] = $number; return $this; @@ -417,23 +325,10 @@ public function getRoaming() * * @param bool|null $roaming Indicates if a number is roaming * - * @return $this + * @return self */ public function setRoaming($roaming) { - - if (is_null($roaming)) { - array_push($this->openAPINullablesSetToNull, 'roaming'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('roaming', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - - $this->container['roaming'] = $roaming; return $this; @@ -454,23 +349,10 @@ public function getPorted() * * @param bool|null $ported Indicates if a number is ported * - * @return $this + * @return self */ public function setPorted($ported) { - - if (is_null($ported)) { - array_push($this->openAPINullablesSetToNull, 'ported'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('ported', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - - $this->container['ported'] = $ported; return $this; @@ -491,23 +373,10 @@ public function getRoamingNetwork() * * @param \Messente\Api\Model\MobileNetwork|null $roamingNetwork roamingNetwork * - * @return $this + * @return self */ public function setRoamingNetwork($roamingNetwork) { - - if (is_null($roamingNetwork)) { - array_push($this->openAPINullablesSetToNull, 'roamingNetwork'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('roamingNetwork', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - - $this->container['roamingNetwork'] = $roamingNetwork; return $this; @@ -528,23 +397,10 @@ public function getCurrentNetwork() * * @param \Messente\Api\Model\MobileNetwork|null $currentNetwork currentNetwork * - * @return $this + * @return self */ public function setCurrentNetwork($currentNetwork) { - - if (is_null($currentNetwork)) { - array_push($this->openAPINullablesSetToNull, 'currentNetwork'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('currentNetwork', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - - $this->container['currentNetwork'] = $currentNetwork; return $this; @@ -565,23 +421,10 @@ public function getOriginalNetwork() * * @param \Messente\Api\Model\MobileNetwork|null $originalNetwork originalNetwork * - * @return $this + * @return self */ public function setOriginalNetwork($originalNetwork) { - - if (is_null($originalNetwork)) { - array_push($this->openAPINullablesSetToNull, 'originalNetwork'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('originalNetwork', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - - $this->container['originalNetwork'] = $originalNetwork; return $this; @@ -602,23 +445,10 @@ public function getPortedNetwork() * * @param \Messente\Api\Model\MobileNetwork|null $portedNetwork portedNetwork * - * @return $this + * @return self */ public function setPortedNetwork($portedNetwork) { - - if (is_null($portedNetwork)) { - array_push($this->openAPINullablesSetToNull, 'portedNetwork'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('portedNetwork', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - - $this->container['portedNetwork'] = $portedNetwork; return $this; @@ -639,7 +469,7 @@ public function getStatus() * * @param string|null $status Status of the phone number * - * @return $this + * @return self */ public function setStatus($status) { @@ -647,17 +477,12 @@ public function setStatus($status) if (!is_null($status) && !in_array($status, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'status', must be one of '%s'", + "Invalid value '%s' for 'status', must be one of '%s'", + $status, implode("', '", $allowedValues) ) ); } - - - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; return $this; @@ -666,7 +491,7 @@ public function setStatus($status) /** * Gets error * - * @return object|null + * @return mixed|null */ public function getError() { @@ -676,18 +501,12 @@ public function getError() /** * Sets error * - * @param object|null $error Indicates if any error occurred while handling the request + * @param mixed|null $error Indicates if any error occurred while handling the request * - * @return $this + * @return self */ public function setError($error) { - - - if (is_null($error)) { - throw new \InvalidArgumentException('non-nullable error cannot be null'); - } - $this->container['error'] = $error; return $this; @@ -709,18 +528,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -745,6 +564,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -757,6 +588,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/SyncNumberLookupSuccess.php b/lib/Model/SyncNumberLookupSuccess.php index f6b90bc..c00b889 100644 --- a/lib/Model/SyncNumberLookupSuccess.php +++ b/lib/Model/SyncNumberLookupSuccess.php @@ -2,7 +2,7 @@ /** * SyncNumberLookupSuccess * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class SyncNumberLookupSuccess implements ModelInterface, ArrayAccess +class SyncNumberLookupSuccess implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -66,29 +69,14 @@ class SyncNumberLookupSuccess implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'requestId' => null, 'result' => null ]; - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static $openAPINullables = [ - 'requestId' => false, - 'result' => 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 * @@ -109,60 +97,6 @@ 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 @@ -235,9 +169,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -254,19 +185,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('requestId', $data, null); - $this->setIfExists('result', $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; + $this->container['requestId'] = $data['requestId'] ?? null; + $this->container['result'] = $data['result'] ?? null; } /** @@ -314,16 +234,10 @@ public function getRequestId() * * @param string $requestId ID of the request * - * @return $this + * @return self */ public function setRequestId($requestId) { - - - if (is_null($requestId)) { - throw new \InvalidArgumentException('non-nullable requestId cannot be null'); - } - $this->container['requestId'] = $requestId; return $this; @@ -344,16 +258,10 @@ public function getResult() * * @param \Messente\Api\Model\SyncNumberLookupResult[] $result A container for phone number info objects * - * @return $this + * @return self */ public function setResult($result) { - - - if (is_null($result)) { - throw new \InvalidArgumentException('non-nullable result cannot be null'); - } - $this->container['result'] = $result; return $this; @@ -375,18 +283,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -411,6 +319,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -423,6 +343,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/Telegram.php b/lib/Model/Telegram.php index 47fee59..f033906 100644 --- a/lib/Model/Telegram.php +++ b/lib/Model/Telegram.php @@ -2,7 +2,7 @@ /** * Telegram * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class Telegram implements ModelInterface, ArrayAccess +class Telegram implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -71,6 +74,8 @@ class Telegram implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'sender' => null, @@ -82,28 +87,6 @@ class Telegram 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, - 'documentUrl' => false, - 'audioUrl' => 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 * @@ -124,60 +107,6 @@ 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 @@ -266,9 +195,7 @@ public function getModelName() } const CHANNEL_TELEGRAM = 'telegram'; - - /** * Gets allowable values of the enum * @@ -280,7 +207,6 @@ public function getChannelAllowableValues() self::CHANNEL_TELEGRAM, ]; } - /** * Associative array for storing property values @@ -297,24 +223,13 @@ public function getChannelAllowableValues() */ public function __construct(array $data = null) { - $this->setIfExists('sender', $data, null); - $this->setIfExists('validity', $data, null); - $this->setIfExists('text', $data, null); - $this->setIfExists('imageUrl', $data, null); - $this->setIfExists('documentUrl', $data, null); - $this->setIfExists('audioUrl', $data, null); - $this->setIfExists('channel', $data, 'telegram'); - } - - 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; + $this->container['sender'] = $data['sender'] ?? null; + $this->container['validity'] = $data['validity'] ?? null; + $this->container['text'] = $data['text'] ?? null; + $this->container['imageUrl'] = $data['imageUrl'] ?? null; + $this->container['documentUrl'] = $data['documentUrl'] ?? null; + $this->container['audioUrl'] = $data['audioUrl'] ?? null; + $this->container['channel'] = $data['channel'] ?? 'telegram'; } /** @@ -329,7 +244,8 @@ public function listInvalidProperties() $allowedValues = $this->getChannelAllowableValues(); if (!is_null($this->container['channel']) && !in_array($this->container['channel'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'channel', must be one of '%s'", + "invalid value '%s' for 'channel', must be one of '%s'", + $this->container['channel'], implode("', '", $allowedValues) ); } @@ -364,16 +280,10 @@ public function getSender() * * @param string|null $sender Phone number or alphanumeric sender name * - * @return $this + * @return self */ public function setSender($sender) { - - - if (is_null($sender)) { - throw new \InvalidArgumentException('non-nullable sender cannot be null'); - } - $this->container['sender'] = $sender; return $this; @@ -394,16 +304,10 @@ public function getValidity() * * @param int|null $validity After how many minutes this channel is considered as failed and the next channel is attempted * - * @return $this + * @return self */ public function setValidity($validity) { - - - if (is_null($validity)) { - throw new \InvalidArgumentException('non-nullable validity cannot be null'); - } - $this->container['validity'] = $validity; return $this; @@ -424,16 +328,10 @@ public function getText() * * @param string|null $text Plaintext content for Telegram * - * @return $this + * @return self */ public function setText($text) { - - - if (is_null($text)) { - throw new \InvalidArgumentException('non-nullable text cannot be null'); - } - $this->container['text'] = $text; return $this; @@ -454,16 +352,10 @@ public function getImageUrl() * * @param string|null $imageUrl URL for the embedded image. Mutually exclusive with \"document_url\" and \"audio_url\" * - * @return $this + * @return self */ public function setImageUrl($imageUrl) { - - - if (is_null($imageUrl)) { - throw new \InvalidArgumentException('non-nullable imageUrl cannot be null'); - } - $this->container['imageUrl'] = $imageUrl; return $this; @@ -484,16 +376,10 @@ public function getDocumentUrl() * * @param string|null $documentUrl URL for the embedded image. Mutually exclusive with \"audio_url\" and \"image_url\" * - * @return $this + * @return self */ public function setDocumentUrl($documentUrl) { - - - if (is_null($documentUrl)) { - throw new \InvalidArgumentException('non-nullable documentUrl cannot be null'); - } - $this->container['documentUrl'] = $documentUrl; return $this; @@ -514,16 +400,10 @@ public function getAudioUrl() * * @param string|null $audioUrl URL for the embedded image. Mutually exclusive with \"document_url\" and \"image_url\" * - * @return $this + * @return self */ public function setAudioUrl($audioUrl) { - - - if (is_null($audioUrl)) { - throw new \InvalidArgumentException('non-nullable audioUrl cannot be null'); - } - $this->container['audioUrl'] = $audioUrl; return $this; @@ -544,7 +424,7 @@ public function getChannel() * * @param string|null $channel The channel used to deliver the message * - * @return $this + * @return self */ public function setChannel($channel) { @@ -552,17 +432,12 @@ public function setChannel($channel) if (!is_null($channel) && !in_array($channel, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'channel', must be one of '%s'", + "Invalid value '%s' for 'channel', must be one of '%s'", + $channel, implode("', '", $allowedValues) ) ); } - - - if (is_null($channel)) { - throw new \InvalidArgumentException('non-nullable channel cannot be null'); - } - $this->container['channel'] = $channel; return $this; @@ -584,18 +459,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -620,6 +495,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -632,6 +519,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/TextStore.php b/lib/Model/TextStore.php index dfd65c8..e06dd53 100644 --- a/lib/Model/TextStore.php +++ b/lib/Model/TextStore.php @@ -2,7 +2,7 @@ /** * TextStore * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -45,9 +45,11 @@ class TextStore * Possible values of this enum */ const NOSTORE = 'nostore'; + const PLAINTEXT = 'plaintext'; + const SHA256 = 'sha256'; - + /** * Gets allowable values of the enum * @return string[] @@ -57,7 +59,7 @@ public static function getAllowableEnumValues() return [ self::NOSTORE, self::PLAINTEXT, - self::SHA256, + self::SHA256 ]; } } diff --git a/lib/Model/Viber.php b/lib/Model/Viber.php index d61af74..e4ac2d9 100644 --- a/lib/Model/Viber.php +++ b/lib/Model/Viber.php @@ -2,7 +2,7 @@ /** * Viber * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class Viber implements ModelInterface, ArrayAccess +class Viber implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -71,6 +74,8 @@ class Viber implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'sender' => null, @@ -82,28 +87,6 @@ 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 * @@ -124,60 +107,6 @@ 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 @@ -266,9 +195,7 @@ public function getModelName() } const CHANNEL_VIBER = 'viber'; - - /** * Gets allowable values of the enum * @@ -280,7 +207,6 @@ public function getChannelAllowableValues() self::CHANNEL_VIBER, ]; } - /** * Associative array for storing property values @@ -297,24 +223,13 @@ public function getChannelAllowableValues() */ public function __construct(array $data = null) { - $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; + $this->container['sender'] = $data['sender'] ?? null; + $this->container['validity'] = $data['validity'] ?? null; + $this->container['text'] = $data['text'] ?? null; + $this->container['imageUrl'] = $data['imageUrl'] ?? null; + $this->container['buttonUrl'] = $data['buttonUrl'] ?? null; + $this->container['buttonText'] = $data['buttonText'] ?? null; + $this->container['channel'] = $data['channel'] ?? 'viber'; } /** @@ -329,7 +244,8 @@ public function listInvalidProperties() $allowedValues = $this->getChannelAllowableValues(); if (!is_null($this->container['channel']) && !in_array($this->container['channel'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'channel', must be one of '%s'", + "invalid value '%s' for 'channel', must be one of '%s'", + $this->container['channel'], implode("', '", $allowedValues) ); } @@ -364,16 +280,10 @@ public function getSender() * * @param string|null $sender Phone number or alphanumeric sender name * - * @return $this + * @return self */ public function setSender($sender) { - - - if (is_null($sender)) { - throw new \InvalidArgumentException('non-nullable sender cannot be null'); - } - $this->container['sender'] = $sender; return $this; @@ -394,16 +304,10 @@ public function getValidity() * * @param int|null $validity After how many minutes this channel is considered as failed and the next channel is attempted * - * @return $this + * @return self */ public function setValidity($validity) { - - - if (is_null($validity)) { - throw new \InvalidArgumentException('non-nullable validity cannot be null'); - } - $this->container['validity'] = $validity; return $this; @@ -424,16 +328,10 @@ public function getText() * * @param string|null $text Plaintext content for Viber * - * @return $this + * @return self */ public function setText($text) { - - - if (is_null($text)) { - throw new \InvalidArgumentException('non-nullable text cannot be null'); - } - $this->container['text'] = $text; return $this; @@ -454,16 +352,10 @@ public function getImageUrl() * * @param string|null $imageUrl URL for the embedded image Valid combinations: 1) image_url, 2) text, image_url, button_url, button_text * - * @return $this + * @return self */ public function setImageUrl($imageUrl) { - - - if (is_null($imageUrl)) { - throw new \InvalidArgumentException('non-nullable imageUrl cannot be null'); - } - $this->container['imageUrl'] = $imageUrl; return $this; @@ -484,16 +376,10 @@ public function getButtonUrl() * * @param string|null $buttonUrl URL of the button, must be specified along with ''text'', ''button_text'' and ''image_url'' (optional) * - * @return $this + * @return self */ public function setButtonUrl($buttonUrl) { - - - if (is_null($buttonUrl)) { - throw new \InvalidArgumentException('non-nullable buttonUrl cannot be null'); - } - $this->container['buttonUrl'] = $buttonUrl; return $this; @@ -514,16 +400,10 @@ public function getButtonText() * * @param string|null $buttonText Must be specified along with ''text'', ''button_url'', ''button_text'', ''image_url'' (optional) * - * @return $this + * @return self */ public function setButtonText($buttonText) { - - - if (is_null($buttonText)) { - throw new \InvalidArgumentException('non-nullable buttonText cannot be null'); - } - $this->container['buttonText'] = $buttonText; return $this; @@ -544,7 +424,7 @@ public function getChannel() * * @param string|null $channel The channel used to deliver the message * - * @return $this + * @return self */ public function setChannel($channel) { @@ -552,17 +432,12 @@ public function setChannel($channel) if (!is_null($channel) && !in_array($channel, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'channel', must be one of '%s'", + "Invalid value '%s' for 'channel', must be one of '%s'", + $channel, implode("', '", $allowedValues) ) ); } - - - if (is_null($channel)) { - throw new \InvalidArgumentException('non-nullable channel cannot be null'); - } - $this->container['channel'] = $channel; return $this; @@ -584,18 +459,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -620,6 +495,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -632,6 +519,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/WhatsApp.php b/lib/Model/WhatsApp.php index 35a2745..aa14c56 100644 --- a/lib/Model/WhatsApp.php +++ b/lib/Model/WhatsApp.php @@ -2,7 +2,7 @@ /** * WhatsApp * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class WhatsApp implements ModelInterface, ArrayAccess +class WhatsApp implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -71,6 +74,8 @@ class WhatsApp implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'sender' => null, @@ -82,28 +87,6 @@ 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 * @@ -124,60 +107,6 @@ 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 @@ -266,9 +195,7 @@ public function getModelName() } const CHANNEL_WHATSAPP = 'whatsapp'; - - /** * Gets allowable values of the enum * @@ -280,7 +207,6 @@ public function getChannelAllowableValues() self::CHANNEL_WHATSAPP, ]; } - /** * Associative array for storing property values @@ -297,24 +223,13 @@ public function getChannelAllowableValues() */ public function __construct(array $data = null) { - $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; + $this->container['sender'] = $data['sender'] ?? null; + $this->container['validity'] = $data['validity'] ?? null; + $this->container['text'] = $data['text'] ?? null; + $this->container['image'] = $data['image'] ?? null; + $this->container['document'] = $data['document'] ?? null; + $this->container['audio'] = $data['audio'] ?? null; + $this->container['channel'] = $data['channel'] ?? 'whatsapp'; } /** @@ -329,7 +244,8 @@ public function listInvalidProperties() $allowedValues = $this->getChannelAllowableValues(); if (!is_null($this->container['channel']) && !in_array($this->container['channel'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'channel', must be one of '%s'", + "invalid value '%s' for 'channel', must be one of '%s'", + $this->container['channel'], implode("', '", $allowedValues) ); } @@ -364,16 +280,10 @@ public function getSender() * * @param string|null $sender Phone number or alphanumeric sender name * - * @return $this + * @return self */ public function setSender($sender) { - - - if (is_null($sender)) { - throw new \InvalidArgumentException('non-nullable sender cannot be null'); - } - $this->container['sender'] = $sender; return $this; @@ -394,16 +304,10 @@ public function getValidity() * * @param int|null $validity After how many minutes this channel is considered as failed and the next channel is attempted * - * @return $this + * @return self */ public function setValidity($validity) { - - - if (is_null($validity)) { - throw new \InvalidArgumentException('non-nullable validity cannot be null'); - } - $this->container['validity'] = $validity; return $this; @@ -424,16 +328,10 @@ public function getText() * * @param \Messente\Api\Model\WhatsAppText|null $text text * - * @return $this + * @return self */ public function setText($text) { - - - if (is_null($text)) { - throw new \InvalidArgumentException('non-nullable text cannot be null'); - } - $this->container['text'] = $text; return $this; @@ -454,16 +352,10 @@ public function getImage() * * @param \Messente\Api\Model\WhatsAppImage|null $image image * - * @return $this + * @return self */ public function setImage($image) { - - - if (is_null($image)) { - throw new \InvalidArgumentException('non-nullable image cannot be null'); - } - $this->container['image'] = $image; return $this; @@ -484,16 +376,10 @@ public function getDocument() * * @param \Messente\Api\Model\WhatsAppDocument|null $document document * - * @return $this + * @return self */ public function setDocument($document) { - - - if (is_null($document)) { - throw new \InvalidArgumentException('non-nullable document cannot be null'); - } - $this->container['document'] = $document; return $this; @@ -514,16 +400,10 @@ public function getAudio() * * @param \Messente\Api\Model\WhatsAppAudio|null $audio audio * - * @return $this + * @return self */ public function setAudio($audio) { - - - if (is_null($audio)) { - throw new \InvalidArgumentException('non-nullable audio cannot be null'); - } - $this->container['audio'] = $audio; return $this; @@ -544,7 +424,7 @@ public function getChannel() * * @param string|null $channel The channel used to deliver the message * - * @return $this + * @return self */ public function setChannel($channel) { @@ -552,17 +432,12 @@ public function setChannel($channel) if (!is_null($channel) && !in_array($channel, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'channel', must be one of '%s'", + "Invalid value '%s' for 'channel', must be one of '%s'", + $channel, implode("', '", $allowedValues) ) ); } - - - if (is_null($channel)) { - throw new \InvalidArgumentException('non-nullable channel cannot be null'); - } - $this->container['channel'] = $channel; return $this; @@ -584,18 +459,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -620,6 +495,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -632,6 +519,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/WhatsAppAudio.php b/lib/Model/WhatsAppAudio.php index c10aa8d..eb67bc9 100644 --- a/lib/Model/WhatsAppAudio.php +++ b/lib/Model/WhatsAppAudio.php @@ -2,7 +2,7 @@ /** * WhatsAppAudio * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class WhatsAppAudio implements ModelInterface, ArrayAccess +class WhatsAppAudio implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -65,27 +68,13 @@ class WhatsAppAudio implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -106,60 +95,6 @@ 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 @@ -229,9 +164,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -248,18 +180,7 @@ public function getModelName() */ public function __construct(array $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; + $this->container['content'] = $data['content'] ?? null; } /** @@ -304,16 +225,10 @@ public function getContent() * * @param string $content Base64-encoded audio * - * @return $this + * @return self */ public function setContent($content) { - - - if (is_null($content)) { - throw new \InvalidArgumentException('non-nullable content cannot be null'); - } - $this->container['content'] = $content; return $this; @@ -335,18 +250,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -371,6 +286,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -383,6 +310,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/WhatsAppDocument.php b/lib/Model/WhatsAppDocument.php index 13f8279..fe15f48 100644 --- a/lib/Model/WhatsAppDocument.php +++ b/lib/Model/WhatsAppDocument.php @@ -2,7 +2,7 @@ /** * WhatsAppDocument * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class WhatsAppDocument implements ModelInterface, ArrayAccess +class WhatsAppDocument implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -66,29 +69,14 @@ class WhatsAppDocument implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'caption' => null, '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 * @@ -109,60 +97,6 @@ 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 @@ -235,9 +169,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -254,19 +185,8 @@ public function getModelName() */ public function __construct(array $data = 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; + $this->container['caption'] = $data['caption'] ?? null; + $this->container['content'] = $data['content'] ?? null; } /** @@ -311,16 +231,10 @@ public function getCaption() * * @param string|null $caption Description for the document * - * @return $this + * @return self */ public function setCaption($caption) { - - - if (is_null($caption)) { - throw new \InvalidArgumentException('non-nullable caption cannot be null'); - } - $this->container['caption'] = $caption; return $this; @@ -341,16 +255,10 @@ public function getContent() * * @param string $content Base64-encoded image * - * @return $this + * @return self */ public function setContent($content) { - - - if (is_null($content)) { - throw new \InvalidArgumentException('non-nullable content cannot be null'); - } - $this->container['content'] = $content; return $this; @@ -372,18 +280,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -408,6 +316,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -420,6 +340,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/WhatsAppImage.php b/lib/Model/WhatsAppImage.php index 8a2f952..3e6545b 100644 --- a/lib/Model/WhatsAppImage.php +++ b/lib/Model/WhatsAppImage.php @@ -2,7 +2,7 @@ /** * WhatsAppImage * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class WhatsAppImage implements ModelInterface, ArrayAccess +class WhatsAppImage implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -66,29 +69,14 @@ class WhatsAppImage implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'caption' => null, '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 * @@ -109,60 +97,6 @@ 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 @@ -235,9 +169,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -254,19 +185,8 @@ public function getModelName() */ public function __construct(array $data = 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; + $this->container['caption'] = $data['caption'] ?? null; + $this->container['content'] = $data['content'] ?? null; } /** @@ -311,16 +231,10 @@ public function getCaption() * * @param string|null $caption Description for the image * - * @return $this + * @return self */ public function setCaption($caption) { - - - if (is_null($caption)) { - throw new \InvalidArgumentException('non-nullable caption cannot be null'); - } - $this->container['caption'] = $caption; return $this; @@ -341,16 +255,10 @@ public function getContent() * * @param string $content Base64-encoded image * - * @return $this + * @return self */ public function setContent($content) { - - - if (is_null($content)) { - throw new \InvalidArgumentException('non-nullable content cannot be null'); - } - $this->container['content'] = $content; return $this; @@ -372,18 +280,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -408,6 +316,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -420,6 +340,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/WhatsAppText.php b/lib/Model/WhatsAppText.php index 6b40520..c3f257b 100644 --- a/lib/Model/WhatsAppText.php +++ b/lib/Model/WhatsAppText.php @@ -2,7 +2,7 @@ /** * WhatsAppText * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class WhatsAppText implements ModelInterface, ArrayAccess +class WhatsAppText implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -66,29 +69,14 @@ class WhatsAppText implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'previewUrl' => null, '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 * @@ -109,60 +97,6 @@ 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 @@ -235,9 +169,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -254,19 +185,8 @@ public function getModelName() */ public function __construct(array $data = 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; + $this->container['previewUrl'] = $data['previewUrl'] ?? true; + $this->container['body'] = $data['body'] ?? null; } /** @@ -311,16 +231,10 @@ public function getPreviewUrl() * * @param bool|null $previewUrl Whether to display link preview if the message contains a hyperlink * - * @return $this + * @return self */ public function setPreviewUrl($previewUrl) { - - - if (is_null($previewUrl)) { - throw new \InvalidArgumentException('non-nullable previewUrl cannot be null'); - } - $this->container['previewUrl'] = $previewUrl; return $this; @@ -341,16 +255,10 @@ public function getBody() * * @param string $body Plaintext content for WhatsApp, can contain URLs, emojis and formatting * - * @return $this + * @return self */ public function setBody($body) { - - - if (is_null($body)) { - throw new \InvalidArgumentException('non-nullable body cannot be null'); - } - $this->container['body'] = $body; return $this; @@ -372,18 +280,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -408,6 +316,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -420,6 +340,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/ObjectSerializer.php b/lib/ObjectSerializer.php index 1a17780..2a1510f 100644 --- a/lib/ObjectSerializer.php +++ b/lib/ObjectSerializer.php @@ -2,7 +2,7 @@ /** * ObjectSerializer * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -41,6 +41,19 @@ */ class ObjectSerializer { + /** @var string */ + private static $dateTimeFormat = \DateTime::ATOM; + + /** + * Change the date format + * + * @param string $format the new date format to use + */ + public static function setDateTimeFormat($format) + { + self::$dateTimeFormat = $format; + } + /** * Serialize data * @@ -48,34 +61,44 @@ class ObjectSerializer * @param string $type the OpenAPIToolsType of the data * @param string $format the format of the OpenAPITools type of the data * - * @return string|object serialized form of $data + * @return scalar|object|array|null serialized form of $data */ public static function sanitizeForSerialization($data, $type = null, $format = null) { if (is_scalar($data) || null === $data) { return $data; - } elseif ($data instanceof \DateTime) { - return ($format === 'date') ? $data->format('Y-m-d') : $data->format(\DateTime::ATOM); - } elseif (is_array($data)) { + } + + if ($data instanceof \DateTime) { + return ($format === 'date') ? $data->format('Y-m-d') : $data->format(self::$dateTimeFormat); + } + + if (is_array($data)) { foreach ($data as $property => $value) { $data[$property] = self::sanitizeForSerialization($value); } return $data; - } elseif (is_object($data)) { + } + + if (is_object($data)) { $values = []; if ($data instanceof ModelInterface) { $formats = $data::openAPIFormats(); foreach ($data::openAPITypes() as $property => $openAPIType) { $getter = $data::getters()[$property]; $value = $data->$getter(); - if ($value !== null - && !in_array($openAPIType, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true) - && method_exists($openAPIType, 'getAllowableEnumValues') - && !in_array($value, $openAPIType::getAllowableEnumValues(), true)) { - $imploded = implode("', '", $openAPIType::getAllowableEnumValues()); - throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); + if ($value !== null && !in_array($openAPIType, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + $callable = [$openAPIType, 'getAllowableEnumValues']; + if (is_callable($callable)) { + /** array $callable */ + $allowedEnumTypes = $callable(); + if (!in_array($value, $allowedEnumTypes, true)) { + $imploded = implode("', '", $allowedEnumTypes); + throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); + } + } } - if ($data::isNullable($property) && $data->isNullableSetToNull($property) || $value !== null) { + if ($value !== null) { $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]); } } @@ -150,6 +173,11 @@ public static function toQueryValue($object) */ public static function toHeaderValue($value) { + $callable = [$value, 'toHeaderValue']; + if (is_callable($callable)) { + return $callable(); + } + return self::toString($value); } @@ -184,8 +212,8 @@ public static function toFormValue($value) public static function toString($value) { if ($value instanceof \DateTime) { // datetime in ISO8601 format - return $value->format(\DateTime::ATOM); - } else if (is_bool($value)) { + return $value->format(self::$dateTimeFormat); + } elseif (is_bool($value)) { return $value ? 'true' : 'false'; } else { return $value; @@ -196,29 +224,32 @@ public static function toString($value) * Serialize an array to a string. * * @param array $collection collection to serialize to a string - * @param string $collectionFormat the format use for serialization (csv, + * @param string $style the format use for serialization (csv, * ssv, tsv, pipes, multi) * @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array * * @return string */ - public static function serializeCollection(array $collection, $collectionFormat, $allowCollectionFormatMulti = false) + public static function serializeCollection(array $collection, $style, $allowCollectionFormatMulti = false) { - if ($allowCollectionFormatMulti && ('multi' === $collectionFormat)) { + if ($allowCollectionFormatMulti && ('multi' === $style)) { // http_build_query() almost does the job for us. We just // need to fix the result of multidimensional arrays. return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&')); } - switch ($collectionFormat) { + switch ($style) { + case 'pipeDelimited': case 'pipes': return implode('|', $collection); case 'tsv': return implode("\t", $collection); + case 'spaceDelimited': case 'ssv': return implode(' ', $collection); + case 'simple': case 'csv': // Deliberate fall through. CSV is default format. default: @@ -240,7 +271,24 @@ public static function deserialize($data, $class, $httpHeaders = null) { if (null === $data) { return null; - } elseif (substr($class, 0, 4) === 'map[') { // for associative array e.g. map[string,int] + } + + if (strcasecmp(substr($class, -2), '[]') === 0) { + $data = is_string($data) ? json_decode($data) : $data; + + if (!is_array($data)) { + throw new \InvalidArgumentException("Invalid array '$class'"); + } + + $subClass = substr($class, 0, -2); + $values = []; + foreach ($data as $key => $value) { + $values[] = self::deserialize($value, $subClass, null); + } + return $values; + } + + if (preg_match('/^(array<|map\[)/', $class)) { // for associative array e.g. array $data = is_string($data) ? json_decode($data) : $data; settype($data, 'array'); $inner = substr($class, 4, -1); @@ -253,18 +301,17 @@ public static function deserialize($data, $class, $httpHeaders = null) } } return $deserialized; - } elseif (strcasecmp(substr($class, -2), '[]') === 0) { - $data = is_string($data) ? json_decode($data) : $data; - $subClass = substr($class, 0, -2); - $values = []; - foreach ($data as $key => $value) { - $values[] = self::deserialize($value, $subClass, null); - } - return $values; - } elseif ($class === 'object') { + } + + if ($class === 'object') { settype($data, 'array'); return $data; - } elseif ($class === '\DateTime') { + } else if ($class === 'mixed') { + settype($data, gettype($data)); + return $data; + } + + if ($class === '\DateTime') { // Some API's return an invalid, empty string as a // date-time property. DateTime::__construct() will return // the current time for empty input which is probably not @@ -272,14 +319,27 @@ public static function deserialize($data, $class, $httpHeaders = null) // be interpreted as a missing field/value. Let's handle // this graceful. if (!empty($data)) { - return new \DateTime($data); + try { + return new \DateTime($data); + } catch (\Exception $exception) { + // Some API's return a date-time with too high nanosecond + // precision for php's DateTime to handle. This conversion + // (string -> unix timestamp -> DateTime) is a workaround + // for the problem. + return (new \DateTime())->setTimestamp(strtotime($data)); + } } else { return null; } - } elseif (in_array($class, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + } + + /** @psalm-suppress ParadoxicalCondition */ + if (in_array($class, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { settype($data, $class); return $data; - } elseif ($class === '\SplFileObject') { + } + + if ($class === '\SplFileObject') { /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name @@ -313,21 +373,18 @@ public static function deserialize($data, $class, $httpHeaders = null) $class = $subclass; } } + + /** @var ModelInterface $instance */ $instance = new $class(); foreach ($instance::openAPITypes() as $property => $type) { $propertySetter = $instance::setters()[$property]; - if (!isset($propertySetter)) { - continue; - } - - if (!isset($data->{$instance::attributeMap()[$property]})) { - $instance->$propertySetter(null); + if (!isset($propertySetter) || !isset($data->{$instance::attributeMap()[$property]})) { continue; } - $propertyValue = $data->{$instance::attributeMap()[$property]}; - if (isset($propertyValue)) { + if (isset($data->{$instance::attributeMap()[$property]})) { + $propertyValue = $data->{$instance::attributeMap()[$property]}; $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); } } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 3dd90bb..485899a 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,23 +1,18 @@ - - - - ./test/Api - ./test/Model - - - - - ./lib/Api - ./lib/Model - - - - - + + + + ./lib/Api + ./lib/Model + + + + + ./test/Api + ./test/Model + + + + + diff --git a/test/Api/BlacklistApiTest.php b/test/Api/BlacklistApiTest.php new file mode 100644 index 0000000..4a9cd00 --- /dev/null +++ b/test/Api/BlacklistApiTest.php @@ -0,0 +1,122 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for deleteFromBlacklist + * + * Deletes a phone number from the blacklist. + * + */ + public function testDeleteFromBlacklist() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for fetchBlacklist + * + * Returns all blacklisted phone numbers. + * + */ + public function testFetchBlacklist() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for isBlacklisted + * + * Checks if a phone number is blacklisted. + * + */ + public function testIsBlacklisted() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/ContactsApiTest.php b/test/Api/ContactsApiTest.php new file mode 100644 index 0000000..7cbcd7e --- /dev/null +++ b/test/Api/ContactsApiTest.php @@ -0,0 +1,170 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for createContact + * + * Creates a new contact. + * + */ + public function testCreateContact() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for deleteContact + * + * Deletes a contact. + * + */ + public function testDeleteContact() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for fetchContact + * + * Lists a contact. + * + */ + public function testFetchContact() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for fetchContactGroups + * + * Lists groups of a contact. + * + */ + public function testFetchContactGroups() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for fetchContacts + * + * Returns all contacts. + * + */ + public function testFetchContacts() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for removeContactFromGroup + * + * Removes a contact from a group. + * + */ + public function testRemoveContactFromGroup() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for updateContact + * + * Updates a contact. + * + */ + public function testUpdateContact() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/DeliveryReportApiTest.php b/test/Api/DeliveryReportApiTest.php new file mode 100644 index 0000000..cce94dd --- /dev/null +++ b/test/Api/DeliveryReportApiTest.php @@ -0,0 +1,86 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/GroupsApiTest.php b/test/Api/GroupsApiTest.php new file mode 100644 index 0000000..3faadc3 --- /dev/null +++ b/test/Api/GroupsApiTest.php @@ -0,0 +1,134 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for deleteGroup + * + * Deletes a group. + * + */ + public function testDeleteGroup() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for fetchGroup + * + * Lists a group. + * + */ + public function testFetchGroup() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for fetchGroups + * + * Returns all groups. + * + */ + public function testFetchGroups() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for updateGroup + * + * Updates a group with the provided name. + * + */ + public function testUpdateGroup() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/NumberLookupApiTest.php b/test/Api/NumberLookupApiTest.php new file mode 100644 index 0000000..f64ee88 --- /dev/null +++ b/test/Api/NumberLookupApiTest.php @@ -0,0 +1,86 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/OmnimessageApiTest.php b/test/Api/OmnimessageApiTest.php new file mode 100644 index 0000000..6b61e27 --- /dev/null +++ b/test/Api/OmnimessageApiTest.php @@ -0,0 +1,98 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for sendOmnimessage + * + * Sends an Omnimessage. + * + */ + public function testSendOmnimessage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/StatisticsApiTest.php b/test/Api/StatisticsApiTest.php new file mode 100644 index 0000000..10f2646 --- /dev/null +++ b/test/Api/StatisticsApiTest.php @@ -0,0 +1,86 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ChannelTest.php b/test/Model/ChannelTest.php new file mode 100644 index 0000000..5d478ad --- /dev/null +++ b/test/Model/ChannelTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ContactEnvelopeTest.php b/test/Model/ContactEnvelopeTest.php new file mode 100644 index 0000000..ad42b6a --- /dev/null +++ b/test/Model/ContactEnvelopeTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "contact" + */ + public function testPropertyContact() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ContactFieldsTest.php b/test/Model/ContactFieldsTest.php new file mode 100644 index 0000000..7fa774d --- /dev/null +++ b/test/Model/ContactFieldsTest.php @@ -0,0 +1,172 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "phoneNumber" + */ + public function testPropertyPhoneNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "email" + */ + public function testPropertyEmail() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "firstName" + */ + public function testPropertyFirstName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "lastName" + */ + public function testPropertyLastName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "company" + */ + public function testPropertyCompany() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "title" + */ + public function testPropertyTitle() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "custom" + */ + public function testPropertyCustom() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "custom2" + */ + public function testPropertyCustom2() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "custom3" + */ + public function testPropertyCustom3() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "custom4" + */ + public function testPropertyCustom4() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ContactListEnvelopeTest.php b/test/Model/ContactListEnvelopeTest.php new file mode 100644 index 0000000..bde0072 --- /dev/null +++ b/test/Model/ContactListEnvelopeTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "contacts" + */ + public function testPropertyContacts() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ContactResponseFieldsTest.php b/test/Model/ContactResponseFieldsTest.php new file mode 100644 index 0000000..0709a33 --- /dev/null +++ b/test/Model/ContactResponseFieldsTest.php @@ -0,0 +1,181 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "phoneNumber" + */ + public function testPropertyPhoneNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "email" + */ + public function testPropertyEmail() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "firstName" + */ + public function testPropertyFirstName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "lastName" + */ + public function testPropertyLastName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "company" + */ + public function testPropertyCompany() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "title" + */ + public function testPropertyTitle() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "custom" + */ + public function testPropertyCustom() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "custom2" + */ + public function testPropertyCustom2() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "custom3" + */ + public function testPropertyCustom3() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "custom4" + */ + public function testPropertyCustom4() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "scheduledDeletionDate" + */ + public function testPropertyScheduledDeletionDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ContactUpdateFieldsTest.php b/test/Model/ContactUpdateFieldsTest.php new file mode 100644 index 0000000..c179501 --- /dev/null +++ b/test/Model/ContactUpdateFieldsTest.php @@ -0,0 +1,163 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "email" + */ + public function testPropertyEmail() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "firstName" + */ + public function testPropertyFirstName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "lastName" + */ + public function testPropertyLastName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "company" + */ + public function testPropertyCompany() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "title" + */ + public function testPropertyTitle() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "custom" + */ + public function testPropertyCustom() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "custom2" + */ + public function testPropertyCustom2() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "custom3" + */ + public function testPropertyCustom3() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "custom4" + */ + public function testPropertyCustom4() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DeliveryReportResponseTest.php b/test/Model/DeliveryReportResponseTest.php new file mode 100644 index 0000000..8bb70a1 --- /dev/null +++ b/test/Model/DeliveryReportResponseTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "statuses" + */ + public function testPropertyStatuses() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "to" + */ + public function testPropertyTo() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "omnimessageId" + */ + public function testPropertyOmnimessageId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DeliveryResultTest.php b/test/Model/DeliveryResultTest.php new file mode 100644 index 0000000..a1e207b --- /dev/null +++ b/test/Model/DeliveryResultTest.php @@ -0,0 +1,136 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "channel" + */ + public function testPropertyChannel() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "messageId" + */ + public function testPropertyMessageId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "error" + */ + public function testPropertyError() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "err" + */ + public function testPropertyErr() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timestamp" + */ + public function testPropertyTimestamp() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ErrorCodeOmnichannelMachineTest.php b/test/Model/ErrorCodeOmnichannelMachineTest.php new file mode 100644 index 0000000..1cdf214 --- /dev/null +++ b/test/Model/ErrorCodeOmnichannelMachineTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ErrorCodeOmnichannelTest.php b/test/Model/ErrorCodeOmnichannelTest.php new file mode 100644 index 0000000..78fddb5 --- /dev/null +++ b/test/Model/ErrorCodeOmnichannelTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ErrorCodePhonebookTest.php b/test/Model/ErrorCodePhonebookTest.php new file mode 100644 index 0000000..71bc429 --- /dev/null +++ b/test/Model/ErrorCodePhonebookTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ErrorCodeStatisticsTest.php b/test/Model/ErrorCodeStatisticsTest.php new file mode 100644 index 0000000..f03468e --- /dev/null +++ b/test/Model/ErrorCodeStatisticsTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ErrorItemNumberLookupErrorTest.php b/test/Model/ErrorItemNumberLookupErrorTest.php new file mode 100644 index 0000000..8885f53 --- /dev/null +++ b/test/Model/ErrorItemNumberLookupErrorTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "description" + */ + public function testPropertyDescription() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "code" + */ + public function testPropertyCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ErrorItemNumberLookupTest.php b/test/Model/ErrorItemNumberLookupTest.php new file mode 100644 index 0000000..9246aa1 --- /dev/null +++ b/test/Model/ErrorItemNumberLookupTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "error" + */ + public function testPropertyError() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ErrorItemOmnichannelTest.php b/test/Model/ErrorItemOmnichannelTest.php new file mode 100644 index 0000000..ae5544a --- /dev/null +++ b/test/Model/ErrorItemOmnichannelTest.php @@ -0,0 +1,118 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "title" + */ + public function testPropertyTitle() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "detail" + */ + public function testPropertyDetail() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "code" + */ + public function testPropertyCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "source" + */ + public function testPropertySource() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ErrorItemPhonebookTest.php b/test/Model/ErrorItemPhonebookTest.php new file mode 100644 index 0000000..4d28e07 --- /dev/null +++ b/test/Model/ErrorItemPhonebookTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "title" + */ + public function testPropertyTitle() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "detail" + */ + public function testPropertyDetail() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "code" + */ + public function testPropertyCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ErrorItemStatisticsTest.php b/test/Model/ErrorItemStatisticsTest.php new file mode 100644 index 0000000..24e42b7 --- /dev/null +++ b/test/Model/ErrorItemStatisticsTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "title" + */ + public function testPropertyTitle() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "details" + */ + public function testPropertyDetails() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "code" + */ + public function testPropertyCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ErrorNumberLookupTest.php b/test/Model/ErrorNumberLookupTest.php new file mode 100644 index 0000000..27b57c4 --- /dev/null +++ b/test/Model/ErrorNumberLookupTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "errors" + */ + public function testPropertyErrors() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ErrorOmnichannelTest.php b/test/Model/ErrorOmnichannelTest.php new file mode 100644 index 0000000..5f1e138 --- /dev/null +++ b/test/Model/ErrorOmnichannelTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "errors" + */ + public function testPropertyErrors() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ErrorPhonebookTest.php b/test/Model/ErrorPhonebookTest.php new file mode 100644 index 0000000..4e836bf --- /dev/null +++ b/test/Model/ErrorPhonebookTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "errors" + */ + public function testPropertyErrors() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ErrorStatisticsTest.php b/test/Model/ErrorStatisticsTest.php new file mode 100644 index 0000000..4272499 --- /dev/null +++ b/test/Model/ErrorStatisticsTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "errors" + */ + public function testPropertyErrors() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ErrorTitleOmnichannelTest.php b/test/Model/ErrorTitleOmnichannelTest.php new file mode 100644 index 0000000..c29096a --- /dev/null +++ b/test/Model/ErrorTitleOmnichannelTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ErrorTitlePhonebookTest.php b/test/Model/ErrorTitlePhonebookTest.php new file mode 100644 index 0000000..2816116 --- /dev/null +++ b/test/Model/ErrorTitlePhonebookTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/FetchBlacklistSuccessTest.php b/test/Model/FetchBlacklistSuccessTest.php new file mode 100644 index 0000000..a93ea6f --- /dev/null +++ b/test/Model/FetchBlacklistSuccessTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "phoneNumbers" + */ + public function testPropertyPhoneNumbers() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/GroupEnvelopeTest.php b/test/Model/GroupEnvelopeTest.php new file mode 100644 index 0000000..ac7b3b1 --- /dev/null +++ b/test/Model/GroupEnvelopeTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "group" + */ + public function testPropertyGroup() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/GroupListEnvelopeTest.php b/test/Model/GroupListEnvelopeTest.php new file mode 100644 index 0000000..47b2f4b --- /dev/null +++ b/test/Model/GroupListEnvelopeTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "groups" + */ + public function testPropertyGroups() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/GroupNameTest.php b/test/Model/GroupNameTest.php new file mode 100644 index 0000000..82a5d94 --- /dev/null +++ b/test/Model/GroupNameTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/GroupResponseFieldsTest.php b/test/Model/GroupResponseFieldsTest.php new file mode 100644 index 0000000..cd5136a --- /dev/null +++ b/test/Model/GroupResponseFieldsTest.php @@ -0,0 +1,118 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "createdOn" + */ + public function testPropertyCreatedOn() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "contactsCount" + */ + public function testPropertyContactsCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/MessageResultTest.php b/test/Model/MessageResultTest.php new file mode 100644 index 0000000..778d4dc --- /dev/null +++ b/test/Model/MessageResultTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "messageId" + */ + public function testPropertyMessageId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "channel" + */ + public function testPropertyChannel() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sender" + */ + public function testPropertySender() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/MobileNetworkTest.php b/test/Model/MobileNetworkTest.php new file mode 100644 index 0000000..6b19db3 --- /dev/null +++ b/test/Model/MobileNetworkTest.php @@ -0,0 +1,127 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "mccmnc" + */ + public function testPropertyMccmnc() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "networkName" + */ + public function testPropertyNetworkName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "countryName" + */ + public function testPropertyCountryName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "countryPrefix" + */ + public function testPropertyCountryPrefix() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "countryCode" + */ + public function testPropertyCountryCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/NumberToBlacklistTest.php b/test/Model/NumberToBlacklistTest.php new file mode 100644 index 0000000..2b005cd --- /dev/null +++ b/test/Model/NumberToBlacklistTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "phoneNumber" + */ + public function testPropertyPhoneNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/NumbersToInvestigateTest.php b/test/Model/NumbersToInvestigateTest.php new file mode 100644 index 0000000..54c17fb --- /dev/null +++ b/test/Model/NumbersToInvestigateTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "numbers" + */ + public function testPropertyNumbers() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/OmniMessageCreateSuccessResponseTest.php b/test/Model/OmniMessageCreateSuccessResponseTest.php new file mode 100644 index 0000000..1544f73 --- /dev/null +++ b/test/Model/OmniMessageCreateSuccessResponseTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "messages" + */ + public function testPropertyMessages() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "to" + */ + public function testPropertyTo() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "omnimessageId" + */ + public function testPropertyOmnimessageId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/OmnimessageTest.php b/test/Model/OmnimessageTest.php new file mode 100644 index 0000000..c498a37 --- /dev/null +++ b/test/Model/OmnimessageTest.php @@ -0,0 +1,136 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "to" + */ + public function testPropertyTo() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "messages" + */ + public function testPropertyMessages() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "dlrUrl" + */ + public function testPropertyDlrUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "textStore" + */ + public function testPropertyTextStore() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timeToSend" + */ + public function testPropertyTimeToSend() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "priority" + */ + public function testPropertyPriority() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/PriorityTest.php b/test/Model/PriorityTest.php new file mode 100644 index 0000000..124fe12 --- /dev/null +++ b/test/Model/PriorityTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SMSTest.php b/test/Model/SMSTest.php new file mode 100644 index 0000000..c8cede3 --- /dev/null +++ b/test/Model/SMSTest.php @@ -0,0 +1,136 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "text" + */ + public function testPropertyText() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sender" + */ + public function testPropertySender() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "validity" + */ + public function testPropertyValidity() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "autoconvert" + */ + public function testPropertyAutoconvert() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "udh" + */ + public function testPropertyUdh() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "channel" + */ + public function testPropertyChannel() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/StatisticsReportSettingsTest.php b/test/Model/StatisticsReportSettingsTest.php new file mode 100644 index 0000000..d73d235 --- /dev/null +++ b/test/Model/StatisticsReportSettingsTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "startDate" + */ + public function testPropertyStartDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "endDate" + */ + public function testPropertyEndDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "messageTypes" + */ + public function testPropertyMessageTypes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/StatisticsReportSuccessTest.php b/test/Model/StatisticsReportSuccessTest.php new file mode 100644 index 0000000..f200c05 --- /dev/null +++ b/test/Model/StatisticsReportSuccessTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "reports" + */ + public function testPropertyReports() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/StatisticsReportTest.php b/test/Model/StatisticsReportTest.php new file mode 100644 index 0000000..8a4021a --- /dev/null +++ b/test/Model/StatisticsReportTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "totalMessages" + */ + public function testPropertyTotalMessages() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "totalPrice" + */ + public function testPropertyTotalPrice() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "country" + */ + public function testPropertyCountry() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/StatusTest.php b/test/Model/StatusTest.php new file mode 100644 index 0000000..10530f9 --- /dev/null +++ b/test/Model/StatusTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SyncNumberLookupResultTest.php b/test/Model/SyncNumberLookupResultTest.php new file mode 100644 index 0000000..8eb6dae --- /dev/null +++ b/test/Model/SyncNumberLookupResultTest.php @@ -0,0 +1,163 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "number" + */ + public function testPropertyNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "roaming" + */ + public function testPropertyRoaming() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ported" + */ + public function testPropertyPorted() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "roamingNetwork" + */ + public function testPropertyRoamingNetwork() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "currentNetwork" + */ + public function testPropertyCurrentNetwork() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "originalNetwork" + */ + public function testPropertyOriginalNetwork() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "portedNetwork" + */ + public function testPropertyPortedNetwork() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "error" + */ + public function testPropertyError() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SyncNumberLookupSuccessTest.php b/test/Model/SyncNumberLookupSuccessTest.php new file mode 100644 index 0000000..1274234 --- /dev/null +++ b/test/Model/SyncNumberLookupSuccessTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "requestId" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "result" + */ + public function testPropertyResult() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/TelegramTest.php b/test/Model/TelegramTest.php new file mode 100644 index 0000000..6a88027 --- /dev/null +++ b/test/Model/TelegramTest.php @@ -0,0 +1,145 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sender" + */ + public function testPropertySender() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "validity" + */ + public function testPropertyValidity() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "text" + */ + public function testPropertyText() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "imageUrl" + */ + public function testPropertyImageUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "documentUrl" + */ + public function testPropertyDocumentUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "audioUrl" + */ + public function testPropertyAudioUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "channel" + */ + public function testPropertyChannel() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/TextStoreTest.php b/test/Model/TextStoreTest.php new file mode 100644 index 0000000..70ff6ca --- /dev/null +++ b/test/Model/TextStoreTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ViberTest.php b/test/Model/ViberTest.php new file mode 100644 index 0000000..bc8daca --- /dev/null +++ b/test/Model/ViberTest.php @@ -0,0 +1,145 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sender" + */ + public function testPropertySender() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "validity" + */ + public function testPropertyValidity() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "text" + */ + public function testPropertyText() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "imageUrl" + */ + public function testPropertyImageUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "buttonUrl" + */ + public function testPropertyButtonUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "buttonText" + */ + public function testPropertyButtonText() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "channel" + */ + public function testPropertyChannel() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/WhatsAppAudioTest.php b/test/Model/WhatsAppAudioTest.php new file mode 100644 index 0000000..9d4fec7 --- /dev/null +++ b/test/Model/WhatsAppAudioTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "content" + */ + public function testPropertyContent() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/WhatsAppDocumentTest.php b/test/Model/WhatsAppDocumentTest.php new file mode 100644 index 0000000..022c0fa --- /dev/null +++ b/test/Model/WhatsAppDocumentTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "caption" + */ + public function testPropertyCaption() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "content" + */ + public function testPropertyContent() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/WhatsAppImageTest.php b/test/Model/WhatsAppImageTest.php new file mode 100644 index 0000000..e9d384f --- /dev/null +++ b/test/Model/WhatsAppImageTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "caption" + */ + public function testPropertyCaption() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "content" + */ + public function testPropertyContent() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/WhatsAppTest.php b/test/Model/WhatsAppTest.php new file mode 100644 index 0000000..462de55 --- /dev/null +++ b/test/Model/WhatsAppTest.php @@ -0,0 +1,145 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sender" + */ + public function testPropertySender() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "validity" + */ + public function testPropertyValidity() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "text" + */ + public function testPropertyText() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "image" + */ + public function testPropertyImage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "document" + */ + public function testPropertyDocument() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "audio" + */ + public function testPropertyAudio() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "channel" + */ + public function testPropertyChannel() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/WhatsAppTextTest.php b/test/Model/WhatsAppTextTest.php new file mode 100644 index 0000000..a3b7035 --- /dev/null +++ b/test/Model/WhatsAppTextTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "previewUrl" + */ + public function testPropertyPreviewUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "body" + */ + public function testPropertyBody() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} From 71805c99f472edaa92ddf1b226fe321a765b32aa Mon Sep 17 00:00:00 2001 From: api-librarian Date: Thu, 14 Jul 2022 11:01:01 +0000 Subject: [PATCH 3/8] Travis update: Jul 2022 (Build 697) [skip ci] --- .gitignore | 14 - .openapi-generator/FILES | 184 ------ .openapi-generator/VERSION | 2 +- .travis.yml | 11 +- README.md | 4 +- composer.json | 2 +- docs/Api/BlacklistApi.md | 72 ++- docs/Api/ContactsApi.md | 147 ++--- docs/Api/DeliveryReportApi.md | 20 +- docs/Api/GroupsApi.md | 95 +-- docs/Api/NumberLookupApi.md | 22 +- docs/Api/OmnimessageApi.md | 39 +- docs/Api/StatisticsApi.md | 22 +- docs/Model/Channel.md | 4 +- docs/Model/ContactEnvelope.md | 6 +- docs/Model/ContactFields.md | 24 +- docs/Model/ContactListEnvelope.md | 6 +- docs/Model/ContactResponseFields.md | 26 +- docs/Model/ContactUpdateFields.md | 22 +- docs/Model/DeliveryReportResponse.md | 10 +- docs/Model/DeliveryResult.md | 18 +- docs/Model/ErrorCodeOmnichannel.md | 4 +- docs/Model/ErrorCodeOmnichannelMachine.md | 4 +- docs/Model/ErrorCodePhonebook.md | 4 +- docs/Model/ErrorCodeStatistics.md | 4 +- docs/Model/ErrorItemNumberLookup.md | 6 +- docs/Model/ErrorItemNumberLookupError.md | 8 +- docs/Model/ErrorItemOmnichannel.md | 12 +- docs/Model/ErrorItemPhonebook.md | 10 +- docs/Model/ErrorItemStatistics.md | 10 +- docs/Model/ErrorNumberLookup.md | 6 +- docs/Model/ErrorOmnichannel.md | 6 +- docs/Model/ErrorPhonebook.md | 6 +- docs/Model/ErrorStatistics.md | 6 +- docs/Model/ErrorTitleOmnichannel.md | 4 +- docs/Model/ErrorTitlePhonebook.md | 4 +- docs/Model/FetchBlacklistSuccess.md | 6 +- docs/Model/GroupEnvelope.md | 6 +- docs/Model/GroupListEnvelope.md | 6 +- docs/Model/GroupName.md | 6 +- docs/Model/GroupResponseFields.md | 12 +- docs/Model/MessageResult.md | 10 +- docs/Model/MobileNetwork.md | 14 +- docs/Model/NumberToBlacklist.md | 6 +- docs/Model/NumbersToInvestigate.md | 6 +- .../Model/OmniMessageCreateSuccessResponse.md | 10 +- docs/Model/Omnimessage.md | 18 +- docs/Model/Priority.md | 4 +- docs/Model/SMS.md | 14 +- docs/Model/StatisticsReport.md | 10 +- docs/Model/StatisticsReportSettings.md | 10 +- docs/Model/StatisticsReportSuccess.md | 6 +- docs/Model/Status.md | 4 +- docs/Model/SyncNumberLookupResult.md | 22 +- docs/Model/SyncNumberLookupSuccess.md | 8 +- docs/Model/Telegram.md | 16 +- docs/Model/TextStore.md | 4 +- docs/Model/Viber.md | 16 +- docs/Model/WhatsApp.md | 16 +- docs/Model/WhatsAppAudio.md | 6 +- docs/Model/WhatsAppDocument.md | 8 +- docs/Model/WhatsAppImage.md | 8 +- docs/Model/WhatsAppText.md | 6 +- git_push.sh | 17 +- lib/Api/BlacklistApi.php | 229 ++++--- lib/Api/ContactsApi.php | 581 +++++++++--------- lib/Api/DeliveryReportApi.php | 86 +-- lib/Api/GroupsApi.php | 357 ++++++----- lib/Api/NumberLookupApi.php | 95 ++- lib/Api/OmnimessageApi.php | 152 +++-- lib/Api/StatisticsApi.php | 99 ++- lib/ApiException.php | 24 +- lib/Configuration.php | 51 +- lib/HeaderSelector.php | 13 +- lib/Model/Channel.php | 13 +- lib/Model/ContactEnvelope.php | 139 +++-- lib/Model/ContactFields.php | 301 +++++++-- lib/Model/ContactListEnvelope.php | 137 +++-- lib/Model/ContactResponseFields.php | 319 ++++++++-- lib/Model/ContactUpdateFields.php | 290 +++++++-- lib/Model/DeliveryReportResponse.php | 161 +++-- lib/Model/DeliveryResult.php | 194 ++++-- lib/Model/ErrorCodeOmnichannel.php | 16 +- lib/Model/ErrorCodeOmnichannelMachine.php | 67 +- lib/Model/ErrorCodePhonebook.php | 15 +- lib/Model/ErrorCodeStatistics.php | 13 +- lib/Model/ErrorItemNumberLookup.php | 139 +++-- lib/Model/ErrorItemNumberLookupError.php | 150 +++-- lib/Model/ErrorItemOmnichannel.php | 179 ++++-- lib/Model/ErrorItemPhonebook.php | 161 +++-- lib/Model/ErrorItemStatistics.php | 161 +++-- lib/Model/ErrorNumberLookup.php | 139 +++-- lib/Model/ErrorOmnichannel.php | 139 +++-- lib/Model/ErrorPhonebook.php | 139 +++-- lib/Model/ErrorStatistics.php | 139 +++-- lib/Model/ErrorTitleOmnichannel.php | 16 +- lib/Model/ErrorTitlePhonebook.php | 15 +- lib/Model/FetchBlacklistSuccess.php | 137 +++-- lib/Model/GroupEnvelope.php | 139 +++-- lib/Model/GroupListEnvelope.php | 137 +++-- lib/Model/GroupName.php | 139 +++-- lib/Model/GroupResponseFields.php | 179 ++++-- lib/Model/MessageResult.php | 161 +++-- lib/Model/MobileNetwork.php | 183 ++++-- lib/Model/ModelInterface.php | 6 +- lib/Model/NumberToBlacklist.php | 139 +++-- lib/Model/NumbersToInvestigate.php | 152 +++-- .../OmniMessageCreateSuccessResponse.php | 161 +++-- lib/Model/Omnimessage.php | 194 ++++-- lib/Model/Priority.php | 12 +- lib/Model/SMS.php | 208 +++++-- lib/Model/StatisticsReport.php | 161 +++-- lib/Model/StatisticsReportSettings.php | 161 +++-- lib/Model/StatisticsReportSuccess.php | 139 +++-- lib/Model/Status.php | 20 +- lib/Model/SyncNumberLookupResult.php | 281 +++++++-- lib/Model/SyncNumberLookupSuccess.php | 150 +++-- lib/Model/Telegram.php | 211 +++++-- lib/Model/TextStore.php | 12 +- lib/Model/Viber.php | 211 +++++-- lib/Model/WhatsApp.php | 211 +++++-- lib/Model/WhatsAppAudio.php | 139 +++-- lib/Model/WhatsAppDocument.php | 150 +++-- lib/Model/WhatsAppImage.php | 150 +++-- lib/Model/WhatsAppText.php | 150 +++-- lib/ObjectSerializer.php | 143 ++--- phpunit.xml.dist | 37 +- test/Api/BlacklistApiTest.php | 122 ---- test/Api/ContactsApiTest.php | 170 ----- test/Api/DeliveryReportApiTest.php | 86 --- test/Api/GroupsApiTest.php | 134 ---- test/Api/NumberLookupApiTest.php | 86 --- test/Api/OmnimessageApiTest.php | 98 --- test/Api/StatisticsApiTest.php | 86 --- test/Model/ChannelTest.php | 82 --- test/Model/ContactEnvelopeTest.php | 91 --- test/Model/ContactFieldsTest.php | 172 ------ test/Model/ContactListEnvelopeTest.php | 91 --- test/Model/ContactResponseFieldsTest.php | 181 ------ test/Model/ContactUpdateFieldsTest.php | 163 ----- test/Model/DeliveryReportResponseTest.php | 109 ---- test/Model/DeliveryResultTest.php | 136 ---- .../Model/ErrorCodeOmnichannelMachineTest.php | 82 --- test/Model/ErrorCodeOmnichannelTest.php | 82 --- test/Model/ErrorCodePhonebookTest.php | 82 --- test/Model/ErrorCodeStatisticsTest.php | 82 --- test/Model/ErrorItemNumberLookupErrorTest.php | 100 --- test/Model/ErrorItemNumberLookupTest.php | 91 --- test/Model/ErrorItemOmnichannelTest.php | 118 ---- test/Model/ErrorItemPhonebookTest.php | 109 ---- test/Model/ErrorItemStatisticsTest.php | 109 ---- test/Model/ErrorNumberLookupTest.php | 91 --- test/Model/ErrorOmnichannelTest.php | 91 --- test/Model/ErrorPhonebookTest.php | 91 --- test/Model/ErrorStatisticsTest.php | 91 --- test/Model/ErrorTitleOmnichannelTest.php | 82 --- test/Model/ErrorTitlePhonebookTest.php | 82 --- test/Model/FetchBlacklistSuccessTest.php | 91 --- test/Model/GroupEnvelopeTest.php | 91 --- test/Model/GroupListEnvelopeTest.php | 91 --- test/Model/GroupNameTest.php | 91 --- test/Model/GroupResponseFieldsTest.php | 118 ---- test/Model/MessageResultTest.php | 109 ---- test/Model/MobileNetworkTest.php | 127 ---- test/Model/NumberToBlacklistTest.php | 91 --- test/Model/NumbersToInvestigateTest.php | 91 --- .../OmniMessageCreateSuccessResponseTest.php | 109 ---- test/Model/OmnimessageTest.php | 136 ---- test/Model/PriorityTest.php | 82 --- test/Model/SMSTest.php | 136 ---- test/Model/StatisticsReportSettingsTest.php | 109 ---- test/Model/StatisticsReportSuccessTest.php | 91 --- test/Model/StatisticsReportTest.php | 109 ---- test/Model/StatusTest.php | 82 --- test/Model/SyncNumberLookupResultTest.php | 163 ----- test/Model/SyncNumberLookupSuccessTest.php | 100 --- test/Model/TelegramTest.php | 145 ----- test/Model/TextStoreTest.php | 82 --- test/Model/ViberTest.php | 145 ----- test/Model/WhatsAppAudioTest.php | 91 --- test/Model/WhatsAppDocumentTest.php | 100 --- test/Model/WhatsAppImageTest.php | 100 --- test/Model/WhatsAppTest.php | 145 ----- test/Model/WhatsAppTextTest.php | 100 --- 184 files changed, 6663 insertions(+), 9573 deletions(-) delete mode 100644 .gitignore delete mode 100644 .openapi-generator/FILES delete mode 100644 test/Api/BlacklistApiTest.php delete mode 100644 test/Api/ContactsApiTest.php delete mode 100644 test/Api/DeliveryReportApiTest.php delete mode 100644 test/Api/GroupsApiTest.php delete mode 100644 test/Api/NumberLookupApiTest.php delete mode 100644 test/Api/OmnimessageApiTest.php delete mode 100644 test/Api/StatisticsApiTest.php delete mode 100644 test/Model/ChannelTest.php delete mode 100644 test/Model/ContactEnvelopeTest.php delete mode 100644 test/Model/ContactFieldsTest.php delete mode 100644 test/Model/ContactListEnvelopeTest.php delete mode 100644 test/Model/ContactResponseFieldsTest.php delete mode 100644 test/Model/ContactUpdateFieldsTest.php delete mode 100644 test/Model/DeliveryReportResponseTest.php delete mode 100644 test/Model/DeliveryResultTest.php delete mode 100644 test/Model/ErrorCodeOmnichannelMachineTest.php delete mode 100644 test/Model/ErrorCodeOmnichannelTest.php delete mode 100644 test/Model/ErrorCodePhonebookTest.php delete mode 100644 test/Model/ErrorCodeStatisticsTest.php delete mode 100644 test/Model/ErrorItemNumberLookupErrorTest.php delete mode 100644 test/Model/ErrorItemNumberLookupTest.php delete mode 100644 test/Model/ErrorItemOmnichannelTest.php delete mode 100644 test/Model/ErrorItemPhonebookTest.php delete mode 100644 test/Model/ErrorItemStatisticsTest.php delete mode 100644 test/Model/ErrorNumberLookupTest.php delete mode 100644 test/Model/ErrorOmnichannelTest.php delete mode 100644 test/Model/ErrorPhonebookTest.php delete mode 100644 test/Model/ErrorStatisticsTest.php delete mode 100644 test/Model/ErrorTitleOmnichannelTest.php delete mode 100644 test/Model/ErrorTitlePhonebookTest.php delete mode 100644 test/Model/FetchBlacklistSuccessTest.php delete mode 100644 test/Model/GroupEnvelopeTest.php delete mode 100644 test/Model/GroupListEnvelopeTest.php delete mode 100644 test/Model/GroupNameTest.php delete mode 100644 test/Model/GroupResponseFieldsTest.php delete mode 100644 test/Model/MessageResultTest.php delete mode 100644 test/Model/MobileNetworkTest.php delete mode 100644 test/Model/NumberToBlacklistTest.php delete mode 100644 test/Model/NumbersToInvestigateTest.php delete mode 100644 test/Model/OmniMessageCreateSuccessResponseTest.php delete mode 100644 test/Model/OmnimessageTest.php delete mode 100644 test/Model/PriorityTest.php delete mode 100644 test/Model/SMSTest.php delete mode 100644 test/Model/StatisticsReportSettingsTest.php delete mode 100644 test/Model/StatisticsReportSuccessTest.php delete mode 100644 test/Model/StatisticsReportTest.php delete mode 100644 test/Model/StatusTest.php delete mode 100644 test/Model/SyncNumberLookupResultTest.php delete mode 100644 test/Model/SyncNumberLookupSuccessTest.php delete mode 100644 test/Model/TelegramTest.php delete mode 100644 test/Model/TextStoreTest.php delete mode 100644 test/Model/ViberTest.php delete mode 100644 test/Model/WhatsAppAudioTest.php delete mode 100644 test/Model/WhatsAppDocumentTest.php delete mode 100644 test/Model/WhatsAppImageTest.php delete mode 100644 test/Model/WhatsAppTest.php delete mode 100644 test/Model/WhatsAppTextTest.php diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 92f7fde..0000000 --- a/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -# ref: https://github.com/github/gitignore/blob/master/Composer.gitignore - -composer.phar -/vendor/ - -# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control -# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file -# composer.lock - -# php-cs-fixer cache -.php_cs.cache - -# PHPUnit cache -.phpunit.result.cache diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES deleted file mode 100644 index 274bcd7..0000000 --- a/.openapi-generator/FILES +++ /dev/null @@ -1,184 +0,0 @@ -.gitignore -.openapi-generator-ignore -.php_cs -.travis.yml -README.md -composer.json -docs/Api/BlacklistApi.md -docs/Api/ContactsApi.md -docs/Api/DeliveryReportApi.md -docs/Api/GroupsApi.md -docs/Api/NumberLookupApi.md -docs/Api/OmnimessageApi.md -docs/Api/StatisticsApi.md -docs/Model/Channel.md -docs/Model/ContactEnvelope.md -docs/Model/ContactFields.md -docs/Model/ContactListEnvelope.md -docs/Model/ContactResponseFields.md -docs/Model/ContactUpdateFields.md -docs/Model/DeliveryReportResponse.md -docs/Model/DeliveryResult.md -docs/Model/ErrorCodeOmnichannel.md -docs/Model/ErrorCodeOmnichannelMachine.md -docs/Model/ErrorCodePhonebook.md -docs/Model/ErrorCodeStatistics.md -docs/Model/ErrorItemNumberLookup.md -docs/Model/ErrorItemNumberLookupError.md -docs/Model/ErrorItemOmnichannel.md -docs/Model/ErrorItemPhonebook.md -docs/Model/ErrorItemStatistics.md -docs/Model/ErrorNumberLookup.md -docs/Model/ErrorOmnichannel.md -docs/Model/ErrorPhonebook.md -docs/Model/ErrorStatistics.md -docs/Model/ErrorTitleOmnichannel.md -docs/Model/ErrorTitlePhonebook.md -docs/Model/FetchBlacklistSuccess.md -docs/Model/GroupEnvelope.md -docs/Model/GroupListEnvelope.md -docs/Model/GroupName.md -docs/Model/GroupResponseFields.md -docs/Model/MessageResult.md -docs/Model/MobileNetwork.md -docs/Model/NumberToBlacklist.md -docs/Model/NumbersToInvestigate.md -docs/Model/OmniMessageCreateSuccessResponse.md -docs/Model/Omnimessage.md -docs/Model/Priority.md -docs/Model/SMS.md -docs/Model/StatisticsReport.md -docs/Model/StatisticsReportSettings.md -docs/Model/StatisticsReportSuccess.md -docs/Model/Status.md -docs/Model/SyncNumberLookupResult.md -docs/Model/SyncNumberLookupSuccess.md -docs/Model/Telegram.md -docs/Model/TextStore.md -docs/Model/Viber.md -docs/Model/WhatsApp.md -docs/Model/WhatsAppAudio.md -docs/Model/WhatsAppDocument.md -docs/Model/WhatsAppImage.md -docs/Model/WhatsAppText.md -git_push.sh -lib/Api/BlacklistApi.php -lib/Api/ContactsApi.php -lib/Api/DeliveryReportApi.php -lib/Api/GroupsApi.php -lib/Api/NumberLookupApi.php -lib/Api/OmnimessageApi.php -lib/Api/StatisticsApi.php -lib/ApiException.php -lib/Configuration.php -lib/HeaderSelector.php -lib/Model/Channel.php -lib/Model/ContactEnvelope.php -lib/Model/ContactFields.php -lib/Model/ContactListEnvelope.php -lib/Model/ContactResponseFields.php -lib/Model/ContactUpdateFields.php -lib/Model/DeliveryReportResponse.php -lib/Model/DeliveryResult.php -lib/Model/ErrorCodeOmnichannel.php -lib/Model/ErrorCodeOmnichannelMachine.php -lib/Model/ErrorCodePhonebook.php -lib/Model/ErrorCodeStatistics.php -lib/Model/ErrorItemNumberLookup.php -lib/Model/ErrorItemNumberLookupError.php -lib/Model/ErrorItemOmnichannel.php -lib/Model/ErrorItemPhonebook.php -lib/Model/ErrorItemStatistics.php -lib/Model/ErrorNumberLookup.php -lib/Model/ErrorOmnichannel.php -lib/Model/ErrorPhonebook.php -lib/Model/ErrorStatistics.php -lib/Model/ErrorTitleOmnichannel.php -lib/Model/ErrorTitlePhonebook.php -lib/Model/FetchBlacklistSuccess.php -lib/Model/GroupEnvelope.php -lib/Model/GroupListEnvelope.php -lib/Model/GroupName.php -lib/Model/GroupResponseFields.php -lib/Model/MessageResult.php -lib/Model/MobileNetwork.php -lib/Model/ModelInterface.php -lib/Model/NumberToBlacklist.php -lib/Model/NumbersToInvestigate.php -lib/Model/OmniMessageCreateSuccessResponse.php -lib/Model/Omnimessage.php -lib/Model/Priority.php -lib/Model/SMS.php -lib/Model/StatisticsReport.php -lib/Model/StatisticsReportSettings.php -lib/Model/StatisticsReportSuccess.php -lib/Model/Status.php -lib/Model/SyncNumberLookupResult.php -lib/Model/SyncNumberLookupSuccess.php -lib/Model/Telegram.php -lib/Model/TextStore.php -lib/Model/Viber.php -lib/Model/WhatsApp.php -lib/Model/WhatsAppAudio.php -lib/Model/WhatsAppDocument.php -lib/Model/WhatsAppImage.php -lib/Model/WhatsAppText.php -lib/ObjectSerializer.php -phpunit.xml.dist -test/Api/BlacklistApiTest.php -test/Api/ContactsApiTest.php -test/Api/DeliveryReportApiTest.php -test/Api/GroupsApiTest.php -test/Api/NumberLookupApiTest.php -test/Api/OmnimessageApiTest.php -test/Api/StatisticsApiTest.php -test/Model/ChannelTest.php -test/Model/ContactEnvelopeTest.php -test/Model/ContactFieldsTest.php -test/Model/ContactListEnvelopeTest.php -test/Model/ContactResponseFieldsTest.php -test/Model/ContactUpdateFieldsTest.php -test/Model/DeliveryReportResponseTest.php -test/Model/DeliveryResultTest.php -test/Model/ErrorCodeOmnichannelMachineTest.php -test/Model/ErrorCodeOmnichannelTest.php -test/Model/ErrorCodePhonebookTest.php -test/Model/ErrorCodeStatisticsTest.php -test/Model/ErrorItemNumberLookupErrorTest.php -test/Model/ErrorItemNumberLookupTest.php -test/Model/ErrorItemOmnichannelTest.php -test/Model/ErrorItemPhonebookTest.php -test/Model/ErrorItemStatisticsTest.php -test/Model/ErrorNumberLookupTest.php -test/Model/ErrorOmnichannelTest.php -test/Model/ErrorPhonebookTest.php -test/Model/ErrorStatisticsTest.php -test/Model/ErrorTitleOmnichannelTest.php -test/Model/ErrorTitlePhonebookTest.php -test/Model/FetchBlacklistSuccessTest.php -test/Model/GroupEnvelopeTest.php -test/Model/GroupListEnvelopeTest.php -test/Model/GroupNameTest.php -test/Model/GroupResponseFieldsTest.php -test/Model/MessageResultTest.php -test/Model/MobileNetworkTest.php -test/Model/NumberToBlacklistTest.php -test/Model/NumbersToInvestigateTest.php -test/Model/OmniMessageCreateSuccessResponseTest.php -test/Model/OmnimessageTest.php -test/Model/PriorityTest.php -test/Model/SMSTest.php -test/Model/StatisticsReportSettingsTest.php -test/Model/StatisticsReportSuccessTest.php -test/Model/StatisticsReportTest.php -test/Model/StatusTest.php -test/Model/SyncNumberLookupResultTest.php -test/Model/SyncNumberLookupSuccessTest.php -test/Model/TelegramTest.php -test/Model/TextStoreTest.php -test/Model/ViberTest.php -test/Model/WhatsAppAudioTest.php -test/Model/WhatsAppDocumentTest.php -test/Model/WhatsAppImageTest.php -test/Model/WhatsAppTest.php -test/Model/WhatsAppTextTest.php diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index e230c83..aa31e71 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.0 \ No newline at end of file +4.0.3 \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 714772e..d77f382 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,10 @@ language: php -# Bionic environment has preinstalled PHP from 7.1 to 7.4 -# https://docs.travis-ci.com/user/reference/bionic/#php-support -dist: bionic +sudo: false php: - - 7.3 - - 7.4 + - 5.4 + - 5.5 + - 5.6 + - 7.0 + - hhvm before_install: "composer install" script: "vendor/bin/phpunit" diff --git a/README.md b/README.md index b8b1fcc..903f149 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Messente API Library -- Messente API version: 2.0.0 -- PHP artifact version: 2.0.0 +- Messente API version: 1.4.0 +- PHP artifact version: 1.4.0 [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. 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 78b3564..ff0e769 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "messente/messente-api-php", - "version": "2.0.0", + "version": "1.4.0", "description": "[Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world.", "keywords": ["viber", "telegram", "sms", "whatsapp", "phonebook", "openapitools", "openapi-generator", diff --git a/docs/Api/BlacklistApi.md b/docs/Api/BlacklistApi.md index 7bd8656..1018d6b 100644 --- a/docs/Api/BlacklistApi.md +++ b/docs/Api/BlacklistApi.md @@ -1,20 +1,19 @@ # Messente\Api\BlacklistApi -All URIs are relative to https://api.messente.com/v1. +All URIs are relative to *https://api.messente.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**addToBlacklist()**](BlacklistApi.md#addToBlacklist) | **POST** /phonebook/blacklist | Adds a phone number to the blacklist -[**deleteFromBlacklist()**](BlacklistApi.md#deleteFromBlacklist) | **DELETE** /phonebook/blacklist/{phone} | Deletes a phone number from the blacklist -[**fetchBlacklist()**](BlacklistApi.md#fetchBlacklist) | **GET** /phonebook/blacklist | Returns all blacklisted phone numbers -[**isBlacklisted()**](BlacklistApi.md#isBlacklisted) | **GET** /phonebook/blacklist/{phone} | Checks if a phone number is blacklisted +[**addToBlacklist**](BlacklistApi.md#addToBlacklist) | **POST** /phonebook/blacklist | Adds a phone number to the blacklist +[**deleteFromBlacklist**](BlacklistApi.md#deleteFromBlacklist) | **DELETE** /phonebook/blacklist/{phone} | Deletes a phone number from the blacklist +[**fetchBlacklist**](BlacklistApi.md#fetchBlacklist) | **GET** /phonebook/blacklist | Returns all blacklisted phone numbers +[**isBlacklisted**](BlacklistApi.md#isBlacklisted) | **GET** /phonebook/blacklist/{phone} | Checks if a phone number is blacklisted -## `addToBlacklist()` -```php -addToBlacklist($numberToBlacklist) -``` +## addToBlacklist + +> addToBlacklist($numberToBlacklist) Adds a phone number to the blacklist @@ -44,10 +43,12 @@ try { } catch (Exception $e) { echo 'Exception when calling BlacklistApi->addToBlacklist: ', $e->getMessage(), PHP_EOL; } +?> ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **numberToBlacklist** | [**\Messente\Api\Model\NumberToBlacklist**](../Model/NumberToBlacklist.md)| Phone number to be blacklisted | @@ -62,18 +63,17 @@ void (empty response body) ### HTTP request headers -- **Content-Type**: `application/json` -- **Accept**: `application/json` +- **Content-Type**: application/json +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -## `deleteFromBlacklist()` -```php -deleteFromBlacklist($phone) -``` +## deleteFromBlacklist + +> deleteFromBlacklist($phone) Deletes a phone number from the blacklist @@ -103,10 +103,12 @@ try { } catch (Exception $e) { echo 'Exception when calling BlacklistApi->deleteFromBlacklist: ', $e->getMessage(), PHP_EOL; } +?> ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **phone** | **string**| A phone number | @@ -122,17 +124,16 @@ void (empty response body) ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: `application/json` +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -## `fetchBlacklist()` -```php -fetchBlacklist(): \Messente\Api\Model\FetchBlacklistSuccess -``` +## fetchBlacklist + +> \Messente\Api\Model\FetchBlacklistSuccess fetchBlacklist() Returns all blacklisted phone numbers @@ -162,6 +163,7 @@ try { } catch (Exception $e) { echo 'Exception when calling BlacklistApi->fetchBlacklist: ', $e->getMessage(), PHP_EOL; } +?> ``` ### Parameters @@ -179,17 +181,16 @@ This endpoint does not need any parameter. ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: `application/json` +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -## `isBlacklisted()` -```php -isBlacklisted($phone) -``` +## isBlacklisted + +> isBlacklisted($phone) Checks if a phone number is blacklisted @@ -219,10 +220,12 @@ try { } catch (Exception $e) { echo 'Exception when calling BlacklistApi->isBlacklisted: ', $e->getMessage(), PHP_EOL; } +?> ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **phone** | **string**| A phone number | @@ -238,8 +241,9 @@ void (empty response body) ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: `application/json` +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/docs/Api/ContactsApi.md b/docs/Api/ContactsApi.md index 970e008..4bf5349 100644 --- a/docs/Api/ContactsApi.md +++ b/docs/Api/ContactsApi.md @@ -1,24 +1,23 @@ # Messente\Api\ContactsApi -All URIs are relative to https://api.messente.com/v1. +All URIs are relative to *https://api.messente.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**addContactToGroup()**](ContactsApi.md#addContactToGroup) | **POST** /phonebook/groups/{groupId}/contacts/{phone} | Adds a contact to a group -[**createContact()**](ContactsApi.md#createContact) | **POST** /phonebook/contacts | Creates a new contact -[**deleteContact()**](ContactsApi.md#deleteContact) | **DELETE** /phonebook/contacts/{phone} | Deletes a contact -[**fetchContact()**](ContactsApi.md#fetchContact) | **GET** /phonebook/contacts/{phone} | Lists a contact -[**fetchContactGroups()**](ContactsApi.md#fetchContactGroups) | **GET** /phonebook/contacts/{phone}/groups | Lists groups of a contact -[**fetchContacts()**](ContactsApi.md#fetchContacts) | **GET** /phonebook/contacts | Returns all contacts -[**removeContactFromGroup()**](ContactsApi.md#removeContactFromGroup) | **DELETE** /phonebook/groups/{groupId}/contacts/{phone} | Removes a contact from a group -[**updateContact()**](ContactsApi.md#updateContact) | **PATCH** /phonebook/contacts/{phone} | Updates a contact +[**addContactToGroup**](ContactsApi.md#addContactToGroup) | **POST** /phonebook/groups/{groupId}/contacts/{phone} | Adds a contact to a group +[**createContact**](ContactsApi.md#createContact) | **POST** /phonebook/contacts | Creates a new contact +[**deleteContact**](ContactsApi.md#deleteContact) | **DELETE** /phonebook/contacts/{phone} | Deletes a contact +[**fetchContact**](ContactsApi.md#fetchContact) | **GET** /phonebook/contacts/{phone} | Lists a contact +[**fetchContactGroups**](ContactsApi.md#fetchContactGroups) | **GET** /phonebook/contacts/{phone}/groups | Lists groups of a contact +[**fetchContacts**](ContactsApi.md#fetchContacts) | **GET** /phonebook/contacts | Returns all contacts +[**removeContactFromGroup**](ContactsApi.md#removeContactFromGroup) | **DELETE** /phonebook/groups/{groupId}/contacts/{phone} | Removes a contact from a group +[**updateContact**](ContactsApi.md#updateContact) | **PATCH** /phonebook/contacts/{phone} | Updates a contact -## `addContactToGroup()` -```php -addContactToGroup($groupId, $phone): object -``` +## addContactToGroup + +> object addContactToGroup($groupId, $phone) Adds a contact to a group @@ -50,10 +49,12 @@ try { } catch (Exception $e) { echo 'Exception when calling ContactsApi->addContactToGroup: ', $e->getMessage(), PHP_EOL; } +?> ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **groupId** | **string**| String in UUID format | @@ -70,17 +71,16 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: `application/json` +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -## `createContact()` -```php -createContact($contactFields): \Messente\Api\Model\ContactEnvelope -``` +## createContact + +> \Messente\Api\Model\ContactEnvelope createContact($contactFields) Creates a new contact @@ -103,7 +103,7 @@ $apiInstance = new Messente\Api\Api\ContactsApi( new GuzzleHttp\Client(), $config ); -$contactFields = {"phoneNumber":"+37251000000","email":"anyone@messente.com","firstName":"Any","lastName":"One","company":"Messente","title":"Sir","custom":"Any custom","custom2":"Any custom two","custom3":"Any custom three","custom4":"Any custom four"}; // \Messente\Api\Model\ContactFields +$contactFields = {"phoneNumber":"+37251000000","email":"anyone@messente.com","firstName":"Any","lastName":"One","company":"Messente","title":"Sir","custom":"Any custom","custom2":"Any custom two","custom3":"Any custom three","custom4":"Any custom four"}; // \Messente\Api\Model\ContactFields | try { $result = $apiInstance->createContact($contactFields); @@ -111,10 +111,12 @@ try { } catch (Exception $e) { echo 'Exception when calling ContactsApi->createContact: ', $e->getMessage(), PHP_EOL; } +?> ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **contactFields** | [**\Messente\Api\Model\ContactFields**](../Model/ContactFields.md)| | @@ -129,18 +131,17 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: `application/json` -- **Accept**: `application/json` +- **Content-Type**: application/json +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -## `deleteContact()` -```php -deleteContact($phone) -``` +## deleteContact + +> deleteContact($phone) Deletes a contact @@ -170,10 +171,12 @@ try { } catch (Exception $e) { echo 'Exception when calling ContactsApi->deleteContact: ', $e->getMessage(), PHP_EOL; } +?> ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **phone** | **string**| A phone number | @@ -189,17 +192,16 @@ void (empty response body) ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: `application/json` +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -## `fetchContact()` -```php -fetchContact($phone): \Messente\Api\Model\ContactEnvelope -``` +## fetchContact + +> \Messente\Api\Model\ContactEnvelope fetchContact($phone) Lists a contact @@ -230,10 +232,12 @@ try { } catch (Exception $e) { echo 'Exception when calling ContactsApi->fetchContact: ', $e->getMessage(), PHP_EOL; } +?> ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **phone** | **string**| A phone number | @@ -249,17 +253,16 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: `application/json` +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -## `fetchContactGroups()` -```php -fetchContactGroups($phone): \Messente\Api\Model\GroupListEnvelope -``` +## fetchContactGroups + +> \Messente\Api\Model\GroupListEnvelope fetchContactGroups($phone) Lists groups of a contact @@ -290,10 +293,12 @@ try { } catch (Exception $e) { echo 'Exception when calling ContactsApi->fetchContactGroups: ', $e->getMessage(), PHP_EOL; } +?> ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **phone** | **string**| A phone number | @@ -309,17 +314,16 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: `application/json` +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -## `fetchContacts()` -```php -fetchContacts($groupIds): \Messente\Api\Model\ContactListEnvelope -``` +## fetchContacts + +> \Messente\Api\Model\ContactListEnvelope fetchContacts($groupIds) Returns all contacts @@ -350,10 +354,12 @@ try { } catch (Exception $e) { echo 'Exception when calling ContactsApi->fetchContacts: ', $e->getMessage(), PHP_EOL; } +?> ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **groupIds** | [**string[]**](../Model/string.md)| Optional one or many group id strings in UUID format. For example: \"/contacts?groupIds=group_id_one&groupIds=group_id_two\" | [optional] @@ -369,17 +375,16 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: `application/json` +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -## `removeContactFromGroup()` -```php -removeContactFromGroup($groupId, $phone) -``` +## removeContactFromGroup + +> removeContactFromGroup($groupId, $phone) Removes a contact from a group @@ -410,10 +415,12 @@ try { } catch (Exception $e) { echo 'Exception when calling ContactsApi->removeContactFromGroup: ', $e->getMessage(), PHP_EOL; } +?> ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **groupId** | **string**| String in UUID format | @@ -430,17 +437,16 @@ void (empty response body) ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: `application/json` +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -## `updateContact()` -```php -updateContact($phone, $contactUpdateFields): \Messente\Api\Model\ContactEnvelope -``` +## updateContact + +> \Messente\Api\Model\ContactEnvelope updateContact($phone, $contactUpdateFields) Updates a contact @@ -464,7 +470,7 @@ $apiInstance = new Messente\Api\Api\ContactsApi( $config ); $phone = +37251000000; // string | A phone number -$contactUpdateFields = {"email":"anyone@messente.com","firstName":"Any","lastName":"One","company":"Messente","title":"Sir","custom":"Any custom","custom2":"Any custom two","custom3":"Any custom three","custom4":"Any custom four"}; // \Messente\Api\Model\ContactUpdateFields +$contactUpdateFields = {"email":"anyone@messente.com","firstName":"Any","lastName":"One","company":"Messente","title":"Sir","custom":"Any custom","custom2":"Any custom two","custom3":"Any custom three","custom4":"Any custom four"}; // \Messente\Api\Model\ContactUpdateFields | try { $result = $apiInstance->updateContact($phone, $contactUpdateFields); @@ -472,10 +478,12 @@ try { } catch (Exception $e) { echo 'Exception when calling ContactsApi->updateContact: ', $e->getMessage(), PHP_EOL; } +?> ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **phone** | **string**| A phone number | @@ -491,9 +499,10 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: `application/json` -- **Accept**: `application/json` +- **Content-Type**: application/json +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/docs/Api/DeliveryReportApi.md b/docs/Api/DeliveryReportApi.md index ef62c6f..7c2d10e 100644 --- a/docs/Api/DeliveryReportApi.md +++ b/docs/Api/DeliveryReportApi.md @@ -1,17 +1,16 @@ # Messente\Api\DeliveryReportApi -All URIs are relative to https://api.messente.com/v1. +All URIs are relative to *https://api.messente.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**retrieveDeliveryReport()**](DeliveryReportApi.md#retrieveDeliveryReport) | **GET** /omnimessage/{omnimessageId}/status | Retrieves the delivery report for the Omnimessage +[**retrieveDeliveryReport**](DeliveryReportApi.md#retrieveDeliveryReport) | **GET** /omnimessage/{omnimessageId}/status | Retrieves the delivery report for the Omnimessage -## `retrieveDeliveryReport()` -```php -retrieveDeliveryReport($omnimessageId): \Messente\Api\Model\DeliveryReportResponse -``` +## retrieveDeliveryReport + +> \Messente\Api\Model\DeliveryReportResponse retrieveDeliveryReport($omnimessageId) Retrieves the delivery report for the Omnimessage @@ -42,10 +41,12 @@ try { } catch (Exception $e) { echo 'Exception when calling DeliveryReportApi->retrieveDeliveryReport: ', $e->getMessage(), PHP_EOL; } +?> ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **omnimessageId** | **string**| UUID of the omnimessage to for which the delivery report is to be retrieved | @@ -61,8 +62,9 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: `application/json` +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/docs/Api/GroupsApi.md b/docs/Api/GroupsApi.md index f511a0e..5e910c5 100644 --- a/docs/Api/GroupsApi.md +++ b/docs/Api/GroupsApi.md @@ -1,21 +1,20 @@ # Messente\Api\GroupsApi -All URIs are relative to https://api.messente.com/v1. +All URIs are relative to *https://api.messente.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**createGroup()**](GroupsApi.md#createGroup) | **POST** /phonebook/groups | Creates a new group with the provided name -[**deleteGroup()**](GroupsApi.md#deleteGroup) | **DELETE** /phonebook/groups/{groupId} | Deletes a group -[**fetchGroup()**](GroupsApi.md#fetchGroup) | **GET** /phonebook/groups/{groupId} | Lists a group -[**fetchGroups()**](GroupsApi.md#fetchGroups) | **GET** /phonebook/groups | Returns all groups -[**updateGroup()**](GroupsApi.md#updateGroup) | **PUT** /phonebook/groups/{groupId} | Updates a group with the provided name +[**createGroup**](GroupsApi.md#createGroup) | **POST** /phonebook/groups | Creates a new group with the provided name +[**deleteGroup**](GroupsApi.md#deleteGroup) | **DELETE** /phonebook/groups/{groupId} | Deletes a group +[**fetchGroup**](GroupsApi.md#fetchGroup) | **GET** /phonebook/groups/{groupId} | Lists a group +[**fetchGroups**](GroupsApi.md#fetchGroups) | **GET** /phonebook/groups | Returns all groups +[**updateGroup**](GroupsApi.md#updateGroup) | **PUT** /phonebook/groups/{groupId} | Updates a group with the provided name -## `createGroup()` -```php -createGroup($groupName): \Messente\Api\Model\GroupEnvelope -``` +## createGroup + +> \Messente\Api\Model\GroupEnvelope createGroup($groupName) Creates a new group with the provided name @@ -38,7 +37,7 @@ $apiInstance = new Messente\Api\Api\GroupsApi( new GuzzleHttp\Client(), $config ); -$groupName = {"name":"Any group name"}; // \Messente\Api\Model\GroupName +$groupName = {"name":"Any group name"}; // \Messente\Api\Model\GroupName | try { $result = $apiInstance->createGroup($groupName); @@ -46,10 +45,12 @@ try { } catch (Exception $e) { echo 'Exception when calling GroupsApi->createGroup: ', $e->getMessage(), PHP_EOL; } +?> ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **groupName** | [**\Messente\Api\Model\GroupName**](../Model/GroupName.md)| | @@ -64,18 +65,17 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: `application/json` -- **Accept**: `application/json` +- **Content-Type**: application/json +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -## `deleteGroup()` -```php -deleteGroup($groupId) -``` +## deleteGroup + +> deleteGroup($groupId) Deletes a group @@ -105,10 +105,12 @@ try { } catch (Exception $e) { echo 'Exception when calling GroupsApi->deleteGroup: ', $e->getMessage(), PHP_EOL; } +?> ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **groupId** | **string**| String in UUID format | @@ -124,17 +126,16 @@ void (empty response body) ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: `application/json` +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -## `fetchGroup()` -```php -fetchGroup($groupId): \Messente\Api\Model\GroupEnvelope -``` +## fetchGroup + +> \Messente\Api\Model\GroupEnvelope fetchGroup($groupId) Lists a group @@ -165,10 +166,12 @@ try { } catch (Exception $e) { echo 'Exception when calling GroupsApi->fetchGroup: ', $e->getMessage(), PHP_EOL; } +?> ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **groupId** | **string**| String in UUID format | @@ -184,17 +187,16 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: `application/json` +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -## `fetchGroups()` -```php -fetchGroups(): \Messente\Api\Model\GroupListEnvelope -``` +## fetchGroups + +> \Messente\Api\Model\GroupListEnvelope fetchGroups() Returns all groups @@ -224,6 +226,7 @@ try { } catch (Exception $e) { echo 'Exception when calling GroupsApi->fetchGroups: ', $e->getMessage(), PHP_EOL; } +?> ``` ### Parameters @@ -241,17 +244,16 @@ This endpoint does not need any parameter. ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: `application/json` +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -## `updateGroup()` -```php -updateGroup($groupId, $groupName): \Messente\Api\Model\GroupEnvelope -``` +## updateGroup + +> \Messente\Api\Model\GroupEnvelope updateGroup($groupId, $groupName) Updates a group with the provided name @@ -275,7 +277,7 @@ $apiInstance = new Messente\Api\Api\GroupsApi( $config ); $groupId = 5792a02a-e5c2-422b-a0a0-0ae65d814663; // string | String in UUID format -$groupName = {"name":"Any group name"}; // \Messente\Api\Model\GroupName +$groupName = {"name":"Any group name"}; // \Messente\Api\Model\GroupName | try { $result = $apiInstance->updateGroup($groupId, $groupName); @@ -283,10 +285,12 @@ try { } catch (Exception $e) { echo 'Exception when calling GroupsApi->updateGroup: ', $e->getMessage(), PHP_EOL; } +?> ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **groupId** | **string**| String in UUID format | @@ -302,9 +306,10 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: `application/json` -- **Accept**: `application/json` +- **Content-Type**: application/json +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/docs/Api/NumberLookupApi.md b/docs/Api/NumberLookupApi.md index c671dfe..4b3088d 100644 --- a/docs/Api/NumberLookupApi.md +++ b/docs/Api/NumberLookupApi.md @@ -1,17 +1,16 @@ # Messente\Api\NumberLookupApi -All URIs are relative to https://api.messente.com/v1. +All URIs are relative to *https://api.messente.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**fetchInfo()**](NumberLookupApi.md#fetchInfo) | **POST** /hlr/sync | Requests info about phone numbers +[**fetchInfo**](NumberLookupApi.md#fetchInfo) | **POST** /hlr/sync | Requests info about phone numbers -## `fetchInfo()` -```php -fetchInfo($numbersToInvestigate): \Messente\Api\Model\SyncNumberLookupSuccess -``` +## fetchInfo + +> \Messente\Api\Model\SyncNumberLookupSuccess fetchInfo($numbersToInvestigate) Requests info about phone numbers @@ -42,10 +41,12 @@ try { } catch (Exception $e) { echo 'Exception when calling NumberLookupApi->fetchInfo: ', $e->getMessage(), PHP_EOL; } +?> ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **numbersToInvestigate** | [**\Messente\Api\Model\NumbersToInvestigate**](../Model/NumbersToInvestigate.md)| Numbers for lookup | @@ -60,9 +61,10 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: `application/json` -- **Accept**: `application/json` +- **Content-Type**: application/json +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/docs/Api/OmnimessageApi.md b/docs/Api/OmnimessageApi.md index c07dc9b..95c84e9 100644 --- a/docs/Api/OmnimessageApi.md +++ b/docs/Api/OmnimessageApi.md @@ -1,18 +1,17 @@ # Messente\Api\OmnimessageApi -All URIs are relative to https://api.messente.com/v1. +All URIs are relative to *https://api.messente.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**cancelScheduledMessage()**](OmnimessageApi.md#cancelScheduledMessage) | **DELETE** /omnimessage/{omnimessageId} | Cancels a scheduled Omnimessage -[**sendOmnimessage()**](OmnimessageApi.md#sendOmnimessage) | **POST** /omnimessage | Sends an Omnimessage +[**cancelScheduledMessage**](OmnimessageApi.md#cancelScheduledMessage) | **DELETE** /omnimessage/{omnimessageId} | Cancels a scheduled Omnimessage +[**sendOmnimessage**](OmnimessageApi.md#sendOmnimessage) | **POST** /omnimessage | Sends an Omnimessage -## `cancelScheduledMessage()` -```php -cancelScheduledMessage($omnimessageId): object -``` +## cancelScheduledMessage + +> object cancelScheduledMessage($omnimessageId) Cancels a scheduled Omnimessage @@ -43,10 +42,12 @@ try { } catch (Exception $e) { echo 'Exception when calling OmnimessageApi->cancelScheduledMessage: ', $e->getMessage(), PHP_EOL; } +?> ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **omnimessageId** | **string**| UUID of the scheduled omnimessage to be cancelled | @@ -62,17 +63,16 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: `application/json` +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -## `sendOmnimessage()` -```php -sendOmnimessage($omnimessage): \Messente\Api\Model\OmniMessageCreateSuccessResponse -``` +## sendOmnimessage + +> \Messente\Api\Model\OmniMessageCreateSuccessResponse sendOmnimessage($omnimessage) Sends an Omnimessage @@ -103,10 +103,12 @@ try { } catch (Exception $e) { echo 'Exception when calling OmnimessageApi->sendOmnimessage: ', $e->getMessage(), PHP_EOL; } +?> ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **omnimessage** | [**\Messente\Api\Model\Omnimessage**](../Model/Omnimessage.md)| Omnimessage to be sent | @@ -121,9 +123,10 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: `application/json` -- **Accept**: `application/json` +- **Content-Type**: application/json +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/docs/Api/StatisticsApi.md b/docs/Api/StatisticsApi.md index 4cfe438..c6cd0a4 100644 --- a/docs/Api/StatisticsApi.md +++ b/docs/Api/StatisticsApi.md @@ -1,17 +1,16 @@ # Messente\Api\StatisticsApi -All URIs are relative to https://api.messente.com/v1. +All URIs are relative to *https://api.messente.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**createStatisticsReport()**](StatisticsApi.md#createStatisticsReport) | **POST** /statistics/reports | Requests statistics reports for each country +[**createStatisticsReport**](StatisticsApi.md#createStatisticsReport) | **POST** /statistics/reports | Requests statistics reports for each country -## `createStatisticsReport()` -```php -createStatisticsReport($statisticsReportSettings): \Messente\Api\Model\StatisticsReportSuccess -``` +## createStatisticsReport + +> \Messente\Api\Model\StatisticsReportSuccess createStatisticsReport($statisticsReportSettings) Requests statistics reports for each country @@ -42,10 +41,12 @@ try { } catch (Exception $e) { echo 'Exception when calling StatisticsApi->createStatisticsReport: ', $e->getMessage(), PHP_EOL; } +?> ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **statisticsReportSettings** | [**\Messente\Api\Model\StatisticsReportSettings**](../Model/StatisticsReportSettings.md)| Settings for statistics report | @@ -60,9 +61,10 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: `application/json` -- **Accept**: `application/json` +- **Content-Type**: application/json +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/docs/Model/Channel.md b/docs/Model/Channel.md index 866cd4a..7028070 100644 --- a/docs/Model/Channel.md +++ b/docs/Model/Channel.md @@ -5,4 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ContactEnvelope.md b/docs/Model/ContactEnvelope.md index c86b00d..65a43bc 100644 --- a/docs/Model/ContactEnvelope.md +++ b/docs/Model/ContactEnvelope.md @@ -4,6 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**contact** | [**\Messente\Api\Model\ContactResponseFields**](ContactResponseFields.md) | | [optional] +**contact** | [**\Messente\Api\Model\ContactResponseFields**](ContactResponseFields.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContactFields.md b/docs/Model/ContactFields.md index 5f5e1a3..70e6c2f 100644 --- a/docs/Model/ContactFields.md +++ b/docs/Model/ContactFields.md @@ -4,15 +4,17 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**phoneNumber** | **string** | Phone number in e.164 format | -**email** | **string** | The email of the contact | [optional] -**firstName** | **string** | The first name of the contact | [optional] -**lastName** | **string** | The last name of the contact | [optional] -**company** | **string** | The company of the contact | [optional] -**title** | **string** | The title of the contact | [optional] -**custom** | **string** | The first custom field | [optional] -**custom2** | **string** | The second custom field | [optional] -**custom3** | **string** | The third custom field | [optional] -**custom4** | **string** | The fourth custom field | [optional] +**phoneNumber** | **string** | Phone number in e.164 format | +**email** | **string** | The email of the contact | [optional] +**firstName** | **string** | The first name of the contact | [optional] +**lastName** | **string** | The last name of the contact | [optional] +**company** | **string** | The company of the contact | [optional] +**title** | **string** | The title of the contact | [optional] +**custom** | **string** | The first custom field | [optional] +**custom2** | **string** | The second custom field | [optional] +**custom3** | **string** | The third custom field | [optional] +**custom4** | **string** | The fourth custom field | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContactListEnvelope.md b/docs/Model/ContactListEnvelope.md index 0ad220a..ed0764f 100644 --- a/docs/Model/ContactListEnvelope.md +++ b/docs/Model/ContactListEnvelope.md @@ -4,6 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**contacts** | [**\Messente\Api\Model\ContactResponseFields[]**](ContactResponseFields.md) | An array of contacts | [optional] +**contacts** | [**\Messente\Api\Model\ContactResponseFields[]**](ContactResponseFields.md) | An array of contacts | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContactResponseFields.md b/docs/Model/ContactResponseFields.md index d9ed0a8..c0b42b2 100644 --- a/docs/Model/ContactResponseFields.md +++ b/docs/Model/ContactResponseFields.md @@ -4,16 +4,18 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**phoneNumber** | **string** | Phone number in e.164 format | [optional] -**email** | **string** | The email of the contact | [optional] -**firstName** | **string** | The first name of the contact | [optional] -**lastName** | **string** | The last name of the contact | [optional] -**company** | **string** | The company of the contact | [optional] -**title** | **string** | The title of the contact | [optional] -**custom** | **string** | The first custom field | [optional] -**custom2** | **string** | The second custom field | [optional] -**custom3** | **string** | The third custom field | [optional] -**custom4** | **string** | The fourth custom field | [optional] -**scheduledDeletionDate** | **\DateTime** | The date in ISO 8601 format, YYYY-MM-DD, on which the contact is going to be deleted because it has not belonged to a group for 30 days | [optional] +**phoneNumber** | **string** | Phone number in e.164 format | [optional] +**email** | **string** | The email of the contact | [optional] +**firstName** | **string** | The first name of the contact | [optional] +**lastName** | **string** | The last name of the contact | [optional] +**company** | **string** | The company of the contact | [optional] +**title** | **string** | The title of the contact | [optional] +**custom** | **string** | The first custom field | [optional] +**custom2** | **string** | The second custom field | [optional] +**custom3** | **string** | The third custom field | [optional] +**custom4** | **string** | The fourth custom field | [optional] +**scheduledDeletionDate** | [**\DateTime**](\DateTime.md) | The date in ISO 8601 format, YYYY-MM-DD, on which the contact is going to be deleted because it has not belonged to a group for 30 days | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContactUpdateFields.md b/docs/Model/ContactUpdateFields.md index 1110f27..2d004cc 100644 --- a/docs/Model/ContactUpdateFields.md +++ b/docs/Model/ContactUpdateFields.md @@ -4,14 +4,16 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**email** | **string** | The email of the contact | [optional] -**firstName** | **string** | The first name of the contact | [optional] -**lastName** | **string** | The last name of the contact | [optional] -**company** | **string** | The company of the contact | [optional] -**title** | **string** | The title of the contact | [optional] -**custom** | **string** | The first custom field | [optional] -**custom2** | **string** | The second custom field | [optional] -**custom3** | **string** | The third custom field | [optional] -**custom4** | **string** | The fourth custom field | [optional] +**email** | **string** | The email of the contact | [optional] +**firstName** | **string** | The first name of the contact | [optional] +**lastName** | **string** | The last name of the contact | [optional] +**company** | **string** | The company of the contact | [optional] +**title** | **string** | The title of the contact | [optional] +**custom** | **string** | The first custom field | [optional] +**custom2** | **string** | The second custom field | [optional] +**custom3** | **string** | The third custom field | [optional] +**custom4** | **string** | The fourth custom field | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeliveryReportResponse.md b/docs/Model/DeliveryReportResponse.md index 0dc0688..8d5a0cd 100644 --- a/docs/Model/DeliveryReportResponse.md +++ b/docs/Model/DeliveryReportResponse.md @@ -4,8 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**statuses** | [**\Messente\Api\Model\DeliveryResult[]**](DeliveryResult.md) | Contains the delivery reports for each channel, ordered by send order | -**to** | **string** | Phone number in e.164 format | -**omnimessageId** | **string** | Unique identifier for the omnimessage | +**statuses** | [**\Messente\Api\Model\DeliveryResult[]**](DeliveryResult.md) | Contains the delivery reports for each channel, ordered by send order | +**to** | **string** | Phone number in e.164 format | +**omnimessageId** | **string** | Unique identifier for the omnimessage | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeliveryResult.md b/docs/Model/DeliveryResult.md index 427c9f2..7274a16 100644 --- a/docs/Model/DeliveryResult.md +++ b/docs/Model/DeliveryResult.md @@ -4,11 +4,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**status** | [**\Messente\Api\Model\Status**](Status.md) | | [optional] -**channel** | [**\Messente\Api\Model\Channel**](Channel.md) | | [optional] -**messageId** | **string** | Unique identifier for the message | [optional] -**error** | **string** | Human-readable description of what went wrong, *null* in case of success or if the message has not been processed yet | [optional] -**err** | [**\Messente\Api\Model\ErrorCodeOmnichannelMachine**](ErrorCodeOmnichannelMachine.md) | | [optional] -**timestamp** | **\DateTime** | When this status was received by Omnichannel API | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) +**status** | [**\Messente\Api\Model\Status**](Status.md) | | [optional] +**channel** | [**\Messente\Api\Model\Channel**](Channel.md) | | [optional] +**messageId** | **string** | Unique identifier for the message | [optional] +**error** | **string** | Human-readable description of what went wrong, *null* in case of success or if the message has not been processed yet | [optional] +**err** | [**\Messente\Api\Model\ErrorCodeOmnichannelMachine**](ErrorCodeOmnichannelMachine.md) | | [optional] +**timestamp** | [**\DateTime**](\DateTime.md) | When this status was received by Omnichannel API | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ErrorCodeOmnichannel.md b/docs/Model/ErrorCodeOmnichannel.md index 667281b..a8d3477 100644 --- a/docs/Model/ErrorCodeOmnichannel.md +++ b/docs/Model/ErrorCodeOmnichannel.md @@ -5,4 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ErrorCodeOmnichannelMachine.md b/docs/Model/ErrorCodeOmnichannelMachine.md index da84b2d..9269270 100644 --- a/docs/Model/ErrorCodeOmnichannelMachine.md +++ b/docs/Model/ErrorCodeOmnichannelMachine.md @@ -5,4 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ErrorCodePhonebook.md b/docs/Model/ErrorCodePhonebook.md index d7fe431..0718169 100644 --- a/docs/Model/ErrorCodePhonebook.md +++ b/docs/Model/ErrorCodePhonebook.md @@ -5,4 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ErrorCodeStatistics.md b/docs/Model/ErrorCodeStatistics.md index 3ba4cf6..a362880 100644 --- a/docs/Model/ErrorCodeStatistics.md +++ b/docs/Model/ErrorCodeStatistics.md @@ -5,4 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ErrorItemNumberLookup.md b/docs/Model/ErrorItemNumberLookup.md index c923237..e47dbb7 100644 --- a/docs/Model/ErrorItemNumberLookup.md +++ b/docs/Model/ErrorItemNumberLookup.md @@ -4,6 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**error** | [**\Messente\Api\Model\ErrorItemNumberLookupError**](ErrorItemNumberLookupError.md) | | +**error** | [**\Messente\Api\Model\ErrorItemNumberLookupError**](ErrorItemNumberLookupError.md) | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorItemNumberLookupError.md b/docs/Model/ErrorItemNumberLookupError.md index dab852b..a05e7ab 100644 --- a/docs/Model/ErrorItemNumberLookupError.md +++ b/docs/Model/ErrorItemNumberLookupError.md @@ -4,7 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**description** | **string** | Error description | -**code** | **int** | Matches the following error title. This field is a constant * 101 - Unauthorized * 102 - Invalid arguments or parameters * 103 - Server error * 104 - Crediting error #1 * 105 - Crediting error #2 * 106 - Client error | +**description** | **string** | Error description | +**code** | **int** | Matches the following error title. This field is a constant * 101 - Unauthorized * 102 - Invalid arguments or parameters * 103 - Server error * 104 - Crediting error #1 * 105 - Crediting error #2 * 106 - Client error | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorItemOmnichannel.md b/docs/Model/ErrorItemOmnichannel.md index 64aec57..0cafabb 100644 --- a/docs/Model/ErrorItemOmnichannel.md +++ b/docs/Model/ErrorItemOmnichannel.md @@ -4,9 +4,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**title** | [**\Messente\Api\Model\ErrorTitleOmnichannel**](ErrorTitleOmnichannel.md) | | -**detail** | **string** | Free form more detailed description of the error | -**code** | [**\Messente\Api\Model\ErrorCodeOmnichannel**](ErrorCodeOmnichannel.md) | | -**source** | **string** | Describes which field is causing the issue in the payload, null for non 400 status code responses | +**title** | [**\Messente\Api\Model\ErrorTitleOmnichannel**](ErrorTitleOmnichannel.md) | | +**detail** | **string** | Free form more detailed description of the error | +**code** | [**\Messente\Api\Model\ErrorCodeOmnichannel**](ErrorCodeOmnichannel.md) | | +**source** | **string** | Describes which field is causing the issue in the payload, null for non 400 status code responses | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorItemPhonebook.md b/docs/Model/ErrorItemPhonebook.md index 8ca8880..73efe06 100644 --- a/docs/Model/ErrorItemPhonebook.md +++ b/docs/Model/ErrorItemPhonebook.md @@ -4,8 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**title** | [**\Messente\Api\Model\ErrorTitlePhonebook**](ErrorTitlePhonebook.md) | | -**detail** | **string** | Free form more detailed description of the error | -**code** | [**\Messente\Api\Model\ErrorCodePhonebook**](ErrorCodePhonebook.md) | | +**title** | [**\Messente\Api\Model\ErrorTitlePhonebook**](ErrorTitlePhonebook.md) | | +**detail** | **string** | Free form more detailed description of the error | +**code** | [**\Messente\Api\Model\ErrorCodePhonebook**](ErrorCodePhonebook.md) | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorItemStatistics.md b/docs/Model/ErrorItemStatistics.md index 62d0e8a..6a73f02 100644 --- a/docs/Model/ErrorItemStatistics.md +++ b/docs/Model/ErrorItemStatistics.md @@ -4,8 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**title** | **string** | Error title | -**details** | **string** | Error details | -**code** | [**\Messente\Api\Model\ErrorCodeStatistics**](ErrorCodeStatistics.md) | | +**title** | **string** | Error title | +**details** | **string** | Error details | +**code** | [**\Messente\Api\Model\ErrorCodeStatistics**](ErrorCodeStatistics.md) | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorNumberLookup.md b/docs/Model/ErrorNumberLookup.md index d8116b4..4e7f7a3 100644 --- a/docs/Model/ErrorNumberLookup.md +++ b/docs/Model/ErrorNumberLookup.md @@ -4,6 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**errors** | [**\Messente\Api\Model\ErrorItemNumberLookup[]**](ErrorItemNumberLookup.md) | An array of errors | +**errors** | [**\Messente\Api\Model\ErrorItemNumberLookup[]**](ErrorItemNumberLookup.md) | An array of errors | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorOmnichannel.md b/docs/Model/ErrorOmnichannel.md index fe59aea..9136d9a 100644 --- a/docs/Model/ErrorOmnichannel.md +++ b/docs/Model/ErrorOmnichannel.md @@ -4,6 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**errors** | [**\Messente\Api\Model\ErrorItemOmnichannel[]**](ErrorItemOmnichannel.md) | An array of errors | +**errors** | [**\Messente\Api\Model\ErrorItemOmnichannel[]**](ErrorItemOmnichannel.md) | An array of errors | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorPhonebook.md b/docs/Model/ErrorPhonebook.md index 0345c9e..49e33b6 100644 --- a/docs/Model/ErrorPhonebook.md +++ b/docs/Model/ErrorPhonebook.md @@ -4,6 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**errors** | [**\Messente\Api\Model\ErrorItemPhonebook[]**](ErrorItemPhonebook.md) | An array of errors | +**errors** | [**\Messente\Api\Model\ErrorItemPhonebook[]**](ErrorItemPhonebook.md) | An array of errors | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorStatistics.md b/docs/Model/ErrorStatistics.md index 3dba2a6..83cc5f9 100644 --- a/docs/Model/ErrorStatistics.md +++ b/docs/Model/ErrorStatistics.md @@ -4,6 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**errors** | [**\Messente\Api\Model\ErrorItemStatistics[]**](ErrorItemStatistics.md) | An array of errors | +**errors** | [**\Messente\Api\Model\ErrorItemStatistics[]**](ErrorItemStatistics.md) | An array of errors | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorTitleOmnichannel.md b/docs/Model/ErrorTitleOmnichannel.md index 25938a8..b17deca 100644 --- a/docs/Model/ErrorTitleOmnichannel.md +++ b/docs/Model/ErrorTitleOmnichannel.md @@ -5,4 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ErrorTitlePhonebook.md b/docs/Model/ErrorTitlePhonebook.md index 9f4f024..1efae0b 100644 --- a/docs/Model/ErrorTitlePhonebook.md +++ b/docs/Model/ErrorTitlePhonebook.md @@ -5,4 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/FetchBlacklistSuccess.md b/docs/Model/FetchBlacklistSuccess.md index 36a7fef..29d467f 100644 --- a/docs/Model/FetchBlacklistSuccess.md +++ b/docs/Model/FetchBlacklistSuccess.md @@ -4,6 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**phoneNumbers** | **string[]** | Array of unique phone numbers | [optional] +**phoneNumbers** | **string[]** | Array of unique phone numbers | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GroupEnvelope.md b/docs/Model/GroupEnvelope.md index ed34926..421db2c 100644 --- a/docs/Model/GroupEnvelope.md +++ b/docs/Model/GroupEnvelope.md @@ -4,6 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**group** | [**\Messente\Api\Model\GroupResponseFields**](GroupResponseFields.md) | | [optional] +**group** | [**\Messente\Api\Model\GroupResponseFields**](GroupResponseFields.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GroupListEnvelope.md b/docs/Model/GroupListEnvelope.md index 7244a7a..41a078f 100644 --- a/docs/Model/GroupListEnvelope.md +++ b/docs/Model/GroupListEnvelope.md @@ -4,6 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**groups** | [**\Messente\Api\Model\GroupResponseFields[]**](GroupResponseFields.md) | An array of groups | [optional] +**groups** | [**\Messente\Api\Model\GroupResponseFields[]**](GroupResponseFields.md) | An array of groups | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GroupName.md b/docs/Model/GroupName.md index d97a1f0..b4ababf 100644 --- a/docs/Model/GroupName.md +++ b/docs/Model/GroupName.md @@ -4,6 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | **string** | The name of the group | +**name** | **string** | The name of the group | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GroupResponseFields.md b/docs/Model/GroupResponseFields.md index c08e03e..8bcc09d 100644 --- a/docs/Model/GroupResponseFields.md +++ b/docs/Model/GroupResponseFields.md @@ -4,9 +4,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **string** | Id string in UUID format | -**name** | **string** | The name of the group | -**createdOn** | **string** | When the group was created | [optional] -**contactsCount** | **int** | The count of contacts in the group | +**id** | **string** | Id string in UUID format | +**name** | **string** | The name of the group | +**createdOn** | **string** | When the group was created | [optional] +**contactsCount** | **int** | The count of contacts in the group | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MessageResult.md b/docs/Model/MessageResult.md index b8a4036..291b60c 100644 --- a/docs/Model/MessageResult.md +++ b/docs/Model/MessageResult.md @@ -4,8 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**messageId** | **string** | Unique identifier for the message | -**channel** | [**\Messente\Api\Model\Channel**](Channel.md) | | -**sender** | **string** | Sender that was used for the message | +**messageId** | **string** | Unique identifier for the message | +**channel** | [**\Messente\Api\Model\Channel**](Channel.md) | | +**sender** | **string** | Sender that was used for the message | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MobileNetwork.md b/docs/Model/MobileNetwork.md index f0529f2..9f98e1c 100644 --- a/docs/Model/MobileNetwork.md +++ b/docs/Model/MobileNetwork.md @@ -4,10 +4,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**mccmnc** | **string** | Mobile country and mobile network code | [optional] -**networkName** | **string** | Mobile network name | [optional] -**countryName** | **string** | Country name | [optional] -**countryPrefix** | **string** | Country prefix | [optional] -**countryCode** | **string** | Country code | [optional] +**mccmnc** | **string** | Mobile country and mobile network code | [optional] +**networkName** | **string** | Mobile network name | [optional] +**countryName** | **string** | Country name | [optional] +**countryPrefix** | **string** | Country prefix | [optional] +**countryCode** | **string** | Country code | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NumberToBlacklist.md b/docs/Model/NumberToBlacklist.md index 6b1906a..15862b1 100644 --- a/docs/Model/NumberToBlacklist.md +++ b/docs/Model/NumberToBlacklist.md @@ -4,6 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**phoneNumber** | **string** | Phone number in e.164 format | +**phoneNumber** | **string** | Phone number in e.164 format | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NumbersToInvestigate.md b/docs/Model/NumbersToInvestigate.md index 705faae..75c3611 100644 --- a/docs/Model/NumbersToInvestigate.md +++ b/docs/Model/NumbersToInvestigate.md @@ -4,6 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**numbers** | **string[]** | A list of phone numbers. Max 10 numbers per request | +**numbers** | **string[]** | Array of phone numbers | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OmniMessageCreateSuccessResponse.md b/docs/Model/OmniMessageCreateSuccessResponse.md index 6177048..1b3daa4 100644 --- a/docs/Model/OmniMessageCreateSuccessResponse.md +++ b/docs/Model/OmniMessageCreateSuccessResponse.md @@ -4,8 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**messages** | [**\Messente\Api\Model\MessageResult[]**](MessageResult.md) | List of messages that compose the omnimessage | -**to** | **string** | Phone number in e.164 format | -**omnimessageId** | **string** | Unique identifier for the omnimessage | +**messages** | [**\Messente\Api\Model\MessageResult[]**](MessageResult.md) | List of messages that compose the omnimessage | +**to** | **string** | Phone number in e.164 format | +**omnimessageId** | **string** | Unique identifier for the omnimessage | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Omnimessage.md b/docs/Model/Omnimessage.md index 9f218f0..f2e25fb 100644 --- a/docs/Model/Omnimessage.md +++ b/docs/Model/Omnimessage.md @@ -4,11 +4,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**to** | **string** | Phone number in e.164 format | -**messages** | [**OneOfViberSMSWhatsAppTelegram[]**](OneOfViberSMSWhatsAppTelegram.md) | An array of messages | -**dlrUrl** | **string** | URL where the delivery report will be sent | [optional] -**textStore** | [**\Messente\Api\Model\TextStore**](TextStore.md) | | [optional] -**timeToSend** | **\DateTime** | Optional parameter for sending messages at some specific time in the future. Time must be specified in the ISO-8601 format. If no timezone is specified, then the timezone is assumed to be UTC Examples: * Time specified with timezone: 2018-06-22T09:05:07+00:00 Time specified in UTC: 2018-06-22T09:05:07Z * Time specified without timezone: 2018-06-22T09:05 (equivalent to 2018-06-22T09:05+00:00) | [optional] -**priority** | [**\Messente\Api\Model\Priority**](Priority.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) +**to** | **string** | Phone number in e.164 format | +**messages** | [**OneOfViberSMSWhatsAppTelegram[]**](OneOfViberSMSWhatsAppTelegram.md) | An array of messages | +**dlrUrl** | **string** | URL where the delivery report will be sent | [optional] +**textStore** | [**\Messente\Api\Model\TextStore**](TextStore.md) | | [optional] +**timeToSend** | [**\DateTime**](\DateTime.md) | Optional parameter for sending messages at some specific time in the future. Time must be specified in the ISO-8601 format. If no timezone is specified, then the timezone is assumed to be UTC Examples: * Time specified with timezone: 2018-06-22T09:05:07+00:00 Time specified in UTC: 2018-06-22T09:05:07Z * Time specified without timezone: 2018-06-22T09:05 (equivalent to 2018-06-22T09:05+00:00) | [optional] +**priority** | [**\Messente\Api\Model\Priority**](Priority.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/Priority.md b/docs/Model/Priority.md index 552ead2..4a8cbe8 100644 --- a/docs/Model/Priority.md +++ b/docs/Model/Priority.md @@ -5,4 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/SMS.md b/docs/Model/SMS.md index f0d4c91..c25d31f 100644 --- a/docs/Model/SMS.md +++ b/docs/Model/SMS.md @@ -4,11 +4,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**text** | **string** | Text content of the SMS | -**sender** | **string** | Phone number or alphanumeric sender name | [optional] -**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted | [optional] -**autoconvert** | **string** | Defines how non-GSM characters will be treated: - \"on\" Use replacement settings from the account's [API Auto Replace settings page](https://dashboard.messente.com/api-settings/auto-replace) (default) - \"full\" All non GSM 03.38 characters will be replaced with suitable alternatives - \"off\" Message content is not modified in any way | [optional] -**udh** | **string** | hex-encoded string containing SMS UDH | [optional] +**text** | **string** | Text content of the SMS | +**sender** | **string** | Phone number or alphanumeric sender name | [optional] +**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted | [optional] +**autoconvert** | **string** | Defines how non-GSM characters will be treated: - \"on\" Use replacement settings from the account's [API Auto Replace settings page](https://dashboard.messente.com/api-settings/auto-replace) (default) - \"full\" All non GSM 03.38 characters will be replaced with suitable alternatives - \"off\" Message content is not modified in any way | [optional] +**udh** | **string** | hex-encoded string containing SMS UDH | [optional] **channel** | **string** | The channel used to deliver the message | [optional] [default to 'sms'] -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/StatisticsReport.md b/docs/Model/StatisticsReport.md index 283b6b7..b646314 100644 --- a/docs/Model/StatisticsReport.md +++ b/docs/Model/StatisticsReport.md @@ -4,8 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**totalMessages** | **int** | Sum of all messages | -**totalPrice** | **string** | Price for all messages | -**country** | **string** | Target country of all messages | +**totalMessages** | **int** | Sum of all messages | +**totalPrice** | **string** | Price for all messages | +**country** | **string** | Target country of all messages | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StatisticsReportSettings.md b/docs/Model/StatisticsReportSettings.md index dc51d8b..ad54c58 100644 --- a/docs/Model/StatisticsReportSettings.md +++ b/docs/Model/StatisticsReportSettings.md @@ -4,8 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**startDate** | **\DateTime** | Start date for the report | -**endDate** | **\DateTime** | End date for the report | -**messageTypes** | **string[]** | Optional list of message types (sms, viber, whatsapp, hlr, telegram) | [optional] +**startDate** | [**\DateTime**](\DateTime.md) | Start date for the report | +**endDate** | [**\DateTime**](\DateTime.md) | End date for the report | +**messageTypes** | **string[]** | Optional list of message types (sms, viber, whatsapp, hlr, telegram) | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StatisticsReportSuccess.md b/docs/Model/StatisticsReportSuccess.md index 0f78d80..cd98a66 100644 --- a/docs/Model/StatisticsReportSuccess.md +++ b/docs/Model/StatisticsReportSuccess.md @@ -4,6 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**reports** | [**\Messente\Api\Model\StatisticsReport[]**](StatisticsReport.md) | Array of report objects | +**reports** | [**\Messente\Api\Model\StatisticsReport[]**](StatisticsReport.md) | Array of report objects | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Status.md b/docs/Model/Status.md index c462142..fb7c6c7 100644 --- a/docs/Model/Status.md +++ b/docs/Model/Status.md @@ -5,4 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/SyncNumberLookupResult.md b/docs/Model/SyncNumberLookupResult.md index 38ba91f..3db52c2 100644 --- a/docs/Model/SyncNumberLookupResult.md +++ b/docs/Model/SyncNumberLookupResult.md @@ -4,14 +4,16 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**number** | **string** | Phone number in e.164 format | -**roaming** | **bool** | Indicates if a number is roaming | [optional] -**ported** | **bool** | Indicates if a number is ported | [optional] -**roamingNetwork** | [**\Messente\Api\Model\MobileNetwork**](MobileNetwork.md) | | [optional] -**currentNetwork** | [**\Messente\Api\Model\MobileNetwork**](MobileNetwork.md) | | [optional] -**originalNetwork** | [**\Messente\Api\Model\MobileNetwork**](MobileNetwork.md) | | [optional] -**portedNetwork** | [**\Messente\Api\Model\MobileNetwork**](MobileNetwork.md) | | [optional] -**status** | **string** | Status of the phone number | [optional] -**error** | **mixed** | Indicates if any error occurred while handling the request | [optional] +**number** | **string** | Phone number in e.164 format | +**roaming** | **bool** | Indicates if a number is roaming | [optional] +**ported** | **bool** | Indicates if a number is ported | [optional] +**roamingNetwork** | [**\Messente\Api\Model\MobileNetwork**](MobileNetwork.md) | | [optional] +**currentNetwork** | [**\Messente\Api\Model\MobileNetwork**](MobileNetwork.md) | | [optional] +**originalNetwork** | [**\Messente\Api\Model\MobileNetwork**](MobileNetwork.md) | | [optional] +**portedNetwork** | [**\Messente\Api\Model\MobileNetwork**](MobileNetwork.md) | | [optional] +**status** | **string** | Status of the phone number | [optional] +**error** | **object** | Indicates if any error occurred while handling the request | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SyncNumberLookupSuccess.md b/docs/Model/SyncNumberLookupSuccess.md index debed8f..9b8eae7 100644 --- a/docs/Model/SyncNumberLookupSuccess.md +++ b/docs/Model/SyncNumberLookupSuccess.md @@ -4,7 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**requestId** | **string** | ID of the request | -**result** | [**\Messente\Api\Model\SyncNumberLookupResult[]**](SyncNumberLookupResult.md) | A container for phone number info objects | +**requestId** | **string** | ID of the request | +**result** | [**\Messente\Api\Model\SyncNumberLookupResult[]**](SyncNumberLookupResult.md) | A container for phone number info objects | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Telegram.md b/docs/Model/Telegram.md index 1debeb9..ee778a0 100644 --- a/docs/Model/Telegram.md +++ b/docs/Model/Telegram.md @@ -4,12 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**sender** | **string** | Phone number or alphanumeric sender name | [optional] -**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted | [optional] -**text** | **string** | Plaintext content for Telegram | [optional] -**imageUrl** | **string** | URL for the embedded image. Mutually exclusive with \"document_url\" and \"audio_url\" | [optional] -**documentUrl** | **string** | URL for the embedded image. Mutually exclusive with \"audio_url\" and \"image_url\" | [optional] -**audioUrl** | **string** | URL for the embedded image. Mutually exclusive with \"document_url\" and \"image_url\" | [optional] +**sender** | **string** | Phone number or alphanumeric sender name | [optional] +**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted | [optional] +**text** | **string** | Plaintext content for Telegram | [optional] +**imageUrl** | **string** | URL for the embedded image. Mutually exclusive with \"document_url\" and \"audio_url\" | [optional] +**documentUrl** | **string** | URL for the embedded image. Mutually exclusive with \"audio_url\" and \"image_url\" | [optional] +**audioUrl** | **string** | URL for the embedded image. Mutually exclusive with \"document_url\" and \"image_url\" | [optional] **channel** | **string** | The channel used to deliver the message | [optional] [default to 'telegram'] -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/TextStore.md b/docs/Model/TextStore.md index 3b2f6f1..8fc3b29 100644 --- a/docs/Model/TextStore.md +++ b/docs/Model/TextStore.md @@ -5,4 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/Viber.md b/docs/Model/Viber.md index 688a035..2a353f2 100644 --- a/docs/Model/Viber.md +++ b/docs/Model/Viber.md @@ -4,12 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**sender** | **string** | Phone number or alphanumeric sender name | [optional] -**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted | [optional] -**text** | **string** | Plaintext content for Viber | [optional] -**imageUrl** | **string** | URL for the embedded image Valid combinations: 1) image_url, 2) text, image_url, button_url, button_text | [optional] -**buttonUrl** | **string** | URL of the button, must be specified along with ''text'', ''button_text'' and ''image_url'' (optional) | [optional] -**buttonText** | **string** | Must be specified along with ''text'', ''button_url'', ''button_text'', ''image_url'' (optional) | [optional] +**sender** | **string** | Phone number or alphanumeric sender name | [optional] +**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted | [optional] +**text** | **string** | Plaintext content for Viber | [optional] +**imageUrl** | **string** | URL for the embedded image Valid combinations: 1) image_url, 2) text, image_url, button_url, button_text | [optional] +**buttonUrl** | **string** | URL of the button, must be specified along with ''text'', ''button_text'' and ''image_url'' (optional) | [optional] +**buttonText** | **string** | Must be specified along with ''text'', ''button_url'', ''button_text'', ''image_url'' (optional) | [optional] **channel** | **string** | The channel used to deliver the message | [optional] [default to 'viber'] -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/WhatsApp.md b/docs/Model/WhatsApp.md index 6ce50dd..5b3dff7 100644 --- a/docs/Model/WhatsApp.md +++ b/docs/Model/WhatsApp.md @@ -4,12 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**sender** | **string** | Phone number or alphanumeric sender name | [optional] -**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted | [optional] -**text** | [**\Messente\Api\Model\WhatsAppText**](WhatsAppText.md) | | [optional] -**image** | [**\Messente\Api\Model\WhatsAppImage**](WhatsAppImage.md) | | [optional] -**document** | [**\Messente\Api\Model\WhatsAppDocument**](WhatsAppDocument.md) | | [optional] -**audio** | [**\Messente\Api\Model\WhatsAppAudio**](WhatsAppAudio.md) | | [optional] +**sender** | **string** | Phone number or alphanumeric sender name | [optional] +**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted | [optional] +**text** | [**\Messente\Api\Model\WhatsAppText**](WhatsAppText.md) | | [optional] +**image** | [**\Messente\Api\Model\WhatsAppImage**](WhatsAppImage.md) | | [optional] +**document** | [**\Messente\Api\Model\WhatsAppDocument**](WhatsAppDocument.md) | | [optional] +**audio** | [**\Messente\Api\Model\WhatsAppAudio**](WhatsAppAudio.md) | | [optional] **channel** | **string** | The channel used to deliver the message | [optional] [default to 'whatsapp'] -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/WhatsAppAudio.md b/docs/Model/WhatsAppAudio.md index ff0e201..9be0439 100644 --- a/docs/Model/WhatsAppAudio.md +++ b/docs/Model/WhatsAppAudio.md @@ -4,6 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**content** | **string** | Base64-encoded audio | +**content** | **string** | Base64-encoded audio | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WhatsAppDocument.md b/docs/Model/WhatsAppDocument.md index 1183cd3..5d5dc71 100644 --- a/docs/Model/WhatsAppDocument.md +++ b/docs/Model/WhatsAppDocument.md @@ -4,7 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**caption** | **string** | Description for the document | [optional] -**content** | **string** | Base64-encoded image | +**caption** | **string** | Description for the document | [optional] +**content** | **string** | Base64-encoded image | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WhatsAppImage.md b/docs/Model/WhatsAppImage.md index fff678f..2c578d1 100644 --- a/docs/Model/WhatsAppImage.md +++ b/docs/Model/WhatsAppImage.md @@ -4,7 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**caption** | **string** | Description for the image | [optional] -**content** | **string** | Base64-encoded image | +**caption** | **string** | Description for the image | [optional] +**content** | **string** | Base64-encoded image | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WhatsAppText.md b/docs/Model/WhatsAppText.md index 5a801c0..0c1fad1 100644 --- a/docs/Model/WhatsAppText.md +++ b/docs/Model/WhatsAppText.md @@ -5,6 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **previewUrl** | **bool** | Whether to display link preview if the message contains a hyperlink | [optional] [default to true] -**body** | **string** | Plaintext content for WhatsApp, can contain URLs, emojis and formatting | +**body** | **string** | Plaintext content for WhatsApp, can contain URLs, emojis and formatting | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/git_push.sh b/git_push.sh index 14bad7f..7a23503 100644 --- a/git_push.sh +++ b/git_push.sh @@ -1,17 +1,11 @@ #!/bin/sh # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ # -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" git_user_id=$1 git_repo_id=$2 release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi if [ "$git_user_id" = "" ]; then git_user_id="messente" @@ -38,14 +32,14 @@ git add . git commit -m "$release_note" # Sets the new remote -git_remote=$(git remote) +git_remote=`git remote` if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git fi fi @@ -53,5 +47,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' + diff --git a/lib/Api/BlacklistApi.php b/lib/Api/BlacklistApi.php index dfa0ecd..70ec8b6 100644 --- a/lib/Api/BlacklistApi.php +++ b/lib/Api/BlacklistApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $hostIndex; + $this->hostIndex = $host_index; } /** * Set the host index * - * @param int $hostIndex Host index (required) + * @param int Host index (required) */ - public function setHostIndex($hostIndex): void + public function setHostIndex($host_index) { - $this->hostIndex = $hostIndex; + $this->hostIndex = $host_index; } /** * Get the host index * - * @return int Host index + * @return Host index */ public function getHostIndex() { @@ -154,16 +153,9 @@ public function addToBlacklistWithHttpInfo($numberToBlacklist) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -174,11 +166,11 @@ public function addToBlacklistWithHttpInfo($numberToBlacklist) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + $request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } @@ -275,7 +267,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } ); @@ -289,7 +281,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function addToBlacklistRequest($numberToBlacklist) + protected function addToBlacklistRequest($numberToBlacklist) { // verify the required parameter 'numberToBlacklist' is set if ($numberToBlacklist === null || (is_array($numberToBlacklist) && count($numberToBlacklist) === 0)) { @@ -307,7 +299,11 @@ public function addToBlacklistRequest($numberToBlacklist) - + // body params + $_tempBody = null; + if (isset($numberToBlacklist)) { + $_tempBody = $numberToBlacklist; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -321,23 +317,21 @@ public function addToBlacklistRequest($numberToBlacklist) } // for model (json/xml) - if (isset($numberToBlacklist)) { + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($numberToBlacklist)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { - $httpBody = $numberToBlacklist; + $httpBody = $_tempBody; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -347,7 +341,7 @@ public function addToBlacklistRequest($numberToBlacklist) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -367,7 +361,7 @@ public function addToBlacklistRequest($numberToBlacklist) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -414,16 +408,9 @@ public function deleteFromBlacklistWithHttpInfo($phone) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -434,11 +421,11 @@ public function deleteFromBlacklistWithHttpInfo($phone) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + $request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } @@ -535,7 +522,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } ); @@ -549,7 +536,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteFromBlacklistRequest($phone) + protected function deleteFromBlacklistRequest($phone) { // verify the required parameter 'phone' is set if ($phone === null || (is_array($phone) && count($phone) === 0)) { @@ -566,7 +553,6 @@ public function deleteFromBlacklistRequest($phone) $multipart = false; - // path params if ($phone !== null) { $resourcePath = str_replace( @@ -576,6 +562,8 @@ public function deleteFromBlacklistRequest($phone) ); } + // body params + $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -589,17 +577,21 @@ public function deleteFromBlacklistRequest($phone) } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -609,7 +601,7 @@ public function deleteFromBlacklistRequest($phone) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -629,7 +621,7 @@ public function deleteFromBlacklistRequest($phone) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -675,16 +667,9 @@ public function fetchBlacklistWithHttpInfo() } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -695,20 +680,21 @@ public function fetchBlacklistWithHttpInfo() sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + $request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } + $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Messente\Api\Model\FetchBlacklistSuccess' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -718,9 +704,9 @@ public function fetchBlacklistWithHttpInfo() ]; case 401: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -730,9 +716,9 @@ public function fetchBlacklistWithHttpInfo() ]; default: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -743,10 +729,11 @@ public function fetchBlacklistWithHttpInfo() } $returnType = '\Messente\Api\Model\FetchBlacklistSuccess'; + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -823,10 +810,11 @@ public function fetchBlacklistAsyncWithHttpInfo() ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -846,7 +834,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } ); @@ -859,7 +847,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchBlacklistRequest() + protected function fetchBlacklistRequest() { $resourcePath = '/phonebook/blacklist'; @@ -871,7 +859,8 @@ public function fetchBlacklistRequest() - + // body params + $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -885,17 +874,21 @@ public function fetchBlacklistRequest() } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -905,7 +898,7 @@ public function fetchBlacklistRequest() } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -925,7 +918,7 @@ public function fetchBlacklistRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -972,16 +965,9 @@ public function isBlacklistedWithHttpInfo($phone) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -992,11 +978,11 @@ public function isBlacklistedWithHttpInfo($phone) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + $request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } @@ -1085,7 +1071,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } ); @@ -1099,7 +1085,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function isBlacklistedRequest($phone) + protected function isBlacklistedRequest($phone) { // verify the required parameter 'phone' is set if ($phone === null || (is_array($phone) && count($phone) === 0)) { @@ -1116,7 +1102,6 @@ public function isBlacklistedRequest($phone) $multipart = false; - // path params if ($phone !== null) { $resourcePath = str_replace( @@ -1126,6 +1111,8 @@ public function isBlacklistedRequest($phone) ); } + // body params + $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1139,17 +1126,21 @@ public function isBlacklistedRequest($phone) } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1159,7 +1150,7 @@ public function isBlacklistedRequest($phone) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -1179,7 +1170,7 @@ public function isBlacklistedRequest($phone) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/lib/Api/ContactsApi.php b/lib/Api/ContactsApi.php index 73fc90b..5c8f73c 100644 --- a/lib/Api/ContactsApi.php +++ b/lib/Api/ContactsApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $hostIndex; + $this->hostIndex = $host_index; } /** * Set the host index * - * @param int $hostIndex Host index (required) + * @param int Host index (required) */ - public function setHostIndex($hostIndex): void + public function setHostIndex($host_index) { - $this->hostIndex = $hostIndex; + $this->hostIndex = $host_index; } /** * Get the host index * - * @return int Host index + * @return Host index */ public function getHostIndex() { @@ -157,16 +156,9 @@ public function addContactToGroupWithHttpInfo($groupId, $phone) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -177,20 +169,21 @@ public function addContactToGroupWithHttpInfo($groupId, $phone) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + $request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } + $responseBody = $response->getBody(); switch($statusCode) { case 201: if ('object' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -200,9 +193,9 @@ public function addContactToGroupWithHttpInfo($groupId, $phone) ]; case 400: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -212,9 +205,9 @@ public function addContactToGroupWithHttpInfo($groupId, $phone) ]; case 401: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -224,9 +217,9 @@ public function addContactToGroupWithHttpInfo($groupId, $phone) ]; case 404: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -236,9 +229,9 @@ public function addContactToGroupWithHttpInfo($groupId, $phone) ]; case 409: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -248,9 +241,9 @@ public function addContactToGroupWithHttpInfo($groupId, $phone) ]; default: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -261,10 +254,11 @@ public function addContactToGroupWithHttpInfo($groupId, $phone) } $returnType = 'object'; + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -369,10 +363,11 @@ public function addContactToGroupAsyncWithHttpInfo($groupId, $phone) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -392,7 +387,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } ); @@ -407,7 +402,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function addContactToGroupRequest($groupId, $phone) + protected function addContactToGroupRequest($groupId, $phone) { // verify the required parameter 'groupId' is set if ($groupId === null || (is_array($groupId) && count($groupId) === 0)) { @@ -430,7 +425,6 @@ public function addContactToGroupRequest($groupId, $phone) $multipart = false; - // path params if ($groupId !== null) { $resourcePath = str_replace( @@ -448,6 +442,8 @@ public function addContactToGroupRequest($groupId, $phone) ); } + // body params + $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -461,17 +457,21 @@ public function addContactToGroupRequest($groupId, $phone) } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -481,7 +481,7 @@ public function addContactToGroupRequest($groupId, $phone) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -501,7 +501,7 @@ public function addContactToGroupRequest($groupId, $phone) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -549,16 +549,9 @@ public function createContactWithHttpInfo($contactFields) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -569,20 +562,21 @@ public function createContactWithHttpInfo($contactFields) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + $request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } + $responseBody = $response->getBody(); switch($statusCode) { case 201: if ('\Messente\Api\Model\ContactEnvelope' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -592,9 +586,9 @@ public function createContactWithHttpInfo($contactFields) ]; case 400: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -604,9 +598,9 @@ public function createContactWithHttpInfo($contactFields) ]; case 401: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -616,9 +610,9 @@ public function createContactWithHttpInfo($contactFields) ]; case 409: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -628,9 +622,9 @@ public function createContactWithHttpInfo($contactFields) ]; default: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -641,10 +635,11 @@ public function createContactWithHttpInfo($contactFields) } $returnType = '\Messente\Api\Model\ContactEnvelope'; + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -739,10 +734,11 @@ public function createContactAsyncWithHttpInfo($contactFields) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -762,7 +758,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } ); @@ -776,7 +772,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createContactRequest($contactFields) + protected function createContactRequest($contactFields) { // verify the required parameter 'contactFields' is set if ($contactFields === null || (is_array($contactFields) && count($contactFields) === 0)) { @@ -794,7 +790,11 @@ public function createContactRequest($contactFields) - + // body params + $_tempBody = null; + if (isset($contactFields)) { + $_tempBody = $contactFields; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -808,23 +808,21 @@ public function createContactRequest($contactFields) } // for model (json/xml) - if (isset($contactFields)) { + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($contactFields)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { - $httpBody = $contactFields; + $httpBody = $_tempBody; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -834,7 +832,7 @@ public function createContactRequest($contactFields) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -854,7 +852,7 @@ public function createContactRequest($contactFields) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -901,16 +899,9 @@ public function deleteContactWithHttpInfo($phone) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -921,11 +912,11 @@ public function deleteContactWithHttpInfo($phone) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + $request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } @@ -1022,7 +1013,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } ); @@ -1036,7 +1027,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteContactRequest($phone) + protected function deleteContactRequest($phone) { // verify the required parameter 'phone' is set if ($phone === null || (is_array($phone) && count($phone) === 0)) { @@ -1053,7 +1044,6 @@ public function deleteContactRequest($phone) $multipart = false; - // path params if ($phone !== null) { $resourcePath = str_replace( @@ -1063,6 +1053,8 @@ public function deleteContactRequest($phone) ); } + // body params + $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1076,17 +1068,21 @@ public function deleteContactRequest($phone) } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1096,7 +1092,7 @@ public function deleteContactRequest($phone) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -1116,7 +1112,7 @@ public function deleteContactRequest($phone) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -1164,16 +1160,9 @@ public function fetchContactWithHttpInfo($phone) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -1184,20 +1173,21 @@ public function fetchContactWithHttpInfo($phone) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + $request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } + $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Messente\Api\Model\ContactEnvelope' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1207,9 +1197,9 @@ public function fetchContactWithHttpInfo($phone) ]; case 400: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1219,9 +1209,9 @@ public function fetchContactWithHttpInfo($phone) ]; case 401: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1231,9 +1221,9 @@ public function fetchContactWithHttpInfo($phone) ]; case 404: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1244,10 +1234,11 @@ public function fetchContactWithHttpInfo($phone) } $returnType = '\Messente\Api\Model\ContactEnvelope'; + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1334,10 +1325,11 @@ public function fetchContactAsyncWithHttpInfo($phone) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1357,7 +1349,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } ); @@ -1371,7 +1363,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchContactRequest($phone) + protected function fetchContactRequest($phone) { // verify the required parameter 'phone' is set if ($phone === null || (is_array($phone) && count($phone) === 0)) { @@ -1388,7 +1380,6 @@ public function fetchContactRequest($phone) $multipart = false; - // path params if ($phone !== null) { $resourcePath = str_replace( @@ -1398,6 +1389,8 @@ public function fetchContactRequest($phone) ); } + // body params + $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1411,17 +1404,21 @@ public function fetchContactRequest($phone) } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1431,7 +1428,7 @@ public function fetchContactRequest($phone) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -1451,7 +1448,7 @@ public function fetchContactRequest($phone) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -1499,16 +1496,9 @@ public function fetchContactGroupsWithHttpInfo($phone) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -1519,20 +1509,21 @@ public function fetchContactGroupsWithHttpInfo($phone) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + $request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } + $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Messente\Api\Model\GroupListEnvelope' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1542,9 +1533,9 @@ public function fetchContactGroupsWithHttpInfo($phone) ]; case 400: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1554,9 +1545,9 @@ public function fetchContactGroupsWithHttpInfo($phone) ]; case 401: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1566,9 +1557,9 @@ public function fetchContactGroupsWithHttpInfo($phone) ]; case 404: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1579,10 +1570,11 @@ public function fetchContactGroupsWithHttpInfo($phone) } $returnType = '\Messente\Api\Model\GroupListEnvelope'; + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1669,10 +1661,11 @@ public function fetchContactGroupsAsyncWithHttpInfo($phone) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1692,7 +1685,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } ); @@ -1706,7 +1699,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchContactGroupsRequest($phone) + protected function fetchContactGroupsRequest($phone) { // verify the required parameter 'phone' is set if ($phone === null || (is_array($phone) && count($phone) === 0)) { @@ -1723,7 +1716,6 @@ public function fetchContactGroupsRequest($phone) $multipart = false; - // path params if ($phone !== null) { $resourcePath = str_replace( @@ -1733,6 +1725,8 @@ public function fetchContactGroupsRequest($phone) ); } + // body params + $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1746,17 +1740,21 @@ public function fetchContactGroupsRequest($phone) } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1766,7 +1764,7 @@ public function fetchContactGroupsRequest($phone) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -1786,7 +1784,7 @@ public function fetchContactGroupsRequest($phone) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -1834,16 +1832,9 @@ public function fetchContactsWithHttpInfo($groupIds = null) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -1854,20 +1845,21 @@ public function fetchContactsWithHttpInfo($groupIds = null) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + $request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } + $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Messente\Api\Model\ContactListEnvelope' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1877,9 +1869,9 @@ public function fetchContactsWithHttpInfo($groupIds = null) ]; case 400: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1889,9 +1881,9 @@ public function fetchContactsWithHttpInfo($groupIds = null) ]; case 401: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1901,9 +1893,9 @@ public function fetchContactsWithHttpInfo($groupIds = null) ]; default: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1914,10 +1906,11 @@ public function fetchContactsWithHttpInfo($groupIds = null) } $returnType = '\Messente\Api\Model\ContactListEnvelope'; + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -2004,10 +1997,11 @@ public function fetchContactsAsyncWithHttpInfo($groupIds = null) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -2027,7 +2021,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } ); @@ -2041,7 +2035,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchContactsRequest($groupIds = null) + protected function fetchContactsRequest($groupIds = null) { $resourcePath = '/phonebook/contacts'; @@ -2052,19 +2046,16 @@ public function fetchContactsRequest($groupIds = null) $multipart = false; // query params + if (is_array($groupIds)) { + $groupIds = ObjectSerializer::serializeCollection($groupIds, 'multi', true); + } if ($groupIds !== null) { - if('form' === 'form' && is_array($groupIds)) { - foreach($groupIds as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['groupIds'] = $groupIds; - } + $queryParams['groupIds'] = ObjectSerializer::toQueryValue($groupIds); } - + // body params + $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -2078,17 +2069,21 @@ public function fetchContactsRequest($groupIds = null) } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -2098,7 +2093,7 @@ public function fetchContactsRequest($groupIds = null) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -2118,7 +2113,7 @@ public function fetchContactsRequest($groupIds = null) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -2167,16 +2162,9 @@ public function removeContactFromGroupWithHttpInfo($groupId, $phone) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -2187,11 +2175,11 @@ public function removeContactFromGroupWithHttpInfo($groupId, $phone) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + $request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } @@ -2290,7 +2278,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } ); @@ -2305,7 +2293,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function removeContactFromGroupRequest($groupId, $phone) + protected function removeContactFromGroupRequest($groupId, $phone) { // verify the required parameter 'groupId' is set if ($groupId === null || (is_array($groupId) && count($groupId) === 0)) { @@ -2328,7 +2316,6 @@ public function removeContactFromGroupRequest($groupId, $phone) $multipart = false; - // path params if ($groupId !== null) { $resourcePath = str_replace( @@ -2346,6 +2333,8 @@ public function removeContactFromGroupRequest($groupId, $phone) ); } + // body params + $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -2359,17 +2348,21 @@ public function removeContactFromGroupRequest($groupId, $phone) } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -2379,7 +2372,7 @@ public function removeContactFromGroupRequest($groupId, $phone) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -2399,7 +2392,7 @@ public function removeContactFromGroupRequest($groupId, $phone) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -2449,16 +2442,9 @@ public function updateContactWithHttpInfo($phone, $contactUpdateFields) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -2469,20 +2455,21 @@ public function updateContactWithHttpInfo($phone, $contactUpdateFields) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + $request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } + $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Messente\Api\Model\ContactEnvelope' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -2492,9 +2479,9 @@ public function updateContactWithHttpInfo($phone, $contactUpdateFields) ]; case 400: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -2504,9 +2491,9 @@ public function updateContactWithHttpInfo($phone, $contactUpdateFields) ]; case 401: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -2516,9 +2503,9 @@ public function updateContactWithHttpInfo($phone, $contactUpdateFields) ]; case 404: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -2528,9 +2515,9 @@ public function updateContactWithHttpInfo($phone, $contactUpdateFields) ]; default: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -2541,10 +2528,11 @@ public function updateContactWithHttpInfo($phone, $contactUpdateFields) } $returnType = '\Messente\Api\Model\ContactEnvelope'; + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -2641,10 +2629,11 @@ public function updateContactAsyncWithHttpInfo($phone, $contactUpdateFields) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -2664,7 +2653,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } ); @@ -2679,7 +2668,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateContactRequest($phone, $contactUpdateFields) + protected function updateContactRequest($phone, $contactUpdateFields) { // verify the required parameter 'phone' is set if ($phone === null || (is_array($phone) && count($phone) === 0)) { @@ -2702,7 +2691,6 @@ public function updateContactRequest($phone, $contactUpdateFields) $multipart = false; - // path params if ($phone !== null) { $resourcePath = str_replace( @@ -2712,6 +2700,11 @@ public function updateContactRequest($phone, $contactUpdateFields) ); } + // body params + $_tempBody = null; + if (isset($contactUpdateFields)) { + $_tempBody = $contactUpdateFields; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -2725,23 +2718,21 @@ public function updateContactRequest($phone, $contactUpdateFields) } // for model (json/xml) - if (isset($contactUpdateFields)) { + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($contactUpdateFields)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { - $httpBody = $contactUpdateFields; + $httpBody = $_tempBody; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -2751,7 +2742,7 @@ public function updateContactRequest($phone, $contactUpdateFields) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -2771,7 +2762,7 @@ public function updateContactRequest($phone, $contactUpdateFields) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'PATCH', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/lib/Api/DeliveryReportApi.php b/lib/Api/DeliveryReportApi.php index 02d348b..4b9c9de 100644 --- a/lib/Api/DeliveryReportApi.php +++ b/lib/Api/DeliveryReportApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $hostIndex; + $this->hostIndex = $host_index; } /** * Set the host index * - * @param int $hostIndex Host index (required) + * @param int Host index (required) */ - public function setHostIndex($hostIndex): void + public function setHostIndex($host_index) { - $this->hostIndex = $hostIndex; + $this->hostIndex = $host_index; } /** * Get the host index * - * @return int Host index + * @return Host index */ public function getHostIndex() { @@ -155,16 +154,9 @@ public function retrieveDeliveryReportWithHttpInfo($omnimessageId) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -175,20 +167,21 @@ public function retrieveDeliveryReportWithHttpInfo($omnimessageId) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + $request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } + $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Messente\Api\Model\DeliveryReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -198,9 +191,9 @@ public function retrieveDeliveryReportWithHttpInfo($omnimessageId) ]; case 404: if ('\Messente\Api\Model\ErrorOmnichannel' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -211,10 +204,11 @@ public function retrieveDeliveryReportWithHttpInfo($omnimessageId) } $returnType = '\Messente\Api\Model\DeliveryReportResponse'; + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -285,10 +279,11 @@ public function retrieveDeliveryReportAsyncWithHttpInfo($omnimessageId) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -308,7 +303,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } ); @@ -322,7 +317,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function retrieveDeliveryReportRequest($omnimessageId) + protected function retrieveDeliveryReportRequest($omnimessageId) { // verify the required parameter 'omnimessageId' is set if ($omnimessageId === null || (is_array($omnimessageId) && count($omnimessageId) === 0)) { @@ -339,7 +334,6 @@ public function retrieveDeliveryReportRequest($omnimessageId) $multipart = false; - // path params if ($omnimessageId !== null) { $resourcePath = str_replace( @@ -349,6 +343,8 @@ public function retrieveDeliveryReportRequest($omnimessageId) ); } + // body params + $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -362,17 +358,21 @@ public function retrieveDeliveryReportRequest($omnimessageId) } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -382,7 +382,7 @@ public function retrieveDeliveryReportRequest($omnimessageId) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -402,7 +402,7 @@ public function retrieveDeliveryReportRequest($omnimessageId) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/lib/Api/GroupsApi.php b/lib/Api/GroupsApi.php index 8bfaca6..7188bbb 100644 --- a/lib/Api/GroupsApi.php +++ b/lib/Api/GroupsApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $hostIndex; + $this->hostIndex = $host_index; } /** * Set the host index * - * @param int $hostIndex Host index (required) + * @param int Host index (required) */ - public function setHostIndex($hostIndex): void + public function setHostIndex($host_index) { - $this->hostIndex = $hostIndex; + $this->hostIndex = $host_index; } /** * Get the host index * - * @return int Host index + * @return Host index */ public function getHostIndex() { @@ -155,16 +154,9 @@ public function createGroupWithHttpInfo($groupName) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -175,20 +167,21 @@ public function createGroupWithHttpInfo($groupName) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + $request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } + $responseBody = $response->getBody(); switch($statusCode) { case 201: if ('\Messente\Api\Model\GroupEnvelope' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -198,9 +191,9 @@ public function createGroupWithHttpInfo($groupName) ]; case 400: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -210,9 +203,9 @@ public function createGroupWithHttpInfo($groupName) ]; case 401: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -222,9 +215,9 @@ public function createGroupWithHttpInfo($groupName) ]; default: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -235,10 +228,11 @@ public function createGroupWithHttpInfo($groupName) } $returnType = '\Messente\Api\Model\GroupEnvelope'; + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -325,10 +319,11 @@ public function createGroupAsyncWithHttpInfo($groupName) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -348,7 +343,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } ); @@ -362,7 +357,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createGroupRequest($groupName) + protected function createGroupRequest($groupName) { // verify the required parameter 'groupName' is set if ($groupName === null || (is_array($groupName) && count($groupName) === 0)) { @@ -380,7 +375,11 @@ public function createGroupRequest($groupName) - + // body params + $_tempBody = null; + if (isset($groupName)) { + $_tempBody = $groupName; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -394,23 +393,21 @@ public function createGroupRequest($groupName) } // for model (json/xml) - if (isset($groupName)) { + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($groupName)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { - $httpBody = $groupName; + $httpBody = $_tempBody; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -420,7 +417,7 @@ public function createGroupRequest($groupName) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -440,7 +437,7 @@ public function createGroupRequest($groupName) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -487,16 +484,9 @@ public function deleteGroupWithHttpInfo($groupId) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -507,11 +497,11 @@ public function deleteGroupWithHttpInfo($groupId) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + $request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } @@ -600,7 +590,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } ); @@ -614,7 +604,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteGroupRequest($groupId) + protected function deleteGroupRequest($groupId) { // verify the required parameter 'groupId' is set if ($groupId === null || (is_array($groupId) && count($groupId) === 0)) { @@ -631,7 +621,6 @@ public function deleteGroupRequest($groupId) $multipart = false; - // path params if ($groupId !== null) { $resourcePath = str_replace( @@ -641,6 +630,8 @@ public function deleteGroupRequest($groupId) ); } + // body params + $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -654,17 +645,21 @@ public function deleteGroupRequest($groupId) } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -674,7 +669,7 @@ public function deleteGroupRequest($groupId) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -694,7 +689,7 @@ public function deleteGroupRequest($groupId) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -742,16 +737,9 @@ public function fetchGroupWithHttpInfo($groupId) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -762,20 +750,21 @@ public function fetchGroupWithHttpInfo($groupId) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + $request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } + $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Messente\Api\Model\GroupEnvelope' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -785,9 +774,9 @@ public function fetchGroupWithHttpInfo($groupId) ]; case 401: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -797,9 +786,9 @@ public function fetchGroupWithHttpInfo($groupId) ]; case 404: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -810,10 +799,11 @@ public function fetchGroupWithHttpInfo($groupId) } $returnType = '\Messente\Api\Model\GroupEnvelope'; + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -892,10 +882,11 @@ public function fetchGroupAsyncWithHttpInfo($groupId) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -915,7 +906,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } ); @@ -929,7 +920,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchGroupRequest($groupId) + protected function fetchGroupRequest($groupId) { // verify the required parameter 'groupId' is set if ($groupId === null || (is_array($groupId) && count($groupId) === 0)) { @@ -946,7 +937,6 @@ public function fetchGroupRequest($groupId) $multipart = false; - // path params if ($groupId !== null) { $resourcePath = str_replace( @@ -956,6 +946,8 @@ public function fetchGroupRequest($groupId) ); } + // body params + $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -969,17 +961,21 @@ public function fetchGroupRequest($groupId) } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -989,7 +985,7 @@ public function fetchGroupRequest($groupId) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -1009,7 +1005,7 @@ public function fetchGroupRequest($groupId) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -1055,16 +1051,9 @@ public function fetchGroupsWithHttpInfo() } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -1075,20 +1064,21 @@ public function fetchGroupsWithHttpInfo() sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + $request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } + $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Messente\Api\Model\GroupListEnvelope' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1098,9 +1088,9 @@ public function fetchGroupsWithHttpInfo() ]; case 401: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1110,9 +1100,9 @@ public function fetchGroupsWithHttpInfo() ]; default: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1123,10 +1113,11 @@ public function fetchGroupsWithHttpInfo() } $returnType = '\Messente\Api\Model\GroupListEnvelope'; + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1203,10 +1194,11 @@ public function fetchGroupsAsyncWithHttpInfo() ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1226,7 +1218,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } ); @@ -1239,7 +1231,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchGroupsRequest() + protected function fetchGroupsRequest() { $resourcePath = '/phonebook/groups'; @@ -1251,7 +1243,8 @@ public function fetchGroupsRequest() - + // body params + $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1265,17 +1258,21 @@ public function fetchGroupsRequest() } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1285,7 +1282,7 @@ public function fetchGroupsRequest() } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -1305,7 +1302,7 @@ public function fetchGroupsRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -1355,16 +1352,9 @@ public function updateGroupWithHttpInfo($groupId, $groupName) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -1375,20 +1365,21 @@ public function updateGroupWithHttpInfo($groupId, $groupName) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + $request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } + $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Messente\Api\Model\GroupEnvelope' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1398,9 +1389,9 @@ public function updateGroupWithHttpInfo($groupId, $groupName) ]; case 400: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1410,9 +1401,9 @@ public function updateGroupWithHttpInfo($groupId, $groupName) ]; case 401: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1422,9 +1413,9 @@ public function updateGroupWithHttpInfo($groupId, $groupName) ]; case 404: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1434,9 +1425,9 @@ public function updateGroupWithHttpInfo($groupId, $groupName) ]; default: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1447,10 +1438,11 @@ public function updateGroupWithHttpInfo($groupId, $groupName) } $returnType = '\Messente\Api\Model\GroupEnvelope'; + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1547,10 +1539,11 @@ public function updateGroupAsyncWithHttpInfo($groupId, $groupName) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -1570,7 +1563,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } ); @@ -1585,7 +1578,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateGroupRequest($groupId, $groupName) + protected function updateGroupRequest($groupId, $groupName) { // verify the required parameter 'groupId' is set if ($groupId === null || (is_array($groupId) && count($groupId) === 0)) { @@ -1608,7 +1601,6 @@ public function updateGroupRequest($groupId, $groupName) $multipart = false; - // path params if ($groupId !== null) { $resourcePath = str_replace( @@ -1618,6 +1610,11 @@ public function updateGroupRequest($groupId, $groupName) ); } + // body params + $_tempBody = null; + if (isset($groupName)) { + $_tempBody = $groupName; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1631,23 +1628,21 @@ public function updateGroupRequest($groupId, $groupName) } // for model (json/xml) - if (isset($groupName)) { + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($groupName)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { - $httpBody = $groupName; + $httpBody = $_tempBody; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1657,7 +1652,7 @@ public function updateGroupRequest($groupId, $groupName) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -1677,7 +1672,7 @@ public function updateGroupRequest($groupId, $groupName) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'PUT', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/lib/Api/NumberLookupApi.php b/lib/Api/NumberLookupApi.php index 54abbe4..2fd2451 100644 --- a/lib/Api/NumberLookupApi.php +++ b/lib/Api/NumberLookupApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $hostIndex; + $this->hostIndex = $host_index; } /** * Set the host index * - * @param int $hostIndex Host index (required) + * @param int Host index (required) */ - public function setHostIndex($hostIndex): void + public function setHostIndex($host_index) { - $this->hostIndex = $hostIndex; + $this->hostIndex = $host_index; } /** * Get the host index * - * @return int Host index + * @return Host index */ public function getHostIndex() { @@ -155,16 +154,9 @@ public function fetchInfoWithHttpInfo($numbersToInvestigate) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -175,20 +167,21 @@ public function fetchInfoWithHttpInfo($numbersToInvestigate) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + $request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } + $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Messente\Api\Model\SyncNumberLookupSuccess' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -198,9 +191,9 @@ public function fetchInfoWithHttpInfo($numbersToInvestigate) ]; case 400: if ('\Messente\Api\Model\ErrorNumberLookup' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -210,9 +203,9 @@ public function fetchInfoWithHttpInfo($numbersToInvestigate) ]; case 401: if ('\Messente\Api\Model\ErrorNumberLookup' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -222,9 +215,9 @@ public function fetchInfoWithHttpInfo($numbersToInvestigate) ]; case 402: if ('\Messente\Api\Model\ErrorNumberLookup' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -235,10 +228,11 @@ public function fetchInfoWithHttpInfo($numbersToInvestigate) } $returnType = '\Messente\Api\Model\SyncNumberLookupSuccess'; + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -325,10 +319,11 @@ public function fetchInfoAsyncWithHttpInfo($numbersToInvestigate) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -348,7 +343,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } ); @@ -362,7 +357,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchInfoRequest($numbersToInvestigate) + protected function fetchInfoRequest($numbersToInvestigate) { // verify the required parameter 'numbersToInvestigate' is set if ($numbersToInvestigate === null || (is_array($numbersToInvestigate) && count($numbersToInvestigate) === 0)) { @@ -380,7 +375,11 @@ public function fetchInfoRequest($numbersToInvestigate) - + // body params + $_tempBody = null; + if (isset($numbersToInvestigate)) { + $_tempBody = $numbersToInvestigate; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -394,23 +393,21 @@ public function fetchInfoRequest($numbersToInvestigate) } // for model (json/xml) - if (isset($numbersToInvestigate)) { + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($numbersToInvestigate)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { - $httpBody = $numbersToInvestigate; + $httpBody = $_tempBody; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -420,7 +417,7 @@ public function fetchInfoRequest($numbersToInvestigate) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -440,7 +437,7 @@ public function fetchInfoRequest($numbersToInvestigate) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/lib/Api/OmnimessageApi.php b/lib/Api/OmnimessageApi.php index 15867bd..220bbe6 100644 --- a/lib/Api/OmnimessageApi.php +++ b/lib/Api/OmnimessageApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $hostIndex; + $this->hostIndex = $host_index; } /** * Set the host index * - * @param int $hostIndex Host index (required) + * @param int Host index (required) */ - public function setHostIndex($hostIndex): void + public function setHostIndex($host_index) { - $this->hostIndex = $hostIndex; + $this->hostIndex = $host_index; } /** * Get the host index * - * @return int Host index + * @return Host index */ public function getHostIndex() { @@ -155,16 +154,9 @@ public function cancelScheduledMessageWithHttpInfo($omnimessageId) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -175,20 +167,21 @@ public function cancelScheduledMessageWithHttpInfo($omnimessageId) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + $request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } + $responseBody = $response->getBody(); switch($statusCode) { case 202: if ('object' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -198,9 +191,9 @@ public function cancelScheduledMessageWithHttpInfo($omnimessageId) ]; case 404: if ('\Messente\Api\Model\ErrorOmnichannel' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -211,10 +204,11 @@ public function cancelScheduledMessageWithHttpInfo($omnimessageId) } $returnType = 'object'; + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -285,10 +279,11 @@ public function cancelScheduledMessageAsyncWithHttpInfo($omnimessageId) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -308,7 +303,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } ); @@ -322,7 +317,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function cancelScheduledMessageRequest($omnimessageId) + protected function cancelScheduledMessageRequest($omnimessageId) { // verify the required parameter 'omnimessageId' is set if ($omnimessageId === null || (is_array($omnimessageId) && count($omnimessageId) === 0)) { @@ -339,7 +334,6 @@ public function cancelScheduledMessageRequest($omnimessageId) $multipart = false; - // path params if ($omnimessageId !== null) { $resourcePath = str_replace( @@ -349,6 +343,8 @@ public function cancelScheduledMessageRequest($omnimessageId) ); } + // body params + $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -362,17 +358,21 @@ public function cancelScheduledMessageRequest($omnimessageId) } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -382,7 +382,7 @@ public function cancelScheduledMessageRequest($omnimessageId) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -402,7 +402,7 @@ public function cancelScheduledMessageRequest($omnimessageId) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -450,16 +450,9 @@ public function sendOmnimessageWithHttpInfo($omnimessage) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -470,20 +463,21 @@ public function sendOmnimessageWithHttpInfo($omnimessage) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + $request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } + $responseBody = $response->getBody(); switch($statusCode) { case 201: if ('\Messente\Api\Model\OmniMessageCreateSuccessResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -493,9 +487,9 @@ public function sendOmnimessageWithHttpInfo($omnimessage) ]; case 400: if ('\Messente\Api\Model\ErrorOmnichannel' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -506,10 +500,11 @@ public function sendOmnimessageWithHttpInfo($omnimessage) } $returnType = '\Messente\Api\Model\OmniMessageCreateSuccessResponse'; + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -580,10 +575,11 @@ public function sendOmnimessageAsyncWithHttpInfo($omnimessage) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -603,7 +599,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } ); @@ -617,7 +613,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function sendOmnimessageRequest($omnimessage) + protected function sendOmnimessageRequest($omnimessage) { // verify the required parameter 'omnimessage' is set if ($omnimessage === null || (is_array($omnimessage) && count($omnimessage) === 0)) { @@ -635,7 +631,11 @@ public function sendOmnimessageRequest($omnimessage) - + // body params + $_tempBody = null; + if (isset($omnimessage)) { + $_tempBody = $omnimessage; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -649,23 +649,21 @@ public function sendOmnimessageRequest($omnimessage) } // for model (json/xml) - if (isset($omnimessage)) { + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($omnimessage)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { - $httpBody = $omnimessage; + $httpBody = $_tempBody; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -675,7 +673,7 @@ public function sendOmnimessageRequest($omnimessage) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -695,7 +693,7 @@ public function sendOmnimessageRequest($omnimessage) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/lib/Api/StatisticsApi.php b/lib/Api/StatisticsApi.php index a5b109f..8af4d30 100644 --- a/lib/Api/StatisticsApi.php +++ b/lib/Api/StatisticsApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $hostIndex; + $this->hostIndex = $host_index; } /** * Set the host index * - * @param int $hostIndex Host index (required) + * @param int Host index (required) */ - public function setHostIndex($hostIndex): void + public function setHostIndex($host_index) { - $this->hostIndex = $hostIndex; + $this->hostIndex = $host_index; } /** * Get the host index * - * @return int Host index + * @return Host index */ public function getHostIndex() { @@ -155,16 +154,9 @@ public function createStatisticsReportWithHttpInfo($statisticsReportSettings) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -175,20 +167,21 @@ public function createStatisticsReportWithHttpInfo($statisticsReportSettings) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + $request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } + $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Messente\Api\Model\StatisticsReportSuccess' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -198,9 +191,9 @@ public function createStatisticsReportWithHttpInfo($statisticsReportSettings) ]; case 400: if ('\Messente\Api\Model\ErrorStatistics' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -210,9 +203,9 @@ public function createStatisticsReportWithHttpInfo($statisticsReportSettings) ]; case 401: if ('\Messente\Api\Model\ErrorStatistics' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -222,9 +215,9 @@ public function createStatisticsReportWithHttpInfo($statisticsReportSettings) ]; case 422: if ('\Messente\Api\Model\ErrorStatistics' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -234,9 +227,9 @@ public function createStatisticsReportWithHttpInfo($statisticsReportSettings) ]; case 500: if ('\Messente\Api\Model\ErrorStatistics' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -247,10 +240,11 @@ public function createStatisticsReportWithHttpInfo($statisticsReportSettings) } $returnType = '\Messente\Api\Model\StatisticsReportSuccess'; + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -345,10 +339,11 @@ public function createStatisticsReportAsyncWithHttpInfo($statisticsReportSetting ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { + $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $responseBody; //stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = $responseBody->getContents(); } return [ @@ -368,7 +363,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + $response->getBody() ); } ); @@ -382,7 +377,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createStatisticsReportRequest($statisticsReportSettings) + protected function createStatisticsReportRequest($statisticsReportSettings) { // verify the required parameter 'statisticsReportSettings' is set if ($statisticsReportSettings === null || (is_array($statisticsReportSettings) && count($statisticsReportSettings) === 0)) { @@ -400,7 +395,11 @@ public function createStatisticsReportRequest($statisticsReportSettings) - + // body params + $_tempBody = null; + if (isset($statisticsReportSettings)) { + $_tempBody = $statisticsReportSettings; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -414,23 +413,21 @@ public function createStatisticsReportRequest($statisticsReportSettings) } // for model (json/xml) - if (isset($statisticsReportSettings)) { + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($statisticsReportSettings)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { - $httpBody = $statisticsReportSettings; + $httpBody = $_tempBody; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -440,7 +437,7 @@ public function createStatisticsReportRequest($statisticsReportSettings) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -460,7 +457,7 @@ public function createStatisticsReportRequest($statisticsReportSettings) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/lib/ApiException.php b/lib/ApiException.php index 5e918bc..a4fe6e6 100644 --- a/lib/ApiException.php +++ b/lib/ApiException.php @@ -1,7 +1,7 @@ getTempFolderPath() . PHP_EOL; return $report; @@ -411,7 +408,7 @@ public static function toDebugReport() * * @param string $apiKeyIdentifier name of apikey * - * @return null|string API key with the prefix + * @return string API key with the prefix */ public function getApiKeyWithPrefix($apiKeyIdentifier) { @@ -434,29 +431,29 @@ public function getApiKeyWithPrefix($apiKeyIdentifier) /** * Returns an array of host settings * - * @return array an array of host settings + * @return an array of host settings */ public function getHostSettings() { - return [ - [ - "url" => "https://api.messente.com/v1", - "description" => "No description provided", - ] - ]; + return array( + array( + "url" => "https://api.messente.com/v1", + "description" => "No description provided", + ) + ); } /** * Returns URL based on the index and variables * - * @param int $index index of the host settings - * @param array|null $variables hash of variable and the corresponding value (optional) - * @return string URL based on host settings + * @param index array index of the host settings + * @param variables hash of variable and the corresponding value (optional) + * @return URL based on host settings */ public function getHostFromSettings($index, $variables = null) { if (null === $variables) { - $variables = []; + $variables = array(); } $hosts = $this->getHostSettings(); @@ -470,9 +467,9 @@ public function getHostFromSettings($index, $variables = null) $url = $host["url"]; // go through variable and assign a value - foreach ($host["variables"] ?? [] as $name => $variable) { + foreach ($host["variables"] as $name => $variable) { if (array_key_exists($name, $variables)) { // check to see if it's in the variables provided by the user - if (in_array($variables[$name], $variable["enum_values"], true)) { // check to see if the value is in the enum + if (in_array($variables[$name], $variable["enum_values"])) { // check to see if the value is in the enum $url = str_replace("{".$name."}", $variables[$name], $url); } else { throw new \InvalidArgumentException("The variable `$name` in the host URL has invalid value ".$variables[$name].". Must be ".join(',', $variable["enum_values"])."."); diff --git a/lib/HeaderSelector.php b/lib/HeaderSelector.php index a149e1d..05795b9 100644 --- a/lib/HeaderSelector.php +++ b/lib/HeaderSelector.php @@ -1,7 +1,7 @@ - * @template TKey int|null - * @template TValue mixed|null */ -class ContactEnvelope implements ModelInterface, ArrayAccess, \JsonSerializable +class ContactEnvelope implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -68,13 +65,27 @@ class ContactEnvelope implements ModelInterface, ArrayAccess, \JsonSerializable * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -95,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 @@ -164,6 +229,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -180,7 +248,18 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['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; } /** @@ -222,10 +301,16 @@ public function getContact() * * @param \Messente\Api\Model\ContactResponseFields|null $contact contact * - * @return self + * @return $this */ public function setContact($contact) { + + + if (is_null($contact)) { + throw new \InvalidArgumentException('non-nullable contact cannot be null'); + } + $this->container['contact'] = $contact; return $this; @@ -247,18 +332,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -283,18 +368,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -307,16 +380,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/ContactFields.php b/lib/Model/ContactFields.php index 7fc55a0..defdf21 100644 --- a/lib/Model/ContactFields.php +++ b/lib/Model/ContactFields.php @@ -2,7 +2,7 @@ /** * ContactFields * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class ContactFields implements ModelInterface, ArrayAccess, \JsonSerializable +class ContactFields implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -77,8 +74,6 @@ class ContactFields implements ModelInterface, ArrayAccess, \JsonSerializable * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'phoneNumber' => null, @@ -93,6 +88,31 @@ class ContactFields implements ModelInterface, ArrayAccess, \JsonSerializable '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 * @@ -113,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 @@ -209,6 +283,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -225,16 +302,27 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['phoneNumber'] = $data['phoneNumber'] ?? null; - $this->container['email'] = $data['email'] ?? null; - $this->container['firstName'] = $data['firstName'] ?? null; - $this->container['lastName'] = $data['lastName'] ?? null; - $this->container['company'] = $data['company'] ?? null; - $this->container['title'] = $data['title'] ?? null; - $this->container['custom'] = $data['custom'] ?? null; - $this->container['custom2'] = $data['custom2'] ?? null; - $this->container['custom3'] = $data['custom3'] ?? null; - $this->container['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; } /** @@ -279,10 +367,16 @@ public function getPhoneNumber() * * @param string $phoneNumber Phone number in e.164 format * - * @return self + * @return $this */ public function setPhoneNumber($phoneNumber) { + + + if (is_null($phoneNumber)) { + throw new \InvalidArgumentException('non-nullable phoneNumber cannot be null'); + } + $this->container['phoneNumber'] = $phoneNumber; return $this; @@ -303,10 +397,23 @@ public function getEmail() * * @param string|null $email The email of the contact * - * @return self + * @return $this */ 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; @@ -327,10 +434,23 @@ public function getFirstName() * * @param string|null $firstName The first name of the contact * - * @return self + * @return $this */ 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; @@ -351,10 +471,23 @@ public function getLastName() * * @param string|null $lastName The last name of the contact * - * @return self + * @return $this */ 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; @@ -375,10 +508,23 @@ public function getCompany() * * @param string|null $company The company of the contact * - * @return self + * @return $this */ 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; @@ -399,10 +545,23 @@ public function getTitle() * * @param string|null $title The title of the contact * - * @return self + * @return $this */ 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; @@ -423,10 +582,23 @@ public function getCustom() * * @param string|null $custom The first custom field * - * @return self + * @return $this */ 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; @@ -447,10 +619,23 @@ public function getCustom2() * * @param string|null $custom2 The second custom field * - * @return self + * @return $this */ 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; @@ -471,10 +656,23 @@ public function getCustom3() * * @param string|null $custom3 The third custom field * - * @return self + * @return $this */ 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; @@ -495,10 +693,23 @@ public function getCustom4() * * @param string|null $custom4 The fourth custom field * - * @return self + * @return $this */ 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; @@ -520,18 +731,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -556,18 +767,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -580,16 +779,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/ContactListEnvelope.php b/lib/Model/ContactListEnvelope.php index b225830..0b730a5 100644 --- a/lib/Model/ContactListEnvelope.php +++ b/lib/Model/ContactListEnvelope.php @@ -2,7 +2,7 @@ /** * ContactListEnvelope * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class ContactListEnvelope implements ModelInterface, ArrayAccess, \JsonSerializable +class ContactListEnvelope implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -68,13 +65,27 @@ class ContactListEnvelope implements ModelInterface, ArrayAccess, \JsonSerializa * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -95,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 @@ -164,6 +229,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -180,7 +248,18 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['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; } /** @@ -222,12 +301,16 @@ public function getContacts() * * @param \Messente\Api\Model\ContactResponseFields[]|null $contacts An array of contacts * - * @return self + * @return $this */ public function setContacts($contacts) { + if (is_null($contacts)) { + throw new \InvalidArgumentException('non-nullable contacts cannot be null'); + } + $this->container['contacts'] = $contacts; return $this; @@ -249,18 +332,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -285,18 +368,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -309,16 +380,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/ContactResponseFields.php b/lib/Model/ContactResponseFields.php index 1b44998..225a03b 100644 --- a/lib/Model/ContactResponseFields.php +++ b/lib/Model/ContactResponseFields.php @@ -2,7 +2,7 @@ /** * ContactResponseFields * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class ContactResponseFields implements ModelInterface, ArrayAccess, \JsonSerializable +class ContactResponseFields implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -78,8 +75,6 @@ class ContactResponseFields implements ModelInterface, ArrayAccess, \JsonSeriali * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'phoneNumber' => null, @@ -95,6 +90,32 @@ class ContactResponseFields implements ModelInterface, ArrayAccess, \JsonSeriali 'scheduledDeletionDate' => 'date' ]; + /** + * 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, + 'scheduledDeletionDate' => 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 * @@ -115,6 +136,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 @@ -214,6 +289,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -230,17 +308,28 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['phoneNumber'] = $data['phoneNumber'] ?? null; - $this->container['email'] = $data['email'] ?? null; - $this->container['firstName'] = $data['firstName'] ?? null; - $this->container['lastName'] = $data['lastName'] ?? null; - $this->container['company'] = $data['company'] ?? null; - $this->container['title'] = $data['title'] ?? null; - $this->container['custom'] = $data['custom'] ?? null; - $this->container['custom2'] = $data['custom2'] ?? null; - $this->container['custom3'] = $data['custom3'] ?? null; - $this->container['custom4'] = $data['custom4'] ?? null; - $this->container['scheduledDeletionDate'] = $data['scheduledDeletionDate'] ?? 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); + $this->setIfExists('scheduledDeletionDate', $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; } /** @@ -282,10 +371,16 @@ public function getPhoneNumber() * * @param string|null $phoneNumber Phone number in e.164 format * - * @return self + * @return $this */ public function setPhoneNumber($phoneNumber) { + + + if (is_null($phoneNumber)) { + throw new \InvalidArgumentException('non-nullable phoneNumber cannot be null'); + } + $this->container['phoneNumber'] = $phoneNumber; return $this; @@ -306,10 +401,23 @@ public function getEmail() * * @param string|null $email The email of the contact * - * @return self + * @return $this */ 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; @@ -330,10 +438,23 @@ public function getFirstName() * * @param string|null $firstName The first name of the contact * - * @return self + * @return $this */ 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; @@ -354,10 +475,23 @@ public function getLastName() * * @param string|null $lastName The last name of the contact * - * @return self + * @return $this */ 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; @@ -378,10 +512,23 @@ public function getCompany() * * @param string|null $company The company of the contact * - * @return self + * @return $this */ 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; @@ -402,10 +549,23 @@ public function getTitle() * * @param string|null $title The title of the contact * - * @return self + * @return $this */ 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; @@ -426,10 +586,23 @@ public function getCustom() * * @param string|null $custom The first custom field * - * @return self + * @return $this */ 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; @@ -450,10 +623,23 @@ public function getCustom2() * * @param string|null $custom2 The second custom field * - * @return self + * @return $this */ 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; @@ -474,10 +660,23 @@ public function getCustom3() * * @param string|null $custom3 The third custom field * - * @return self + * @return $this */ 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; @@ -498,10 +697,23 @@ public function getCustom4() * * @param string|null $custom4 The fourth custom field * - * @return self + * @return $this */ 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; @@ -522,10 +734,23 @@ public function getScheduledDeletionDate() * * @param \DateTime|null $scheduledDeletionDate The date in ISO 8601 format, YYYY-MM-DD, on which the contact is going to be deleted because it has not belonged to a group for 30 days * - * @return self + * @return $this */ public function setScheduledDeletionDate($scheduledDeletionDate) { + + if (is_null($scheduledDeletionDate)) { + array_push($this->openAPINullablesSetToNull, 'scheduledDeletionDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('scheduledDeletionDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['scheduledDeletionDate'] = $scheduledDeletionDate; return $this; @@ -547,18 +772,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -583,18 +808,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -607,16 +820,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/ContactUpdateFields.php b/lib/Model/ContactUpdateFields.php index 1f4c757..2f731b6 100644 --- a/lib/Model/ContactUpdateFields.php +++ b/lib/Model/ContactUpdateFields.php @@ -2,7 +2,7 @@ /** * ContactUpdateFields * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class ContactUpdateFields implements ModelInterface, ArrayAccess, \JsonSerializable +class ContactUpdateFields implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -76,8 +73,6 @@ class ContactUpdateFields implements ModelInterface, ArrayAccess, \JsonSerializa * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'email' => null, @@ -91,6 +86,30 @@ class ContactUpdateFields implements ModelInterface, ArrayAccess, \JsonSerializa '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 * @@ -111,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 @@ -204,6 +277,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -220,15 +296,26 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['email'] = $data['email'] ?? null; - $this->container['firstName'] = $data['firstName'] ?? null; - $this->container['lastName'] = $data['lastName'] ?? null; - $this->container['company'] = $data['company'] ?? null; - $this->container['title'] = $data['title'] ?? null; - $this->container['custom'] = $data['custom'] ?? null; - $this->container['custom2'] = $data['custom2'] ?? null; - $this->container['custom3'] = $data['custom3'] ?? null; - $this->container['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; } /** @@ -270,10 +357,23 @@ public function getEmail() * * @param string|null $email The email of the contact * - * @return self + * @return $this */ 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; @@ -294,10 +394,23 @@ public function getFirstName() * * @param string|null $firstName The first name of the contact * - * @return self + * @return $this */ 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; @@ -318,10 +431,23 @@ public function getLastName() * * @param string|null $lastName The last name of the contact * - * @return self + * @return $this */ 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; @@ -342,10 +468,23 @@ public function getCompany() * * @param string|null $company The company of the contact * - * @return self + * @return $this */ 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; @@ -366,10 +505,23 @@ public function getTitle() * * @param string|null $title The title of the contact * - * @return self + * @return $this */ 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; @@ -390,10 +542,23 @@ public function getCustom() * * @param string|null $custom The first custom field * - * @return self + * @return $this */ 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; @@ -414,10 +579,23 @@ public function getCustom2() * * @param string|null $custom2 The second custom field * - * @return self + * @return $this */ 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; @@ -438,10 +616,23 @@ public function getCustom3() * * @param string|null $custom3 The third custom field * - * @return self + * @return $this */ 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; @@ -462,10 +653,23 @@ public function getCustom4() * * @param string|null $custom4 The fourth custom field * - * @return self + * @return $this */ 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; @@ -487,18 +691,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -523,18 +727,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -547,16 +739,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/DeliveryReportResponse.php b/lib/Model/DeliveryReportResponse.php index 0ac1bdb..c078fea 100644 --- a/lib/Model/DeliveryReportResponse.php +++ b/lib/Model/DeliveryReportResponse.php @@ -2,7 +2,7 @@ /** * DeliveryReportResponse * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class DeliveryReportResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class DeliveryReportResponse implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -70,8 +67,6 @@ class DeliveryReportResponse implements ModelInterface, ArrayAccess, \JsonSerial * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'statuses' => null, @@ -79,6 +74,24 @@ class DeliveryReportResponse implements ModelInterface, ArrayAccess, \JsonSerial '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 * @@ -99,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 @@ -174,6 +241,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -190,9 +260,20 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['statuses'] = $data['statuses'] ?? null; - $this->container['to'] = $data['to'] ?? null; - $this->container['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; } /** @@ -243,10 +324,16 @@ public function getStatuses() * * @param \Messente\Api\Model\DeliveryResult[] $statuses Contains the delivery reports for each channel, ordered by send order * - * @return self + * @return $this */ public function setStatuses($statuses) { + + + if (is_null($statuses)) { + throw new \InvalidArgumentException('non-nullable statuses cannot be null'); + } + $this->container['statuses'] = $statuses; return $this; @@ -267,10 +354,16 @@ public function getTo() * * @param string $to Phone number in e.164 format * - * @return self + * @return $this */ public function setTo($to) { + + + if (is_null($to)) { + throw new \InvalidArgumentException('non-nullable to cannot be null'); + } + $this->container['to'] = $to; return $this; @@ -291,10 +384,16 @@ public function getOmnimessageId() * * @param string $omnimessageId Unique identifier for the omnimessage * - * @return self + * @return $this */ public function setOmnimessageId($omnimessageId) { + + + if (is_null($omnimessageId)) { + throw new \InvalidArgumentException('non-nullable omnimessageId cannot be null'); + } + $this->container['omnimessageId'] = $omnimessageId; return $this; @@ -316,18 +415,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -352,18 +451,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -376,16 +463,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/DeliveryResult.php b/lib/Model/DeliveryResult.php index 049d5e3..3dd6dde 100644 --- a/lib/Model/DeliveryResult.php +++ b/lib/Model/DeliveryResult.php @@ -2,7 +2,7 @@ /** * DeliveryResult * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class DeliveryResult implements ModelInterface, ArrayAccess, \JsonSerializable +class DeliveryResult implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -73,8 +70,6 @@ class DeliveryResult implements ModelInterface, ArrayAccess, \JsonSerializable * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'status' => null, @@ -85,6 +80,27 @@ class DeliveryResult implements ModelInterface, ArrayAccess, \JsonSerializable '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 * @@ -105,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 @@ -189,6 +259,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -205,12 +278,23 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['status'] = $data['status'] ?? null; - $this->container['channel'] = $data['channel'] ?? null; - $this->container['messageId'] = $data['messageId'] ?? null; - $this->container['error'] = $data['error'] ?? null; - $this->container['err'] = $data['err'] ?? null; - $this->container['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; } /** @@ -252,10 +336,16 @@ public function getStatus() * * @param \Messente\Api\Model\Status|null $status status * - * @return self + * @return $this */ public function setStatus($status) { + + + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; return $this; @@ -276,10 +366,16 @@ public function getChannel() * * @param \Messente\Api\Model\Channel|null $channel channel * - * @return self + * @return $this */ public function setChannel($channel) { + + + if (is_null($channel)) { + throw new \InvalidArgumentException('non-nullable channel cannot be null'); + } + $this->container['channel'] = $channel; return $this; @@ -300,10 +396,16 @@ public function getMessageId() * * @param string|null $messageId Unique identifier for the message * - * @return self + * @return $this */ public function setMessageId($messageId) { + + + if (is_null($messageId)) { + throw new \InvalidArgumentException('non-nullable messageId cannot be null'); + } + $this->container['messageId'] = $messageId; return $this; @@ -324,10 +426,16 @@ public function getError() * * @param string|null $error Human-readable description of what went wrong, *null* in case of success or if the message has not been processed yet * - * @return self + * @return $this */ public function setError($error) { + + + if (is_null($error)) { + throw new \InvalidArgumentException('non-nullable error cannot be null'); + } + $this->container['error'] = $error; return $this; @@ -348,10 +456,16 @@ public function getErr() * * @param \Messente\Api\Model\ErrorCodeOmnichannelMachine|null $err err * - * @return self + * @return $this */ public function setErr($err) { + + + if (is_null($err)) { + throw new \InvalidArgumentException('non-nullable err cannot be null'); + } + $this->container['err'] = $err; return $this; @@ -372,10 +486,16 @@ public function getTimestamp() * * @param \DateTime|null $timestamp When this status was received by Omnichannel API * - * @return self + * @return $this */ public function setTimestamp($timestamp) { + + + if (is_null($timestamp)) { + throw new \InvalidArgumentException('non-nullable timestamp cannot be null'); + } + $this->container['timestamp'] = $timestamp; return $this; @@ -397,18 +517,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -433,18 +553,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -457,16 +565,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/ErrorCodeOmnichannel.php b/lib/Model/ErrorCodeOmnichannel.php index 5f88cd2..64a7750 100644 --- a/lib/Model/ErrorCodeOmnichannel.php +++ b/lib/Model/ErrorCodeOmnichannel.php @@ -2,7 +2,7 @@ /** * ErrorCodeOmnichannel * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -45,19 +45,13 @@ class ErrorCodeOmnichannel * Possible values of this enum */ const _101 = '101'; - const _102 = '102'; - const _103 = '103'; - const _104 = '104'; - const _105 = '105'; - const _106 = '106'; - const _107 = '107'; - + /** * Gets allowable values of the enum * @return string[] @@ -71,7 +65,7 @@ public static function getAllowableEnumValues() self::_104, self::_105, self::_106, - self::_107 + self::_107, ]; } } diff --git a/lib/Model/ErrorCodeOmnichannelMachine.php b/lib/Model/ErrorCodeOmnichannelMachine.php index 50b2f5f..03ae830 100644 --- a/lib/Model/ErrorCodeOmnichannelMachine.php +++ b/lib/Model/ErrorCodeOmnichannelMachine.php @@ -2,7 +2,7 @@ /** * ErrorCodeOmnichannelMachine * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -44,30 +44,19 @@ class ErrorCodeOmnichannelMachine /** * Possible values of this enum */ - const NUMBER_0 = 0; - - const NUMBER_1 = 1; - - const NUMBER_2 = 2; - - const NUMBER_3 = 3; - - const NUMBER_4 = 4; - - const NUMBER_5 = 5; - - const NUMBER_6 = 6; - - const NUMBER_7 = 7; - - const NUMBER_8 = 8; - - const NUMBER_9 = 9; - - const NUMBER_10 = 10; - - const NUMBER_999 = 999; - + const 0 = 0; + const 1 = 1; + const 2 = 2; + const 3 = 3; + const 4 = 4; + const 5 = 5; + const 6 = 6; + const 7 = 7; + const 8 = 8; + const 9 = 9; + const 10 = 10; + const 999 = 999; + /** * Gets allowable values of the enum * @return string[] @@ -75,18 +64,18 @@ class ErrorCodeOmnichannelMachine public static function getAllowableEnumValues() { return [ - self::NUMBER_0, - self::NUMBER_1, - self::NUMBER_2, - self::NUMBER_3, - self::NUMBER_4, - self::NUMBER_5, - self::NUMBER_6, - self::NUMBER_7, - self::NUMBER_8, - self::NUMBER_9, - self::NUMBER_10, - self::NUMBER_999 + self::0, + self::1, + self::2, + self::3, + self::4, + self::5, + self::6, + self::7, + self::8, + self::9, + self::10, + self::999, ]; } } diff --git a/lib/Model/ErrorCodePhonebook.php b/lib/Model/ErrorCodePhonebook.php index 37fdb89..8a980d8 100644 --- a/lib/Model/ErrorCodePhonebook.php +++ b/lib/Model/ErrorCodePhonebook.php @@ -2,7 +2,7 @@ /** * ErrorCodePhonebook * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -45,17 +45,12 @@ class ErrorCodePhonebook * Possible values of this enum */ const _201 = '201'; - const _202 = '202'; - const _203 = '203'; - const _204 = '204'; - const _244 = '244'; - const _205 = '205'; - + /** * Gets allowable values of the enum * @return string[] @@ -68,7 +63,7 @@ public static function getAllowableEnumValues() self::_203, self::_204, self::_244, - self::_205 + self::_205, ]; } } diff --git a/lib/Model/ErrorCodeStatistics.php b/lib/Model/ErrorCodeStatistics.php index 6b082f7..afabc11 100644 --- a/lib/Model/ErrorCodeStatistics.php +++ b/lib/Model/ErrorCodeStatistics.php @@ -2,7 +2,7 @@ /** * ErrorCodeStatistics * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -45,13 +45,10 @@ class ErrorCodeStatistics * Possible values of this enum */ const _100 = '100'; - const _103 = '103'; - const _104 = '104'; - const _105 = '105'; - + /** * Gets allowable values of the enum * @return string[] @@ -62,7 +59,7 @@ public static function getAllowableEnumValues() self::_100, self::_103, self::_104, - self::_105 + self::_105, ]; } } diff --git a/lib/Model/ErrorItemNumberLookup.php b/lib/Model/ErrorItemNumberLookup.php index 1173426..d0eef98 100644 --- a/lib/Model/ErrorItemNumberLookup.php +++ b/lib/Model/ErrorItemNumberLookup.php @@ -2,7 +2,7 @@ /** * ErrorItemNumberLookup * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class ErrorItemNumberLookup implements ModelInterface, ArrayAccess, \JsonSerializable +class ErrorItemNumberLookup implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -68,13 +65,27 @@ class ErrorItemNumberLookup implements ModelInterface, ArrayAccess, \JsonSeriali * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'error' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'error' => 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 * @@ -95,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 @@ -164,6 +229,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -180,7 +248,18 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['error'] = $data['error'] ?? null; + $this->setIfExists('error', $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; } /** @@ -225,10 +304,16 @@ public function getError() * * @param \Messente\Api\Model\ErrorItemNumberLookupError $error error * - * @return self + * @return $this */ public function setError($error) { + + + if (is_null($error)) { + throw new \InvalidArgumentException('non-nullable error cannot be null'); + } + $this->container['error'] = $error; return $this; @@ -250,18 +335,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -286,18 +371,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -310,16 +383,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/ErrorItemNumberLookupError.php b/lib/Model/ErrorItemNumberLookupError.php index b8f6254..e0ad19c 100644 --- a/lib/Model/ErrorItemNumberLookupError.php +++ b/lib/Model/ErrorItemNumberLookupError.php @@ -2,7 +2,7 @@ /** * ErrorItemNumberLookupError * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class ErrorItemNumberLookupError implements ModelInterface, ArrayAccess, \JsonSerializable +class ErrorItemNumberLookupError implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -69,14 +66,29 @@ class ErrorItemNumberLookupError implements ModelInterface, ArrayAccess, \JsonSe * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'description' => null, 'code' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'description' => 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 * @@ -97,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 @@ -169,6 +235,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -185,8 +254,19 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['description'] = $data['description'] ?? null; - $this->container['code'] = $data['code'] ?? null; + $this->setIfExists('description', $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; } /** @@ -242,10 +322,16 @@ public function getDescription() * * @param string $description Error description * - * @return self + * @return $this */ public function setDescription($description) { + + + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; return $this; @@ -266,7 +352,7 @@ public function getCode() * * @param int $code Matches the following error title. This field is a constant * 101 - Unauthorized * 102 - Invalid arguments or parameters * 103 - Server error * 104 - Crediting error #1 * 105 - Crediting error #2 * 106 - Client error * - * @return self + * @return $this */ public function setCode($code) { @@ -278,6 +364,12 @@ public function setCode($code) throw new \InvalidArgumentException('invalid value for $code when calling ErrorItemNumberLookupError., must be bigger than or equal to 101.'); } + + + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); + } + $this->container['code'] = $code; return $this; @@ -299,18 +391,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -335,18 +427,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -359,16 +439,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/ErrorItemOmnichannel.php b/lib/Model/ErrorItemOmnichannel.php index dd1cad6..7bf1027 100644 --- a/lib/Model/ErrorItemOmnichannel.php +++ b/lib/Model/ErrorItemOmnichannel.php @@ -2,7 +2,7 @@ /** * ErrorItemOmnichannel * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class ErrorItemOmnichannel implements ModelInterface, ArrayAccess, \JsonSerializable +class ErrorItemOmnichannel implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -71,8 +68,6 @@ class ErrorItemOmnichannel implements ModelInterface, ArrayAccess, \JsonSerializ * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'title' => null, @@ -81,6 +76,25 @@ class ErrorItemOmnichannel implements ModelInterface, ArrayAccess, \JsonSerializ 'source' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'title' => false, + 'detail' => false, + 'code' => false, + 'source' => 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 * @@ -101,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 @@ -179,6 +247,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -195,10 +266,21 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['detail'] = $data['detail'] ?? null; - $this->container['code'] = $data['code'] ?? null; - $this->container['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; } /** @@ -252,10 +334,16 @@ public function getTitle() * * @param \Messente\Api\Model\ErrorTitleOmnichannel $title title * - * @return self + * @return $this */ public function setTitle($title) { + + + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } + $this->container['title'] = $title; return $this; @@ -276,10 +364,16 @@ public function getDetail() * * @param string $detail Free form more detailed description of the error * - * @return self + * @return $this */ public function setDetail($detail) { + + + if (is_null($detail)) { + throw new \InvalidArgumentException('non-nullable detail cannot be null'); + } + $this->container['detail'] = $detail; return $this; @@ -300,10 +394,16 @@ public function getCode() * * @param \Messente\Api\Model\ErrorCodeOmnichannel $code code * - * @return self + * @return $this */ public function setCode($code) { + + + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); + } + $this->container['code'] = $code; return $this; @@ -324,10 +424,23 @@ public function getSource() * * @param string $source Describes which field is causing the issue in the payload, null for non 400 status code responses * - * @return self + * @return $this */ public function setSource($source) { + + if (is_null($source)) { + array_push($this->openAPINullablesSetToNull, 'source'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('source', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['source'] = $source; return $this; @@ -349,18 +462,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -385,18 +498,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -409,16 +510,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/ErrorItemPhonebook.php b/lib/Model/ErrorItemPhonebook.php index 8e0cb54..0f7f426 100644 --- a/lib/Model/ErrorItemPhonebook.php +++ b/lib/Model/ErrorItemPhonebook.php @@ -2,7 +2,7 @@ /** * ErrorItemPhonebook * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class ErrorItemPhonebook implements ModelInterface, ArrayAccess, \JsonSerializable +class ErrorItemPhonebook implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -70,8 +67,6 @@ class ErrorItemPhonebook implements ModelInterface, ArrayAccess, \JsonSerializab * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'title' => null, @@ -79,6 +74,24 @@ class ErrorItemPhonebook implements ModelInterface, ArrayAccess, \JsonSerializab '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 * @@ -99,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 @@ -174,6 +241,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -190,9 +260,20 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['detail'] = $data['detail'] ?? null; - $this->container['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; } /** @@ -243,10 +324,16 @@ public function getTitle() * * @param \Messente\Api\Model\ErrorTitlePhonebook $title title * - * @return self + * @return $this */ public function setTitle($title) { + + + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } + $this->container['title'] = $title; return $this; @@ -267,10 +354,16 @@ public function getDetail() * * @param string $detail Free form more detailed description of the error * - * @return self + * @return $this */ public function setDetail($detail) { + + + if (is_null($detail)) { + throw new \InvalidArgumentException('non-nullable detail cannot be null'); + } + $this->container['detail'] = $detail; return $this; @@ -291,10 +384,16 @@ public function getCode() * * @param \Messente\Api\Model\ErrorCodePhonebook $code code * - * @return self + * @return $this */ public function setCode($code) { + + + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); + } + $this->container['code'] = $code; return $this; @@ -316,18 +415,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -352,18 +451,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -376,16 +463,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/ErrorItemStatistics.php b/lib/Model/ErrorItemStatistics.php index 1c794d4..278f46c 100644 --- a/lib/Model/ErrorItemStatistics.php +++ b/lib/Model/ErrorItemStatistics.php @@ -2,7 +2,7 @@ /** * ErrorItemStatistics * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class ErrorItemStatistics implements ModelInterface, ArrayAccess, \JsonSerializable +class ErrorItemStatistics implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -70,8 +67,6 @@ class ErrorItemStatistics implements ModelInterface, ArrayAccess, \JsonSerializa * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'title' => null, @@ -79,6 +74,24 @@ class ErrorItemStatistics implements ModelInterface, ArrayAccess, \JsonSerializa 'code' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'title' => false, + 'details' => 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 * @@ -99,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 @@ -174,6 +241,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -190,9 +260,20 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['details'] = $data['details'] ?? null; - $this->container['code'] = $data['code'] ?? null; + $this->setIfExists('title', $data, null); + $this->setIfExists('details', $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; } /** @@ -243,10 +324,16 @@ public function getTitle() * * @param string $title Error title * - * @return self + * @return $this */ public function setTitle($title) { + + + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } + $this->container['title'] = $title; return $this; @@ -267,10 +354,16 @@ public function getDetails() * * @param string $details Error details * - * @return self + * @return $this */ public function setDetails($details) { + + + if (is_null($details)) { + throw new \InvalidArgumentException('non-nullable details cannot be null'); + } + $this->container['details'] = $details; return $this; @@ -291,10 +384,16 @@ public function getCode() * * @param \Messente\Api\Model\ErrorCodeStatistics $code code * - * @return self + * @return $this */ public function setCode($code) { + + + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); + } + $this->container['code'] = $code; return $this; @@ -316,18 +415,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -352,18 +451,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -376,16 +463,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/ErrorNumberLookup.php b/lib/Model/ErrorNumberLookup.php index 1e4d769..f62ff86 100644 --- a/lib/Model/ErrorNumberLookup.php +++ b/lib/Model/ErrorNumberLookup.php @@ -2,7 +2,7 @@ /** * ErrorNumberLookup * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class ErrorNumberLookup implements ModelInterface, ArrayAccess, \JsonSerializable +class ErrorNumberLookup implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -68,13 +65,27 @@ class ErrorNumberLookup implements ModelInterface, ArrayAccess, \JsonSerializabl * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -95,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 @@ -164,6 +229,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -180,7 +248,18 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['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; } /** @@ -225,10 +304,16 @@ public function getErrors() * * @param \Messente\Api\Model\ErrorItemNumberLookup[] $errors An array of errors * - * @return self + * @return $this */ public function setErrors($errors) { + + + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); + } + $this->container['errors'] = $errors; return $this; @@ -250,18 +335,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -286,18 +371,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -310,16 +383,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/ErrorOmnichannel.php b/lib/Model/ErrorOmnichannel.php index ff18c12..d7ffaa8 100644 --- a/lib/Model/ErrorOmnichannel.php +++ b/lib/Model/ErrorOmnichannel.php @@ -2,7 +2,7 @@ /** * ErrorOmnichannel * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class ErrorOmnichannel implements ModelInterface, ArrayAccess, \JsonSerializable +class ErrorOmnichannel implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -68,13 +65,27 @@ class ErrorOmnichannel implements ModelInterface, ArrayAccess, \JsonSerializable * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -95,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 @@ -164,6 +229,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -180,7 +248,18 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['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; } /** @@ -225,10 +304,16 @@ public function getErrors() * * @param \Messente\Api\Model\ErrorItemOmnichannel[] $errors An array of errors * - * @return self + * @return $this */ public function setErrors($errors) { + + + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); + } + $this->container['errors'] = $errors; return $this; @@ -250,18 +335,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -286,18 +371,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -310,16 +383,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/ErrorPhonebook.php b/lib/Model/ErrorPhonebook.php index 6f5f502..fb54b7f 100644 --- a/lib/Model/ErrorPhonebook.php +++ b/lib/Model/ErrorPhonebook.php @@ -2,7 +2,7 @@ /** * ErrorPhonebook * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class ErrorPhonebook implements ModelInterface, ArrayAccess, \JsonSerializable +class ErrorPhonebook implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -68,13 +65,27 @@ class ErrorPhonebook implements ModelInterface, ArrayAccess, \JsonSerializable * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -95,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 @@ -164,6 +229,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -180,7 +248,18 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['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; } /** @@ -225,10 +304,16 @@ public function getErrors() * * @param \Messente\Api\Model\ErrorItemPhonebook[] $errors An array of errors * - * @return self + * @return $this */ public function setErrors($errors) { + + + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); + } + $this->container['errors'] = $errors; return $this; @@ -250,18 +335,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -286,18 +371,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -310,16 +383,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/ErrorStatistics.php b/lib/Model/ErrorStatistics.php index dec3d64..f5c8840 100644 --- a/lib/Model/ErrorStatistics.php +++ b/lib/Model/ErrorStatistics.php @@ -2,7 +2,7 @@ /** * ErrorStatistics * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class ErrorStatistics implements ModelInterface, ArrayAccess, \JsonSerializable +class ErrorStatistics implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -68,13 +65,27 @@ class ErrorStatistics implements ModelInterface, ArrayAccess, \JsonSerializable * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -95,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 @@ -164,6 +229,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -180,7 +248,18 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['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; } /** @@ -225,10 +304,16 @@ public function getErrors() * * @param \Messente\Api\Model\ErrorItemStatistics[] $errors An array of errors * - * @return self + * @return $this */ public function setErrors($errors) { + + + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); + } + $this->container['errors'] = $errors; return $this; @@ -250,18 +335,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -286,18 +371,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -310,16 +383,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/ErrorTitleOmnichannel.php b/lib/Model/ErrorTitleOmnichannel.php index e5a0b6b..f4657c9 100644 --- a/lib/Model/ErrorTitleOmnichannel.php +++ b/lib/Model/ErrorTitleOmnichannel.php @@ -2,7 +2,7 @@ /** * ErrorTitleOmnichannel * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -45,19 +45,13 @@ class ErrorTitleOmnichannel * Possible values of this enum */ const NOT_FOUND = 'Not found'; - const FORBIDDEN = 'Forbidden'; - const UNAUTHORIZED = 'Unauthorized'; - const INVALID_DATA = 'Invalid data'; - const INTERNAL_SERVER_ERROR = 'Internal Server Error'; - const MISSING_DATA = 'Missing data'; - const METHOD_NOT_ALLOWED = 'Method not allowed'; - + /** * Gets allowable values of the enum * @return string[] @@ -71,7 +65,7 @@ public static function getAllowableEnumValues() self::INVALID_DATA, self::INTERNAL_SERVER_ERROR, self::MISSING_DATA, - self::METHOD_NOT_ALLOWED + self::METHOD_NOT_ALLOWED, ]; } } diff --git a/lib/Model/ErrorTitlePhonebook.php b/lib/Model/ErrorTitlePhonebook.php index 5fe8354..c2ca7b0 100644 --- a/lib/Model/ErrorTitlePhonebook.php +++ b/lib/Model/ErrorTitlePhonebook.php @@ -2,7 +2,7 @@ /** * ErrorTitlePhonebook * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -45,17 +45,12 @@ class ErrorTitlePhonebook * Possible values of this enum */ const INVALID_DATA = 'Invalid data'; - const UNAUTHORIZED = 'Unauthorized'; - const MISSING_RESOURCE = 'Missing resource'; - const CONFLICT = 'Conflict'; - const CLIENT_ERROR = 'Client error'; - const GENERAL_ERROR = 'General error'; - + /** * Gets allowable values of the enum * @return string[] @@ -68,7 +63,7 @@ public static function getAllowableEnumValues() self::MISSING_RESOURCE, self::CONFLICT, self::CLIENT_ERROR, - self::GENERAL_ERROR + self::GENERAL_ERROR, ]; } } diff --git a/lib/Model/FetchBlacklistSuccess.php b/lib/Model/FetchBlacklistSuccess.php index 55fe1a5..8d3179f 100644 --- a/lib/Model/FetchBlacklistSuccess.php +++ b/lib/Model/FetchBlacklistSuccess.php @@ -2,7 +2,7 @@ /** * FetchBlacklistSuccess * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class FetchBlacklistSuccess implements ModelInterface, ArrayAccess, \JsonSerializable +class FetchBlacklistSuccess implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -68,13 +65,27 @@ class FetchBlacklistSuccess implements ModelInterface, ArrayAccess, \JsonSeriali * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -95,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 @@ -164,6 +229,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -180,7 +248,18 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['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; } /** @@ -222,12 +301,16 @@ public function getPhoneNumbers() * * @param string[]|null $phoneNumbers Array of unique phone numbers * - * @return self + * @return $this */ public function setPhoneNumbers($phoneNumbers) { + if (is_null($phoneNumbers)) { + throw new \InvalidArgumentException('non-nullable phoneNumbers cannot be null'); + } + $this->container['phoneNumbers'] = $phoneNumbers; return $this; @@ -249,18 +332,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -285,18 +368,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -309,16 +380,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/GroupEnvelope.php b/lib/Model/GroupEnvelope.php index d2fd51c..1ce8f9d 100644 --- a/lib/Model/GroupEnvelope.php +++ b/lib/Model/GroupEnvelope.php @@ -2,7 +2,7 @@ /** * GroupEnvelope * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class GroupEnvelope implements ModelInterface, ArrayAccess, \JsonSerializable +class GroupEnvelope implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -68,13 +65,27 @@ class GroupEnvelope implements ModelInterface, ArrayAccess, \JsonSerializable * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -95,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 @@ -164,6 +229,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -180,7 +248,18 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['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; } /** @@ -222,10 +301,16 @@ public function getGroup() * * @param \Messente\Api\Model\GroupResponseFields|null $group group * - * @return self + * @return $this */ public function setGroup($group) { + + + if (is_null($group)) { + throw new \InvalidArgumentException('non-nullable group cannot be null'); + } + $this->container['group'] = $group; return $this; @@ -247,18 +332,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -283,18 +368,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -307,16 +380,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/GroupListEnvelope.php b/lib/Model/GroupListEnvelope.php index da5982b..f1f7e25 100644 --- a/lib/Model/GroupListEnvelope.php +++ b/lib/Model/GroupListEnvelope.php @@ -2,7 +2,7 @@ /** * GroupListEnvelope * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class GroupListEnvelope implements ModelInterface, ArrayAccess, \JsonSerializable +class GroupListEnvelope implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -68,13 +65,27 @@ class GroupListEnvelope implements ModelInterface, ArrayAccess, \JsonSerializabl * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -95,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 @@ -164,6 +229,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -180,7 +248,18 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['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; } /** @@ -222,12 +301,16 @@ public function getGroups() * * @param \Messente\Api\Model\GroupResponseFields[]|null $groups An array of groups * - * @return self + * @return $this */ public function setGroups($groups) { + if (is_null($groups)) { + throw new \InvalidArgumentException('non-nullable groups cannot be null'); + } + $this->container['groups'] = $groups; return $this; @@ -249,18 +332,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -285,18 +368,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -309,16 +380,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/GroupName.php b/lib/Model/GroupName.php index 5d6f31b..a7b9c41 100644 --- a/lib/Model/GroupName.php +++ b/lib/Model/GroupName.php @@ -2,7 +2,7 @@ /** * GroupName * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class GroupName implements ModelInterface, ArrayAccess, \JsonSerializable +class GroupName implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -68,13 +65,27 @@ class GroupName implements ModelInterface, ArrayAccess, \JsonSerializable * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -95,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 @@ -164,6 +229,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -180,7 +248,18 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['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; } /** @@ -229,7 +308,7 @@ public function getName() * * @param string $name The name of the group * - * @return self + * @return $this */ public function setName($name) { @@ -238,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; @@ -259,18 +344,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -295,18 +380,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -319,16 +392,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/GroupResponseFields.php b/lib/Model/GroupResponseFields.php index 8da8935..1b3781c 100644 --- a/lib/Model/GroupResponseFields.php +++ b/lib/Model/GroupResponseFields.php @@ -2,7 +2,7 @@ /** * GroupResponseFields * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class GroupResponseFields implements ModelInterface, ArrayAccess, \JsonSerializable +class GroupResponseFields implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -71,8 +68,6 @@ class GroupResponseFields implements ModelInterface, ArrayAccess, \JsonSerializa * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'id' => null, @@ -81,6 +76,25 @@ class GroupResponseFields implements ModelInterface, ArrayAccess, \JsonSerializa '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 * @@ -101,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 @@ -179,6 +247,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -195,10 +266,21 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['name'] = $data['name'] ?? null; - $this->container['createdOn'] = $data['createdOn'] ?? null; - $this->container['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; } /** @@ -249,10 +331,16 @@ public function getId() * * @param string $id Id string in UUID format * - * @return self + * @return $this */ public function setId($id) { + + + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; return $this; @@ -273,10 +361,16 @@ public function getName() * * @param string $name The name of the group * - * @return self + * @return $this */ public function setName($name) { + + + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; return $this; @@ -297,10 +391,23 @@ public function getCreatedOn() * * @param string|null $createdOn When the group was created * - * @return self + * @return $this */ 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; @@ -321,10 +428,16 @@ public function getContactsCount() * * @param int $contactsCount The count of contacts in the group * - * @return self + * @return $this */ public function setContactsCount($contactsCount) { + + + if (is_null($contactsCount)) { + throw new \InvalidArgumentException('non-nullable contactsCount cannot be null'); + } + $this->container['contactsCount'] = $contactsCount; return $this; @@ -346,18 +459,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -382,18 +495,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -406,16 +507,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/MessageResult.php b/lib/Model/MessageResult.php index 5955d04..0d70066 100644 --- a/lib/Model/MessageResult.php +++ b/lib/Model/MessageResult.php @@ -2,7 +2,7 @@ /** * MessageResult * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class MessageResult implements ModelInterface, ArrayAccess, \JsonSerializable +class MessageResult implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -70,8 +67,6 @@ class MessageResult implements ModelInterface, ArrayAccess, \JsonSerializable * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'messageId' => 'UUID', @@ -79,6 +74,24 @@ class MessageResult implements ModelInterface, ArrayAccess, \JsonSerializable '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 * @@ -99,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 @@ -174,6 +241,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -190,9 +260,20 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['messageId'] = $data['messageId'] ?? null; - $this->container['channel'] = $data['channel'] ?? null; - $this->container['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; } /** @@ -243,10 +324,16 @@ public function getMessageId() * * @param string $messageId Unique identifier for the message * - * @return self + * @return $this */ public function setMessageId($messageId) { + + + if (is_null($messageId)) { + throw new \InvalidArgumentException('non-nullable messageId cannot be null'); + } + $this->container['messageId'] = $messageId; return $this; @@ -267,10 +354,16 @@ public function getChannel() * * @param \Messente\Api\Model\Channel $channel channel * - * @return self + * @return $this */ public function setChannel($channel) { + + + if (is_null($channel)) { + throw new \InvalidArgumentException('non-nullable channel cannot be null'); + } + $this->container['channel'] = $channel; return $this; @@ -291,10 +384,16 @@ public function getSender() * * @param string $sender Sender that was used for the message * - * @return self + * @return $this */ public function setSender($sender) { + + + if (is_null($sender)) { + throw new \InvalidArgumentException('non-nullable sender cannot be null'); + } + $this->container['sender'] = $sender; return $this; @@ -316,18 +415,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -352,18 +451,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -376,16 +463,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/MobileNetwork.php b/lib/Model/MobileNetwork.php index 8309511..d43e621 100644 --- a/lib/Model/MobileNetwork.php +++ b/lib/Model/MobileNetwork.php @@ -2,7 +2,7 @@ /** * MobileNetwork * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class MobileNetwork implements ModelInterface, ArrayAccess, \JsonSerializable +class MobileNetwork implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -72,8 +69,6 @@ class MobileNetwork implements ModelInterface, ArrayAccess, \JsonSerializable * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'mccmnc' => null, @@ -83,6 +78,26 @@ class MobileNetwork implements ModelInterface, ArrayAccess, \JsonSerializable 'countryCode' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'mccmnc' => false, + 'networkName' => false, + 'countryName' => false, + 'countryPrefix' => false, + 'countryCode' => 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 * @@ -103,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 @@ -184,6 +253,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -200,11 +272,22 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['mccmnc'] = $data['mccmnc'] ?? null; - $this->container['networkName'] = $data['networkName'] ?? null; - $this->container['countryName'] = $data['countryName'] ?? null; - $this->container['countryPrefix'] = $data['countryPrefix'] ?? null; - $this->container['countryCode'] = $data['countryCode'] ?? null; + $this->setIfExists('mccmnc', $data, null); + $this->setIfExists('networkName', $data, null); + $this->setIfExists('countryName', $data, null); + $this->setIfExists('countryPrefix', $data, null); + $this->setIfExists('countryCode', $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; } /** @@ -246,10 +329,16 @@ public function getMccmnc() * * @param string|null $mccmnc Mobile country and mobile network code * - * @return self + * @return $this */ public function setMccmnc($mccmnc) { + + + if (is_null($mccmnc)) { + throw new \InvalidArgumentException('non-nullable mccmnc cannot be null'); + } + $this->container['mccmnc'] = $mccmnc; return $this; @@ -270,10 +359,16 @@ public function getNetworkName() * * @param string|null $networkName Mobile network name * - * @return self + * @return $this */ public function setNetworkName($networkName) { + + + if (is_null($networkName)) { + throw new \InvalidArgumentException('non-nullable networkName cannot be null'); + } + $this->container['networkName'] = $networkName; return $this; @@ -294,10 +389,16 @@ public function getCountryName() * * @param string|null $countryName Country name * - * @return self + * @return $this */ public function setCountryName($countryName) { + + + if (is_null($countryName)) { + throw new \InvalidArgumentException('non-nullable countryName cannot be null'); + } + $this->container['countryName'] = $countryName; return $this; @@ -318,10 +419,16 @@ public function getCountryPrefix() * * @param string|null $countryPrefix Country prefix * - * @return self + * @return $this */ public function setCountryPrefix($countryPrefix) { + + + if (is_null($countryPrefix)) { + throw new \InvalidArgumentException('non-nullable countryPrefix cannot be null'); + } + $this->container['countryPrefix'] = $countryPrefix; return $this; @@ -342,10 +449,16 @@ public function getCountryCode() * * @param string|null $countryCode Country code * - * @return self + * @return $this */ public function setCountryCode($countryCode) { + + + if (is_null($countryCode)) { + throw new \InvalidArgumentException('non-nullable countryCode cannot be null'); + } + $this->container['countryCode'] = $countryCode; return $this; @@ -367,18 +480,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -403,18 +516,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -427,16 +528,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/ModelInterface.php b/lib/Model/ModelInterface.php index 672465c..0256178 100644 --- a/lib/Model/ModelInterface.php +++ b/lib/Model/ModelInterface.php @@ -2,7 +2,7 @@ /** * ModelInterface * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api\Model @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** diff --git a/lib/Model/NumberToBlacklist.php b/lib/Model/NumberToBlacklist.php index 59d996c..59a4407 100644 --- a/lib/Model/NumberToBlacklist.php +++ b/lib/Model/NumberToBlacklist.php @@ -2,7 +2,7 @@ /** * NumberToBlacklist * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class NumberToBlacklist implements ModelInterface, ArrayAccess, \JsonSerializable +class NumberToBlacklist implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -68,13 +65,27 @@ class NumberToBlacklist implements ModelInterface, ArrayAccess, \JsonSerializabl * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -95,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 @@ -164,6 +229,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -180,7 +248,18 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['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; } /** @@ -225,10 +304,16 @@ public function getPhoneNumber() * * @param string $phoneNumber Phone number in e.164 format * - * @return self + * @return $this */ public function setPhoneNumber($phoneNumber) { + + + if (is_null($phoneNumber)) { + throw new \InvalidArgumentException('non-nullable phoneNumber cannot be null'); + } + $this->container['phoneNumber'] = $phoneNumber; return $this; @@ -250,18 +335,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -286,18 +371,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -310,16 +383,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/NumbersToInvestigate.php b/lib/Model/NumbersToInvestigate.php index 5f5b95c..99ffa81 100644 --- a/lib/Model/NumbersToInvestigate.php +++ b/lib/Model/NumbersToInvestigate.php @@ -2,7 +2,7 @@ /** * NumbersToInvestigate * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class NumbersToInvestigate implements ModelInterface, ArrayAccess, \JsonSerializable +class NumbersToInvestigate implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -68,13 +65,27 @@ class NumbersToInvestigate implements ModelInterface, ArrayAccess, \JsonSerializ * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'numbers' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'numbers' => 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 * @@ -95,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 @@ -164,6 +229,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -180,7 +248,18 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['numbers'] = $data['numbers'] ?? null; + $this->setIfExists('numbers', $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; } /** @@ -195,14 +274,6 @@ public function listInvalidProperties() if ($this->container['numbers'] === null) { $invalidProperties[] = "'numbers' can't be null"; } - if ((count($this->container['numbers']) > 10)) { - $invalidProperties[] = "invalid value for 'numbers', number of items must be less than or equal to 10."; - } - - if ((count($this->container['numbers']) < 1)) { - $invalidProperties[] = "invalid value for 'numbers', number of items must be greater than or equal to 1."; - } - return $invalidProperties; } @@ -231,19 +302,18 @@ public function getNumbers() /** * Sets numbers * - * @param string[] $numbers A list of phone numbers. Max 10 numbers per request + * @param string[] $numbers Array of phone numbers * - * @return self + * @return $this */ public function setNumbers($numbers) { - if ((count($numbers) > 10)) { - throw new \InvalidArgumentException('invalid value for $numbers when calling NumbersToInvestigate., number of items must be less than or equal to 10.'); - } - if ((count($numbers) < 1)) { - throw new \InvalidArgumentException('invalid length for $numbers when calling NumbersToInvestigate., number of items must be greater than or equal to 1.'); + + if (is_null($numbers)) { + throw new \InvalidArgumentException('non-nullable numbers cannot be null'); } + $this->container['numbers'] = $numbers; return $this; @@ -265,18 +335,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -301,18 +371,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -325,16 +383,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/OmniMessageCreateSuccessResponse.php b/lib/Model/OmniMessageCreateSuccessResponse.php index 387711d..c239991 100644 --- a/lib/Model/OmniMessageCreateSuccessResponse.php +++ b/lib/Model/OmniMessageCreateSuccessResponse.php @@ -2,7 +2,7 @@ /** * OmniMessageCreateSuccessResponse * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class OmniMessageCreateSuccessResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class OmniMessageCreateSuccessResponse implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -70,8 +67,6 @@ class OmniMessageCreateSuccessResponse implements ModelInterface, ArrayAccess, \ * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'messages' => null, @@ -79,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 * @@ -99,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 @@ -174,6 +241,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -190,9 +260,20 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['messages'] = $data['messages'] ?? null; - $this->container['to'] = $data['to'] ?? null; - $this->container['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; } /** @@ -243,10 +324,16 @@ public function getMessages() * * @param \Messente\Api\Model\MessageResult[] $messages List of messages that compose the omnimessage * - * @return self + * @return $this */ public function setMessages($messages) { + + + if (is_null($messages)) { + throw new \InvalidArgumentException('non-nullable messages cannot be null'); + } + $this->container['messages'] = $messages; return $this; @@ -267,10 +354,16 @@ public function getTo() * * @param string $to Phone number in e.164 format * - * @return self + * @return $this */ public function setTo($to) { + + + if (is_null($to)) { + throw new \InvalidArgumentException('non-nullable to cannot be null'); + } + $this->container['to'] = $to; return $this; @@ -291,10 +384,16 @@ public function getOmnimessageId() * * @param string $omnimessageId Unique identifier for the omnimessage * - * @return self + * @return $this */ public function setOmnimessageId($omnimessageId) { + + + if (is_null($omnimessageId)) { + throw new \InvalidArgumentException('non-nullable omnimessageId cannot be null'); + } + $this->container['omnimessageId'] = $omnimessageId; return $this; @@ -316,18 +415,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -352,18 +451,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -376,16 +463,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/Omnimessage.php b/lib/Model/Omnimessage.php index f312944..80a2b96 100644 --- a/lib/Model/Omnimessage.php +++ b/lib/Model/Omnimessage.php @@ -2,7 +2,7 @@ /** * Omnimessage * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class Omnimessage implements ModelInterface, ArrayAccess, \JsonSerializable +class Omnimessage implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -73,8 +70,6 @@ class Omnimessage implements ModelInterface, ArrayAccess, \JsonSerializable * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'to' => null, @@ -85,6 +80,27 @@ class Omnimessage implements ModelInterface, ArrayAccess, \JsonSerializable 'priority' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'to' => false, + 'messages' => false, + 'dlrUrl' => false, + 'textStore' => false, + 'timeToSend' => false, + 'priority' => 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 * @@ -105,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 @@ -189,6 +259,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -205,12 +278,23 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['to'] = $data['to'] ?? null; - $this->container['messages'] = $data['messages'] ?? null; - $this->container['dlrUrl'] = $data['dlrUrl'] ?? null; - $this->container['textStore'] = $data['textStore'] ?? null; - $this->container['timeToSend'] = $data['timeToSend'] ?? null; - $this->container['priority'] = $data['priority'] ?? 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); + $this->setIfExists('priority', $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; } /** @@ -258,10 +342,16 @@ public function getTo() * * @param string $to Phone number in e.164 format * - * @return self + * @return $this */ public function setTo($to) { + + + if (is_null($to)) { + throw new \InvalidArgumentException('non-nullable to cannot be null'); + } + $this->container['to'] = $to; return $this; @@ -282,10 +372,16 @@ public function getMessages() * * @param OneOfViberSMSWhatsAppTelegram[] $messages An array of messages * - * @return self + * @return $this */ public function setMessages($messages) { + + + if (is_null($messages)) { + throw new \InvalidArgumentException('non-nullable messages cannot be null'); + } + $this->container['messages'] = $messages; return $this; @@ -306,10 +402,16 @@ public function getDlrUrl() * * @param string|null $dlrUrl URL where the delivery report will be sent * - * @return self + * @return $this */ public function setDlrUrl($dlrUrl) { + + + if (is_null($dlrUrl)) { + throw new \InvalidArgumentException('non-nullable dlrUrl cannot be null'); + } + $this->container['dlrUrl'] = $dlrUrl; return $this; @@ -330,10 +432,16 @@ public function getTextStore() * * @param \Messente\Api\Model\TextStore|null $textStore textStore * - * @return self + * @return $this */ public function setTextStore($textStore) { + + + if (is_null($textStore)) { + throw new \InvalidArgumentException('non-nullable textStore cannot be null'); + } + $this->container['textStore'] = $textStore; return $this; @@ -354,10 +462,16 @@ public function getTimeToSend() * * @param \DateTime|null $timeToSend Optional parameter for sending messages at some specific time in the future. Time must be specified in the ISO-8601 format. If no timezone is specified, then the timezone is assumed to be UTC Examples: * Time specified with timezone: 2018-06-22T09:05:07+00:00 Time specified in UTC: 2018-06-22T09:05:07Z * Time specified without timezone: 2018-06-22T09:05 (equivalent to 2018-06-22T09:05+00:00) * - * @return self + * @return $this */ public function setTimeToSend($timeToSend) { + + + if (is_null($timeToSend)) { + throw new \InvalidArgumentException('non-nullable timeToSend cannot be null'); + } + $this->container['timeToSend'] = $timeToSend; return $this; @@ -378,10 +492,16 @@ public function getPriority() * * @param \Messente\Api\Model\Priority|null $priority priority * - * @return self + * @return $this */ public function setPriority($priority) { + + + if (is_null($priority)) { + throw new \InvalidArgumentException('non-nullable priority cannot be null'); + } + $this->container['priority'] = $priority; return $this; @@ -403,18 +523,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -439,18 +559,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -463,16 +571,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/Priority.php b/lib/Model/Priority.php index 609f6b5..9d2746d 100644 --- a/lib/Model/Priority.php +++ b/lib/Model/Priority.php @@ -2,7 +2,7 @@ /** * Priority * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -45,11 +45,9 @@ class Priority * Possible values of this enum */ const LOW = 'low'; - const REGULAR = 'regular'; - const HIGH = 'high'; - + /** * Gets allowable values of the enum * @return string[] @@ -59,7 +57,7 @@ public static function getAllowableEnumValues() return [ self::LOW, self::REGULAR, - self::HIGH + self::HIGH, ]; } } diff --git a/lib/Model/SMS.php b/lib/Model/SMS.php index 7f3c04d..69317d0 100644 --- a/lib/Model/SMS.php +++ b/lib/Model/SMS.php @@ -2,7 +2,7 @@ /** * SMS * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class SMS implements ModelInterface, ArrayAccess, \JsonSerializable +class SMS implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -73,8 +70,6 @@ class SMS implements ModelInterface, ArrayAccess, \JsonSerializable * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'text' => null, @@ -85,6 +80,27 @@ class SMS implements ModelInterface, ArrayAccess, \JsonSerializable '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 * @@ -105,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 @@ -193,7 +263,9 @@ public function getModelName() const AUTOCONVERT_ON = 'on'; const AUTOCONVERT_OFF = 'off'; const CHANNEL_SMS = 'sms'; + + /** * Gets allowable values of the enum * @@ -207,7 +279,7 @@ public function getAutoconvertAllowableValues() self::AUTOCONVERT_OFF, ]; } - + /** * Gets allowable values of the enum * @@ -219,6 +291,7 @@ public function getChannelAllowableValues() self::CHANNEL_SMS, ]; } + /** * Associative array for storing property values @@ -235,12 +308,23 @@ public function getChannelAllowableValues() */ public function __construct(array $data = null) { - $this->container['text'] = $data['text'] ?? null; - $this->container['sender'] = $data['sender'] ?? null; - $this->container['validity'] = $data['validity'] ?? null; - $this->container['autoconvert'] = $data['autoconvert'] ?? null; - $this->container['udh'] = $data['udh'] ?? null; - $this->container['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; } /** @@ -258,8 +342,7 @@ public function listInvalidProperties() $allowedValues = $this->getAutoconvertAllowableValues(); if (!is_null($this->container['autoconvert']) && !in_array($this->container['autoconvert'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value '%s' for 'autoconvert', must be one of '%s'", - $this->container['autoconvert'], + "invalid value for 'autoconvert', must be one of '%s'", implode("', '", $allowedValues) ); } @@ -267,8 +350,7 @@ public function listInvalidProperties() $allowedValues = $this->getChannelAllowableValues(); if (!is_null($this->container['channel']) && !in_array($this->container['channel'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value '%s' for 'channel', must be one of '%s'", - $this->container['channel'], + "invalid value for 'channel', must be one of '%s'", implode("', '", $allowedValues) ); } @@ -303,10 +385,16 @@ public function getText() * * @param string $text Text content of the SMS * - * @return self + * @return $this */ public function setText($text) { + + + if (is_null($text)) { + throw new \InvalidArgumentException('non-nullable text cannot be null'); + } + $this->container['text'] = $text; return $this; @@ -327,10 +415,16 @@ public function getSender() * * @param string|null $sender Phone number or alphanumeric sender name * - * @return self + * @return $this */ public function setSender($sender) { + + + if (is_null($sender)) { + throw new \InvalidArgumentException('non-nullable sender cannot be null'); + } + $this->container['sender'] = $sender; return $this; @@ -351,10 +445,16 @@ public function getValidity() * * @param int|null $validity After how many minutes this channel is considered as failed and the next channel is attempted * - * @return self + * @return $this */ public function setValidity($validity) { + + + if (is_null($validity)) { + throw new \InvalidArgumentException('non-nullable validity cannot be null'); + } + $this->container['validity'] = $validity; return $this; @@ -375,7 +475,7 @@ public function getAutoconvert() * * @param string|null $autoconvert Defines how non-GSM characters will be treated: - \"on\" Use replacement settings from the account's [API Auto Replace settings page](https://dashboard.messente.com/api-settings/auto-replace) (default) - \"full\" All non GSM 03.38 characters will be replaced with suitable alternatives - \"off\" Message content is not modified in any way * - * @return self + * @return $this */ public function setAutoconvert($autoconvert) { @@ -383,12 +483,17 @@ public function setAutoconvert($autoconvert) if (!is_null($autoconvert) && !in_array($autoconvert, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value '%s' for 'autoconvert', must be one of '%s'", - $autoconvert, + "Invalid value for 'autoconvert', must be one of '%s'", implode("', '", $allowedValues) ) ); } + + + if (is_null($autoconvert)) { + throw new \InvalidArgumentException('non-nullable autoconvert cannot be null'); + } + $this->container['autoconvert'] = $autoconvert; return $this; @@ -409,10 +514,16 @@ public function getUdh() * * @param string|null $udh hex-encoded string containing SMS UDH * - * @return self + * @return $this */ public function setUdh($udh) { + + + if (is_null($udh)) { + throw new \InvalidArgumentException('non-nullable udh cannot be null'); + } + $this->container['udh'] = $udh; return $this; @@ -433,7 +544,7 @@ public function getChannel() * * @param string|null $channel The channel used to deliver the message * - * @return self + * @return $this */ public function setChannel($channel) { @@ -441,12 +552,17 @@ public function setChannel($channel) if (!is_null($channel) && !in_array($channel, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value '%s' for 'channel', must be one of '%s'", - $channel, + "Invalid value for 'channel', must be one of '%s'", implode("', '", $allowedValues) ) ); } + + + if (is_null($channel)) { + throw new \InvalidArgumentException('non-nullable channel cannot be null'); + } + $this->container['channel'] = $channel; return $this; @@ -468,18 +584,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -504,18 +620,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -528,16 +632,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/StatisticsReport.php b/lib/Model/StatisticsReport.php index 3e7d658..53309e5 100644 --- a/lib/Model/StatisticsReport.php +++ b/lib/Model/StatisticsReport.php @@ -2,7 +2,7 @@ /** * StatisticsReport * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class StatisticsReport implements ModelInterface, ArrayAccess, \JsonSerializable +class StatisticsReport implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -70,8 +67,6 @@ class StatisticsReport implements ModelInterface, ArrayAccess, \JsonSerializable * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'totalMessages' => null, @@ -79,6 +74,24 @@ class StatisticsReport implements ModelInterface, ArrayAccess, \JsonSerializable 'country' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'totalMessages' => false, + 'totalPrice' => false, + 'country' => 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 * @@ -99,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 @@ -174,6 +241,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -190,9 +260,20 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['totalMessages'] = $data['totalMessages'] ?? null; - $this->container['totalPrice'] = $data['totalPrice'] ?? null; - $this->container['country'] = $data['country'] ?? null; + $this->setIfExists('totalMessages', $data, null); + $this->setIfExists('totalPrice', $data, null); + $this->setIfExists('country', $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; } /** @@ -243,10 +324,16 @@ public function getTotalMessages() * * @param int $totalMessages Sum of all messages * - * @return self + * @return $this */ public function setTotalMessages($totalMessages) { + + + if (is_null($totalMessages)) { + throw new \InvalidArgumentException('non-nullable totalMessages cannot be null'); + } + $this->container['totalMessages'] = $totalMessages; return $this; @@ -267,10 +354,16 @@ public function getTotalPrice() * * @param string $totalPrice Price for all messages * - * @return self + * @return $this */ public function setTotalPrice($totalPrice) { + + + if (is_null($totalPrice)) { + throw new \InvalidArgumentException('non-nullable totalPrice cannot be null'); + } + $this->container['totalPrice'] = $totalPrice; return $this; @@ -291,10 +384,16 @@ public function getCountry() * * @param string $country Target country of all messages * - * @return self + * @return $this */ public function setCountry($country) { + + + if (is_null($country)) { + throw new \InvalidArgumentException('non-nullable country cannot be null'); + } + $this->container['country'] = $country; return $this; @@ -316,18 +415,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -352,18 +451,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -376,16 +463,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/StatisticsReportSettings.php b/lib/Model/StatisticsReportSettings.php index 74991c1..6ea852e 100644 --- a/lib/Model/StatisticsReportSettings.php +++ b/lib/Model/StatisticsReportSettings.php @@ -2,7 +2,7 @@ /** * StatisticsReportSettings * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class StatisticsReportSettings implements ModelInterface, ArrayAccess, \JsonSerializable +class StatisticsReportSettings implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -70,8 +67,6 @@ class StatisticsReportSettings implements ModelInterface, ArrayAccess, \JsonSeri * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'startDate' => 'date', @@ -79,6 +74,24 @@ class StatisticsReportSettings implements ModelInterface, ArrayAccess, \JsonSeri 'messageTypes' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'startDate' => false, + 'endDate' => false, + 'messageTypes' => 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 * @@ -99,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 @@ -174,6 +241,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -190,9 +260,20 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['startDate'] = $data['startDate'] ?? null; - $this->container['endDate'] = $data['endDate'] ?? null; - $this->container['messageTypes'] = $data['messageTypes'] ?? null; + $this->setIfExists('startDate', $data, null); + $this->setIfExists('endDate', $data, null); + $this->setIfExists('messageTypes', $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; } /** @@ -240,10 +321,16 @@ public function getStartDate() * * @param \DateTime $startDate Start date for the report * - * @return self + * @return $this */ public function setStartDate($startDate) { + + + if (is_null($startDate)) { + throw new \InvalidArgumentException('non-nullable startDate cannot be null'); + } + $this->container['startDate'] = $startDate; return $this; @@ -264,10 +351,16 @@ public function getEndDate() * * @param \DateTime $endDate End date for the report * - * @return self + * @return $this */ public function setEndDate($endDate) { + + + if (is_null($endDate)) { + throw new \InvalidArgumentException('non-nullable endDate cannot be null'); + } + $this->container['endDate'] = $endDate; return $this; @@ -288,10 +381,16 @@ public function getMessageTypes() * * @param string[]|null $messageTypes Optional list of message types (sms, viber, whatsapp, hlr, telegram) * - * @return self + * @return $this */ public function setMessageTypes($messageTypes) { + + + if (is_null($messageTypes)) { + throw new \InvalidArgumentException('non-nullable messageTypes cannot be null'); + } + $this->container['messageTypes'] = $messageTypes; return $this; @@ -313,18 +412,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -349,18 +448,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -373,16 +460,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/StatisticsReportSuccess.php b/lib/Model/StatisticsReportSuccess.php index 0178992..ebbd74f 100644 --- a/lib/Model/StatisticsReportSuccess.php +++ b/lib/Model/StatisticsReportSuccess.php @@ -2,7 +2,7 @@ /** * StatisticsReportSuccess * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class StatisticsReportSuccess implements ModelInterface, ArrayAccess, \JsonSerializable +class StatisticsReportSuccess implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -68,13 +65,27 @@ class StatisticsReportSuccess implements ModelInterface, ArrayAccess, \JsonSeria * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'reports' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'reports' => 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 * @@ -95,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 @@ -164,6 +229,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -180,7 +248,18 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['reports'] = $data['reports'] ?? null; + $this->setIfExists('reports', $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; } /** @@ -225,10 +304,16 @@ public function getReports() * * @param \Messente\Api\Model\StatisticsReport[] $reports Array of report objects * - * @return self + * @return $this */ public function setReports($reports) { + + + if (is_null($reports)) { + throw new \InvalidArgumentException('non-nullable reports cannot be null'); + } + $this->container['reports'] = $reports; return $this; @@ -250,18 +335,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -286,18 +371,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -310,16 +383,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/Status.php b/lib/Model/Status.php index dcfbfeb..854c153 100644 --- a/lib/Model/Status.php +++ b/lib/Model/Status.php @@ -2,7 +2,7 @@ /** * Status * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -45,27 +45,17 @@ class Status * Possible values of this enum */ const ACK = 'ACK'; - const DELIVRD = 'DELIVRD'; - const UNDELIV = 'UNDELIV'; - const FAILED = 'FAILED'; - const UNKNOWN = 'UNKNOWN'; - const ACCEPTD = 'ACCEPTD'; - const REJECTD = 'REJECTD'; - const DELETED = 'DELETED'; - const EXPIRED = 'EXPIRED'; - const NACK = 'NACK'; - const SEEN = 'SEEN'; - + /** * Gets allowable values of the enum * @return string[] @@ -83,7 +73,7 @@ public static function getAllowableEnumValues() self::DELETED, self::EXPIRED, self::NACK, - self::SEEN + self::SEEN, ]; } } diff --git a/lib/Model/SyncNumberLookupResult.php b/lib/Model/SyncNumberLookupResult.php index 15f25c9..9d04da1 100644 --- a/lib/Model/SyncNumberLookupResult.php +++ b/lib/Model/SyncNumberLookupResult.php @@ -2,7 +2,7 @@ /** * SyncNumberLookupResult * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class SyncNumberLookupResult implements ModelInterface, ArrayAccess, \JsonSerializable +class SyncNumberLookupResult implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -69,15 +66,13 @@ class SyncNumberLookupResult implements ModelInterface, ArrayAccess, \JsonSerial 'originalNetwork' => '\Messente\Api\Model\MobileNetwork', 'portedNetwork' => '\Messente\Api\Model\MobileNetwork', 'status' => 'string', - 'error' => 'mixed' + 'error' => 'object' ]; /** * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'number' => null, @@ -91,6 +86,30 @@ class SyncNumberLookupResult implements ModelInterface, ArrayAccess, \JsonSerial 'error' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'number' => false, + 'roaming' => true, + 'ported' => true, + 'roamingNetwork' => true, + 'currentNetwork' => true, + 'originalNetwork' => true, + 'portedNetwork' => true, + 'status' => false, + 'error' => 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 * @@ -111,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 @@ -208,7 +281,9 @@ public function getModelName() const STATUS_OFF = 'OFF'; const STATUS_INVALID = 'INVALID'; const STATUS_UNKNOWN = 'UNKNOWN'; + + /** * Gets allowable values of the enum * @@ -223,6 +298,7 @@ public function getStatusAllowableValues() self::STATUS_UNKNOWN, ]; } + /** * Associative array for storing property values @@ -239,15 +315,26 @@ public function getStatusAllowableValues() */ public function __construct(array $data = null) { - $this->container['number'] = $data['number'] ?? null; - $this->container['roaming'] = $data['roaming'] ?? null; - $this->container['ported'] = $data['ported'] ?? null; - $this->container['roamingNetwork'] = $data['roamingNetwork'] ?? null; - $this->container['currentNetwork'] = $data['currentNetwork'] ?? null; - $this->container['originalNetwork'] = $data['originalNetwork'] ?? null; - $this->container['portedNetwork'] = $data['portedNetwork'] ?? null; - $this->container['status'] = $data['status'] ?? null; - $this->container['error'] = $data['error'] ?? null; + $this->setIfExists('number', $data, null); + $this->setIfExists('roaming', $data, null); + $this->setIfExists('ported', $data, null); + $this->setIfExists('roamingNetwork', $data, null); + $this->setIfExists('currentNetwork', $data, null); + $this->setIfExists('originalNetwork', $data, null); + $this->setIfExists('portedNetwork', $data, null); + $this->setIfExists('status', $data, null); + $this->setIfExists('error', $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; } /** @@ -265,8 +352,7 @@ public function listInvalidProperties() $allowedValues = $this->getStatusAllowableValues(); if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value '%s' for 'status', must be one of '%s'", - $this->container['status'], + "invalid value for 'status', must be one of '%s'", implode("', '", $allowedValues) ); } @@ -301,10 +387,16 @@ public function getNumber() * * @param string $number Phone number in e.164 format * - * @return self + * @return $this */ public function setNumber($number) { + + + if (is_null($number)) { + throw new \InvalidArgumentException('non-nullable number cannot be null'); + } + $this->container['number'] = $number; return $this; @@ -325,10 +417,23 @@ public function getRoaming() * * @param bool|null $roaming Indicates if a number is roaming * - * @return self + * @return $this */ public function setRoaming($roaming) { + + if (is_null($roaming)) { + array_push($this->openAPINullablesSetToNull, 'roaming'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('roaming', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['roaming'] = $roaming; return $this; @@ -349,10 +454,23 @@ public function getPorted() * * @param bool|null $ported Indicates if a number is ported * - * @return self + * @return $this */ public function setPorted($ported) { + + if (is_null($ported)) { + array_push($this->openAPINullablesSetToNull, 'ported'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('ported', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['ported'] = $ported; return $this; @@ -373,10 +491,23 @@ public function getRoamingNetwork() * * @param \Messente\Api\Model\MobileNetwork|null $roamingNetwork roamingNetwork * - * @return self + * @return $this */ public function setRoamingNetwork($roamingNetwork) { + + if (is_null($roamingNetwork)) { + array_push($this->openAPINullablesSetToNull, 'roamingNetwork'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('roamingNetwork', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['roamingNetwork'] = $roamingNetwork; return $this; @@ -397,10 +528,23 @@ public function getCurrentNetwork() * * @param \Messente\Api\Model\MobileNetwork|null $currentNetwork currentNetwork * - * @return self + * @return $this */ public function setCurrentNetwork($currentNetwork) { + + if (is_null($currentNetwork)) { + array_push($this->openAPINullablesSetToNull, 'currentNetwork'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('currentNetwork', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['currentNetwork'] = $currentNetwork; return $this; @@ -421,10 +565,23 @@ public function getOriginalNetwork() * * @param \Messente\Api\Model\MobileNetwork|null $originalNetwork originalNetwork * - * @return self + * @return $this */ public function setOriginalNetwork($originalNetwork) { + + if (is_null($originalNetwork)) { + array_push($this->openAPINullablesSetToNull, 'originalNetwork'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('originalNetwork', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['originalNetwork'] = $originalNetwork; return $this; @@ -445,10 +602,23 @@ public function getPortedNetwork() * * @param \Messente\Api\Model\MobileNetwork|null $portedNetwork portedNetwork * - * @return self + * @return $this */ public function setPortedNetwork($portedNetwork) { + + if (is_null($portedNetwork)) { + array_push($this->openAPINullablesSetToNull, 'portedNetwork'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('portedNetwork', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['portedNetwork'] = $portedNetwork; return $this; @@ -469,7 +639,7 @@ public function getStatus() * * @param string|null $status Status of the phone number * - * @return self + * @return $this */ public function setStatus($status) { @@ -477,12 +647,17 @@ public function setStatus($status) if (!is_null($status) && !in_array($status, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value '%s' for 'status', must be one of '%s'", - $status, + "Invalid value for 'status', must be one of '%s'", implode("', '", $allowedValues) ) ); } + + + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; return $this; @@ -491,7 +666,7 @@ public function setStatus($status) /** * Gets error * - * @return mixed|null + * @return object|null */ public function getError() { @@ -501,12 +676,18 @@ public function getError() /** * Sets error * - * @param mixed|null $error Indicates if any error occurred while handling the request + * @param object|null $error Indicates if any error occurred while handling the request * - * @return self + * @return $this */ public function setError($error) { + + + if (is_null($error)) { + throw new \InvalidArgumentException('non-nullable error cannot be null'); + } + $this->container['error'] = $error; return $this; @@ -528,18 +709,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -564,18 +745,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -588,16 +757,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/SyncNumberLookupSuccess.php b/lib/Model/SyncNumberLookupSuccess.php index c00b889..f6b90bc 100644 --- a/lib/Model/SyncNumberLookupSuccess.php +++ b/lib/Model/SyncNumberLookupSuccess.php @@ -2,7 +2,7 @@ /** * SyncNumberLookupSuccess * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class SyncNumberLookupSuccess implements ModelInterface, ArrayAccess, \JsonSerializable +class SyncNumberLookupSuccess implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -69,14 +66,29 @@ class SyncNumberLookupSuccess implements ModelInterface, ArrayAccess, \JsonSeria * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'requestId' => null, 'result' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'requestId' => false, + 'result' => 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 * @@ -97,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 @@ -169,6 +235,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -185,8 +254,19 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['requestId'] = $data['requestId'] ?? null; - $this->container['result'] = $data['result'] ?? null; + $this->setIfExists('requestId', $data, null); + $this->setIfExists('result', $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; } /** @@ -234,10 +314,16 @@ public function getRequestId() * * @param string $requestId ID of the request * - * @return self + * @return $this */ public function setRequestId($requestId) { + + + if (is_null($requestId)) { + throw new \InvalidArgumentException('non-nullable requestId cannot be null'); + } + $this->container['requestId'] = $requestId; return $this; @@ -258,10 +344,16 @@ public function getResult() * * @param \Messente\Api\Model\SyncNumberLookupResult[] $result A container for phone number info objects * - * @return self + * @return $this */ public function setResult($result) { + + + if (is_null($result)) { + throw new \InvalidArgumentException('non-nullable result cannot be null'); + } + $this->container['result'] = $result; return $this; @@ -283,18 +375,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -319,18 +411,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -343,16 +423,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/Telegram.php b/lib/Model/Telegram.php index f033906..47fee59 100644 --- a/lib/Model/Telegram.php +++ b/lib/Model/Telegram.php @@ -2,7 +2,7 @@ /** * Telegram * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class Telegram implements ModelInterface, ArrayAccess, \JsonSerializable +class Telegram implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -74,8 +71,6 @@ class Telegram implements ModelInterface, ArrayAccess, \JsonSerializable * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'sender' => null, @@ -87,6 +82,28 @@ class Telegram implements ModelInterface, ArrayAccess, \JsonSerializable 'channel' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'sender' => false, + 'validity' => false, + 'text' => false, + 'imageUrl' => false, + 'documentUrl' => false, + 'audioUrl' => 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 * @@ -107,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 @@ -195,7 +266,9 @@ public function getModelName() } const CHANNEL_TELEGRAM = 'telegram'; + + /** * Gets allowable values of the enum * @@ -207,6 +280,7 @@ public function getChannelAllowableValues() self::CHANNEL_TELEGRAM, ]; } + /** * Associative array for storing property values @@ -223,13 +297,24 @@ public function getChannelAllowableValues() */ public function __construct(array $data = null) { - $this->container['sender'] = $data['sender'] ?? null; - $this->container['validity'] = $data['validity'] ?? null; - $this->container['text'] = $data['text'] ?? null; - $this->container['imageUrl'] = $data['imageUrl'] ?? null; - $this->container['documentUrl'] = $data['documentUrl'] ?? null; - $this->container['audioUrl'] = $data['audioUrl'] ?? null; - $this->container['channel'] = $data['channel'] ?? 'telegram'; + $this->setIfExists('sender', $data, null); + $this->setIfExists('validity', $data, null); + $this->setIfExists('text', $data, null); + $this->setIfExists('imageUrl', $data, null); + $this->setIfExists('documentUrl', $data, null); + $this->setIfExists('audioUrl', $data, null); + $this->setIfExists('channel', $data, 'telegram'); + } + + 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; } /** @@ -244,8 +329,7 @@ public function listInvalidProperties() $allowedValues = $this->getChannelAllowableValues(); if (!is_null($this->container['channel']) && !in_array($this->container['channel'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value '%s' for 'channel', must be one of '%s'", - $this->container['channel'], + "invalid value for 'channel', must be one of '%s'", implode("', '", $allowedValues) ); } @@ -280,10 +364,16 @@ public function getSender() * * @param string|null $sender Phone number or alphanumeric sender name * - * @return self + * @return $this */ public function setSender($sender) { + + + if (is_null($sender)) { + throw new \InvalidArgumentException('non-nullable sender cannot be null'); + } + $this->container['sender'] = $sender; return $this; @@ -304,10 +394,16 @@ public function getValidity() * * @param int|null $validity After how many minutes this channel is considered as failed and the next channel is attempted * - * @return self + * @return $this */ public function setValidity($validity) { + + + if (is_null($validity)) { + throw new \InvalidArgumentException('non-nullable validity cannot be null'); + } + $this->container['validity'] = $validity; return $this; @@ -328,10 +424,16 @@ public function getText() * * @param string|null $text Plaintext content for Telegram * - * @return self + * @return $this */ public function setText($text) { + + + if (is_null($text)) { + throw new \InvalidArgumentException('non-nullable text cannot be null'); + } + $this->container['text'] = $text; return $this; @@ -352,10 +454,16 @@ public function getImageUrl() * * @param string|null $imageUrl URL for the embedded image. Mutually exclusive with \"document_url\" and \"audio_url\" * - * @return self + * @return $this */ public function setImageUrl($imageUrl) { + + + if (is_null($imageUrl)) { + throw new \InvalidArgumentException('non-nullable imageUrl cannot be null'); + } + $this->container['imageUrl'] = $imageUrl; return $this; @@ -376,10 +484,16 @@ public function getDocumentUrl() * * @param string|null $documentUrl URL for the embedded image. Mutually exclusive with \"audio_url\" and \"image_url\" * - * @return self + * @return $this */ public function setDocumentUrl($documentUrl) { + + + if (is_null($documentUrl)) { + throw new \InvalidArgumentException('non-nullable documentUrl cannot be null'); + } + $this->container['documentUrl'] = $documentUrl; return $this; @@ -400,10 +514,16 @@ public function getAudioUrl() * * @param string|null $audioUrl URL for the embedded image. Mutually exclusive with \"document_url\" and \"image_url\" * - * @return self + * @return $this */ public function setAudioUrl($audioUrl) { + + + if (is_null($audioUrl)) { + throw new \InvalidArgumentException('non-nullable audioUrl cannot be null'); + } + $this->container['audioUrl'] = $audioUrl; return $this; @@ -424,7 +544,7 @@ public function getChannel() * * @param string|null $channel The channel used to deliver the message * - * @return self + * @return $this */ public function setChannel($channel) { @@ -432,12 +552,17 @@ public function setChannel($channel) if (!is_null($channel) && !in_array($channel, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value '%s' for 'channel', must be one of '%s'", - $channel, + "Invalid value for 'channel', must be one of '%s'", implode("', '", $allowedValues) ) ); } + + + if (is_null($channel)) { + throw new \InvalidArgumentException('non-nullable channel cannot be null'); + } + $this->container['channel'] = $channel; return $this; @@ -459,18 +584,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -495,18 +620,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -519,16 +632,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/TextStore.php b/lib/Model/TextStore.php index e06dd53..dfd65c8 100644 --- a/lib/Model/TextStore.php +++ b/lib/Model/TextStore.php @@ -2,7 +2,7 @@ /** * TextStore * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -45,11 +45,9 @@ class TextStore * Possible values of this enum */ const NOSTORE = 'nostore'; - const PLAINTEXT = 'plaintext'; - const SHA256 = 'sha256'; - + /** * Gets allowable values of the enum * @return string[] @@ -59,7 +57,7 @@ public static function getAllowableEnumValues() return [ self::NOSTORE, self::PLAINTEXT, - self::SHA256 + self::SHA256, ]; } } diff --git a/lib/Model/Viber.php b/lib/Model/Viber.php index e4ac2d9..d61af74 100644 --- a/lib/Model/Viber.php +++ b/lib/Model/Viber.php @@ -2,7 +2,7 @@ /** * Viber * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class Viber implements ModelInterface, ArrayAccess, \JsonSerializable +class Viber implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -74,8 +71,6 @@ class Viber implements ModelInterface, ArrayAccess, \JsonSerializable * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'sender' => null, @@ -87,6 +82,28 @@ class Viber implements ModelInterface, ArrayAccess, \JsonSerializable '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 * @@ -107,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 @@ -195,7 +266,9 @@ public function getModelName() } const CHANNEL_VIBER = 'viber'; + + /** * Gets allowable values of the enum * @@ -207,6 +280,7 @@ public function getChannelAllowableValues() self::CHANNEL_VIBER, ]; } + /** * Associative array for storing property values @@ -223,13 +297,24 @@ public function getChannelAllowableValues() */ public function __construct(array $data = null) { - $this->container['sender'] = $data['sender'] ?? null; - $this->container['validity'] = $data['validity'] ?? null; - $this->container['text'] = $data['text'] ?? null; - $this->container['imageUrl'] = $data['imageUrl'] ?? null; - $this->container['buttonUrl'] = $data['buttonUrl'] ?? null; - $this->container['buttonText'] = $data['buttonText'] ?? null; - $this->container['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; } /** @@ -244,8 +329,7 @@ public function listInvalidProperties() $allowedValues = $this->getChannelAllowableValues(); if (!is_null($this->container['channel']) && !in_array($this->container['channel'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value '%s' for 'channel', must be one of '%s'", - $this->container['channel'], + "invalid value for 'channel', must be one of '%s'", implode("', '", $allowedValues) ); } @@ -280,10 +364,16 @@ public function getSender() * * @param string|null $sender Phone number or alphanumeric sender name * - * @return self + * @return $this */ public function setSender($sender) { + + + if (is_null($sender)) { + throw new \InvalidArgumentException('non-nullable sender cannot be null'); + } + $this->container['sender'] = $sender; return $this; @@ -304,10 +394,16 @@ public function getValidity() * * @param int|null $validity After how many minutes this channel is considered as failed and the next channel is attempted * - * @return self + * @return $this */ public function setValidity($validity) { + + + if (is_null($validity)) { + throw new \InvalidArgumentException('non-nullable validity cannot be null'); + } + $this->container['validity'] = $validity; return $this; @@ -328,10 +424,16 @@ public function getText() * * @param string|null $text Plaintext content for Viber * - * @return self + * @return $this */ public function setText($text) { + + + if (is_null($text)) { + throw new \InvalidArgumentException('non-nullable text cannot be null'); + } + $this->container['text'] = $text; return $this; @@ -352,10 +454,16 @@ public function getImageUrl() * * @param string|null $imageUrl URL for the embedded image Valid combinations: 1) image_url, 2) text, image_url, button_url, button_text * - * @return self + * @return $this */ public function setImageUrl($imageUrl) { + + + if (is_null($imageUrl)) { + throw new \InvalidArgumentException('non-nullable imageUrl cannot be null'); + } + $this->container['imageUrl'] = $imageUrl; return $this; @@ -376,10 +484,16 @@ public function getButtonUrl() * * @param string|null $buttonUrl URL of the button, must be specified along with ''text'', ''button_text'' and ''image_url'' (optional) * - * @return self + * @return $this */ public function setButtonUrl($buttonUrl) { + + + if (is_null($buttonUrl)) { + throw new \InvalidArgumentException('non-nullable buttonUrl cannot be null'); + } + $this->container['buttonUrl'] = $buttonUrl; return $this; @@ -400,10 +514,16 @@ public function getButtonText() * * @param string|null $buttonText Must be specified along with ''text'', ''button_url'', ''button_text'', ''image_url'' (optional) * - * @return self + * @return $this */ public function setButtonText($buttonText) { + + + if (is_null($buttonText)) { + throw new \InvalidArgumentException('non-nullable buttonText cannot be null'); + } + $this->container['buttonText'] = $buttonText; return $this; @@ -424,7 +544,7 @@ public function getChannel() * * @param string|null $channel The channel used to deliver the message * - * @return self + * @return $this */ public function setChannel($channel) { @@ -432,12 +552,17 @@ public function setChannel($channel) if (!is_null($channel) && !in_array($channel, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value '%s' for 'channel', must be one of '%s'", - $channel, + "Invalid value for 'channel', must be one of '%s'", implode("', '", $allowedValues) ) ); } + + + if (is_null($channel)) { + throw new \InvalidArgumentException('non-nullable channel cannot be null'); + } + $this->container['channel'] = $channel; return $this; @@ -459,18 +584,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -495,18 +620,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -519,16 +632,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/WhatsApp.php b/lib/Model/WhatsApp.php index aa14c56..35a2745 100644 --- a/lib/Model/WhatsApp.php +++ b/lib/Model/WhatsApp.php @@ -2,7 +2,7 @@ /** * WhatsApp * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class WhatsApp implements ModelInterface, ArrayAccess, \JsonSerializable +class WhatsApp implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -74,8 +71,6 @@ class WhatsApp implements ModelInterface, ArrayAccess, \JsonSerializable * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'sender' => null, @@ -87,6 +82,28 @@ class WhatsApp implements ModelInterface, ArrayAccess, \JsonSerializable '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 * @@ -107,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 @@ -195,7 +266,9 @@ public function getModelName() } const CHANNEL_WHATSAPP = 'whatsapp'; + + /** * Gets allowable values of the enum * @@ -207,6 +280,7 @@ public function getChannelAllowableValues() self::CHANNEL_WHATSAPP, ]; } + /** * Associative array for storing property values @@ -223,13 +297,24 @@ public function getChannelAllowableValues() */ public function __construct(array $data = null) { - $this->container['sender'] = $data['sender'] ?? null; - $this->container['validity'] = $data['validity'] ?? null; - $this->container['text'] = $data['text'] ?? null; - $this->container['image'] = $data['image'] ?? null; - $this->container['document'] = $data['document'] ?? null; - $this->container['audio'] = $data['audio'] ?? null; - $this->container['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; } /** @@ -244,8 +329,7 @@ public function listInvalidProperties() $allowedValues = $this->getChannelAllowableValues(); if (!is_null($this->container['channel']) && !in_array($this->container['channel'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value '%s' for 'channel', must be one of '%s'", - $this->container['channel'], + "invalid value for 'channel', must be one of '%s'", implode("', '", $allowedValues) ); } @@ -280,10 +364,16 @@ public function getSender() * * @param string|null $sender Phone number or alphanumeric sender name * - * @return self + * @return $this */ public function setSender($sender) { + + + if (is_null($sender)) { + throw new \InvalidArgumentException('non-nullable sender cannot be null'); + } + $this->container['sender'] = $sender; return $this; @@ -304,10 +394,16 @@ public function getValidity() * * @param int|null $validity After how many minutes this channel is considered as failed and the next channel is attempted * - * @return self + * @return $this */ public function setValidity($validity) { + + + if (is_null($validity)) { + throw new \InvalidArgumentException('non-nullable validity cannot be null'); + } + $this->container['validity'] = $validity; return $this; @@ -328,10 +424,16 @@ public function getText() * * @param \Messente\Api\Model\WhatsAppText|null $text text * - * @return self + * @return $this */ public function setText($text) { + + + if (is_null($text)) { + throw new \InvalidArgumentException('non-nullable text cannot be null'); + } + $this->container['text'] = $text; return $this; @@ -352,10 +454,16 @@ public function getImage() * * @param \Messente\Api\Model\WhatsAppImage|null $image image * - * @return self + * @return $this */ public function setImage($image) { + + + if (is_null($image)) { + throw new \InvalidArgumentException('non-nullable image cannot be null'); + } + $this->container['image'] = $image; return $this; @@ -376,10 +484,16 @@ public function getDocument() * * @param \Messente\Api\Model\WhatsAppDocument|null $document document * - * @return self + * @return $this */ public function setDocument($document) { + + + if (is_null($document)) { + throw new \InvalidArgumentException('non-nullable document cannot be null'); + } + $this->container['document'] = $document; return $this; @@ -400,10 +514,16 @@ public function getAudio() * * @param \Messente\Api\Model\WhatsAppAudio|null $audio audio * - * @return self + * @return $this */ public function setAudio($audio) { + + + if (is_null($audio)) { + throw new \InvalidArgumentException('non-nullable audio cannot be null'); + } + $this->container['audio'] = $audio; return $this; @@ -424,7 +544,7 @@ public function getChannel() * * @param string|null $channel The channel used to deliver the message * - * @return self + * @return $this */ public function setChannel($channel) { @@ -432,12 +552,17 @@ public function setChannel($channel) if (!is_null($channel) && !in_array($channel, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value '%s' for 'channel', must be one of '%s'", - $channel, + "Invalid value for 'channel', must be one of '%s'", implode("', '", $allowedValues) ) ); } + + + if (is_null($channel)) { + throw new \InvalidArgumentException('non-nullable channel cannot be null'); + } + $this->container['channel'] = $channel; return $this; @@ -459,18 +584,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -495,18 +620,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -519,16 +632,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/WhatsAppAudio.php b/lib/Model/WhatsAppAudio.php index eb67bc9..c10aa8d 100644 --- a/lib/Model/WhatsAppAudio.php +++ b/lib/Model/WhatsAppAudio.php @@ -2,7 +2,7 @@ /** * WhatsAppAudio * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class WhatsAppAudio implements ModelInterface, ArrayAccess, \JsonSerializable +class WhatsAppAudio implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -68,13 +65,27 @@ class WhatsAppAudio implements ModelInterface, ArrayAccess, \JsonSerializable * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -95,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 @@ -164,6 +229,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -180,7 +248,18 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['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; } /** @@ -225,10 +304,16 @@ public function getContent() * * @param string $content Base64-encoded audio * - * @return self + * @return $this */ public function setContent($content) { + + + if (is_null($content)) { + throw new \InvalidArgumentException('non-nullable content cannot be null'); + } + $this->container['content'] = $content; return $this; @@ -250,18 +335,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -286,18 +371,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -310,16 +383,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/WhatsAppDocument.php b/lib/Model/WhatsAppDocument.php index fe15f48..13f8279 100644 --- a/lib/Model/WhatsAppDocument.php +++ b/lib/Model/WhatsAppDocument.php @@ -2,7 +2,7 @@ /** * WhatsAppDocument * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class WhatsAppDocument implements ModelInterface, ArrayAccess, \JsonSerializable +class WhatsAppDocument implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -69,14 +66,29 @@ class WhatsAppDocument implements ModelInterface, ArrayAccess, \JsonSerializable * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'caption' => null, '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 * @@ -97,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 @@ -169,6 +235,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -185,8 +254,19 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['caption'] = $data['caption'] ?? null; - $this->container['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; } /** @@ -231,10 +311,16 @@ public function getCaption() * * @param string|null $caption Description for the document * - * @return self + * @return $this */ public function setCaption($caption) { + + + if (is_null($caption)) { + throw new \InvalidArgumentException('non-nullable caption cannot be null'); + } + $this->container['caption'] = $caption; return $this; @@ -255,10 +341,16 @@ public function getContent() * * @param string $content Base64-encoded image * - * @return self + * @return $this */ public function setContent($content) { + + + if (is_null($content)) { + throw new \InvalidArgumentException('non-nullable content cannot be null'); + } + $this->container['content'] = $content; return $this; @@ -280,18 +372,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -316,18 +408,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -340,16 +420,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/WhatsAppImage.php b/lib/Model/WhatsAppImage.php index 3e6545b..8a2f952 100644 --- a/lib/Model/WhatsAppImage.php +++ b/lib/Model/WhatsAppImage.php @@ -2,7 +2,7 @@ /** * WhatsAppImage * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class WhatsAppImage implements ModelInterface, ArrayAccess, \JsonSerializable +class WhatsAppImage implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -69,14 +66,29 @@ class WhatsAppImage implements ModelInterface, ArrayAccess, \JsonSerializable * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'caption' => null, '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 * @@ -97,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 @@ -169,6 +235,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -185,8 +254,19 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['caption'] = $data['caption'] ?? null; - $this->container['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; } /** @@ -231,10 +311,16 @@ public function getCaption() * * @param string|null $caption Description for the image * - * @return self + * @return $this */ public function setCaption($caption) { + + + if (is_null($caption)) { + throw new \InvalidArgumentException('non-nullable caption cannot be null'); + } + $this->container['caption'] = $caption; return $this; @@ -255,10 +341,16 @@ public function getContent() * * @param string $content Base64-encoded image * - * @return self + * @return $this */ public function setContent($content) { + + + if (is_null($content)) { + throw new \InvalidArgumentException('non-nullable content cannot be null'); + } + $this->container['content'] = $content; return $this; @@ -280,18 +372,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -316,18 +408,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -340,16 +420,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/Model/WhatsAppText.php b/lib/Model/WhatsAppText.php index c3f257b..6b40520 100644 --- a/lib/Model/WhatsAppText.php +++ b/lib/Model/WhatsAppText.php @@ -2,7 +2,7 @@ /** * WhatsAppText * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -40,13 +40,10 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null */ -class WhatsAppText implements ModelInterface, ArrayAccess, \JsonSerializable +class WhatsAppText implements ModelInterface, ArrayAccess { - public const DISCRIMINATOR = null; + const DISCRIMINATOR = null; /** * The original name of the model. @@ -69,14 +66,29 @@ class WhatsAppText implements ModelInterface, ArrayAccess, \JsonSerializable * Array of property to format mappings. Used for (de)serialization * * @var string[] - * @phpstan-var array - * @psalm-var array */ protected static $openAPIFormats = [ 'previewUrl' => null, '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 * @@ -97,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 @@ -169,6 +235,9 @@ public function getModelName() return self::$openAPIModelName; } + + + /** * Associative array for storing property values @@ -185,8 +254,19 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['previewUrl'] = $data['previewUrl'] ?? true; - $this->container['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; } /** @@ -231,10 +311,16 @@ public function getPreviewUrl() * * @param bool|null $previewUrl Whether to display link preview if the message contains a hyperlink * - * @return self + * @return $this */ public function setPreviewUrl($previewUrl) { + + + if (is_null($previewUrl)) { + throw new \InvalidArgumentException('non-nullable previewUrl cannot be null'); + } + $this->container['previewUrl'] = $previewUrl; return $this; @@ -255,10 +341,16 @@ public function getBody() * * @param string $body Plaintext content for WhatsApp, can contain URLs, emojis and formatting * - * @return self + * @return $this */ public function setBody($body) { + + + if (is_null($body)) { + throw new \InvalidArgumentException('non-nullable body cannot be null'); + } + $this->container['body'] = $body; return $this; @@ -280,18 +372,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed|null + * @return mixed */ public function offsetGet($offset) { - return $this->container[$offset] ?? null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * - * @param int|null $offset Offset - * @param mixed $value Value to be set + * @param integer $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -316,18 +408,6 @@ public function offsetUnset($offset) unset($this->container[$offset]); } - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - /** * Gets the string presentation of the object * @@ -340,16 +420,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/lib/ObjectSerializer.php b/lib/ObjectSerializer.php index 2a1510f..1a17780 100644 --- a/lib/ObjectSerializer.php +++ b/lib/ObjectSerializer.php @@ -2,7 +2,7 @@ /** * ObjectSerializer * - * PHP version 7.3 + * PHP version 5 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 2.0.0 + * The version of the OpenAPI document: 1.4.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * OpenAPI Generator version: 4.0.3 */ /** @@ -41,19 +41,6 @@ */ class ObjectSerializer { - /** @var string */ - private static $dateTimeFormat = \DateTime::ATOM; - - /** - * Change the date format - * - * @param string $format the new date format to use - */ - public static function setDateTimeFormat($format) - { - self::$dateTimeFormat = $format; - } - /** * Serialize data * @@ -61,44 +48,34 @@ public static function setDateTimeFormat($format) * @param string $type the OpenAPIToolsType of the data * @param string $format the format of the OpenAPITools type of the data * - * @return scalar|object|array|null serialized form of $data + * @return string|object serialized form of $data */ public static function sanitizeForSerialization($data, $type = null, $format = null) { if (is_scalar($data) || null === $data) { return $data; - } - - if ($data instanceof \DateTime) { - return ($format === 'date') ? $data->format('Y-m-d') : $data->format(self::$dateTimeFormat); - } - - if (is_array($data)) { + } elseif ($data instanceof \DateTime) { + return ($format === 'date') ? $data->format('Y-m-d') : $data->format(\DateTime::ATOM); + } elseif (is_array($data)) { foreach ($data as $property => $value) { $data[$property] = self::sanitizeForSerialization($value); } return $data; - } - - if (is_object($data)) { + } elseif (is_object($data)) { $values = []; if ($data instanceof ModelInterface) { $formats = $data::openAPIFormats(); foreach ($data::openAPITypes() as $property => $openAPIType) { $getter = $data::getters()[$property]; $value = $data->$getter(); - if ($value !== null && !in_array($openAPIType, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { - $callable = [$openAPIType, 'getAllowableEnumValues']; - if (is_callable($callable)) { - /** array $callable */ - $allowedEnumTypes = $callable(); - if (!in_array($value, $allowedEnumTypes, true)) { - $imploded = implode("', '", $allowedEnumTypes); - throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); - } - } + if ($value !== null + && !in_array($openAPIType, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true) + && method_exists($openAPIType, 'getAllowableEnumValues') + && !in_array($value, $openAPIType::getAllowableEnumValues(), true)) { + $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]); } } @@ -173,11 +150,6 @@ public static function toQueryValue($object) */ public static function toHeaderValue($value) { - $callable = [$value, 'toHeaderValue']; - if (is_callable($callable)) { - return $callable(); - } - return self::toString($value); } @@ -212,8 +184,8 @@ public static function toFormValue($value) public static function toString($value) { if ($value instanceof \DateTime) { // datetime in ISO8601 format - return $value->format(self::$dateTimeFormat); - } elseif (is_bool($value)) { + return $value->format(\DateTime::ATOM); + } else if (is_bool($value)) { return $value ? 'true' : 'false'; } else { return $value; @@ -224,32 +196,29 @@ public static function toString($value) * Serialize an array to a string. * * @param array $collection collection to serialize to a string - * @param string $style the format use for serialization (csv, + * @param string $collectionFormat the format use for serialization (csv, * ssv, tsv, pipes, multi) * @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array * * @return string */ - public static function serializeCollection(array $collection, $style, $allowCollectionFormatMulti = false) + public static function serializeCollection(array $collection, $collectionFormat, $allowCollectionFormatMulti = false) { - if ($allowCollectionFormatMulti && ('multi' === $style)) { + if ($allowCollectionFormatMulti && ('multi' === $collectionFormat)) { // http_build_query() almost does the job for us. We just // need to fix the result of multidimensional arrays. return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&')); } - switch ($style) { - case 'pipeDelimited': + switch ($collectionFormat) { case 'pipes': return implode('|', $collection); case 'tsv': return implode("\t", $collection); - case 'spaceDelimited': case 'ssv': return implode(' ', $collection); - case 'simple': case 'csv': // Deliberate fall through. CSV is default format. default: @@ -271,24 +240,7 @@ public static function deserialize($data, $class, $httpHeaders = null) { if (null === $data) { return null; - } - - if (strcasecmp(substr($class, -2), '[]') === 0) { - $data = is_string($data) ? json_decode($data) : $data; - - if (!is_array($data)) { - throw new \InvalidArgumentException("Invalid array '$class'"); - } - - $subClass = substr($class, 0, -2); - $values = []; - foreach ($data as $key => $value) { - $values[] = self::deserialize($value, $subClass, null); - } - return $values; - } - - if (preg_match('/^(array<|map\[)/', $class)) { // for associative array e.g. array + } elseif (substr($class, 0, 4) === 'map[') { // for associative array e.g. map[string,int] $data = is_string($data) ? json_decode($data) : $data; settype($data, 'array'); $inner = substr($class, 4, -1); @@ -301,17 +253,18 @@ public static function deserialize($data, $class, $httpHeaders = null) } } return $deserialized; - } - - if ($class === 'object') { + } elseif (strcasecmp(substr($class, -2), '[]') === 0) { + $data = is_string($data) ? json_decode($data) : $data; + $subClass = substr($class, 0, -2); + $values = []; + foreach ($data as $key => $value) { + $values[] = self::deserialize($value, $subClass, null); + } + return $values; + } elseif ($class === 'object') { settype($data, 'array'); return $data; - } else if ($class === 'mixed') { - settype($data, gettype($data)); - return $data; - } - - if ($class === '\DateTime') { + } elseif ($class === '\DateTime') { // Some API's return an invalid, empty string as a // date-time property. DateTime::__construct() will return // the current time for empty input which is probably not @@ -319,27 +272,14 @@ public static function deserialize($data, $class, $httpHeaders = null) // be interpreted as a missing field/value. Let's handle // this graceful. if (!empty($data)) { - try { - return new \DateTime($data); - } catch (\Exception $exception) { - // Some API's return a date-time with too high nanosecond - // precision for php's DateTime to handle. This conversion - // (string -> unix timestamp -> DateTime) is a workaround - // for the problem. - return (new \DateTime())->setTimestamp(strtotime($data)); - } + return new \DateTime($data); } else { return null; } - } - - /** @psalm-suppress ParadoxicalCondition */ - if (in_array($class, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + } elseif (in_array($class, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { settype($data, $class); return $data; - } - - if ($class === '\SplFileObject') { + } elseif ($class === '\SplFileObject') { /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name @@ -373,18 +313,21 @@ public static function deserialize($data, $class, $httpHeaders = null) $class = $subclass; } } - - /** @var ModelInterface $instance */ $instance = new $class(); 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; } - if (isset($data->{$instance::attributeMap()[$property]})) { - $propertyValue = $data->{$instance::attributeMap()[$property]}; + $propertyValue = $data->{$instance::attributeMap()[$property]}; + if (isset($propertyValue)) { $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); } } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 485899a..3dd90bb 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,18 +1,23 @@ - - - - ./lib/Api - ./lib/Model - - - - - ./test/Api - ./test/Model - - - - - + + + + ./test/Api + ./test/Model + + + + + ./lib/Api + ./lib/Model + + + + + diff --git a/test/Api/BlacklistApiTest.php b/test/Api/BlacklistApiTest.php deleted file mode 100644 index 4a9cd00..0000000 --- a/test/Api/BlacklistApiTest.php +++ /dev/null @@ -1,122 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test case for deleteFromBlacklist - * - * Deletes a phone number from the blacklist. - * - */ - public function testDeleteFromBlacklist() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for fetchBlacklist - * - * Returns all blacklisted phone numbers. - * - */ - public function testFetchBlacklist() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for isBlacklisted - * - * Checks if a phone number is blacklisted. - * - */ - public function testIsBlacklisted() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Api/ContactsApiTest.php b/test/Api/ContactsApiTest.php deleted file mode 100644 index 7cbcd7e..0000000 --- a/test/Api/ContactsApiTest.php +++ /dev/null @@ -1,170 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test case for createContact - * - * Creates a new contact. - * - */ - public function testCreateContact() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for deleteContact - * - * Deletes a contact. - * - */ - public function testDeleteContact() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for fetchContact - * - * Lists a contact. - * - */ - public function testFetchContact() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for fetchContactGroups - * - * Lists groups of a contact. - * - */ - public function testFetchContactGroups() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for fetchContacts - * - * Returns all contacts. - * - */ - public function testFetchContacts() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for removeContactFromGroup - * - * Removes a contact from a group. - * - */ - public function testRemoveContactFromGroup() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for updateContact - * - * Updates a contact. - * - */ - public function testUpdateContact() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Api/DeliveryReportApiTest.php b/test/Api/DeliveryReportApiTest.php deleted file mode 100644 index cce94dd..0000000 --- a/test/Api/DeliveryReportApiTest.php +++ /dev/null @@ -1,86 +0,0 @@ -markTestIncomplete('Not implemented'); - } -} diff --git a/test/Api/GroupsApiTest.php b/test/Api/GroupsApiTest.php deleted file mode 100644 index 3faadc3..0000000 --- a/test/Api/GroupsApiTest.php +++ /dev/null @@ -1,134 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test case for deleteGroup - * - * Deletes a group. - * - */ - public function testDeleteGroup() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for fetchGroup - * - * Lists a group. - * - */ - public function testFetchGroup() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for fetchGroups - * - * Returns all groups. - * - */ - public function testFetchGroups() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for updateGroup - * - * Updates a group with the provided name. - * - */ - public function testUpdateGroup() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Api/NumberLookupApiTest.php b/test/Api/NumberLookupApiTest.php deleted file mode 100644 index f64ee88..0000000 --- a/test/Api/NumberLookupApiTest.php +++ /dev/null @@ -1,86 +0,0 @@ -markTestIncomplete('Not implemented'); - } -} diff --git a/test/Api/OmnimessageApiTest.php b/test/Api/OmnimessageApiTest.php deleted file mode 100644 index 6b61e27..0000000 --- a/test/Api/OmnimessageApiTest.php +++ /dev/null @@ -1,98 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test case for sendOmnimessage - * - * Sends an Omnimessage. - * - */ - public function testSendOmnimessage() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Api/StatisticsApiTest.php b/test/Api/StatisticsApiTest.php deleted file mode 100644 index 10f2646..0000000 --- a/test/Api/StatisticsApiTest.php +++ /dev/null @@ -1,86 +0,0 @@ -markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/ChannelTest.php b/test/Model/ChannelTest.php deleted file mode 100644 index 5d478ad..0000000 --- a/test/Model/ChannelTest.php +++ /dev/null @@ -1,82 +0,0 @@ -markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/ContactEnvelopeTest.php b/test/Model/ContactEnvelopeTest.php deleted file mode 100644 index ad42b6a..0000000 --- a/test/Model/ContactEnvelopeTest.php +++ /dev/null @@ -1,91 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "contact" - */ - public function testPropertyContact() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/ContactFieldsTest.php b/test/Model/ContactFieldsTest.php deleted file mode 100644 index 7fa774d..0000000 --- a/test/Model/ContactFieldsTest.php +++ /dev/null @@ -1,172 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "phoneNumber" - */ - public function testPropertyPhoneNumber() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "email" - */ - public function testPropertyEmail() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "firstName" - */ - public function testPropertyFirstName() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "lastName" - */ - public function testPropertyLastName() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "company" - */ - public function testPropertyCompany() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "title" - */ - public function testPropertyTitle() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "custom" - */ - public function testPropertyCustom() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "custom2" - */ - public function testPropertyCustom2() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "custom3" - */ - public function testPropertyCustom3() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "custom4" - */ - public function testPropertyCustom4() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/ContactListEnvelopeTest.php b/test/Model/ContactListEnvelopeTest.php deleted file mode 100644 index bde0072..0000000 --- a/test/Model/ContactListEnvelopeTest.php +++ /dev/null @@ -1,91 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "contacts" - */ - public function testPropertyContacts() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/ContactResponseFieldsTest.php b/test/Model/ContactResponseFieldsTest.php deleted file mode 100644 index 0709a33..0000000 --- a/test/Model/ContactResponseFieldsTest.php +++ /dev/null @@ -1,181 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "phoneNumber" - */ - public function testPropertyPhoneNumber() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "email" - */ - public function testPropertyEmail() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "firstName" - */ - public function testPropertyFirstName() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "lastName" - */ - public function testPropertyLastName() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "company" - */ - public function testPropertyCompany() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "title" - */ - public function testPropertyTitle() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "custom" - */ - public function testPropertyCustom() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "custom2" - */ - public function testPropertyCustom2() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "custom3" - */ - public function testPropertyCustom3() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "custom4" - */ - public function testPropertyCustom4() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "scheduledDeletionDate" - */ - public function testPropertyScheduledDeletionDate() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/ContactUpdateFieldsTest.php b/test/Model/ContactUpdateFieldsTest.php deleted file mode 100644 index c179501..0000000 --- a/test/Model/ContactUpdateFieldsTest.php +++ /dev/null @@ -1,163 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "email" - */ - public function testPropertyEmail() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "firstName" - */ - public function testPropertyFirstName() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "lastName" - */ - public function testPropertyLastName() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "company" - */ - public function testPropertyCompany() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "title" - */ - public function testPropertyTitle() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "custom" - */ - public function testPropertyCustom() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "custom2" - */ - public function testPropertyCustom2() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "custom3" - */ - public function testPropertyCustom3() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "custom4" - */ - public function testPropertyCustom4() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/DeliveryReportResponseTest.php b/test/Model/DeliveryReportResponseTest.php deleted file mode 100644 index 8bb70a1..0000000 --- a/test/Model/DeliveryReportResponseTest.php +++ /dev/null @@ -1,109 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "statuses" - */ - public function testPropertyStatuses() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "to" - */ - public function testPropertyTo() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "omnimessageId" - */ - public function testPropertyOmnimessageId() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/DeliveryResultTest.php b/test/Model/DeliveryResultTest.php deleted file mode 100644 index a1e207b..0000000 --- a/test/Model/DeliveryResultTest.php +++ /dev/null @@ -1,136 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "status" - */ - public function testPropertyStatus() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "channel" - */ - public function testPropertyChannel() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "messageId" - */ - public function testPropertyMessageId() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "error" - */ - public function testPropertyError() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "err" - */ - public function testPropertyErr() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "timestamp" - */ - public function testPropertyTimestamp() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/ErrorCodeOmnichannelMachineTest.php b/test/Model/ErrorCodeOmnichannelMachineTest.php deleted file mode 100644 index 1cdf214..0000000 --- a/test/Model/ErrorCodeOmnichannelMachineTest.php +++ /dev/null @@ -1,82 +0,0 @@ -markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/ErrorCodeOmnichannelTest.php b/test/Model/ErrorCodeOmnichannelTest.php deleted file mode 100644 index 78fddb5..0000000 --- a/test/Model/ErrorCodeOmnichannelTest.php +++ /dev/null @@ -1,82 +0,0 @@ -markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/ErrorCodePhonebookTest.php b/test/Model/ErrorCodePhonebookTest.php deleted file mode 100644 index 71bc429..0000000 --- a/test/Model/ErrorCodePhonebookTest.php +++ /dev/null @@ -1,82 +0,0 @@ -markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/ErrorCodeStatisticsTest.php b/test/Model/ErrorCodeStatisticsTest.php deleted file mode 100644 index f03468e..0000000 --- a/test/Model/ErrorCodeStatisticsTest.php +++ /dev/null @@ -1,82 +0,0 @@ -markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/ErrorItemNumberLookupErrorTest.php b/test/Model/ErrorItemNumberLookupErrorTest.php deleted file mode 100644 index 8885f53..0000000 --- a/test/Model/ErrorItemNumberLookupErrorTest.php +++ /dev/null @@ -1,100 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "description" - */ - public function testPropertyDescription() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "code" - */ - public function testPropertyCode() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/ErrorItemNumberLookupTest.php b/test/Model/ErrorItemNumberLookupTest.php deleted file mode 100644 index 9246aa1..0000000 --- a/test/Model/ErrorItemNumberLookupTest.php +++ /dev/null @@ -1,91 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "error" - */ - public function testPropertyError() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/ErrorItemOmnichannelTest.php b/test/Model/ErrorItemOmnichannelTest.php deleted file mode 100644 index ae5544a..0000000 --- a/test/Model/ErrorItemOmnichannelTest.php +++ /dev/null @@ -1,118 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "title" - */ - public function testPropertyTitle() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "detail" - */ - public function testPropertyDetail() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "code" - */ - public function testPropertyCode() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "source" - */ - public function testPropertySource() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/ErrorItemPhonebookTest.php b/test/Model/ErrorItemPhonebookTest.php deleted file mode 100644 index 4d28e07..0000000 --- a/test/Model/ErrorItemPhonebookTest.php +++ /dev/null @@ -1,109 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "title" - */ - public function testPropertyTitle() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "detail" - */ - public function testPropertyDetail() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "code" - */ - public function testPropertyCode() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/ErrorItemStatisticsTest.php b/test/Model/ErrorItemStatisticsTest.php deleted file mode 100644 index 24e42b7..0000000 --- a/test/Model/ErrorItemStatisticsTest.php +++ /dev/null @@ -1,109 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "title" - */ - public function testPropertyTitle() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "details" - */ - public function testPropertyDetails() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "code" - */ - public function testPropertyCode() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/ErrorNumberLookupTest.php b/test/Model/ErrorNumberLookupTest.php deleted file mode 100644 index 27b57c4..0000000 --- a/test/Model/ErrorNumberLookupTest.php +++ /dev/null @@ -1,91 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "errors" - */ - public function testPropertyErrors() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/ErrorOmnichannelTest.php b/test/Model/ErrorOmnichannelTest.php deleted file mode 100644 index 5f1e138..0000000 --- a/test/Model/ErrorOmnichannelTest.php +++ /dev/null @@ -1,91 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "errors" - */ - public function testPropertyErrors() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/ErrorPhonebookTest.php b/test/Model/ErrorPhonebookTest.php deleted file mode 100644 index 4e836bf..0000000 --- a/test/Model/ErrorPhonebookTest.php +++ /dev/null @@ -1,91 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "errors" - */ - public function testPropertyErrors() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/ErrorStatisticsTest.php b/test/Model/ErrorStatisticsTest.php deleted file mode 100644 index 4272499..0000000 --- a/test/Model/ErrorStatisticsTest.php +++ /dev/null @@ -1,91 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "errors" - */ - public function testPropertyErrors() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/ErrorTitleOmnichannelTest.php b/test/Model/ErrorTitleOmnichannelTest.php deleted file mode 100644 index c29096a..0000000 --- a/test/Model/ErrorTitleOmnichannelTest.php +++ /dev/null @@ -1,82 +0,0 @@ -markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/ErrorTitlePhonebookTest.php b/test/Model/ErrorTitlePhonebookTest.php deleted file mode 100644 index 2816116..0000000 --- a/test/Model/ErrorTitlePhonebookTest.php +++ /dev/null @@ -1,82 +0,0 @@ -markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/FetchBlacklistSuccessTest.php b/test/Model/FetchBlacklistSuccessTest.php deleted file mode 100644 index a93ea6f..0000000 --- a/test/Model/FetchBlacklistSuccessTest.php +++ /dev/null @@ -1,91 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "phoneNumbers" - */ - public function testPropertyPhoneNumbers() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/GroupEnvelopeTest.php b/test/Model/GroupEnvelopeTest.php deleted file mode 100644 index ac7b3b1..0000000 --- a/test/Model/GroupEnvelopeTest.php +++ /dev/null @@ -1,91 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "group" - */ - public function testPropertyGroup() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/GroupListEnvelopeTest.php b/test/Model/GroupListEnvelopeTest.php deleted file mode 100644 index 47b2f4b..0000000 --- a/test/Model/GroupListEnvelopeTest.php +++ /dev/null @@ -1,91 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "groups" - */ - public function testPropertyGroups() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/GroupNameTest.php b/test/Model/GroupNameTest.php deleted file mode 100644 index 82a5d94..0000000 --- a/test/Model/GroupNameTest.php +++ /dev/null @@ -1,91 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "name" - */ - public function testPropertyName() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/GroupResponseFieldsTest.php b/test/Model/GroupResponseFieldsTest.php deleted file mode 100644 index cd5136a..0000000 --- a/test/Model/GroupResponseFieldsTest.php +++ /dev/null @@ -1,118 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "id" - */ - public function testPropertyId() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "name" - */ - public function testPropertyName() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "createdOn" - */ - public function testPropertyCreatedOn() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "contactsCount" - */ - public function testPropertyContactsCount() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/MessageResultTest.php b/test/Model/MessageResultTest.php deleted file mode 100644 index 778d4dc..0000000 --- a/test/Model/MessageResultTest.php +++ /dev/null @@ -1,109 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "messageId" - */ - public function testPropertyMessageId() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "channel" - */ - public function testPropertyChannel() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "sender" - */ - public function testPropertySender() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/MobileNetworkTest.php b/test/Model/MobileNetworkTest.php deleted file mode 100644 index 6b19db3..0000000 --- a/test/Model/MobileNetworkTest.php +++ /dev/null @@ -1,127 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "mccmnc" - */ - public function testPropertyMccmnc() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "networkName" - */ - public function testPropertyNetworkName() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "countryName" - */ - public function testPropertyCountryName() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "countryPrefix" - */ - public function testPropertyCountryPrefix() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "countryCode" - */ - public function testPropertyCountryCode() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/NumberToBlacklistTest.php b/test/Model/NumberToBlacklistTest.php deleted file mode 100644 index 2b005cd..0000000 --- a/test/Model/NumberToBlacklistTest.php +++ /dev/null @@ -1,91 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "phoneNumber" - */ - public function testPropertyPhoneNumber() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/NumbersToInvestigateTest.php b/test/Model/NumbersToInvestigateTest.php deleted file mode 100644 index 54c17fb..0000000 --- a/test/Model/NumbersToInvestigateTest.php +++ /dev/null @@ -1,91 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "numbers" - */ - public function testPropertyNumbers() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/OmniMessageCreateSuccessResponseTest.php b/test/Model/OmniMessageCreateSuccessResponseTest.php deleted file mode 100644 index 1544f73..0000000 --- a/test/Model/OmniMessageCreateSuccessResponseTest.php +++ /dev/null @@ -1,109 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "messages" - */ - public function testPropertyMessages() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "to" - */ - public function testPropertyTo() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "omnimessageId" - */ - public function testPropertyOmnimessageId() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/OmnimessageTest.php b/test/Model/OmnimessageTest.php deleted file mode 100644 index c498a37..0000000 --- a/test/Model/OmnimessageTest.php +++ /dev/null @@ -1,136 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "to" - */ - public function testPropertyTo() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "messages" - */ - public function testPropertyMessages() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "dlrUrl" - */ - public function testPropertyDlrUrl() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "textStore" - */ - public function testPropertyTextStore() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "timeToSend" - */ - public function testPropertyTimeToSend() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "priority" - */ - public function testPropertyPriority() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/PriorityTest.php b/test/Model/PriorityTest.php deleted file mode 100644 index 124fe12..0000000 --- a/test/Model/PriorityTest.php +++ /dev/null @@ -1,82 +0,0 @@ -markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/SMSTest.php b/test/Model/SMSTest.php deleted file mode 100644 index c8cede3..0000000 --- a/test/Model/SMSTest.php +++ /dev/null @@ -1,136 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "text" - */ - public function testPropertyText() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "sender" - */ - public function testPropertySender() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "validity" - */ - public function testPropertyValidity() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "autoconvert" - */ - public function testPropertyAutoconvert() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "udh" - */ - public function testPropertyUdh() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "channel" - */ - public function testPropertyChannel() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/StatisticsReportSettingsTest.php b/test/Model/StatisticsReportSettingsTest.php deleted file mode 100644 index d73d235..0000000 --- a/test/Model/StatisticsReportSettingsTest.php +++ /dev/null @@ -1,109 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "startDate" - */ - public function testPropertyStartDate() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "endDate" - */ - public function testPropertyEndDate() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "messageTypes" - */ - public function testPropertyMessageTypes() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/StatisticsReportSuccessTest.php b/test/Model/StatisticsReportSuccessTest.php deleted file mode 100644 index f200c05..0000000 --- a/test/Model/StatisticsReportSuccessTest.php +++ /dev/null @@ -1,91 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "reports" - */ - public function testPropertyReports() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/StatisticsReportTest.php b/test/Model/StatisticsReportTest.php deleted file mode 100644 index 8a4021a..0000000 --- a/test/Model/StatisticsReportTest.php +++ /dev/null @@ -1,109 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "totalMessages" - */ - public function testPropertyTotalMessages() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "totalPrice" - */ - public function testPropertyTotalPrice() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "country" - */ - public function testPropertyCountry() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/StatusTest.php b/test/Model/StatusTest.php deleted file mode 100644 index 10530f9..0000000 --- a/test/Model/StatusTest.php +++ /dev/null @@ -1,82 +0,0 @@ -markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/SyncNumberLookupResultTest.php b/test/Model/SyncNumberLookupResultTest.php deleted file mode 100644 index 8eb6dae..0000000 --- a/test/Model/SyncNumberLookupResultTest.php +++ /dev/null @@ -1,163 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "number" - */ - public function testPropertyNumber() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "roaming" - */ - public function testPropertyRoaming() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "ported" - */ - public function testPropertyPorted() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "roamingNetwork" - */ - public function testPropertyRoamingNetwork() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "currentNetwork" - */ - public function testPropertyCurrentNetwork() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "originalNetwork" - */ - public function testPropertyOriginalNetwork() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "portedNetwork" - */ - public function testPropertyPortedNetwork() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "status" - */ - public function testPropertyStatus() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "error" - */ - public function testPropertyError() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/SyncNumberLookupSuccessTest.php b/test/Model/SyncNumberLookupSuccessTest.php deleted file mode 100644 index 1274234..0000000 --- a/test/Model/SyncNumberLookupSuccessTest.php +++ /dev/null @@ -1,100 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "requestId" - */ - public function testPropertyRequestId() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "result" - */ - public function testPropertyResult() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/TelegramTest.php b/test/Model/TelegramTest.php deleted file mode 100644 index 6a88027..0000000 --- a/test/Model/TelegramTest.php +++ /dev/null @@ -1,145 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "sender" - */ - public function testPropertySender() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "validity" - */ - public function testPropertyValidity() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "text" - */ - public function testPropertyText() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "imageUrl" - */ - public function testPropertyImageUrl() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "documentUrl" - */ - public function testPropertyDocumentUrl() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "audioUrl" - */ - public function testPropertyAudioUrl() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "channel" - */ - public function testPropertyChannel() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/TextStoreTest.php b/test/Model/TextStoreTest.php deleted file mode 100644 index 70ff6ca..0000000 --- a/test/Model/TextStoreTest.php +++ /dev/null @@ -1,82 +0,0 @@ -markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/ViberTest.php b/test/Model/ViberTest.php deleted file mode 100644 index bc8daca..0000000 --- a/test/Model/ViberTest.php +++ /dev/null @@ -1,145 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "sender" - */ - public function testPropertySender() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "validity" - */ - public function testPropertyValidity() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "text" - */ - public function testPropertyText() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "imageUrl" - */ - public function testPropertyImageUrl() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "buttonUrl" - */ - public function testPropertyButtonUrl() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "buttonText" - */ - public function testPropertyButtonText() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "channel" - */ - public function testPropertyChannel() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/WhatsAppAudioTest.php b/test/Model/WhatsAppAudioTest.php deleted file mode 100644 index 9d4fec7..0000000 --- a/test/Model/WhatsAppAudioTest.php +++ /dev/null @@ -1,91 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "content" - */ - public function testPropertyContent() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/WhatsAppDocumentTest.php b/test/Model/WhatsAppDocumentTest.php deleted file mode 100644 index 022c0fa..0000000 --- a/test/Model/WhatsAppDocumentTest.php +++ /dev/null @@ -1,100 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "caption" - */ - public function testPropertyCaption() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "content" - */ - public function testPropertyContent() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/WhatsAppImageTest.php b/test/Model/WhatsAppImageTest.php deleted file mode 100644 index e9d384f..0000000 --- a/test/Model/WhatsAppImageTest.php +++ /dev/null @@ -1,100 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "caption" - */ - public function testPropertyCaption() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "content" - */ - public function testPropertyContent() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/WhatsAppTest.php b/test/Model/WhatsAppTest.php deleted file mode 100644 index 462de55..0000000 --- a/test/Model/WhatsAppTest.php +++ /dev/null @@ -1,145 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "sender" - */ - public function testPropertySender() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "validity" - */ - public function testPropertyValidity() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "text" - */ - public function testPropertyText() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "image" - */ - public function testPropertyImage() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "document" - */ - public function testPropertyDocument() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "audio" - */ - public function testPropertyAudio() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "channel" - */ - public function testPropertyChannel() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/test/Model/WhatsAppTextTest.php b/test/Model/WhatsAppTextTest.php deleted file mode 100644 index a3b7035..0000000 --- a/test/Model/WhatsAppTextTest.php +++ /dev/null @@ -1,100 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "previewUrl" - */ - public function testPropertyPreviewUrl() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "body" - */ - public function testPropertyBody() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} From 9030ffe77d724d24e0cfd4c6bdb8e4f6315f9eb1 Mon Sep 17 00:00:00 2001 From: api-librarian Date: Thu, 14 Jul 2022 11:03:47 +0000 Subject: [PATCH 4/8] Travis update: Jul 2022 (Build 698) [skip ci] --- .gitignore | 14 + .openapi-generator/FILES | 184 ++++++ .openapi-generator/VERSION | 2 +- .travis.yml | 11 +- README.md | 4 +- composer.json | 2 +- docs/Api/BlacklistApi.md | 72 +-- docs/Api/ContactsApi.md | 147 +++-- docs/Api/DeliveryReportApi.md | 20 +- docs/Api/GroupsApi.md | 95 ++- docs/Api/NumberLookupApi.md | 22 +- docs/Api/OmnimessageApi.md | 39 +- docs/Api/StatisticsApi.md | 22 +- docs/Model/Channel.md | 4 +- docs/Model/ContactEnvelope.md | 6 +- docs/Model/ContactFields.md | 24 +- docs/Model/ContactListEnvelope.md | 6 +- docs/Model/ContactResponseFields.md | 26 +- docs/Model/ContactUpdateFields.md | 22 +- docs/Model/DeliveryReportResponse.md | 10 +- docs/Model/DeliveryResult.md | 18 +- docs/Model/ErrorCodeOmnichannel.md | 4 +- docs/Model/ErrorCodeOmnichannelMachine.md | 4 +- docs/Model/ErrorCodePhonebook.md | 4 +- docs/Model/ErrorCodeStatistics.md | 4 +- docs/Model/ErrorItemNumberLookup.md | 6 +- docs/Model/ErrorItemNumberLookupError.md | 8 +- docs/Model/ErrorItemOmnichannel.md | 12 +- docs/Model/ErrorItemPhonebook.md | 10 +- docs/Model/ErrorItemStatistics.md | 10 +- docs/Model/ErrorNumberLookup.md | 6 +- docs/Model/ErrorOmnichannel.md | 6 +- docs/Model/ErrorPhonebook.md | 6 +- docs/Model/ErrorStatistics.md | 6 +- docs/Model/ErrorTitleOmnichannel.md | 4 +- docs/Model/ErrorTitlePhonebook.md | 4 +- docs/Model/FetchBlacklistSuccess.md | 6 +- docs/Model/GroupEnvelope.md | 6 +- docs/Model/GroupListEnvelope.md | 6 +- docs/Model/GroupName.md | 6 +- docs/Model/GroupResponseFields.md | 12 +- docs/Model/MessageResult.md | 10 +- docs/Model/MobileNetwork.md | 14 +- docs/Model/NumberToBlacklist.md | 6 +- docs/Model/NumbersToInvestigate.md | 6 +- .../Model/OmniMessageCreateSuccessResponse.md | 10 +- docs/Model/Omnimessage.md | 18 +- docs/Model/Priority.md | 4 +- docs/Model/SMS.md | 14 +- docs/Model/StatisticsReport.md | 10 +- docs/Model/StatisticsReportSettings.md | 10 +- docs/Model/StatisticsReportSuccess.md | 6 +- docs/Model/Status.md | 4 +- docs/Model/SyncNumberLookupResult.md | 22 +- docs/Model/SyncNumberLookupSuccess.md | 8 +- docs/Model/Telegram.md | 16 +- docs/Model/TextStore.md | 4 +- docs/Model/Viber.md | 16 +- docs/Model/WhatsApp.md | 16 +- docs/Model/WhatsAppAudio.md | 6 +- docs/Model/WhatsAppDocument.md | 8 +- docs/Model/WhatsAppImage.md | 8 +- docs/Model/WhatsAppText.md | 6 +- git_push.sh | 17 +- lib/Api/BlacklistApi.php | 229 +++---- lib/Api/ContactsApi.php | 581 +++++++++--------- lib/Api/DeliveryReportApi.php | 86 +-- lib/Api/GroupsApi.php | 357 +++++------ lib/Api/NumberLookupApi.php | 95 +-- lib/Api/OmnimessageApi.php | 152 ++--- lib/Api/StatisticsApi.php | 99 +-- lib/ApiException.php | 24 +- lib/Configuration.php | 51 +- lib/HeaderSelector.php | 13 +- lib/Model/Channel.php | 13 +- lib/Model/ContactEnvelope.php | 139 ++--- lib/Model/ContactFields.php | 301 ++------- lib/Model/ContactListEnvelope.php | 137 ++--- lib/Model/ContactResponseFields.php | 319 ++-------- lib/Model/ContactUpdateFields.php | 290 ++------- lib/Model/DeliveryReportResponse.php | 161 ++--- lib/Model/DeliveryResult.php | 194 ++---- lib/Model/ErrorCodeOmnichannel.php | 16 +- lib/Model/ErrorCodeOmnichannelMachine.php | 67 +- lib/Model/ErrorCodePhonebook.php | 15 +- lib/Model/ErrorCodeStatistics.php | 13 +- lib/Model/ErrorItemNumberLookup.php | 139 ++--- lib/Model/ErrorItemNumberLookupError.php | 150 ++--- lib/Model/ErrorItemOmnichannel.php | 179 ++---- lib/Model/ErrorItemPhonebook.php | 161 ++--- lib/Model/ErrorItemStatistics.php | 161 ++--- lib/Model/ErrorNumberLookup.php | 139 ++--- lib/Model/ErrorOmnichannel.php | 139 ++--- lib/Model/ErrorPhonebook.php | 139 ++--- lib/Model/ErrorStatistics.php | 139 ++--- lib/Model/ErrorTitleOmnichannel.php | 16 +- lib/Model/ErrorTitlePhonebook.php | 15 +- lib/Model/FetchBlacklistSuccess.php | 137 ++--- lib/Model/GroupEnvelope.php | 139 ++--- lib/Model/GroupListEnvelope.php | 137 ++--- lib/Model/GroupName.php | 139 ++--- lib/Model/GroupResponseFields.php | 179 ++---- lib/Model/MessageResult.php | 161 ++--- lib/Model/MobileNetwork.php | 183 ++---- lib/Model/ModelInterface.php | 6 +- lib/Model/NumberToBlacklist.php | 139 ++--- lib/Model/NumbersToInvestigate.php | 152 ++--- .../OmniMessageCreateSuccessResponse.php | 161 ++--- lib/Model/Omnimessage.php | 194 ++---- lib/Model/Priority.php | 12 +- lib/Model/SMS.php | 208 ++----- lib/Model/StatisticsReport.php | 161 ++--- lib/Model/StatisticsReportSettings.php | 161 ++--- lib/Model/StatisticsReportSuccess.php | 139 ++--- lib/Model/Status.php | 20 +- lib/Model/SyncNumberLookupResult.php | 281 ++------- lib/Model/SyncNumberLookupSuccess.php | 150 ++--- lib/Model/Telegram.php | 211 ++----- lib/Model/TextStore.php | 12 +- lib/Model/Viber.php | 211 ++----- lib/Model/WhatsApp.php | 211 ++----- lib/Model/WhatsAppAudio.php | 139 ++--- lib/Model/WhatsAppDocument.php | 150 ++--- lib/Model/WhatsAppImage.php | 150 ++--- lib/Model/WhatsAppText.php | 150 ++--- lib/ObjectSerializer.php | 143 +++-- phpunit.xml.dist | 37 +- test/Api/BlacklistApiTest.php | 122 ++++ test/Api/ContactsApiTest.php | 170 +++++ test/Api/DeliveryReportApiTest.php | 86 +++ test/Api/GroupsApiTest.php | 134 ++++ test/Api/NumberLookupApiTest.php | 86 +++ test/Api/OmnimessageApiTest.php | 98 +++ test/Api/StatisticsApiTest.php | 86 +++ test/Model/ChannelTest.php | 82 +++ test/Model/ContactEnvelopeTest.php | 91 +++ test/Model/ContactFieldsTest.php | 172 ++++++ test/Model/ContactListEnvelopeTest.php | 91 +++ test/Model/ContactResponseFieldsTest.php | 181 ++++++ test/Model/ContactUpdateFieldsTest.php | 163 +++++ test/Model/DeliveryReportResponseTest.php | 109 ++++ test/Model/DeliveryResultTest.php | 136 ++++ .../Model/ErrorCodeOmnichannelMachineTest.php | 82 +++ test/Model/ErrorCodeOmnichannelTest.php | 82 +++ test/Model/ErrorCodePhonebookTest.php | 82 +++ test/Model/ErrorCodeStatisticsTest.php | 82 +++ test/Model/ErrorItemNumberLookupErrorTest.php | 100 +++ test/Model/ErrorItemNumberLookupTest.php | 91 +++ test/Model/ErrorItemOmnichannelTest.php | 118 ++++ test/Model/ErrorItemPhonebookTest.php | 109 ++++ test/Model/ErrorItemStatisticsTest.php | 109 ++++ test/Model/ErrorNumberLookupTest.php | 91 +++ test/Model/ErrorOmnichannelTest.php | 91 +++ test/Model/ErrorPhonebookTest.php | 91 +++ test/Model/ErrorStatisticsTest.php | 91 +++ test/Model/ErrorTitleOmnichannelTest.php | 82 +++ test/Model/ErrorTitlePhonebookTest.php | 82 +++ test/Model/FetchBlacklistSuccessTest.php | 91 +++ test/Model/GroupEnvelopeTest.php | 91 +++ test/Model/GroupListEnvelopeTest.php | 91 +++ test/Model/GroupNameTest.php | 91 +++ test/Model/GroupResponseFieldsTest.php | 118 ++++ test/Model/MessageResultTest.php | 109 ++++ test/Model/MobileNetworkTest.php | 127 ++++ test/Model/NumberToBlacklistTest.php | 91 +++ test/Model/NumbersToInvestigateTest.php | 91 +++ .../OmniMessageCreateSuccessResponseTest.php | 109 ++++ test/Model/OmnimessageTest.php | 136 ++++ test/Model/PriorityTest.php | 82 +++ test/Model/SMSTest.php | 136 ++++ test/Model/StatisticsReportSettingsTest.php | 109 ++++ test/Model/StatisticsReportSuccessTest.php | 91 +++ test/Model/StatisticsReportTest.php | 109 ++++ test/Model/StatusTest.php | 82 +++ test/Model/SyncNumberLookupResultTest.php | 163 +++++ test/Model/SyncNumberLookupSuccessTest.php | 100 +++ test/Model/TelegramTest.php | 145 +++++ test/Model/TextStoreTest.php | 82 +++ test/Model/ViberTest.php | 145 +++++ test/Model/WhatsAppAudioTest.php | 91 +++ test/Model/WhatsAppDocumentTest.php | 100 +++ test/Model/WhatsAppImageTest.php | 100 +++ test/Model/WhatsAppTest.php | 145 +++++ test/Model/WhatsAppTextTest.php | 100 +++ 184 files changed, 9573 insertions(+), 6663 deletions(-) create mode 100644 .gitignore create mode 100644 .openapi-generator/FILES create mode 100644 test/Api/BlacklistApiTest.php create mode 100644 test/Api/ContactsApiTest.php create mode 100644 test/Api/DeliveryReportApiTest.php create mode 100644 test/Api/GroupsApiTest.php create mode 100644 test/Api/NumberLookupApiTest.php create mode 100644 test/Api/OmnimessageApiTest.php create mode 100644 test/Api/StatisticsApiTest.php create mode 100644 test/Model/ChannelTest.php create mode 100644 test/Model/ContactEnvelopeTest.php create mode 100644 test/Model/ContactFieldsTest.php create mode 100644 test/Model/ContactListEnvelopeTest.php create mode 100644 test/Model/ContactResponseFieldsTest.php create mode 100644 test/Model/ContactUpdateFieldsTest.php create mode 100644 test/Model/DeliveryReportResponseTest.php create mode 100644 test/Model/DeliveryResultTest.php create mode 100644 test/Model/ErrorCodeOmnichannelMachineTest.php create mode 100644 test/Model/ErrorCodeOmnichannelTest.php create mode 100644 test/Model/ErrorCodePhonebookTest.php create mode 100644 test/Model/ErrorCodeStatisticsTest.php create mode 100644 test/Model/ErrorItemNumberLookupErrorTest.php create mode 100644 test/Model/ErrorItemNumberLookupTest.php create mode 100644 test/Model/ErrorItemOmnichannelTest.php create mode 100644 test/Model/ErrorItemPhonebookTest.php create mode 100644 test/Model/ErrorItemStatisticsTest.php create mode 100644 test/Model/ErrorNumberLookupTest.php create mode 100644 test/Model/ErrorOmnichannelTest.php create mode 100644 test/Model/ErrorPhonebookTest.php create mode 100644 test/Model/ErrorStatisticsTest.php create mode 100644 test/Model/ErrorTitleOmnichannelTest.php create mode 100644 test/Model/ErrorTitlePhonebookTest.php create mode 100644 test/Model/FetchBlacklistSuccessTest.php create mode 100644 test/Model/GroupEnvelopeTest.php create mode 100644 test/Model/GroupListEnvelopeTest.php create mode 100644 test/Model/GroupNameTest.php create mode 100644 test/Model/GroupResponseFieldsTest.php create mode 100644 test/Model/MessageResultTest.php create mode 100644 test/Model/MobileNetworkTest.php create mode 100644 test/Model/NumberToBlacklistTest.php create mode 100644 test/Model/NumbersToInvestigateTest.php create mode 100644 test/Model/OmniMessageCreateSuccessResponseTest.php create mode 100644 test/Model/OmnimessageTest.php create mode 100644 test/Model/PriorityTest.php create mode 100644 test/Model/SMSTest.php create mode 100644 test/Model/StatisticsReportSettingsTest.php create mode 100644 test/Model/StatisticsReportSuccessTest.php create mode 100644 test/Model/StatisticsReportTest.php create mode 100644 test/Model/StatusTest.php create mode 100644 test/Model/SyncNumberLookupResultTest.php create mode 100644 test/Model/SyncNumberLookupSuccessTest.php create mode 100644 test/Model/TelegramTest.php create mode 100644 test/Model/TextStoreTest.php create mode 100644 test/Model/ViberTest.php create mode 100644 test/Model/WhatsAppAudioTest.php create mode 100644 test/Model/WhatsAppDocumentTest.php create mode 100644 test/Model/WhatsAppImageTest.php create mode 100644 test/Model/WhatsAppTest.php create mode 100644 test/Model/WhatsAppTextTest.php diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..92f7fde --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +# ref: https://github.com/github/gitignore/blob/master/Composer.gitignore + +composer.phar +/vendor/ + +# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control +# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file +# composer.lock + +# php-cs-fixer cache +.php_cs.cache + +# PHPUnit cache +.phpunit.result.cache diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES new file mode 100644 index 0000000..274bcd7 --- /dev/null +++ b/.openapi-generator/FILES @@ -0,0 +1,184 @@ +.gitignore +.openapi-generator-ignore +.php_cs +.travis.yml +README.md +composer.json +docs/Api/BlacklistApi.md +docs/Api/ContactsApi.md +docs/Api/DeliveryReportApi.md +docs/Api/GroupsApi.md +docs/Api/NumberLookupApi.md +docs/Api/OmnimessageApi.md +docs/Api/StatisticsApi.md +docs/Model/Channel.md +docs/Model/ContactEnvelope.md +docs/Model/ContactFields.md +docs/Model/ContactListEnvelope.md +docs/Model/ContactResponseFields.md +docs/Model/ContactUpdateFields.md +docs/Model/DeliveryReportResponse.md +docs/Model/DeliveryResult.md +docs/Model/ErrorCodeOmnichannel.md +docs/Model/ErrorCodeOmnichannelMachine.md +docs/Model/ErrorCodePhonebook.md +docs/Model/ErrorCodeStatistics.md +docs/Model/ErrorItemNumberLookup.md +docs/Model/ErrorItemNumberLookupError.md +docs/Model/ErrorItemOmnichannel.md +docs/Model/ErrorItemPhonebook.md +docs/Model/ErrorItemStatistics.md +docs/Model/ErrorNumberLookup.md +docs/Model/ErrorOmnichannel.md +docs/Model/ErrorPhonebook.md +docs/Model/ErrorStatistics.md +docs/Model/ErrorTitleOmnichannel.md +docs/Model/ErrorTitlePhonebook.md +docs/Model/FetchBlacklistSuccess.md +docs/Model/GroupEnvelope.md +docs/Model/GroupListEnvelope.md +docs/Model/GroupName.md +docs/Model/GroupResponseFields.md +docs/Model/MessageResult.md +docs/Model/MobileNetwork.md +docs/Model/NumberToBlacklist.md +docs/Model/NumbersToInvestigate.md +docs/Model/OmniMessageCreateSuccessResponse.md +docs/Model/Omnimessage.md +docs/Model/Priority.md +docs/Model/SMS.md +docs/Model/StatisticsReport.md +docs/Model/StatisticsReportSettings.md +docs/Model/StatisticsReportSuccess.md +docs/Model/Status.md +docs/Model/SyncNumberLookupResult.md +docs/Model/SyncNumberLookupSuccess.md +docs/Model/Telegram.md +docs/Model/TextStore.md +docs/Model/Viber.md +docs/Model/WhatsApp.md +docs/Model/WhatsAppAudio.md +docs/Model/WhatsAppDocument.md +docs/Model/WhatsAppImage.md +docs/Model/WhatsAppText.md +git_push.sh +lib/Api/BlacklistApi.php +lib/Api/ContactsApi.php +lib/Api/DeliveryReportApi.php +lib/Api/GroupsApi.php +lib/Api/NumberLookupApi.php +lib/Api/OmnimessageApi.php +lib/Api/StatisticsApi.php +lib/ApiException.php +lib/Configuration.php +lib/HeaderSelector.php +lib/Model/Channel.php +lib/Model/ContactEnvelope.php +lib/Model/ContactFields.php +lib/Model/ContactListEnvelope.php +lib/Model/ContactResponseFields.php +lib/Model/ContactUpdateFields.php +lib/Model/DeliveryReportResponse.php +lib/Model/DeliveryResult.php +lib/Model/ErrorCodeOmnichannel.php +lib/Model/ErrorCodeOmnichannelMachine.php +lib/Model/ErrorCodePhonebook.php +lib/Model/ErrorCodeStatistics.php +lib/Model/ErrorItemNumberLookup.php +lib/Model/ErrorItemNumberLookupError.php +lib/Model/ErrorItemOmnichannel.php +lib/Model/ErrorItemPhonebook.php +lib/Model/ErrorItemStatistics.php +lib/Model/ErrorNumberLookup.php +lib/Model/ErrorOmnichannel.php +lib/Model/ErrorPhonebook.php +lib/Model/ErrorStatistics.php +lib/Model/ErrorTitleOmnichannel.php +lib/Model/ErrorTitlePhonebook.php +lib/Model/FetchBlacklistSuccess.php +lib/Model/GroupEnvelope.php +lib/Model/GroupListEnvelope.php +lib/Model/GroupName.php +lib/Model/GroupResponseFields.php +lib/Model/MessageResult.php +lib/Model/MobileNetwork.php +lib/Model/ModelInterface.php +lib/Model/NumberToBlacklist.php +lib/Model/NumbersToInvestigate.php +lib/Model/OmniMessageCreateSuccessResponse.php +lib/Model/Omnimessage.php +lib/Model/Priority.php +lib/Model/SMS.php +lib/Model/StatisticsReport.php +lib/Model/StatisticsReportSettings.php +lib/Model/StatisticsReportSuccess.php +lib/Model/Status.php +lib/Model/SyncNumberLookupResult.php +lib/Model/SyncNumberLookupSuccess.php +lib/Model/Telegram.php +lib/Model/TextStore.php +lib/Model/Viber.php +lib/Model/WhatsApp.php +lib/Model/WhatsAppAudio.php +lib/Model/WhatsAppDocument.php +lib/Model/WhatsAppImage.php +lib/Model/WhatsAppText.php +lib/ObjectSerializer.php +phpunit.xml.dist +test/Api/BlacklistApiTest.php +test/Api/ContactsApiTest.php +test/Api/DeliveryReportApiTest.php +test/Api/GroupsApiTest.php +test/Api/NumberLookupApiTest.php +test/Api/OmnimessageApiTest.php +test/Api/StatisticsApiTest.php +test/Model/ChannelTest.php +test/Model/ContactEnvelopeTest.php +test/Model/ContactFieldsTest.php +test/Model/ContactListEnvelopeTest.php +test/Model/ContactResponseFieldsTest.php +test/Model/ContactUpdateFieldsTest.php +test/Model/DeliveryReportResponseTest.php +test/Model/DeliveryResultTest.php +test/Model/ErrorCodeOmnichannelMachineTest.php +test/Model/ErrorCodeOmnichannelTest.php +test/Model/ErrorCodePhonebookTest.php +test/Model/ErrorCodeStatisticsTest.php +test/Model/ErrorItemNumberLookupErrorTest.php +test/Model/ErrorItemNumberLookupTest.php +test/Model/ErrorItemOmnichannelTest.php +test/Model/ErrorItemPhonebookTest.php +test/Model/ErrorItemStatisticsTest.php +test/Model/ErrorNumberLookupTest.php +test/Model/ErrorOmnichannelTest.php +test/Model/ErrorPhonebookTest.php +test/Model/ErrorStatisticsTest.php +test/Model/ErrorTitleOmnichannelTest.php +test/Model/ErrorTitlePhonebookTest.php +test/Model/FetchBlacklistSuccessTest.php +test/Model/GroupEnvelopeTest.php +test/Model/GroupListEnvelopeTest.php +test/Model/GroupNameTest.php +test/Model/GroupResponseFieldsTest.php +test/Model/MessageResultTest.php +test/Model/MobileNetworkTest.php +test/Model/NumberToBlacklistTest.php +test/Model/NumbersToInvestigateTest.php +test/Model/OmniMessageCreateSuccessResponseTest.php +test/Model/OmnimessageTest.php +test/Model/PriorityTest.php +test/Model/SMSTest.php +test/Model/StatisticsReportSettingsTest.php +test/Model/StatisticsReportSuccessTest.php +test/Model/StatisticsReportTest.php +test/Model/StatusTest.php +test/Model/SyncNumberLookupResultTest.php +test/Model/SyncNumberLookupSuccessTest.php +test/Model/TelegramTest.php +test/Model/TextStoreTest.php +test/Model/ViberTest.php +test/Model/WhatsAppAudioTest.php +test/Model/WhatsAppDocumentTest.php +test/Model/WhatsAppImageTest.php +test/Model/WhatsAppTest.php +test/Model/WhatsAppTextTest.php diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index aa31e71..e230c83 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.3 \ No newline at end of file +5.3.0 \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index d77f382..714772e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,9 @@ language: php -sudo: false +# Bionic environment has preinstalled PHP from 7.1 to 7.4 +# https://docs.travis-ci.com/user/reference/bionic/#php-support +dist: bionic php: - - 5.4 - - 5.5 - - 5.6 - - 7.0 - - hhvm + - 7.3 + - 7.4 before_install: "composer install" script: "vendor/bin/phpunit" diff --git a/README.md b/README.md index 903f149..b8b1fcc 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Messente API Library -- Messente API version: 1.4.0 -- PHP artifact version: 1.4.0 +- Messente API version: 2.0.0 +- PHP artifact version: 2.0.0 [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. 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 ff0e769..78b3564 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "messente/messente-api-php", - "version": "1.4.0", + "version": "2.0.0", "description": "[Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world.", "keywords": ["viber", "telegram", "sms", "whatsapp", "phonebook", "openapitools", "openapi-generator", diff --git a/docs/Api/BlacklistApi.md b/docs/Api/BlacklistApi.md index 1018d6b..7bd8656 100644 --- a/docs/Api/BlacklistApi.md +++ b/docs/Api/BlacklistApi.md @@ -1,19 +1,20 @@ # Messente\Api\BlacklistApi -All URIs are relative to *https://api.messente.com/v1* +All URIs are relative to https://api.messente.com/v1. Method | HTTP request | Description ------------- | ------------- | ------------- -[**addToBlacklist**](BlacklistApi.md#addToBlacklist) | **POST** /phonebook/blacklist | Adds a phone number to the blacklist -[**deleteFromBlacklist**](BlacklistApi.md#deleteFromBlacklist) | **DELETE** /phonebook/blacklist/{phone} | Deletes a phone number from the blacklist -[**fetchBlacklist**](BlacklistApi.md#fetchBlacklist) | **GET** /phonebook/blacklist | Returns all blacklisted phone numbers -[**isBlacklisted**](BlacklistApi.md#isBlacklisted) | **GET** /phonebook/blacklist/{phone} | Checks if a phone number is blacklisted +[**addToBlacklist()**](BlacklistApi.md#addToBlacklist) | **POST** /phonebook/blacklist | Adds a phone number to the blacklist +[**deleteFromBlacklist()**](BlacklistApi.md#deleteFromBlacklist) | **DELETE** /phonebook/blacklist/{phone} | Deletes a phone number from the blacklist +[**fetchBlacklist()**](BlacklistApi.md#fetchBlacklist) | **GET** /phonebook/blacklist | Returns all blacklisted phone numbers +[**isBlacklisted()**](BlacklistApi.md#isBlacklisted) | **GET** /phonebook/blacklist/{phone} | Checks if a phone number is blacklisted +## `addToBlacklist()` -## addToBlacklist - -> addToBlacklist($numberToBlacklist) +```php +addToBlacklist($numberToBlacklist) +``` Adds a phone number to the blacklist @@ -43,12 +44,10 @@ try { } catch (Exception $e) { echo 'Exception when calling BlacklistApi->addToBlacklist: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **numberToBlacklist** | [**\Messente\Api\Model\NumberToBlacklist**](../Model/NumberToBlacklist.md)| Phone number to be blacklisted | @@ -63,17 +62,18 @@ void (empty response body) ### HTTP request headers -- **Content-Type**: application/json -- **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `deleteFromBlacklist()` -## deleteFromBlacklist - -> deleteFromBlacklist($phone) +```php +deleteFromBlacklist($phone) +``` Deletes a phone number from the blacklist @@ -103,12 +103,10 @@ try { } catch (Exception $e) { echo 'Exception when calling BlacklistApi->deleteFromBlacklist: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **phone** | **string**| A phone number | @@ -124,16 +122,17 @@ void (empty response body) ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `fetchBlacklist()` -## fetchBlacklist - -> \Messente\Api\Model\FetchBlacklistSuccess fetchBlacklist() +```php +fetchBlacklist(): \Messente\Api\Model\FetchBlacklistSuccess +``` Returns all blacklisted phone numbers @@ -163,7 +162,6 @@ try { } catch (Exception $e) { echo 'Exception when calling BlacklistApi->fetchBlacklist: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters @@ -181,16 +179,17 @@ This endpoint does not need any parameter. ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `isBlacklisted()` -## isBlacklisted - -> isBlacklisted($phone) +```php +isBlacklisted($phone) +``` Checks if a phone number is blacklisted @@ -220,12 +219,10 @@ try { } catch (Exception $e) { echo 'Exception when calling BlacklistApi->isBlacklisted: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **phone** | **string**| A phone number | @@ -241,9 +238,8 @@ void (empty response body) ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) - diff --git a/docs/Api/ContactsApi.md b/docs/Api/ContactsApi.md index 4bf5349..970e008 100644 --- a/docs/Api/ContactsApi.md +++ b/docs/Api/ContactsApi.md @@ -1,23 +1,24 @@ # Messente\Api\ContactsApi -All URIs are relative to *https://api.messente.com/v1* +All URIs are relative to https://api.messente.com/v1. Method | HTTP request | Description ------------- | ------------- | ------------- -[**addContactToGroup**](ContactsApi.md#addContactToGroup) | **POST** /phonebook/groups/{groupId}/contacts/{phone} | Adds a contact to a group -[**createContact**](ContactsApi.md#createContact) | **POST** /phonebook/contacts | Creates a new contact -[**deleteContact**](ContactsApi.md#deleteContact) | **DELETE** /phonebook/contacts/{phone} | Deletes a contact -[**fetchContact**](ContactsApi.md#fetchContact) | **GET** /phonebook/contacts/{phone} | Lists a contact -[**fetchContactGroups**](ContactsApi.md#fetchContactGroups) | **GET** /phonebook/contacts/{phone}/groups | Lists groups of a contact -[**fetchContacts**](ContactsApi.md#fetchContacts) | **GET** /phonebook/contacts | Returns all contacts -[**removeContactFromGroup**](ContactsApi.md#removeContactFromGroup) | **DELETE** /phonebook/groups/{groupId}/contacts/{phone} | Removes a contact from a group -[**updateContact**](ContactsApi.md#updateContact) | **PATCH** /phonebook/contacts/{phone} | Updates a contact +[**addContactToGroup()**](ContactsApi.md#addContactToGroup) | **POST** /phonebook/groups/{groupId}/contacts/{phone} | Adds a contact to a group +[**createContact()**](ContactsApi.md#createContact) | **POST** /phonebook/contacts | Creates a new contact +[**deleteContact()**](ContactsApi.md#deleteContact) | **DELETE** /phonebook/contacts/{phone} | Deletes a contact +[**fetchContact()**](ContactsApi.md#fetchContact) | **GET** /phonebook/contacts/{phone} | Lists a contact +[**fetchContactGroups()**](ContactsApi.md#fetchContactGroups) | **GET** /phonebook/contacts/{phone}/groups | Lists groups of a contact +[**fetchContacts()**](ContactsApi.md#fetchContacts) | **GET** /phonebook/contacts | Returns all contacts +[**removeContactFromGroup()**](ContactsApi.md#removeContactFromGroup) | **DELETE** /phonebook/groups/{groupId}/contacts/{phone} | Removes a contact from a group +[**updateContact()**](ContactsApi.md#updateContact) | **PATCH** /phonebook/contacts/{phone} | Updates a contact +## `addContactToGroup()` -## addContactToGroup - -> object addContactToGroup($groupId, $phone) +```php +addContactToGroup($groupId, $phone): object +``` Adds a contact to a group @@ -49,12 +50,10 @@ try { } catch (Exception $e) { echo 'Exception when calling ContactsApi->addContactToGroup: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **groupId** | **string**| String in UUID format | @@ -71,16 +70,17 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `createContact()` -## createContact - -> \Messente\Api\Model\ContactEnvelope createContact($contactFields) +```php +createContact($contactFields): \Messente\Api\Model\ContactEnvelope +``` Creates a new contact @@ -103,7 +103,7 @@ $apiInstance = new Messente\Api\Api\ContactsApi( new GuzzleHttp\Client(), $config ); -$contactFields = {"phoneNumber":"+37251000000","email":"anyone@messente.com","firstName":"Any","lastName":"One","company":"Messente","title":"Sir","custom":"Any custom","custom2":"Any custom two","custom3":"Any custom three","custom4":"Any custom four"}; // \Messente\Api\Model\ContactFields | +$contactFields = {"phoneNumber":"+37251000000","email":"anyone@messente.com","firstName":"Any","lastName":"One","company":"Messente","title":"Sir","custom":"Any custom","custom2":"Any custom two","custom3":"Any custom three","custom4":"Any custom four"}; // \Messente\Api\Model\ContactFields try { $result = $apiInstance->createContact($contactFields); @@ -111,12 +111,10 @@ try { } catch (Exception $e) { echo 'Exception when calling ContactsApi->createContact: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **contactFields** | [**\Messente\Api\Model\ContactFields**](../Model/ContactFields.md)| | @@ -131,17 +129,18 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: application/json -- **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `deleteContact()` -## deleteContact - -> deleteContact($phone) +```php +deleteContact($phone) +``` Deletes a contact @@ -171,12 +170,10 @@ try { } catch (Exception $e) { echo 'Exception when calling ContactsApi->deleteContact: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **phone** | **string**| A phone number | @@ -192,16 +189,17 @@ void (empty response body) ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `fetchContact()` -## fetchContact - -> \Messente\Api\Model\ContactEnvelope fetchContact($phone) +```php +fetchContact($phone): \Messente\Api\Model\ContactEnvelope +``` Lists a contact @@ -232,12 +230,10 @@ try { } catch (Exception $e) { echo 'Exception when calling ContactsApi->fetchContact: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **phone** | **string**| A phone number | @@ -253,16 +249,17 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `fetchContactGroups()` -## fetchContactGroups - -> \Messente\Api\Model\GroupListEnvelope fetchContactGroups($phone) +```php +fetchContactGroups($phone): \Messente\Api\Model\GroupListEnvelope +``` Lists groups of a contact @@ -293,12 +290,10 @@ try { } catch (Exception $e) { echo 'Exception when calling ContactsApi->fetchContactGroups: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **phone** | **string**| A phone number | @@ -314,16 +309,17 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `fetchContacts()` -## fetchContacts - -> \Messente\Api\Model\ContactListEnvelope fetchContacts($groupIds) +```php +fetchContacts($groupIds): \Messente\Api\Model\ContactListEnvelope +``` Returns all contacts @@ -354,12 +350,10 @@ try { } catch (Exception $e) { echo 'Exception when calling ContactsApi->fetchContacts: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **groupIds** | [**string[]**](../Model/string.md)| Optional one or many group id strings in UUID format. For example: \"/contacts?groupIds=group_id_one&groupIds=group_id_two\" | [optional] @@ -375,16 +369,17 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `removeContactFromGroup()` -## removeContactFromGroup - -> removeContactFromGroup($groupId, $phone) +```php +removeContactFromGroup($groupId, $phone) +``` Removes a contact from a group @@ -415,12 +410,10 @@ try { } catch (Exception $e) { echo 'Exception when calling ContactsApi->removeContactFromGroup: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **groupId** | **string**| String in UUID format | @@ -437,16 +430,17 @@ void (empty response body) ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `updateContact()` -## updateContact - -> \Messente\Api\Model\ContactEnvelope updateContact($phone, $contactUpdateFields) +```php +updateContact($phone, $contactUpdateFields): \Messente\Api\Model\ContactEnvelope +``` Updates a contact @@ -470,7 +464,7 @@ $apiInstance = new Messente\Api\Api\ContactsApi( $config ); $phone = +37251000000; // string | A phone number -$contactUpdateFields = {"email":"anyone@messente.com","firstName":"Any","lastName":"One","company":"Messente","title":"Sir","custom":"Any custom","custom2":"Any custom two","custom3":"Any custom three","custom4":"Any custom four"}; // \Messente\Api\Model\ContactUpdateFields | +$contactUpdateFields = {"email":"anyone@messente.com","firstName":"Any","lastName":"One","company":"Messente","title":"Sir","custom":"Any custom","custom2":"Any custom two","custom3":"Any custom three","custom4":"Any custom four"}; // \Messente\Api\Model\ContactUpdateFields try { $result = $apiInstance->updateContact($phone, $contactUpdateFields); @@ -478,12 +472,10 @@ try { } catch (Exception $e) { echo 'Exception when calling ContactsApi->updateContact: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **phone** | **string**| A phone number | @@ -499,10 +491,9 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: application/json -- **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) - diff --git a/docs/Api/DeliveryReportApi.md b/docs/Api/DeliveryReportApi.md index 7c2d10e..ef62c6f 100644 --- a/docs/Api/DeliveryReportApi.md +++ b/docs/Api/DeliveryReportApi.md @@ -1,16 +1,17 @@ # Messente\Api\DeliveryReportApi -All URIs are relative to *https://api.messente.com/v1* +All URIs are relative to https://api.messente.com/v1. Method | HTTP request | Description ------------- | ------------- | ------------- -[**retrieveDeliveryReport**](DeliveryReportApi.md#retrieveDeliveryReport) | **GET** /omnimessage/{omnimessageId}/status | Retrieves the delivery report for the Omnimessage +[**retrieveDeliveryReport()**](DeliveryReportApi.md#retrieveDeliveryReport) | **GET** /omnimessage/{omnimessageId}/status | Retrieves the delivery report for the Omnimessage +## `retrieveDeliveryReport()` -## retrieveDeliveryReport - -> \Messente\Api\Model\DeliveryReportResponse retrieveDeliveryReport($omnimessageId) +```php +retrieveDeliveryReport($omnimessageId): \Messente\Api\Model\DeliveryReportResponse +``` Retrieves the delivery report for the Omnimessage @@ -41,12 +42,10 @@ try { } catch (Exception $e) { echo 'Exception when calling DeliveryReportApi->retrieveDeliveryReport: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **omnimessageId** | **string**| UUID of the omnimessage to for which the delivery report is to be retrieved | @@ -62,9 +61,8 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) - diff --git a/docs/Api/GroupsApi.md b/docs/Api/GroupsApi.md index 5e910c5..f511a0e 100644 --- a/docs/Api/GroupsApi.md +++ b/docs/Api/GroupsApi.md @@ -1,20 +1,21 @@ # Messente\Api\GroupsApi -All URIs are relative to *https://api.messente.com/v1* +All URIs are relative to https://api.messente.com/v1. Method | HTTP request | Description ------------- | ------------- | ------------- -[**createGroup**](GroupsApi.md#createGroup) | **POST** /phonebook/groups | Creates a new group with the provided name -[**deleteGroup**](GroupsApi.md#deleteGroup) | **DELETE** /phonebook/groups/{groupId} | Deletes a group -[**fetchGroup**](GroupsApi.md#fetchGroup) | **GET** /phonebook/groups/{groupId} | Lists a group -[**fetchGroups**](GroupsApi.md#fetchGroups) | **GET** /phonebook/groups | Returns all groups -[**updateGroup**](GroupsApi.md#updateGroup) | **PUT** /phonebook/groups/{groupId} | Updates a group with the provided name +[**createGroup()**](GroupsApi.md#createGroup) | **POST** /phonebook/groups | Creates a new group with the provided name +[**deleteGroup()**](GroupsApi.md#deleteGroup) | **DELETE** /phonebook/groups/{groupId} | Deletes a group +[**fetchGroup()**](GroupsApi.md#fetchGroup) | **GET** /phonebook/groups/{groupId} | Lists a group +[**fetchGroups()**](GroupsApi.md#fetchGroups) | **GET** /phonebook/groups | Returns all groups +[**updateGroup()**](GroupsApi.md#updateGroup) | **PUT** /phonebook/groups/{groupId} | Updates a group with the provided name +## `createGroup()` -## createGroup - -> \Messente\Api\Model\GroupEnvelope createGroup($groupName) +```php +createGroup($groupName): \Messente\Api\Model\GroupEnvelope +``` Creates a new group with the provided name @@ -37,7 +38,7 @@ $apiInstance = new Messente\Api\Api\GroupsApi( new GuzzleHttp\Client(), $config ); -$groupName = {"name":"Any group name"}; // \Messente\Api\Model\GroupName | +$groupName = {"name":"Any group name"}; // \Messente\Api\Model\GroupName try { $result = $apiInstance->createGroup($groupName); @@ -45,12 +46,10 @@ try { } catch (Exception $e) { echo 'Exception when calling GroupsApi->createGroup: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **groupName** | [**\Messente\Api\Model\GroupName**](../Model/GroupName.md)| | @@ -65,17 +64,18 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: application/json -- **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `deleteGroup()` -## deleteGroup - -> deleteGroup($groupId) +```php +deleteGroup($groupId) +``` Deletes a group @@ -105,12 +105,10 @@ try { } catch (Exception $e) { echo 'Exception when calling GroupsApi->deleteGroup: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **groupId** | **string**| String in UUID format | @@ -126,16 +124,17 @@ void (empty response body) ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `fetchGroup()` -## fetchGroup - -> \Messente\Api\Model\GroupEnvelope fetchGroup($groupId) +```php +fetchGroup($groupId): \Messente\Api\Model\GroupEnvelope +``` Lists a group @@ -166,12 +165,10 @@ try { } catch (Exception $e) { echo 'Exception when calling GroupsApi->fetchGroup: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **groupId** | **string**| String in UUID format | @@ -187,16 +184,17 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `fetchGroups()` -## fetchGroups - -> \Messente\Api\Model\GroupListEnvelope fetchGroups() +```php +fetchGroups(): \Messente\Api\Model\GroupListEnvelope +``` Returns all groups @@ -226,7 +224,6 @@ try { } catch (Exception $e) { echo 'Exception when calling GroupsApi->fetchGroups: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters @@ -244,16 +241,17 @@ This endpoint does not need any parameter. ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `updateGroup()` -## updateGroup - -> \Messente\Api\Model\GroupEnvelope updateGroup($groupId, $groupName) +```php +updateGroup($groupId, $groupName): \Messente\Api\Model\GroupEnvelope +``` Updates a group with the provided name @@ -277,7 +275,7 @@ $apiInstance = new Messente\Api\Api\GroupsApi( $config ); $groupId = 5792a02a-e5c2-422b-a0a0-0ae65d814663; // string | String in UUID format -$groupName = {"name":"Any group name"}; // \Messente\Api\Model\GroupName | +$groupName = {"name":"Any group name"}; // \Messente\Api\Model\GroupName try { $result = $apiInstance->updateGroup($groupId, $groupName); @@ -285,12 +283,10 @@ try { } catch (Exception $e) { echo 'Exception when calling GroupsApi->updateGroup: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **groupId** | **string**| String in UUID format | @@ -306,10 +302,9 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: application/json -- **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) - diff --git a/docs/Api/NumberLookupApi.md b/docs/Api/NumberLookupApi.md index 4b3088d..c671dfe 100644 --- a/docs/Api/NumberLookupApi.md +++ b/docs/Api/NumberLookupApi.md @@ -1,16 +1,17 @@ # Messente\Api\NumberLookupApi -All URIs are relative to *https://api.messente.com/v1* +All URIs are relative to https://api.messente.com/v1. Method | HTTP request | Description ------------- | ------------- | ------------- -[**fetchInfo**](NumberLookupApi.md#fetchInfo) | **POST** /hlr/sync | Requests info about phone numbers +[**fetchInfo()**](NumberLookupApi.md#fetchInfo) | **POST** /hlr/sync | Requests info about phone numbers +## `fetchInfo()` -## fetchInfo - -> \Messente\Api\Model\SyncNumberLookupSuccess fetchInfo($numbersToInvestigate) +```php +fetchInfo($numbersToInvestigate): \Messente\Api\Model\SyncNumberLookupSuccess +``` Requests info about phone numbers @@ -41,12 +42,10 @@ try { } catch (Exception $e) { echo 'Exception when calling NumberLookupApi->fetchInfo: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **numbersToInvestigate** | [**\Messente\Api\Model\NumbersToInvestigate**](../Model/NumbersToInvestigate.md)| Numbers for lookup | @@ -61,10 +60,9 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: application/json -- **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) - diff --git a/docs/Api/OmnimessageApi.md b/docs/Api/OmnimessageApi.md index 95c84e9..c07dc9b 100644 --- a/docs/Api/OmnimessageApi.md +++ b/docs/Api/OmnimessageApi.md @@ -1,17 +1,18 @@ # Messente\Api\OmnimessageApi -All URIs are relative to *https://api.messente.com/v1* +All URIs are relative to https://api.messente.com/v1. Method | HTTP request | Description ------------- | ------------- | ------------- -[**cancelScheduledMessage**](OmnimessageApi.md#cancelScheduledMessage) | **DELETE** /omnimessage/{omnimessageId} | Cancels a scheduled Omnimessage -[**sendOmnimessage**](OmnimessageApi.md#sendOmnimessage) | **POST** /omnimessage | Sends an Omnimessage +[**cancelScheduledMessage()**](OmnimessageApi.md#cancelScheduledMessage) | **DELETE** /omnimessage/{omnimessageId} | Cancels a scheduled Omnimessage +[**sendOmnimessage()**](OmnimessageApi.md#sendOmnimessage) | **POST** /omnimessage | Sends an Omnimessage +## `cancelScheduledMessage()` -## cancelScheduledMessage - -> object cancelScheduledMessage($omnimessageId) +```php +cancelScheduledMessage($omnimessageId): object +``` Cancels a scheduled Omnimessage @@ -42,12 +43,10 @@ try { } catch (Exception $e) { echo 'Exception when calling OmnimessageApi->cancelScheduledMessage: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **omnimessageId** | **string**| UUID of the scheduled omnimessage to be cancelled | @@ -63,16 +62,17 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `sendOmnimessage()` -## sendOmnimessage - -> \Messente\Api\Model\OmniMessageCreateSuccessResponse sendOmnimessage($omnimessage) +```php +sendOmnimessage($omnimessage): \Messente\Api\Model\OmniMessageCreateSuccessResponse +``` Sends an Omnimessage @@ -103,12 +103,10 @@ try { } catch (Exception $e) { echo 'Exception when calling OmnimessageApi->sendOmnimessage: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **omnimessage** | [**\Messente\Api\Model\Omnimessage**](../Model/Omnimessage.md)| Omnimessage to be sent | @@ -123,10 +121,9 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: application/json -- **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) - diff --git a/docs/Api/StatisticsApi.md b/docs/Api/StatisticsApi.md index c6cd0a4..4cfe438 100644 --- a/docs/Api/StatisticsApi.md +++ b/docs/Api/StatisticsApi.md @@ -1,16 +1,17 @@ # Messente\Api\StatisticsApi -All URIs are relative to *https://api.messente.com/v1* +All URIs are relative to https://api.messente.com/v1. Method | HTTP request | Description ------------- | ------------- | ------------- -[**createStatisticsReport**](StatisticsApi.md#createStatisticsReport) | **POST** /statistics/reports | Requests statistics reports for each country +[**createStatisticsReport()**](StatisticsApi.md#createStatisticsReport) | **POST** /statistics/reports | Requests statistics reports for each country +## `createStatisticsReport()` -## createStatisticsReport - -> \Messente\Api\Model\StatisticsReportSuccess createStatisticsReport($statisticsReportSettings) +```php +createStatisticsReport($statisticsReportSettings): \Messente\Api\Model\StatisticsReportSuccess +``` Requests statistics reports for each country @@ -41,12 +42,10 @@ try { } catch (Exception $e) { echo 'Exception when calling StatisticsApi->createStatisticsReport: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **statisticsReportSettings** | [**\Messente\Api\Model\StatisticsReportSettings**](../Model/StatisticsReportSettings.md)| Settings for statistics report | @@ -61,10 +60,9 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: application/json -- **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) - diff --git a/docs/Model/Channel.md b/docs/Model/Channel.md index 7028070..866cd4a 100644 --- a/docs/Model/Channel.md +++ b/docs/Model/Channel.md @@ -5,6 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContactEnvelope.md b/docs/Model/ContactEnvelope.md index 65a43bc..c86b00d 100644 --- a/docs/Model/ContactEnvelope.md +++ b/docs/Model/ContactEnvelope.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**contact** | [**\Messente\Api\Model\ContactResponseFields**](ContactResponseFields.md) | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**contact** | [**\Messente\Api\Model\ContactResponseFields**](ContactResponseFields.md) | | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContactFields.md b/docs/Model/ContactFields.md index 70e6c2f..5f5e1a3 100644 --- a/docs/Model/ContactFields.md +++ b/docs/Model/ContactFields.md @@ -4,17 +4,15 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**phoneNumber** | **string** | Phone number in e.164 format | -**email** | **string** | The email of the contact | [optional] -**firstName** | **string** | The first name of the contact | [optional] -**lastName** | **string** | The last name of the contact | [optional] -**company** | **string** | The company of the contact | [optional] -**title** | **string** | The title of the contact | [optional] -**custom** | **string** | The first custom field | [optional] -**custom2** | **string** | The second custom field | [optional] -**custom3** | **string** | The third custom field | [optional] -**custom4** | **string** | The fourth custom field | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**phoneNumber** | **string** | Phone number in e.164 format | +**email** | **string** | The email of the contact | [optional] +**firstName** | **string** | The first name of the contact | [optional] +**lastName** | **string** | The last name of the contact | [optional] +**company** | **string** | The company of the contact | [optional] +**title** | **string** | The title of the contact | [optional] +**custom** | **string** | The first custom field | [optional] +**custom2** | **string** | The second custom field | [optional] +**custom3** | **string** | The third custom field | [optional] +**custom4** | **string** | The fourth custom field | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContactListEnvelope.md b/docs/Model/ContactListEnvelope.md index ed0764f..0ad220a 100644 --- a/docs/Model/ContactListEnvelope.md +++ b/docs/Model/ContactListEnvelope.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**contacts** | [**\Messente\Api\Model\ContactResponseFields[]**](ContactResponseFields.md) | An array of contacts | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**contacts** | [**\Messente\Api\Model\ContactResponseFields[]**](ContactResponseFields.md) | An array of contacts | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContactResponseFields.md b/docs/Model/ContactResponseFields.md index c0b42b2..d9ed0a8 100644 --- a/docs/Model/ContactResponseFields.md +++ b/docs/Model/ContactResponseFields.md @@ -4,18 +4,16 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**phoneNumber** | **string** | Phone number in e.164 format | [optional] -**email** | **string** | The email of the contact | [optional] -**firstName** | **string** | The first name of the contact | [optional] -**lastName** | **string** | The last name of the contact | [optional] -**company** | **string** | The company of the contact | [optional] -**title** | **string** | The title of the contact | [optional] -**custom** | **string** | The first custom field | [optional] -**custom2** | **string** | The second custom field | [optional] -**custom3** | **string** | The third custom field | [optional] -**custom4** | **string** | The fourth custom field | [optional] -**scheduledDeletionDate** | [**\DateTime**](\DateTime.md) | The date in ISO 8601 format, YYYY-MM-DD, on which the contact is going to be deleted because it has not belonged to a group for 30 days | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**phoneNumber** | **string** | Phone number in e.164 format | [optional] +**email** | **string** | The email of the contact | [optional] +**firstName** | **string** | The first name of the contact | [optional] +**lastName** | **string** | The last name of the contact | [optional] +**company** | **string** | The company of the contact | [optional] +**title** | **string** | The title of the contact | [optional] +**custom** | **string** | The first custom field | [optional] +**custom2** | **string** | The second custom field | [optional] +**custom3** | **string** | The third custom field | [optional] +**custom4** | **string** | The fourth custom field | [optional] +**scheduledDeletionDate** | **\DateTime** | The date in ISO 8601 format, YYYY-MM-DD, on which the contact is going to be deleted because it has not belonged to a group for 30 days | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContactUpdateFields.md b/docs/Model/ContactUpdateFields.md index 2d004cc..1110f27 100644 --- a/docs/Model/ContactUpdateFields.md +++ b/docs/Model/ContactUpdateFields.md @@ -4,16 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**email** | **string** | The email of the contact | [optional] -**firstName** | **string** | The first name of the contact | [optional] -**lastName** | **string** | The last name of the contact | [optional] -**company** | **string** | The company of the contact | [optional] -**title** | **string** | The title of the contact | [optional] -**custom** | **string** | The first custom field | [optional] -**custom2** | **string** | The second custom field | [optional] -**custom3** | **string** | The third custom field | [optional] -**custom4** | **string** | The fourth custom field | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**email** | **string** | The email of the contact | [optional] +**firstName** | **string** | The first name of the contact | [optional] +**lastName** | **string** | The last name of the contact | [optional] +**company** | **string** | The company of the contact | [optional] +**title** | **string** | The title of the contact | [optional] +**custom** | **string** | The first custom field | [optional] +**custom2** | **string** | The second custom field | [optional] +**custom3** | **string** | The third custom field | [optional] +**custom4** | **string** | The fourth custom field | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeliveryReportResponse.md b/docs/Model/DeliveryReportResponse.md index 8d5a0cd..0dc0688 100644 --- a/docs/Model/DeliveryReportResponse.md +++ b/docs/Model/DeliveryReportResponse.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**statuses** | [**\Messente\Api\Model\DeliveryResult[]**](DeliveryResult.md) | Contains the delivery reports for each channel, ordered by send order | -**to** | **string** | Phone number in e.164 format | -**omnimessageId** | **string** | Unique identifier for the omnimessage | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**statuses** | [**\Messente\Api\Model\DeliveryResult[]**](DeliveryResult.md) | Contains the delivery reports for each channel, ordered by send order | +**to** | **string** | Phone number in e.164 format | +**omnimessageId** | **string** | Unique identifier for the omnimessage | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeliveryResult.md b/docs/Model/DeliveryResult.md index 7274a16..427c9f2 100644 --- a/docs/Model/DeliveryResult.md +++ b/docs/Model/DeliveryResult.md @@ -4,13 +4,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**status** | [**\Messente\Api\Model\Status**](Status.md) | | [optional] -**channel** | [**\Messente\Api\Model\Channel**](Channel.md) | | [optional] -**messageId** | **string** | Unique identifier for the message | [optional] -**error** | **string** | Human-readable description of what went wrong, *null* in case of success or if the message has not been processed yet | [optional] -**err** | [**\Messente\Api\Model\ErrorCodeOmnichannelMachine**](ErrorCodeOmnichannelMachine.md) | | [optional] -**timestamp** | [**\DateTime**](\DateTime.md) | When this status was received by Omnichannel API | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +**status** | [**\Messente\Api\Model\Status**](Status.md) | | [optional] +**channel** | [**\Messente\Api\Model\Channel**](Channel.md) | | [optional] +**messageId** | **string** | Unique identifier for the message | [optional] +**error** | **string** | Human-readable description of what went wrong, *null* in case of success or if the message has not been processed yet | [optional] +**err** | [**\Messente\Api\Model\ErrorCodeOmnichannelMachine**](ErrorCodeOmnichannelMachine.md) | | [optional] +**timestamp** | **\DateTime** | When this status was received by Omnichannel API | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorCodeOmnichannel.md b/docs/Model/ErrorCodeOmnichannel.md index a8d3477..667281b 100644 --- a/docs/Model/ErrorCodeOmnichannel.md +++ b/docs/Model/ErrorCodeOmnichannel.md @@ -5,6 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorCodeOmnichannelMachine.md b/docs/Model/ErrorCodeOmnichannelMachine.md index 9269270..da84b2d 100644 --- a/docs/Model/ErrorCodeOmnichannelMachine.md +++ b/docs/Model/ErrorCodeOmnichannelMachine.md @@ -5,6 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorCodePhonebook.md b/docs/Model/ErrorCodePhonebook.md index 0718169..d7fe431 100644 --- a/docs/Model/ErrorCodePhonebook.md +++ b/docs/Model/ErrorCodePhonebook.md @@ -5,6 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorCodeStatistics.md b/docs/Model/ErrorCodeStatistics.md index a362880..3ba4cf6 100644 --- a/docs/Model/ErrorCodeStatistics.md +++ b/docs/Model/ErrorCodeStatistics.md @@ -5,6 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorItemNumberLookup.md b/docs/Model/ErrorItemNumberLookup.md index e47dbb7..c923237 100644 --- a/docs/Model/ErrorItemNumberLookup.md +++ b/docs/Model/ErrorItemNumberLookup.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**error** | [**\Messente\Api\Model\ErrorItemNumberLookupError**](ErrorItemNumberLookupError.md) | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**error** | [**\Messente\Api\Model\ErrorItemNumberLookupError**](ErrorItemNumberLookupError.md) | | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorItemNumberLookupError.md b/docs/Model/ErrorItemNumberLookupError.md index a05e7ab..dab852b 100644 --- a/docs/Model/ErrorItemNumberLookupError.md +++ b/docs/Model/ErrorItemNumberLookupError.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**description** | **string** | Error description | -**code** | **int** | Matches the following error title. This field is a constant * 101 - Unauthorized * 102 - Invalid arguments or parameters * 103 - Server error * 104 - Crediting error #1 * 105 - Crediting error #2 * 106 - Client error | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**description** | **string** | Error description | +**code** | **int** | Matches the following error title. This field is a constant * 101 - Unauthorized * 102 - Invalid arguments or parameters * 103 - Server error * 104 - Crediting error #1 * 105 - Crediting error #2 * 106 - Client error | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorItemOmnichannel.md b/docs/Model/ErrorItemOmnichannel.md index 0cafabb..64aec57 100644 --- a/docs/Model/ErrorItemOmnichannel.md +++ b/docs/Model/ErrorItemOmnichannel.md @@ -4,11 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**title** | [**\Messente\Api\Model\ErrorTitleOmnichannel**](ErrorTitleOmnichannel.md) | | -**detail** | **string** | Free form more detailed description of the error | -**code** | [**\Messente\Api\Model\ErrorCodeOmnichannel**](ErrorCodeOmnichannel.md) | | -**source** | **string** | Describes which field is causing the issue in the payload, null for non 400 status code responses | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**title** | [**\Messente\Api\Model\ErrorTitleOmnichannel**](ErrorTitleOmnichannel.md) | | +**detail** | **string** | Free form more detailed description of the error | +**code** | [**\Messente\Api\Model\ErrorCodeOmnichannel**](ErrorCodeOmnichannel.md) | | +**source** | **string** | Describes which field is causing the issue in the payload, null for non 400 status code responses | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorItemPhonebook.md b/docs/Model/ErrorItemPhonebook.md index 73efe06..8ca8880 100644 --- a/docs/Model/ErrorItemPhonebook.md +++ b/docs/Model/ErrorItemPhonebook.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**title** | [**\Messente\Api\Model\ErrorTitlePhonebook**](ErrorTitlePhonebook.md) | | -**detail** | **string** | Free form more detailed description of the error | -**code** | [**\Messente\Api\Model\ErrorCodePhonebook**](ErrorCodePhonebook.md) | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**title** | [**\Messente\Api\Model\ErrorTitlePhonebook**](ErrorTitlePhonebook.md) | | +**detail** | **string** | Free form more detailed description of the error | +**code** | [**\Messente\Api\Model\ErrorCodePhonebook**](ErrorCodePhonebook.md) | | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorItemStatistics.md b/docs/Model/ErrorItemStatistics.md index 6a73f02..62d0e8a 100644 --- a/docs/Model/ErrorItemStatistics.md +++ b/docs/Model/ErrorItemStatistics.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**title** | **string** | Error title | -**details** | **string** | Error details | -**code** | [**\Messente\Api\Model\ErrorCodeStatistics**](ErrorCodeStatistics.md) | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**title** | **string** | Error title | +**details** | **string** | Error details | +**code** | [**\Messente\Api\Model\ErrorCodeStatistics**](ErrorCodeStatistics.md) | | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorNumberLookup.md b/docs/Model/ErrorNumberLookup.md index 4e7f7a3..d8116b4 100644 --- a/docs/Model/ErrorNumberLookup.md +++ b/docs/Model/ErrorNumberLookup.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**errors** | [**\Messente\Api\Model\ErrorItemNumberLookup[]**](ErrorItemNumberLookup.md) | An array of errors | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**errors** | [**\Messente\Api\Model\ErrorItemNumberLookup[]**](ErrorItemNumberLookup.md) | An array of errors | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorOmnichannel.md b/docs/Model/ErrorOmnichannel.md index 9136d9a..fe59aea 100644 --- a/docs/Model/ErrorOmnichannel.md +++ b/docs/Model/ErrorOmnichannel.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**errors** | [**\Messente\Api\Model\ErrorItemOmnichannel[]**](ErrorItemOmnichannel.md) | An array of errors | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**errors** | [**\Messente\Api\Model\ErrorItemOmnichannel[]**](ErrorItemOmnichannel.md) | An array of errors | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorPhonebook.md b/docs/Model/ErrorPhonebook.md index 49e33b6..0345c9e 100644 --- a/docs/Model/ErrorPhonebook.md +++ b/docs/Model/ErrorPhonebook.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**errors** | [**\Messente\Api\Model\ErrorItemPhonebook[]**](ErrorItemPhonebook.md) | An array of errors | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**errors** | [**\Messente\Api\Model\ErrorItemPhonebook[]**](ErrorItemPhonebook.md) | An array of errors | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorStatistics.md b/docs/Model/ErrorStatistics.md index 83cc5f9..3dba2a6 100644 --- a/docs/Model/ErrorStatistics.md +++ b/docs/Model/ErrorStatistics.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**errors** | [**\Messente\Api\Model\ErrorItemStatistics[]**](ErrorItemStatistics.md) | An array of errors | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**errors** | [**\Messente\Api\Model\ErrorItemStatistics[]**](ErrorItemStatistics.md) | An array of errors | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorTitleOmnichannel.md b/docs/Model/ErrorTitleOmnichannel.md index b17deca..25938a8 100644 --- a/docs/Model/ErrorTitleOmnichannel.md +++ b/docs/Model/ErrorTitleOmnichannel.md @@ -5,6 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorTitlePhonebook.md b/docs/Model/ErrorTitlePhonebook.md index 1efae0b..9f4f024 100644 --- a/docs/Model/ErrorTitlePhonebook.md +++ b/docs/Model/ErrorTitlePhonebook.md @@ -5,6 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FetchBlacklistSuccess.md b/docs/Model/FetchBlacklistSuccess.md index 29d467f..36a7fef 100644 --- a/docs/Model/FetchBlacklistSuccess.md +++ b/docs/Model/FetchBlacklistSuccess.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**phoneNumbers** | **string[]** | Array of unique phone numbers | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**phoneNumbers** | **string[]** | Array of unique phone numbers | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GroupEnvelope.md b/docs/Model/GroupEnvelope.md index 421db2c..ed34926 100644 --- a/docs/Model/GroupEnvelope.md +++ b/docs/Model/GroupEnvelope.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**group** | [**\Messente\Api\Model\GroupResponseFields**](GroupResponseFields.md) | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**group** | [**\Messente\Api\Model\GroupResponseFields**](GroupResponseFields.md) | | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GroupListEnvelope.md b/docs/Model/GroupListEnvelope.md index 41a078f..7244a7a 100644 --- a/docs/Model/GroupListEnvelope.md +++ b/docs/Model/GroupListEnvelope.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**groups** | [**\Messente\Api\Model\GroupResponseFields[]**](GroupResponseFields.md) | An array of groups | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**groups** | [**\Messente\Api\Model\GroupResponseFields[]**](GroupResponseFields.md) | An array of groups | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GroupName.md b/docs/Model/GroupName.md index b4ababf..d97a1f0 100644 --- a/docs/Model/GroupName.md +++ b/docs/Model/GroupName.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | **string** | The name of the group | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**name** | **string** | The name of the group | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GroupResponseFields.md b/docs/Model/GroupResponseFields.md index 8bcc09d..c08e03e 100644 --- a/docs/Model/GroupResponseFields.md +++ b/docs/Model/GroupResponseFields.md @@ -4,11 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **string** | Id string in UUID format | -**name** | **string** | The name of the group | -**createdOn** | **string** | When the group was created | [optional] -**contactsCount** | **int** | The count of contacts in the group | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**id** | **string** | Id string in UUID format | +**name** | **string** | The name of the group | +**createdOn** | **string** | When the group was created | [optional] +**contactsCount** | **int** | The count of contacts in the group | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MessageResult.md b/docs/Model/MessageResult.md index 291b60c..b8a4036 100644 --- a/docs/Model/MessageResult.md +++ b/docs/Model/MessageResult.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**messageId** | **string** | Unique identifier for the message | -**channel** | [**\Messente\Api\Model\Channel**](Channel.md) | | -**sender** | **string** | Sender that was used for the message | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**messageId** | **string** | Unique identifier for the message | +**channel** | [**\Messente\Api\Model\Channel**](Channel.md) | | +**sender** | **string** | Sender that was used for the message | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MobileNetwork.md b/docs/Model/MobileNetwork.md index 9f98e1c..f0529f2 100644 --- a/docs/Model/MobileNetwork.md +++ b/docs/Model/MobileNetwork.md @@ -4,12 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**mccmnc** | **string** | Mobile country and mobile network code | [optional] -**networkName** | **string** | Mobile network name | [optional] -**countryName** | **string** | Country name | [optional] -**countryPrefix** | **string** | Country prefix | [optional] -**countryCode** | **string** | Country code | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**mccmnc** | **string** | Mobile country and mobile network code | [optional] +**networkName** | **string** | Mobile network name | [optional] +**countryName** | **string** | Country name | [optional] +**countryPrefix** | **string** | Country prefix | [optional] +**countryCode** | **string** | Country code | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NumberToBlacklist.md b/docs/Model/NumberToBlacklist.md index 15862b1..6b1906a 100644 --- a/docs/Model/NumberToBlacklist.md +++ b/docs/Model/NumberToBlacklist.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**phoneNumber** | **string** | Phone number in e.164 format | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**phoneNumber** | **string** | Phone number in e.164 format | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NumbersToInvestigate.md b/docs/Model/NumbersToInvestigate.md index 75c3611..705faae 100644 --- a/docs/Model/NumbersToInvestigate.md +++ b/docs/Model/NumbersToInvestigate.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**numbers** | **string[]** | Array of phone numbers | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**numbers** | **string[]** | A list of phone numbers. Max 10 numbers per request | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OmniMessageCreateSuccessResponse.md b/docs/Model/OmniMessageCreateSuccessResponse.md index 1b3daa4..6177048 100644 --- a/docs/Model/OmniMessageCreateSuccessResponse.md +++ b/docs/Model/OmniMessageCreateSuccessResponse.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**messages** | [**\Messente\Api\Model\MessageResult[]**](MessageResult.md) | List of messages that compose the omnimessage | -**to** | **string** | Phone number in e.164 format | -**omnimessageId** | **string** | Unique identifier for the omnimessage | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**messages** | [**\Messente\Api\Model\MessageResult[]**](MessageResult.md) | List of messages that compose the omnimessage | +**to** | **string** | Phone number in e.164 format | +**omnimessageId** | **string** | Unique identifier for the omnimessage | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Omnimessage.md b/docs/Model/Omnimessage.md index f2e25fb..9f218f0 100644 --- a/docs/Model/Omnimessage.md +++ b/docs/Model/Omnimessage.md @@ -4,13 +4,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**to** | **string** | Phone number in e.164 format | -**messages** | [**OneOfViberSMSWhatsAppTelegram[]**](OneOfViberSMSWhatsAppTelegram.md) | An array of messages | -**dlrUrl** | **string** | URL where the delivery report will be sent | [optional] -**textStore** | [**\Messente\Api\Model\TextStore**](TextStore.md) | | [optional] -**timeToSend** | [**\DateTime**](\DateTime.md) | Optional parameter for sending messages at some specific time in the future. Time must be specified in the ISO-8601 format. If no timezone is specified, then the timezone is assumed to be UTC Examples: * Time specified with timezone: 2018-06-22T09:05:07+00:00 Time specified in UTC: 2018-06-22T09:05:07Z * Time specified without timezone: 2018-06-22T09:05 (equivalent to 2018-06-22T09:05+00:00) | [optional] -**priority** | [**\Messente\Api\Model\Priority**](Priority.md) | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +**to** | **string** | Phone number in e.164 format | +**messages** | [**OneOfViberSMSWhatsAppTelegram[]**](OneOfViberSMSWhatsAppTelegram.md) | An array of messages | +**dlrUrl** | **string** | URL where the delivery report will be sent | [optional] +**textStore** | [**\Messente\Api\Model\TextStore**](TextStore.md) | | [optional] +**timeToSend** | **\DateTime** | Optional parameter for sending messages at some specific time in the future. Time must be specified in the ISO-8601 format. If no timezone is specified, then the timezone is assumed to be UTC Examples: * Time specified with timezone: 2018-06-22T09:05:07+00:00 Time specified in UTC: 2018-06-22T09:05:07Z * Time specified without timezone: 2018-06-22T09:05 (equivalent to 2018-06-22T09:05+00:00) | [optional] +**priority** | [**\Messente\Api\Model\Priority**](Priority.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Priority.md b/docs/Model/Priority.md index 4a8cbe8..552ead2 100644 --- a/docs/Model/Priority.md +++ b/docs/Model/Priority.md @@ -5,6 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SMS.md b/docs/Model/SMS.md index c25d31f..f0d4c91 100644 --- a/docs/Model/SMS.md +++ b/docs/Model/SMS.md @@ -4,13 +4,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**text** | **string** | Text content of the SMS | -**sender** | **string** | Phone number or alphanumeric sender name | [optional] -**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted | [optional] -**autoconvert** | **string** | Defines how non-GSM characters will be treated: - \"on\" Use replacement settings from the account's [API Auto Replace settings page](https://dashboard.messente.com/api-settings/auto-replace) (default) - \"full\" All non GSM 03.38 characters will be replaced with suitable alternatives - \"off\" Message content is not modified in any way | [optional] -**udh** | **string** | hex-encoded string containing SMS UDH | [optional] +**text** | **string** | Text content of the SMS | +**sender** | **string** | Phone number or alphanumeric sender name | [optional] +**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted | [optional] +**autoconvert** | **string** | Defines how non-GSM characters will be treated: - \"on\" Use replacement settings from the account's [API Auto Replace settings page](https://dashboard.messente.com/api-settings/auto-replace) (default) - \"full\" All non GSM 03.38 characters will be replaced with suitable alternatives - \"off\" Message content is not modified in any way | [optional] +**udh** | **string** | hex-encoded string containing SMS UDH | [optional] **channel** | **string** | The channel used to deliver the message | [optional] [default to 'sms'] -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StatisticsReport.md b/docs/Model/StatisticsReport.md index b646314..283b6b7 100644 --- a/docs/Model/StatisticsReport.md +++ b/docs/Model/StatisticsReport.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**totalMessages** | **int** | Sum of all messages | -**totalPrice** | **string** | Price for all messages | -**country** | **string** | Target country of all messages | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**totalMessages** | **int** | Sum of all messages | +**totalPrice** | **string** | Price for all messages | +**country** | **string** | Target country of all messages | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StatisticsReportSettings.md b/docs/Model/StatisticsReportSettings.md index ad54c58..dc51d8b 100644 --- a/docs/Model/StatisticsReportSettings.md +++ b/docs/Model/StatisticsReportSettings.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**startDate** | [**\DateTime**](\DateTime.md) | Start date for the report | -**endDate** | [**\DateTime**](\DateTime.md) | End date for the report | -**messageTypes** | **string[]** | Optional list of message types (sms, viber, whatsapp, hlr, telegram) | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**startDate** | **\DateTime** | Start date for the report | +**endDate** | **\DateTime** | End date for the report | +**messageTypes** | **string[]** | Optional list of message types (sms, viber, whatsapp, hlr, telegram) | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StatisticsReportSuccess.md b/docs/Model/StatisticsReportSuccess.md index cd98a66..0f78d80 100644 --- a/docs/Model/StatisticsReportSuccess.md +++ b/docs/Model/StatisticsReportSuccess.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**reports** | [**\Messente\Api\Model\StatisticsReport[]**](StatisticsReport.md) | Array of report objects | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**reports** | [**\Messente\Api\Model\StatisticsReport[]**](StatisticsReport.md) | Array of report objects | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Status.md b/docs/Model/Status.md index fb7c6c7..c462142 100644 --- a/docs/Model/Status.md +++ b/docs/Model/Status.md @@ -5,6 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SyncNumberLookupResult.md b/docs/Model/SyncNumberLookupResult.md index 3db52c2..38ba91f 100644 --- a/docs/Model/SyncNumberLookupResult.md +++ b/docs/Model/SyncNumberLookupResult.md @@ -4,16 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**number** | **string** | Phone number in e.164 format | -**roaming** | **bool** | Indicates if a number is roaming | [optional] -**ported** | **bool** | Indicates if a number is ported | [optional] -**roamingNetwork** | [**\Messente\Api\Model\MobileNetwork**](MobileNetwork.md) | | [optional] -**currentNetwork** | [**\Messente\Api\Model\MobileNetwork**](MobileNetwork.md) | | [optional] -**originalNetwork** | [**\Messente\Api\Model\MobileNetwork**](MobileNetwork.md) | | [optional] -**portedNetwork** | [**\Messente\Api\Model\MobileNetwork**](MobileNetwork.md) | | [optional] -**status** | **string** | Status of the phone number | [optional] -**error** | **object** | Indicates if any error occurred while handling the request | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**number** | **string** | Phone number in e.164 format | +**roaming** | **bool** | Indicates if a number is roaming | [optional] +**ported** | **bool** | Indicates if a number is ported | [optional] +**roamingNetwork** | [**\Messente\Api\Model\MobileNetwork**](MobileNetwork.md) | | [optional] +**currentNetwork** | [**\Messente\Api\Model\MobileNetwork**](MobileNetwork.md) | | [optional] +**originalNetwork** | [**\Messente\Api\Model\MobileNetwork**](MobileNetwork.md) | | [optional] +**portedNetwork** | [**\Messente\Api\Model\MobileNetwork**](MobileNetwork.md) | | [optional] +**status** | **string** | Status of the phone number | [optional] +**error** | **mixed** | Indicates if any error occurred while handling the request | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SyncNumberLookupSuccess.md b/docs/Model/SyncNumberLookupSuccess.md index 9b8eae7..debed8f 100644 --- a/docs/Model/SyncNumberLookupSuccess.md +++ b/docs/Model/SyncNumberLookupSuccess.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**requestId** | **string** | ID of the request | -**result** | [**\Messente\Api\Model\SyncNumberLookupResult[]**](SyncNumberLookupResult.md) | A container for phone number info objects | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**requestId** | **string** | ID of the request | +**result** | [**\Messente\Api\Model\SyncNumberLookupResult[]**](SyncNumberLookupResult.md) | A container for phone number info objects | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Telegram.md b/docs/Model/Telegram.md index ee778a0..1debeb9 100644 --- a/docs/Model/Telegram.md +++ b/docs/Model/Telegram.md @@ -4,14 +4,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**sender** | **string** | Phone number or alphanumeric sender name | [optional] -**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted | [optional] -**text** | **string** | Plaintext content for Telegram | [optional] -**imageUrl** | **string** | URL for the embedded image. Mutually exclusive with \"document_url\" and \"audio_url\" | [optional] -**documentUrl** | **string** | URL for the embedded image. Mutually exclusive with \"audio_url\" and \"image_url\" | [optional] -**audioUrl** | **string** | URL for the embedded image. Mutually exclusive with \"document_url\" and \"image_url\" | [optional] +**sender** | **string** | Phone number or alphanumeric sender name | [optional] +**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted | [optional] +**text** | **string** | Plaintext content for Telegram | [optional] +**imageUrl** | **string** | URL for the embedded image. Mutually exclusive with \"document_url\" and \"audio_url\" | [optional] +**documentUrl** | **string** | URL for the embedded image. Mutually exclusive with \"audio_url\" and \"image_url\" | [optional] +**audioUrl** | **string** | URL for the embedded image. Mutually exclusive with \"document_url\" and \"image_url\" | [optional] **channel** | **string** | The channel used to deliver the message | [optional] [default to 'telegram'] -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TextStore.md b/docs/Model/TextStore.md index 8fc3b29..3b2f6f1 100644 --- a/docs/Model/TextStore.md +++ b/docs/Model/TextStore.md @@ -5,6 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Viber.md b/docs/Model/Viber.md index 2a353f2..688a035 100644 --- a/docs/Model/Viber.md +++ b/docs/Model/Viber.md @@ -4,14 +4,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**sender** | **string** | Phone number or alphanumeric sender name | [optional] -**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted | [optional] -**text** | **string** | Plaintext content for Viber | [optional] -**imageUrl** | **string** | URL for the embedded image Valid combinations: 1) image_url, 2) text, image_url, button_url, button_text | [optional] -**buttonUrl** | **string** | URL of the button, must be specified along with ''text'', ''button_text'' and ''image_url'' (optional) | [optional] -**buttonText** | **string** | Must be specified along with ''text'', ''button_url'', ''button_text'', ''image_url'' (optional) | [optional] +**sender** | **string** | Phone number or alphanumeric sender name | [optional] +**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted | [optional] +**text** | **string** | Plaintext content for Viber | [optional] +**imageUrl** | **string** | URL for the embedded image Valid combinations: 1) image_url, 2) text, image_url, button_url, button_text | [optional] +**buttonUrl** | **string** | URL of the button, must be specified along with ''text'', ''button_text'' and ''image_url'' (optional) | [optional] +**buttonText** | **string** | Must be specified along with ''text'', ''button_url'', ''button_text'', ''image_url'' (optional) | [optional] **channel** | **string** | The channel used to deliver the message | [optional] [default to 'viber'] -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WhatsApp.md b/docs/Model/WhatsApp.md index 5b3dff7..6ce50dd 100644 --- a/docs/Model/WhatsApp.md +++ b/docs/Model/WhatsApp.md @@ -4,14 +4,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**sender** | **string** | Phone number or alphanumeric sender name | [optional] -**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted | [optional] -**text** | [**\Messente\Api\Model\WhatsAppText**](WhatsAppText.md) | | [optional] -**image** | [**\Messente\Api\Model\WhatsAppImage**](WhatsAppImage.md) | | [optional] -**document** | [**\Messente\Api\Model\WhatsAppDocument**](WhatsAppDocument.md) | | [optional] -**audio** | [**\Messente\Api\Model\WhatsAppAudio**](WhatsAppAudio.md) | | [optional] +**sender** | **string** | Phone number or alphanumeric sender name | [optional] +**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted | [optional] +**text** | [**\Messente\Api\Model\WhatsAppText**](WhatsAppText.md) | | [optional] +**image** | [**\Messente\Api\Model\WhatsAppImage**](WhatsAppImage.md) | | [optional] +**document** | [**\Messente\Api\Model\WhatsAppDocument**](WhatsAppDocument.md) | | [optional] +**audio** | [**\Messente\Api\Model\WhatsAppAudio**](WhatsAppAudio.md) | | [optional] **channel** | **string** | The channel used to deliver the message | [optional] [default to 'whatsapp'] -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WhatsAppAudio.md b/docs/Model/WhatsAppAudio.md index 9be0439..ff0e201 100644 --- a/docs/Model/WhatsAppAudio.md +++ b/docs/Model/WhatsAppAudio.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**content** | **string** | Base64-encoded audio | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**content** | **string** | Base64-encoded audio | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WhatsAppDocument.md b/docs/Model/WhatsAppDocument.md index 5d5dc71..1183cd3 100644 --- a/docs/Model/WhatsAppDocument.md +++ b/docs/Model/WhatsAppDocument.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**caption** | **string** | Description for the document | [optional] -**content** | **string** | Base64-encoded image | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**caption** | **string** | Description for the document | [optional] +**content** | **string** | Base64-encoded image | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WhatsAppImage.md b/docs/Model/WhatsAppImage.md index 2c578d1..fff678f 100644 --- a/docs/Model/WhatsAppImage.md +++ b/docs/Model/WhatsAppImage.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**caption** | **string** | Description for the image | [optional] -**content** | **string** | Base64-encoded image | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**caption** | **string** | Description for the image | [optional] +**content** | **string** | Base64-encoded image | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WhatsAppText.md b/docs/Model/WhatsAppText.md index 0c1fad1..5a801c0 100644 --- a/docs/Model/WhatsAppText.md +++ b/docs/Model/WhatsAppText.md @@ -5,8 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **previewUrl** | **bool** | Whether to display link preview if the message contains a hyperlink | [optional] [default to true] -**body** | **string** | Plaintext content for WhatsApp, can contain URLs, emojis and formatting | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**body** | **string** | Plaintext content for WhatsApp, can contain URLs, emojis and formatting | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/git_push.sh b/git_push.sh index 7a23503..14bad7f 100644 --- a/git_push.sh +++ b/git_push.sh @@ -1,11 +1,17 @@ #!/bin/sh # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ # -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" git_user_id=$1 git_repo_id=$2 release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="messente" @@ -32,14 +38,14 @@ git add . git commit -m "$release_note" # Sets the new remote -git_remote=`git remote` +git_remote=$(git remote) if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,5 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' - diff --git a/lib/Api/BlacklistApi.php b/lib/Api/BlacklistApi.php index 70ec8b6..dfa0ecd 100644 --- a/lib/Api/BlacklistApi.php +++ b/lib/Api/BlacklistApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Set the host index * - * @param int Host index (required) + * @param int $hostIndex Host index (required) */ - public function setHostIndex($host_index) + public function setHostIndex($hostIndex): void { - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Get the host index * - * @return Host index + * @return int Host index */ public function getHostIndex() { @@ -153,9 +154,16 @@ public function addToBlacklistWithHttpInfo($numberToBlacklist) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -166,11 +174,11 @@ public function addToBlacklistWithHttpInfo($numberToBlacklist) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } @@ -267,7 +275,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -281,7 +289,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function addToBlacklistRequest($numberToBlacklist) + public function addToBlacklistRequest($numberToBlacklist) { // verify the required parameter 'numberToBlacklist' is set if ($numberToBlacklist === null || (is_array($numberToBlacklist) && count($numberToBlacklist) === 0)) { @@ -299,11 +307,7 @@ protected function addToBlacklistRequest($numberToBlacklist) - // body params - $_tempBody = null; - if (isset($numberToBlacklist)) { - $_tempBody = $numberToBlacklist; - } + if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -317,21 +321,23 @@ protected function addToBlacklistRequest($numberToBlacklist) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present + if (isset($numberToBlacklist)) { if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($numberToBlacklist)); } else { - $httpBody = $_tempBody; + $httpBody = $numberToBlacklist; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -341,7 +347,7 @@ protected function addToBlacklistRequest($numberToBlacklist) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -361,7 +367,7 @@ protected function addToBlacklistRequest($numberToBlacklist) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -408,9 +414,16 @@ public function deleteFromBlacklistWithHttpInfo($phone) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -421,11 +434,11 @@ public function deleteFromBlacklistWithHttpInfo($phone) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } @@ -522,7 +535,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -536,7 +549,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteFromBlacklistRequest($phone) + public function deleteFromBlacklistRequest($phone) { // verify the required parameter 'phone' is set if ($phone === null || (is_array($phone) && count($phone) === 0)) { @@ -553,6 +566,7 @@ protected function deleteFromBlacklistRequest($phone) $multipart = false; + // path params if ($phone !== null) { $resourcePath = str_replace( @@ -562,8 +576,6 @@ protected function deleteFromBlacklistRequest($phone) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -577,21 +589,17 @@ protected function deleteFromBlacklistRequest($phone) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -601,7 +609,7 @@ protected function deleteFromBlacklistRequest($phone) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -621,7 +629,7 @@ protected function deleteFromBlacklistRequest($phone) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -667,9 +675,16 @@ public function fetchBlacklistWithHttpInfo() } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -680,21 +695,20 @@ public function fetchBlacklistWithHttpInfo() sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Messente\Api\Model\FetchBlacklistSuccess' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -704,9 +718,9 @@ public function fetchBlacklistWithHttpInfo() ]; case 401: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -716,9 +730,9 @@ public function fetchBlacklistWithHttpInfo() ]; default: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -729,11 +743,10 @@ public function fetchBlacklistWithHttpInfo() } $returnType = '\Messente\Api\Model\FetchBlacklistSuccess'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -810,11 +823,10 @@ public function fetchBlacklistAsyncWithHttpInfo() ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -834,7 +846,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -847,7 +859,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function fetchBlacklistRequest() + public function fetchBlacklistRequest() { $resourcePath = '/phonebook/blacklist'; @@ -859,8 +871,7 @@ protected function fetchBlacklistRequest() - // body params - $_tempBody = null; + if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -874,21 +885,17 @@ protected function fetchBlacklistRequest() } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -898,7 +905,7 @@ protected function fetchBlacklistRequest() } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -918,7 +925,7 @@ protected function fetchBlacklistRequest() $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -965,9 +972,16 @@ public function isBlacklistedWithHttpInfo($phone) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -978,11 +992,11 @@ public function isBlacklistedWithHttpInfo($phone) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } @@ -1071,7 +1085,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -1085,7 +1099,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function isBlacklistedRequest($phone) + public function isBlacklistedRequest($phone) { // verify the required parameter 'phone' is set if ($phone === null || (is_array($phone) && count($phone) === 0)) { @@ -1102,6 +1116,7 @@ protected function isBlacklistedRequest($phone) $multipart = false; + // path params if ($phone !== null) { $resourcePath = str_replace( @@ -1111,8 +1126,6 @@ protected function isBlacklistedRequest($phone) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1126,21 +1139,17 @@ protected function isBlacklistedRequest($phone) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1150,7 +1159,7 @@ protected function isBlacklistedRequest($phone) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -1170,7 +1179,7 @@ protected function isBlacklistedRequest($phone) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/lib/Api/ContactsApi.php b/lib/Api/ContactsApi.php index 5c8f73c..73fc90b 100644 --- a/lib/Api/ContactsApi.php +++ b/lib/Api/ContactsApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Set the host index * - * @param int Host index (required) + * @param int $hostIndex Host index (required) */ - public function setHostIndex($host_index) + public function setHostIndex($hostIndex): void { - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Get the host index * - * @return Host index + * @return int Host index */ public function getHostIndex() { @@ -156,9 +157,16 @@ public function addContactToGroupWithHttpInfo($groupId, $phone) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -169,21 +177,20 @@ public function addContactToGroupWithHttpInfo($groupId, $phone) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 201: if ('object' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -193,9 +200,9 @@ public function addContactToGroupWithHttpInfo($groupId, $phone) ]; case 400: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -205,9 +212,9 @@ public function addContactToGroupWithHttpInfo($groupId, $phone) ]; case 401: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -217,9 +224,9 @@ public function addContactToGroupWithHttpInfo($groupId, $phone) ]; case 404: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -229,9 +236,9 @@ public function addContactToGroupWithHttpInfo($groupId, $phone) ]; case 409: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -241,9 +248,9 @@ public function addContactToGroupWithHttpInfo($groupId, $phone) ]; default: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -254,11 +261,10 @@ public function addContactToGroupWithHttpInfo($groupId, $phone) } $returnType = 'object'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -363,11 +369,10 @@ public function addContactToGroupAsyncWithHttpInfo($groupId, $phone) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -387,7 +392,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -402,7 +407,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function addContactToGroupRequest($groupId, $phone) + public function addContactToGroupRequest($groupId, $phone) { // verify the required parameter 'groupId' is set if ($groupId === null || (is_array($groupId) && count($groupId) === 0)) { @@ -425,6 +430,7 @@ protected function addContactToGroupRequest($groupId, $phone) $multipart = false; + // path params if ($groupId !== null) { $resourcePath = str_replace( @@ -442,8 +448,6 @@ protected function addContactToGroupRequest($groupId, $phone) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -457,21 +461,17 @@ protected function addContactToGroupRequest($groupId, $phone) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -481,7 +481,7 @@ protected function addContactToGroupRequest($groupId, $phone) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -501,7 +501,7 @@ protected function addContactToGroupRequest($groupId, $phone) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -549,9 +549,16 @@ public function createContactWithHttpInfo($contactFields) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -562,21 +569,20 @@ public function createContactWithHttpInfo($contactFields) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 201: if ('\Messente\Api\Model\ContactEnvelope' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -586,9 +592,9 @@ public function createContactWithHttpInfo($contactFields) ]; case 400: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -598,9 +604,9 @@ public function createContactWithHttpInfo($contactFields) ]; case 401: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -610,9 +616,9 @@ public function createContactWithHttpInfo($contactFields) ]; case 409: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -622,9 +628,9 @@ public function createContactWithHttpInfo($contactFields) ]; default: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -635,11 +641,10 @@ public function createContactWithHttpInfo($contactFields) } $returnType = '\Messente\Api\Model\ContactEnvelope'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -734,11 +739,10 @@ public function createContactAsyncWithHttpInfo($contactFields) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -758,7 +762,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -772,7 +776,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createContactRequest($contactFields) + public function createContactRequest($contactFields) { // verify the required parameter 'contactFields' is set if ($contactFields === null || (is_array($contactFields) && count($contactFields) === 0)) { @@ -790,11 +794,7 @@ protected function createContactRequest($contactFields) - // body params - $_tempBody = null; - if (isset($contactFields)) { - $_tempBody = $contactFields; - } + if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -808,21 +808,23 @@ protected function createContactRequest($contactFields) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present + if (isset($contactFields)) { if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($contactFields)); } else { - $httpBody = $_tempBody; + $httpBody = $contactFields; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -832,7 +834,7 @@ protected function createContactRequest($contactFields) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -852,7 +854,7 @@ protected function createContactRequest($contactFields) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -899,9 +901,16 @@ public function deleteContactWithHttpInfo($phone) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -912,11 +921,11 @@ public function deleteContactWithHttpInfo($phone) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } @@ -1013,7 +1022,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -1027,7 +1036,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteContactRequest($phone) + public function deleteContactRequest($phone) { // verify the required parameter 'phone' is set if ($phone === null || (is_array($phone) && count($phone) === 0)) { @@ -1044,6 +1053,7 @@ protected function deleteContactRequest($phone) $multipart = false; + // path params if ($phone !== null) { $resourcePath = str_replace( @@ -1053,8 +1063,6 @@ protected function deleteContactRequest($phone) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1068,21 +1076,17 @@ protected function deleteContactRequest($phone) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1092,7 +1096,7 @@ protected function deleteContactRequest($phone) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -1112,7 +1116,7 @@ protected function deleteContactRequest($phone) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -1160,9 +1164,16 @@ public function fetchContactWithHttpInfo($phone) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -1173,21 +1184,20 @@ public function fetchContactWithHttpInfo($phone) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Messente\Api\Model\ContactEnvelope' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1197,9 +1207,9 @@ public function fetchContactWithHttpInfo($phone) ]; case 400: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1209,9 +1219,9 @@ public function fetchContactWithHttpInfo($phone) ]; case 401: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1221,9 +1231,9 @@ public function fetchContactWithHttpInfo($phone) ]; case 404: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1234,11 +1244,10 @@ public function fetchContactWithHttpInfo($phone) } $returnType = '\Messente\Api\Model\ContactEnvelope'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1325,11 +1334,10 @@ public function fetchContactAsyncWithHttpInfo($phone) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1349,7 +1357,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -1363,7 +1371,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function fetchContactRequest($phone) + public function fetchContactRequest($phone) { // verify the required parameter 'phone' is set if ($phone === null || (is_array($phone) && count($phone) === 0)) { @@ -1380,6 +1388,7 @@ protected function fetchContactRequest($phone) $multipart = false; + // path params if ($phone !== null) { $resourcePath = str_replace( @@ -1389,8 +1398,6 @@ protected function fetchContactRequest($phone) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1404,21 +1411,17 @@ protected function fetchContactRequest($phone) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1428,7 +1431,7 @@ protected function fetchContactRequest($phone) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -1448,7 +1451,7 @@ protected function fetchContactRequest($phone) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -1496,9 +1499,16 @@ public function fetchContactGroupsWithHttpInfo($phone) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -1509,21 +1519,20 @@ public function fetchContactGroupsWithHttpInfo($phone) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Messente\Api\Model\GroupListEnvelope' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1533,9 +1542,9 @@ public function fetchContactGroupsWithHttpInfo($phone) ]; case 400: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1545,9 +1554,9 @@ public function fetchContactGroupsWithHttpInfo($phone) ]; case 401: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1557,9 +1566,9 @@ public function fetchContactGroupsWithHttpInfo($phone) ]; case 404: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1570,11 +1579,10 @@ public function fetchContactGroupsWithHttpInfo($phone) } $returnType = '\Messente\Api\Model\GroupListEnvelope'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1661,11 +1669,10 @@ public function fetchContactGroupsAsyncWithHttpInfo($phone) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1685,7 +1692,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -1699,7 +1706,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function fetchContactGroupsRequest($phone) + public function fetchContactGroupsRequest($phone) { // verify the required parameter 'phone' is set if ($phone === null || (is_array($phone) && count($phone) === 0)) { @@ -1716,6 +1723,7 @@ protected function fetchContactGroupsRequest($phone) $multipart = false; + // path params if ($phone !== null) { $resourcePath = str_replace( @@ -1725,8 +1733,6 @@ protected function fetchContactGroupsRequest($phone) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1740,21 +1746,17 @@ protected function fetchContactGroupsRequest($phone) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1764,7 +1766,7 @@ protected function fetchContactGroupsRequest($phone) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -1784,7 +1786,7 @@ protected function fetchContactGroupsRequest($phone) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -1832,9 +1834,16 @@ public function fetchContactsWithHttpInfo($groupIds = null) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -1845,21 +1854,20 @@ public function fetchContactsWithHttpInfo($groupIds = null) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Messente\Api\Model\ContactListEnvelope' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1869,9 +1877,9 @@ public function fetchContactsWithHttpInfo($groupIds = null) ]; case 400: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1881,9 +1889,9 @@ public function fetchContactsWithHttpInfo($groupIds = null) ]; case 401: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1893,9 +1901,9 @@ public function fetchContactsWithHttpInfo($groupIds = null) ]; default: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1906,11 +1914,10 @@ public function fetchContactsWithHttpInfo($groupIds = null) } $returnType = '\Messente\Api\Model\ContactListEnvelope'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1997,11 +2004,10 @@ public function fetchContactsAsyncWithHttpInfo($groupIds = null) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -2021,7 +2027,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -2035,7 +2041,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function fetchContactsRequest($groupIds = null) + public function fetchContactsRequest($groupIds = null) { $resourcePath = '/phonebook/contacts'; @@ -2046,16 +2052,19 @@ protected function fetchContactsRequest($groupIds = null) $multipart = false; // query params - if (is_array($groupIds)) { - $groupIds = ObjectSerializer::serializeCollection($groupIds, 'multi', true); - } if ($groupIds !== null) { - $queryParams['groupIds'] = ObjectSerializer::toQueryValue($groupIds); + if('form' === 'form' && is_array($groupIds)) { + foreach($groupIds as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['groupIds'] = $groupIds; + } } - // body params - $_tempBody = null; + if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -2069,21 +2078,17 @@ protected function fetchContactsRequest($groupIds = null) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -2093,7 +2098,7 @@ protected function fetchContactsRequest($groupIds = null) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -2113,7 +2118,7 @@ protected function fetchContactsRequest($groupIds = null) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -2162,9 +2167,16 @@ public function removeContactFromGroupWithHttpInfo($groupId, $phone) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -2175,11 +2187,11 @@ public function removeContactFromGroupWithHttpInfo($groupId, $phone) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } @@ -2278,7 +2290,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -2293,7 +2305,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function removeContactFromGroupRequest($groupId, $phone) + public function removeContactFromGroupRequest($groupId, $phone) { // verify the required parameter 'groupId' is set if ($groupId === null || (is_array($groupId) && count($groupId) === 0)) { @@ -2316,6 +2328,7 @@ protected function removeContactFromGroupRequest($groupId, $phone) $multipart = false; + // path params if ($groupId !== null) { $resourcePath = str_replace( @@ -2333,8 +2346,6 @@ protected function removeContactFromGroupRequest($groupId, $phone) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -2348,21 +2359,17 @@ protected function removeContactFromGroupRequest($groupId, $phone) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -2372,7 +2379,7 @@ protected function removeContactFromGroupRequest($groupId, $phone) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -2392,7 +2399,7 @@ protected function removeContactFromGroupRequest($groupId, $phone) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -2442,9 +2449,16 @@ public function updateContactWithHttpInfo($phone, $contactUpdateFields) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -2455,21 +2469,20 @@ public function updateContactWithHttpInfo($phone, $contactUpdateFields) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Messente\Api\Model\ContactEnvelope' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -2479,9 +2492,9 @@ public function updateContactWithHttpInfo($phone, $contactUpdateFields) ]; case 400: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -2491,9 +2504,9 @@ public function updateContactWithHttpInfo($phone, $contactUpdateFields) ]; case 401: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -2503,9 +2516,9 @@ public function updateContactWithHttpInfo($phone, $contactUpdateFields) ]; case 404: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -2515,9 +2528,9 @@ public function updateContactWithHttpInfo($phone, $contactUpdateFields) ]; default: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -2528,11 +2541,10 @@ public function updateContactWithHttpInfo($phone, $contactUpdateFields) } $returnType = '\Messente\Api\Model\ContactEnvelope'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -2629,11 +2641,10 @@ public function updateContactAsyncWithHttpInfo($phone, $contactUpdateFields) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -2653,7 +2664,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -2668,7 +2679,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function updateContactRequest($phone, $contactUpdateFields) + public function updateContactRequest($phone, $contactUpdateFields) { // verify the required parameter 'phone' is set if ($phone === null || (is_array($phone) && count($phone) === 0)) { @@ -2691,6 +2702,7 @@ protected function updateContactRequest($phone, $contactUpdateFields) $multipart = false; + // path params if ($phone !== null) { $resourcePath = str_replace( @@ -2700,11 +2712,6 @@ protected function updateContactRequest($phone, $contactUpdateFields) ); } - // body params - $_tempBody = null; - if (isset($contactUpdateFields)) { - $_tempBody = $contactUpdateFields; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -2718,21 +2725,23 @@ protected function updateContactRequest($phone, $contactUpdateFields) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present + if (isset($contactUpdateFields)) { if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($contactUpdateFields)); } else { - $httpBody = $_tempBody; + $httpBody = $contactUpdateFields; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -2742,7 +2751,7 @@ protected function updateContactRequest($phone, $contactUpdateFields) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -2762,7 +2771,7 @@ protected function updateContactRequest($phone, $contactUpdateFields) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'PATCH', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/lib/Api/DeliveryReportApi.php b/lib/Api/DeliveryReportApi.php index 4b9c9de..02d348b 100644 --- a/lib/Api/DeliveryReportApi.php +++ b/lib/Api/DeliveryReportApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Set the host index * - * @param int Host index (required) + * @param int $hostIndex Host index (required) */ - public function setHostIndex($host_index) + public function setHostIndex($hostIndex): void { - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Get the host index * - * @return Host index + * @return int Host index */ public function getHostIndex() { @@ -154,9 +155,16 @@ public function retrieveDeliveryReportWithHttpInfo($omnimessageId) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -167,21 +175,20 @@ public function retrieveDeliveryReportWithHttpInfo($omnimessageId) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Messente\Api\Model\DeliveryReportResponse' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -191,9 +198,9 @@ public function retrieveDeliveryReportWithHttpInfo($omnimessageId) ]; case 404: if ('\Messente\Api\Model\ErrorOmnichannel' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -204,11 +211,10 @@ public function retrieveDeliveryReportWithHttpInfo($omnimessageId) } $returnType = '\Messente\Api\Model\DeliveryReportResponse'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -279,11 +285,10 @@ public function retrieveDeliveryReportAsyncWithHttpInfo($omnimessageId) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -303,7 +308,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -317,7 +322,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function retrieveDeliveryReportRequest($omnimessageId) + public function retrieveDeliveryReportRequest($omnimessageId) { // verify the required parameter 'omnimessageId' is set if ($omnimessageId === null || (is_array($omnimessageId) && count($omnimessageId) === 0)) { @@ -334,6 +339,7 @@ protected function retrieveDeliveryReportRequest($omnimessageId) $multipart = false; + // path params if ($omnimessageId !== null) { $resourcePath = str_replace( @@ -343,8 +349,6 @@ protected function retrieveDeliveryReportRequest($omnimessageId) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -358,21 +362,17 @@ protected function retrieveDeliveryReportRequest($omnimessageId) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -382,7 +382,7 @@ protected function retrieveDeliveryReportRequest($omnimessageId) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -402,7 +402,7 @@ protected function retrieveDeliveryReportRequest($omnimessageId) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/lib/Api/GroupsApi.php b/lib/Api/GroupsApi.php index 7188bbb..8bfaca6 100644 --- a/lib/Api/GroupsApi.php +++ b/lib/Api/GroupsApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Set the host index * - * @param int Host index (required) + * @param int $hostIndex Host index (required) */ - public function setHostIndex($host_index) + public function setHostIndex($hostIndex): void { - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Get the host index * - * @return Host index + * @return int Host index */ public function getHostIndex() { @@ -154,9 +155,16 @@ public function createGroupWithHttpInfo($groupName) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -167,21 +175,20 @@ public function createGroupWithHttpInfo($groupName) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 201: if ('\Messente\Api\Model\GroupEnvelope' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -191,9 +198,9 @@ public function createGroupWithHttpInfo($groupName) ]; case 400: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -203,9 +210,9 @@ public function createGroupWithHttpInfo($groupName) ]; case 401: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -215,9 +222,9 @@ public function createGroupWithHttpInfo($groupName) ]; default: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -228,11 +235,10 @@ public function createGroupWithHttpInfo($groupName) } $returnType = '\Messente\Api\Model\GroupEnvelope'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -319,11 +325,10 @@ public function createGroupAsyncWithHttpInfo($groupName) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -343,7 +348,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -357,7 +362,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createGroupRequest($groupName) + public function createGroupRequest($groupName) { // verify the required parameter 'groupName' is set if ($groupName === null || (is_array($groupName) && count($groupName) === 0)) { @@ -375,11 +380,7 @@ protected function createGroupRequest($groupName) - // body params - $_tempBody = null; - if (isset($groupName)) { - $_tempBody = $groupName; - } + if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -393,21 +394,23 @@ protected function createGroupRequest($groupName) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present + if (isset($groupName)) { if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($groupName)); } else { - $httpBody = $_tempBody; + $httpBody = $groupName; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -417,7 +420,7 @@ protected function createGroupRequest($groupName) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -437,7 +440,7 @@ protected function createGroupRequest($groupName) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -484,9 +487,16 @@ public function deleteGroupWithHttpInfo($groupId) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -497,11 +507,11 @@ public function deleteGroupWithHttpInfo($groupId) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } @@ -590,7 +600,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -604,7 +614,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteGroupRequest($groupId) + public function deleteGroupRequest($groupId) { // verify the required parameter 'groupId' is set if ($groupId === null || (is_array($groupId) && count($groupId) === 0)) { @@ -621,6 +631,7 @@ protected function deleteGroupRequest($groupId) $multipart = false; + // path params if ($groupId !== null) { $resourcePath = str_replace( @@ -630,8 +641,6 @@ protected function deleteGroupRequest($groupId) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -645,21 +654,17 @@ protected function deleteGroupRequest($groupId) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -669,7 +674,7 @@ protected function deleteGroupRequest($groupId) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -689,7 +694,7 @@ protected function deleteGroupRequest($groupId) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -737,9 +742,16 @@ public function fetchGroupWithHttpInfo($groupId) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -750,21 +762,20 @@ public function fetchGroupWithHttpInfo($groupId) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Messente\Api\Model\GroupEnvelope' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -774,9 +785,9 @@ public function fetchGroupWithHttpInfo($groupId) ]; case 401: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -786,9 +797,9 @@ public function fetchGroupWithHttpInfo($groupId) ]; case 404: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -799,11 +810,10 @@ public function fetchGroupWithHttpInfo($groupId) } $returnType = '\Messente\Api\Model\GroupEnvelope'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -882,11 +892,10 @@ public function fetchGroupAsyncWithHttpInfo($groupId) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -906,7 +915,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -920,7 +929,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function fetchGroupRequest($groupId) + public function fetchGroupRequest($groupId) { // verify the required parameter 'groupId' is set if ($groupId === null || (is_array($groupId) && count($groupId) === 0)) { @@ -937,6 +946,7 @@ protected function fetchGroupRequest($groupId) $multipart = false; + // path params if ($groupId !== null) { $resourcePath = str_replace( @@ -946,8 +956,6 @@ protected function fetchGroupRequest($groupId) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -961,21 +969,17 @@ protected function fetchGroupRequest($groupId) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -985,7 +989,7 @@ protected function fetchGroupRequest($groupId) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -1005,7 +1009,7 @@ protected function fetchGroupRequest($groupId) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -1051,9 +1055,16 @@ public function fetchGroupsWithHttpInfo() } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -1064,21 +1075,20 @@ public function fetchGroupsWithHttpInfo() sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Messente\Api\Model\GroupListEnvelope' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1088,9 +1098,9 @@ public function fetchGroupsWithHttpInfo() ]; case 401: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1100,9 +1110,9 @@ public function fetchGroupsWithHttpInfo() ]; default: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1113,11 +1123,10 @@ public function fetchGroupsWithHttpInfo() } $returnType = '\Messente\Api\Model\GroupListEnvelope'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1194,11 +1203,10 @@ public function fetchGroupsAsyncWithHttpInfo() ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1218,7 +1226,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -1231,7 +1239,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function fetchGroupsRequest() + public function fetchGroupsRequest() { $resourcePath = '/phonebook/groups'; @@ -1243,8 +1251,7 @@ protected function fetchGroupsRequest() - // body params - $_tempBody = null; + if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1258,21 +1265,17 @@ protected function fetchGroupsRequest() } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1282,7 +1285,7 @@ protected function fetchGroupsRequest() } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -1302,7 +1305,7 @@ protected function fetchGroupsRequest() $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -1352,9 +1355,16 @@ public function updateGroupWithHttpInfo($groupId, $groupName) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -1365,21 +1375,20 @@ public function updateGroupWithHttpInfo($groupId, $groupName) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Messente\Api\Model\GroupEnvelope' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1389,9 +1398,9 @@ public function updateGroupWithHttpInfo($groupId, $groupName) ]; case 400: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1401,9 +1410,9 @@ public function updateGroupWithHttpInfo($groupId, $groupName) ]; case 401: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1413,9 +1422,9 @@ public function updateGroupWithHttpInfo($groupId, $groupName) ]; case 404: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1425,9 +1434,9 @@ public function updateGroupWithHttpInfo($groupId, $groupName) ]; default: if ('\Messente\Api\Model\ErrorPhonebook' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1438,11 +1447,10 @@ public function updateGroupWithHttpInfo($groupId, $groupName) } $returnType = '\Messente\Api\Model\GroupEnvelope'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1539,11 +1547,10 @@ public function updateGroupAsyncWithHttpInfo($groupId, $groupName) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -1563,7 +1570,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -1578,7 +1585,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function updateGroupRequest($groupId, $groupName) + public function updateGroupRequest($groupId, $groupName) { // verify the required parameter 'groupId' is set if ($groupId === null || (is_array($groupId) && count($groupId) === 0)) { @@ -1601,6 +1608,7 @@ protected function updateGroupRequest($groupId, $groupName) $multipart = false; + // path params if ($groupId !== null) { $resourcePath = str_replace( @@ -1610,11 +1618,6 @@ protected function updateGroupRequest($groupId, $groupName) ); } - // body params - $_tempBody = null; - if (isset($groupName)) { - $_tempBody = $groupName; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1628,21 +1631,23 @@ protected function updateGroupRequest($groupId, $groupName) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present + if (isset($groupName)) { if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($groupName)); } else { - $httpBody = $_tempBody; + $httpBody = $groupName; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1652,7 +1657,7 @@ protected function updateGroupRequest($groupId, $groupName) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -1672,7 +1677,7 @@ protected function updateGroupRequest($groupId, $groupName) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'PUT', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/lib/Api/NumberLookupApi.php b/lib/Api/NumberLookupApi.php index 2fd2451..54abbe4 100644 --- a/lib/Api/NumberLookupApi.php +++ b/lib/Api/NumberLookupApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Set the host index * - * @param int Host index (required) + * @param int $hostIndex Host index (required) */ - public function setHostIndex($host_index) + public function setHostIndex($hostIndex): void { - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Get the host index * - * @return Host index + * @return int Host index */ public function getHostIndex() { @@ -154,9 +155,16 @@ public function fetchInfoWithHttpInfo($numbersToInvestigate) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -167,21 +175,20 @@ public function fetchInfoWithHttpInfo($numbersToInvestigate) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Messente\Api\Model\SyncNumberLookupSuccess' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -191,9 +198,9 @@ public function fetchInfoWithHttpInfo($numbersToInvestigate) ]; case 400: if ('\Messente\Api\Model\ErrorNumberLookup' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -203,9 +210,9 @@ public function fetchInfoWithHttpInfo($numbersToInvestigate) ]; case 401: if ('\Messente\Api\Model\ErrorNumberLookup' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -215,9 +222,9 @@ public function fetchInfoWithHttpInfo($numbersToInvestigate) ]; case 402: if ('\Messente\Api\Model\ErrorNumberLookup' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -228,11 +235,10 @@ public function fetchInfoWithHttpInfo($numbersToInvestigate) } $returnType = '\Messente\Api\Model\SyncNumberLookupSuccess'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -319,11 +325,10 @@ public function fetchInfoAsyncWithHttpInfo($numbersToInvestigate) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -343,7 +348,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -357,7 +362,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function fetchInfoRequest($numbersToInvestigate) + public function fetchInfoRequest($numbersToInvestigate) { // verify the required parameter 'numbersToInvestigate' is set if ($numbersToInvestigate === null || (is_array($numbersToInvestigate) && count($numbersToInvestigate) === 0)) { @@ -375,11 +380,7 @@ protected function fetchInfoRequest($numbersToInvestigate) - // body params - $_tempBody = null; - if (isset($numbersToInvestigate)) { - $_tempBody = $numbersToInvestigate; - } + if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -393,21 +394,23 @@ protected function fetchInfoRequest($numbersToInvestigate) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present + if (isset($numbersToInvestigate)) { if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($numbersToInvestigate)); } else { - $httpBody = $_tempBody; + $httpBody = $numbersToInvestigate; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -417,7 +420,7 @@ protected function fetchInfoRequest($numbersToInvestigate) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -437,7 +440,7 @@ protected function fetchInfoRequest($numbersToInvestigate) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/lib/Api/OmnimessageApi.php b/lib/Api/OmnimessageApi.php index 220bbe6..15867bd 100644 --- a/lib/Api/OmnimessageApi.php +++ b/lib/Api/OmnimessageApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Set the host index * - * @param int Host index (required) + * @param int $hostIndex Host index (required) */ - public function setHostIndex($host_index) + public function setHostIndex($hostIndex): void { - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Get the host index * - * @return Host index + * @return int Host index */ public function getHostIndex() { @@ -154,9 +155,16 @@ public function cancelScheduledMessageWithHttpInfo($omnimessageId) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -167,21 +175,20 @@ public function cancelScheduledMessageWithHttpInfo($omnimessageId) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 202: if ('object' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -191,9 +198,9 @@ public function cancelScheduledMessageWithHttpInfo($omnimessageId) ]; case 404: if ('\Messente\Api\Model\ErrorOmnichannel' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -204,11 +211,10 @@ public function cancelScheduledMessageWithHttpInfo($omnimessageId) } $returnType = 'object'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -279,11 +285,10 @@ public function cancelScheduledMessageAsyncWithHttpInfo($omnimessageId) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -303,7 +308,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -317,7 +322,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function cancelScheduledMessageRequest($omnimessageId) + public function cancelScheduledMessageRequest($omnimessageId) { // verify the required parameter 'omnimessageId' is set if ($omnimessageId === null || (is_array($omnimessageId) && count($omnimessageId) === 0)) { @@ -334,6 +339,7 @@ protected function cancelScheduledMessageRequest($omnimessageId) $multipart = false; + // path params if ($omnimessageId !== null) { $resourcePath = str_replace( @@ -343,8 +349,6 @@ protected function cancelScheduledMessageRequest($omnimessageId) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -358,21 +362,17 @@ protected function cancelScheduledMessageRequest($omnimessageId) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -382,7 +382,7 @@ protected function cancelScheduledMessageRequest($omnimessageId) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -402,7 +402,7 @@ protected function cancelScheduledMessageRequest($omnimessageId) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -450,9 +450,16 @@ public function sendOmnimessageWithHttpInfo($omnimessage) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -463,21 +470,20 @@ public function sendOmnimessageWithHttpInfo($omnimessage) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 201: if ('\Messente\Api\Model\OmniMessageCreateSuccessResponse' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -487,9 +493,9 @@ public function sendOmnimessageWithHttpInfo($omnimessage) ]; case 400: if ('\Messente\Api\Model\ErrorOmnichannel' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -500,11 +506,10 @@ public function sendOmnimessageWithHttpInfo($omnimessage) } $returnType = '\Messente\Api\Model\OmniMessageCreateSuccessResponse'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -575,11 +580,10 @@ public function sendOmnimessageAsyncWithHttpInfo($omnimessage) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -599,7 +603,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -613,7 +617,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function sendOmnimessageRequest($omnimessage) + public function sendOmnimessageRequest($omnimessage) { // verify the required parameter 'omnimessage' is set if ($omnimessage === null || (is_array($omnimessage) && count($omnimessage) === 0)) { @@ -631,11 +635,7 @@ protected function sendOmnimessageRequest($omnimessage) - // body params - $_tempBody = null; - if (isset($omnimessage)) { - $_tempBody = $omnimessage; - } + if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -649,21 +649,23 @@ protected function sendOmnimessageRequest($omnimessage) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present + if (isset($omnimessage)) { if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($omnimessage)); } else { - $httpBody = $_tempBody; + $httpBody = $omnimessage; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -673,7 +675,7 @@ protected function sendOmnimessageRequest($omnimessage) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -693,7 +695,7 @@ protected function sendOmnimessageRequest($omnimessage) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/lib/Api/StatisticsApi.php b/lib/Api/StatisticsApi.php index 8af4d30..a5b109f 100644 --- a/lib/Api/StatisticsApi.php +++ b/lib/Api/StatisticsApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Set the host index * - * @param int Host index (required) + * @param int $hostIndex Host index (required) */ - public function setHostIndex($host_index) + public function setHostIndex($hostIndex): void { - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Get the host index * - * @return Host index + * @return int Host index */ public function getHostIndex() { @@ -154,9 +155,16 @@ public function createStatisticsReportWithHttpInfo($statisticsReportSettings) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -167,21 +175,20 @@ public function createStatisticsReportWithHttpInfo($statisticsReportSettings) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Messente\Api\Model\StatisticsReportSuccess' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -191,9 +198,9 @@ public function createStatisticsReportWithHttpInfo($statisticsReportSettings) ]; case 400: if ('\Messente\Api\Model\ErrorStatistics' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -203,9 +210,9 @@ public function createStatisticsReportWithHttpInfo($statisticsReportSettings) ]; case 401: if ('\Messente\Api\Model\ErrorStatistics' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -215,9 +222,9 @@ public function createStatisticsReportWithHttpInfo($statisticsReportSettings) ]; case 422: if ('\Messente\Api\Model\ErrorStatistics' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -227,9 +234,9 @@ public function createStatisticsReportWithHttpInfo($statisticsReportSettings) ]; case 500: if ('\Messente\Api\Model\ErrorStatistics' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -240,11 +247,10 @@ public function createStatisticsReportWithHttpInfo($statisticsReportSettings) } $returnType = '\Messente\Api\Model\StatisticsReportSuccess'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -339,11 +345,10 @@ public function createStatisticsReportAsyncWithHttpInfo($statisticsReportSetting ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); } return [ @@ -363,7 +368,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -377,7 +382,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createStatisticsReportRequest($statisticsReportSettings) + public function createStatisticsReportRequest($statisticsReportSettings) { // verify the required parameter 'statisticsReportSettings' is set if ($statisticsReportSettings === null || (is_array($statisticsReportSettings) && count($statisticsReportSettings) === 0)) { @@ -395,11 +400,7 @@ protected function createStatisticsReportRequest($statisticsReportSettings) - // body params - $_tempBody = null; - if (isset($statisticsReportSettings)) { - $_tempBody = $statisticsReportSettings; - } + if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -413,21 +414,23 @@ protected function createStatisticsReportRequest($statisticsReportSettings) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present + if (isset($statisticsReportSettings)) { if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($statisticsReportSettings)); } else { - $httpBody = $_tempBody; + $httpBody = $statisticsReportSettings; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -437,7 +440,7 @@ protected function createStatisticsReportRequest($statisticsReportSettings) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -457,7 +460,7 @@ protected function createStatisticsReportRequest($statisticsReportSettings) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/lib/ApiException.php b/lib/ApiException.php index a4fe6e6..5e918bc 100644 --- a/lib/ApiException.php +++ b/lib/ApiException.php @@ -1,7 +1,7 @@ getTempFolderPath() . PHP_EOL; return $report; @@ -408,7 +411,7 @@ public static function toDebugReport() * * @param string $apiKeyIdentifier name of apikey * - * @return string API key with the prefix + * @return null|string API key with the prefix */ public function getApiKeyWithPrefix($apiKeyIdentifier) { @@ -431,29 +434,29 @@ public function getApiKeyWithPrefix($apiKeyIdentifier) /** * Returns an array of host settings * - * @return an array of host settings + * @return array an array of host settings */ public function getHostSettings() { - return array( - array( - "url" => "https://api.messente.com/v1", - "description" => "No description provided", - ) - ); + return [ + [ + "url" => "https://api.messente.com/v1", + "description" => "No description provided", + ] + ]; } /** * Returns URL based on the index and variables * - * @param index array index of the host settings - * @param variables hash of variable and the corresponding value (optional) - * @return URL based on host settings + * @param int $index index of the host settings + * @param array|null $variables hash of variable and the corresponding value (optional) + * @return string URL based on host settings */ public function getHostFromSettings($index, $variables = null) { if (null === $variables) { - $variables = array(); + $variables = []; } $hosts = $this->getHostSettings(); @@ -467,9 +470,9 @@ public function getHostFromSettings($index, $variables = null) $url = $host["url"]; // go through variable and assign a value - foreach ($host["variables"] as $name => $variable) { + foreach ($host["variables"] ?? [] as $name => $variable) { if (array_key_exists($name, $variables)) { // check to see if it's in the variables provided by the user - if (in_array($variables[$name], $variable["enum_values"])) { // check to see if the value is in the enum + if (in_array($variables[$name], $variable["enum_values"], true)) { // check to see if the value is in the enum $url = str_replace("{".$name."}", $variables[$name], $url); } else { throw new \InvalidArgumentException("The variable `$name` in the host URL has invalid value ".$variables[$name].". Must be ".join(',', $variable["enum_values"])."."); diff --git a/lib/HeaderSelector.php b/lib/HeaderSelector.php index 05795b9..a149e1d 100644 --- a/lib/HeaderSelector.php +++ b/lib/HeaderSelector.php @@ -1,7 +1,7 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class ContactEnvelope implements ModelInterface, ArrayAccess +class ContactEnvelope implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -65,27 +68,13 @@ class ContactEnvelope implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -106,60 +95,6 @@ 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 @@ -229,9 +164,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -248,18 +180,7 @@ public function getModelName() */ public function __construct(array $data = 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; + $this->container['contact'] = $data['contact'] ?? null; } /** @@ -301,16 +222,10 @@ public function getContact() * * @param \Messente\Api\Model\ContactResponseFields|null $contact contact * - * @return $this + * @return self */ public function setContact($contact) { - - - if (is_null($contact)) { - throw new \InvalidArgumentException('non-nullable contact cannot be null'); - } - $this->container['contact'] = $contact; return $this; @@ -332,18 +247,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -368,6 +283,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -380,6 +307,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/ContactFields.php b/lib/Model/ContactFields.php index defdf21..7fc55a0 100644 --- a/lib/Model/ContactFields.php +++ b/lib/Model/ContactFields.php @@ -2,7 +2,7 @@ /** * ContactFields * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class ContactFields implements ModelInterface, ArrayAccess +class ContactFields implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -74,6 +77,8 @@ class ContactFields implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'phoneNumber' => null, @@ -88,31 +93,6 @@ 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 * @@ -133,60 +113,6 @@ 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 @@ -283,9 +209,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -302,27 +225,16 @@ public function getModelName() */ public function __construct(array $data = 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; + $this->container['phoneNumber'] = $data['phoneNumber'] ?? null; + $this->container['email'] = $data['email'] ?? null; + $this->container['firstName'] = $data['firstName'] ?? null; + $this->container['lastName'] = $data['lastName'] ?? null; + $this->container['company'] = $data['company'] ?? null; + $this->container['title'] = $data['title'] ?? null; + $this->container['custom'] = $data['custom'] ?? null; + $this->container['custom2'] = $data['custom2'] ?? null; + $this->container['custom3'] = $data['custom3'] ?? null; + $this->container['custom4'] = $data['custom4'] ?? null; } /** @@ -367,16 +279,10 @@ public function getPhoneNumber() * * @param string $phoneNumber Phone number in e.164 format * - * @return $this + * @return self */ public function setPhoneNumber($phoneNumber) { - - - if (is_null($phoneNumber)) { - throw new \InvalidArgumentException('non-nullable phoneNumber cannot be null'); - } - $this->container['phoneNumber'] = $phoneNumber; return $this; @@ -397,23 +303,10 @@ public function getEmail() * * @param string|null $email The email of the contact * - * @return $this + * @return self */ 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; @@ -434,23 +327,10 @@ public function getFirstName() * * @param string|null $firstName The first name of the contact * - * @return $this + * @return self */ 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; @@ -471,23 +351,10 @@ public function getLastName() * * @param string|null $lastName The last name of the contact * - * @return $this + * @return self */ 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; @@ -508,23 +375,10 @@ public function getCompany() * * @param string|null $company The company of the contact * - * @return $this + * @return self */ 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; @@ -545,23 +399,10 @@ public function getTitle() * * @param string|null $title The title of the contact * - * @return $this + * @return self */ 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; @@ -582,23 +423,10 @@ public function getCustom() * * @param string|null $custom The first custom field * - * @return $this + * @return self */ 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; @@ -619,23 +447,10 @@ public function getCustom2() * * @param string|null $custom2 The second custom field * - * @return $this + * @return self */ 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; @@ -656,23 +471,10 @@ public function getCustom3() * * @param string|null $custom3 The third custom field * - * @return $this + * @return self */ 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; @@ -693,23 +495,10 @@ public function getCustom4() * * @param string|null $custom4 The fourth custom field * - * @return $this + * @return self */ 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; @@ -731,18 +520,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -767,6 +556,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -779,6 +580,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/ContactListEnvelope.php b/lib/Model/ContactListEnvelope.php index 0b730a5..b225830 100644 --- a/lib/Model/ContactListEnvelope.php +++ b/lib/Model/ContactListEnvelope.php @@ -2,7 +2,7 @@ /** * ContactListEnvelope * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class ContactListEnvelope implements ModelInterface, ArrayAccess +class ContactListEnvelope implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -65,27 +68,13 @@ class ContactListEnvelope implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -106,60 +95,6 @@ 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 @@ -229,9 +164,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -248,18 +180,7 @@ public function getModelName() */ public function __construct(array $data = 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; + $this->container['contacts'] = $data['contacts'] ?? null; } /** @@ -301,16 +222,12 @@ public function getContacts() * * @param \Messente\Api\Model\ContactResponseFields[]|null $contacts An array of contacts * - * @return $this + * @return self */ public function setContacts($contacts) { - if (is_null($contacts)) { - throw new \InvalidArgumentException('non-nullable contacts cannot be null'); - } - $this->container['contacts'] = $contacts; return $this; @@ -332,18 +249,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -368,6 +285,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -380,6 +309,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/ContactResponseFields.php b/lib/Model/ContactResponseFields.php index 225a03b..1b44998 100644 --- a/lib/Model/ContactResponseFields.php +++ b/lib/Model/ContactResponseFields.php @@ -2,7 +2,7 @@ /** * ContactResponseFields * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class ContactResponseFields implements ModelInterface, ArrayAccess +class ContactResponseFields implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -75,6 +78,8 @@ class ContactResponseFields implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'phoneNumber' => null, @@ -90,32 +95,6 @@ class ContactResponseFields implements ModelInterface, ArrayAccess 'scheduledDeletionDate' => 'date' ]; - /** - * 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, - 'scheduledDeletionDate' => 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 * @@ -136,60 +115,6 @@ 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 @@ -289,9 +214,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -308,28 +230,17 @@ public function getModelName() */ public function __construct(array $data = 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); - $this->setIfExists('scheduledDeletionDate', $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; + $this->container['phoneNumber'] = $data['phoneNumber'] ?? null; + $this->container['email'] = $data['email'] ?? null; + $this->container['firstName'] = $data['firstName'] ?? null; + $this->container['lastName'] = $data['lastName'] ?? null; + $this->container['company'] = $data['company'] ?? null; + $this->container['title'] = $data['title'] ?? null; + $this->container['custom'] = $data['custom'] ?? null; + $this->container['custom2'] = $data['custom2'] ?? null; + $this->container['custom3'] = $data['custom3'] ?? null; + $this->container['custom4'] = $data['custom4'] ?? null; + $this->container['scheduledDeletionDate'] = $data['scheduledDeletionDate'] ?? null; } /** @@ -371,16 +282,10 @@ public function getPhoneNumber() * * @param string|null $phoneNumber Phone number in e.164 format * - * @return $this + * @return self */ public function setPhoneNumber($phoneNumber) { - - - if (is_null($phoneNumber)) { - throw new \InvalidArgumentException('non-nullable phoneNumber cannot be null'); - } - $this->container['phoneNumber'] = $phoneNumber; return $this; @@ -401,23 +306,10 @@ public function getEmail() * * @param string|null $email The email of the contact * - * @return $this + * @return self */ 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; @@ -438,23 +330,10 @@ public function getFirstName() * * @param string|null $firstName The first name of the contact * - * @return $this + * @return self */ 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; @@ -475,23 +354,10 @@ public function getLastName() * * @param string|null $lastName The last name of the contact * - * @return $this + * @return self */ 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; @@ -512,23 +378,10 @@ public function getCompany() * * @param string|null $company The company of the contact * - * @return $this + * @return self */ 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; @@ -549,23 +402,10 @@ public function getTitle() * * @param string|null $title The title of the contact * - * @return $this + * @return self */ 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; @@ -586,23 +426,10 @@ public function getCustom() * * @param string|null $custom The first custom field * - * @return $this + * @return self */ 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; @@ -623,23 +450,10 @@ public function getCustom2() * * @param string|null $custom2 The second custom field * - * @return $this + * @return self */ 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; @@ -660,23 +474,10 @@ public function getCustom3() * * @param string|null $custom3 The third custom field * - * @return $this + * @return self */ 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; @@ -697,23 +498,10 @@ public function getCustom4() * * @param string|null $custom4 The fourth custom field * - * @return $this + * @return self */ 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; @@ -734,23 +522,10 @@ public function getScheduledDeletionDate() * * @param \DateTime|null $scheduledDeletionDate The date in ISO 8601 format, YYYY-MM-DD, on which the contact is going to be deleted because it has not belonged to a group for 30 days * - * @return $this + * @return self */ public function setScheduledDeletionDate($scheduledDeletionDate) { - - if (is_null($scheduledDeletionDate)) { - array_push($this->openAPINullablesSetToNull, 'scheduledDeletionDate'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('scheduledDeletionDate', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - - $this->container['scheduledDeletionDate'] = $scheduledDeletionDate; return $this; @@ -772,18 +547,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -808,6 +583,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -820,6 +607,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/ContactUpdateFields.php b/lib/Model/ContactUpdateFields.php index 2f731b6..1f4c757 100644 --- a/lib/Model/ContactUpdateFields.php +++ b/lib/Model/ContactUpdateFields.php @@ -2,7 +2,7 @@ /** * ContactUpdateFields * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class ContactUpdateFields implements ModelInterface, ArrayAccess +class ContactUpdateFields implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -73,6 +76,8 @@ class ContactUpdateFields implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'email' => null, @@ -86,30 +91,6 @@ 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 * @@ -130,60 +111,6 @@ 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 @@ -277,9 +204,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -296,26 +220,15 @@ public function getModelName() */ public function __construct(array $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; + $this->container['email'] = $data['email'] ?? null; + $this->container['firstName'] = $data['firstName'] ?? null; + $this->container['lastName'] = $data['lastName'] ?? null; + $this->container['company'] = $data['company'] ?? null; + $this->container['title'] = $data['title'] ?? null; + $this->container['custom'] = $data['custom'] ?? null; + $this->container['custom2'] = $data['custom2'] ?? null; + $this->container['custom3'] = $data['custom3'] ?? null; + $this->container['custom4'] = $data['custom4'] ?? null; } /** @@ -357,23 +270,10 @@ public function getEmail() * * @param string|null $email The email of the contact * - * @return $this + * @return self */ 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; @@ -394,23 +294,10 @@ public function getFirstName() * * @param string|null $firstName The first name of the contact * - * @return $this + * @return self */ 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; @@ -431,23 +318,10 @@ public function getLastName() * * @param string|null $lastName The last name of the contact * - * @return $this + * @return self */ 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; @@ -468,23 +342,10 @@ public function getCompany() * * @param string|null $company The company of the contact * - * @return $this + * @return self */ 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; @@ -505,23 +366,10 @@ public function getTitle() * * @param string|null $title The title of the contact * - * @return $this + * @return self */ 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; @@ -542,23 +390,10 @@ public function getCustom() * * @param string|null $custom The first custom field * - * @return $this + * @return self */ 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; @@ -579,23 +414,10 @@ public function getCustom2() * * @param string|null $custom2 The second custom field * - * @return $this + * @return self */ 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; @@ -616,23 +438,10 @@ public function getCustom3() * * @param string|null $custom3 The third custom field * - * @return $this + * @return self */ 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; @@ -653,23 +462,10 @@ public function getCustom4() * * @param string|null $custom4 The fourth custom field * - * @return $this + * @return self */ 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; @@ -691,18 +487,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -727,6 +523,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -739,6 +547,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/DeliveryReportResponse.php b/lib/Model/DeliveryReportResponse.php index c078fea..0ac1bdb 100644 --- a/lib/Model/DeliveryReportResponse.php +++ b/lib/Model/DeliveryReportResponse.php @@ -2,7 +2,7 @@ /** * DeliveryReportResponse * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class DeliveryReportResponse implements ModelInterface, ArrayAccess +class DeliveryReportResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -67,6 +70,8 @@ class DeliveryReportResponse implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'statuses' => null, @@ -74,24 +79,6 @@ 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 * @@ -112,60 +99,6 @@ 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 @@ -241,9 +174,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -260,20 +190,9 @@ public function getModelName() */ public function __construct(array $data = 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; + $this->container['statuses'] = $data['statuses'] ?? null; + $this->container['to'] = $data['to'] ?? null; + $this->container['omnimessageId'] = $data['omnimessageId'] ?? null; } /** @@ -324,16 +243,10 @@ public function getStatuses() * * @param \Messente\Api\Model\DeliveryResult[] $statuses Contains the delivery reports for each channel, ordered by send order * - * @return $this + * @return self */ public function setStatuses($statuses) { - - - if (is_null($statuses)) { - throw new \InvalidArgumentException('non-nullable statuses cannot be null'); - } - $this->container['statuses'] = $statuses; return $this; @@ -354,16 +267,10 @@ public function getTo() * * @param string $to Phone number in e.164 format * - * @return $this + * @return self */ public function setTo($to) { - - - if (is_null($to)) { - throw new \InvalidArgumentException('non-nullable to cannot be null'); - } - $this->container['to'] = $to; return $this; @@ -384,16 +291,10 @@ public function getOmnimessageId() * * @param string $omnimessageId Unique identifier for the omnimessage * - * @return $this + * @return self */ public function setOmnimessageId($omnimessageId) { - - - if (is_null($omnimessageId)) { - throw new \InvalidArgumentException('non-nullable omnimessageId cannot be null'); - } - $this->container['omnimessageId'] = $omnimessageId; return $this; @@ -415,18 +316,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -451,6 +352,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -463,6 +376,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/DeliveryResult.php b/lib/Model/DeliveryResult.php index 3dd6dde..049d5e3 100644 --- a/lib/Model/DeliveryResult.php +++ b/lib/Model/DeliveryResult.php @@ -2,7 +2,7 @@ /** * DeliveryResult * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class DeliveryResult implements ModelInterface, ArrayAccess +class DeliveryResult implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -70,6 +73,8 @@ class DeliveryResult implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'status' => null, @@ -80,27 +85,6 @@ 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 * @@ -121,60 +105,6 @@ 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 @@ -259,9 +189,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -278,23 +205,12 @@ public function getModelName() */ public function __construct(array $data = 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; + $this->container['status'] = $data['status'] ?? null; + $this->container['channel'] = $data['channel'] ?? null; + $this->container['messageId'] = $data['messageId'] ?? null; + $this->container['error'] = $data['error'] ?? null; + $this->container['err'] = $data['err'] ?? null; + $this->container['timestamp'] = $data['timestamp'] ?? null; } /** @@ -336,16 +252,10 @@ public function getStatus() * * @param \Messente\Api\Model\Status|null $status status * - * @return $this + * @return self */ public function setStatus($status) { - - - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; return $this; @@ -366,16 +276,10 @@ public function getChannel() * * @param \Messente\Api\Model\Channel|null $channel channel * - * @return $this + * @return self */ public function setChannel($channel) { - - - if (is_null($channel)) { - throw new \InvalidArgumentException('non-nullable channel cannot be null'); - } - $this->container['channel'] = $channel; return $this; @@ -396,16 +300,10 @@ public function getMessageId() * * @param string|null $messageId Unique identifier for the message * - * @return $this + * @return self */ public function setMessageId($messageId) { - - - if (is_null($messageId)) { - throw new \InvalidArgumentException('non-nullable messageId cannot be null'); - } - $this->container['messageId'] = $messageId; return $this; @@ -426,16 +324,10 @@ public function getError() * * @param string|null $error Human-readable description of what went wrong, *null* in case of success or if the message has not been processed yet * - * @return $this + * @return self */ public function setError($error) { - - - if (is_null($error)) { - throw new \InvalidArgumentException('non-nullable error cannot be null'); - } - $this->container['error'] = $error; return $this; @@ -456,16 +348,10 @@ public function getErr() * * @param \Messente\Api\Model\ErrorCodeOmnichannelMachine|null $err err * - * @return $this + * @return self */ public function setErr($err) { - - - if (is_null($err)) { - throw new \InvalidArgumentException('non-nullable err cannot be null'); - } - $this->container['err'] = $err; return $this; @@ -486,16 +372,10 @@ public function getTimestamp() * * @param \DateTime|null $timestamp When this status was received by Omnichannel API * - * @return $this + * @return self */ public function setTimestamp($timestamp) { - - - if (is_null($timestamp)) { - throw new \InvalidArgumentException('non-nullable timestamp cannot be null'); - } - $this->container['timestamp'] = $timestamp; return $this; @@ -517,18 +397,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -553,6 +433,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -565,6 +457,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/ErrorCodeOmnichannel.php b/lib/Model/ErrorCodeOmnichannel.php index 64a7750..5f88cd2 100644 --- a/lib/Model/ErrorCodeOmnichannel.php +++ b/lib/Model/ErrorCodeOmnichannel.php @@ -2,7 +2,7 @@ /** * ErrorCodeOmnichannel * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -45,13 +45,19 @@ class ErrorCodeOmnichannel * Possible values of this enum */ const _101 = '101'; + const _102 = '102'; + const _103 = '103'; + const _104 = '104'; + const _105 = '105'; + const _106 = '106'; + const _107 = '107'; - + /** * Gets allowable values of the enum * @return string[] @@ -65,7 +71,7 @@ public static function getAllowableEnumValues() self::_104, self::_105, self::_106, - self::_107, + self::_107 ]; } } diff --git a/lib/Model/ErrorCodeOmnichannelMachine.php b/lib/Model/ErrorCodeOmnichannelMachine.php index 03ae830..50b2f5f 100644 --- a/lib/Model/ErrorCodeOmnichannelMachine.php +++ b/lib/Model/ErrorCodeOmnichannelMachine.php @@ -2,7 +2,7 @@ /** * ErrorCodeOmnichannelMachine * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -44,19 +44,30 @@ class ErrorCodeOmnichannelMachine /** * Possible values of this enum */ - const 0 = 0; - const 1 = 1; - const 2 = 2; - const 3 = 3; - const 4 = 4; - const 5 = 5; - const 6 = 6; - const 7 = 7; - const 8 = 8; - const 9 = 9; - const 10 = 10; - const 999 = 999; - + const NUMBER_0 = 0; + + const NUMBER_1 = 1; + + const NUMBER_2 = 2; + + const NUMBER_3 = 3; + + const NUMBER_4 = 4; + + const NUMBER_5 = 5; + + const NUMBER_6 = 6; + + const NUMBER_7 = 7; + + const NUMBER_8 = 8; + + const NUMBER_9 = 9; + + const NUMBER_10 = 10; + + const NUMBER_999 = 999; + /** * Gets allowable values of the enum * @return string[] @@ -64,18 +75,18 @@ class ErrorCodeOmnichannelMachine public static function getAllowableEnumValues() { return [ - self::0, - self::1, - self::2, - self::3, - self::4, - self::5, - self::6, - self::7, - self::8, - self::9, - self::10, - self::999, + self::NUMBER_0, + self::NUMBER_1, + self::NUMBER_2, + self::NUMBER_3, + self::NUMBER_4, + self::NUMBER_5, + self::NUMBER_6, + self::NUMBER_7, + self::NUMBER_8, + self::NUMBER_9, + self::NUMBER_10, + self::NUMBER_999 ]; } } diff --git a/lib/Model/ErrorCodePhonebook.php b/lib/Model/ErrorCodePhonebook.php index 8a980d8..37fdb89 100644 --- a/lib/Model/ErrorCodePhonebook.php +++ b/lib/Model/ErrorCodePhonebook.php @@ -2,7 +2,7 @@ /** * ErrorCodePhonebook * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -45,12 +45,17 @@ class ErrorCodePhonebook * Possible values of this enum */ const _201 = '201'; + const _202 = '202'; + const _203 = '203'; + const _204 = '204'; + const _244 = '244'; + const _205 = '205'; - + /** * Gets allowable values of the enum * @return string[] @@ -63,7 +68,7 @@ public static function getAllowableEnumValues() self::_203, self::_204, self::_244, - self::_205, + self::_205 ]; } } diff --git a/lib/Model/ErrorCodeStatistics.php b/lib/Model/ErrorCodeStatistics.php index afabc11..6b082f7 100644 --- a/lib/Model/ErrorCodeStatistics.php +++ b/lib/Model/ErrorCodeStatistics.php @@ -2,7 +2,7 @@ /** * ErrorCodeStatistics * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -45,10 +45,13 @@ class ErrorCodeStatistics * Possible values of this enum */ const _100 = '100'; + const _103 = '103'; + const _104 = '104'; + const _105 = '105'; - + /** * Gets allowable values of the enum * @return string[] @@ -59,7 +62,7 @@ public static function getAllowableEnumValues() self::_100, self::_103, self::_104, - self::_105, + self::_105 ]; } } diff --git a/lib/Model/ErrorItemNumberLookup.php b/lib/Model/ErrorItemNumberLookup.php index d0eef98..1173426 100644 --- a/lib/Model/ErrorItemNumberLookup.php +++ b/lib/Model/ErrorItemNumberLookup.php @@ -2,7 +2,7 @@ /** * ErrorItemNumberLookup * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class ErrorItemNumberLookup implements ModelInterface, ArrayAccess +class ErrorItemNumberLookup implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -65,27 +68,13 @@ class ErrorItemNumberLookup implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'error' => null ]; - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static $openAPINullables = [ - 'error' => 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 * @@ -106,60 +95,6 @@ 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 @@ -229,9 +164,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -248,18 +180,7 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('error', $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; + $this->container['error'] = $data['error'] ?? null; } /** @@ -304,16 +225,10 @@ public function getError() * * @param \Messente\Api\Model\ErrorItemNumberLookupError $error error * - * @return $this + * @return self */ public function setError($error) { - - - if (is_null($error)) { - throw new \InvalidArgumentException('non-nullable error cannot be null'); - } - $this->container['error'] = $error; return $this; @@ -335,18 +250,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -371,6 +286,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -383,6 +310,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/ErrorItemNumberLookupError.php b/lib/Model/ErrorItemNumberLookupError.php index e0ad19c..b8f6254 100644 --- a/lib/Model/ErrorItemNumberLookupError.php +++ b/lib/Model/ErrorItemNumberLookupError.php @@ -2,7 +2,7 @@ /** * ErrorItemNumberLookupError * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class ErrorItemNumberLookupError implements ModelInterface, ArrayAccess +class ErrorItemNumberLookupError implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -66,29 +69,14 @@ class ErrorItemNumberLookupError implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'description' => null, 'code' => null ]; - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static $openAPINullables = [ - 'description' => 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 * @@ -109,60 +97,6 @@ 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 @@ -235,9 +169,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -254,19 +185,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('description', $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; + $this->container['description'] = $data['description'] ?? null; + $this->container['code'] = $data['code'] ?? null; } /** @@ -322,16 +242,10 @@ public function getDescription() * * @param string $description Error description * - * @return $this + * @return self */ public function setDescription($description) { - - - if (is_null($description)) { - throw new \InvalidArgumentException('non-nullable description cannot be null'); - } - $this->container['description'] = $description; return $this; @@ -352,7 +266,7 @@ public function getCode() * * @param int $code Matches the following error title. This field is a constant * 101 - Unauthorized * 102 - Invalid arguments or parameters * 103 - Server error * 104 - Crediting error #1 * 105 - Crediting error #2 * 106 - Client error * - * @return $this + * @return self */ public function setCode($code) { @@ -364,12 +278,6 @@ public function setCode($code) throw new \InvalidArgumentException('invalid value for $code when calling ErrorItemNumberLookupError., must be bigger than or equal to 101.'); } - - - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; return $this; @@ -391,18 +299,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -427,6 +335,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -439,6 +359,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/ErrorItemOmnichannel.php b/lib/Model/ErrorItemOmnichannel.php index 7bf1027..dd1cad6 100644 --- a/lib/Model/ErrorItemOmnichannel.php +++ b/lib/Model/ErrorItemOmnichannel.php @@ -2,7 +2,7 @@ /** * ErrorItemOmnichannel * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class ErrorItemOmnichannel implements ModelInterface, ArrayAccess +class ErrorItemOmnichannel implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -68,6 +71,8 @@ class ErrorItemOmnichannel implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'title' => null, @@ -76,25 +81,6 @@ 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' => 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 * @@ -115,60 +101,6 @@ 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 @@ -247,9 +179,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -266,21 +195,10 @@ public function getModelName() */ public function __construct(array $data = 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; + $this->container['title'] = $data['title'] ?? null; + $this->container['detail'] = $data['detail'] ?? null; + $this->container['code'] = $data['code'] ?? null; + $this->container['source'] = $data['source'] ?? null; } /** @@ -334,16 +252,10 @@ public function getTitle() * * @param \Messente\Api\Model\ErrorTitleOmnichannel $title title * - * @return $this + * @return self */ public function setTitle($title) { - - - if (is_null($title)) { - throw new \InvalidArgumentException('non-nullable title cannot be null'); - } - $this->container['title'] = $title; return $this; @@ -364,16 +276,10 @@ public function getDetail() * * @param string $detail Free form more detailed description of the error * - * @return $this + * @return self */ public function setDetail($detail) { - - - if (is_null($detail)) { - throw new \InvalidArgumentException('non-nullable detail cannot be null'); - } - $this->container['detail'] = $detail; return $this; @@ -394,16 +300,10 @@ public function getCode() * * @param \Messente\Api\Model\ErrorCodeOmnichannel $code code * - * @return $this + * @return self */ public function setCode($code) { - - - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; return $this; @@ -424,23 +324,10 @@ public function getSource() * * @param string $source Describes which field is causing the issue in the payload, null for non 400 status code responses * - * @return $this + * @return self */ public function setSource($source) { - - if (is_null($source)) { - array_push($this->openAPINullablesSetToNull, 'source'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('source', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - - $this->container['source'] = $source; return $this; @@ -462,18 +349,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -498,6 +385,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -510,6 +409,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/ErrorItemPhonebook.php b/lib/Model/ErrorItemPhonebook.php index 0f7f426..8e0cb54 100644 --- a/lib/Model/ErrorItemPhonebook.php +++ b/lib/Model/ErrorItemPhonebook.php @@ -2,7 +2,7 @@ /** * ErrorItemPhonebook * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class ErrorItemPhonebook implements ModelInterface, ArrayAccess +class ErrorItemPhonebook implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -67,6 +70,8 @@ class ErrorItemPhonebook implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'title' => null, @@ -74,24 +79,6 @@ 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 * @@ -112,60 +99,6 @@ 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 @@ -241,9 +174,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -260,20 +190,9 @@ public function getModelName() */ public function __construct(array $data = 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; + $this->container['title'] = $data['title'] ?? null; + $this->container['detail'] = $data['detail'] ?? null; + $this->container['code'] = $data['code'] ?? null; } /** @@ -324,16 +243,10 @@ public function getTitle() * * @param \Messente\Api\Model\ErrorTitlePhonebook $title title * - * @return $this + * @return self */ public function setTitle($title) { - - - if (is_null($title)) { - throw new \InvalidArgumentException('non-nullable title cannot be null'); - } - $this->container['title'] = $title; return $this; @@ -354,16 +267,10 @@ public function getDetail() * * @param string $detail Free form more detailed description of the error * - * @return $this + * @return self */ public function setDetail($detail) { - - - if (is_null($detail)) { - throw new \InvalidArgumentException('non-nullable detail cannot be null'); - } - $this->container['detail'] = $detail; return $this; @@ -384,16 +291,10 @@ public function getCode() * * @param \Messente\Api\Model\ErrorCodePhonebook $code code * - * @return $this + * @return self */ public function setCode($code) { - - - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; return $this; @@ -415,18 +316,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -451,6 +352,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -463,6 +376,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/ErrorItemStatistics.php b/lib/Model/ErrorItemStatistics.php index 278f46c..1c794d4 100644 --- a/lib/Model/ErrorItemStatistics.php +++ b/lib/Model/ErrorItemStatistics.php @@ -2,7 +2,7 @@ /** * ErrorItemStatistics * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class ErrorItemStatistics implements ModelInterface, ArrayAccess +class ErrorItemStatistics implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -67,6 +70,8 @@ class ErrorItemStatistics implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'title' => null, @@ -74,24 +79,6 @@ class ErrorItemStatistics implements ModelInterface, ArrayAccess 'code' => null ]; - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static $openAPINullables = [ - 'title' => false, - 'details' => 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 * @@ -112,60 +99,6 @@ 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 @@ -241,9 +174,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -260,20 +190,9 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('title', $data, null); - $this->setIfExists('details', $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; + $this->container['title'] = $data['title'] ?? null; + $this->container['details'] = $data['details'] ?? null; + $this->container['code'] = $data['code'] ?? null; } /** @@ -324,16 +243,10 @@ public function getTitle() * * @param string $title Error title * - * @return $this + * @return self */ public function setTitle($title) { - - - if (is_null($title)) { - throw new \InvalidArgumentException('non-nullable title cannot be null'); - } - $this->container['title'] = $title; return $this; @@ -354,16 +267,10 @@ public function getDetails() * * @param string $details Error details * - * @return $this + * @return self */ public function setDetails($details) { - - - if (is_null($details)) { - throw new \InvalidArgumentException('non-nullable details cannot be null'); - } - $this->container['details'] = $details; return $this; @@ -384,16 +291,10 @@ public function getCode() * * @param \Messente\Api\Model\ErrorCodeStatistics $code code * - * @return $this + * @return self */ public function setCode($code) { - - - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; return $this; @@ -415,18 +316,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -451,6 +352,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -463,6 +376,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/ErrorNumberLookup.php b/lib/Model/ErrorNumberLookup.php index f62ff86..1e4d769 100644 --- a/lib/Model/ErrorNumberLookup.php +++ b/lib/Model/ErrorNumberLookup.php @@ -2,7 +2,7 @@ /** * ErrorNumberLookup * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class ErrorNumberLookup implements ModelInterface, ArrayAccess +class ErrorNumberLookup implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -65,27 +68,13 @@ class ErrorNumberLookup implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -106,60 +95,6 @@ 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 @@ -229,9 +164,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -248,18 +180,7 @@ public function getModelName() */ public function __construct(array $data = 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; + $this->container['errors'] = $data['errors'] ?? null; } /** @@ -304,16 +225,10 @@ public function getErrors() * * @param \Messente\Api\Model\ErrorItemNumberLookup[] $errors An array of errors * - * @return $this + * @return self */ public function setErrors($errors) { - - - if (is_null($errors)) { - throw new \InvalidArgumentException('non-nullable errors cannot be null'); - } - $this->container['errors'] = $errors; return $this; @@ -335,18 +250,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -371,6 +286,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -383,6 +310,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/ErrorOmnichannel.php b/lib/Model/ErrorOmnichannel.php index d7ffaa8..ff18c12 100644 --- a/lib/Model/ErrorOmnichannel.php +++ b/lib/Model/ErrorOmnichannel.php @@ -2,7 +2,7 @@ /** * ErrorOmnichannel * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class ErrorOmnichannel implements ModelInterface, ArrayAccess +class ErrorOmnichannel implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -65,27 +68,13 @@ class ErrorOmnichannel implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -106,60 +95,6 @@ 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 @@ -229,9 +164,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -248,18 +180,7 @@ public function getModelName() */ public function __construct(array $data = 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; + $this->container['errors'] = $data['errors'] ?? null; } /** @@ -304,16 +225,10 @@ public function getErrors() * * @param \Messente\Api\Model\ErrorItemOmnichannel[] $errors An array of errors * - * @return $this + * @return self */ public function setErrors($errors) { - - - if (is_null($errors)) { - throw new \InvalidArgumentException('non-nullable errors cannot be null'); - } - $this->container['errors'] = $errors; return $this; @@ -335,18 +250,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -371,6 +286,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -383,6 +310,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/ErrorPhonebook.php b/lib/Model/ErrorPhonebook.php index fb54b7f..6f5f502 100644 --- a/lib/Model/ErrorPhonebook.php +++ b/lib/Model/ErrorPhonebook.php @@ -2,7 +2,7 @@ /** * ErrorPhonebook * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class ErrorPhonebook implements ModelInterface, ArrayAccess +class ErrorPhonebook implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -65,27 +68,13 @@ class ErrorPhonebook implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -106,60 +95,6 @@ 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 @@ -229,9 +164,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -248,18 +180,7 @@ public function getModelName() */ public function __construct(array $data = 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; + $this->container['errors'] = $data['errors'] ?? null; } /** @@ -304,16 +225,10 @@ public function getErrors() * * @param \Messente\Api\Model\ErrorItemPhonebook[] $errors An array of errors * - * @return $this + * @return self */ public function setErrors($errors) { - - - if (is_null($errors)) { - throw new \InvalidArgumentException('non-nullable errors cannot be null'); - } - $this->container['errors'] = $errors; return $this; @@ -335,18 +250,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -371,6 +286,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -383,6 +310,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/ErrorStatistics.php b/lib/Model/ErrorStatistics.php index f5c8840..dec3d64 100644 --- a/lib/Model/ErrorStatistics.php +++ b/lib/Model/ErrorStatistics.php @@ -2,7 +2,7 @@ /** * ErrorStatistics * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class ErrorStatistics implements ModelInterface, ArrayAccess +class ErrorStatistics implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -65,27 +68,13 @@ class ErrorStatistics implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -106,60 +95,6 @@ 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 @@ -229,9 +164,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -248,18 +180,7 @@ public function getModelName() */ public function __construct(array $data = 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; + $this->container['errors'] = $data['errors'] ?? null; } /** @@ -304,16 +225,10 @@ public function getErrors() * * @param \Messente\Api\Model\ErrorItemStatistics[] $errors An array of errors * - * @return $this + * @return self */ public function setErrors($errors) { - - - if (is_null($errors)) { - throw new \InvalidArgumentException('non-nullable errors cannot be null'); - } - $this->container['errors'] = $errors; return $this; @@ -335,18 +250,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -371,6 +286,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -383,6 +310,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/ErrorTitleOmnichannel.php b/lib/Model/ErrorTitleOmnichannel.php index f4657c9..e5a0b6b 100644 --- a/lib/Model/ErrorTitleOmnichannel.php +++ b/lib/Model/ErrorTitleOmnichannel.php @@ -2,7 +2,7 @@ /** * ErrorTitleOmnichannel * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -45,13 +45,19 @@ class ErrorTitleOmnichannel * Possible values of this enum */ const NOT_FOUND = 'Not found'; + const FORBIDDEN = 'Forbidden'; + const UNAUTHORIZED = 'Unauthorized'; + const INVALID_DATA = 'Invalid data'; + const INTERNAL_SERVER_ERROR = 'Internal Server Error'; + const MISSING_DATA = 'Missing data'; + const METHOD_NOT_ALLOWED = 'Method not allowed'; - + /** * Gets allowable values of the enum * @return string[] @@ -65,7 +71,7 @@ public static function getAllowableEnumValues() self::INVALID_DATA, self::INTERNAL_SERVER_ERROR, self::MISSING_DATA, - self::METHOD_NOT_ALLOWED, + self::METHOD_NOT_ALLOWED ]; } } diff --git a/lib/Model/ErrorTitlePhonebook.php b/lib/Model/ErrorTitlePhonebook.php index c2ca7b0..5fe8354 100644 --- a/lib/Model/ErrorTitlePhonebook.php +++ b/lib/Model/ErrorTitlePhonebook.php @@ -2,7 +2,7 @@ /** * ErrorTitlePhonebook * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -45,12 +45,17 @@ class ErrorTitlePhonebook * Possible values of this enum */ const INVALID_DATA = 'Invalid data'; + const UNAUTHORIZED = 'Unauthorized'; + const MISSING_RESOURCE = 'Missing resource'; + const CONFLICT = 'Conflict'; + const CLIENT_ERROR = 'Client error'; + const GENERAL_ERROR = 'General error'; - + /** * Gets allowable values of the enum * @return string[] @@ -63,7 +68,7 @@ public static function getAllowableEnumValues() self::MISSING_RESOURCE, self::CONFLICT, self::CLIENT_ERROR, - self::GENERAL_ERROR, + self::GENERAL_ERROR ]; } } diff --git a/lib/Model/FetchBlacklistSuccess.php b/lib/Model/FetchBlacklistSuccess.php index 8d3179f..55fe1a5 100644 --- a/lib/Model/FetchBlacklistSuccess.php +++ b/lib/Model/FetchBlacklistSuccess.php @@ -2,7 +2,7 @@ /** * FetchBlacklistSuccess * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class FetchBlacklistSuccess implements ModelInterface, ArrayAccess +class FetchBlacklistSuccess implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -65,27 +68,13 @@ class FetchBlacklistSuccess implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -106,60 +95,6 @@ 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 @@ -229,9 +164,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -248,18 +180,7 @@ public function getModelName() */ public function __construct(array $data = 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; + $this->container['phoneNumbers'] = $data['phoneNumbers'] ?? null; } /** @@ -301,16 +222,12 @@ public function getPhoneNumbers() * * @param string[]|null $phoneNumbers Array of unique phone numbers * - * @return $this + * @return self */ public function setPhoneNumbers($phoneNumbers) { - if (is_null($phoneNumbers)) { - throw new \InvalidArgumentException('non-nullable phoneNumbers cannot be null'); - } - $this->container['phoneNumbers'] = $phoneNumbers; return $this; @@ -332,18 +249,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -368,6 +285,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -380,6 +309,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/GroupEnvelope.php b/lib/Model/GroupEnvelope.php index 1ce8f9d..d2fd51c 100644 --- a/lib/Model/GroupEnvelope.php +++ b/lib/Model/GroupEnvelope.php @@ -2,7 +2,7 @@ /** * GroupEnvelope * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class GroupEnvelope implements ModelInterface, ArrayAccess +class GroupEnvelope implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -65,27 +68,13 @@ class GroupEnvelope implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -106,60 +95,6 @@ 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 @@ -229,9 +164,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -248,18 +180,7 @@ public function getModelName() */ public function __construct(array $data = 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; + $this->container['group'] = $data['group'] ?? null; } /** @@ -301,16 +222,10 @@ public function getGroup() * * @param \Messente\Api\Model\GroupResponseFields|null $group group * - * @return $this + * @return self */ public function setGroup($group) { - - - if (is_null($group)) { - throw new \InvalidArgumentException('non-nullable group cannot be null'); - } - $this->container['group'] = $group; return $this; @@ -332,18 +247,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -368,6 +283,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -380,6 +307,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/GroupListEnvelope.php b/lib/Model/GroupListEnvelope.php index f1f7e25..da5982b 100644 --- a/lib/Model/GroupListEnvelope.php +++ b/lib/Model/GroupListEnvelope.php @@ -2,7 +2,7 @@ /** * GroupListEnvelope * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class GroupListEnvelope implements ModelInterface, ArrayAccess +class GroupListEnvelope implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -65,27 +68,13 @@ class GroupListEnvelope implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -106,60 +95,6 @@ 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 @@ -229,9 +164,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -248,18 +180,7 @@ public function getModelName() */ public function __construct(array $data = 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; + $this->container['groups'] = $data['groups'] ?? null; } /** @@ -301,16 +222,12 @@ public function getGroups() * * @param \Messente\Api\Model\GroupResponseFields[]|null $groups An array of groups * - * @return $this + * @return self */ public function setGroups($groups) { - if (is_null($groups)) { - throw new \InvalidArgumentException('non-nullable groups cannot be null'); - } - $this->container['groups'] = $groups; return $this; @@ -332,18 +249,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -368,6 +285,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -380,6 +309,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/GroupName.php b/lib/Model/GroupName.php index a7b9c41..5d6f31b 100644 --- a/lib/Model/GroupName.php +++ b/lib/Model/GroupName.php @@ -2,7 +2,7 @@ /** * GroupName * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class GroupName implements ModelInterface, ArrayAccess +class GroupName implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -65,27 +68,13 @@ class GroupName implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -106,60 +95,6 @@ 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 @@ -229,9 +164,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -248,18 +180,7 @@ public function getModelName() */ public function __construct(array $data = 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; + $this->container['name'] = $data['name'] ?? null; } /** @@ -308,7 +229,7 @@ public function getName() * * @param string $name The name of the group * - * @return $this + * @return self */ public function setName($name) { @@ -317,12 +238,6 @@ 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; @@ -344,18 +259,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -380,6 +295,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -392,6 +319,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/GroupResponseFields.php b/lib/Model/GroupResponseFields.php index 1b3781c..8da8935 100644 --- a/lib/Model/GroupResponseFields.php +++ b/lib/Model/GroupResponseFields.php @@ -2,7 +2,7 @@ /** * GroupResponseFields * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class GroupResponseFields implements ModelInterface, ArrayAccess +class GroupResponseFields implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -68,6 +71,8 @@ class GroupResponseFields implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'id' => null, @@ -76,25 +81,6 @@ 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 * @@ -115,60 +101,6 @@ 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 @@ -247,9 +179,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -266,21 +195,10 @@ public function getModelName() */ public function __construct(array $data = 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; + $this->container['id'] = $data['id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['createdOn'] = $data['createdOn'] ?? null; + $this->container['contactsCount'] = $data['contactsCount'] ?? null; } /** @@ -331,16 +249,10 @@ public function getId() * * @param string $id Id string in UUID format * - * @return $this + * @return self */ public function setId($id) { - - - if (is_null($id)) { - throw new \InvalidArgumentException('non-nullable id cannot be null'); - } - $this->container['id'] = $id; return $this; @@ -361,16 +273,10 @@ public function getName() * * @param string $name The name of the group * - * @return $this + * @return self */ public function setName($name) { - - - if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); - } - $this->container['name'] = $name; return $this; @@ -391,23 +297,10 @@ public function getCreatedOn() * * @param string|null $createdOn When the group was created * - * @return $this + * @return self */ 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; @@ -428,16 +321,10 @@ public function getContactsCount() * * @param int $contactsCount The count of contacts in the group * - * @return $this + * @return self */ public function setContactsCount($contactsCount) { - - - if (is_null($contactsCount)) { - throw new \InvalidArgumentException('non-nullable contactsCount cannot be null'); - } - $this->container['contactsCount'] = $contactsCount; return $this; @@ -459,18 +346,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -495,6 +382,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -507,6 +406,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/MessageResult.php b/lib/Model/MessageResult.php index 0d70066..5955d04 100644 --- a/lib/Model/MessageResult.php +++ b/lib/Model/MessageResult.php @@ -2,7 +2,7 @@ /** * MessageResult * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class MessageResult implements ModelInterface, ArrayAccess +class MessageResult implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -67,6 +70,8 @@ class MessageResult implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'messageId' => 'UUID', @@ -74,24 +79,6 @@ 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 * @@ -112,60 +99,6 @@ 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 @@ -241,9 +174,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -260,20 +190,9 @@ public function getModelName() */ public function __construct(array $data = 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; + $this->container['messageId'] = $data['messageId'] ?? null; + $this->container['channel'] = $data['channel'] ?? null; + $this->container['sender'] = $data['sender'] ?? null; } /** @@ -324,16 +243,10 @@ public function getMessageId() * * @param string $messageId Unique identifier for the message * - * @return $this + * @return self */ public function setMessageId($messageId) { - - - if (is_null($messageId)) { - throw new \InvalidArgumentException('non-nullable messageId cannot be null'); - } - $this->container['messageId'] = $messageId; return $this; @@ -354,16 +267,10 @@ public function getChannel() * * @param \Messente\Api\Model\Channel $channel channel * - * @return $this + * @return self */ public function setChannel($channel) { - - - if (is_null($channel)) { - throw new \InvalidArgumentException('non-nullable channel cannot be null'); - } - $this->container['channel'] = $channel; return $this; @@ -384,16 +291,10 @@ public function getSender() * * @param string $sender Sender that was used for the message * - * @return $this + * @return self */ public function setSender($sender) { - - - if (is_null($sender)) { - throw new \InvalidArgumentException('non-nullable sender cannot be null'); - } - $this->container['sender'] = $sender; return $this; @@ -415,18 +316,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -451,6 +352,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -463,6 +376,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/MobileNetwork.php b/lib/Model/MobileNetwork.php index d43e621..8309511 100644 --- a/lib/Model/MobileNetwork.php +++ b/lib/Model/MobileNetwork.php @@ -2,7 +2,7 @@ /** * MobileNetwork * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class MobileNetwork implements ModelInterface, ArrayAccess +class MobileNetwork implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -69,6 +72,8 @@ class MobileNetwork implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'mccmnc' => null, @@ -78,26 +83,6 @@ class MobileNetwork implements ModelInterface, ArrayAccess 'countryCode' => null ]; - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static $openAPINullables = [ - 'mccmnc' => false, - 'networkName' => false, - 'countryName' => false, - 'countryPrefix' => false, - 'countryCode' => 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 * @@ -118,60 +103,6 @@ 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 @@ -253,9 +184,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -272,22 +200,11 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('mccmnc', $data, null); - $this->setIfExists('networkName', $data, null); - $this->setIfExists('countryName', $data, null); - $this->setIfExists('countryPrefix', $data, null); - $this->setIfExists('countryCode', $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; + $this->container['mccmnc'] = $data['mccmnc'] ?? null; + $this->container['networkName'] = $data['networkName'] ?? null; + $this->container['countryName'] = $data['countryName'] ?? null; + $this->container['countryPrefix'] = $data['countryPrefix'] ?? null; + $this->container['countryCode'] = $data['countryCode'] ?? null; } /** @@ -329,16 +246,10 @@ public function getMccmnc() * * @param string|null $mccmnc Mobile country and mobile network code * - * @return $this + * @return self */ public function setMccmnc($mccmnc) { - - - if (is_null($mccmnc)) { - throw new \InvalidArgumentException('non-nullable mccmnc cannot be null'); - } - $this->container['mccmnc'] = $mccmnc; return $this; @@ -359,16 +270,10 @@ public function getNetworkName() * * @param string|null $networkName Mobile network name * - * @return $this + * @return self */ public function setNetworkName($networkName) { - - - if (is_null($networkName)) { - throw new \InvalidArgumentException('non-nullable networkName cannot be null'); - } - $this->container['networkName'] = $networkName; return $this; @@ -389,16 +294,10 @@ public function getCountryName() * * @param string|null $countryName Country name * - * @return $this + * @return self */ public function setCountryName($countryName) { - - - if (is_null($countryName)) { - throw new \InvalidArgumentException('non-nullable countryName cannot be null'); - } - $this->container['countryName'] = $countryName; return $this; @@ -419,16 +318,10 @@ public function getCountryPrefix() * * @param string|null $countryPrefix Country prefix * - * @return $this + * @return self */ public function setCountryPrefix($countryPrefix) { - - - if (is_null($countryPrefix)) { - throw new \InvalidArgumentException('non-nullable countryPrefix cannot be null'); - } - $this->container['countryPrefix'] = $countryPrefix; return $this; @@ -449,16 +342,10 @@ public function getCountryCode() * * @param string|null $countryCode Country code * - * @return $this + * @return self */ public function setCountryCode($countryCode) { - - - if (is_null($countryCode)) { - throw new \InvalidArgumentException('non-nullable countryCode cannot be null'); - } - $this->container['countryCode'] = $countryCode; return $this; @@ -480,18 +367,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -516,6 +403,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -528,6 +427,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/ModelInterface.php b/lib/Model/ModelInterface.php index 0256178..672465c 100644 --- a/lib/Model/ModelInterface.php +++ b/lib/Model/ModelInterface.php @@ -2,7 +2,7 @@ /** * ModelInterface * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api\Model @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** diff --git a/lib/Model/NumberToBlacklist.php b/lib/Model/NumberToBlacklist.php index 59a4407..59d996c 100644 --- a/lib/Model/NumberToBlacklist.php +++ b/lib/Model/NumberToBlacklist.php @@ -2,7 +2,7 @@ /** * NumberToBlacklist * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class NumberToBlacklist implements ModelInterface, ArrayAccess +class NumberToBlacklist implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -65,27 +68,13 @@ class NumberToBlacklist implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -106,60 +95,6 @@ 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 @@ -229,9 +164,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -248,18 +180,7 @@ public function getModelName() */ public function __construct(array $data = 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; + $this->container['phoneNumber'] = $data['phoneNumber'] ?? null; } /** @@ -304,16 +225,10 @@ public function getPhoneNumber() * * @param string $phoneNumber Phone number in e.164 format * - * @return $this + * @return self */ public function setPhoneNumber($phoneNumber) { - - - if (is_null($phoneNumber)) { - throw new \InvalidArgumentException('non-nullable phoneNumber cannot be null'); - } - $this->container['phoneNumber'] = $phoneNumber; return $this; @@ -335,18 +250,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -371,6 +286,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -383,6 +310,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/NumbersToInvestigate.php b/lib/Model/NumbersToInvestigate.php index 99ffa81..5f5b95c 100644 --- a/lib/Model/NumbersToInvestigate.php +++ b/lib/Model/NumbersToInvestigate.php @@ -2,7 +2,7 @@ /** * NumbersToInvestigate * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class NumbersToInvestigate implements ModelInterface, ArrayAccess +class NumbersToInvestigate implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -65,27 +68,13 @@ class NumbersToInvestigate implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'numbers' => null ]; - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static $openAPINullables = [ - 'numbers' => 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 * @@ -106,60 +95,6 @@ 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 @@ -229,9 +164,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -248,18 +180,7 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('numbers', $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; + $this->container['numbers'] = $data['numbers'] ?? null; } /** @@ -274,6 +195,14 @@ public function listInvalidProperties() if ($this->container['numbers'] === null) { $invalidProperties[] = "'numbers' can't be null"; } + if ((count($this->container['numbers']) > 10)) { + $invalidProperties[] = "invalid value for 'numbers', number of items must be less than or equal to 10."; + } + + if ((count($this->container['numbers']) < 1)) { + $invalidProperties[] = "invalid value for 'numbers', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -302,18 +231,19 @@ public function getNumbers() /** * Sets numbers * - * @param string[] $numbers Array of phone numbers + * @param string[] $numbers A list of phone numbers. Max 10 numbers per request * - * @return $this + * @return self */ public function setNumbers($numbers) { - - if (is_null($numbers)) { - throw new \InvalidArgumentException('non-nullable numbers cannot be null'); + if ((count($numbers) > 10)) { + throw new \InvalidArgumentException('invalid value for $numbers when calling NumbersToInvestigate., number of items must be less than or equal to 10.'); + } + if ((count($numbers) < 1)) { + throw new \InvalidArgumentException('invalid length for $numbers when calling NumbersToInvestigate., number of items must be greater than or equal to 1.'); } - $this->container['numbers'] = $numbers; return $this; @@ -335,18 +265,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -371,6 +301,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -383,6 +325,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/OmniMessageCreateSuccessResponse.php b/lib/Model/OmniMessageCreateSuccessResponse.php index c239991..387711d 100644 --- a/lib/Model/OmniMessageCreateSuccessResponse.php +++ b/lib/Model/OmniMessageCreateSuccessResponse.php @@ -2,7 +2,7 @@ /** * OmniMessageCreateSuccessResponse * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class OmniMessageCreateSuccessResponse implements ModelInterface, ArrayAccess +class OmniMessageCreateSuccessResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -67,6 +70,8 @@ class OmniMessageCreateSuccessResponse implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'messages' => null, @@ -74,24 +79,6 @@ 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 * @@ -112,60 +99,6 @@ 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 @@ -241,9 +174,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -260,20 +190,9 @@ public function getModelName() */ public function __construct(array $data = 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; + $this->container['messages'] = $data['messages'] ?? null; + $this->container['to'] = $data['to'] ?? null; + $this->container['omnimessageId'] = $data['omnimessageId'] ?? null; } /** @@ -324,16 +243,10 @@ public function getMessages() * * @param \Messente\Api\Model\MessageResult[] $messages List of messages that compose the omnimessage * - * @return $this + * @return self */ public function setMessages($messages) { - - - if (is_null($messages)) { - throw new \InvalidArgumentException('non-nullable messages cannot be null'); - } - $this->container['messages'] = $messages; return $this; @@ -354,16 +267,10 @@ public function getTo() * * @param string $to Phone number in e.164 format * - * @return $this + * @return self */ public function setTo($to) { - - - if (is_null($to)) { - throw new \InvalidArgumentException('non-nullable to cannot be null'); - } - $this->container['to'] = $to; return $this; @@ -384,16 +291,10 @@ public function getOmnimessageId() * * @param string $omnimessageId Unique identifier for the omnimessage * - * @return $this + * @return self */ public function setOmnimessageId($omnimessageId) { - - - if (is_null($omnimessageId)) { - throw new \InvalidArgumentException('non-nullable omnimessageId cannot be null'); - } - $this->container['omnimessageId'] = $omnimessageId; return $this; @@ -415,18 +316,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -451,6 +352,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -463,6 +376,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/Omnimessage.php b/lib/Model/Omnimessage.php index 80a2b96..f312944 100644 --- a/lib/Model/Omnimessage.php +++ b/lib/Model/Omnimessage.php @@ -2,7 +2,7 @@ /** * Omnimessage * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class Omnimessage implements ModelInterface, ArrayAccess +class Omnimessage implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -70,6 +73,8 @@ class Omnimessage implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'to' => null, @@ -80,27 +85,6 @@ class Omnimessage implements ModelInterface, ArrayAccess 'priority' => null ]; - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static $openAPINullables = [ - 'to' => false, - 'messages' => false, - 'dlrUrl' => false, - 'textStore' => false, - 'timeToSend' => false, - 'priority' => 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 * @@ -121,60 +105,6 @@ 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 @@ -259,9 +189,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -278,23 +205,12 @@ public function getModelName() */ public function __construct(array $data = 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); - $this->setIfExists('priority', $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; + $this->container['to'] = $data['to'] ?? null; + $this->container['messages'] = $data['messages'] ?? null; + $this->container['dlrUrl'] = $data['dlrUrl'] ?? null; + $this->container['textStore'] = $data['textStore'] ?? null; + $this->container['timeToSend'] = $data['timeToSend'] ?? null; + $this->container['priority'] = $data['priority'] ?? null; } /** @@ -342,16 +258,10 @@ public function getTo() * * @param string $to Phone number in e.164 format * - * @return $this + * @return self */ public function setTo($to) { - - - if (is_null($to)) { - throw new \InvalidArgumentException('non-nullable to cannot be null'); - } - $this->container['to'] = $to; return $this; @@ -372,16 +282,10 @@ public function getMessages() * * @param OneOfViberSMSWhatsAppTelegram[] $messages An array of messages * - * @return $this + * @return self */ public function setMessages($messages) { - - - if (is_null($messages)) { - throw new \InvalidArgumentException('non-nullable messages cannot be null'); - } - $this->container['messages'] = $messages; return $this; @@ -402,16 +306,10 @@ public function getDlrUrl() * * @param string|null $dlrUrl URL where the delivery report will be sent * - * @return $this + * @return self */ public function setDlrUrl($dlrUrl) { - - - if (is_null($dlrUrl)) { - throw new \InvalidArgumentException('non-nullable dlrUrl cannot be null'); - } - $this->container['dlrUrl'] = $dlrUrl; return $this; @@ -432,16 +330,10 @@ public function getTextStore() * * @param \Messente\Api\Model\TextStore|null $textStore textStore * - * @return $this + * @return self */ public function setTextStore($textStore) { - - - if (is_null($textStore)) { - throw new \InvalidArgumentException('non-nullable textStore cannot be null'); - } - $this->container['textStore'] = $textStore; return $this; @@ -462,16 +354,10 @@ public function getTimeToSend() * * @param \DateTime|null $timeToSend Optional parameter for sending messages at some specific time in the future. Time must be specified in the ISO-8601 format. If no timezone is specified, then the timezone is assumed to be UTC Examples: * Time specified with timezone: 2018-06-22T09:05:07+00:00 Time specified in UTC: 2018-06-22T09:05:07Z * Time specified without timezone: 2018-06-22T09:05 (equivalent to 2018-06-22T09:05+00:00) * - * @return $this + * @return self */ public function setTimeToSend($timeToSend) { - - - if (is_null($timeToSend)) { - throw new \InvalidArgumentException('non-nullable timeToSend cannot be null'); - } - $this->container['timeToSend'] = $timeToSend; return $this; @@ -492,16 +378,10 @@ public function getPriority() * * @param \Messente\Api\Model\Priority|null $priority priority * - * @return $this + * @return self */ public function setPriority($priority) { - - - if (is_null($priority)) { - throw new \InvalidArgumentException('non-nullable priority cannot be null'); - } - $this->container['priority'] = $priority; return $this; @@ -523,18 +403,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -559,6 +439,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -571,6 +463,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/Priority.php b/lib/Model/Priority.php index 9d2746d..609f6b5 100644 --- a/lib/Model/Priority.php +++ b/lib/Model/Priority.php @@ -2,7 +2,7 @@ /** * Priority * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -45,9 +45,11 @@ class Priority * Possible values of this enum */ const LOW = 'low'; + const REGULAR = 'regular'; + const HIGH = 'high'; - + /** * Gets allowable values of the enum * @return string[] @@ -57,7 +59,7 @@ public static function getAllowableEnumValues() return [ self::LOW, self::REGULAR, - self::HIGH, + self::HIGH ]; } } diff --git a/lib/Model/SMS.php b/lib/Model/SMS.php index 69317d0..7f3c04d 100644 --- a/lib/Model/SMS.php +++ b/lib/Model/SMS.php @@ -2,7 +2,7 @@ /** * SMS * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class SMS implements ModelInterface, ArrayAccess +class SMS implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -70,6 +73,8 @@ class SMS implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'text' => null, @@ -80,27 +85,6 @@ 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 * @@ -121,60 +105,6 @@ 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 @@ -263,9 +193,7 @@ public function getModelName() const AUTOCONVERT_ON = 'on'; const AUTOCONVERT_OFF = 'off'; const CHANNEL_SMS = 'sms'; - - /** * Gets allowable values of the enum * @@ -279,7 +207,7 @@ public function getAutoconvertAllowableValues() self::AUTOCONVERT_OFF, ]; } - + /** * Gets allowable values of the enum * @@ -291,7 +219,6 @@ public function getChannelAllowableValues() self::CHANNEL_SMS, ]; } - /** * Associative array for storing property values @@ -308,23 +235,12 @@ public function getChannelAllowableValues() */ public function __construct(array $data = null) { - $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; + $this->container['text'] = $data['text'] ?? null; + $this->container['sender'] = $data['sender'] ?? null; + $this->container['validity'] = $data['validity'] ?? null; + $this->container['autoconvert'] = $data['autoconvert'] ?? null; + $this->container['udh'] = $data['udh'] ?? null; + $this->container['channel'] = $data['channel'] ?? 'sms'; } /** @@ -342,7 +258,8 @@ public function listInvalidProperties() $allowedValues = $this->getAutoconvertAllowableValues(); if (!is_null($this->container['autoconvert']) && !in_array($this->container['autoconvert'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'autoconvert', must be one of '%s'", + "invalid value '%s' for 'autoconvert', must be one of '%s'", + $this->container['autoconvert'], implode("', '", $allowedValues) ); } @@ -350,7 +267,8 @@ public function listInvalidProperties() $allowedValues = $this->getChannelAllowableValues(); if (!is_null($this->container['channel']) && !in_array($this->container['channel'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'channel', must be one of '%s'", + "invalid value '%s' for 'channel', must be one of '%s'", + $this->container['channel'], implode("', '", $allowedValues) ); } @@ -385,16 +303,10 @@ public function getText() * * @param string $text Text content of the SMS * - * @return $this + * @return self */ public function setText($text) { - - - if (is_null($text)) { - throw new \InvalidArgumentException('non-nullable text cannot be null'); - } - $this->container['text'] = $text; return $this; @@ -415,16 +327,10 @@ public function getSender() * * @param string|null $sender Phone number or alphanumeric sender name * - * @return $this + * @return self */ public function setSender($sender) { - - - if (is_null($sender)) { - throw new \InvalidArgumentException('non-nullable sender cannot be null'); - } - $this->container['sender'] = $sender; return $this; @@ -445,16 +351,10 @@ public function getValidity() * * @param int|null $validity After how many minutes this channel is considered as failed and the next channel is attempted * - * @return $this + * @return self */ public function setValidity($validity) { - - - if (is_null($validity)) { - throw new \InvalidArgumentException('non-nullable validity cannot be null'); - } - $this->container['validity'] = $validity; return $this; @@ -475,7 +375,7 @@ public function getAutoconvert() * * @param string|null $autoconvert Defines how non-GSM characters will be treated: - \"on\" Use replacement settings from the account's [API Auto Replace settings page](https://dashboard.messente.com/api-settings/auto-replace) (default) - \"full\" All non GSM 03.38 characters will be replaced with suitable alternatives - \"off\" Message content is not modified in any way * - * @return $this + * @return self */ public function setAutoconvert($autoconvert) { @@ -483,17 +383,12 @@ public function setAutoconvert($autoconvert) if (!is_null($autoconvert) && !in_array($autoconvert, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'autoconvert', must be one of '%s'", + "Invalid value '%s' for 'autoconvert', must be one of '%s'", + $autoconvert, implode("', '", $allowedValues) ) ); } - - - if (is_null($autoconvert)) { - throw new \InvalidArgumentException('non-nullable autoconvert cannot be null'); - } - $this->container['autoconvert'] = $autoconvert; return $this; @@ -514,16 +409,10 @@ public function getUdh() * * @param string|null $udh hex-encoded string containing SMS UDH * - * @return $this + * @return self */ public function setUdh($udh) { - - - if (is_null($udh)) { - throw new \InvalidArgumentException('non-nullable udh cannot be null'); - } - $this->container['udh'] = $udh; return $this; @@ -544,7 +433,7 @@ public function getChannel() * * @param string|null $channel The channel used to deliver the message * - * @return $this + * @return self */ public function setChannel($channel) { @@ -552,17 +441,12 @@ public function setChannel($channel) if (!is_null($channel) && !in_array($channel, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'channel', must be one of '%s'", + "Invalid value '%s' for 'channel', must be one of '%s'", + $channel, implode("', '", $allowedValues) ) ); } - - - if (is_null($channel)) { - throw new \InvalidArgumentException('non-nullable channel cannot be null'); - } - $this->container['channel'] = $channel; return $this; @@ -584,18 +468,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -620,6 +504,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -632,6 +528,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/StatisticsReport.php b/lib/Model/StatisticsReport.php index 53309e5..3e7d658 100644 --- a/lib/Model/StatisticsReport.php +++ b/lib/Model/StatisticsReport.php @@ -2,7 +2,7 @@ /** * StatisticsReport * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class StatisticsReport implements ModelInterface, ArrayAccess +class StatisticsReport implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -67,6 +70,8 @@ class StatisticsReport implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'totalMessages' => null, @@ -74,24 +79,6 @@ class StatisticsReport implements ModelInterface, ArrayAccess 'country' => null ]; - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static $openAPINullables = [ - 'totalMessages' => false, - 'totalPrice' => false, - 'country' => 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 * @@ -112,60 +99,6 @@ 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 @@ -241,9 +174,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -260,20 +190,9 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('totalMessages', $data, null); - $this->setIfExists('totalPrice', $data, null); - $this->setIfExists('country', $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; + $this->container['totalMessages'] = $data['totalMessages'] ?? null; + $this->container['totalPrice'] = $data['totalPrice'] ?? null; + $this->container['country'] = $data['country'] ?? null; } /** @@ -324,16 +243,10 @@ public function getTotalMessages() * * @param int $totalMessages Sum of all messages * - * @return $this + * @return self */ public function setTotalMessages($totalMessages) { - - - if (is_null($totalMessages)) { - throw new \InvalidArgumentException('non-nullable totalMessages cannot be null'); - } - $this->container['totalMessages'] = $totalMessages; return $this; @@ -354,16 +267,10 @@ public function getTotalPrice() * * @param string $totalPrice Price for all messages * - * @return $this + * @return self */ public function setTotalPrice($totalPrice) { - - - if (is_null($totalPrice)) { - throw new \InvalidArgumentException('non-nullable totalPrice cannot be null'); - } - $this->container['totalPrice'] = $totalPrice; return $this; @@ -384,16 +291,10 @@ public function getCountry() * * @param string $country Target country of all messages * - * @return $this + * @return self */ public function setCountry($country) { - - - if (is_null($country)) { - throw new \InvalidArgumentException('non-nullable country cannot be null'); - } - $this->container['country'] = $country; return $this; @@ -415,18 +316,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -451,6 +352,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -463,6 +376,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/StatisticsReportSettings.php b/lib/Model/StatisticsReportSettings.php index 6ea852e..74991c1 100644 --- a/lib/Model/StatisticsReportSettings.php +++ b/lib/Model/StatisticsReportSettings.php @@ -2,7 +2,7 @@ /** * StatisticsReportSettings * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class StatisticsReportSettings implements ModelInterface, ArrayAccess +class StatisticsReportSettings implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -67,6 +70,8 @@ class StatisticsReportSettings implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'startDate' => 'date', @@ -74,24 +79,6 @@ class StatisticsReportSettings implements ModelInterface, ArrayAccess 'messageTypes' => null ]; - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static $openAPINullables = [ - 'startDate' => false, - 'endDate' => false, - 'messageTypes' => 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 * @@ -112,60 +99,6 @@ 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 @@ -241,9 +174,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -260,20 +190,9 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('startDate', $data, null); - $this->setIfExists('endDate', $data, null); - $this->setIfExists('messageTypes', $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; + $this->container['startDate'] = $data['startDate'] ?? null; + $this->container['endDate'] = $data['endDate'] ?? null; + $this->container['messageTypes'] = $data['messageTypes'] ?? null; } /** @@ -321,16 +240,10 @@ public function getStartDate() * * @param \DateTime $startDate Start date for the report * - * @return $this + * @return self */ public function setStartDate($startDate) { - - - if (is_null($startDate)) { - throw new \InvalidArgumentException('non-nullable startDate cannot be null'); - } - $this->container['startDate'] = $startDate; return $this; @@ -351,16 +264,10 @@ public function getEndDate() * * @param \DateTime $endDate End date for the report * - * @return $this + * @return self */ public function setEndDate($endDate) { - - - if (is_null($endDate)) { - throw new \InvalidArgumentException('non-nullable endDate cannot be null'); - } - $this->container['endDate'] = $endDate; return $this; @@ -381,16 +288,10 @@ public function getMessageTypes() * * @param string[]|null $messageTypes Optional list of message types (sms, viber, whatsapp, hlr, telegram) * - * @return $this + * @return self */ public function setMessageTypes($messageTypes) { - - - if (is_null($messageTypes)) { - throw new \InvalidArgumentException('non-nullable messageTypes cannot be null'); - } - $this->container['messageTypes'] = $messageTypes; return $this; @@ -412,18 +313,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -448,6 +349,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -460,6 +373,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/StatisticsReportSuccess.php b/lib/Model/StatisticsReportSuccess.php index ebbd74f..0178992 100644 --- a/lib/Model/StatisticsReportSuccess.php +++ b/lib/Model/StatisticsReportSuccess.php @@ -2,7 +2,7 @@ /** * StatisticsReportSuccess * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class StatisticsReportSuccess implements ModelInterface, ArrayAccess +class StatisticsReportSuccess implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -65,27 +68,13 @@ class StatisticsReportSuccess implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'reports' => null ]; - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static $openAPINullables = [ - 'reports' => 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 * @@ -106,60 +95,6 @@ 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 @@ -229,9 +164,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -248,18 +180,7 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('reports', $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; + $this->container['reports'] = $data['reports'] ?? null; } /** @@ -304,16 +225,10 @@ public function getReports() * * @param \Messente\Api\Model\StatisticsReport[] $reports Array of report objects * - * @return $this + * @return self */ public function setReports($reports) { - - - if (is_null($reports)) { - throw new \InvalidArgumentException('non-nullable reports cannot be null'); - } - $this->container['reports'] = $reports; return $this; @@ -335,18 +250,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -371,6 +286,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -383,6 +310,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/Status.php b/lib/Model/Status.php index 854c153..dcfbfeb 100644 --- a/lib/Model/Status.php +++ b/lib/Model/Status.php @@ -2,7 +2,7 @@ /** * Status * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -45,17 +45,27 @@ class Status * Possible values of this enum */ const ACK = 'ACK'; + const DELIVRD = 'DELIVRD'; + const UNDELIV = 'UNDELIV'; + const FAILED = 'FAILED'; + const UNKNOWN = 'UNKNOWN'; + const ACCEPTD = 'ACCEPTD'; + const REJECTD = 'REJECTD'; + const DELETED = 'DELETED'; + const EXPIRED = 'EXPIRED'; + const NACK = 'NACK'; + const SEEN = 'SEEN'; - + /** * Gets allowable values of the enum * @return string[] @@ -73,7 +83,7 @@ public static function getAllowableEnumValues() self::DELETED, self::EXPIRED, self::NACK, - self::SEEN, + self::SEEN ]; } } diff --git a/lib/Model/SyncNumberLookupResult.php b/lib/Model/SyncNumberLookupResult.php index 9d04da1..15f25c9 100644 --- a/lib/Model/SyncNumberLookupResult.php +++ b/lib/Model/SyncNumberLookupResult.php @@ -2,7 +2,7 @@ /** * SyncNumberLookupResult * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class SyncNumberLookupResult implements ModelInterface, ArrayAccess +class SyncNumberLookupResult implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -66,13 +69,15 @@ class SyncNumberLookupResult implements ModelInterface, ArrayAccess 'originalNetwork' => '\Messente\Api\Model\MobileNetwork', 'portedNetwork' => '\Messente\Api\Model\MobileNetwork', 'status' => 'string', - 'error' => 'object' + 'error' => 'mixed' ]; /** * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'number' => null, @@ -86,30 +91,6 @@ class SyncNumberLookupResult implements ModelInterface, ArrayAccess 'error' => null ]; - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static $openAPINullables = [ - 'number' => false, - 'roaming' => true, - 'ported' => true, - 'roamingNetwork' => true, - 'currentNetwork' => true, - 'originalNetwork' => true, - 'portedNetwork' => true, - 'status' => false, - 'error' => 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 * @@ -130,60 +111,6 @@ 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 @@ -281,9 +208,7 @@ public function getModelName() const STATUS_OFF = 'OFF'; const STATUS_INVALID = 'INVALID'; const STATUS_UNKNOWN = 'UNKNOWN'; - - /** * Gets allowable values of the enum * @@ -298,7 +223,6 @@ public function getStatusAllowableValues() self::STATUS_UNKNOWN, ]; } - /** * Associative array for storing property values @@ -315,26 +239,15 @@ public function getStatusAllowableValues() */ public function __construct(array $data = null) { - $this->setIfExists('number', $data, null); - $this->setIfExists('roaming', $data, null); - $this->setIfExists('ported', $data, null); - $this->setIfExists('roamingNetwork', $data, null); - $this->setIfExists('currentNetwork', $data, null); - $this->setIfExists('originalNetwork', $data, null); - $this->setIfExists('portedNetwork', $data, null); - $this->setIfExists('status', $data, null); - $this->setIfExists('error', $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; + $this->container['number'] = $data['number'] ?? null; + $this->container['roaming'] = $data['roaming'] ?? null; + $this->container['ported'] = $data['ported'] ?? null; + $this->container['roamingNetwork'] = $data['roamingNetwork'] ?? null; + $this->container['currentNetwork'] = $data['currentNetwork'] ?? null; + $this->container['originalNetwork'] = $data['originalNetwork'] ?? null; + $this->container['portedNetwork'] = $data['portedNetwork'] ?? null; + $this->container['status'] = $data['status'] ?? null; + $this->container['error'] = $data['error'] ?? null; } /** @@ -352,7 +265,8 @@ public function listInvalidProperties() $allowedValues = $this->getStatusAllowableValues(); if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'status', must be one of '%s'", + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], implode("', '", $allowedValues) ); } @@ -387,16 +301,10 @@ public function getNumber() * * @param string $number Phone number in e.164 format * - * @return $this + * @return self */ public function setNumber($number) { - - - if (is_null($number)) { - throw new \InvalidArgumentException('non-nullable number cannot be null'); - } - $this->container['number'] = $number; return $this; @@ -417,23 +325,10 @@ public function getRoaming() * * @param bool|null $roaming Indicates if a number is roaming * - * @return $this + * @return self */ public function setRoaming($roaming) { - - if (is_null($roaming)) { - array_push($this->openAPINullablesSetToNull, 'roaming'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('roaming', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - - $this->container['roaming'] = $roaming; return $this; @@ -454,23 +349,10 @@ public function getPorted() * * @param bool|null $ported Indicates if a number is ported * - * @return $this + * @return self */ public function setPorted($ported) { - - if (is_null($ported)) { - array_push($this->openAPINullablesSetToNull, 'ported'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('ported', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - - $this->container['ported'] = $ported; return $this; @@ -491,23 +373,10 @@ public function getRoamingNetwork() * * @param \Messente\Api\Model\MobileNetwork|null $roamingNetwork roamingNetwork * - * @return $this + * @return self */ public function setRoamingNetwork($roamingNetwork) { - - if (is_null($roamingNetwork)) { - array_push($this->openAPINullablesSetToNull, 'roamingNetwork'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('roamingNetwork', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - - $this->container['roamingNetwork'] = $roamingNetwork; return $this; @@ -528,23 +397,10 @@ public function getCurrentNetwork() * * @param \Messente\Api\Model\MobileNetwork|null $currentNetwork currentNetwork * - * @return $this + * @return self */ public function setCurrentNetwork($currentNetwork) { - - if (is_null($currentNetwork)) { - array_push($this->openAPINullablesSetToNull, 'currentNetwork'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('currentNetwork', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - - $this->container['currentNetwork'] = $currentNetwork; return $this; @@ -565,23 +421,10 @@ public function getOriginalNetwork() * * @param \Messente\Api\Model\MobileNetwork|null $originalNetwork originalNetwork * - * @return $this + * @return self */ public function setOriginalNetwork($originalNetwork) { - - if (is_null($originalNetwork)) { - array_push($this->openAPINullablesSetToNull, 'originalNetwork'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('originalNetwork', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - - $this->container['originalNetwork'] = $originalNetwork; return $this; @@ -602,23 +445,10 @@ public function getPortedNetwork() * * @param \Messente\Api\Model\MobileNetwork|null $portedNetwork portedNetwork * - * @return $this + * @return self */ public function setPortedNetwork($portedNetwork) { - - if (is_null($portedNetwork)) { - array_push($this->openAPINullablesSetToNull, 'portedNetwork'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('portedNetwork', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - - $this->container['portedNetwork'] = $portedNetwork; return $this; @@ -639,7 +469,7 @@ public function getStatus() * * @param string|null $status Status of the phone number * - * @return $this + * @return self */ public function setStatus($status) { @@ -647,17 +477,12 @@ public function setStatus($status) if (!is_null($status) && !in_array($status, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'status', must be one of '%s'", + "Invalid value '%s' for 'status', must be one of '%s'", + $status, implode("', '", $allowedValues) ) ); } - - - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; return $this; @@ -666,7 +491,7 @@ public function setStatus($status) /** * Gets error * - * @return object|null + * @return mixed|null */ public function getError() { @@ -676,18 +501,12 @@ public function getError() /** * Sets error * - * @param object|null $error Indicates if any error occurred while handling the request + * @param mixed|null $error Indicates if any error occurred while handling the request * - * @return $this + * @return self */ public function setError($error) { - - - if (is_null($error)) { - throw new \InvalidArgumentException('non-nullable error cannot be null'); - } - $this->container['error'] = $error; return $this; @@ -709,18 +528,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -745,6 +564,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -757,6 +588,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/SyncNumberLookupSuccess.php b/lib/Model/SyncNumberLookupSuccess.php index f6b90bc..c00b889 100644 --- a/lib/Model/SyncNumberLookupSuccess.php +++ b/lib/Model/SyncNumberLookupSuccess.php @@ -2,7 +2,7 @@ /** * SyncNumberLookupSuccess * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class SyncNumberLookupSuccess implements ModelInterface, ArrayAccess +class SyncNumberLookupSuccess implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -66,29 +69,14 @@ class SyncNumberLookupSuccess implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'requestId' => null, 'result' => null ]; - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static $openAPINullables = [ - 'requestId' => false, - 'result' => 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 * @@ -109,60 +97,6 @@ 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 @@ -235,9 +169,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -254,19 +185,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('requestId', $data, null); - $this->setIfExists('result', $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; + $this->container['requestId'] = $data['requestId'] ?? null; + $this->container['result'] = $data['result'] ?? null; } /** @@ -314,16 +234,10 @@ public function getRequestId() * * @param string $requestId ID of the request * - * @return $this + * @return self */ public function setRequestId($requestId) { - - - if (is_null($requestId)) { - throw new \InvalidArgumentException('non-nullable requestId cannot be null'); - } - $this->container['requestId'] = $requestId; return $this; @@ -344,16 +258,10 @@ public function getResult() * * @param \Messente\Api\Model\SyncNumberLookupResult[] $result A container for phone number info objects * - * @return $this + * @return self */ public function setResult($result) { - - - if (is_null($result)) { - throw new \InvalidArgumentException('non-nullable result cannot be null'); - } - $this->container['result'] = $result; return $this; @@ -375,18 +283,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -411,6 +319,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -423,6 +343,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/Telegram.php b/lib/Model/Telegram.php index 47fee59..f033906 100644 --- a/lib/Model/Telegram.php +++ b/lib/Model/Telegram.php @@ -2,7 +2,7 @@ /** * Telegram * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class Telegram implements ModelInterface, ArrayAccess +class Telegram implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -71,6 +74,8 @@ class Telegram implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'sender' => null, @@ -82,28 +87,6 @@ class Telegram 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, - 'documentUrl' => false, - 'audioUrl' => 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 * @@ -124,60 +107,6 @@ 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 @@ -266,9 +195,7 @@ public function getModelName() } const CHANNEL_TELEGRAM = 'telegram'; - - /** * Gets allowable values of the enum * @@ -280,7 +207,6 @@ public function getChannelAllowableValues() self::CHANNEL_TELEGRAM, ]; } - /** * Associative array for storing property values @@ -297,24 +223,13 @@ public function getChannelAllowableValues() */ public function __construct(array $data = null) { - $this->setIfExists('sender', $data, null); - $this->setIfExists('validity', $data, null); - $this->setIfExists('text', $data, null); - $this->setIfExists('imageUrl', $data, null); - $this->setIfExists('documentUrl', $data, null); - $this->setIfExists('audioUrl', $data, null); - $this->setIfExists('channel', $data, 'telegram'); - } - - 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; + $this->container['sender'] = $data['sender'] ?? null; + $this->container['validity'] = $data['validity'] ?? null; + $this->container['text'] = $data['text'] ?? null; + $this->container['imageUrl'] = $data['imageUrl'] ?? null; + $this->container['documentUrl'] = $data['documentUrl'] ?? null; + $this->container['audioUrl'] = $data['audioUrl'] ?? null; + $this->container['channel'] = $data['channel'] ?? 'telegram'; } /** @@ -329,7 +244,8 @@ public function listInvalidProperties() $allowedValues = $this->getChannelAllowableValues(); if (!is_null($this->container['channel']) && !in_array($this->container['channel'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'channel', must be one of '%s'", + "invalid value '%s' for 'channel', must be one of '%s'", + $this->container['channel'], implode("', '", $allowedValues) ); } @@ -364,16 +280,10 @@ public function getSender() * * @param string|null $sender Phone number or alphanumeric sender name * - * @return $this + * @return self */ public function setSender($sender) { - - - if (is_null($sender)) { - throw new \InvalidArgumentException('non-nullable sender cannot be null'); - } - $this->container['sender'] = $sender; return $this; @@ -394,16 +304,10 @@ public function getValidity() * * @param int|null $validity After how many minutes this channel is considered as failed and the next channel is attempted * - * @return $this + * @return self */ public function setValidity($validity) { - - - if (is_null($validity)) { - throw new \InvalidArgumentException('non-nullable validity cannot be null'); - } - $this->container['validity'] = $validity; return $this; @@ -424,16 +328,10 @@ public function getText() * * @param string|null $text Plaintext content for Telegram * - * @return $this + * @return self */ public function setText($text) { - - - if (is_null($text)) { - throw new \InvalidArgumentException('non-nullable text cannot be null'); - } - $this->container['text'] = $text; return $this; @@ -454,16 +352,10 @@ public function getImageUrl() * * @param string|null $imageUrl URL for the embedded image. Mutually exclusive with \"document_url\" and \"audio_url\" * - * @return $this + * @return self */ public function setImageUrl($imageUrl) { - - - if (is_null($imageUrl)) { - throw new \InvalidArgumentException('non-nullable imageUrl cannot be null'); - } - $this->container['imageUrl'] = $imageUrl; return $this; @@ -484,16 +376,10 @@ public function getDocumentUrl() * * @param string|null $documentUrl URL for the embedded image. Mutually exclusive with \"audio_url\" and \"image_url\" * - * @return $this + * @return self */ public function setDocumentUrl($documentUrl) { - - - if (is_null($documentUrl)) { - throw new \InvalidArgumentException('non-nullable documentUrl cannot be null'); - } - $this->container['documentUrl'] = $documentUrl; return $this; @@ -514,16 +400,10 @@ public function getAudioUrl() * * @param string|null $audioUrl URL for the embedded image. Mutually exclusive with \"document_url\" and \"image_url\" * - * @return $this + * @return self */ public function setAudioUrl($audioUrl) { - - - if (is_null($audioUrl)) { - throw new \InvalidArgumentException('non-nullable audioUrl cannot be null'); - } - $this->container['audioUrl'] = $audioUrl; return $this; @@ -544,7 +424,7 @@ public function getChannel() * * @param string|null $channel The channel used to deliver the message * - * @return $this + * @return self */ public function setChannel($channel) { @@ -552,17 +432,12 @@ public function setChannel($channel) if (!is_null($channel) && !in_array($channel, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'channel', must be one of '%s'", + "Invalid value '%s' for 'channel', must be one of '%s'", + $channel, implode("', '", $allowedValues) ) ); } - - - if (is_null($channel)) { - throw new \InvalidArgumentException('non-nullable channel cannot be null'); - } - $this->container['channel'] = $channel; return $this; @@ -584,18 +459,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -620,6 +495,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -632,6 +519,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/TextStore.php b/lib/Model/TextStore.php index dfd65c8..e06dd53 100644 --- a/lib/Model/TextStore.php +++ b/lib/Model/TextStore.php @@ -2,7 +2,7 @@ /** * TextStore * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -45,9 +45,11 @@ class TextStore * Possible values of this enum */ const NOSTORE = 'nostore'; + const PLAINTEXT = 'plaintext'; + const SHA256 = 'sha256'; - + /** * Gets allowable values of the enum * @return string[] @@ -57,7 +59,7 @@ public static function getAllowableEnumValues() return [ self::NOSTORE, self::PLAINTEXT, - self::SHA256, + self::SHA256 ]; } } diff --git a/lib/Model/Viber.php b/lib/Model/Viber.php index d61af74..e4ac2d9 100644 --- a/lib/Model/Viber.php +++ b/lib/Model/Viber.php @@ -2,7 +2,7 @@ /** * Viber * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class Viber implements ModelInterface, ArrayAccess +class Viber implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -71,6 +74,8 @@ class Viber implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'sender' => null, @@ -82,28 +87,6 @@ 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 * @@ -124,60 +107,6 @@ 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 @@ -266,9 +195,7 @@ public function getModelName() } const CHANNEL_VIBER = 'viber'; - - /** * Gets allowable values of the enum * @@ -280,7 +207,6 @@ public function getChannelAllowableValues() self::CHANNEL_VIBER, ]; } - /** * Associative array for storing property values @@ -297,24 +223,13 @@ public function getChannelAllowableValues() */ public function __construct(array $data = null) { - $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; + $this->container['sender'] = $data['sender'] ?? null; + $this->container['validity'] = $data['validity'] ?? null; + $this->container['text'] = $data['text'] ?? null; + $this->container['imageUrl'] = $data['imageUrl'] ?? null; + $this->container['buttonUrl'] = $data['buttonUrl'] ?? null; + $this->container['buttonText'] = $data['buttonText'] ?? null; + $this->container['channel'] = $data['channel'] ?? 'viber'; } /** @@ -329,7 +244,8 @@ public function listInvalidProperties() $allowedValues = $this->getChannelAllowableValues(); if (!is_null($this->container['channel']) && !in_array($this->container['channel'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'channel', must be one of '%s'", + "invalid value '%s' for 'channel', must be one of '%s'", + $this->container['channel'], implode("', '", $allowedValues) ); } @@ -364,16 +280,10 @@ public function getSender() * * @param string|null $sender Phone number or alphanumeric sender name * - * @return $this + * @return self */ public function setSender($sender) { - - - if (is_null($sender)) { - throw new \InvalidArgumentException('non-nullable sender cannot be null'); - } - $this->container['sender'] = $sender; return $this; @@ -394,16 +304,10 @@ public function getValidity() * * @param int|null $validity After how many minutes this channel is considered as failed and the next channel is attempted * - * @return $this + * @return self */ public function setValidity($validity) { - - - if (is_null($validity)) { - throw new \InvalidArgumentException('non-nullable validity cannot be null'); - } - $this->container['validity'] = $validity; return $this; @@ -424,16 +328,10 @@ public function getText() * * @param string|null $text Plaintext content for Viber * - * @return $this + * @return self */ public function setText($text) { - - - if (is_null($text)) { - throw new \InvalidArgumentException('non-nullable text cannot be null'); - } - $this->container['text'] = $text; return $this; @@ -454,16 +352,10 @@ public function getImageUrl() * * @param string|null $imageUrl URL for the embedded image Valid combinations: 1) image_url, 2) text, image_url, button_url, button_text * - * @return $this + * @return self */ public function setImageUrl($imageUrl) { - - - if (is_null($imageUrl)) { - throw new \InvalidArgumentException('non-nullable imageUrl cannot be null'); - } - $this->container['imageUrl'] = $imageUrl; return $this; @@ -484,16 +376,10 @@ public function getButtonUrl() * * @param string|null $buttonUrl URL of the button, must be specified along with ''text'', ''button_text'' and ''image_url'' (optional) * - * @return $this + * @return self */ public function setButtonUrl($buttonUrl) { - - - if (is_null($buttonUrl)) { - throw new \InvalidArgumentException('non-nullable buttonUrl cannot be null'); - } - $this->container['buttonUrl'] = $buttonUrl; return $this; @@ -514,16 +400,10 @@ public function getButtonText() * * @param string|null $buttonText Must be specified along with ''text'', ''button_url'', ''button_text'', ''image_url'' (optional) * - * @return $this + * @return self */ public function setButtonText($buttonText) { - - - if (is_null($buttonText)) { - throw new \InvalidArgumentException('non-nullable buttonText cannot be null'); - } - $this->container['buttonText'] = $buttonText; return $this; @@ -544,7 +424,7 @@ public function getChannel() * * @param string|null $channel The channel used to deliver the message * - * @return $this + * @return self */ public function setChannel($channel) { @@ -552,17 +432,12 @@ public function setChannel($channel) if (!is_null($channel) && !in_array($channel, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'channel', must be one of '%s'", + "Invalid value '%s' for 'channel', must be one of '%s'", + $channel, implode("', '", $allowedValues) ) ); } - - - if (is_null($channel)) { - throw new \InvalidArgumentException('non-nullable channel cannot be null'); - } - $this->container['channel'] = $channel; return $this; @@ -584,18 +459,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -620,6 +495,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -632,6 +519,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/WhatsApp.php b/lib/Model/WhatsApp.php index 35a2745..aa14c56 100644 --- a/lib/Model/WhatsApp.php +++ b/lib/Model/WhatsApp.php @@ -2,7 +2,7 @@ /** * WhatsApp * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class WhatsApp implements ModelInterface, ArrayAccess +class WhatsApp implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -71,6 +74,8 @@ class WhatsApp implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'sender' => null, @@ -82,28 +87,6 @@ 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 * @@ -124,60 +107,6 @@ 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 @@ -266,9 +195,7 @@ public function getModelName() } const CHANNEL_WHATSAPP = 'whatsapp'; - - /** * Gets allowable values of the enum * @@ -280,7 +207,6 @@ public function getChannelAllowableValues() self::CHANNEL_WHATSAPP, ]; } - /** * Associative array for storing property values @@ -297,24 +223,13 @@ public function getChannelAllowableValues() */ public function __construct(array $data = null) { - $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; + $this->container['sender'] = $data['sender'] ?? null; + $this->container['validity'] = $data['validity'] ?? null; + $this->container['text'] = $data['text'] ?? null; + $this->container['image'] = $data['image'] ?? null; + $this->container['document'] = $data['document'] ?? null; + $this->container['audio'] = $data['audio'] ?? null; + $this->container['channel'] = $data['channel'] ?? 'whatsapp'; } /** @@ -329,7 +244,8 @@ public function listInvalidProperties() $allowedValues = $this->getChannelAllowableValues(); if (!is_null($this->container['channel']) && !in_array($this->container['channel'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'channel', must be one of '%s'", + "invalid value '%s' for 'channel', must be one of '%s'", + $this->container['channel'], implode("', '", $allowedValues) ); } @@ -364,16 +280,10 @@ public function getSender() * * @param string|null $sender Phone number or alphanumeric sender name * - * @return $this + * @return self */ public function setSender($sender) { - - - if (is_null($sender)) { - throw new \InvalidArgumentException('non-nullable sender cannot be null'); - } - $this->container['sender'] = $sender; return $this; @@ -394,16 +304,10 @@ public function getValidity() * * @param int|null $validity After how many minutes this channel is considered as failed and the next channel is attempted * - * @return $this + * @return self */ public function setValidity($validity) { - - - if (is_null($validity)) { - throw new \InvalidArgumentException('non-nullable validity cannot be null'); - } - $this->container['validity'] = $validity; return $this; @@ -424,16 +328,10 @@ public function getText() * * @param \Messente\Api\Model\WhatsAppText|null $text text * - * @return $this + * @return self */ public function setText($text) { - - - if (is_null($text)) { - throw new \InvalidArgumentException('non-nullable text cannot be null'); - } - $this->container['text'] = $text; return $this; @@ -454,16 +352,10 @@ public function getImage() * * @param \Messente\Api\Model\WhatsAppImage|null $image image * - * @return $this + * @return self */ public function setImage($image) { - - - if (is_null($image)) { - throw new \InvalidArgumentException('non-nullable image cannot be null'); - } - $this->container['image'] = $image; return $this; @@ -484,16 +376,10 @@ public function getDocument() * * @param \Messente\Api\Model\WhatsAppDocument|null $document document * - * @return $this + * @return self */ public function setDocument($document) { - - - if (is_null($document)) { - throw new \InvalidArgumentException('non-nullable document cannot be null'); - } - $this->container['document'] = $document; return $this; @@ -514,16 +400,10 @@ public function getAudio() * * @param \Messente\Api\Model\WhatsAppAudio|null $audio audio * - * @return $this + * @return self */ public function setAudio($audio) { - - - if (is_null($audio)) { - throw new \InvalidArgumentException('non-nullable audio cannot be null'); - } - $this->container['audio'] = $audio; return $this; @@ -544,7 +424,7 @@ public function getChannel() * * @param string|null $channel The channel used to deliver the message * - * @return $this + * @return self */ public function setChannel($channel) { @@ -552,17 +432,12 @@ public function setChannel($channel) if (!is_null($channel) && !in_array($channel, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'channel', must be one of '%s'", + "Invalid value '%s' for 'channel', must be one of '%s'", + $channel, implode("', '", $allowedValues) ) ); } - - - if (is_null($channel)) { - throw new \InvalidArgumentException('non-nullable channel cannot be null'); - } - $this->container['channel'] = $channel; return $this; @@ -584,18 +459,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -620,6 +495,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -632,6 +519,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/WhatsAppAudio.php b/lib/Model/WhatsAppAudio.php index c10aa8d..eb67bc9 100644 --- a/lib/Model/WhatsAppAudio.php +++ b/lib/Model/WhatsAppAudio.php @@ -2,7 +2,7 @@ /** * WhatsAppAudio * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class WhatsAppAudio implements ModelInterface, ArrayAccess +class WhatsAppAudio implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -65,27 +68,13 @@ class WhatsAppAudio implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ '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 * @@ -106,60 +95,6 @@ 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 @@ -229,9 +164,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -248,18 +180,7 @@ public function getModelName() */ public function __construct(array $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; + $this->container['content'] = $data['content'] ?? null; } /** @@ -304,16 +225,10 @@ public function getContent() * * @param string $content Base64-encoded audio * - * @return $this + * @return self */ public function setContent($content) { - - - if (is_null($content)) { - throw new \InvalidArgumentException('non-nullable content cannot be null'); - } - $this->container['content'] = $content; return $this; @@ -335,18 +250,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -371,6 +286,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -383,6 +310,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/WhatsAppDocument.php b/lib/Model/WhatsAppDocument.php index 13f8279..fe15f48 100644 --- a/lib/Model/WhatsAppDocument.php +++ b/lib/Model/WhatsAppDocument.php @@ -2,7 +2,7 @@ /** * WhatsAppDocument * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class WhatsAppDocument implements ModelInterface, ArrayAccess +class WhatsAppDocument implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -66,29 +69,14 @@ class WhatsAppDocument implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'caption' => null, '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 * @@ -109,60 +97,6 @@ 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 @@ -235,9 +169,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -254,19 +185,8 @@ public function getModelName() */ public function __construct(array $data = 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; + $this->container['caption'] = $data['caption'] ?? null; + $this->container['content'] = $data['content'] ?? null; } /** @@ -311,16 +231,10 @@ public function getCaption() * * @param string|null $caption Description for the document * - * @return $this + * @return self */ public function setCaption($caption) { - - - if (is_null($caption)) { - throw new \InvalidArgumentException('non-nullable caption cannot be null'); - } - $this->container['caption'] = $caption; return $this; @@ -341,16 +255,10 @@ public function getContent() * * @param string $content Base64-encoded image * - * @return $this + * @return self */ public function setContent($content) { - - - if (is_null($content)) { - throw new \InvalidArgumentException('non-nullable content cannot be null'); - } - $this->container['content'] = $content; return $this; @@ -372,18 +280,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -408,6 +316,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -420,6 +340,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/WhatsAppImage.php b/lib/Model/WhatsAppImage.php index 8a2f952..3e6545b 100644 --- a/lib/Model/WhatsAppImage.php +++ b/lib/Model/WhatsAppImage.php @@ -2,7 +2,7 @@ /** * WhatsAppImage * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class WhatsAppImage implements ModelInterface, ArrayAccess +class WhatsAppImage implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -66,29 +69,14 @@ class WhatsAppImage implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'caption' => null, '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 * @@ -109,60 +97,6 @@ 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 @@ -235,9 +169,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -254,19 +185,8 @@ public function getModelName() */ public function __construct(array $data = 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; + $this->container['caption'] = $data['caption'] ?? null; + $this->container['content'] = $data['content'] ?? null; } /** @@ -311,16 +231,10 @@ public function getCaption() * * @param string|null $caption Description for the image * - * @return $this + * @return self */ public function setCaption($caption) { - - - if (is_null($caption)) { - throw new \InvalidArgumentException('non-nullable caption cannot be null'); - } - $this->container['caption'] = $caption; return $this; @@ -341,16 +255,10 @@ public function getContent() * * @param string $content Base64-encoded image * - * @return $this + * @return self */ public function setContent($content) { - - - if (is_null($content)) { - throw new \InvalidArgumentException('non-nullable content cannot be null'); - } - $this->container['content'] = $content; return $this; @@ -372,18 +280,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -408,6 +316,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -420,6 +340,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/WhatsAppText.php b/lib/Model/WhatsAppText.php index 6b40520..c3f257b 100644 --- a/lib/Model/WhatsAppText.php +++ b/lib/Model/WhatsAppText.php @@ -2,7 +2,7 @@ /** * WhatsAppText * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -40,10 +40,13 @@ * @package Messente\Api * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class WhatsAppText implements ModelInterface, ArrayAccess +class WhatsAppText implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -66,29 +69,14 @@ class WhatsAppText implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'previewUrl' => null, '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 * @@ -109,60 +97,6 @@ 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 @@ -235,9 +169,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -254,19 +185,8 @@ public function getModelName() */ public function __construct(array $data = 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; + $this->container['previewUrl'] = $data['previewUrl'] ?? true; + $this->container['body'] = $data['body'] ?? null; } /** @@ -311,16 +231,10 @@ public function getPreviewUrl() * * @param bool|null $previewUrl Whether to display link preview if the message contains a hyperlink * - * @return $this + * @return self */ public function setPreviewUrl($previewUrl) { - - - if (is_null($previewUrl)) { - throw new \InvalidArgumentException('non-nullable previewUrl cannot be null'); - } - $this->container['previewUrl'] = $previewUrl; return $this; @@ -341,16 +255,10 @@ public function getBody() * * @param string $body Plaintext content for WhatsApp, can contain URLs, emojis and formatting * - * @return $this + * @return self */ public function setBody($body) { - - - if (is_null($body)) { - throw new \InvalidArgumentException('non-nullable body cannot be null'); - } - $this->container['body'] = $body; return $this; @@ -372,18 +280,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -408,6 +316,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -420,6 +340,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/ObjectSerializer.php b/lib/ObjectSerializer.php index 1a17780..2a1510f 100644 --- a/lib/ObjectSerializer.php +++ b/lib/ObjectSerializer.php @@ -2,7 +2,7 @@ /** * ObjectSerializer * - * PHP version 5 + * PHP version 7.3 * * @category Class * @package Messente\Api @@ -15,10 +15,10 @@ * * [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 2.0.0 * Contact: messente@messente.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.0.3 + * OpenAPI Generator version: 5.3.0 */ /** @@ -41,6 +41,19 @@ */ class ObjectSerializer { + /** @var string */ + private static $dateTimeFormat = \DateTime::ATOM; + + /** + * Change the date format + * + * @param string $format the new date format to use + */ + public static function setDateTimeFormat($format) + { + self::$dateTimeFormat = $format; + } + /** * Serialize data * @@ -48,34 +61,44 @@ class ObjectSerializer * @param string $type the OpenAPIToolsType of the data * @param string $format the format of the OpenAPITools type of the data * - * @return string|object serialized form of $data + * @return scalar|object|array|null serialized form of $data */ public static function sanitizeForSerialization($data, $type = null, $format = null) { if (is_scalar($data) || null === $data) { return $data; - } elseif ($data instanceof \DateTime) { - return ($format === 'date') ? $data->format('Y-m-d') : $data->format(\DateTime::ATOM); - } elseif (is_array($data)) { + } + + if ($data instanceof \DateTime) { + return ($format === 'date') ? $data->format('Y-m-d') : $data->format(self::$dateTimeFormat); + } + + if (is_array($data)) { foreach ($data as $property => $value) { $data[$property] = self::sanitizeForSerialization($value); } return $data; - } elseif (is_object($data)) { + } + + if (is_object($data)) { $values = []; if ($data instanceof ModelInterface) { $formats = $data::openAPIFormats(); foreach ($data::openAPITypes() as $property => $openAPIType) { $getter = $data::getters()[$property]; $value = $data->$getter(); - if ($value !== null - && !in_array($openAPIType, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true) - && method_exists($openAPIType, 'getAllowableEnumValues') - && !in_array($value, $openAPIType::getAllowableEnumValues(), true)) { - $imploded = implode("', '", $openAPIType::getAllowableEnumValues()); - throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); + if ($value !== null && !in_array($openAPIType, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + $callable = [$openAPIType, 'getAllowableEnumValues']; + if (is_callable($callable)) { + /** array $callable */ + $allowedEnumTypes = $callable(); + if (!in_array($value, $allowedEnumTypes, true)) { + $imploded = implode("', '", $allowedEnumTypes); + throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); + } + } } - if ($data::isNullable($property) && $data->isNullableSetToNull($property) || $value !== null) { + if ($value !== null) { $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]); } } @@ -150,6 +173,11 @@ public static function toQueryValue($object) */ public static function toHeaderValue($value) { + $callable = [$value, 'toHeaderValue']; + if (is_callable($callable)) { + return $callable(); + } + return self::toString($value); } @@ -184,8 +212,8 @@ public static function toFormValue($value) public static function toString($value) { if ($value instanceof \DateTime) { // datetime in ISO8601 format - return $value->format(\DateTime::ATOM); - } else if (is_bool($value)) { + return $value->format(self::$dateTimeFormat); + } elseif (is_bool($value)) { return $value ? 'true' : 'false'; } else { return $value; @@ -196,29 +224,32 @@ public static function toString($value) * Serialize an array to a string. * * @param array $collection collection to serialize to a string - * @param string $collectionFormat the format use for serialization (csv, + * @param string $style the format use for serialization (csv, * ssv, tsv, pipes, multi) * @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array * * @return string */ - public static function serializeCollection(array $collection, $collectionFormat, $allowCollectionFormatMulti = false) + public static function serializeCollection(array $collection, $style, $allowCollectionFormatMulti = false) { - if ($allowCollectionFormatMulti && ('multi' === $collectionFormat)) { + if ($allowCollectionFormatMulti && ('multi' === $style)) { // http_build_query() almost does the job for us. We just // need to fix the result of multidimensional arrays. return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&')); } - switch ($collectionFormat) { + switch ($style) { + case 'pipeDelimited': case 'pipes': return implode('|', $collection); case 'tsv': return implode("\t", $collection); + case 'spaceDelimited': case 'ssv': return implode(' ', $collection); + case 'simple': case 'csv': // Deliberate fall through. CSV is default format. default: @@ -240,7 +271,24 @@ public static function deserialize($data, $class, $httpHeaders = null) { if (null === $data) { return null; - } elseif (substr($class, 0, 4) === 'map[') { // for associative array e.g. map[string,int] + } + + if (strcasecmp(substr($class, -2), '[]') === 0) { + $data = is_string($data) ? json_decode($data) : $data; + + if (!is_array($data)) { + throw new \InvalidArgumentException("Invalid array '$class'"); + } + + $subClass = substr($class, 0, -2); + $values = []; + foreach ($data as $key => $value) { + $values[] = self::deserialize($value, $subClass, null); + } + return $values; + } + + if (preg_match('/^(array<|map\[)/', $class)) { // for associative array e.g. array $data = is_string($data) ? json_decode($data) : $data; settype($data, 'array'); $inner = substr($class, 4, -1); @@ -253,18 +301,17 @@ public static function deserialize($data, $class, $httpHeaders = null) } } return $deserialized; - } elseif (strcasecmp(substr($class, -2), '[]') === 0) { - $data = is_string($data) ? json_decode($data) : $data; - $subClass = substr($class, 0, -2); - $values = []; - foreach ($data as $key => $value) { - $values[] = self::deserialize($value, $subClass, null); - } - return $values; - } elseif ($class === 'object') { + } + + if ($class === 'object') { settype($data, 'array'); return $data; - } elseif ($class === '\DateTime') { + } else if ($class === 'mixed') { + settype($data, gettype($data)); + return $data; + } + + if ($class === '\DateTime') { // Some API's return an invalid, empty string as a // date-time property. DateTime::__construct() will return // the current time for empty input which is probably not @@ -272,14 +319,27 @@ public static function deserialize($data, $class, $httpHeaders = null) // be interpreted as a missing field/value. Let's handle // this graceful. if (!empty($data)) { - return new \DateTime($data); + try { + return new \DateTime($data); + } catch (\Exception $exception) { + // Some API's return a date-time with too high nanosecond + // precision for php's DateTime to handle. This conversion + // (string -> unix timestamp -> DateTime) is a workaround + // for the problem. + return (new \DateTime())->setTimestamp(strtotime($data)); + } } else { return null; } - } elseif (in_array($class, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + } + + /** @psalm-suppress ParadoxicalCondition */ + if (in_array($class, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { settype($data, $class); return $data; - } elseif ($class === '\SplFileObject') { + } + + if ($class === '\SplFileObject') { /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name @@ -313,21 +373,18 @@ public static function deserialize($data, $class, $httpHeaders = null) $class = $subclass; } } + + /** @var ModelInterface $instance */ $instance = new $class(); foreach ($instance::openAPITypes() as $property => $type) { $propertySetter = $instance::setters()[$property]; - if (!isset($propertySetter)) { - continue; - } - - if (!isset($data->{$instance::attributeMap()[$property]})) { - $instance->$propertySetter(null); + if (!isset($propertySetter) || !isset($data->{$instance::attributeMap()[$property]})) { continue; } - $propertyValue = $data->{$instance::attributeMap()[$property]}; - if (isset($propertyValue)) { + if (isset($data->{$instance::attributeMap()[$property]})) { + $propertyValue = $data->{$instance::attributeMap()[$property]}; $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); } } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 3dd90bb..485899a 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,23 +1,18 @@ - - - - ./test/Api - ./test/Model - - - - - ./lib/Api - ./lib/Model - - - - - + + + + ./lib/Api + ./lib/Model + + + + + ./test/Api + ./test/Model + + + + + diff --git a/test/Api/BlacklistApiTest.php b/test/Api/BlacklistApiTest.php new file mode 100644 index 0000000..4a9cd00 --- /dev/null +++ b/test/Api/BlacklistApiTest.php @@ -0,0 +1,122 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for deleteFromBlacklist + * + * Deletes a phone number from the blacklist. + * + */ + public function testDeleteFromBlacklist() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for fetchBlacklist + * + * Returns all blacklisted phone numbers. + * + */ + public function testFetchBlacklist() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for isBlacklisted + * + * Checks if a phone number is blacklisted. + * + */ + public function testIsBlacklisted() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/ContactsApiTest.php b/test/Api/ContactsApiTest.php new file mode 100644 index 0000000..7cbcd7e --- /dev/null +++ b/test/Api/ContactsApiTest.php @@ -0,0 +1,170 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for createContact + * + * Creates a new contact. + * + */ + public function testCreateContact() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for deleteContact + * + * Deletes a contact. + * + */ + public function testDeleteContact() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for fetchContact + * + * Lists a contact. + * + */ + public function testFetchContact() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for fetchContactGroups + * + * Lists groups of a contact. + * + */ + public function testFetchContactGroups() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for fetchContacts + * + * Returns all contacts. + * + */ + public function testFetchContacts() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for removeContactFromGroup + * + * Removes a contact from a group. + * + */ + public function testRemoveContactFromGroup() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for updateContact + * + * Updates a contact. + * + */ + public function testUpdateContact() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/DeliveryReportApiTest.php b/test/Api/DeliveryReportApiTest.php new file mode 100644 index 0000000..cce94dd --- /dev/null +++ b/test/Api/DeliveryReportApiTest.php @@ -0,0 +1,86 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/GroupsApiTest.php b/test/Api/GroupsApiTest.php new file mode 100644 index 0000000..3faadc3 --- /dev/null +++ b/test/Api/GroupsApiTest.php @@ -0,0 +1,134 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for deleteGroup + * + * Deletes a group. + * + */ + public function testDeleteGroup() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for fetchGroup + * + * Lists a group. + * + */ + public function testFetchGroup() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for fetchGroups + * + * Returns all groups. + * + */ + public function testFetchGroups() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for updateGroup + * + * Updates a group with the provided name. + * + */ + public function testUpdateGroup() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/NumberLookupApiTest.php b/test/Api/NumberLookupApiTest.php new file mode 100644 index 0000000..f64ee88 --- /dev/null +++ b/test/Api/NumberLookupApiTest.php @@ -0,0 +1,86 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/OmnimessageApiTest.php b/test/Api/OmnimessageApiTest.php new file mode 100644 index 0000000..6b61e27 --- /dev/null +++ b/test/Api/OmnimessageApiTest.php @@ -0,0 +1,98 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for sendOmnimessage + * + * Sends an Omnimessage. + * + */ + public function testSendOmnimessage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/StatisticsApiTest.php b/test/Api/StatisticsApiTest.php new file mode 100644 index 0000000..10f2646 --- /dev/null +++ b/test/Api/StatisticsApiTest.php @@ -0,0 +1,86 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ChannelTest.php b/test/Model/ChannelTest.php new file mode 100644 index 0000000..5d478ad --- /dev/null +++ b/test/Model/ChannelTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ContactEnvelopeTest.php b/test/Model/ContactEnvelopeTest.php new file mode 100644 index 0000000..ad42b6a --- /dev/null +++ b/test/Model/ContactEnvelopeTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "contact" + */ + public function testPropertyContact() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ContactFieldsTest.php b/test/Model/ContactFieldsTest.php new file mode 100644 index 0000000..7fa774d --- /dev/null +++ b/test/Model/ContactFieldsTest.php @@ -0,0 +1,172 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "phoneNumber" + */ + public function testPropertyPhoneNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "email" + */ + public function testPropertyEmail() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "firstName" + */ + public function testPropertyFirstName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "lastName" + */ + public function testPropertyLastName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "company" + */ + public function testPropertyCompany() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "title" + */ + public function testPropertyTitle() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "custom" + */ + public function testPropertyCustom() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "custom2" + */ + public function testPropertyCustom2() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "custom3" + */ + public function testPropertyCustom3() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "custom4" + */ + public function testPropertyCustom4() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ContactListEnvelopeTest.php b/test/Model/ContactListEnvelopeTest.php new file mode 100644 index 0000000..bde0072 --- /dev/null +++ b/test/Model/ContactListEnvelopeTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "contacts" + */ + public function testPropertyContacts() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ContactResponseFieldsTest.php b/test/Model/ContactResponseFieldsTest.php new file mode 100644 index 0000000..0709a33 --- /dev/null +++ b/test/Model/ContactResponseFieldsTest.php @@ -0,0 +1,181 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "phoneNumber" + */ + public function testPropertyPhoneNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "email" + */ + public function testPropertyEmail() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "firstName" + */ + public function testPropertyFirstName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "lastName" + */ + public function testPropertyLastName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "company" + */ + public function testPropertyCompany() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "title" + */ + public function testPropertyTitle() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "custom" + */ + public function testPropertyCustom() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "custom2" + */ + public function testPropertyCustom2() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "custom3" + */ + public function testPropertyCustom3() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "custom4" + */ + public function testPropertyCustom4() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "scheduledDeletionDate" + */ + public function testPropertyScheduledDeletionDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ContactUpdateFieldsTest.php b/test/Model/ContactUpdateFieldsTest.php new file mode 100644 index 0000000..c179501 --- /dev/null +++ b/test/Model/ContactUpdateFieldsTest.php @@ -0,0 +1,163 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "email" + */ + public function testPropertyEmail() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "firstName" + */ + public function testPropertyFirstName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "lastName" + */ + public function testPropertyLastName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "company" + */ + public function testPropertyCompany() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "title" + */ + public function testPropertyTitle() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "custom" + */ + public function testPropertyCustom() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "custom2" + */ + public function testPropertyCustom2() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "custom3" + */ + public function testPropertyCustom3() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "custom4" + */ + public function testPropertyCustom4() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DeliveryReportResponseTest.php b/test/Model/DeliveryReportResponseTest.php new file mode 100644 index 0000000..8bb70a1 --- /dev/null +++ b/test/Model/DeliveryReportResponseTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "statuses" + */ + public function testPropertyStatuses() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "to" + */ + public function testPropertyTo() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "omnimessageId" + */ + public function testPropertyOmnimessageId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DeliveryResultTest.php b/test/Model/DeliveryResultTest.php new file mode 100644 index 0000000..a1e207b --- /dev/null +++ b/test/Model/DeliveryResultTest.php @@ -0,0 +1,136 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "channel" + */ + public function testPropertyChannel() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "messageId" + */ + public function testPropertyMessageId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "error" + */ + public function testPropertyError() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "err" + */ + public function testPropertyErr() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timestamp" + */ + public function testPropertyTimestamp() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ErrorCodeOmnichannelMachineTest.php b/test/Model/ErrorCodeOmnichannelMachineTest.php new file mode 100644 index 0000000..1cdf214 --- /dev/null +++ b/test/Model/ErrorCodeOmnichannelMachineTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ErrorCodeOmnichannelTest.php b/test/Model/ErrorCodeOmnichannelTest.php new file mode 100644 index 0000000..78fddb5 --- /dev/null +++ b/test/Model/ErrorCodeOmnichannelTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ErrorCodePhonebookTest.php b/test/Model/ErrorCodePhonebookTest.php new file mode 100644 index 0000000..71bc429 --- /dev/null +++ b/test/Model/ErrorCodePhonebookTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ErrorCodeStatisticsTest.php b/test/Model/ErrorCodeStatisticsTest.php new file mode 100644 index 0000000..f03468e --- /dev/null +++ b/test/Model/ErrorCodeStatisticsTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ErrorItemNumberLookupErrorTest.php b/test/Model/ErrorItemNumberLookupErrorTest.php new file mode 100644 index 0000000..8885f53 --- /dev/null +++ b/test/Model/ErrorItemNumberLookupErrorTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "description" + */ + public function testPropertyDescription() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "code" + */ + public function testPropertyCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ErrorItemNumberLookupTest.php b/test/Model/ErrorItemNumberLookupTest.php new file mode 100644 index 0000000..9246aa1 --- /dev/null +++ b/test/Model/ErrorItemNumberLookupTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "error" + */ + public function testPropertyError() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ErrorItemOmnichannelTest.php b/test/Model/ErrorItemOmnichannelTest.php new file mode 100644 index 0000000..ae5544a --- /dev/null +++ b/test/Model/ErrorItemOmnichannelTest.php @@ -0,0 +1,118 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "title" + */ + public function testPropertyTitle() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "detail" + */ + public function testPropertyDetail() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "code" + */ + public function testPropertyCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "source" + */ + public function testPropertySource() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ErrorItemPhonebookTest.php b/test/Model/ErrorItemPhonebookTest.php new file mode 100644 index 0000000..4d28e07 --- /dev/null +++ b/test/Model/ErrorItemPhonebookTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "title" + */ + public function testPropertyTitle() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "detail" + */ + public function testPropertyDetail() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "code" + */ + public function testPropertyCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ErrorItemStatisticsTest.php b/test/Model/ErrorItemStatisticsTest.php new file mode 100644 index 0000000..24e42b7 --- /dev/null +++ b/test/Model/ErrorItemStatisticsTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "title" + */ + public function testPropertyTitle() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "details" + */ + public function testPropertyDetails() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "code" + */ + public function testPropertyCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ErrorNumberLookupTest.php b/test/Model/ErrorNumberLookupTest.php new file mode 100644 index 0000000..27b57c4 --- /dev/null +++ b/test/Model/ErrorNumberLookupTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "errors" + */ + public function testPropertyErrors() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ErrorOmnichannelTest.php b/test/Model/ErrorOmnichannelTest.php new file mode 100644 index 0000000..5f1e138 --- /dev/null +++ b/test/Model/ErrorOmnichannelTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "errors" + */ + public function testPropertyErrors() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ErrorPhonebookTest.php b/test/Model/ErrorPhonebookTest.php new file mode 100644 index 0000000..4e836bf --- /dev/null +++ b/test/Model/ErrorPhonebookTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "errors" + */ + public function testPropertyErrors() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ErrorStatisticsTest.php b/test/Model/ErrorStatisticsTest.php new file mode 100644 index 0000000..4272499 --- /dev/null +++ b/test/Model/ErrorStatisticsTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "errors" + */ + public function testPropertyErrors() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ErrorTitleOmnichannelTest.php b/test/Model/ErrorTitleOmnichannelTest.php new file mode 100644 index 0000000..c29096a --- /dev/null +++ b/test/Model/ErrorTitleOmnichannelTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ErrorTitlePhonebookTest.php b/test/Model/ErrorTitlePhonebookTest.php new file mode 100644 index 0000000..2816116 --- /dev/null +++ b/test/Model/ErrorTitlePhonebookTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/FetchBlacklistSuccessTest.php b/test/Model/FetchBlacklistSuccessTest.php new file mode 100644 index 0000000..a93ea6f --- /dev/null +++ b/test/Model/FetchBlacklistSuccessTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "phoneNumbers" + */ + public function testPropertyPhoneNumbers() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/GroupEnvelopeTest.php b/test/Model/GroupEnvelopeTest.php new file mode 100644 index 0000000..ac7b3b1 --- /dev/null +++ b/test/Model/GroupEnvelopeTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "group" + */ + public function testPropertyGroup() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/GroupListEnvelopeTest.php b/test/Model/GroupListEnvelopeTest.php new file mode 100644 index 0000000..47b2f4b --- /dev/null +++ b/test/Model/GroupListEnvelopeTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "groups" + */ + public function testPropertyGroups() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/GroupNameTest.php b/test/Model/GroupNameTest.php new file mode 100644 index 0000000..82a5d94 --- /dev/null +++ b/test/Model/GroupNameTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/GroupResponseFieldsTest.php b/test/Model/GroupResponseFieldsTest.php new file mode 100644 index 0000000..cd5136a --- /dev/null +++ b/test/Model/GroupResponseFieldsTest.php @@ -0,0 +1,118 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "createdOn" + */ + public function testPropertyCreatedOn() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "contactsCount" + */ + public function testPropertyContactsCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/MessageResultTest.php b/test/Model/MessageResultTest.php new file mode 100644 index 0000000..778d4dc --- /dev/null +++ b/test/Model/MessageResultTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "messageId" + */ + public function testPropertyMessageId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "channel" + */ + public function testPropertyChannel() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sender" + */ + public function testPropertySender() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/MobileNetworkTest.php b/test/Model/MobileNetworkTest.php new file mode 100644 index 0000000..6b19db3 --- /dev/null +++ b/test/Model/MobileNetworkTest.php @@ -0,0 +1,127 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "mccmnc" + */ + public function testPropertyMccmnc() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "networkName" + */ + public function testPropertyNetworkName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "countryName" + */ + public function testPropertyCountryName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "countryPrefix" + */ + public function testPropertyCountryPrefix() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "countryCode" + */ + public function testPropertyCountryCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/NumberToBlacklistTest.php b/test/Model/NumberToBlacklistTest.php new file mode 100644 index 0000000..2b005cd --- /dev/null +++ b/test/Model/NumberToBlacklistTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "phoneNumber" + */ + public function testPropertyPhoneNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/NumbersToInvestigateTest.php b/test/Model/NumbersToInvestigateTest.php new file mode 100644 index 0000000..54c17fb --- /dev/null +++ b/test/Model/NumbersToInvestigateTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "numbers" + */ + public function testPropertyNumbers() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/OmniMessageCreateSuccessResponseTest.php b/test/Model/OmniMessageCreateSuccessResponseTest.php new file mode 100644 index 0000000..1544f73 --- /dev/null +++ b/test/Model/OmniMessageCreateSuccessResponseTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "messages" + */ + public function testPropertyMessages() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "to" + */ + public function testPropertyTo() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "omnimessageId" + */ + public function testPropertyOmnimessageId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/OmnimessageTest.php b/test/Model/OmnimessageTest.php new file mode 100644 index 0000000..c498a37 --- /dev/null +++ b/test/Model/OmnimessageTest.php @@ -0,0 +1,136 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "to" + */ + public function testPropertyTo() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "messages" + */ + public function testPropertyMessages() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "dlrUrl" + */ + public function testPropertyDlrUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "textStore" + */ + public function testPropertyTextStore() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timeToSend" + */ + public function testPropertyTimeToSend() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "priority" + */ + public function testPropertyPriority() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/PriorityTest.php b/test/Model/PriorityTest.php new file mode 100644 index 0000000..124fe12 --- /dev/null +++ b/test/Model/PriorityTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SMSTest.php b/test/Model/SMSTest.php new file mode 100644 index 0000000..c8cede3 --- /dev/null +++ b/test/Model/SMSTest.php @@ -0,0 +1,136 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "text" + */ + public function testPropertyText() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sender" + */ + public function testPropertySender() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "validity" + */ + public function testPropertyValidity() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "autoconvert" + */ + public function testPropertyAutoconvert() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "udh" + */ + public function testPropertyUdh() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "channel" + */ + public function testPropertyChannel() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/StatisticsReportSettingsTest.php b/test/Model/StatisticsReportSettingsTest.php new file mode 100644 index 0000000..d73d235 --- /dev/null +++ b/test/Model/StatisticsReportSettingsTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "startDate" + */ + public function testPropertyStartDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "endDate" + */ + public function testPropertyEndDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "messageTypes" + */ + public function testPropertyMessageTypes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/StatisticsReportSuccessTest.php b/test/Model/StatisticsReportSuccessTest.php new file mode 100644 index 0000000..f200c05 --- /dev/null +++ b/test/Model/StatisticsReportSuccessTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "reports" + */ + public function testPropertyReports() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/StatisticsReportTest.php b/test/Model/StatisticsReportTest.php new file mode 100644 index 0000000..8a4021a --- /dev/null +++ b/test/Model/StatisticsReportTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "totalMessages" + */ + public function testPropertyTotalMessages() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "totalPrice" + */ + public function testPropertyTotalPrice() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "country" + */ + public function testPropertyCountry() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/StatusTest.php b/test/Model/StatusTest.php new file mode 100644 index 0000000..10530f9 --- /dev/null +++ b/test/Model/StatusTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SyncNumberLookupResultTest.php b/test/Model/SyncNumberLookupResultTest.php new file mode 100644 index 0000000..8eb6dae --- /dev/null +++ b/test/Model/SyncNumberLookupResultTest.php @@ -0,0 +1,163 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "number" + */ + public function testPropertyNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "roaming" + */ + public function testPropertyRoaming() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ported" + */ + public function testPropertyPorted() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "roamingNetwork" + */ + public function testPropertyRoamingNetwork() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "currentNetwork" + */ + public function testPropertyCurrentNetwork() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "originalNetwork" + */ + public function testPropertyOriginalNetwork() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "portedNetwork" + */ + public function testPropertyPortedNetwork() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "error" + */ + public function testPropertyError() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SyncNumberLookupSuccessTest.php b/test/Model/SyncNumberLookupSuccessTest.php new file mode 100644 index 0000000..1274234 --- /dev/null +++ b/test/Model/SyncNumberLookupSuccessTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "requestId" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "result" + */ + public function testPropertyResult() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/TelegramTest.php b/test/Model/TelegramTest.php new file mode 100644 index 0000000..6a88027 --- /dev/null +++ b/test/Model/TelegramTest.php @@ -0,0 +1,145 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sender" + */ + public function testPropertySender() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "validity" + */ + public function testPropertyValidity() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "text" + */ + public function testPropertyText() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "imageUrl" + */ + public function testPropertyImageUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "documentUrl" + */ + public function testPropertyDocumentUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "audioUrl" + */ + public function testPropertyAudioUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "channel" + */ + public function testPropertyChannel() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/TextStoreTest.php b/test/Model/TextStoreTest.php new file mode 100644 index 0000000..70ff6ca --- /dev/null +++ b/test/Model/TextStoreTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ViberTest.php b/test/Model/ViberTest.php new file mode 100644 index 0000000..bc8daca --- /dev/null +++ b/test/Model/ViberTest.php @@ -0,0 +1,145 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sender" + */ + public function testPropertySender() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "validity" + */ + public function testPropertyValidity() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "text" + */ + public function testPropertyText() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "imageUrl" + */ + public function testPropertyImageUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "buttonUrl" + */ + public function testPropertyButtonUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "buttonText" + */ + public function testPropertyButtonText() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "channel" + */ + public function testPropertyChannel() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/WhatsAppAudioTest.php b/test/Model/WhatsAppAudioTest.php new file mode 100644 index 0000000..9d4fec7 --- /dev/null +++ b/test/Model/WhatsAppAudioTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "content" + */ + public function testPropertyContent() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/WhatsAppDocumentTest.php b/test/Model/WhatsAppDocumentTest.php new file mode 100644 index 0000000..022c0fa --- /dev/null +++ b/test/Model/WhatsAppDocumentTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "caption" + */ + public function testPropertyCaption() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "content" + */ + public function testPropertyContent() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/WhatsAppImageTest.php b/test/Model/WhatsAppImageTest.php new file mode 100644 index 0000000..e9d384f --- /dev/null +++ b/test/Model/WhatsAppImageTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "caption" + */ + public function testPropertyCaption() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "content" + */ + public function testPropertyContent() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/WhatsAppTest.php b/test/Model/WhatsAppTest.php new file mode 100644 index 0000000..462de55 --- /dev/null +++ b/test/Model/WhatsAppTest.php @@ -0,0 +1,145 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sender" + */ + public function testPropertySender() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "validity" + */ + public function testPropertyValidity() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "text" + */ + public function testPropertyText() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "image" + */ + public function testPropertyImage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "document" + */ + public function testPropertyDocument() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "audio" + */ + public function testPropertyAudio() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "channel" + */ + public function testPropertyChannel() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/WhatsAppTextTest.php b/test/Model/WhatsAppTextTest.php new file mode 100644 index 0000000..a3b7035 --- /dev/null +++ b/test/Model/WhatsAppTextTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "previewUrl" + */ + public function testPropertyPreviewUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "body" + */ + public function testPropertyBody() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} From eaf9adfc94e9619fddae6c4a295504fba5b4a7b2 Mon Sep 17 00:00:00 2001 From: api-librarian Date: Tue, 22 Nov 2022 10:43:00 +0000 Subject: [PATCH 5/8] Travis update: Nov 2022 (Build 706) [skip ci] --- docs/Model/SMS.md | 3 ++- docs/Model/Viber.md | 3 ++- docs/Model/WhatsApp.md | 1 + lib/Model/SMS.php | 32 +++++++++++++++++++++++++++++++- lib/Model/Viber.php | 32 +++++++++++++++++++++++++++++++- lib/Model/WhatsApp.php | 30 ++++++++++++++++++++++++++++++ test/Model/SMSTest.php | 9 +++++++++ test/Model/ViberTest.php | 9 +++++++++ test/Model/WhatsAppTest.php | 9 +++++++++ 9 files changed, 124 insertions(+), 4 deletions(-) diff --git a/docs/Model/SMS.md b/docs/Model/SMS.md index f0d4c91..3558995 100644 --- a/docs/Model/SMS.md +++ b/docs/Model/SMS.md @@ -6,7 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **text** | **string** | Text content of the SMS | **sender** | **string** | Phone number or alphanumeric sender name | [optional] -**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted | [optional] +**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted. Only one of \"ttl\" and \"validity\" can be used. | [optional] +**ttl** | **int** | After how many seconds this channel is considered as failed and the next channel is attempted. Only one of \"ttl\" and \"validity\" can be used. | [optional] **autoconvert** | **string** | Defines how non-GSM characters will be treated: - \"on\" Use replacement settings from the account's [API Auto Replace settings page](https://dashboard.messente.com/api-settings/auto-replace) (default) - \"full\" All non GSM 03.38 characters will be replaced with suitable alternatives - \"off\" Message content is not modified in any way | [optional] **udh** | **string** | hex-encoded string containing SMS UDH | [optional] **channel** | **string** | The channel used to deliver the message | [optional] [default to 'sms'] diff --git a/docs/Model/Viber.md b/docs/Model/Viber.md index 688a035..b771b22 100644 --- a/docs/Model/Viber.md +++ b/docs/Model/Viber.md @@ -5,7 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **sender** | **string** | Phone number or alphanumeric sender name | [optional] -**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted | [optional] +**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted. Only one of \"ttl\" and \"validity\" can be used. | [optional] +**ttl** | **int** | After how many seconds this channel is considered as failed and the next channel is attempted. Only one of \"ttl\" and \"validity\" can be used. | [optional] **text** | **string** | Plaintext content for Viber | [optional] **imageUrl** | **string** | URL for the embedded image Valid combinations: 1) image_url, 2) text, image_url, button_url, button_text | [optional] **buttonUrl** | **string** | URL of the button, must be specified along with ''text'', ''button_text'' and ''image_url'' (optional) | [optional] diff --git a/docs/Model/WhatsApp.md b/docs/Model/WhatsApp.md index 6ce50dd..95aab88 100644 --- a/docs/Model/WhatsApp.md +++ b/docs/Model/WhatsApp.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **sender** | **string** | Phone number or alphanumeric sender name | [optional] **validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted | [optional] +**ttl** | **int** | After how many seconds this channel is considered as failed and the next channel is attempted. Only one of \"ttl\" and \"validity\" can be used. | [optional] **text** | [**\Messente\Api\Model\WhatsAppText**](WhatsAppText.md) | | [optional] **image** | [**\Messente\Api\Model\WhatsAppImage**](WhatsAppImage.md) | | [optional] **document** | [**\Messente\Api\Model\WhatsAppDocument**](WhatsAppDocument.md) | | [optional] diff --git a/lib/Model/SMS.php b/lib/Model/SMS.php index 7f3c04d..44acc1c 100644 --- a/lib/Model/SMS.php +++ b/lib/Model/SMS.php @@ -64,6 +64,7 @@ class SMS implements ModelInterface, ArrayAccess, \JsonSerializable 'text' => 'string', 'sender' => 'string', 'validity' => 'int', + 'ttl' => 'int', 'autoconvert' => 'string', 'udh' => 'string', 'channel' => 'string' @@ -80,6 +81,7 @@ class SMS implements ModelInterface, ArrayAccess, \JsonSerializable 'text' => null, 'sender' => null, 'validity' => null, + 'ttl' => null, 'autoconvert' => null, 'udh' => null, 'channel' => null @@ -115,6 +117,7 @@ public static function openAPIFormats() 'text' => 'text', 'sender' => 'sender', 'validity' => 'validity', + 'ttl' => 'ttl', 'autoconvert' => 'autoconvert', 'udh' => 'udh', 'channel' => 'channel' @@ -129,6 +132,7 @@ public static function openAPIFormats() 'text' => 'setText', 'sender' => 'setSender', 'validity' => 'setValidity', + 'ttl' => 'setTtl', 'autoconvert' => 'setAutoconvert', 'udh' => 'setUdh', 'channel' => 'setChannel' @@ -143,6 +147,7 @@ public static function openAPIFormats() 'text' => 'getText', 'sender' => 'getSender', 'validity' => 'getValidity', + 'ttl' => 'getTtl', 'autoconvert' => 'getAutoconvert', 'udh' => 'getUdh', 'channel' => 'getChannel' @@ -238,6 +243,7 @@ public function __construct(array $data = null) $this->container['text'] = $data['text'] ?? null; $this->container['sender'] = $data['sender'] ?? null; $this->container['validity'] = $data['validity'] ?? null; + $this->container['ttl'] = $data['ttl'] ?? null; $this->container['autoconvert'] = $data['autoconvert'] ?? null; $this->container['udh'] = $data['udh'] ?? null; $this->container['channel'] = $data['channel'] ?? 'sms'; @@ -349,7 +355,7 @@ public function getValidity() /** * Sets validity * - * @param int|null $validity After how many minutes this channel is considered as failed and the next channel is attempted + * @param int|null $validity After how many minutes this channel is considered as failed and the next channel is attempted. Only one of \"ttl\" and \"validity\" can be used. * * @return self */ @@ -360,6 +366,30 @@ public function setValidity($validity) return $this; } + /** + * Gets ttl + * + * @return int|null + */ + public function getTtl() + { + return $this->container['ttl']; + } + + /** + * Sets ttl + * + * @param int|null $ttl After how many seconds this channel is considered as failed and the next channel is attempted. Only one of \"ttl\" and \"validity\" can be used. + * + * @return self + */ + public function setTtl($ttl) + { + $this->container['ttl'] = $ttl; + + return $this; + } + /** * Gets autoconvert * diff --git a/lib/Model/Viber.php b/lib/Model/Viber.php index e4ac2d9..0447d57 100644 --- a/lib/Model/Viber.php +++ b/lib/Model/Viber.php @@ -63,6 +63,7 @@ class Viber implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'sender' => 'string', 'validity' => 'int', + 'ttl' => 'int', 'text' => 'string', 'imageUrl' => 'string', 'buttonUrl' => 'string', @@ -80,6 +81,7 @@ class Viber implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPIFormats = [ 'sender' => null, 'validity' => null, + 'ttl' => null, 'text' => null, 'imageUrl' => null, 'buttonUrl' => null, @@ -116,6 +118,7 @@ public static function openAPIFormats() protected static $attributeMap = [ 'sender' => 'sender', 'validity' => 'validity', + 'ttl' => 'ttl', 'text' => 'text', 'imageUrl' => 'image_url', 'buttonUrl' => 'button_url', @@ -131,6 +134,7 @@ public static function openAPIFormats() protected static $setters = [ 'sender' => 'setSender', 'validity' => 'setValidity', + 'ttl' => 'setTtl', 'text' => 'setText', 'imageUrl' => 'setImageUrl', 'buttonUrl' => 'setButtonUrl', @@ -146,6 +150,7 @@ public static function openAPIFormats() protected static $getters = [ 'sender' => 'getSender', 'validity' => 'getValidity', + 'ttl' => 'getTtl', 'text' => 'getText', 'imageUrl' => 'getImageUrl', 'buttonUrl' => 'getButtonUrl', @@ -225,6 +230,7 @@ public function __construct(array $data = null) { $this->container['sender'] = $data['sender'] ?? null; $this->container['validity'] = $data['validity'] ?? null; + $this->container['ttl'] = $data['ttl'] ?? null; $this->container['text'] = $data['text'] ?? null; $this->container['imageUrl'] = $data['imageUrl'] ?? null; $this->container['buttonUrl'] = $data['buttonUrl'] ?? null; @@ -302,7 +308,7 @@ public function getValidity() /** * Sets validity * - * @param int|null $validity After how many minutes this channel is considered as failed and the next channel is attempted + * @param int|null $validity After how many minutes this channel is considered as failed and the next channel is attempted. Only one of \"ttl\" and \"validity\" can be used. * * @return self */ @@ -313,6 +319,30 @@ public function setValidity($validity) return $this; } + /** + * Gets ttl + * + * @return int|null + */ + public function getTtl() + { + return $this->container['ttl']; + } + + /** + * Sets ttl + * + * @param int|null $ttl After how many seconds this channel is considered as failed and the next channel is attempted. Only one of \"ttl\" and \"validity\" can be used. + * + * @return self + */ + public function setTtl($ttl) + { + $this->container['ttl'] = $ttl; + + return $this; + } + /** * Gets text * diff --git a/lib/Model/WhatsApp.php b/lib/Model/WhatsApp.php index aa14c56..d55da7a 100644 --- a/lib/Model/WhatsApp.php +++ b/lib/Model/WhatsApp.php @@ -63,6 +63,7 @@ class WhatsApp implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'sender' => 'string', 'validity' => 'int', + 'ttl' => 'int', 'text' => '\Messente\Api\Model\WhatsAppText', 'image' => '\Messente\Api\Model\WhatsAppImage', 'document' => '\Messente\Api\Model\WhatsAppDocument', @@ -80,6 +81,7 @@ class WhatsApp implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPIFormats = [ 'sender' => null, 'validity' => null, + 'ttl' => null, 'text' => null, 'image' => null, 'document' => null, @@ -116,6 +118,7 @@ public static function openAPIFormats() protected static $attributeMap = [ 'sender' => 'sender', 'validity' => 'validity', + 'ttl' => 'ttl', 'text' => 'text', 'image' => 'image', 'document' => 'document', @@ -131,6 +134,7 @@ public static function openAPIFormats() protected static $setters = [ 'sender' => 'setSender', 'validity' => 'setValidity', + 'ttl' => 'setTtl', 'text' => 'setText', 'image' => 'setImage', 'document' => 'setDocument', @@ -146,6 +150,7 @@ public static function openAPIFormats() protected static $getters = [ 'sender' => 'getSender', 'validity' => 'getValidity', + 'ttl' => 'getTtl', 'text' => 'getText', 'image' => 'getImage', 'document' => 'getDocument', @@ -225,6 +230,7 @@ public function __construct(array $data = null) { $this->container['sender'] = $data['sender'] ?? null; $this->container['validity'] = $data['validity'] ?? null; + $this->container['ttl'] = $data['ttl'] ?? null; $this->container['text'] = $data['text'] ?? null; $this->container['image'] = $data['image'] ?? null; $this->container['document'] = $data['document'] ?? null; @@ -313,6 +319,30 @@ public function setValidity($validity) return $this; } + /** + * Gets ttl + * + * @return int|null + */ + public function getTtl() + { + return $this->container['ttl']; + } + + /** + * Sets ttl + * + * @param int|null $ttl After how many seconds this channel is considered as failed and the next channel is attempted. Only one of \"ttl\" and \"validity\" can be used. + * + * @return self + */ + public function setTtl($ttl) + { + $this->container['ttl'] = $ttl; + + return $this; + } + /** * Gets text * diff --git a/test/Model/SMSTest.php b/test/Model/SMSTest.php index c8cede3..3ab9316 100644 --- a/test/Model/SMSTest.php +++ b/test/Model/SMSTest.php @@ -107,6 +107,15 @@ public function testPropertyValidity() $this->markTestIncomplete('Not implemented'); } + /** + * Test attribute "ttl" + */ + public function testPropertyTtl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + /** * Test attribute "autoconvert" */ diff --git a/test/Model/ViberTest.php b/test/Model/ViberTest.php index bc8daca..f15e95e 100644 --- a/test/Model/ViberTest.php +++ b/test/Model/ViberTest.php @@ -98,6 +98,15 @@ public function testPropertyValidity() $this->markTestIncomplete('Not implemented'); } + /** + * Test attribute "ttl" + */ + public function testPropertyTtl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + /** * Test attribute "text" */ diff --git a/test/Model/WhatsAppTest.php b/test/Model/WhatsAppTest.php index 462de55..115ec5c 100644 --- a/test/Model/WhatsAppTest.php +++ b/test/Model/WhatsAppTest.php @@ -98,6 +98,15 @@ public function testPropertyValidity() $this->markTestIncomplete('Not implemented'); } + /** + * Test attribute "ttl" + */ + public function testPropertyTtl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + /** * Test attribute "text" */ From ddcb810cfb05940dc7b8669ec407b8f42956ff3b Mon Sep 17 00:00:00 2001 From: api-librarian Date: Mon, 5 Dec 2022 08:04:42 +0000 Subject: [PATCH 6/8] Travis update: Dec 2022 (Build 708) [skip ci] --- docs/Model/SMS.md | 3 +-- docs/Model/Viber.md | 3 +-- docs/Model/WhatsApp.md | 1 - lib/Model/SMS.php | 32 +------------------------------- lib/Model/Viber.php | 32 +------------------------------- lib/Model/WhatsApp.php | 30 ------------------------------ test/Model/SMSTest.php | 9 --------- test/Model/ViberTest.php | 9 --------- test/Model/WhatsAppTest.php | 9 --------- 9 files changed, 4 insertions(+), 124 deletions(-) diff --git a/docs/Model/SMS.md b/docs/Model/SMS.md index 3558995..f0d4c91 100644 --- a/docs/Model/SMS.md +++ b/docs/Model/SMS.md @@ -6,8 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **text** | **string** | Text content of the SMS | **sender** | **string** | Phone number or alphanumeric sender name | [optional] -**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted. Only one of \"ttl\" and \"validity\" can be used. | [optional] -**ttl** | **int** | After how many seconds this channel is considered as failed and the next channel is attempted. Only one of \"ttl\" and \"validity\" can be used. | [optional] +**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted | [optional] **autoconvert** | **string** | Defines how non-GSM characters will be treated: - \"on\" Use replacement settings from the account's [API Auto Replace settings page](https://dashboard.messente.com/api-settings/auto-replace) (default) - \"full\" All non GSM 03.38 characters will be replaced with suitable alternatives - \"off\" Message content is not modified in any way | [optional] **udh** | **string** | hex-encoded string containing SMS UDH | [optional] **channel** | **string** | The channel used to deliver the message | [optional] [default to 'sms'] diff --git a/docs/Model/Viber.md b/docs/Model/Viber.md index b771b22..688a035 100644 --- a/docs/Model/Viber.md +++ b/docs/Model/Viber.md @@ -5,8 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **sender** | **string** | Phone number or alphanumeric sender name | [optional] -**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted. Only one of \"ttl\" and \"validity\" can be used. | [optional] -**ttl** | **int** | After how many seconds this channel is considered as failed and the next channel is attempted. Only one of \"ttl\" and \"validity\" can be used. | [optional] +**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted | [optional] **text** | **string** | Plaintext content for Viber | [optional] **imageUrl** | **string** | URL for the embedded image Valid combinations: 1) image_url, 2) text, image_url, button_url, button_text | [optional] **buttonUrl** | **string** | URL of the button, must be specified along with ''text'', ''button_text'' and ''image_url'' (optional) | [optional] diff --git a/docs/Model/WhatsApp.md b/docs/Model/WhatsApp.md index 95aab88..6ce50dd 100644 --- a/docs/Model/WhatsApp.md +++ b/docs/Model/WhatsApp.md @@ -6,7 +6,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **sender** | **string** | Phone number or alphanumeric sender name | [optional] **validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted | [optional] -**ttl** | **int** | After how many seconds this channel is considered as failed and the next channel is attempted. Only one of \"ttl\" and \"validity\" can be used. | [optional] **text** | [**\Messente\Api\Model\WhatsAppText**](WhatsAppText.md) | | [optional] **image** | [**\Messente\Api\Model\WhatsAppImage**](WhatsAppImage.md) | | [optional] **document** | [**\Messente\Api\Model\WhatsAppDocument**](WhatsAppDocument.md) | | [optional] diff --git a/lib/Model/SMS.php b/lib/Model/SMS.php index 44acc1c..7f3c04d 100644 --- a/lib/Model/SMS.php +++ b/lib/Model/SMS.php @@ -64,7 +64,6 @@ class SMS implements ModelInterface, ArrayAccess, \JsonSerializable 'text' => 'string', 'sender' => 'string', 'validity' => 'int', - 'ttl' => 'int', 'autoconvert' => 'string', 'udh' => 'string', 'channel' => 'string' @@ -81,7 +80,6 @@ class SMS implements ModelInterface, ArrayAccess, \JsonSerializable 'text' => null, 'sender' => null, 'validity' => null, - 'ttl' => null, 'autoconvert' => null, 'udh' => null, 'channel' => null @@ -117,7 +115,6 @@ public static function openAPIFormats() 'text' => 'text', 'sender' => 'sender', 'validity' => 'validity', - 'ttl' => 'ttl', 'autoconvert' => 'autoconvert', 'udh' => 'udh', 'channel' => 'channel' @@ -132,7 +129,6 @@ public static function openAPIFormats() 'text' => 'setText', 'sender' => 'setSender', 'validity' => 'setValidity', - 'ttl' => 'setTtl', 'autoconvert' => 'setAutoconvert', 'udh' => 'setUdh', 'channel' => 'setChannel' @@ -147,7 +143,6 @@ public static function openAPIFormats() 'text' => 'getText', 'sender' => 'getSender', 'validity' => 'getValidity', - 'ttl' => 'getTtl', 'autoconvert' => 'getAutoconvert', 'udh' => 'getUdh', 'channel' => 'getChannel' @@ -243,7 +238,6 @@ public function __construct(array $data = null) $this->container['text'] = $data['text'] ?? null; $this->container['sender'] = $data['sender'] ?? null; $this->container['validity'] = $data['validity'] ?? null; - $this->container['ttl'] = $data['ttl'] ?? null; $this->container['autoconvert'] = $data['autoconvert'] ?? null; $this->container['udh'] = $data['udh'] ?? null; $this->container['channel'] = $data['channel'] ?? 'sms'; @@ -355,7 +349,7 @@ public function getValidity() /** * Sets validity * - * @param int|null $validity After how many minutes this channel is considered as failed and the next channel is attempted. Only one of \"ttl\" and \"validity\" can be used. + * @param int|null $validity After how many minutes this channel is considered as failed and the next channel is attempted * * @return self */ @@ -366,30 +360,6 @@ public function setValidity($validity) return $this; } - /** - * Gets ttl - * - * @return int|null - */ - public function getTtl() - { - return $this->container['ttl']; - } - - /** - * Sets ttl - * - * @param int|null $ttl After how many seconds this channel is considered as failed and the next channel is attempted. Only one of \"ttl\" and \"validity\" can be used. - * - * @return self - */ - public function setTtl($ttl) - { - $this->container['ttl'] = $ttl; - - return $this; - } - /** * Gets autoconvert * diff --git a/lib/Model/Viber.php b/lib/Model/Viber.php index 0447d57..e4ac2d9 100644 --- a/lib/Model/Viber.php +++ b/lib/Model/Viber.php @@ -63,7 +63,6 @@ class Viber implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'sender' => 'string', 'validity' => 'int', - 'ttl' => 'int', 'text' => 'string', 'imageUrl' => 'string', 'buttonUrl' => 'string', @@ -81,7 +80,6 @@ class Viber implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPIFormats = [ 'sender' => null, 'validity' => null, - 'ttl' => null, 'text' => null, 'imageUrl' => null, 'buttonUrl' => null, @@ -118,7 +116,6 @@ public static function openAPIFormats() protected static $attributeMap = [ 'sender' => 'sender', 'validity' => 'validity', - 'ttl' => 'ttl', 'text' => 'text', 'imageUrl' => 'image_url', 'buttonUrl' => 'button_url', @@ -134,7 +131,6 @@ public static function openAPIFormats() protected static $setters = [ 'sender' => 'setSender', 'validity' => 'setValidity', - 'ttl' => 'setTtl', 'text' => 'setText', 'imageUrl' => 'setImageUrl', 'buttonUrl' => 'setButtonUrl', @@ -150,7 +146,6 @@ public static function openAPIFormats() protected static $getters = [ 'sender' => 'getSender', 'validity' => 'getValidity', - 'ttl' => 'getTtl', 'text' => 'getText', 'imageUrl' => 'getImageUrl', 'buttonUrl' => 'getButtonUrl', @@ -230,7 +225,6 @@ public function __construct(array $data = null) { $this->container['sender'] = $data['sender'] ?? null; $this->container['validity'] = $data['validity'] ?? null; - $this->container['ttl'] = $data['ttl'] ?? null; $this->container['text'] = $data['text'] ?? null; $this->container['imageUrl'] = $data['imageUrl'] ?? null; $this->container['buttonUrl'] = $data['buttonUrl'] ?? null; @@ -308,7 +302,7 @@ public function getValidity() /** * Sets validity * - * @param int|null $validity After how many minutes this channel is considered as failed and the next channel is attempted. Only one of \"ttl\" and \"validity\" can be used. + * @param int|null $validity After how many minutes this channel is considered as failed and the next channel is attempted * * @return self */ @@ -319,30 +313,6 @@ public function setValidity($validity) return $this; } - /** - * Gets ttl - * - * @return int|null - */ - public function getTtl() - { - return $this->container['ttl']; - } - - /** - * Sets ttl - * - * @param int|null $ttl After how many seconds this channel is considered as failed and the next channel is attempted. Only one of \"ttl\" and \"validity\" can be used. - * - * @return self - */ - public function setTtl($ttl) - { - $this->container['ttl'] = $ttl; - - return $this; - } - /** * Gets text * diff --git a/lib/Model/WhatsApp.php b/lib/Model/WhatsApp.php index d55da7a..aa14c56 100644 --- a/lib/Model/WhatsApp.php +++ b/lib/Model/WhatsApp.php @@ -63,7 +63,6 @@ class WhatsApp implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'sender' => 'string', 'validity' => 'int', - 'ttl' => 'int', 'text' => '\Messente\Api\Model\WhatsAppText', 'image' => '\Messente\Api\Model\WhatsAppImage', 'document' => '\Messente\Api\Model\WhatsAppDocument', @@ -81,7 +80,6 @@ class WhatsApp implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPIFormats = [ 'sender' => null, 'validity' => null, - 'ttl' => null, 'text' => null, 'image' => null, 'document' => null, @@ -118,7 +116,6 @@ public static function openAPIFormats() protected static $attributeMap = [ 'sender' => 'sender', 'validity' => 'validity', - 'ttl' => 'ttl', 'text' => 'text', 'image' => 'image', 'document' => 'document', @@ -134,7 +131,6 @@ public static function openAPIFormats() protected static $setters = [ 'sender' => 'setSender', 'validity' => 'setValidity', - 'ttl' => 'setTtl', 'text' => 'setText', 'image' => 'setImage', 'document' => 'setDocument', @@ -150,7 +146,6 @@ public static function openAPIFormats() protected static $getters = [ 'sender' => 'getSender', 'validity' => 'getValidity', - 'ttl' => 'getTtl', 'text' => 'getText', 'image' => 'getImage', 'document' => 'getDocument', @@ -230,7 +225,6 @@ public function __construct(array $data = null) { $this->container['sender'] = $data['sender'] ?? null; $this->container['validity'] = $data['validity'] ?? null; - $this->container['ttl'] = $data['ttl'] ?? null; $this->container['text'] = $data['text'] ?? null; $this->container['image'] = $data['image'] ?? null; $this->container['document'] = $data['document'] ?? null; @@ -319,30 +313,6 @@ public function setValidity($validity) return $this; } - /** - * Gets ttl - * - * @return int|null - */ - public function getTtl() - { - return $this->container['ttl']; - } - - /** - * Sets ttl - * - * @param int|null $ttl After how many seconds this channel is considered as failed and the next channel is attempted. Only one of \"ttl\" and \"validity\" can be used. - * - * @return self - */ - public function setTtl($ttl) - { - $this->container['ttl'] = $ttl; - - return $this; - } - /** * Gets text * diff --git a/test/Model/SMSTest.php b/test/Model/SMSTest.php index 3ab9316..c8cede3 100644 --- a/test/Model/SMSTest.php +++ b/test/Model/SMSTest.php @@ -107,15 +107,6 @@ public function testPropertyValidity() $this->markTestIncomplete('Not implemented'); } - /** - * Test attribute "ttl" - */ - public function testPropertyTtl() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - /** * Test attribute "autoconvert" */ diff --git a/test/Model/ViberTest.php b/test/Model/ViberTest.php index f15e95e..bc8daca 100644 --- a/test/Model/ViberTest.php +++ b/test/Model/ViberTest.php @@ -98,15 +98,6 @@ public function testPropertyValidity() $this->markTestIncomplete('Not implemented'); } - /** - * Test attribute "ttl" - */ - public function testPropertyTtl() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - /** * Test attribute "text" */ diff --git a/test/Model/WhatsAppTest.php b/test/Model/WhatsAppTest.php index 115ec5c..462de55 100644 --- a/test/Model/WhatsAppTest.php +++ b/test/Model/WhatsAppTest.php @@ -98,15 +98,6 @@ public function testPropertyValidity() $this->markTestIncomplete('Not implemented'); } - /** - * Test attribute "ttl" - */ - public function testPropertyTtl() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - /** * Test attribute "text" */ From 0183aca50d871cf5ab2aa04e068add375f2daf41 Mon Sep 17 00:00:00 2001 From: api-librarian Date: Thu, 19 Jan 2023 12:25:40 +0000 Subject: [PATCH 7/8] Travis update: Jan 2023 (Build 710) [skip ci] --- docs/Model/SMS.md | 3 ++- docs/Model/Viber.md | 3 ++- docs/Model/WhatsApp.md | 1 + lib/Model/SMS.php | 32 +++++++++++++++++++++++++++++++- lib/Model/Viber.php | 32 +++++++++++++++++++++++++++++++- lib/Model/WhatsApp.php | 30 ++++++++++++++++++++++++++++++ test/Model/SMSTest.php | 9 +++++++++ test/Model/ViberTest.php | 9 +++++++++ test/Model/WhatsAppTest.php | 9 +++++++++ 9 files changed, 124 insertions(+), 4 deletions(-) diff --git a/docs/Model/SMS.md b/docs/Model/SMS.md index f0d4c91..3558995 100644 --- a/docs/Model/SMS.md +++ b/docs/Model/SMS.md @@ -6,7 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **text** | **string** | Text content of the SMS | **sender** | **string** | Phone number or alphanumeric sender name | [optional] -**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted | [optional] +**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted. Only one of \"ttl\" and \"validity\" can be used. | [optional] +**ttl** | **int** | After how many seconds this channel is considered as failed and the next channel is attempted. Only one of \"ttl\" and \"validity\" can be used. | [optional] **autoconvert** | **string** | Defines how non-GSM characters will be treated: - \"on\" Use replacement settings from the account's [API Auto Replace settings page](https://dashboard.messente.com/api-settings/auto-replace) (default) - \"full\" All non GSM 03.38 characters will be replaced with suitable alternatives - \"off\" Message content is not modified in any way | [optional] **udh** | **string** | hex-encoded string containing SMS UDH | [optional] **channel** | **string** | The channel used to deliver the message | [optional] [default to 'sms'] diff --git a/docs/Model/Viber.md b/docs/Model/Viber.md index 688a035..b771b22 100644 --- a/docs/Model/Viber.md +++ b/docs/Model/Viber.md @@ -5,7 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **sender** | **string** | Phone number or alphanumeric sender name | [optional] -**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted | [optional] +**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted. Only one of \"ttl\" and \"validity\" can be used. | [optional] +**ttl** | **int** | After how many seconds this channel is considered as failed and the next channel is attempted. Only one of \"ttl\" and \"validity\" can be used. | [optional] **text** | **string** | Plaintext content for Viber | [optional] **imageUrl** | **string** | URL for the embedded image Valid combinations: 1) image_url, 2) text, image_url, button_url, button_text | [optional] **buttonUrl** | **string** | URL of the button, must be specified along with ''text'', ''button_text'' and ''image_url'' (optional) | [optional] diff --git a/docs/Model/WhatsApp.md b/docs/Model/WhatsApp.md index 6ce50dd..95aab88 100644 --- a/docs/Model/WhatsApp.md +++ b/docs/Model/WhatsApp.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **sender** | **string** | Phone number or alphanumeric sender name | [optional] **validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted | [optional] +**ttl** | **int** | After how many seconds this channel is considered as failed and the next channel is attempted. Only one of \"ttl\" and \"validity\" can be used. | [optional] **text** | [**\Messente\Api\Model\WhatsAppText**](WhatsAppText.md) | | [optional] **image** | [**\Messente\Api\Model\WhatsAppImage**](WhatsAppImage.md) | | [optional] **document** | [**\Messente\Api\Model\WhatsAppDocument**](WhatsAppDocument.md) | | [optional] diff --git a/lib/Model/SMS.php b/lib/Model/SMS.php index 7f3c04d..44acc1c 100644 --- a/lib/Model/SMS.php +++ b/lib/Model/SMS.php @@ -64,6 +64,7 @@ class SMS implements ModelInterface, ArrayAccess, \JsonSerializable 'text' => 'string', 'sender' => 'string', 'validity' => 'int', + 'ttl' => 'int', 'autoconvert' => 'string', 'udh' => 'string', 'channel' => 'string' @@ -80,6 +81,7 @@ class SMS implements ModelInterface, ArrayAccess, \JsonSerializable 'text' => null, 'sender' => null, 'validity' => null, + 'ttl' => null, 'autoconvert' => null, 'udh' => null, 'channel' => null @@ -115,6 +117,7 @@ public static function openAPIFormats() 'text' => 'text', 'sender' => 'sender', 'validity' => 'validity', + 'ttl' => 'ttl', 'autoconvert' => 'autoconvert', 'udh' => 'udh', 'channel' => 'channel' @@ -129,6 +132,7 @@ public static function openAPIFormats() 'text' => 'setText', 'sender' => 'setSender', 'validity' => 'setValidity', + 'ttl' => 'setTtl', 'autoconvert' => 'setAutoconvert', 'udh' => 'setUdh', 'channel' => 'setChannel' @@ -143,6 +147,7 @@ public static function openAPIFormats() 'text' => 'getText', 'sender' => 'getSender', 'validity' => 'getValidity', + 'ttl' => 'getTtl', 'autoconvert' => 'getAutoconvert', 'udh' => 'getUdh', 'channel' => 'getChannel' @@ -238,6 +243,7 @@ public function __construct(array $data = null) $this->container['text'] = $data['text'] ?? null; $this->container['sender'] = $data['sender'] ?? null; $this->container['validity'] = $data['validity'] ?? null; + $this->container['ttl'] = $data['ttl'] ?? null; $this->container['autoconvert'] = $data['autoconvert'] ?? null; $this->container['udh'] = $data['udh'] ?? null; $this->container['channel'] = $data['channel'] ?? 'sms'; @@ -349,7 +355,7 @@ public function getValidity() /** * Sets validity * - * @param int|null $validity After how many minutes this channel is considered as failed and the next channel is attempted + * @param int|null $validity After how many minutes this channel is considered as failed and the next channel is attempted. Only one of \"ttl\" and \"validity\" can be used. * * @return self */ @@ -360,6 +366,30 @@ public function setValidity($validity) return $this; } + /** + * Gets ttl + * + * @return int|null + */ + public function getTtl() + { + return $this->container['ttl']; + } + + /** + * Sets ttl + * + * @param int|null $ttl After how many seconds this channel is considered as failed and the next channel is attempted. Only one of \"ttl\" and \"validity\" can be used. + * + * @return self + */ + public function setTtl($ttl) + { + $this->container['ttl'] = $ttl; + + return $this; + } + /** * Gets autoconvert * diff --git a/lib/Model/Viber.php b/lib/Model/Viber.php index e4ac2d9..0447d57 100644 --- a/lib/Model/Viber.php +++ b/lib/Model/Viber.php @@ -63,6 +63,7 @@ class Viber implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'sender' => 'string', 'validity' => 'int', + 'ttl' => 'int', 'text' => 'string', 'imageUrl' => 'string', 'buttonUrl' => 'string', @@ -80,6 +81,7 @@ class Viber implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPIFormats = [ 'sender' => null, 'validity' => null, + 'ttl' => null, 'text' => null, 'imageUrl' => null, 'buttonUrl' => null, @@ -116,6 +118,7 @@ public static function openAPIFormats() protected static $attributeMap = [ 'sender' => 'sender', 'validity' => 'validity', + 'ttl' => 'ttl', 'text' => 'text', 'imageUrl' => 'image_url', 'buttonUrl' => 'button_url', @@ -131,6 +134,7 @@ public static function openAPIFormats() protected static $setters = [ 'sender' => 'setSender', 'validity' => 'setValidity', + 'ttl' => 'setTtl', 'text' => 'setText', 'imageUrl' => 'setImageUrl', 'buttonUrl' => 'setButtonUrl', @@ -146,6 +150,7 @@ public static function openAPIFormats() protected static $getters = [ 'sender' => 'getSender', 'validity' => 'getValidity', + 'ttl' => 'getTtl', 'text' => 'getText', 'imageUrl' => 'getImageUrl', 'buttonUrl' => 'getButtonUrl', @@ -225,6 +230,7 @@ public function __construct(array $data = null) { $this->container['sender'] = $data['sender'] ?? null; $this->container['validity'] = $data['validity'] ?? null; + $this->container['ttl'] = $data['ttl'] ?? null; $this->container['text'] = $data['text'] ?? null; $this->container['imageUrl'] = $data['imageUrl'] ?? null; $this->container['buttonUrl'] = $data['buttonUrl'] ?? null; @@ -302,7 +308,7 @@ public function getValidity() /** * Sets validity * - * @param int|null $validity After how many minutes this channel is considered as failed and the next channel is attempted + * @param int|null $validity After how many minutes this channel is considered as failed and the next channel is attempted. Only one of \"ttl\" and \"validity\" can be used. * * @return self */ @@ -313,6 +319,30 @@ public function setValidity($validity) return $this; } + /** + * Gets ttl + * + * @return int|null + */ + public function getTtl() + { + return $this->container['ttl']; + } + + /** + * Sets ttl + * + * @param int|null $ttl After how many seconds this channel is considered as failed and the next channel is attempted. Only one of \"ttl\" and \"validity\" can be used. + * + * @return self + */ + public function setTtl($ttl) + { + $this->container['ttl'] = $ttl; + + return $this; + } + /** * Gets text * diff --git a/lib/Model/WhatsApp.php b/lib/Model/WhatsApp.php index aa14c56..d55da7a 100644 --- a/lib/Model/WhatsApp.php +++ b/lib/Model/WhatsApp.php @@ -63,6 +63,7 @@ class WhatsApp implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'sender' => 'string', 'validity' => 'int', + 'ttl' => 'int', 'text' => '\Messente\Api\Model\WhatsAppText', 'image' => '\Messente\Api\Model\WhatsAppImage', 'document' => '\Messente\Api\Model\WhatsAppDocument', @@ -80,6 +81,7 @@ class WhatsApp implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPIFormats = [ 'sender' => null, 'validity' => null, + 'ttl' => null, 'text' => null, 'image' => null, 'document' => null, @@ -116,6 +118,7 @@ public static function openAPIFormats() protected static $attributeMap = [ 'sender' => 'sender', 'validity' => 'validity', + 'ttl' => 'ttl', 'text' => 'text', 'image' => 'image', 'document' => 'document', @@ -131,6 +134,7 @@ public static function openAPIFormats() protected static $setters = [ 'sender' => 'setSender', 'validity' => 'setValidity', + 'ttl' => 'setTtl', 'text' => 'setText', 'image' => 'setImage', 'document' => 'setDocument', @@ -146,6 +150,7 @@ public static function openAPIFormats() protected static $getters = [ 'sender' => 'getSender', 'validity' => 'getValidity', + 'ttl' => 'getTtl', 'text' => 'getText', 'image' => 'getImage', 'document' => 'getDocument', @@ -225,6 +230,7 @@ public function __construct(array $data = null) { $this->container['sender'] = $data['sender'] ?? null; $this->container['validity'] = $data['validity'] ?? null; + $this->container['ttl'] = $data['ttl'] ?? null; $this->container['text'] = $data['text'] ?? null; $this->container['image'] = $data['image'] ?? null; $this->container['document'] = $data['document'] ?? null; @@ -313,6 +319,30 @@ public function setValidity($validity) return $this; } + /** + * Gets ttl + * + * @return int|null + */ + public function getTtl() + { + return $this->container['ttl']; + } + + /** + * Sets ttl + * + * @param int|null $ttl After how many seconds this channel is considered as failed and the next channel is attempted. Only one of \"ttl\" and \"validity\" can be used. + * + * @return self + */ + public function setTtl($ttl) + { + $this->container['ttl'] = $ttl; + + return $this; + } + /** * Gets text * diff --git a/test/Model/SMSTest.php b/test/Model/SMSTest.php index c8cede3..3ab9316 100644 --- a/test/Model/SMSTest.php +++ b/test/Model/SMSTest.php @@ -107,6 +107,15 @@ public function testPropertyValidity() $this->markTestIncomplete('Not implemented'); } + /** + * Test attribute "ttl" + */ + public function testPropertyTtl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + /** * Test attribute "autoconvert" */ diff --git a/test/Model/ViberTest.php b/test/Model/ViberTest.php index bc8daca..f15e95e 100644 --- a/test/Model/ViberTest.php +++ b/test/Model/ViberTest.php @@ -98,6 +98,15 @@ public function testPropertyValidity() $this->markTestIncomplete('Not implemented'); } + /** + * Test attribute "ttl" + */ + public function testPropertyTtl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + /** * Test attribute "text" */ diff --git a/test/Model/WhatsAppTest.php b/test/Model/WhatsAppTest.php index 462de55..115ec5c 100644 --- a/test/Model/WhatsAppTest.php +++ b/test/Model/WhatsAppTest.php @@ -98,6 +98,15 @@ public function testPropertyValidity() $this->markTestIncomplete('Not implemented'); } + /** + * Test attribute "ttl" + */ + public function testPropertyTtl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + /** * Test attribute "text" */ From efaf2c9baeb390557722b24474ab441078287beb Mon Sep 17 00:00:00 2001 From: api-librarian Date: Thu, 19 Jan 2023 13:37:07 +0000 Subject: [PATCH 8/8] Travis update: Jan 2023 (Build 711) [skip ci] --- README.md | 2 +- composer.json | 2 +- lib/Configuration.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b8b1fcc..0b37567 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Messente API Library - Messente API version: 2.0.0 -- PHP artifact version: 2.0.0 +- PHP artifact version: 2.0.1 [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. 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 78b3564..727861b 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "messente/messente-api-php", - "version": "2.0.0", + "version": "2.0.1", "description": "[Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world.", "keywords": ["viber", "telegram", "sms", "whatsapp", "phonebook", "openapitools", "openapi-generator", diff --git a/lib/Configuration.php b/lib/Configuration.php index c7afb2d..e8324a5 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -91,7 +91,7 @@ class Configuration * * @var string */ - protected $userAgent = 'OpenAPI-Generator/2.0.0/PHP'; + protected $userAgent = 'OpenAPI-Generator/2.0.1/PHP'; /** * Debug switch (default set to false) @@ -400,7 +400,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: 2.0.0' . PHP_EOL; - $report .= ' SDK Package Version: 2.0.0' . PHP_EOL; + $report .= ' SDK Package Version: 2.0.1' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report;