From 614e98a404e1a3cc3de5256dcc0f64334bb9c985 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arne=20J=C3=B8rgensen?= Date: Mon, 13 Jun 2016 23:22:31 +0200 Subject: [PATCH] [PHP] Regenerate petstore sample --- .../petstore/php/SwaggerClient-php/README.md | 3 +- .../docs/Model/AdditionalPropertiesClass.md | 2 + .../SwaggerClient-php/docs/Model/ArrayTest.md | 3 + ...dPropertiesAndAdditionalPropertiesClass.md | 1 + .../php/SwaggerClient-php/lib/Api/FakeApi.php | 1 + .../php/SwaggerClient-php/lib/Api/PetApi.php | 16 +--- .../SwaggerClient-php/lib/Api/StoreApi.php | 10 +-- .../php/SwaggerClient-php/lib/Api/UserApi.php | 12 +-- .../SwaggerClient-php/lib/Configuration.php | 13 ++- .../lib/Model/AdditionalPropertiesClass.php | 56 ++++++++++++- .../SwaggerClient-php/lib/Model/ArrayTest.php | 82 ++++++++++++++++++- ...PropertiesAndAdditionalPropertiesClass.php | 34 +++++++- 12 files changed, 185 insertions(+), 48 deletions(-) diff --git a/samples/client/petstore/php/SwaggerClient-php/README.md b/samples/client/petstore/php/SwaggerClient-php/README.md index 8d69c7da9e4..4a5af697efb 100644 --- a/samples/client/petstore/php/SwaggerClient-php/README.md +++ b/samples/client/petstore/php/SwaggerClient-php/README.md @@ -4,8 +4,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, mod This PHP package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - API version: 1.0.0 -- Package version: -- Build date: 2016-05-25T22:55:19.912+02:00 +- Build date: 2016-06-13T23:22:10.454+02:00 - Build package: class io.swagger.codegen.languages.PhpClientCodegen ## Requirements diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/Model/AdditionalPropertiesClass.md b/samples/client/petstore/php/SwaggerClient-php/docs/Model/AdditionalPropertiesClass.md index 420ac6efe67..b162fe9595f 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/Model/AdditionalPropertiesClass.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Model/AdditionalPropertiesClass.md @@ -3,6 +3,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**map_property** | **map[string,string]** | | [optional] +**map_of_map_property** | [**map[string,map[string,string]]**](map.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/samples/client/petstore/php/SwaggerClient-php/docs/Model/ArrayTest.md b/samples/client/petstore/php/SwaggerClient-php/docs/Model/ArrayTest.md index 9dcc2c97264..f982dc2e4c7 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/Model/ArrayTest.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Model/ArrayTest.md @@ -3,6 +3,9 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**array_of_string** | **string[]** | | [optional] +**array_array_of_integer** | [**int[][]**](array.md) | | [optional] +**array_array_of_model** | [**\Swagger\Client\Model\ReadOnlyFirst[][]**](array.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/samples/client/petstore/php/SwaggerClient-php/docs/Model/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/php/SwaggerClient-php/docs/Model/MixedPropertiesAndAdditionalPropertiesClass.md index c05cee84500..1e3c4f7bfe1 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/Model/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Model/MixedPropertiesAndAdditionalPropertiesClass.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **uuid** | **string** | | [optional] **date_time** | [**\DateTime**](\DateTime.md) | | [optional] +**map** | [**map[string,\Swagger\Client\Model\Animal]**](Animal.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/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php index d68bf418a00..b916802b2ea 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php @@ -289,6 +289,7 @@ class FakeApi $httpBody, $headerParams ); + return array(null, $statusCode, $httpHeader); } catch (ApiException $e) { switch ($e->getCode()) { diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php index 9cca7063a53..f601a6c9aaa 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php @@ -182,6 +182,7 @@ class PetApi $httpBody, $headerParams ); + return array(null, $statusCode, $httpHeader); } catch (ApiException $e) { switch ($e->getCode()) { @@ -278,6 +279,7 @@ class PetApi $httpBody, $headerParams ); + return array(null, $statusCode, $httpHeader); } catch (ApiException $e) { switch ($e->getCode()) { @@ -369,9 +371,6 @@ class PetApi $headerParams, '\Swagger\Client\Model\Pet[]' ); - if (!$response) { - return array(null, $statusCode, $httpHeader); - } return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\Pet[]', $httpHeader), $statusCode, $httpHeader); } catch (ApiException $e) { @@ -468,9 +467,6 @@ class PetApi $headerParams, '\Swagger\Client\Model\Pet[]' ); - if (!$response) { - return array(null, $statusCode, $httpHeader); - } return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\Pet[]', $httpHeader), $statusCode, $httpHeader); } catch (ApiException $e) { @@ -570,9 +566,6 @@ class PetApi $headerParams, '\Swagger\Client\Model\Pet' ); - if (!$response) { - return array(null, $statusCode, $httpHeader); - } return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\Pet', $httpHeader), $statusCode, $httpHeader); } catch (ApiException $e) { @@ -666,6 +659,7 @@ class PetApi $httpBody, $headerParams ); + return array(null, $statusCode, $httpHeader); } catch (ApiException $e) { switch ($e->getCode()) { @@ -767,6 +761,7 @@ class PetApi $httpBody, $headerParams ); + return array(null, $statusCode, $httpHeader); } catch (ApiException $e) { switch ($e->getCode()) { @@ -875,9 +870,6 @@ class PetApi $headerParams, '\Swagger\Client\Model\ApiResponse' ); - if (!$response) { - return array(null, $statusCode, $httpHeader); - } return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\ApiResponse', $httpHeader), $statusCode, $httpHeader); } catch (ApiException $e) { diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php index d19ddb6f8c5..a04cbec2276 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php @@ -184,6 +184,7 @@ class StoreApi $httpBody, $headerParams ); + return array(null, $statusCode, $httpHeader); } catch (ApiException $e) { switch ($e->getCode()) { @@ -264,9 +265,6 @@ class StoreApi $headerParams, 'map[string,int]' ); - if (!$response) { - return array(null, $statusCode, $httpHeader); - } return array($this->apiClient->getSerializer()->deserialize($response, 'map[string,int]', $httpHeader), $statusCode, $httpHeader); } catch (ApiException $e) { @@ -366,9 +364,6 @@ class StoreApi $headerParams, '\Swagger\Client\Model\Order' ); - if (!$response) { - return array(null, $statusCode, $httpHeader); - } return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\Order', $httpHeader), $statusCode, $httpHeader); } catch (ApiException $e) { @@ -458,9 +453,6 @@ class StoreApi $headerParams, '\Swagger\Client\Model\Order' ); - if (!$response) { - return array(null, $statusCode, $httpHeader); - } return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\Order', $httpHeader), $statusCode, $httpHeader); } catch (ApiException $e) { diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php index d735c083522..6e5a4cfcddd 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php @@ -177,6 +177,7 @@ class UserApi $httpBody, $headerParams ); + return array(null, $statusCode, $httpHeader); } catch (ApiException $e) { switch ($e->getCode()) { @@ -260,6 +261,7 @@ class UserApi $httpBody, $headerParams ); + return array(null, $statusCode, $httpHeader); } catch (ApiException $e) { switch ($e->getCode()) { @@ -343,6 +345,7 @@ class UserApi $httpBody, $headerParams ); + return array(null, $statusCode, $httpHeader); } catch (ApiException $e) { switch ($e->getCode()) { @@ -429,6 +432,7 @@ class UserApi $httpBody, $headerParams ); + return array(null, $statusCode, $httpHeader); } catch (ApiException $e) { switch ($e->getCode()) { @@ -516,9 +520,6 @@ class UserApi $headerParams, '\Swagger\Client\Model\User' ); - if (!$response) { - return array(null, $statusCode, $httpHeader); - } return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\User', $httpHeader), $statusCode, $httpHeader); } catch (ApiException $e) { @@ -617,9 +618,6 @@ class UserApi $headerParams, 'string' ); - if (!$response) { - return array(null, $statusCode, $httpHeader); - } return array($this->apiClient->getSerializer()->deserialize($response, 'string', $httpHeader), $statusCode, $httpHeader); } catch (ApiException $e) { @@ -697,6 +695,7 @@ class UserApi $httpBody, $headerParams ); + return array(null, $statusCode, $httpHeader); } catch (ApiException $e) { switch ($e->getCode()) { @@ -794,6 +793,7 @@ class UserApi $httpBody, $headerParams ); + return array(null, $statusCode, $httpHeader); } catch (ApiException $e) { switch ($e->getCode()) { diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Configuration.php b/samples/client/petstore/php/SwaggerClient-php/lib/Configuration.php index 30b1b6c2dff..98bb4ab2c17 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Configuration.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Configuration.php @@ -116,7 +116,7 @@ class Configuration * * @var string */ - protected $userAgent = "Swagger-Codegen//php"; + protected $userAgent = "Swagger-Codegen/1.0.0/php"; /** * Debug switch (default set to false) @@ -519,12 +519,11 @@ class Configuration */ public static function toDebugReport() { - $report = "PHP SDK (Swagger\Client) Debug Report:".PHP_EOL; - $report .= " OS: ".php_uname().PHP_EOL; - $report .= " PHP Version: ".phpversion().PHP_EOL; - $report .= " OpenAPI Spec Version: 1.0.0".PHP_EOL; - $report .= " SDK Package Version: ".PHP_EOL; - $report .= " Temp Folder Path: ".self::getDefaultConfiguration()->getTempFolderPath().PHP_EOL; + $report = 'PHP SDK (Swagger\Client) Debug Report:' . PHP_EOL; + $report .= ' OS: ' . php_uname() . PHP_EOL; + $report .= ' PHP Version: ' . phpversion() . PHP_EOL; + $report .= ' OpenAPI Spec Version: 1.0.0' . PHP_EOL; + $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; } diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/AdditionalPropertiesClass.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/AdditionalPropertiesClass.php index 4b5703134c1..9b77e2bf1ca 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/AdditionalPropertiesClass.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/AdditionalPropertiesClass.php @@ -65,7 +65,8 @@ class AdditionalPropertiesClass implements ArrayAccess * @var string[] */ protected static $swaggerTypes = array( - + 'map_property' => 'map[string,string]', + 'map_of_map_property' => 'map[string,map[string,string]]' ); public static function swaggerTypes() @@ -78,7 +79,8 @@ class AdditionalPropertiesClass implements ArrayAccess * @var string[] */ protected static $attributeMap = array( - + 'map_property' => 'map_property', + 'map_of_map_property' => 'map_of_map_property' ); public static function attributeMap() @@ -91,7 +93,8 @@ class AdditionalPropertiesClass implements ArrayAccess * @var string[] */ protected static $setters = array( - + 'map_property' => 'setMapProperty', + 'map_of_map_property' => 'setMapOfMapProperty' ); public static function setters() @@ -104,7 +107,8 @@ class AdditionalPropertiesClass implements ArrayAccess * @var string[] */ protected static $getters = array( - + 'map_property' => 'getMapProperty', + 'map_of_map_property' => 'getMapOfMapProperty' ); public static function getters() @@ -128,6 +132,8 @@ class AdditionalPropertiesClass implements ArrayAccess */ public function __construct(array $data = null) { + $this->container['map_property'] = isset($data['map_property']) ? $data['map_property'] : null; + $this->container['map_of_map_property'] = isset($data['map_of_map_property']) ? $data['map_of_map_property'] : null; } /** @@ -152,6 +158,48 @@ class AdditionalPropertiesClass implements ArrayAccess return true; } + + /** + * Gets map_property + * @return map[string,string] + */ + public function getMapProperty() + { + return $this->container['map_property']; + } + + /** + * Sets map_property + * @param map[string,string] $map_property + * @return $this + */ + public function setMapProperty($map_property) + { + $this->container['map_property'] = $map_property; + + return $this; + } + + /** + * Gets map_of_map_property + * @return map[string,map[string,string]] + */ + public function getMapOfMapProperty() + { + return $this->container['map_of_map_property']; + } + + /** + * Sets map_of_map_property + * @param map[string,map[string,string]] $map_of_map_property + * @return $this + */ + public function setMapOfMapProperty($map_of_map_property) + { + $this->container['map_of_map_property'] = $map_of_map_property; + + return $this; + } /** * Returns true if offset exists. False otherwise. * @param integer $offset Offset diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayTest.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayTest.php index 44af1286a6d..e1a4ea91179 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayTest.php @@ -65,7 +65,9 @@ class ArrayTest implements ArrayAccess * @var string[] */ protected static $swaggerTypes = array( - + 'array_of_string' => 'string[]', + 'array_array_of_integer' => 'int[][]', + 'array_array_of_model' => '\Swagger\Client\Model\ReadOnlyFirst[][]' ); public static function swaggerTypes() @@ -78,7 +80,9 @@ class ArrayTest implements ArrayAccess * @var string[] */ protected static $attributeMap = array( - + 'array_of_string' => 'array_of_string', + 'array_array_of_integer' => 'array_array_of_integer', + 'array_array_of_model' => 'array_array_of_model' ); public static function attributeMap() @@ -91,7 +95,9 @@ class ArrayTest implements ArrayAccess * @var string[] */ protected static $setters = array( - + 'array_of_string' => 'setArrayOfString', + 'array_array_of_integer' => 'setArrayArrayOfInteger', + 'array_array_of_model' => 'setArrayArrayOfModel' ); public static function setters() @@ -104,7 +110,9 @@ class ArrayTest implements ArrayAccess * @var string[] */ protected static $getters = array( - + 'array_of_string' => 'getArrayOfString', + 'array_array_of_integer' => 'getArrayArrayOfInteger', + 'array_array_of_model' => 'getArrayArrayOfModel' ); public static function getters() @@ -128,6 +136,9 @@ class ArrayTest implements ArrayAccess */ public function __construct(array $data = null) { + $this->container['array_of_string'] = isset($data['array_of_string']) ? $data['array_of_string'] : null; + $this->container['array_array_of_integer'] = isset($data['array_array_of_integer']) ? $data['array_array_of_integer'] : null; + $this->container['array_array_of_model'] = isset($data['array_array_of_model']) ? $data['array_array_of_model'] : null; } /** @@ -152,6 +163,69 @@ class ArrayTest implements ArrayAccess return true; } + + /** + * Gets array_of_string + * @return string[] + */ + public function getArrayOfString() + { + return $this->container['array_of_string']; + } + + /** + * Sets array_of_string + * @param string[] $array_of_string + * @return $this + */ + public function setArrayOfString($array_of_string) + { + $this->container['array_of_string'] = $array_of_string; + + return $this; + } + + /** + * Gets array_array_of_integer + * @return int[][] + */ + public function getArrayArrayOfInteger() + { + return $this->container['array_array_of_integer']; + } + + /** + * Sets array_array_of_integer + * @param int[][] $array_array_of_integer + * @return $this + */ + public function setArrayArrayOfInteger($array_array_of_integer) + { + $this->container['array_array_of_integer'] = $array_array_of_integer; + + return $this; + } + + /** + * Gets array_array_of_model + * @return \Swagger\Client\Model\ReadOnlyFirst[][] + */ + public function getArrayArrayOfModel() + { + return $this->container['array_array_of_model']; + } + + /** + * Sets array_array_of_model + * @param \Swagger\Client\Model\ReadOnlyFirst[][] $array_array_of_model + * @return $this + */ + public function setArrayArrayOfModel($array_array_of_model) + { + $this->container['array_array_of_model'] = $array_array_of_model; + + return $this; + } /** * Returns true if offset exists. False otherwise. * @param integer $offset Offset diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php index fd397440cfc..c7ec6100988 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php @@ -66,7 +66,8 @@ class MixedPropertiesAndAdditionalPropertiesClass implements ArrayAccess */ protected static $swaggerTypes = array( 'uuid' => 'string', - 'date_time' => '\DateTime' + 'date_time' => '\DateTime', + 'map' => 'map[string,\Swagger\Client\Model\Animal]' ); public static function swaggerTypes() @@ -80,7 +81,8 @@ class MixedPropertiesAndAdditionalPropertiesClass implements ArrayAccess */ protected static $attributeMap = array( 'uuid' => 'uuid', - 'date_time' => 'dateTime' + 'date_time' => 'dateTime', + 'map' => 'map' ); public static function attributeMap() @@ -94,7 +96,8 @@ class MixedPropertiesAndAdditionalPropertiesClass implements ArrayAccess */ protected static $setters = array( 'uuid' => 'setUuid', - 'date_time' => 'setDateTime' + 'date_time' => 'setDateTime', + 'map' => 'setMap' ); public static function setters() @@ -108,7 +111,8 @@ class MixedPropertiesAndAdditionalPropertiesClass implements ArrayAccess */ protected static $getters = array( 'uuid' => 'getUuid', - 'date_time' => 'getDateTime' + 'date_time' => 'getDateTime', + 'map' => 'getMap' ); public static function getters() @@ -134,6 +138,7 @@ class MixedPropertiesAndAdditionalPropertiesClass implements ArrayAccess { $this->container['uuid'] = isset($data['uuid']) ? $data['uuid'] : null; $this->container['date_time'] = isset($data['date_time']) ? $data['date_time'] : null; + $this->container['map'] = isset($data['map']) ? $data['map'] : null; } /** @@ -200,6 +205,27 @@ class MixedPropertiesAndAdditionalPropertiesClass implements ArrayAccess return $this; } + + /** + * Gets map + * @return map[string,\Swagger\Client\Model\Animal] + */ + public function getMap() + { + return $this->container['map']; + } + + /** + * Sets map + * @param map[string,\Swagger\Client\Model\Animal] $map + * @return $this + */ + public function setMap($map) + { + $this->container['map'] = $map; + + return $this; + } /** * Returns true if offset exists. False otherwise. * @param integer $offset Offset