Skip to content

Commit

Permalink
1.0.4 (#6)
Browse files Browse the repository at this point in the history
Fix nullable problems
  • Loading branch information
Erik Räni authored Jul 29, 2019
1 parent f9987c2 commit 01d7874
Show file tree
Hide file tree
Showing 48 changed files with 2,960 additions and 139 deletions.
2 changes: 1 addition & 1 deletion .openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0.0
4.0.3
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Messente API Library

- Messente API version: 1.0.2
- PHP artifact version: 1.0.3
- PHP artifact version: 1.0.4

[Messente](https://messente.com) is a global provider of messaging and user verification services. Use Messente API library to send and receive SMS, Viber and WhatsApp messages, blacklist phone numbers to make sure you're not sending any unwanted messages, manage contacts and groups. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world.

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "messente/messente-api-php",
"version": "1.0.3",
"version": "1.0.4",
"description": "[Messente](https://messente.com) is a global provider of messaging and user verification services. Use Messente API library to send and receive SMS, Viber and WhatsApp messages, blacklist phone numbers to make sure you're not sending any unwanted messages, manage contacts and groups. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world.",
"keywords": ["viber", "sms", "whatsapp", "phonebook", "openapitools",
"openapi-generator",
Expand Down
2 changes: 1 addition & 1 deletion lib/Api/BlacklistApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* The version of the OpenAPI document: 1.0.2
* Contact: [email protected]
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 4.0.0
* OpenAPI Generator version: 4.0.3
*/

/**
Expand Down
3 changes: 1 addition & 2 deletions lib/Api/ContactsApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* The version of the OpenAPI document: 1.0.2
* Contact: [email protected]
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 4.0.0
* OpenAPI Generator version: 4.0.3
*/

/**
Expand Down Expand Up @@ -2048,7 +2048,6 @@ protected function fetchContactsRequest($groupIds = null)
// query params
$queryParams['groupIds'] = $groupIds;


// body params
$_tempBody = null;

Expand Down
2 changes: 1 addition & 1 deletion lib/Api/DeliveryReportApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* The version of the OpenAPI document: 1.0.2
* Contact: [email protected]
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 4.0.0
* OpenAPI Generator version: 4.0.3
*/

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/Api/GroupsApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* The version of the OpenAPI document: 1.0.2
* Contact: [email protected]
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 4.0.0
* OpenAPI Generator version: 4.0.3
*/

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/Api/OmnimessageApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* The version of the OpenAPI document: 1.0.2
* Contact: [email protected]
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 4.0.0
* OpenAPI Generator version: 4.0.3
*/

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/ApiException.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* The version of the OpenAPI document: 1.0.2
* Contact: [email protected]
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 4.0.0
* OpenAPI Generator version: 4.0.3
*/

/**
Expand Down
6 changes: 3 additions & 3 deletions lib/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* The version of the OpenAPI document: 1.0.2
* Contact: [email protected]
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 4.0.0
* OpenAPI Generator version: 4.0.3
*/

/**
Expand Down Expand Up @@ -88,7 +88,7 @@ class Configuration
*
* @var string
*/
protected $userAgent = 'OpenAPI-Generator/1.0.3/PHP';
protected $userAgent = 'OpenAPI-Generator/1.0.4/PHP';

/**
* Debug switch (default set to false)
Expand Down Expand Up @@ -397,7 +397,7 @@ public static function toDebugReport()
$report .= ' OS: ' . php_uname() . PHP_EOL;
$report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL;
$report .= ' The version of the OpenAPI document: 1.0.2' . PHP_EOL;
$report .= ' SDK Package Version: 1.0.3' . PHP_EOL;
$report .= ' SDK Package Version: 1.0.4' . PHP_EOL;
$report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL;

return $report;
Expand Down
2 changes: 1 addition & 1 deletion lib/HeaderSelector.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* The version of the OpenAPI document: 1.0.2
* Contact: [email protected]
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 4.0.0
* OpenAPI Generator version: 4.0.3
*/

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/Model/Channel.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* The version of the OpenAPI document: 1.0.2
* Contact: [email protected]
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 4.0.0
* OpenAPI Generator version: 4.0.3
*/

/**
Expand Down
91 changes: 89 additions & 2 deletions lib/Model/ContactEnvelope.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* The version of the OpenAPI document: 1.0.2
* Contact: [email protected]
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 4.0.0
* OpenAPI Generator version: 4.0.3
*/

/**
Expand Down Expand Up @@ -70,6 +70,22 @@ class ContactEnvelope implements ModelInterface, ArrayAccess
'contact' => null
];

/**
* Array of nullable properties. Used for (de)serialization
*
* @var boolean[]
*/
protected static $openAPINullables = [
'contact' => false
];

/**
* If a nullable field gets set to null, insert it here
*
* @var boolean[]
*/
protected $openAPINullablesSetToNull = [];

/**
* Array of property to type mappings. Used for (de)serialization
*
Expand All @@ -90,6 +106,60 @@ public static function openAPIFormats()
return self::$openAPIFormats;
}

/**
* Array of property to nullable mappings. Used for (de)serialization
*
* @return array
*/
public static function openAPINullables()
{
return self::$openAPINullables;
}

/**
* Array of nullable field names deliberately set to null
*
* @return array
*/
public function getOpenAPINullablesSetToNull()
{
return $this->openAPINullablesSetToNull;
}

public function setOpenAPINullablesSetToNull($nullablesSetToNull)
{
$this->openAPINullablesSetToNull=$nullablesSetToNull;

return $this;
}

/**
* Checks if a property is nullable
*
* @return bool
*/
public static function isNullable(string $property): bool
{
if (isset(self::$openAPINullables[$property])) {
return self::$openAPINullables[$property];
}

return false;
}

/**
* Checks if a nullable property is set to null.
*
* @return bool
*/
public function isNullableSetToNull(string $property): bool
{
if (in_array($property, $this->getOpenAPINullablesSetToNull())) {
return true;
}
return false;
}

/**
* Array of attributes where the key is the local name,
* and the value is the original name
Expand Down Expand Up @@ -178,7 +248,18 @@ public function getModelName()
*/
public function __construct(array $data = null)
{
$this->container['contact'] = isset($data['contact']) ? $data['contact'] : null;
$this->setIfExists('contact', $data, null);
}

public function setIfExists(string $variableName, $fields, $defaultValue)
{
if (is_array($fields) && array_key_exists($variableName, $fields) && is_null($fields[$variableName]) && self::isNullable($variableName)) {
array_push($this->openAPINullablesSetToNull, $variableName);
}

$this->container[$variableName] = isset($fields[$variableName]) ? $fields[$variableName] : $defaultValue;

return $this;
}

/**
Expand Down Expand Up @@ -224,6 +305,12 @@ public function getContact()
*/
public function setContact($contact)
{


if (is_null($contact)) {
throw new \InvalidArgumentException('non-nullable contact cannot be null');
}

$this->container['contact'] = $contact;

return $this;
Expand Down
Loading

0 comments on commit 01d7874

Please sign in to comment.