From 0b7d0c34afdede302e2490f8c96cc8d08a5d99d5 Mon Sep 17 00:00:00 2001 From: wing328 Date: Sat, 14 May 2016 17:11:48 +0800 Subject: [PATCH] add debug switch to print out downloaded file info --- .../resources/php/ObjectSerializer.mustache | 6 +- .../petstore/php/SwaggerClient-php/README.md | 86 ++++----- .../php/SwaggerClient-php/autoload.php | 7 +- .../php/SwaggerClient-php/composer.json | 1 - .../php/SwaggerClient-php/docs/Api/FakeApi.md | 6 +- .../php/SwaggerClient-php/docs/Api/PetApi.md | 80 ++++----- .../SwaggerClient-php/docs/Api/StoreApi.md | 34 ++-- .../php/SwaggerClient-php/docs/Api/UserApi.md | 58 +++---- .../php/SwaggerClient-php/git_push.sh | 2 +- .../php/SwaggerClient-php/lib/Api/FakeApi.php | 37 ++-- .../php/SwaggerClient-php/lib/Api/PetApi.php | 163 ++++++++++-------- .../SwaggerClient-php/lib/Api/StoreApi.php | 91 +++++----- .../php/SwaggerClient-php/lib/Api/UserApi.php | 163 ++++++++++-------- .../php/SwaggerClient-php/lib/ApiClient.php | 29 ++-- .../SwaggerClient-php/lib/ApiException.php | 6 + .../SwaggerClient-php/lib/Configuration.php | 4 +- .../lib/Model/AnimalFarm.php | 2 +- .../SwaggerClient-php/lib/Model/EnumClass.php | 2 +- .../SwaggerClient-php/lib/Model/EnumTest.php | 17 +- .../lib/Model/FormatTest.php | 6 +- .../php/SwaggerClient-php/lib/Model/Order.php | 7 +- .../php/SwaggerClient-php/lib/Model/Pet.php | 7 +- .../lib/ObjectSerializer.php | 18 +- 23 files changed, 468 insertions(+), 364 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/php/ObjectSerializer.mustache b/modules/swagger-codegen/src/main/resources/php/ObjectSerializer.mustache index 46f457fca32..62a128cbb36 100644 --- a/modules/swagger-codegen/src/main/resources/php/ObjectSerializer.mustache +++ b/modules/swagger-codegen/src/main/resources/php/ObjectSerializer.mustache @@ -268,7 +268,11 @@ class ObjectSerializer } $deserialized = new \SplFileObject($filename, "w"); $byte_written = $deserialized->fwrite($data); - error_log("[INFO] Written $byte_written byte to $filename. Please move the file to a proper folder or delete the temp file after processing.\n", 3, Configuration::getDefaultConfiguration()->getDebugFile()); + + if (Configuration::getDefaultConfiguration()->getDebug()) { + error_log("[DEBUG] Written $byte_written byte to $filename. Please move the file to a proper folder or delete the temp file after processing.\n", 3, Configuration::getDefaultConfiguration()->getDebugFile()); + } + return $deserialized; } else { diff --git a/samples/client/petstore/php/SwaggerClient-php/README.md b/samples/client/petstore/php/SwaggerClient-php/README.md index fe09a19fa93..6385bef4e6b 100644 --- a/samples/client/petstore/php/SwaggerClient-php/README.md +++ b/samples/client/petstore/php/SwaggerClient-php/README.md @@ -1,11 +1,11 @@ # SwaggerClient-php -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ 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: 1.0.0 -- Build date: 2016-05-10T22:37:00.768+08:00 +- Package version: +- Build date: 2016-05-14T17:06:01.056+08:00 - Build package: class io.swagger.codegen.languages.PhpClientCodegen ## Requirements @@ -41,7 +41,7 @@ Download the files and include `autoload.php`: require_once('/path/to/SwaggerClient-php/autoload.php'); ``` -## Tests +## Tests To run the unit tests: @@ -87,48 +87,48 @@ All URIs are relative to *http://petstore.swagger.io/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*FakeApi* | [**testEndpointParameters**](docs/ApiFakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -*PetApi* | [**addPet**](docs/ApiPetApi.md#addpet) | **POST** /pet | Add a new pet to the store -*PetApi* | [**deletePet**](docs/ApiPetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -*PetApi* | [**findPetsByStatus**](docs/ApiPetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -*PetApi* | [**findPetsByTags**](docs/ApiPetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -*PetApi* | [**getPetById**](docs/ApiPetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -*PetApi* | [**updatePet**](docs/ApiPetApi.md#updatepet) | **PUT** /pet | Update an existing pet -*PetApi* | [**updatePetWithForm**](docs/ApiPetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -*PetApi* | [**uploadFile**](docs/ApiPetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -*StoreApi* | [**deleteOrder**](docs/ApiStoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID -*StoreApi* | [**getInventory**](docs/ApiStoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**getOrderById**](docs/ApiStoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID -*StoreApi* | [**placeOrder**](docs/ApiStoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet -*UserApi* | [**createUser**](docs/ApiUserApi.md#createuser) | **POST** /user | Create user -*UserApi* | [**createUsersWithArrayInput**](docs/ApiUserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array -*UserApi* | [**createUsersWithListInput**](docs/ApiUserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -*UserApi* | [**deleteUser**](docs/ApiUserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user -*UserApi* | [**getUserByName**](docs/ApiUserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name -*UserApi* | [**loginUser**](docs/ApiUserApi.md#loginuser) | **GET** /user/login | Logs user into the system -*UserApi* | [**logoutUser**](docs/ApiUserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -*UserApi* | [**updateUser**](docs/ApiUserApi.md#updateuser) | **PUT** /user/{username} | Updated user +*FakeApi* | [**testEndpointParameters**](docs/Api/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*PetApi* | [**addPet**](docs/Api/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](docs/Api/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByStatus**](docs/Api/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](docs/Api/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](docs/Api/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**updatePet**](docs/Api/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](docs/Api/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](docs/Api/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**deleteOrder**](docs/Api/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**getInventory**](docs/Api/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](docs/Api/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**placeOrder**](docs/Api/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +*UserApi* | [**createUser**](docs/Api/UserApi.md#createuser) | **POST** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](docs/Api/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](docs/Api/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](docs/Api/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**getUserByName**](docs/Api/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](docs/Api/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](docs/Api/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](docs/Api/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user ## Documentation For Models - - [Animal](docs/ModelAnimal.md) - - [AnimalFarm](docs/ModelAnimalFarm.md) - - [ApiResponse](docs/ModelApiResponse.md) - - [Cat](docs/ModelCat.md) - - [Category](docs/ModelCategory.md) - - [Dog](docs/ModelDog.md) - - [EnumClass](docs/ModelEnumClass.md) - - [EnumTest](docs/ModelEnumTest.md) - - [FormatTest](docs/ModelFormatTest.md) - - [Model200Response](docs/ModelModel200Response.md) - - [ModelReturn](docs/ModelModelReturn.md) - - [Name](docs/ModelName.md) - - [Order](docs/ModelOrder.md) - - [Pet](docs/ModelPet.md) - - [SpecialModelName](docs/ModelSpecialModelName.md) - - [Tag](docs/ModelTag.md) - - [User](docs/ModelUser.md) + - [Animal](docs/Model/Animal.md) + - [AnimalFarm](docs/Model/AnimalFarm.md) + - [ApiResponse](docs/Model/ApiResponse.md) + - [Cat](docs/Model/Cat.md) + - [Category](docs/Model/Category.md) + - [Dog](docs/Model/Dog.md) + - [EnumClass](docs/Model/EnumClass.md) + - [EnumTest](docs/Model/EnumTest.md) + - [FormatTest](docs/Model/FormatTest.md) + - [Model200Response](docs/Model/Model200Response.md) + - [ModelReturn](docs/Model/ModelReturn.md) + - [Name](docs/Model/Name.md) + - [Order](docs/Model/Order.md) + - [Pet](docs/Model/Pet.md) + - [SpecialModelName](docs/Model/SpecialModelName.md) + - [Tag](docs/Model/Tag.md) + - [User](docs/Model/User.md) ## Documentation For Authorization @@ -136,7 +136,7 @@ Class | Method | HTTP request | Description ## api_key -- **Type**: API key +- **Type**: API key - **API key parameter name**: api_key - **Location**: HTTP header diff --git a/samples/client/petstore/php/SwaggerClient-php/autoload.php b/samples/client/petstore/php/SwaggerClient-php/autoload.php index acbd3968b23..3cbe3df8a21 100644 --- a/samples/client/petstore/php/SwaggerClient-php/autoload.php +++ b/samples/client/petstore/php/SwaggerClient-php/autoload.php @@ -1,14 +1,15 @@ testEndpointParameters($number, $double, $string, $byte, $integer, $int32, $int64, $float, $binary, $date, $date_time, $password); } catch (Exception $e) { echo 'Exception when calling FakeApi->testEndpointParameters: ', $e->getMessage(), "\n"; @@ -71,5 +71,5 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, 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 README]](../README.md) +[[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/samples/client/petstore/php/SwaggerClient-php/docs/Api/PetApi.md b/samples/client/petstore/php/SwaggerClient-php/docs/Api/PetApi.md index bf119270a58..6ab902730c7 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/Api/PetApi.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Api/PetApi.md @@ -21,7 +21,7 @@ Add a new pet to the store -### Example +### Example ```php setAccessToken('YOUR_AC $api_instance = new Swagger\Client\Api\PetApi(); $body = new \Swagger\Client\Model\Pet(); // \Swagger\Client\Model\Pet | Pet object that needs to be added to the store -try { +try { $api_instance->addPet($body); } catch (Exception $e) { echo 'Exception when calling PetApi->addPet: ', $e->getMessage(), "\n"; @@ -44,7 +44,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**\Swagger\Client\Model\Pet**](\Swagger\Client\Model\Pet.md)| Pet object that needs to be added to the store | + **body** | [**\Swagger\Client\Model\Pet**](../Model/\Swagger\Client\Model\Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -52,14 +52,14 @@ void (empty response body) ### Authorization -[petstore_auth](../README.md#petstore_auth) +[petstore_auth](../../README.md#petstore_auth) ### HTTP request headers - **Content-Type**: application/json, application/xml - **Accept**: application/xml, 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 README]](../README.md) +[[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) # **deletePet** > deletePet($pet_id, $api_key) @@ -68,7 +68,7 @@ Deletes a pet -### Example +### Example ```php deletePet($pet_id, $api_key); } catch (Exception $e) { echo 'Exception when calling PetApi->deletePet: ', $e->getMessage(), "\n"; @@ -101,14 +101,14 @@ void (empty response body) ### Authorization -[petstore_auth](../README.md#petstore_auth) +[petstore_auth](../../README.md#petstore_auth) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/xml, 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 README]](../README.md) +[[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) # **findPetsByStatus** > \Swagger\Client\Model\Pet[] findPetsByStatus($status) @@ -117,7 +117,7 @@ Finds Pets by status Multiple status values can be provided with comma separated strings -### Example +### Example ```php setAccessToken('YOUR_AC $api_instance = new Swagger\Client\Api\PetApi(); $status = array("status_example"); // string[] | Status values that need to be considered for filter -try { +try { $result = $api_instance->findPetsByStatus($status); print_r($result); } catch (Exception $e) { @@ -141,22 +141,22 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | [**string[]**](string.md)| Status values that need to be considered for filter | + **status** | [**string[]**](../Model/string.md)| Status values that need to be considered for filter | ### Return type -[**\Swagger\Client\Model\Pet[]**](Pet.md) +[**\Swagger\Client\Model\Pet[]**](../Model/Pet.md) ### Authorization -[petstore_auth](../README.md#petstore_auth) +[petstore_auth](../../README.md#petstore_auth) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/xml, 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 README]](../README.md) +[[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) # **findPetsByTags** > \Swagger\Client\Model\Pet[] findPetsByTags($tags) @@ -165,7 +165,7 @@ Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. -### Example +### Example ```php setAccessToken('YOUR_AC $api_instance = new Swagger\Client\Api\PetApi(); $tags = array("tags_example"); // string[] | Tags to filter by -try { +try { $result = $api_instance->findPetsByTags($tags); print_r($result); } catch (Exception $e) { @@ -189,22 +189,22 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**string[]**](string.md)| Tags to filter by | + **tags** | [**string[]**](../Model/string.md)| Tags to filter by | ### Return type -[**\Swagger\Client\Model\Pet[]**](Pet.md) +[**\Swagger\Client\Model\Pet[]**](../Model/Pet.md) ### Authorization -[petstore_auth](../README.md#petstore_auth) +[petstore_auth](../../README.md#petstore_auth) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/xml, 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 README]](../README.md) +[[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) # **getPetById** > \Swagger\Client\Model\Pet getPetById($pet_id) @@ -213,7 +213,7 @@ Find pet by ID Returns a single pet -### Example +### Example ```php setApiKey('api_key', 'Y $api_instance = new Swagger\Client\Api\PetApi(); $pet_id = 789; // int | ID of pet to return -try { +try { $result = $api_instance->getPetById($pet_id); print_r($result); } catch (Exception $e) { @@ -243,18 +243,18 @@ Name | Type | Description | Notes ### Return type -[**\Swagger\Client\Model\Pet**](Pet.md) +[**\Swagger\Client\Model\Pet**](../Model/Pet.md) ### Authorization -[api_key](../README.md#api_key) +[api_key](../../README.md#api_key) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/xml, 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 README]](../README.md) +[[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) # **updatePet** > updatePet($body) @@ -263,7 +263,7 @@ Update an existing pet -### Example +### Example ```php setAccessToken('YOUR_AC $api_instance = new Swagger\Client\Api\PetApi(); $body = new \Swagger\Client\Model\Pet(); // \Swagger\Client\Model\Pet | Pet object that needs to be added to the store -try { +try { $api_instance->updatePet($body); } catch (Exception $e) { echo 'Exception when calling PetApi->updatePet: ', $e->getMessage(), "\n"; @@ -286,7 +286,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**\Swagger\Client\Model\Pet**](\Swagger\Client\Model\Pet.md)| Pet object that needs to be added to the store | + **body** | [**\Swagger\Client\Model\Pet**](../Model/\Swagger\Client\Model\Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -294,14 +294,14 @@ void (empty response body) ### Authorization -[petstore_auth](../README.md#petstore_auth) +[petstore_auth](../../README.md#petstore_auth) ### HTTP request headers - **Content-Type**: application/json, application/xml - **Accept**: application/xml, 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 README]](../README.md) +[[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) # **updatePetWithForm** > updatePetWithForm($pet_id, $name, $status) @@ -310,7 +310,7 @@ Updates a pet in the store with form data -### Example +### Example ```php updatePetWithForm($pet_id, $name, $status); } catch (Exception $e) { echo 'Exception when calling PetApi->updatePetWithForm: ', $e->getMessage(), "\n"; @@ -345,14 +345,14 @@ void (empty response body) ### Authorization -[petstore_auth](../README.md#petstore_auth) +[petstore_auth](../../README.md#petstore_auth) ### HTTP request headers - **Content-Type**: application/x-www-form-urlencoded - **Accept**: application/xml, 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 README]](../README.md) +[[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) # **uploadFile** > \Swagger\Client\Model\ApiResponse uploadFile($pet_id, $additional_metadata, $file) @@ -361,7 +361,7 @@ uploads an image -### Example +### Example ```php uploadFile($pet_id, $additional_metadata, $file); print_r($result); } catch (Exception $e) { @@ -393,16 +393,16 @@ Name | Type | Description | Notes ### Return type -[**\Swagger\Client\Model\ApiResponse**](ApiResponse.md) +[**\Swagger\Client\Model\ApiResponse**](../Model/ApiResponse.md) ### Authorization -[petstore_auth](../README.md#petstore_auth) +[petstore_auth](../../README.md#petstore_auth) ### HTTP request headers - **Content-Type**: multipart/form-data - **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 README]](../README.md) +[[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/samples/client/petstore/php/SwaggerClient-php/docs/Api/StoreApi.md b/samples/client/petstore/php/SwaggerClient-php/docs/Api/StoreApi.md index 7040df371a4..24cacd22b47 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/Api/StoreApi.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Api/StoreApi.md @@ -17,7 +17,7 @@ Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors -### Example +### Example ```php deleteOrder($order_id); } catch (Exception $e) { echo 'Exception when calling StoreApi->deleteOrder: ', $e->getMessage(), "\n"; @@ -52,7 +52,7 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, 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 README]](../README.md) +[[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) # **getInventory** > map[string,int] getInventory() @@ -61,7 +61,7 @@ Returns pet inventories by status Returns a map of status codes to quantities -### Example +### Example ```php setApiKey('api_key', 'Y $api_instance = new Swagger\Client\Api\StoreApi(); -try { +try { $result = $api_instance->getInventory(); print_r($result); } catch (Exception $e) { @@ -87,18 +87,18 @@ This endpoint does not need any parameter. ### Return type -[**map[string,int]**](map.md) +[**map[string,int]**](../Model/map.md) ### Authorization -[api_key](../README.md#api_key) +[api_key](../../README.md#api_key) ### HTTP request headers - **Content-Type**: Not defined - **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 README]](../README.md) +[[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) # **getOrderById** > \Swagger\Client\Model\Order getOrderById($order_id) @@ -107,7 +107,7 @@ Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions -### Example +### Example ```php getOrderById($order_id); print_r($result); } catch (Exception $e) { @@ -132,7 +132,7 @@ Name | Type | Description | Notes ### Return type -[**\Swagger\Client\Model\Order**](Order.md) +[**\Swagger\Client\Model\Order**](../Model/Order.md) ### Authorization @@ -143,7 +143,7 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, 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 README]](../README.md) +[[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) # **placeOrder** > \Swagger\Client\Model\Order placeOrder($body) @@ -152,7 +152,7 @@ Place an order for a pet -### Example +### Example ```php placeOrder($body); print_r($result); } catch (Exception $e) { @@ -173,11 +173,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**\Swagger\Client\Model\Order**](\Swagger\Client\Model\Order.md)| order placed for purchasing the pet | + **body** | [**\Swagger\Client\Model\Order**](../Model/\Swagger\Client\Model\Order.md)| order placed for purchasing the pet | ### Return type -[**\Swagger\Client\Model\Order**](Order.md) +[**\Swagger\Client\Model\Order**](../Model/Order.md) ### Authorization @@ -188,5 +188,5 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, 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 README]](../README.md) +[[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/samples/client/petstore/php/SwaggerClient-php/docs/Api/UserApi.md b/samples/client/petstore/php/SwaggerClient-php/docs/Api/UserApi.md index 7f048a429e3..5737f3cdb5e 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/Api/UserApi.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Api/UserApi.md @@ -21,7 +21,7 @@ Create user This can only be done by the logged in user. -### Example +### Example ```php createUser($body); } catch (Exception $e) { echo 'Exception when calling UserApi->createUser: ', $e->getMessage(), "\n"; @@ -41,7 +41,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**\Swagger\Client\Model\User**](\Swagger\Client\Model\User.md)| Created user object | + **body** | [**\Swagger\Client\Model\User**](../Model/\Swagger\Client\Model\User.md)| Created user object | ### Return type @@ -56,7 +56,7 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, 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 README]](../README.md) +[[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) # **createUsersWithArrayInput** > createUsersWithArrayInput($body) @@ -65,7 +65,7 @@ Creates list of users with given input array -### Example +### Example ```php createUsersWithArrayInput($body); } catch (Exception $e) { echo 'Exception when calling UserApi->createUsersWithArrayInput: ', $e->getMessage(), "\n"; @@ -85,7 +85,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**\Swagger\Client\Model\User[]**](User.md)| List of user object | + **body** | [**\Swagger\Client\Model\User[]**](../Model/User.md)| List of user object | ### Return type @@ -100,7 +100,7 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, 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 README]](../README.md) +[[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) # **createUsersWithListInput** > createUsersWithListInput($body) @@ -109,7 +109,7 @@ Creates list of users with given input array -### Example +### Example ```php createUsersWithListInput($body); } catch (Exception $e) { echo 'Exception when calling UserApi->createUsersWithListInput: ', $e->getMessage(), "\n"; @@ -129,7 +129,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**\Swagger\Client\Model\User[]**](User.md)| List of user object | + **body** | [**\Swagger\Client\Model\User[]**](../Model/User.md)| List of user object | ### Return type @@ -144,7 +144,7 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, 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 README]](../README.md) +[[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) # **deleteUser** > deleteUser($username) @@ -153,7 +153,7 @@ Delete user This can only be done by the logged in user. -### Example +### Example ```php deleteUser($username); } catch (Exception $e) { echo 'Exception when calling UserApi->deleteUser: ', $e->getMessage(), "\n"; @@ -188,7 +188,7 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, 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 README]](../README.md) +[[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) # **getUserByName** > \Swagger\Client\Model\User getUserByName($username) @@ -197,7 +197,7 @@ Get user by user name -### Example +### Example ```php getUserByName($username); print_r($result); } catch (Exception $e) { @@ -222,7 +222,7 @@ Name | Type | Description | Notes ### Return type -[**\Swagger\Client\Model\User**](User.md) +[**\Swagger\Client\Model\User**](../Model/User.md) ### Authorization @@ -233,7 +233,7 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, 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 README]](../README.md) +[[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) # **loginUser** > string loginUser($username, $password) @@ -242,7 +242,7 @@ Logs user into the system -### Example +### Example ```php loginUser($username, $password); print_r($result); } catch (Exception $e) { @@ -280,7 +280,7 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, 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 README]](../README.md) +[[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) # **logoutUser** > logoutUser() @@ -289,14 +289,14 @@ Logs out current logged in user session -### Example +### Example ```php logoutUser(); } catch (Exception $e) { echo 'Exception when calling UserApi->logoutUser: ', $e->getMessage(), "\n"; @@ -320,7 +320,7 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, 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 README]](../README.md) +[[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) # **updateUser** > updateUser($username, $body) @@ -329,7 +329,7 @@ Updated user This can only be done by the logged in user. -### Example +### Example ```php updateUser($username, $body); } catch (Exception $e) { echo 'Exception when calling UserApi->updateUser: ', $e->getMessage(), "\n"; @@ -351,7 +351,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **string**| name that need to be deleted | - **body** | [**\Swagger\Client\Model\User**](\Swagger\Client\Model\User.md)| Updated user object | + **body** | [**\Swagger\Client\Model\User**](../Model/\Swagger\Client\Model\User.md)| Updated user object | ### Return type @@ -366,5 +366,5 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, 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 README]](../README.md) +[[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/samples/client/petstore/php/SwaggerClient-php/git_push.sh b/samples/client/petstore/php/SwaggerClient-php/git_push.sh index ed374619b13..792320114fb 100644 --- a/samples/client/petstore/php/SwaggerClient-php/git_push.sh +++ b/samples/client/petstore/php/SwaggerClient-php/git_push.sh @@ -28,7 +28,7 @@ git init # Adds the files in the local repository and stages them for commit. git add . -# Commits the tracked changes and prepares them to be pushed to a remote repository. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote 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 5620c82fdcd..794725eff23 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php @@ -26,8 +26,8 @@ */ /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -52,12 +52,14 @@ class FakeApi /** * API Client + * * @var \Swagger\Client\ApiClient instance of the ApiClient */ protected $apiClient; - + /** * Constructor + * * @param \Swagger\Client\ApiClient|null $apiClient The api client to use */ function __construct(\Swagger\Client\ApiClient $apiClient = null) @@ -66,22 +68,25 @@ class FakeApi $apiClient = new ApiClient(); $apiClient->getConfig()->setHost('http://petstore.swagger.io/v2'); } - + $this->apiClient = $apiClient; } - + /** * Get API client + * * @return \Swagger\Client\ApiClient get the API client */ public function getApiClient() { return $this->apiClient; } - + /** * Set the API client + * * @param \Swagger\Client\ApiClient $apiClient set the API client + * * @return FakeApi */ public function setApiClient(\Swagger\Client\ApiClient $apiClient) @@ -89,9 +94,9 @@ class FakeApi $this->apiClient = $apiClient; return $this; } - + /** - * testEndpointParameters + * Operation testEndpointParameters * * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * @@ -107,18 +112,19 @@ class FakeApi * @param \DateTime $date None (optional) * @param \DateTime $date_time None (optional) * @param string $password None (optional) + * * @return void * @throws \Swagger\Client\ApiException on non-2xx response */ public function testEndpointParameters($number, $double, $string, $byte, $integer = null, $int32 = null, $int64 = null, $float = null, $binary = null, $date = null, $date_time = null, $password = null) { - list($response) = $this->testEndpointParametersWithHttpInfo ($number, $double, $string, $byte, $integer, $int32, $int64, $float, $binary, $date, $date_time, $password); - return $response; + list($response) = $this->testEndpointParametersWithHttpInfo($number, $double, $string, $byte, $integer, $int32, $int64, $float, $binary, $date, $date_time, $password); + return $response; } /** - * testEndpointParametersWithHttpInfo + * Operation testEndpointParametersWithHttpInfo * * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * @@ -134,6 +140,7 @@ class FakeApi * @param \DateTime $date None (optional) * @param \DateTime $date_time None (optional) * @param string $password None (optional) + * * @return Array of null, HTTP status code, HTTP response headers (array of strings) * @throws \Swagger\Client\ApiException on non-2xx response */ @@ -202,7 +209,7 @@ class FakeApi throw new \InvalidArgumentException('invalid length for "$password" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 10.'); } - + // parse inputs $resourcePath = "/fake"; $httpBody = ''; @@ -214,7 +221,7 @@ class FakeApi $headerParams['Accept'] = $_header_accept; } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); - + @@ -259,7 +266,7 @@ class FakeApi $formParams['password'] = $this->apiClient->getSerializer()->toFormValue($password); } - + // for model (json/xml) if (isset($_tempBody)) { $httpBody = $_tempBody; // $_tempBody is the method argument, if present @@ -278,7 +285,7 @@ class FakeApi } catch (ApiException $e) { switch ($e->getCode()) { } - + throw $e; } } 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 4ab1529c7c0..30a718c247d 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php @@ -26,8 +26,8 @@ */ /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -52,12 +52,14 @@ class PetApi /** * API Client + * * @var \Swagger\Client\ApiClient instance of the ApiClient */ protected $apiClient; - + /** * Constructor + * * @param \Swagger\Client\ApiClient|null $apiClient The api client to use */ function __construct(\Swagger\Client\ApiClient $apiClient = null) @@ -66,22 +68,25 @@ class PetApi $apiClient = new ApiClient(); $apiClient->getConfig()->setHost('http://petstore.swagger.io/v2'); } - + $this->apiClient = $apiClient; } - + /** * Get API client + * * @return \Swagger\Client\ApiClient get the API client */ public function getApiClient() { return $this->apiClient; } - + /** * Set the API client + * * @param \Swagger\Client\ApiClient $apiClient set the API client + * * @return PetApi */ public function setApiClient(\Swagger\Client\ApiClient $apiClient) @@ -89,29 +94,31 @@ class PetApi $this->apiClient = $apiClient; return $this; } - + /** - * addPet + * Operation addPet * * Add a new pet to the store * * @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required) + * * @return void * @throws \Swagger\Client\ApiException on non-2xx response */ public function addPet($body) { - list($response) = $this->addPetWithHttpInfo ($body); - return $response; + list($response) = $this->addPetWithHttpInfo($body); + return $response; } /** - * addPetWithHttpInfo + * Operation addPetWithHttpInfo * * Add a new pet to the store * * @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required) + * * @return Array of null, HTTP status code, HTTP response headers (array of strings) * @throws \Swagger\Client\ApiException on non-2xx response */ @@ -122,7 +129,7 @@ class PetApi if ($body === null) { throw new \InvalidArgumentException('Missing the required parameter $body when calling addPet'); } - + // parse inputs $resourcePath = "/pet"; $httpBody = ''; @@ -134,7 +141,7 @@ class PetApi $headerParams['Accept'] = $_header_accept; } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/xml')); - + @@ -147,7 +154,7 @@ class PetApi if (isset($body)) { $_tempBody = $body; } - + // for model (json/xml) if (isset($_tempBody)) { $httpBody = $_tempBody; // $_tempBody is the method argument, if present @@ -171,34 +178,36 @@ class PetApi } catch (ApiException $e) { switch ($e->getCode()) { } - + throw $e; } } /** - * deletePet + * Operation deletePet * * Deletes a pet * * @param int $pet_id Pet id to delete (required) * @param string $api_key (optional) + * * @return void * @throws \Swagger\Client\ApiException on non-2xx response */ public function deletePet($pet_id, $api_key = null) { - list($response) = $this->deletePetWithHttpInfo ($pet_id, $api_key); - return $response; + list($response) = $this->deletePetWithHttpInfo($pet_id, $api_key); + return $response; } /** - * deletePetWithHttpInfo + * Operation deletePetWithHttpInfo * * Deletes a pet * * @param int $pet_id Pet id to delete (required) * @param string $api_key (optional) + * * @return Array of null, HTTP status code, HTTP response headers (array of strings) * @throws \Swagger\Client\ApiException on non-2xx response */ @@ -209,7 +218,7 @@ class PetApi if ($pet_id === null) { throw new \InvalidArgumentException('Missing the required parameter $pet_id when calling deletePet'); } - + // parse inputs $resourcePath = "/pet/{petId}"; $httpBody = ''; @@ -221,7 +230,7 @@ class PetApi $headerParams['Accept'] = $_header_accept; } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); - + // header params if ($api_key !== null) { @@ -240,7 +249,7 @@ class PetApi - + // for model (json/xml) if (isset($_tempBody)) { $httpBody = $_tempBody; // $_tempBody is the method argument, if present @@ -264,32 +273,34 @@ class PetApi } catch (ApiException $e) { switch ($e->getCode()) { } - + throw $e; } } /** - * findPetsByStatus + * Operation findPetsByStatus * * Finds Pets by status * * @param string[] $status Status values that need to be considered for filter (required) + * * @return \Swagger\Client\Model\Pet[] * @throws \Swagger\Client\ApiException on non-2xx response */ public function findPetsByStatus($status) { - list($response) = $this->findPetsByStatusWithHttpInfo ($status); - return $response; + list($response) = $this->findPetsByStatusWithHttpInfo($status); + return $response; } /** - * findPetsByStatusWithHttpInfo + * Operation findPetsByStatusWithHttpInfo * * Finds Pets by status * * @param string[] $status Status values that need to be considered for filter (required) + * * @return Array of \Swagger\Client\Model\Pet[], HTTP status code, HTTP response headers (array of strings) * @throws \Swagger\Client\ApiException on non-2xx response */ @@ -300,7 +311,7 @@ class PetApi if ($status === null) { throw new \InvalidArgumentException('Missing the required parameter $status when calling findPetsByStatus'); } - + // parse inputs $resourcePath = "/pet/findByStatus"; $httpBody = ''; @@ -312,7 +323,7 @@ class PetApi $headerParams['Accept'] = $_header_accept; } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); - + // query params if (is_array($status)) { $status = $this->apiClient->getSerializer()->serializeCollection($status, 'csv', true); @@ -327,7 +338,7 @@ class PetApi - + // for model (json/xml) if (isset($_tempBody)) { $httpBody = $_tempBody; // $_tempBody is the method argument, if present @@ -358,32 +369,34 @@ class PetApi $e->setResponseObject($data); break; } - + throw $e; } } /** - * findPetsByTags + * Operation findPetsByTags * * Finds Pets by tags * * @param string[] $tags Tags to filter by (required) + * * @return \Swagger\Client\Model\Pet[] * @throws \Swagger\Client\ApiException on non-2xx response */ public function findPetsByTags($tags) { - list($response) = $this->findPetsByTagsWithHttpInfo ($tags); - return $response; + list($response) = $this->findPetsByTagsWithHttpInfo($tags); + return $response; } /** - * findPetsByTagsWithHttpInfo + * Operation findPetsByTagsWithHttpInfo * * Finds Pets by tags * * @param string[] $tags Tags to filter by (required) + * * @return Array of \Swagger\Client\Model\Pet[], HTTP status code, HTTP response headers (array of strings) * @throws \Swagger\Client\ApiException on non-2xx response */ @@ -394,7 +407,7 @@ class PetApi if ($tags === null) { throw new \InvalidArgumentException('Missing the required parameter $tags when calling findPetsByTags'); } - + // parse inputs $resourcePath = "/pet/findByTags"; $httpBody = ''; @@ -406,7 +419,7 @@ class PetApi $headerParams['Accept'] = $_header_accept; } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); - + // query params if (is_array($tags)) { $tags = $this->apiClient->getSerializer()->serializeCollection($tags, 'csv', true); @@ -421,7 +434,7 @@ class PetApi - + // for model (json/xml) if (isset($_tempBody)) { $httpBody = $_tempBody; // $_tempBody is the method argument, if present @@ -452,32 +465,34 @@ class PetApi $e->setResponseObject($data); break; } - + throw $e; } } /** - * getPetById + * Operation getPetById * * Find pet by ID * * @param int $pet_id ID of pet to return (required) + * * @return \Swagger\Client\Model\Pet * @throws \Swagger\Client\ApiException on non-2xx response */ public function getPetById($pet_id) { - list($response) = $this->getPetByIdWithHttpInfo ($pet_id); - return $response; + list($response) = $this->getPetByIdWithHttpInfo($pet_id); + return $response; } /** - * getPetByIdWithHttpInfo + * Operation getPetByIdWithHttpInfo * * Find pet by ID * * @param int $pet_id ID of pet to return (required) + * * @return Array of \Swagger\Client\Model\Pet, HTTP status code, HTTP response headers (array of strings) * @throws \Swagger\Client\ApiException on non-2xx response */ @@ -488,7 +503,7 @@ class PetApi if ($pet_id === null) { throw new \InvalidArgumentException('Missing the required parameter $pet_id when calling getPetById'); } - + // parse inputs $resourcePath = "/pet/{petId}"; $httpBody = ''; @@ -500,7 +515,7 @@ class PetApi $headerParams['Accept'] = $_header_accept; } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); - + // path params @@ -516,7 +531,7 @@ class PetApi - + // for model (json/xml) if (isset($_tempBody)) { $httpBody = $_tempBody; // $_tempBody is the method argument, if present @@ -549,32 +564,34 @@ class PetApi $e->setResponseObject($data); break; } - + throw $e; } } /** - * updatePet + * Operation updatePet * * Update an existing pet * * @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required) + * * @return void * @throws \Swagger\Client\ApiException on non-2xx response */ public function updatePet($body) { - list($response) = $this->updatePetWithHttpInfo ($body); - return $response; + list($response) = $this->updatePetWithHttpInfo($body); + return $response; } /** - * updatePetWithHttpInfo + * Operation updatePetWithHttpInfo * * Update an existing pet * * @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required) + * * @return Array of null, HTTP status code, HTTP response headers (array of strings) * @throws \Swagger\Client\ApiException on non-2xx response */ @@ -585,7 +602,7 @@ class PetApi if ($body === null) { throw new \InvalidArgumentException('Missing the required parameter $body when calling updatePet'); } - + // parse inputs $resourcePath = "/pet"; $httpBody = ''; @@ -597,7 +614,7 @@ class PetApi $headerParams['Accept'] = $_header_accept; } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/xml')); - + @@ -610,7 +627,7 @@ class PetApi if (isset($body)) { $_tempBody = $body; } - + // for model (json/xml) if (isset($_tempBody)) { $httpBody = $_tempBody; // $_tempBody is the method argument, if present @@ -634,36 +651,38 @@ class PetApi } catch (ApiException $e) { switch ($e->getCode()) { } - + throw $e; } } /** - * updatePetWithForm + * Operation updatePetWithForm * * Updates a pet in the store with form data * * @param int $pet_id ID of pet that needs to be updated (required) * @param string $name Updated name of the pet (optional) * @param string $status Updated status of the pet (optional) + * * @return void * @throws \Swagger\Client\ApiException on non-2xx response */ public function updatePetWithForm($pet_id, $name = null, $status = null) { - list($response) = $this->updatePetWithFormWithHttpInfo ($pet_id, $name, $status); - return $response; + list($response) = $this->updatePetWithFormWithHttpInfo($pet_id, $name, $status); + return $response; } /** - * updatePetWithFormWithHttpInfo + * Operation updatePetWithFormWithHttpInfo * * Updates a pet in the store with form data * * @param int $pet_id ID of pet that needs to be updated (required) * @param string $name Updated name of the pet (optional) * @param string $status Updated status of the pet (optional) + * * @return Array of null, HTTP status code, HTTP response headers (array of strings) * @throws \Swagger\Client\ApiException on non-2xx response */ @@ -674,7 +693,7 @@ class PetApi if ($pet_id === null) { throw new \InvalidArgumentException('Missing the required parameter $pet_id when calling updatePetWithForm'); } - + // parse inputs $resourcePath = "/pet/{petId}"; $httpBody = ''; @@ -686,7 +705,7 @@ class PetApi $headerParams['Accept'] = $_header_accept; } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/x-www-form-urlencoded')); - + // path params @@ -708,7 +727,7 @@ class PetApi $formParams['status'] = $this->apiClient->getSerializer()->toFormValue($status); } - + // for model (json/xml) if (isset($_tempBody)) { $httpBody = $_tempBody; // $_tempBody is the method argument, if present @@ -732,36 +751,38 @@ class PetApi } catch (ApiException $e) { switch ($e->getCode()) { } - + throw $e; } } /** - * uploadFile + * Operation uploadFile * * uploads an image * * @param int $pet_id ID of pet to update (required) * @param string $additional_metadata Additional data to pass to server (optional) * @param \SplFileObject $file file to upload (optional) + * * @return \Swagger\Client\Model\ApiResponse * @throws \Swagger\Client\ApiException on non-2xx response */ public function uploadFile($pet_id, $additional_metadata = null, $file = null) { - list($response) = $this->uploadFileWithHttpInfo ($pet_id, $additional_metadata, $file); - return $response; + list($response) = $this->uploadFileWithHttpInfo($pet_id, $additional_metadata, $file); + return $response; } /** - * uploadFileWithHttpInfo + * Operation uploadFileWithHttpInfo * * uploads an image * * @param int $pet_id ID of pet to update (required) * @param string $additional_metadata Additional data to pass to server (optional) * @param \SplFileObject $file file to upload (optional) + * * @return Array of \Swagger\Client\Model\ApiResponse, HTTP status code, HTTP response headers (array of strings) * @throws \Swagger\Client\ApiException on non-2xx response */ @@ -772,7 +793,7 @@ class PetApi if ($pet_id === null) { throw new \InvalidArgumentException('Missing the required parameter $pet_id when calling uploadFile'); } - + // parse inputs $resourcePath = "/pet/{petId}/uploadImage"; $httpBody = ''; @@ -784,7 +805,7 @@ class PetApi $headerParams['Accept'] = $_header_accept; } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('multipart/form-data')); - + // path params @@ -812,7 +833,7 @@ class PetApi } } - + // for model (json/xml) if (isset($_tempBody)) { $httpBody = $_tempBody; // $_tempBody is the method argument, if present @@ -843,7 +864,7 @@ class PetApi $e->setResponseObject($data); break; } - + throw $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 a238eb41312..d05646adb68 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php @@ -26,8 +26,8 @@ */ /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -52,12 +52,14 @@ class StoreApi /** * API Client + * * @var \Swagger\Client\ApiClient instance of the ApiClient */ protected $apiClient; - + /** * Constructor + * * @param \Swagger\Client\ApiClient|null $apiClient The api client to use */ function __construct(\Swagger\Client\ApiClient $apiClient = null) @@ -66,22 +68,25 @@ class StoreApi $apiClient = new ApiClient(); $apiClient->getConfig()->setHost('http://petstore.swagger.io/v2'); } - + $this->apiClient = $apiClient; } - + /** * Get API client + * * @return \Swagger\Client\ApiClient get the API client */ public function getApiClient() { return $this->apiClient; } - + /** * Set the API client + * * @param \Swagger\Client\ApiClient $apiClient set the API client + * * @return StoreApi */ public function setApiClient(\Swagger\Client\ApiClient $apiClient) @@ -89,29 +94,31 @@ class StoreApi $this->apiClient = $apiClient; return $this; } - + /** - * deleteOrder + * Operation deleteOrder * * Delete purchase order by ID * * @param string $order_id ID of the order that needs to be deleted (required) + * * @return void * @throws \Swagger\Client\ApiException on non-2xx response */ public function deleteOrder($order_id) { - list($response) = $this->deleteOrderWithHttpInfo ($order_id); - return $response; + list($response) = $this->deleteOrderWithHttpInfo($order_id); + return $response; } /** - * deleteOrderWithHttpInfo + * Operation deleteOrderWithHttpInfo * * Delete purchase order by ID * * @param string $order_id ID of the order that needs to be deleted (required) + * * @return Array of null, HTTP status code, HTTP response headers (array of strings) * @throws \Swagger\Client\ApiException on non-2xx response */ @@ -126,7 +133,7 @@ class StoreApi throw new \InvalidArgumentException('invalid value for "$order_id" when calling StoreApi.deleteOrder, must be bigger than or equal to 1.0.'); } - + // parse inputs $resourcePath = "/store/order/{orderId}"; $httpBody = ''; @@ -138,7 +145,7 @@ class StoreApi $headerParams['Accept'] = $_header_accept; } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); - + // path params @@ -154,7 +161,7 @@ class StoreApi - + // for model (json/xml) if (isset($_tempBody)) { $httpBody = $_tempBody; // $_tempBody is the method argument, if present @@ -173,36 +180,38 @@ class StoreApi } catch (ApiException $e) { switch ($e->getCode()) { } - + throw $e; } } /** - * getInventory + * Operation getInventory * * Returns pet inventories by status * + * * @return map[string,int] * @throws \Swagger\Client\ApiException on non-2xx response */ public function getInventory() { - list($response) = $this->getInventoryWithHttpInfo (); - return $response; + list($response) = $this->getInventoryWithHttpInfo(); + return $response; } /** - * getInventoryWithHttpInfo + * Operation getInventoryWithHttpInfo * * Returns pet inventories by status * + * * @return Array of map[string,int], HTTP status code, HTTP response headers (array of strings) * @throws \Swagger\Client\ApiException on non-2xx response */ public function getInventoryWithHttpInfo() { - + // parse inputs $resourcePath = "/store/inventory"; $httpBody = ''; @@ -214,7 +223,7 @@ class StoreApi $headerParams['Accept'] = $_header_accept; } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); - + @@ -223,7 +232,7 @@ class StoreApi - + // for model (json/xml) if (isset($_tempBody)) { $httpBody = $_tempBody; // $_tempBody is the method argument, if present @@ -256,32 +265,34 @@ class StoreApi $e->setResponseObject($data); break; } - + throw $e; } } /** - * getOrderById + * Operation getOrderById * * Find purchase order by ID * * @param int $order_id ID of pet that needs to be fetched (required) + * * @return \Swagger\Client\Model\Order * @throws \Swagger\Client\ApiException on non-2xx response */ public function getOrderById($order_id) { - list($response) = $this->getOrderByIdWithHttpInfo ($order_id); - return $response; + list($response) = $this->getOrderByIdWithHttpInfo($order_id); + return $response; } /** - * getOrderByIdWithHttpInfo + * Operation getOrderByIdWithHttpInfo * * Find purchase order by ID * * @param int $order_id ID of pet that needs to be fetched (required) + * * @return Array of \Swagger\Client\Model\Order, HTTP status code, HTTP response headers (array of strings) * @throws \Swagger\Client\ApiException on non-2xx response */ @@ -299,7 +310,7 @@ class StoreApi throw new \InvalidArgumentException('invalid value for "$order_id" when calling StoreApi.getOrderById, must be bigger than or equal to 1.0.'); } - + // parse inputs $resourcePath = "/store/order/{orderId}"; $httpBody = ''; @@ -311,7 +322,7 @@ class StoreApi $headerParams['Accept'] = $_header_accept; } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); - + // path params @@ -327,7 +338,7 @@ class StoreApi - + // for model (json/xml) if (isset($_tempBody)) { $httpBody = $_tempBody; // $_tempBody is the method argument, if present @@ -353,32 +364,34 @@ class StoreApi $e->setResponseObject($data); break; } - + throw $e; } } /** - * placeOrder + * Operation placeOrder * * Place an order for a pet * * @param \Swagger\Client\Model\Order $body order placed for purchasing the pet (required) + * * @return \Swagger\Client\Model\Order * @throws \Swagger\Client\ApiException on non-2xx response */ public function placeOrder($body) { - list($response) = $this->placeOrderWithHttpInfo ($body); - return $response; + list($response) = $this->placeOrderWithHttpInfo($body); + return $response; } /** - * placeOrderWithHttpInfo + * Operation placeOrderWithHttpInfo * * Place an order for a pet * * @param \Swagger\Client\Model\Order $body order placed for purchasing the pet (required) + * * @return Array of \Swagger\Client\Model\Order, HTTP status code, HTTP response headers (array of strings) * @throws \Swagger\Client\ApiException on non-2xx response */ @@ -389,7 +402,7 @@ class StoreApi if ($body === null) { throw new \InvalidArgumentException('Missing the required parameter $body when calling placeOrder'); } - + // parse inputs $resourcePath = "/store/order"; $httpBody = ''; @@ -401,7 +414,7 @@ class StoreApi $headerParams['Accept'] = $_header_accept; } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); - + @@ -414,7 +427,7 @@ class StoreApi if (isset($body)) { $_tempBody = $body; } - + // for model (json/xml) if (isset($_tempBody)) { $httpBody = $_tempBody; // $_tempBody is the method argument, if present @@ -440,7 +453,7 @@ class StoreApi $e->setResponseObject($data); break; } - + throw $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 ed9744b8255..aa57591b9e4 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php @@ -26,8 +26,8 @@ */ /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -52,12 +52,14 @@ class UserApi /** * API Client + * * @var \Swagger\Client\ApiClient instance of the ApiClient */ protected $apiClient; - + /** * Constructor + * * @param \Swagger\Client\ApiClient|null $apiClient The api client to use */ function __construct(\Swagger\Client\ApiClient $apiClient = null) @@ -66,22 +68,25 @@ class UserApi $apiClient = new ApiClient(); $apiClient->getConfig()->setHost('http://petstore.swagger.io/v2'); } - + $this->apiClient = $apiClient; } - + /** * Get API client + * * @return \Swagger\Client\ApiClient get the API client */ public function getApiClient() { return $this->apiClient; } - + /** * Set the API client + * * @param \Swagger\Client\ApiClient $apiClient set the API client + * * @return UserApi */ public function setApiClient(\Swagger\Client\ApiClient $apiClient) @@ -89,29 +94,31 @@ class UserApi $this->apiClient = $apiClient; return $this; } - + /** - * createUser + * Operation createUser * * Create user * * @param \Swagger\Client\Model\User $body Created user object (required) + * * @return void * @throws \Swagger\Client\ApiException on non-2xx response */ public function createUser($body) { - list($response) = $this->createUserWithHttpInfo ($body); - return $response; + list($response) = $this->createUserWithHttpInfo($body); + return $response; } /** - * createUserWithHttpInfo + * Operation createUserWithHttpInfo * * Create user * * @param \Swagger\Client\Model\User $body Created user object (required) + * * @return Array of null, HTTP status code, HTTP response headers (array of strings) * @throws \Swagger\Client\ApiException on non-2xx response */ @@ -122,7 +129,7 @@ class UserApi if ($body === null) { throw new \InvalidArgumentException('Missing the required parameter $body when calling createUser'); } - + // parse inputs $resourcePath = "/user"; $httpBody = ''; @@ -134,7 +141,7 @@ class UserApi $headerParams['Accept'] = $_header_accept; } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); - + @@ -147,7 +154,7 @@ class UserApi if (isset($body)) { $_tempBody = $body; } - + // for model (json/xml) if (isset($_tempBody)) { $httpBody = $_tempBody; // $_tempBody is the method argument, if present @@ -166,32 +173,34 @@ class UserApi } catch (ApiException $e) { switch ($e->getCode()) { } - + throw $e; } } /** - * createUsersWithArrayInput + * Operation createUsersWithArrayInput * * Creates list of users with given input array * * @param \Swagger\Client\Model\User[] $body List of user object (required) + * * @return void * @throws \Swagger\Client\ApiException on non-2xx response */ public function createUsersWithArrayInput($body) { - list($response) = $this->createUsersWithArrayInputWithHttpInfo ($body); - return $response; + list($response) = $this->createUsersWithArrayInputWithHttpInfo($body); + return $response; } /** - * createUsersWithArrayInputWithHttpInfo + * Operation createUsersWithArrayInputWithHttpInfo * * Creates list of users with given input array * * @param \Swagger\Client\Model\User[] $body List of user object (required) + * * @return Array of null, HTTP status code, HTTP response headers (array of strings) * @throws \Swagger\Client\ApiException on non-2xx response */ @@ -202,7 +211,7 @@ class UserApi if ($body === null) { throw new \InvalidArgumentException('Missing the required parameter $body when calling createUsersWithArrayInput'); } - + // parse inputs $resourcePath = "/user/createWithArray"; $httpBody = ''; @@ -214,7 +223,7 @@ class UserApi $headerParams['Accept'] = $_header_accept; } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); - + @@ -227,7 +236,7 @@ class UserApi if (isset($body)) { $_tempBody = $body; } - + // for model (json/xml) if (isset($_tempBody)) { $httpBody = $_tempBody; // $_tempBody is the method argument, if present @@ -246,32 +255,34 @@ class UserApi } catch (ApiException $e) { switch ($e->getCode()) { } - + throw $e; } } /** - * createUsersWithListInput + * Operation createUsersWithListInput * * Creates list of users with given input array * * @param \Swagger\Client\Model\User[] $body List of user object (required) + * * @return void * @throws \Swagger\Client\ApiException on non-2xx response */ public function createUsersWithListInput($body) { - list($response) = $this->createUsersWithListInputWithHttpInfo ($body); - return $response; + list($response) = $this->createUsersWithListInputWithHttpInfo($body); + return $response; } /** - * createUsersWithListInputWithHttpInfo + * Operation createUsersWithListInputWithHttpInfo * * Creates list of users with given input array * * @param \Swagger\Client\Model\User[] $body List of user object (required) + * * @return Array of null, HTTP status code, HTTP response headers (array of strings) * @throws \Swagger\Client\ApiException on non-2xx response */ @@ -282,7 +293,7 @@ class UserApi if ($body === null) { throw new \InvalidArgumentException('Missing the required parameter $body when calling createUsersWithListInput'); } - + // parse inputs $resourcePath = "/user/createWithList"; $httpBody = ''; @@ -294,7 +305,7 @@ class UserApi $headerParams['Accept'] = $_header_accept; } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); - + @@ -307,7 +318,7 @@ class UserApi if (isset($body)) { $_tempBody = $body; } - + // for model (json/xml) if (isset($_tempBody)) { $httpBody = $_tempBody; // $_tempBody is the method argument, if present @@ -326,32 +337,34 @@ class UserApi } catch (ApiException $e) { switch ($e->getCode()) { } - + throw $e; } } /** - * deleteUser + * Operation deleteUser * * Delete user * * @param string $username The name that needs to be deleted (required) + * * @return void * @throws \Swagger\Client\ApiException on non-2xx response */ public function deleteUser($username) { - list($response) = $this->deleteUserWithHttpInfo ($username); - return $response; + list($response) = $this->deleteUserWithHttpInfo($username); + return $response; } /** - * deleteUserWithHttpInfo + * Operation deleteUserWithHttpInfo * * Delete user * * @param string $username The name that needs to be deleted (required) + * * @return Array of null, HTTP status code, HTTP response headers (array of strings) * @throws \Swagger\Client\ApiException on non-2xx response */ @@ -362,7 +375,7 @@ class UserApi if ($username === null) { throw new \InvalidArgumentException('Missing the required parameter $username when calling deleteUser'); } - + // parse inputs $resourcePath = "/user/{username}"; $httpBody = ''; @@ -374,7 +387,7 @@ class UserApi $headerParams['Accept'] = $_header_accept; } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); - + // path params @@ -390,7 +403,7 @@ class UserApi - + // for model (json/xml) if (isset($_tempBody)) { $httpBody = $_tempBody; // $_tempBody is the method argument, if present @@ -409,32 +422,34 @@ class UserApi } catch (ApiException $e) { switch ($e->getCode()) { } - + throw $e; } } /** - * getUserByName + * Operation getUserByName * * Get user by user name * * @param string $username The name that needs to be fetched. Use user1 for testing. (required) + * * @return \Swagger\Client\Model\User * @throws \Swagger\Client\ApiException on non-2xx response */ public function getUserByName($username) { - list($response) = $this->getUserByNameWithHttpInfo ($username); - return $response; + list($response) = $this->getUserByNameWithHttpInfo($username); + return $response; } /** - * getUserByNameWithHttpInfo + * Operation getUserByNameWithHttpInfo * * Get user by user name * * @param string $username The name that needs to be fetched. Use user1 for testing. (required) + * * @return Array of \Swagger\Client\Model\User, HTTP status code, HTTP response headers (array of strings) * @throws \Swagger\Client\ApiException on non-2xx response */ @@ -445,7 +460,7 @@ class UserApi if ($username === null) { throw new \InvalidArgumentException('Missing the required parameter $username when calling getUserByName'); } - + // parse inputs $resourcePath = "/user/{username}"; $httpBody = ''; @@ -457,7 +472,7 @@ class UserApi $headerParams['Accept'] = $_header_accept; } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); - + // path params @@ -473,7 +488,7 @@ class UserApi - + // for model (json/xml) if (isset($_tempBody)) { $httpBody = $_tempBody; // $_tempBody is the method argument, if present @@ -499,34 +514,36 @@ class UserApi $e->setResponseObject($data); break; } - + throw $e; } } /** - * loginUser + * Operation loginUser * * Logs user into the system * * @param string $username The user name for login (required) * @param string $password The password for login in clear text (required) + * * @return string * @throws \Swagger\Client\ApiException on non-2xx response */ public function loginUser($username, $password) { - list($response) = $this->loginUserWithHttpInfo ($username, $password); - return $response; + list($response) = $this->loginUserWithHttpInfo($username, $password); + return $response; } /** - * loginUserWithHttpInfo + * Operation loginUserWithHttpInfo * * Logs user into the system * * @param string $username The user name for login (required) * @param string $password The password for login in clear text (required) + * * @return Array of string, HTTP status code, HTTP response headers (array of strings) * @throws \Swagger\Client\ApiException on non-2xx response */ @@ -542,7 +559,7 @@ class UserApi if ($password === null) { throw new \InvalidArgumentException('Missing the required parameter $password when calling loginUser'); } - + // parse inputs $resourcePath = "/user/login"; $httpBody = ''; @@ -554,7 +571,7 @@ class UserApi $headerParams['Accept'] = $_header_accept; } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); - + // query params if ($username !== null) { $queryParams['username'] = $this->apiClient->getSerializer()->toQueryValue($username); @@ -569,7 +586,7 @@ class UserApi - + // for model (json/xml) if (isset($_tempBody)) { $httpBody = $_tempBody; // $_tempBody is the method argument, if present @@ -595,36 +612,38 @@ class UserApi $e->setResponseObject($data); break; } - + throw $e; } } /** - * logoutUser + * Operation logoutUser * * Logs out current logged in user session * + * * @return void * @throws \Swagger\Client\ApiException on non-2xx response */ public function logoutUser() { - list($response) = $this->logoutUserWithHttpInfo (); - return $response; + list($response) = $this->logoutUserWithHttpInfo(); + return $response; } /** - * logoutUserWithHttpInfo + * Operation logoutUserWithHttpInfo * * Logs out current logged in user session * + * * @return Array of null, HTTP status code, HTTP response headers (array of strings) * @throws \Swagger\Client\ApiException on non-2xx response */ public function logoutUserWithHttpInfo() { - + // parse inputs $resourcePath = "/user/logout"; $httpBody = ''; @@ -636,7 +655,7 @@ class UserApi $headerParams['Accept'] = $_header_accept; } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); - + @@ -645,7 +664,7 @@ class UserApi - + // for model (json/xml) if (isset($_tempBody)) { $httpBody = $_tempBody; // $_tempBody is the method argument, if present @@ -664,34 +683,36 @@ class UserApi } catch (ApiException $e) { switch ($e->getCode()) { } - + throw $e; } } /** - * updateUser + * Operation updateUser * * Updated user * * @param string $username name that need to be deleted (required) * @param \Swagger\Client\Model\User $body Updated user object (required) + * * @return void * @throws \Swagger\Client\ApiException on non-2xx response */ public function updateUser($username, $body) { - list($response) = $this->updateUserWithHttpInfo ($username, $body); - return $response; + list($response) = $this->updateUserWithHttpInfo($username, $body); + return $response; } /** - * updateUserWithHttpInfo + * Operation updateUserWithHttpInfo * * Updated user * * @param string $username name that need to be deleted (required) * @param \Swagger\Client\Model\User $body Updated user object (required) + * * @return Array of null, HTTP status code, HTTP response headers (array of strings) * @throws \Swagger\Client\ApiException on non-2xx response */ @@ -707,7 +728,7 @@ class UserApi if ($body === null) { throw new \InvalidArgumentException('Missing the required parameter $body when calling updateUser'); } - + // parse inputs $resourcePath = "/user/{username}"; $httpBody = ''; @@ -719,7 +740,7 @@ class UserApi $headerParams['Accept'] = $_header_accept; } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); - + // path params @@ -739,7 +760,7 @@ class UserApi if (isset($body)) { $_tempBody = $body; } - + // for model (json/xml) if (isset($_tempBody)) { $httpBody = $_tempBody; // $_tempBody is the method argument, if present @@ -758,7 +779,7 @@ class UserApi } catch (ApiException $e) { switch ($e->getCode()) { } - + throw $e; } } diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/ApiClient.php b/samples/client/petstore/php/SwaggerClient-php/lib/ApiClient.php index b28f2f26140..227d6b0d086 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/ApiClient.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/ApiClient.php @@ -55,18 +55,21 @@ class ApiClient /** * Configuration + * * @var Configuration */ protected $config; /** * Object Serializer + * * @var ObjectSerializer */ protected $serializer; /** * Constructor of the class + * * @param Configuration $config config for this ApiClient */ public function __construct(\Swagger\Client\Configuration $config = null) @@ -81,6 +84,7 @@ class ApiClient /** * Get the config + * * @return Configuration */ public function getConfig() @@ -90,6 +94,7 @@ class ApiClient /** * Get the serializer + * * @return ObjectSerializer */ public function getSerializer() @@ -99,7 +104,9 @@ class ApiClient /** * Get API key (with prefix if set) + * * @param string $apiKeyIdentifier name of apikey + * * @return string API key with the prefix */ public function getApiKeyWithPrefix($apiKeyIdentifier) @@ -122,12 +129,14 @@ class ApiClient /** * Make the HTTP call (Sync) + * * @param string $resourcePath path to method endpoint * @param string $method method to call * @param array $queryParams parameters to be place in query URL * @param array $postData parameters to be placed in POST body * @param array $headerParams parameters to be place in request header * @param string $responseType expected response type of the endpoint + * * @throws \Swagger\Client\ApiException on a non 2xx response * @return mixed */ @@ -160,7 +169,7 @@ class ApiClient if ($this->config->getCurlTimeout() != 0) { curl_setopt($curl, CURLOPT_TIMEOUT, $this->config->getCurlTimeout()); } - // return the result on success, rather than just true + // return the result on success, rather than just true curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); @@ -171,7 +180,7 @@ class ApiClient curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0); } - if (! empty($queryParams)) { + if (!empty($queryParams)) { $url = ($url . '?' . http_build_query($queryParams)); } @@ -216,7 +225,7 @@ class ApiClient // Make the request $response = curl_exec($curl); $http_header_size = curl_getinfo($curl, CURLINFO_HEADER_SIZE); - $http_header = $this->http_parse_headers(substr($response, 0, $http_header_size)); + $http_header = $this->httpParseHeaders(substr($response, 0, $http_header_size)); $http_body = substr($response, $http_header_size); $response_info = curl_getinfo($curl); @@ -295,16 +304,16 @@ class ApiClient * * @return string[] Array of HTTP response heaers */ - protected function http_parse_headers($raw_headers) + protected function httpParseHeaders($raw_headers) { // ref/credit: http://php.net/manual/en/function.http-parse-headers.php#112986 $headers = array(); $key = ''; - + foreach(explode("\n", $raw_headers) as $h) { $h = explode(':', $h, 2); - + if (isset($h[1])) { if (!isset($headers[$h[0]])) @@ -317,18 +326,18 @@ class ApiClient { $headers[$h[0]] = array_merge(array($headers[$h[0]]), array(trim($h[1]))); } - + $key = $h[0]; } else { - if (substr($h[0], 0, 1) == "\t") - $headers[$key] .= "\r\n\t".trim($h[0]); + if (substr($h[0], 0, 1) == "\t") + $headers[$key] .= "\r\n\t".trim($h[0]); elseif (!$key) $headers[0] = trim($h[0]);trim($h[0]); } } - + return $headers; } } diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/ApiException.php b/samples/client/petstore/php/SwaggerClient-php/lib/ApiException.php index d6040a0ff20..370e3f8796b 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/ApiException.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/ApiException.php @@ -48,24 +48,28 @@ class ApiException extends Exception /** * The HTTP body of the server response either as Json or string. + * * @var mixed */ protected $responseBody; /** * The HTTP header of the server response. + * * @var string[] */ protected $responseHeaders; /** * The deserialized response object + * * @var $responseObject; */ protected $responseObject; /** * Constructor + * * @param string $message Error message * @param int $code HTTP status code * @param string $responseHeaders HTTP response header @@ -100,7 +104,9 @@ class ApiException extends Exception /** * Sets the deseralized response object (during deserialization) + * * @param mixed $obj Deserialized response object + * * @return void */ public function setResponseObject($obj) diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Configuration.php b/samples/client/petstore/php/SwaggerClient-php/lib/Configuration.php index 9da9c7edac0..ab6ebd899ac 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Configuration.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Configuration.php @@ -110,7 +110,7 @@ class Configuration * * @var string */ - protected $userAgent = "Swagger-Codegen/1.0.0/php"; + protected $userAgent = "Swagger-Codegen//php"; /** * Debug switch (default set to false) @@ -517,7 +517,7 @@ class Configuration $report .= " OS: ".php_uname()."\n"; $report .= " PHP Version: ".phpversion()."\n"; $report .= " OpenAPI Spec Version: 1.0.0\n"; - $report .= " SDK Package Version: 1.0.0\n"; + $report .= " SDK Package Version: \n"; $report .= " Temp Folder Path: ".self::getDefaultConfiguration()->getTempFolderPath()."\n"; return $report; diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/AnimalFarm.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/AnimalFarm.php index 1bf893935db..a3f43300e72 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/AnimalFarm.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/AnimalFarm.php @@ -125,7 +125,7 @@ class AnimalFarm implements ArrayAccess * * @return array invalid properties with reasons */ - public function list_invalid_properties() + public function listInvalidProperties() { $invalid_properties = array(); return $invalid_properties; diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumClass.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumClass.php index e63691cc979..a4f045db926 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumClass.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumClass.php @@ -125,7 +125,7 @@ class EnumClass implements ArrayAccess * * @return array invalid properties with reasons */ - public function list_invalid_properties() + public function listInvalidProperties() { $invalid_properties = array(); return $invalid_properties; diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumTest.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumTest.php index cb2ce24988b..e1cf6f4a0b2 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumTest.php @@ -110,6 +110,12 @@ class EnumTest implements ArrayAccess return self::$getters; } + const ENUM_STRING_UPPER = 'UPPER'; + const ENUM_STRING_LOWER = 'lower'; + const ENUM_INTEGER_1 = 1; + const ENUM_INTEGER_MINUS_1 = -1; + const ENUM_NUMBER_1_DOT_1 = 1.1; + const ENUM_NUMBER_MINUS_1_DOT_2 = -1.2; @@ -120,7 +126,8 @@ class EnumTest implements ArrayAccess public function getEnumStringAllowableValues() { return [ - + self::ENUM_STRING_UPPER, + self::ENUM_STRING_LOWER, ]; } @@ -131,7 +138,8 @@ class EnumTest implements ArrayAccess public function getEnumIntegerAllowableValues() { return [ - + self::ENUM_INTEGER_1, + self::ENUM_INTEGER_MINUS_1, ]; } @@ -142,7 +150,8 @@ class EnumTest implements ArrayAccess public function getEnumNumberAllowableValues() { return [ - + self::ENUM_NUMBER_1_DOT_1, + self::ENUM_NUMBER_MINUS_1_DOT_2, ]; } @@ -169,7 +178,7 @@ class EnumTest implements ArrayAccess * * @return array invalid properties with reasons */ - public function list_invalid_properties() + public function listInvalidProperties() { $invalid_properties = array(); $allowed_values = array("UPPER", "lower"); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php index 4e456262f6c..7cbfc09c168 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php @@ -69,7 +69,7 @@ class FormatTest implements ArrayAccess 'binary' => 'string', 'date' => '\DateTime', 'date_time' => '\DateTime', - 'uuid' => 'UUID', + 'uuid' => 'string', 'password' => 'string' ); @@ -578,7 +578,7 @@ class FormatTest implements ArrayAccess /** * Gets uuid - * @return UUID + * @return string */ public function getUuid() { @@ -587,7 +587,7 @@ class FormatTest implements ArrayAccess /** * Sets uuid - * @param UUID $uuid + * @param string $uuid * @return $this */ public function setUuid($uuid) diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php index 6d7d227dd11..ff4feaecd85 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php @@ -122,6 +122,9 @@ class Order implements ArrayAccess return self::$getters; } + const STATUS_PLACED = 'placed'; + const STATUS_APPROVED = 'approved'; + const STATUS_DELIVERED = 'delivered'; @@ -132,7 +135,9 @@ class Order implements ArrayAccess public function getStatusAllowableValues() { return [ - + self::STATUS_PLACED, + self::STATUS_APPROVED, + self::STATUS_DELIVERED, ]; } diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php index 83e3c2b325f..f7e489f30ce 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php @@ -122,6 +122,9 @@ class Pet implements ArrayAccess return self::$getters; } + const STATUS_AVAILABLE = 'available'; + const STATUS_PENDING = 'pending'; + const STATUS_SOLD = 'sold'; @@ -132,7 +135,9 @@ class Pet implements ArrayAccess public function getStatusAllowableValues() { return [ - + self::STATUS_AVAILABLE, + self::STATUS_PENDING, + self::STATUS_SOLD, ]; } diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php b/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php index 3adaa899f5f..fa3abe1a22a 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php @@ -1,6 +1,6 @@ fwrite($data); - error_log("[INFO] Written $byte_written byte to $filename. Please move the file to a proper folder or delete the temp file after processing.\n", 3, Configuration::getDefaultConfiguration()->getDebugFile()); - return $deserialized; + if (Configuration::getDefaultConfiguration()->getDebug()) { + error_log("[DEBUG] Written $byte_written byte to $filename. Please move the file to a proper folder or delete the temp file after processing.\n", 3, Configuration::getDefaultConfiguration()->getDebugFile()); + } + + return $deserialized; + } else { // If a discriminator is defined and points to a valid subclass, use it. if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { @@ -282,11 +286,11 @@ class ObjectSerializer $instance = new $class(); foreach ($instance::swaggerTypes() as $property => $type) { $propertySetter = $instance::setters()[$property]; - + if (!isset($propertySetter) || !isset($data->{$instance::attributeMap()[$property]})) { continue; } - + $propertyValue = $data->{$instance::attributeMap()[$property]}; if (isset($propertyValue)) { $instance->$propertySetter(self::deserialize($propertyValue, $type, null, $discriminator));