add debug switch to print out downloaded file info

This commit is contained in:
wing328 2016-05-14 17:11:48 +08:00
parent 1939ce8e91
commit 0b7d0c34af
23 changed files with 468 additions and 364 deletions

View File

@ -268,7 +268,11 @@ class ObjectSerializer
} }
$deserialized = new \SplFileObject($filename, "w"); $deserialized = new \SplFileObject($filename, "w");
$byte_written = $deserialized->fwrite($data); $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; return $deserialized;
} else { } else {

View File

@ -1,11 +1,11 @@
# SwaggerClient-php # 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: This PHP package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
- API version: 1.0.0 - API version: 1.0.0
- Package version: 1.0.0 - Package version:
- Build date: 2016-05-10T22:37:00.768+08:00 - Build date: 2016-05-14T17:06:01.056+08:00
- Build package: class io.swagger.codegen.languages.PhpClientCodegen - Build package: class io.swagger.codegen.languages.PhpClientCodegen
## Requirements ## Requirements
@ -41,7 +41,7 @@ Download the files and include `autoload.php`:
require_once('/path/to/SwaggerClient-php/autoload.php'); require_once('/path/to/SwaggerClient-php/autoload.php');
``` ```
## Tests ## Tests
To run the unit 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 Class | Method | HTTP request | Description
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
*FakeApi* | [**testEndpointParameters**](docs/ApiFakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**testEndpointParameters**](docs/Api/FakeApi.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* | [**addPet**](docs/Api/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store
*PetApi* | [**deletePet**](docs/ApiPetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet *PetApi* | [**deletePet**](docs/Api/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet
*PetApi* | [**findPetsByStatus**](docs/ApiPetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status *PetApi* | [**findPetsByStatus**](docs/Api/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status
*PetApi* | [**findPetsByTags**](docs/ApiPetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags *PetApi* | [**findPetsByTags**](docs/Api/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags
*PetApi* | [**getPetById**](docs/ApiPetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID *PetApi* | [**getPetById**](docs/Api/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID
*PetApi* | [**updatePet**](docs/ApiPetApi.md#updatepet) | **PUT** /pet | Update an existing pet *PetApi* | [**updatePet**](docs/Api/PetApi.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* | [**updatePetWithForm**](docs/Api/PetApi.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 *PetApi* | [**uploadFile**](docs/Api/PetApi.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* | [**deleteOrder**](docs/Api/StoreApi.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* | [**getInventory**](docs/Api/StoreApi.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* | [**getOrderById**](docs/Api/StoreApi.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 *StoreApi* | [**placeOrder**](docs/Api/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet
*UserApi* | [**createUser**](docs/ApiUserApi.md#createuser) | **POST** /user | Create user *UserApi* | [**createUser**](docs/Api/UserApi.md#createuser) | **POST** /user | Create user
*UserApi* | [**createUsersWithArrayInput**](docs/ApiUserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array *UserApi* | [**createUsersWithArrayInput**](docs/Api/UserApi.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* | [**createUsersWithListInput**](docs/Api/UserApi.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* | [**deleteUser**](docs/Api/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user
*UserApi* | [**getUserByName**](docs/ApiUserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name *UserApi* | [**getUserByName**](docs/Api/UserApi.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* | [**loginUser**](docs/Api/UserApi.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* | [**logoutUser**](docs/Api/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session
*UserApi* | [**updateUser**](docs/ApiUserApi.md#updateuser) | **PUT** /user/{username} | Updated user *UserApi* | [**updateUser**](docs/Api/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user
## Documentation For Models ## Documentation For Models
- [Animal](docs/ModelAnimal.md) - [Animal](docs/Model/Animal.md)
- [AnimalFarm](docs/ModelAnimalFarm.md) - [AnimalFarm](docs/Model/AnimalFarm.md)
- [ApiResponse](docs/ModelApiResponse.md) - [ApiResponse](docs/Model/ApiResponse.md)
- [Cat](docs/ModelCat.md) - [Cat](docs/Model/Cat.md)
- [Category](docs/ModelCategory.md) - [Category](docs/Model/Category.md)
- [Dog](docs/ModelDog.md) - [Dog](docs/Model/Dog.md)
- [EnumClass](docs/ModelEnumClass.md) - [EnumClass](docs/Model/EnumClass.md)
- [EnumTest](docs/ModelEnumTest.md) - [EnumTest](docs/Model/EnumTest.md)
- [FormatTest](docs/ModelFormatTest.md) - [FormatTest](docs/Model/FormatTest.md)
- [Model200Response](docs/ModelModel200Response.md) - [Model200Response](docs/Model/Model200Response.md)
- [ModelReturn](docs/ModelModelReturn.md) - [ModelReturn](docs/Model/ModelReturn.md)
- [Name](docs/ModelName.md) - [Name](docs/Model/Name.md)
- [Order](docs/ModelOrder.md) - [Order](docs/Model/Order.md)
- [Pet](docs/ModelPet.md) - [Pet](docs/Model/Pet.md)
- [SpecialModelName](docs/ModelSpecialModelName.md) - [SpecialModelName](docs/Model/SpecialModelName.md)
- [Tag](docs/ModelTag.md) - [Tag](docs/Model/Tag.md)
- [User](docs/ModelUser.md) - [User](docs/Model/User.md)
## Documentation For Authorization ## Documentation For Authorization
@ -136,7 +136,7 @@ Class | Method | HTTP request | Description
## api_key ## api_key
- **Type**: API key - **Type**: API key
- **API key parameter name**: api_key - **API key parameter name**: api_key
- **Location**: HTTP header - **Location**: HTTP header

View File

@ -1,14 +1,15 @@
<?php <?php
/** /**
* An example of a project-specific implementation. * An example of a project-specific implementation.
* *
* After registering this autoload function with SPL, the following line * After registering this autoload function with SPL, the following line
* would cause the function to attempt to load the \Swagger\Client\Baz\Qux class * would cause the function to attempt to load the \Swagger\Client\Baz\Qux class
* from /path/to/project/lib/Baz/Qux.php: * from /path/to/project/lib/Baz/Qux.php:
* *
* new \Swagger\Client\Baz\Qux; * new \Swagger\Client\Baz\Qux;
* *
* @param string $class The fully-qualified class name. * @param string $class The fully-qualified class name.
*
* @return void * @return void
*/ */
spl_autoload_register(function ($class) { spl_autoload_register(function ($class) {

View File

@ -1,6 +1,5 @@
{ {
"name": "GIT_USER_ID/GIT_REPO_ID", "name": "GIT_USER_ID/GIT_REPO_ID",
"version": "1.0.0",
"description": "", "description": "",
"keywords": [ "keywords": [
"swagger", "swagger",

View File

@ -14,7 +14,7 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
### Example ### Example
```php ```php
<?php <?php
require_once(__DIR__ . '/vendor/autoload.php'); require_once(__DIR__ . '/vendor/autoload.php');
@ -33,7 +33,7 @@ $date = new \DateTime(); // \DateTime | None
$date_time = new \DateTime(); // \DateTime | None $date_time = new \DateTime(); // \DateTime | None
$password = "password_example"; // string | None $password = "password_example"; // string | None
try { try {
$api_instance->testEndpointParameters($number, $double, $string, $byte, $integer, $int32, $int64, $float, $binary, $date, $date_time, $password); $api_instance->testEndpointParameters($number, $double, $string, $byte, $integer, $int32, $int64, $float, $binary, $date, $date_time, $password);
} catch (Exception $e) { } catch (Exception $e) {
echo 'Exception when calling FakeApi->testEndpointParameters: ', $e->getMessage(), "\n"; echo 'Exception when calling FakeApi->testEndpointParameters: ', $e->getMessage(), "\n";
@ -71,5 +71,5 @@ No authorization required
- **Content-Type**: Not defined - **Content-Type**: Not defined
- **Accept**: application/xml, application/json - **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)

View File

@ -21,7 +21,7 @@ Add a new pet to the store
### Example ### Example
```php ```php
<?php <?php
require_once(__DIR__ . '/vendor/autoload.php'); require_once(__DIR__ . '/vendor/autoload.php');
@ -32,7 +32,7 @@ Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_AC
$api_instance = new Swagger\Client\Api\PetApi(); $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 $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); $api_instance->addPet($body);
} catch (Exception $e) { } catch (Exception $e) {
echo 'Exception when calling PetApi->addPet: ', $e->getMessage(), "\n"; echo 'Exception when calling PetApi->addPet: ', $e->getMessage(), "\n";
@ -44,7 +44,7 @@ try {
Name | Type | Description | Notes 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 ### Return type
@ -52,14 +52,14 @@ void (empty response body)
### Authorization ### Authorization
[petstore_auth](../README.md#petstore_auth) [petstore_auth](../../README.md#petstore_auth)
### HTTP request headers ### HTTP request headers
- **Content-Type**: application/json, application/xml - **Content-Type**: application/json, application/xml
- **Accept**: application/xml, application/json - **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**
> deletePet($pet_id, $api_key) > deletePet($pet_id, $api_key)
@ -68,7 +68,7 @@ Deletes a pet
### Example ### Example
```php ```php
<?php <?php
require_once(__DIR__ . '/vendor/autoload.php'); require_once(__DIR__ . '/vendor/autoload.php');
@ -80,7 +80,7 @@ $api_instance = new Swagger\Client\Api\PetApi();
$pet_id = 789; // int | Pet id to delete $pet_id = 789; // int | Pet id to delete
$api_key = "api_key_example"; // string | $api_key = "api_key_example"; // string |
try { try {
$api_instance->deletePet($pet_id, $api_key); $api_instance->deletePet($pet_id, $api_key);
} catch (Exception $e) { } catch (Exception $e) {
echo 'Exception when calling PetApi->deletePet: ', $e->getMessage(), "\n"; echo 'Exception when calling PetApi->deletePet: ', $e->getMessage(), "\n";
@ -101,14 +101,14 @@ void (empty response body)
### Authorization ### Authorization
[petstore_auth](../README.md#petstore_auth) [petstore_auth](../../README.md#petstore_auth)
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **Content-Type**: Not defined
- **Accept**: application/xml, application/json - **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** # **findPetsByStatus**
> \Swagger\Client\Model\Pet[] findPetsByStatus($status) > \Swagger\Client\Model\Pet[] findPetsByStatus($status)
@ -117,7 +117,7 @@ Finds Pets by status
Multiple status values can be provided with comma separated strings Multiple status values can be provided with comma separated strings
### Example ### Example
```php ```php
<?php <?php
require_once(__DIR__ . '/vendor/autoload.php'); require_once(__DIR__ . '/vendor/autoload.php');
@ -128,7 +128,7 @@ Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_AC
$api_instance = new Swagger\Client\Api\PetApi(); $api_instance = new Swagger\Client\Api\PetApi();
$status = array("status_example"); // string[] | Status values that need to be considered for filter $status = array("status_example"); // string[] | Status values that need to be considered for filter
try { try {
$result = $api_instance->findPetsByStatus($status); $result = $api_instance->findPetsByStatus($status);
print_r($result); print_r($result);
} catch (Exception $e) { } catch (Exception $e) {
@ -141,22 +141,22 @@ try {
Name | Type | Description | Notes 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 ### Return type
[**\Swagger\Client\Model\Pet[]**](Pet.md) [**\Swagger\Client\Model\Pet[]**](../Model/Pet.md)
### Authorization ### Authorization
[petstore_auth](../README.md#petstore_auth) [petstore_auth](../../README.md#petstore_auth)
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **Content-Type**: Not defined
- **Accept**: application/xml, application/json - **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** # **findPetsByTags**
> \Swagger\Client\Model\Pet[] findPetsByTags($tags) > \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. Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
### Example ### Example
```php ```php
<?php <?php
require_once(__DIR__ . '/vendor/autoload.php'); require_once(__DIR__ . '/vendor/autoload.php');
@ -176,7 +176,7 @@ Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_AC
$api_instance = new Swagger\Client\Api\PetApi(); $api_instance = new Swagger\Client\Api\PetApi();
$tags = array("tags_example"); // string[] | Tags to filter by $tags = array("tags_example"); // string[] | Tags to filter by
try { try {
$result = $api_instance->findPetsByTags($tags); $result = $api_instance->findPetsByTags($tags);
print_r($result); print_r($result);
} catch (Exception $e) { } catch (Exception $e) {
@ -189,22 +189,22 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**tags** | [**string[]**](string.md)| Tags to filter by | **tags** | [**string[]**](../Model/string.md)| Tags to filter by |
### Return type ### Return type
[**\Swagger\Client\Model\Pet[]**](Pet.md) [**\Swagger\Client\Model\Pet[]**](../Model/Pet.md)
### Authorization ### Authorization
[petstore_auth](../README.md#petstore_auth) [petstore_auth](../../README.md#petstore_auth)
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **Content-Type**: Not defined
- **Accept**: application/xml, application/json - **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** # **getPetById**
> \Swagger\Client\Model\Pet getPetById($pet_id) > \Swagger\Client\Model\Pet getPetById($pet_id)
@ -213,7 +213,7 @@ Find pet by ID
Returns a single pet Returns a single pet
### Example ### Example
```php ```php
<?php <?php
require_once(__DIR__ . '/vendor/autoload.php'); require_once(__DIR__ . '/vendor/autoload.php');
@ -226,7 +226,7 @@ Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'Y
$api_instance = new Swagger\Client\Api\PetApi(); $api_instance = new Swagger\Client\Api\PetApi();
$pet_id = 789; // int | ID of pet to return $pet_id = 789; // int | ID of pet to return
try { try {
$result = $api_instance->getPetById($pet_id); $result = $api_instance->getPetById($pet_id);
print_r($result); print_r($result);
} catch (Exception $e) { } catch (Exception $e) {
@ -243,18 +243,18 @@ Name | Type | Description | Notes
### Return type ### Return type
[**\Swagger\Client\Model\Pet**](Pet.md) [**\Swagger\Client\Model\Pet**](../Model/Pet.md)
### Authorization ### Authorization
[api_key](../README.md#api_key) [api_key](../../README.md#api_key)
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **Content-Type**: Not defined
- **Accept**: application/xml, application/json - **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**
> updatePet($body) > updatePet($body)
@ -263,7 +263,7 @@ Update an existing pet
### Example ### Example
```php ```php
<?php <?php
require_once(__DIR__ . '/vendor/autoload.php'); require_once(__DIR__ . '/vendor/autoload.php');
@ -274,7 +274,7 @@ Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_AC
$api_instance = new Swagger\Client\Api\PetApi(); $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 $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); $api_instance->updatePet($body);
} catch (Exception $e) { } catch (Exception $e) {
echo 'Exception when calling PetApi->updatePet: ', $e->getMessage(), "\n"; echo 'Exception when calling PetApi->updatePet: ', $e->getMessage(), "\n";
@ -286,7 +286,7 @@ try {
Name | Type | Description | Notes 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 ### Return type
@ -294,14 +294,14 @@ void (empty response body)
### Authorization ### Authorization
[petstore_auth](../README.md#petstore_auth) [petstore_auth](../../README.md#petstore_auth)
### HTTP request headers ### HTTP request headers
- **Content-Type**: application/json, application/xml - **Content-Type**: application/json, application/xml
- **Accept**: application/xml, application/json - **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**
> updatePetWithForm($pet_id, $name, $status) > updatePetWithForm($pet_id, $name, $status)
@ -310,7 +310,7 @@ Updates a pet in the store with form data
### Example ### Example
```php ```php
<?php <?php
require_once(__DIR__ . '/vendor/autoload.php'); require_once(__DIR__ . '/vendor/autoload.php');
@ -323,7 +323,7 @@ $pet_id = 789; // int | ID of pet that needs to be updated
$name = "name_example"; // string | Updated name of the pet $name = "name_example"; // string | Updated name of the pet
$status = "status_example"; // string | Updated status of the pet $status = "status_example"; // string | Updated status of the pet
try { try {
$api_instance->updatePetWithForm($pet_id, $name, $status); $api_instance->updatePetWithForm($pet_id, $name, $status);
} catch (Exception $e) { } catch (Exception $e) {
echo 'Exception when calling PetApi->updatePetWithForm: ', $e->getMessage(), "\n"; echo 'Exception when calling PetApi->updatePetWithForm: ', $e->getMessage(), "\n";
@ -345,14 +345,14 @@ void (empty response body)
### Authorization ### Authorization
[petstore_auth](../README.md#petstore_auth) [petstore_auth](../../README.md#petstore_auth)
### HTTP request headers ### HTTP request headers
- **Content-Type**: application/x-www-form-urlencoded - **Content-Type**: application/x-www-form-urlencoded
- **Accept**: application/xml, application/json - **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** # **uploadFile**
> \Swagger\Client\Model\ApiResponse uploadFile($pet_id, $additional_metadata, $file) > \Swagger\Client\Model\ApiResponse uploadFile($pet_id, $additional_metadata, $file)
@ -361,7 +361,7 @@ uploads an image
### Example ### Example
```php ```php
<?php <?php
require_once(__DIR__ . '/vendor/autoload.php'); require_once(__DIR__ . '/vendor/autoload.php');
@ -374,7 +374,7 @@ $pet_id = 789; // int | ID of pet to update
$additional_metadata = "additional_metadata_example"; // string | Additional data to pass to server $additional_metadata = "additional_metadata_example"; // string | Additional data to pass to server
$file = "/path/to/file.txt"; // \SplFileObject | file to upload $file = "/path/to/file.txt"; // \SplFileObject | file to upload
try { try {
$result = $api_instance->uploadFile($pet_id, $additional_metadata, $file); $result = $api_instance->uploadFile($pet_id, $additional_metadata, $file);
print_r($result); print_r($result);
} catch (Exception $e) { } catch (Exception $e) {
@ -393,16 +393,16 @@ Name | Type | Description | Notes
### Return type ### Return type
[**\Swagger\Client\Model\ApiResponse**](ApiResponse.md) [**\Swagger\Client\Model\ApiResponse**](../Model/ApiResponse.md)
### Authorization ### Authorization
[petstore_auth](../README.md#petstore_auth) [petstore_auth](../../README.md#petstore_auth)
### HTTP request headers ### HTTP request headers
- **Content-Type**: multipart/form-data - **Content-Type**: multipart/form-data
- **Accept**: application/json - **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to 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)

View File

@ -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 For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
### Example ### Example
```php ```php
<?php <?php
require_once(__DIR__ . '/vendor/autoload.php'); require_once(__DIR__ . '/vendor/autoload.php');
@ -25,7 +25,7 @@ require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\Api\StoreApi(); $api_instance = new Swagger\Client\Api\StoreApi();
$order_id = "order_id_example"; // string | ID of the order that needs to be deleted $order_id = "order_id_example"; // string | ID of the order that needs to be deleted
try { try {
$api_instance->deleteOrder($order_id); $api_instance->deleteOrder($order_id);
} catch (Exception $e) { } catch (Exception $e) {
echo 'Exception when calling StoreApi->deleteOrder: ', $e->getMessage(), "\n"; echo 'Exception when calling StoreApi->deleteOrder: ', $e->getMessage(), "\n";
@ -52,7 +52,7 @@ No authorization required
- **Content-Type**: Not defined - **Content-Type**: Not defined
- **Accept**: application/xml, application/json - **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** # **getInventory**
> map[string,int] getInventory() > map[string,int] getInventory()
@ -61,7 +61,7 @@ Returns pet inventories by status
Returns a map of status codes to quantities Returns a map of status codes to quantities
### Example ### Example
```php ```php
<?php <?php
require_once(__DIR__ . '/vendor/autoload.php'); require_once(__DIR__ . '/vendor/autoload.php');
@ -73,7 +73,7 @@ Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'Y
$api_instance = new Swagger\Client\Api\StoreApi(); $api_instance = new Swagger\Client\Api\StoreApi();
try { try {
$result = $api_instance->getInventory(); $result = $api_instance->getInventory();
print_r($result); print_r($result);
} catch (Exception $e) { } catch (Exception $e) {
@ -87,18 +87,18 @@ This endpoint does not need any parameter.
### Return type ### Return type
[**map[string,int]**](map.md) [**map[string,int]**](../Model/map.md)
### Authorization ### Authorization
[api_key](../README.md#api_key) [api_key](../../README.md#api_key)
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **Content-Type**: Not defined
- **Accept**: application/json - **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to 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** # **getOrderById**
> \Swagger\Client\Model\Order getOrderById($order_id) > \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 For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
### Example ### Example
```php ```php
<?php <?php
require_once(__DIR__ . '/vendor/autoload.php'); require_once(__DIR__ . '/vendor/autoload.php');
@ -115,7 +115,7 @@ require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\Api\StoreApi(); $api_instance = new Swagger\Client\Api\StoreApi();
$order_id = 789; // int | ID of pet that needs to be fetched $order_id = 789; // int | ID of pet that needs to be fetched
try { try {
$result = $api_instance->getOrderById($order_id); $result = $api_instance->getOrderById($order_id);
print_r($result); print_r($result);
} catch (Exception $e) { } catch (Exception $e) {
@ -132,7 +132,7 @@ Name | Type | Description | Notes
### Return type ### Return type
[**\Swagger\Client\Model\Order**](Order.md) [**\Swagger\Client\Model\Order**](../Model/Order.md)
### Authorization ### Authorization
@ -143,7 +143,7 @@ No authorization required
- **Content-Type**: Not defined - **Content-Type**: Not defined
- **Accept**: application/xml, application/json - **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** # **placeOrder**
> \Swagger\Client\Model\Order placeOrder($body) > \Swagger\Client\Model\Order placeOrder($body)
@ -152,7 +152,7 @@ Place an order for a pet
### Example ### Example
```php ```php
<?php <?php
require_once(__DIR__ . '/vendor/autoload.php'); require_once(__DIR__ . '/vendor/autoload.php');
@ -160,7 +160,7 @@ require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\Api\StoreApi(); $api_instance = new Swagger\Client\Api\StoreApi();
$body = new \Swagger\Client\Model\Order(); // \Swagger\Client\Model\Order | order placed for purchasing the pet $body = new \Swagger\Client\Model\Order(); // \Swagger\Client\Model\Order | order placed for purchasing the pet
try { try {
$result = $api_instance->placeOrder($body); $result = $api_instance->placeOrder($body);
print_r($result); print_r($result);
} catch (Exception $e) { } catch (Exception $e) {
@ -173,11 +173,11 @@ try {
Name | Type | Description | Notes 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 ### Return type
[**\Swagger\Client\Model\Order**](Order.md) [**\Swagger\Client\Model\Order**](../Model/Order.md)
### Authorization ### Authorization
@ -188,5 +188,5 @@ No authorization required
- **Content-Type**: Not defined - **Content-Type**: Not defined
- **Accept**: application/xml, application/json - **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)

View File

@ -21,7 +21,7 @@ Create user
This can only be done by the logged in user. This can only be done by the logged in user.
### Example ### Example
```php ```php
<?php <?php
require_once(__DIR__ . '/vendor/autoload.php'); require_once(__DIR__ . '/vendor/autoload.php');
@ -29,7 +29,7 @@ require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\Api\UserApi(); $api_instance = new Swagger\Client\Api\UserApi();
$body = new \Swagger\Client\Model\User(); // \Swagger\Client\Model\User | Created user object $body = new \Swagger\Client\Model\User(); // \Swagger\Client\Model\User | Created user object
try { try {
$api_instance->createUser($body); $api_instance->createUser($body);
} catch (Exception $e) { } catch (Exception $e) {
echo 'Exception when calling UserApi->createUser: ', $e->getMessage(), "\n"; echo 'Exception when calling UserApi->createUser: ', $e->getMessage(), "\n";
@ -41,7 +41,7 @@ try {
Name | Type | Description | Notes 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 ### Return type
@ -56,7 +56,7 @@ No authorization required
- **Content-Type**: Not defined - **Content-Type**: Not defined
- **Accept**: application/xml, application/json - **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**
> createUsersWithArrayInput($body) > createUsersWithArrayInput($body)
@ -65,7 +65,7 @@ Creates list of users with given input array
### Example ### Example
```php ```php
<?php <?php
require_once(__DIR__ . '/vendor/autoload.php'); require_once(__DIR__ . '/vendor/autoload.php');
@ -73,7 +73,7 @@ require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\Api\UserApi(); $api_instance = new Swagger\Client\Api\UserApi();
$body = array(new User()); // \Swagger\Client\Model\User[] | List of user object $body = array(new User()); // \Swagger\Client\Model\User[] | List of user object
try { try {
$api_instance->createUsersWithArrayInput($body); $api_instance->createUsersWithArrayInput($body);
} catch (Exception $e) { } catch (Exception $e) {
echo 'Exception when calling UserApi->createUsersWithArrayInput: ', $e->getMessage(), "\n"; echo 'Exception when calling UserApi->createUsersWithArrayInput: ', $e->getMessage(), "\n";
@ -85,7 +85,7 @@ try {
Name | Type | Description | Notes 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 ### Return type
@ -100,7 +100,7 @@ No authorization required
- **Content-Type**: Not defined - **Content-Type**: Not defined
- **Accept**: application/xml, application/json - **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**
> createUsersWithListInput($body) > createUsersWithListInput($body)
@ -109,7 +109,7 @@ Creates list of users with given input array
### Example ### Example
```php ```php
<?php <?php
require_once(__DIR__ . '/vendor/autoload.php'); require_once(__DIR__ . '/vendor/autoload.php');
@ -117,7 +117,7 @@ require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\Api\UserApi(); $api_instance = new Swagger\Client\Api\UserApi();
$body = array(new User()); // \Swagger\Client\Model\User[] | List of user object $body = array(new User()); // \Swagger\Client\Model\User[] | List of user object
try { try {
$api_instance->createUsersWithListInput($body); $api_instance->createUsersWithListInput($body);
} catch (Exception $e) { } catch (Exception $e) {
echo 'Exception when calling UserApi->createUsersWithListInput: ', $e->getMessage(), "\n"; echo 'Exception when calling UserApi->createUsersWithListInput: ', $e->getMessage(), "\n";
@ -129,7 +129,7 @@ try {
Name | Type | Description | Notes 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 ### Return type
@ -144,7 +144,7 @@ No authorization required
- **Content-Type**: Not defined - **Content-Type**: Not defined
- **Accept**: application/xml, application/json - **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**
> deleteUser($username) > deleteUser($username)
@ -153,7 +153,7 @@ Delete user
This can only be done by the logged in user. This can only be done by the logged in user.
### Example ### Example
```php ```php
<?php <?php
require_once(__DIR__ . '/vendor/autoload.php'); require_once(__DIR__ . '/vendor/autoload.php');
@ -161,7 +161,7 @@ require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\Api\UserApi(); $api_instance = new Swagger\Client\Api\UserApi();
$username = "username_example"; // string | The name that needs to be deleted $username = "username_example"; // string | The name that needs to be deleted
try { try {
$api_instance->deleteUser($username); $api_instance->deleteUser($username);
} catch (Exception $e) { } catch (Exception $e) {
echo 'Exception when calling UserApi->deleteUser: ', $e->getMessage(), "\n"; echo 'Exception when calling UserApi->deleteUser: ', $e->getMessage(), "\n";
@ -188,7 +188,7 @@ No authorization required
- **Content-Type**: Not defined - **Content-Type**: Not defined
- **Accept**: application/xml, application/json - **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** # **getUserByName**
> \Swagger\Client\Model\User getUserByName($username) > \Swagger\Client\Model\User getUserByName($username)
@ -197,7 +197,7 @@ Get user by user name
### Example ### Example
```php ```php
<?php <?php
require_once(__DIR__ . '/vendor/autoload.php'); require_once(__DIR__ . '/vendor/autoload.php');
@ -205,7 +205,7 @@ require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\Api\UserApi(); $api_instance = new Swagger\Client\Api\UserApi();
$username = "username_example"; // string | The name that needs to be fetched. Use user1 for testing. $username = "username_example"; // string | The name that needs to be fetched. Use user1 for testing.
try { try {
$result = $api_instance->getUserByName($username); $result = $api_instance->getUserByName($username);
print_r($result); print_r($result);
} catch (Exception $e) { } catch (Exception $e) {
@ -222,7 +222,7 @@ Name | Type | Description | Notes
### Return type ### Return type
[**\Swagger\Client\Model\User**](User.md) [**\Swagger\Client\Model\User**](../Model/User.md)
### Authorization ### Authorization
@ -233,7 +233,7 @@ No authorization required
- **Content-Type**: Not defined - **Content-Type**: Not defined
- **Accept**: application/xml, application/json - **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** # **loginUser**
> string loginUser($username, $password) > string loginUser($username, $password)
@ -242,7 +242,7 @@ Logs user into the system
### Example ### Example
```php ```php
<?php <?php
require_once(__DIR__ . '/vendor/autoload.php'); require_once(__DIR__ . '/vendor/autoload.php');
@ -251,7 +251,7 @@ $api_instance = new Swagger\Client\Api\UserApi();
$username = "username_example"; // string | The user name for login $username = "username_example"; // string | The user name for login
$password = "password_example"; // string | The password for login in clear text $password = "password_example"; // string | The password for login in clear text
try { try {
$result = $api_instance->loginUser($username, $password); $result = $api_instance->loginUser($username, $password);
print_r($result); print_r($result);
} catch (Exception $e) { } catch (Exception $e) {
@ -280,7 +280,7 @@ No authorization required
- **Content-Type**: Not defined - **Content-Type**: Not defined
- **Accept**: application/xml, application/json - **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**
> logoutUser() > logoutUser()
@ -289,14 +289,14 @@ Logs out current logged in user session
### Example ### Example
```php ```php
<?php <?php
require_once(__DIR__ . '/vendor/autoload.php'); require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\Api\UserApi(); $api_instance = new Swagger\Client\Api\UserApi();
try { try {
$api_instance->logoutUser(); $api_instance->logoutUser();
} catch (Exception $e) { } catch (Exception $e) {
echo 'Exception when calling UserApi->logoutUser: ', $e->getMessage(), "\n"; echo 'Exception when calling UserApi->logoutUser: ', $e->getMessage(), "\n";
@ -320,7 +320,7 @@ No authorization required
- **Content-Type**: Not defined - **Content-Type**: Not defined
- **Accept**: application/xml, application/json - **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**
> updateUser($username, $body) > updateUser($username, $body)
@ -329,7 +329,7 @@ Updated user
This can only be done by the logged in user. This can only be done by the logged in user.
### Example ### Example
```php ```php
<?php <?php
require_once(__DIR__ . '/vendor/autoload.php'); require_once(__DIR__ . '/vendor/autoload.php');
@ -338,7 +338,7 @@ $api_instance = new Swagger\Client\Api\UserApi();
$username = "username_example"; // string | name that need to be deleted $username = "username_example"; // string | name that need to be deleted
$body = new \Swagger\Client\Model\User(); // \Swagger\Client\Model\User | Updated user object $body = new \Swagger\Client\Model\User(); // \Swagger\Client\Model\User | Updated user object
try { try {
$api_instance->updateUser($username, $body); $api_instance->updateUser($username, $body);
} catch (Exception $e) { } catch (Exception $e) {
echo 'Exception when calling UserApi->updateUser: ', $e->getMessage(), "\n"; echo 'Exception when calling UserApi->updateUser: ', $e->getMessage(), "\n";
@ -351,7 +351,7 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**username** | **string**| name that need to be deleted | **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 ### Return type
@ -366,5 +366,5 @@ No authorization required
- **Content-Type**: Not defined - **Content-Type**: Not defined
- **Accept**: application/xml, application/json - **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)

View File

@ -28,7 +28,7 @@ git init
# Adds the files in the local repository and stages them for commit. # Adds the files in the local repository and stages them for commit.
git add . 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" git commit -m "$release_note"
# Sets the new remote # Sets the new remote

View File

@ -26,8 +26,8 @@
*/ */
/** /**
* NOTE: This class is auto generated by the swagger code generator program. * NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen * https://github.com/swagger-api/swagger-codegen
* Do not edit the class manually. * Do not edit the class manually.
*/ */
@ -52,12 +52,14 @@ class FakeApi
/** /**
* API Client * API Client
*
* @var \Swagger\Client\ApiClient instance of the ApiClient * @var \Swagger\Client\ApiClient instance of the ApiClient
*/ */
protected $apiClient; protected $apiClient;
/** /**
* Constructor * Constructor
*
* @param \Swagger\Client\ApiClient|null $apiClient The api client to use * @param \Swagger\Client\ApiClient|null $apiClient The api client to use
*/ */
function __construct(\Swagger\Client\ApiClient $apiClient = null) function __construct(\Swagger\Client\ApiClient $apiClient = null)
@ -66,22 +68,25 @@ class FakeApi
$apiClient = new ApiClient(); $apiClient = new ApiClient();
$apiClient->getConfig()->setHost('http://petstore.swagger.io/v2'); $apiClient->getConfig()->setHost('http://petstore.swagger.io/v2');
} }
$this->apiClient = $apiClient; $this->apiClient = $apiClient;
} }
/** /**
* Get API client * Get API client
*
* @return \Swagger\Client\ApiClient get the API client * @return \Swagger\Client\ApiClient get the API client
*/ */
public function getApiClient() public function getApiClient()
{ {
return $this->apiClient; return $this->apiClient;
} }
/** /**
* Set the API client * Set the API client
*
* @param \Swagger\Client\ApiClient $apiClient set the API client * @param \Swagger\Client\ApiClient $apiClient set the API client
*
* @return FakeApi * @return FakeApi
*/ */
public function setApiClient(\Swagger\Client\ApiClient $apiClient) public function setApiClient(\Swagger\Client\ApiClient $apiClient)
@ -89,9 +94,9 @@ class FakeApi
$this->apiClient = $apiClient; $this->apiClient = $apiClient;
return $this; return $this;
} }
/** /**
* testEndpointParameters * Operation testEndpointParameters
* *
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
* *
@ -107,18 +112,19 @@ class FakeApi
* @param \DateTime $date None (optional) * @param \DateTime $date None (optional)
* @param \DateTime $date_time None (optional) * @param \DateTime $date_time None (optional)
* @param string $password None (optional) * @param string $password None (optional)
*
* @return void * @return void
* @throws \Swagger\Client\ApiException on non-2xx response * @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) 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); list($response) = $this->testEndpointParametersWithHttpInfo($number, $double, $string, $byte, $integer, $int32, $int64, $float, $binary, $date, $date_time, $password);
return $response; return $response;
} }
/** /**
* testEndpointParametersWithHttpInfo * Operation testEndpointParametersWithHttpInfo
* *
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
* *
@ -134,6 +140,7 @@ class FakeApi
* @param \DateTime $date None (optional) * @param \DateTime $date None (optional)
* @param \DateTime $date_time None (optional) * @param \DateTime $date_time None (optional)
* @param string $password None (optional) * @param string $password None (optional)
*
* @return Array of null, HTTP status code, HTTP response headers (array of strings) * @return Array of null, HTTP status code, HTTP response headers (array of strings)
* @throws \Swagger\Client\ApiException on non-2xx response * @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.'); throw new \InvalidArgumentException('invalid length for "$password" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 10.');
} }
// parse inputs // parse inputs
$resourcePath = "/fake"; $resourcePath = "/fake";
$httpBody = ''; $httpBody = '';
@ -214,7 +221,7 @@ class FakeApi
$headerParams['Accept'] = $_header_accept; $headerParams['Accept'] = $_header_accept;
} }
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
@ -259,7 +266,7 @@ class FakeApi
$formParams['password'] = $this->apiClient->getSerializer()->toFormValue($password); $formParams['password'] = $this->apiClient->getSerializer()->toFormValue($password);
} }
// for model (json/xml) // for model (json/xml)
if (isset($_tempBody)) { if (isset($_tempBody)) {
$httpBody = $_tempBody; // $_tempBody is the method argument, if present $httpBody = $_tempBody; // $_tempBody is the method argument, if present
@ -278,7 +285,7 @@ class FakeApi
} catch (ApiException $e) { } catch (ApiException $e) {
switch ($e->getCode()) { switch ($e->getCode()) {
} }
throw $e; throw $e;
} }
} }

View File

@ -26,8 +26,8 @@
*/ */
/** /**
* NOTE: This class is auto generated by the swagger code generator program. * NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen * https://github.com/swagger-api/swagger-codegen
* Do not edit the class manually. * Do not edit the class manually.
*/ */
@ -52,12 +52,14 @@ class PetApi
/** /**
* API Client * API Client
*
* @var \Swagger\Client\ApiClient instance of the ApiClient * @var \Swagger\Client\ApiClient instance of the ApiClient
*/ */
protected $apiClient; protected $apiClient;
/** /**
* Constructor * Constructor
*
* @param \Swagger\Client\ApiClient|null $apiClient The api client to use * @param \Swagger\Client\ApiClient|null $apiClient The api client to use
*/ */
function __construct(\Swagger\Client\ApiClient $apiClient = null) function __construct(\Swagger\Client\ApiClient $apiClient = null)
@ -66,22 +68,25 @@ class PetApi
$apiClient = new ApiClient(); $apiClient = new ApiClient();
$apiClient->getConfig()->setHost('http://petstore.swagger.io/v2'); $apiClient->getConfig()->setHost('http://petstore.swagger.io/v2');
} }
$this->apiClient = $apiClient; $this->apiClient = $apiClient;
} }
/** /**
* Get API client * Get API client
*
* @return \Swagger\Client\ApiClient get the API client * @return \Swagger\Client\ApiClient get the API client
*/ */
public function getApiClient() public function getApiClient()
{ {
return $this->apiClient; return $this->apiClient;
} }
/** /**
* Set the API client * Set the API client
*
* @param \Swagger\Client\ApiClient $apiClient set the API client * @param \Swagger\Client\ApiClient $apiClient set the API client
*
* @return PetApi * @return PetApi
*/ */
public function setApiClient(\Swagger\Client\ApiClient $apiClient) public function setApiClient(\Swagger\Client\ApiClient $apiClient)
@ -89,29 +94,31 @@ class PetApi
$this->apiClient = $apiClient; $this->apiClient = $apiClient;
return $this; return $this;
} }
/** /**
* addPet * Operation addPet
* *
* Add a new pet to the store * Add a new pet to the store
* *
* @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required) * @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required)
*
* @return void * @return void
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
public function addPet($body) public function addPet($body)
{ {
list($response) = $this->addPetWithHttpInfo ($body); list($response) = $this->addPetWithHttpInfo($body);
return $response; return $response;
} }
/** /**
* addPetWithHttpInfo * Operation addPetWithHttpInfo
* *
* Add a new pet to the store * Add a new pet to the store
* *
* @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required) * @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) * @return Array of null, HTTP status code, HTTP response headers (array of strings)
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
@ -122,7 +129,7 @@ class PetApi
if ($body === null) { if ($body === null) {
throw new \InvalidArgumentException('Missing the required parameter $body when calling addPet'); throw new \InvalidArgumentException('Missing the required parameter $body when calling addPet');
} }
// parse inputs // parse inputs
$resourcePath = "/pet"; $resourcePath = "/pet";
$httpBody = ''; $httpBody = '';
@ -134,7 +141,7 @@ class PetApi
$headerParams['Accept'] = $_header_accept; $headerParams['Accept'] = $_header_accept;
} }
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/xml')); $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/xml'));
@ -147,7 +154,7 @@ class PetApi
if (isset($body)) { if (isset($body)) {
$_tempBody = $body; $_tempBody = $body;
} }
// for model (json/xml) // for model (json/xml)
if (isset($_tempBody)) { if (isset($_tempBody)) {
$httpBody = $_tempBody; // $_tempBody is the method argument, if present $httpBody = $_tempBody; // $_tempBody is the method argument, if present
@ -171,34 +178,36 @@ class PetApi
} catch (ApiException $e) { } catch (ApiException $e) {
switch ($e->getCode()) { switch ($e->getCode()) {
} }
throw $e; throw $e;
} }
} }
/** /**
* deletePet * Operation deletePet
* *
* Deletes a pet * Deletes a pet
* *
* @param int $pet_id Pet id to delete (required) * @param int $pet_id Pet id to delete (required)
* @param string $api_key (optional) * @param string $api_key (optional)
*
* @return void * @return void
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
public function deletePet($pet_id, $api_key = null) public function deletePet($pet_id, $api_key = null)
{ {
list($response) = $this->deletePetWithHttpInfo ($pet_id, $api_key); list($response) = $this->deletePetWithHttpInfo($pet_id, $api_key);
return $response; return $response;
} }
/** /**
* deletePetWithHttpInfo * Operation deletePetWithHttpInfo
* *
* Deletes a pet * Deletes a pet
* *
* @param int $pet_id Pet id to delete (required) * @param int $pet_id Pet id to delete (required)
* @param string $api_key (optional) * @param string $api_key (optional)
*
* @return Array of null, HTTP status code, HTTP response headers (array of strings) * @return Array of null, HTTP status code, HTTP response headers (array of strings)
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
@ -209,7 +218,7 @@ class PetApi
if ($pet_id === null) { if ($pet_id === null) {
throw new \InvalidArgumentException('Missing the required parameter $pet_id when calling deletePet'); throw new \InvalidArgumentException('Missing the required parameter $pet_id when calling deletePet');
} }
// parse inputs // parse inputs
$resourcePath = "/pet/{petId}"; $resourcePath = "/pet/{petId}";
$httpBody = ''; $httpBody = '';
@ -221,7 +230,7 @@ class PetApi
$headerParams['Accept'] = $_header_accept; $headerParams['Accept'] = $_header_accept;
} }
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
// header params // header params
if ($api_key !== null) { if ($api_key !== null) {
@ -240,7 +249,7 @@ class PetApi
// for model (json/xml) // for model (json/xml)
if (isset($_tempBody)) { if (isset($_tempBody)) {
$httpBody = $_tempBody; // $_tempBody is the method argument, if present $httpBody = $_tempBody; // $_tempBody is the method argument, if present
@ -264,32 +273,34 @@ class PetApi
} catch (ApiException $e) { } catch (ApiException $e) {
switch ($e->getCode()) { switch ($e->getCode()) {
} }
throw $e; throw $e;
} }
} }
/** /**
* findPetsByStatus * Operation findPetsByStatus
* *
* Finds Pets by status * Finds Pets by status
* *
* @param string[] $status Status values that need to be considered for filter (required) * @param string[] $status Status values that need to be considered for filter (required)
*
* @return \Swagger\Client\Model\Pet[] * @return \Swagger\Client\Model\Pet[]
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
public function findPetsByStatus($status) public function findPetsByStatus($status)
{ {
list($response) = $this->findPetsByStatusWithHttpInfo ($status); list($response) = $this->findPetsByStatusWithHttpInfo($status);
return $response; return $response;
} }
/** /**
* findPetsByStatusWithHttpInfo * Operation findPetsByStatusWithHttpInfo
* *
* Finds Pets by status * Finds Pets by status
* *
* @param string[] $status Status values that need to be considered for filter (required) * @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) * @return Array of \Swagger\Client\Model\Pet[], HTTP status code, HTTP response headers (array of strings)
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
@ -300,7 +311,7 @@ class PetApi
if ($status === null) { if ($status === null) {
throw new \InvalidArgumentException('Missing the required parameter $status when calling findPetsByStatus'); throw new \InvalidArgumentException('Missing the required parameter $status when calling findPetsByStatus');
} }
// parse inputs // parse inputs
$resourcePath = "/pet/findByStatus"; $resourcePath = "/pet/findByStatus";
$httpBody = ''; $httpBody = '';
@ -312,7 +323,7 @@ class PetApi
$headerParams['Accept'] = $_header_accept; $headerParams['Accept'] = $_header_accept;
} }
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
// query params // query params
if (is_array($status)) { if (is_array($status)) {
$status = $this->apiClient->getSerializer()->serializeCollection($status, 'csv', true); $status = $this->apiClient->getSerializer()->serializeCollection($status, 'csv', true);
@ -327,7 +338,7 @@ class PetApi
// for model (json/xml) // for model (json/xml)
if (isset($_tempBody)) { if (isset($_tempBody)) {
$httpBody = $_tempBody; // $_tempBody is the method argument, if present $httpBody = $_tempBody; // $_tempBody is the method argument, if present
@ -358,32 +369,34 @@ class PetApi
$e->setResponseObject($data); $e->setResponseObject($data);
break; break;
} }
throw $e; throw $e;
} }
} }
/** /**
* findPetsByTags * Operation findPetsByTags
* *
* Finds Pets by tags * Finds Pets by tags
* *
* @param string[] $tags Tags to filter by (required) * @param string[] $tags Tags to filter by (required)
*
* @return \Swagger\Client\Model\Pet[] * @return \Swagger\Client\Model\Pet[]
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
public function findPetsByTags($tags) public function findPetsByTags($tags)
{ {
list($response) = $this->findPetsByTagsWithHttpInfo ($tags); list($response) = $this->findPetsByTagsWithHttpInfo($tags);
return $response; return $response;
} }
/** /**
* findPetsByTagsWithHttpInfo * Operation findPetsByTagsWithHttpInfo
* *
* Finds Pets by tags * Finds Pets by tags
* *
* @param string[] $tags Tags to filter by (required) * @param string[] $tags Tags to filter by (required)
*
* @return Array of \Swagger\Client\Model\Pet[], HTTP status code, HTTP response headers (array of strings) * @return Array of \Swagger\Client\Model\Pet[], HTTP status code, HTTP response headers (array of strings)
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
@ -394,7 +407,7 @@ class PetApi
if ($tags === null) { if ($tags === null) {
throw new \InvalidArgumentException('Missing the required parameter $tags when calling findPetsByTags'); throw new \InvalidArgumentException('Missing the required parameter $tags when calling findPetsByTags');
} }
// parse inputs // parse inputs
$resourcePath = "/pet/findByTags"; $resourcePath = "/pet/findByTags";
$httpBody = ''; $httpBody = '';
@ -406,7 +419,7 @@ class PetApi
$headerParams['Accept'] = $_header_accept; $headerParams['Accept'] = $_header_accept;
} }
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
// query params // query params
if (is_array($tags)) { if (is_array($tags)) {
$tags = $this->apiClient->getSerializer()->serializeCollection($tags, 'csv', true); $tags = $this->apiClient->getSerializer()->serializeCollection($tags, 'csv', true);
@ -421,7 +434,7 @@ class PetApi
// for model (json/xml) // for model (json/xml)
if (isset($_tempBody)) { if (isset($_tempBody)) {
$httpBody = $_tempBody; // $_tempBody is the method argument, if present $httpBody = $_tempBody; // $_tempBody is the method argument, if present
@ -452,32 +465,34 @@ class PetApi
$e->setResponseObject($data); $e->setResponseObject($data);
break; break;
} }
throw $e; throw $e;
} }
} }
/** /**
* getPetById * Operation getPetById
* *
* Find pet by ID * Find pet by ID
* *
* @param int $pet_id ID of pet to return (required) * @param int $pet_id ID of pet to return (required)
*
* @return \Swagger\Client\Model\Pet * @return \Swagger\Client\Model\Pet
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
public function getPetById($pet_id) public function getPetById($pet_id)
{ {
list($response) = $this->getPetByIdWithHttpInfo ($pet_id); list($response) = $this->getPetByIdWithHttpInfo($pet_id);
return $response; return $response;
} }
/** /**
* getPetByIdWithHttpInfo * Operation getPetByIdWithHttpInfo
* *
* Find pet by ID * Find pet by ID
* *
* @param int $pet_id ID of pet to return (required) * @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) * @return Array of \Swagger\Client\Model\Pet, HTTP status code, HTTP response headers (array of strings)
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
@ -488,7 +503,7 @@ class PetApi
if ($pet_id === null) { if ($pet_id === null) {
throw new \InvalidArgumentException('Missing the required parameter $pet_id when calling getPetById'); throw new \InvalidArgumentException('Missing the required parameter $pet_id when calling getPetById');
} }
// parse inputs // parse inputs
$resourcePath = "/pet/{petId}"; $resourcePath = "/pet/{petId}";
$httpBody = ''; $httpBody = '';
@ -500,7 +515,7 @@ class PetApi
$headerParams['Accept'] = $_header_accept; $headerParams['Accept'] = $_header_accept;
} }
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
// path params // path params
@ -516,7 +531,7 @@ class PetApi
// for model (json/xml) // for model (json/xml)
if (isset($_tempBody)) { if (isset($_tempBody)) {
$httpBody = $_tempBody; // $_tempBody is the method argument, if present $httpBody = $_tempBody; // $_tempBody is the method argument, if present
@ -549,32 +564,34 @@ class PetApi
$e->setResponseObject($data); $e->setResponseObject($data);
break; break;
} }
throw $e; throw $e;
} }
} }
/** /**
* updatePet * Operation updatePet
* *
* Update an existing pet * Update an existing pet
* *
* @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required) * @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required)
*
* @return void * @return void
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
public function updatePet($body) public function updatePet($body)
{ {
list($response) = $this->updatePetWithHttpInfo ($body); list($response) = $this->updatePetWithHttpInfo($body);
return $response; return $response;
} }
/** /**
* updatePetWithHttpInfo * Operation updatePetWithHttpInfo
* *
* Update an existing pet * Update an existing pet
* *
* @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required) * @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) * @return Array of null, HTTP status code, HTTP response headers (array of strings)
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
@ -585,7 +602,7 @@ class PetApi
if ($body === null) { if ($body === null) {
throw new \InvalidArgumentException('Missing the required parameter $body when calling updatePet'); throw new \InvalidArgumentException('Missing the required parameter $body when calling updatePet');
} }
// parse inputs // parse inputs
$resourcePath = "/pet"; $resourcePath = "/pet";
$httpBody = ''; $httpBody = '';
@ -597,7 +614,7 @@ class PetApi
$headerParams['Accept'] = $_header_accept; $headerParams['Accept'] = $_header_accept;
} }
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/xml')); $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/xml'));
@ -610,7 +627,7 @@ class PetApi
if (isset($body)) { if (isset($body)) {
$_tempBody = $body; $_tempBody = $body;
} }
// for model (json/xml) // for model (json/xml)
if (isset($_tempBody)) { if (isset($_tempBody)) {
$httpBody = $_tempBody; // $_tempBody is the method argument, if present $httpBody = $_tempBody; // $_tempBody is the method argument, if present
@ -634,36 +651,38 @@ class PetApi
} catch (ApiException $e) { } catch (ApiException $e) {
switch ($e->getCode()) { switch ($e->getCode()) {
} }
throw $e; throw $e;
} }
} }
/** /**
* updatePetWithForm * Operation updatePetWithForm
* *
* Updates a pet in the store with form data * Updates a pet in the store with form data
* *
* @param int $pet_id ID of pet that needs to be updated (required) * @param int $pet_id ID of pet that needs to be updated (required)
* @param string $name Updated name of the pet (optional) * @param string $name Updated name of the pet (optional)
* @param string $status Updated status of the pet (optional) * @param string $status Updated status of the pet (optional)
*
* @return void * @return void
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
public function updatePetWithForm($pet_id, $name = null, $status = null) public function updatePetWithForm($pet_id, $name = null, $status = null)
{ {
list($response) = $this->updatePetWithFormWithHttpInfo ($pet_id, $name, $status); list($response) = $this->updatePetWithFormWithHttpInfo($pet_id, $name, $status);
return $response; return $response;
} }
/** /**
* updatePetWithFormWithHttpInfo * Operation updatePetWithFormWithHttpInfo
* *
* Updates a pet in the store with form data * Updates a pet in the store with form data
* *
* @param int $pet_id ID of pet that needs to be updated (required) * @param int $pet_id ID of pet that needs to be updated (required)
* @param string $name Updated name of the pet (optional) * @param string $name Updated name of the pet (optional)
* @param string $status Updated status 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) * @return Array of null, HTTP status code, HTTP response headers (array of strings)
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
@ -674,7 +693,7 @@ class PetApi
if ($pet_id === null) { if ($pet_id === null) {
throw new \InvalidArgumentException('Missing the required parameter $pet_id when calling updatePetWithForm'); throw new \InvalidArgumentException('Missing the required parameter $pet_id when calling updatePetWithForm');
} }
// parse inputs // parse inputs
$resourcePath = "/pet/{petId}"; $resourcePath = "/pet/{petId}";
$httpBody = ''; $httpBody = '';
@ -686,7 +705,7 @@ class PetApi
$headerParams['Accept'] = $_header_accept; $headerParams['Accept'] = $_header_accept;
} }
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/x-www-form-urlencoded')); $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/x-www-form-urlencoded'));
// path params // path params
@ -708,7 +727,7 @@ class PetApi
$formParams['status'] = $this->apiClient->getSerializer()->toFormValue($status); $formParams['status'] = $this->apiClient->getSerializer()->toFormValue($status);
} }
// for model (json/xml) // for model (json/xml)
if (isset($_tempBody)) { if (isset($_tempBody)) {
$httpBody = $_tempBody; // $_tempBody is the method argument, if present $httpBody = $_tempBody; // $_tempBody is the method argument, if present
@ -732,36 +751,38 @@ class PetApi
} catch (ApiException $e) { } catch (ApiException $e) {
switch ($e->getCode()) { switch ($e->getCode()) {
} }
throw $e; throw $e;
} }
} }
/** /**
* uploadFile * Operation uploadFile
* *
* uploads an image * uploads an image
* *
* @param int $pet_id ID of pet to update (required) * @param int $pet_id ID of pet to update (required)
* @param string $additional_metadata Additional data to pass to server (optional) * @param string $additional_metadata Additional data to pass to server (optional)
* @param \SplFileObject $file file to upload (optional) * @param \SplFileObject $file file to upload (optional)
*
* @return \Swagger\Client\Model\ApiResponse * @return \Swagger\Client\Model\ApiResponse
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
public function uploadFile($pet_id, $additional_metadata = null, $file = null) public function uploadFile($pet_id, $additional_metadata = null, $file = null)
{ {
list($response) = $this->uploadFileWithHttpInfo ($pet_id, $additional_metadata, $file); list($response) = $this->uploadFileWithHttpInfo($pet_id, $additional_metadata, $file);
return $response; return $response;
} }
/** /**
* uploadFileWithHttpInfo * Operation uploadFileWithHttpInfo
* *
* uploads an image * uploads an image
* *
* @param int $pet_id ID of pet to update (required) * @param int $pet_id ID of pet to update (required)
* @param string $additional_metadata Additional data to pass to server (optional) * @param string $additional_metadata Additional data to pass to server (optional)
* @param \SplFileObject $file file to upload (optional) * @param \SplFileObject $file file to upload (optional)
*
* @return Array of \Swagger\Client\Model\ApiResponse, HTTP status code, HTTP response headers (array of strings) * @return Array of \Swagger\Client\Model\ApiResponse, HTTP status code, HTTP response headers (array of strings)
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
@ -772,7 +793,7 @@ class PetApi
if ($pet_id === null) { if ($pet_id === null) {
throw new \InvalidArgumentException('Missing the required parameter $pet_id when calling uploadFile'); throw new \InvalidArgumentException('Missing the required parameter $pet_id when calling uploadFile');
} }
// parse inputs // parse inputs
$resourcePath = "/pet/{petId}/uploadImage"; $resourcePath = "/pet/{petId}/uploadImage";
$httpBody = ''; $httpBody = '';
@ -784,7 +805,7 @@ class PetApi
$headerParams['Accept'] = $_header_accept; $headerParams['Accept'] = $_header_accept;
} }
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('multipart/form-data')); $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('multipart/form-data'));
// path params // path params
@ -812,7 +833,7 @@ class PetApi
} }
} }
// for model (json/xml) // for model (json/xml)
if (isset($_tempBody)) { if (isset($_tempBody)) {
$httpBody = $_tempBody; // $_tempBody is the method argument, if present $httpBody = $_tempBody; // $_tempBody is the method argument, if present
@ -843,7 +864,7 @@ class PetApi
$e->setResponseObject($data); $e->setResponseObject($data);
break; break;
} }
throw $e; throw $e;
} }
} }

View File

@ -26,8 +26,8 @@
*/ */
/** /**
* NOTE: This class is auto generated by the swagger code generator program. * NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen * https://github.com/swagger-api/swagger-codegen
* Do not edit the class manually. * Do not edit the class manually.
*/ */
@ -52,12 +52,14 @@ class StoreApi
/** /**
* API Client * API Client
*
* @var \Swagger\Client\ApiClient instance of the ApiClient * @var \Swagger\Client\ApiClient instance of the ApiClient
*/ */
protected $apiClient; protected $apiClient;
/** /**
* Constructor * Constructor
*
* @param \Swagger\Client\ApiClient|null $apiClient The api client to use * @param \Swagger\Client\ApiClient|null $apiClient The api client to use
*/ */
function __construct(\Swagger\Client\ApiClient $apiClient = null) function __construct(\Swagger\Client\ApiClient $apiClient = null)
@ -66,22 +68,25 @@ class StoreApi
$apiClient = new ApiClient(); $apiClient = new ApiClient();
$apiClient->getConfig()->setHost('http://petstore.swagger.io/v2'); $apiClient->getConfig()->setHost('http://petstore.swagger.io/v2');
} }
$this->apiClient = $apiClient; $this->apiClient = $apiClient;
} }
/** /**
* Get API client * Get API client
*
* @return \Swagger\Client\ApiClient get the API client * @return \Swagger\Client\ApiClient get the API client
*/ */
public function getApiClient() public function getApiClient()
{ {
return $this->apiClient; return $this->apiClient;
} }
/** /**
* Set the API client * Set the API client
*
* @param \Swagger\Client\ApiClient $apiClient set the API client * @param \Swagger\Client\ApiClient $apiClient set the API client
*
* @return StoreApi * @return StoreApi
*/ */
public function setApiClient(\Swagger\Client\ApiClient $apiClient) public function setApiClient(\Swagger\Client\ApiClient $apiClient)
@ -89,29 +94,31 @@ class StoreApi
$this->apiClient = $apiClient; $this->apiClient = $apiClient;
return $this; return $this;
} }
/** /**
* deleteOrder * Operation deleteOrder
* *
* Delete purchase order by ID * Delete purchase order by ID
* *
* @param string $order_id ID of the order that needs to be deleted (required) * @param string $order_id ID of the order that needs to be deleted (required)
*
* @return void * @return void
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
public function deleteOrder($order_id) public function deleteOrder($order_id)
{ {
list($response) = $this->deleteOrderWithHttpInfo ($order_id); list($response) = $this->deleteOrderWithHttpInfo($order_id);
return $response; return $response;
} }
/** /**
* deleteOrderWithHttpInfo * Operation deleteOrderWithHttpInfo
* *
* Delete purchase order by ID * Delete purchase order by ID
* *
* @param string $order_id ID of the order that needs to be deleted (required) * @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) * @return Array of null, HTTP status code, HTTP response headers (array of strings)
* @throws \Swagger\Client\ApiException on non-2xx response * @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.'); throw new \InvalidArgumentException('invalid value for "$order_id" when calling StoreApi.deleteOrder, must be bigger than or equal to 1.0.');
} }
// parse inputs // parse inputs
$resourcePath = "/store/order/{orderId}"; $resourcePath = "/store/order/{orderId}";
$httpBody = ''; $httpBody = '';
@ -138,7 +145,7 @@ class StoreApi
$headerParams['Accept'] = $_header_accept; $headerParams['Accept'] = $_header_accept;
} }
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
// path params // path params
@ -154,7 +161,7 @@ class StoreApi
// for model (json/xml) // for model (json/xml)
if (isset($_tempBody)) { if (isset($_tempBody)) {
$httpBody = $_tempBody; // $_tempBody is the method argument, if present $httpBody = $_tempBody; // $_tempBody is the method argument, if present
@ -173,36 +180,38 @@ class StoreApi
} catch (ApiException $e) { } catch (ApiException $e) {
switch ($e->getCode()) { switch ($e->getCode()) {
} }
throw $e; throw $e;
} }
} }
/** /**
* getInventory * Operation getInventory
* *
* Returns pet inventories by status * Returns pet inventories by status
* *
*
* @return map[string,int] * @return map[string,int]
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
public function getInventory() public function getInventory()
{ {
list($response) = $this->getInventoryWithHttpInfo (); list($response) = $this->getInventoryWithHttpInfo();
return $response; return $response;
} }
/** /**
* getInventoryWithHttpInfo * Operation getInventoryWithHttpInfo
* *
* Returns pet inventories by status * Returns pet inventories by status
* *
*
* @return Array of map[string,int], HTTP status code, HTTP response headers (array of strings) * @return Array of map[string,int], HTTP status code, HTTP response headers (array of strings)
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
public function getInventoryWithHttpInfo() public function getInventoryWithHttpInfo()
{ {
// parse inputs // parse inputs
$resourcePath = "/store/inventory"; $resourcePath = "/store/inventory";
$httpBody = ''; $httpBody = '';
@ -214,7 +223,7 @@ class StoreApi
$headerParams['Accept'] = $_header_accept; $headerParams['Accept'] = $_header_accept;
} }
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
@ -223,7 +232,7 @@ class StoreApi
// for model (json/xml) // for model (json/xml)
if (isset($_tempBody)) { if (isset($_tempBody)) {
$httpBody = $_tempBody; // $_tempBody is the method argument, if present $httpBody = $_tempBody; // $_tempBody is the method argument, if present
@ -256,32 +265,34 @@ class StoreApi
$e->setResponseObject($data); $e->setResponseObject($data);
break; break;
} }
throw $e; throw $e;
} }
} }
/** /**
* getOrderById * Operation getOrderById
* *
* Find purchase order by ID * Find purchase order by ID
* *
* @param int $order_id ID of pet that needs to be fetched (required) * @param int $order_id ID of pet that needs to be fetched (required)
*
* @return \Swagger\Client\Model\Order * @return \Swagger\Client\Model\Order
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
public function getOrderById($order_id) public function getOrderById($order_id)
{ {
list($response) = $this->getOrderByIdWithHttpInfo ($order_id); list($response) = $this->getOrderByIdWithHttpInfo($order_id);
return $response; return $response;
} }
/** /**
* getOrderByIdWithHttpInfo * Operation getOrderByIdWithHttpInfo
* *
* Find purchase order by ID * Find purchase order by ID
* *
* @param int $order_id ID of pet that needs to be fetched (required) * @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) * @return Array of \Swagger\Client\Model\Order, HTTP status code, HTTP response headers (array of strings)
* @throws \Swagger\Client\ApiException on non-2xx response * @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.'); throw new \InvalidArgumentException('invalid value for "$order_id" when calling StoreApi.getOrderById, must be bigger than or equal to 1.0.');
} }
// parse inputs // parse inputs
$resourcePath = "/store/order/{orderId}"; $resourcePath = "/store/order/{orderId}";
$httpBody = ''; $httpBody = '';
@ -311,7 +322,7 @@ class StoreApi
$headerParams['Accept'] = $_header_accept; $headerParams['Accept'] = $_header_accept;
} }
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
// path params // path params
@ -327,7 +338,7 @@ class StoreApi
// for model (json/xml) // for model (json/xml)
if (isset($_tempBody)) { if (isset($_tempBody)) {
$httpBody = $_tempBody; // $_tempBody is the method argument, if present $httpBody = $_tempBody; // $_tempBody is the method argument, if present
@ -353,32 +364,34 @@ class StoreApi
$e->setResponseObject($data); $e->setResponseObject($data);
break; break;
} }
throw $e; throw $e;
} }
} }
/** /**
* placeOrder * Operation placeOrder
* *
* Place an order for a pet * Place an order for a pet
* *
* @param \Swagger\Client\Model\Order $body order placed for purchasing the pet (required) * @param \Swagger\Client\Model\Order $body order placed for purchasing the pet (required)
*
* @return \Swagger\Client\Model\Order * @return \Swagger\Client\Model\Order
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
public function placeOrder($body) public function placeOrder($body)
{ {
list($response) = $this->placeOrderWithHttpInfo ($body); list($response) = $this->placeOrderWithHttpInfo($body);
return $response; return $response;
} }
/** /**
* placeOrderWithHttpInfo * Operation placeOrderWithHttpInfo
* *
* Place an order for a pet * Place an order for a pet
* *
* @param \Swagger\Client\Model\Order $body order placed for purchasing the pet (required) * @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) * @return Array of \Swagger\Client\Model\Order, HTTP status code, HTTP response headers (array of strings)
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
@ -389,7 +402,7 @@ class StoreApi
if ($body === null) { if ($body === null) {
throw new \InvalidArgumentException('Missing the required parameter $body when calling placeOrder'); throw new \InvalidArgumentException('Missing the required parameter $body when calling placeOrder');
} }
// parse inputs // parse inputs
$resourcePath = "/store/order"; $resourcePath = "/store/order";
$httpBody = ''; $httpBody = '';
@ -401,7 +414,7 @@ class StoreApi
$headerParams['Accept'] = $_header_accept; $headerParams['Accept'] = $_header_accept;
} }
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
@ -414,7 +427,7 @@ class StoreApi
if (isset($body)) { if (isset($body)) {
$_tempBody = $body; $_tempBody = $body;
} }
// for model (json/xml) // for model (json/xml)
if (isset($_tempBody)) { if (isset($_tempBody)) {
$httpBody = $_tempBody; // $_tempBody is the method argument, if present $httpBody = $_tempBody; // $_tempBody is the method argument, if present
@ -440,7 +453,7 @@ class StoreApi
$e->setResponseObject($data); $e->setResponseObject($data);
break; break;
} }
throw $e; throw $e;
} }
} }

View File

@ -26,8 +26,8 @@
*/ */
/** /**
* NOTE: This class is auto generated by the swagger code generator program. * NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen * https://github.com/swagger-api/swagger-codegen
* Do not edit the class manually. * Do not edit the class manually.
*/ */
@ -52,12 +52,14 @@ class UserApi
/** /**
* API Client * API Client
*
* @var \Swagger\Client\ApiClient instance of the ApiClient * @var \Swagger\Client\ApiClient instance of the ApiClient
*/ */
protected $apiClient; protected $apiClient;
/** /**
* Constructor * Constructor
*
* @param \Swagger\Client\ApiClient|null $apiClient The api client to use * @param \Swagger\Client\ApiClient|null $apiClient The api client to use
*/ */
function __construct(\Swagger\Client\ApiClient $apiClient = null) function __construct(\Swagger\Client\ApiClient $apiClient = null)
@ -66,22 +68,25 @@ class UserApi
$apiClient = new ApiClient(); $apiClient = new ApiClient();
$apiClient->getConfig()->setHost('http://petstore.swagger.io/v2'); $apiClient->getConfig()->setHost('http://petstore.swagger.io/v2');
} }
$this->apiClient = $apiClient; $this->apiClient = $apiClient;
} }
/** /**
* Get API client * Get API client
*
* @return \Swagger\Client\ApiClient get the API client * @return \Swagger\Client\ApiClient get the API client
*/ */
public function getApiClient() public function getApiClient()
{ {
return $this->apiClient; return $this->apiClient;
} }
/** /**
* Set the API client * Set the API client
*
* @param \Swagger\Client\ApiClient $apiClient set the API client * @param \Swagger\Client\ApiClient $apiClient set the API client
*
* @return UserApi * @return UserApi
*/ */
public function setApiClient(\Swagger\Client\ApiClient $apiClient) public function setApiClient(\Swagger\Client\ApiClient $apiClient)
@ -89,29 +94,31 @@ class UserApi
$this->apiClient = $apiClient; $this->apiClient = $apiClient;
return $this; return $this;
} }
/** /**
* createUser * Operation createUser
* *
* Create user * Create user
* *
* @param \Swagger\Client\Model\User $body Created user object (required) * @param \Swagger\Client\Model\User $body Created user object (required)
*
* @return void * @return void
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
public function createUser($body) public function createUser($body)
{ {
list($response) = $this->createUserWithHttpInfo ($body); list($response) = $this->createUserWithHttpInfo($body);
return $response; return $response;
} }
/** /**
* createUserWithHttpInfo * Operation createUserWithHttpInfo
* *
* Create user * Create user
* *
* @param \Swagger\Client\Model\User $body Created user object (required) * @param \Swagger\Client\Model\User $body Created user object (required)
*
* @return Array of null, HTTP status code, HTTP response headers (array of strings) * @return Array of null, HTTP status code, HTTP response headers (array of strings)
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
@ -122,7 +129,7 @@ class UserApi
if ($body === null) { if ($body === null) {
throw new \InvalidArgumentException('Missing the required parameter $body when calling createUser'); throw new \InvalidArgumentException('Missing the required parameter $body when calling createUser');
} }
// parse inputs // parse inputs
$resourcePath = "/user"; $resourcePath = "/user";
$httpBody = ''; $httpBody = '';
@ -134,7 +141,7 @@ class UserApi
$headerParams['Accept'] = $_header_accept; $headerParams['Accept'] = $_header_accept;
} }
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
@ -147,7 +154,7 @@ class UserApi
if (isset($body)) { if (isset($body)) {
$_tempBody = $body; $_tempBody = $body;
} }
// for model (json/xml) // for model (json/xml)
if (isset($_tempBody)) { if (isset($_tempBody)) {
$httpBody = $_tempBody; // $_tempBody is the method argument, if present $httpBody = $_tempBody; // $_tempBody is the method argument, if present
@ -166,32 +173,34 @@ class UserApi
} catch (ApiException $e) { } catch (ApiException $e) {
switch ($e->getCode()) { switch ($e->getCode()) {
} }
throw $e; throw $e;
} }
} }
/** /**
* createUsersWithArrayInput * Operation createUsersWithArrayInput
* *
* Creates list of users with given input array * Creates list of users with given input array
* *
* @param \Swagger\Client\Model\User[] $body List of user object (required) * @param \Swagger\Client\Model\User[] $body List of user object (required)
*
* @return void * @return void
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
public function createUsersWithArrayInput($body) public function createUsersWithArrayInput($body)
{ {
list($response) = $this->createUsersWithArrayInputWithHttpInfo ($body); list($response) = $this->createUsersWithArrayInputWithHttpInfo($body);
return $response; return $response;
} }
/** /**
* createUsersWithArrayInputWithHttpInfo * Operation createUsersWithArrayInputWithHttpInfo
* *
* Creates list of users with given input array * Creates list of users with given input array
* *
* @param \Swagger\Client\Model\User[] $body List of user object (required) * @param \Swagger\Client\Model\User[] $body List of user object (required)
*
* @return Array of null, HTTP status code, HTTP response headers (array of strings) * @return Array of null, HTTP status code, HTTP response headers (array of strings)
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
@ -202,7 +211,7 @@ class UserApi
if ($body === null) { if ($body === null) {
throw new \InvalidArgumentException('Missing the required parameter $body when calling createUsersWithArrayInput'); throw new \InvalidArgumentException('Missing the required parameter $body when calling createUsersWithArrayInput');
} }
// parse inputs // parse inputs
$resourcePath = "/user/createWithArray"; $resourcePath = "/user/createWithArray";
$httpBody = ''; $httpBody = '';
@ -214,7 +223,7 @@ class UserApi
$headerParams['Accept'] = $_header_accept; $headerParams['Accept'] = $_header_accept;
} }
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
@ -227,7 +236,7 @@ class UserApi
if (isset($body)) { if (isset($body)) {
$_tempBody = $body; $_tempBody = $body;
} }
// for model (json/xml) // for model (json/xml)
if (isset($_tempBody)) { if (isset($_tempBody)) {
$httpBody = $_tempBody; // $_tempBody is the method argument, if present $httpBody = $_tempBody; // $_tempBody is the method argument, if present
@ -246,32 +255,34 @@ class UserApi
} catch (ApiException $e) { } catch (ApiException $e) {
switch ($e->getCode()) { switch ($e->getCode()) {
} }
throw $e; throw $e;
} }
} }
/** /**
* createUsersWithListInput * Operation createUsersWithListInput
* *
* Creates list of users with given input array * Creates list of users with given input array
* *
* @param \Swagger\Client\Model\User[] $body List of user object (required) * @param \Swagger\Client\Model\User[] $body List of user object (required)
*
* @return void * @return void
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
public function createUsersWithListInput($body) public function createUsersWithListInput($body)
{ {
list($response) = $this->createUsersWithListInputWithHttpInfo ($body); list($response) = $this->createUsersWithListInputWithHttpInfo($body);
return $response; return $response;
} }
/** /**
* createUsersWithListInputWithHttpInfo * Operation createUsersWithListInputWithHttpInfo
* *
* Creates list of users with given input array * Creates list of users with given input array
* *
* @param \Swagger\Client\Model\User[] $body List of user object (required) * @param \Swagger\Client\Model\User[] $body List of user object (required)
*
* @return Array of null, HTTP status code, HTTP response headers (array of strings) * @return Array of null, HTTP status code, HTTP response headers (array of strings)
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
@ -282,7 +293,7 @@ class UserApi
if ($body === null) { if ($body === null) {
throw new \InvalidArgumentException('Missing the required parameter $body when calling createUsersWithListInput'); throw new \InvalidArgumentException('Missing the required parameter $body when calling createUsersWithListInput');
} }
// parse inputs // parse inputs
$resourcePath = "/user/createWithList"; $resourcePath = "/user/createWithList";
$httpBody = ''; $httpBody = '';
@ -294,7 +305,7 @@ class UserApi
$headerParams['Accept'] = $_header_accept; $headerParams['Accept'] = $_header_accept;
} }
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
@ -307,7 +318,7 @@ class UserApi
if (isset($body)) { if (isset($body)) {
$_tempBody = $body; $_tempBody = $body;
} }
// for model (json/xml) // for model (json/xml)
if (isset($_tempBody)) { if (isset($_tempBody)) {
$httpBody = $_tempBody; // $_tempBody is the method argument, if present $httpBody = $_tempBody; // $_tempBody is the method argument, if present
@ -326,32 +337,34 @@ class UserApi
} catch (ApiException $e) { } catch (ApiException $e) {
switch ($e->getCode()) { switch ($e->getCode()) {
} }
throw $e; throw $e;
} }
} }
/** /**
* deleteUser * Operation deleteUser
* *
* Delete user * Delete user
* *
* @param string $username The name that needs to be deleted (required) * @param string $username The name that needs to be deleted (required)
*
* @return void * @return void
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
public function deleteUser($username) public function deleteUser($username)
{ {
list($response) = $this->deleteUserWithHttpInfo ($username); list($response) = $this->deleteUserWithHttpInfo($username);
return $response; return $response;
} }
/** /**
* deleteUserWithHttpInfo * Operation deleteUserWithHttpInfo
* *
* Delete user * Delete user
* *
* @param string $username The name that needs to be deleted (required) * @param string $username The name that needs to be deleted (required)
*
* @return Array of null, HTTP status code, HTTP response headers (array of strings) * @return Array of null, HTTP status code, HTTP response headers (array of strings)
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
@ -362,7 +375,7 @@ class UserApi
if ($username === null) { if ($username === null) {
throw new \InvalidArgumentException('Missing the required parameter $username when calling deleteUser'); throw new \InvalidArgumentException('Missing the required parameter $username when calling deleteUser');
} }
// parse inputs // parse inputs
$resourcePath = "/user/{username}"; $resourcePath = "/user/{username}";
$httpBody = ''; $httpBody = '';
@ -374,7 +387,7 @@ class UserApi
$headerParams['Accept'] = $_header_accept; $headerParams['Accept'] = $_header_accept;
} }
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
// path params // path params
@ -390,7 +403,7 @@ class UserApi
// for model (json/xml) // for model (json/xml)
if (isset($_tempBody)) { if (isset($_tempBody)) {
$httpBody = $_tempBody; // $_tempBody is the method argument, if present $httpBody = $_tempBody; // $_tempBody is the method argument, if present
@ -409,32 +422,34 @@ class UserApi
} catch (ApiException $e) { } catch (ApiException $e) {
switch ($e->getCode()) { switch ($e->getCode()) {
} }
throw $e; throw $e;
} }
} }
/** /**
* getUserByName * Operation getUserByName
* *
* Get user by user name * Get user by user name
* *
* @param string $username The name that needs to be fetched. Use user1 for testing. (required) * @param string $username The name that needs to be fetched. Use user1 for testing. (required)
*
* @return \Swagger\Client\Model\User * @return \Swagger\Client\Model\User
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
public function getUserByName($username) public function getUserByName($username)
{ {
list($response) = $this->getUserByNameWithHttpInfo ($username); list($response) = $this->getUserByNameWithHttpInfo($username);
return $response; return $response;
} }
/** /**
* getUserByNameWithHttpInfo * Operation getUserByNameWithHttpInfo
* *
* Get user by user name * Get user by user name
* *
* @param string $username The name that needs to be fetched. Use user1 for testing. (required) * @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) * @return Array of \Swagger\Client\Model\User, HTTP status code, HTTP response headers (array of strings)
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
@ -445,7 +460,7 @@ class UserApi
if ($username === null) { if ($username === null) {
throw new \InvalidArgumentException('Missing the required parameter $username when calling getUserByName'); throw new \InvalidArgumentException('Missing the required parameter $username when calling getUserByName');
} }
// parse inputs // parse inputs
$resourcePath = "/user/{username}"; $resourcePath = "/user/{username}";
$httpBody = ''; $httpBody = '';
@ -457,7 +472,7 @@ class UserApi
$headerParams['Accept'] = $_header_accept; $headerParams['Accept'] = $_header_accept;
} }
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
// path params // path params
@ -473,7 +488,7 @@ class UserApi
// for model (json/xml) // for model (json/xml)
if (isset($_tempBody)) { if (isset($_tempBody)) {
$httpBody = $_tempBody; // $_tempBody is the method argument, if present $httpBody = $_tempBody; // $_tempBody is the method argument, if present
@ -499,34 +514,36 @@ class UserApi
$e->setResponseObject($data); $e->setResponseObject($data);
break; break;
} }
throw $e; throw $e;
} }
} }
/** /**
* loginUser * Operation loginUser
* *
* Logs user into the system * Logs user into the system
* *
* @param string $username The user name for login (required) * @param string $username The user name for login (required)
* @param string $password The password for login in clear text (required) * @param string $password The password for login in clear text (required)
*
* @return string * @return string
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
public function loginUser($username, $password) public function loginUser($username, $password)
{ {
list($response) = $this->loginUserWithHttpInfo ($username, $password); list($response) = $this->loginUserWithHttpInfo($username, $password);
return $response; return $response;
} }
/** /**
* loginUserWithHttpInfo * Operation loginUserWithHttpInfo
* *
* Logs user into the system * Logs user into the system
* *
* @param string $username The user name for login (required) * @param string $username The user name for login (required)
* @param string $password The password for login in clear text (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) * @return Array of string, HTTP status code, HTTP response headers (array of strings)
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
@ -542,7 +559,7 @@ class UserApi
if ($password === null) { if ($password === null) {
throw new \InvalidArgumentException('Missing the required parameter $password when calling loginUser'); throw new \InvalidArgumentException('Missing the required parameter $password when calling loginUser');
} }
// parse inputs // parse inputs
$resourcePath = "/user/login"; $resourcePath = "/user/login";
$httpBody = ''; $httpBody = '';
@ -554,7 +571,7 @@ class UserApi
$headerParams['Accept'] = $_header_accept; $headerParams['Accept'] = $_header_accept;
} }
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
// query params // query params
if ($username !== null) { if ($username !== null) {
$queryParams['username'] = $this->apiClient->getSerializer()->toQueryValue($username); $queryParams['username'] = $this->apiClient->getSerializer()->toQueryValue($username);
@ -569,7 +586,7 @@ class UserApi
// for model (json/xml) // for model (json/xml)
if (isset($_tempBody)) { if (isset($_tempBody)) {
$httpBody = $_tempBody; // $_tempBody is the method argument, if present $httpBody = $_tempBody; // $_tempBody is the method argument, if present
@ -595,36 +612,38 @@ class UserApi
$e->setResponseObject($data); $e->setResponseObject($data);
break; break;
} }
throw $e; throw $e;
} }
} }
/** /**
* logoutUser * Operation logoutUser
* *
* Logs out current logged in user session * Logs out current logged in user session
* *
*
* @return void * @return void
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
public function logoutUser() public function logoutUser()
{ {
list($response) = $this->logoutUserWithHttpInfo (); list($response) = $this->logoutUserWithHttpInfo();
return $response; return $response;
} }
/** /**
* logoutUserWithHttpInfo * Operation logoutUserWithHttpInfo
* *
* Logs out current logged in user session * Logs out current logged in user session
* *
*
* @return Array of null, HTTP status code, HTTP response headers (array of strings) * @return Array of null, HTTP status code, HTTP response headers (array of strings)
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
public function logoutUserWithHttpInfo() public function logoutUserWithHttpInfo()
{ {
// parse inputs // parse inputs
$resourcePath = "/user/logout"; $resourcePath = "/user/logout";
$httpBody = ''; $httpBody = '';
@ -636,7 +655,7 @@ class UserApi
$headerParams['Accept'] = $_header_accept; $headerParams['Accept'] = $_header_accept;
} }
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
@ -645,7 +664,7 @@ class UserApi
// for model (json/xml) // for model (json/xml)
if (isset($_tempBody)) { if (isset($_tempBody)) {
$httpBody = $_tempBody; // $_tempBody is the method argument, if present $httpBody = $_tempBody; // $_tempBody is the method argument, if present
@ -664,34 +683,36 @@ class UserApi
} catch (ApiException $e) { } catch (ApiException $e) {
switch ($e->getCode()) { switch ($e->getCode()) {
} }
throw $e; throw $e;
} }
} }
/** /**
* updateUser * Operation updateUser
* *
* Updated user * Updated user
* *
* @param string $username name that need to be deleted (required) * @param string $username name that need to be deleted (required)
* @param \Swagger\Client\Model\User $body Updated user object (required) * @param \Swagger\Client\Model\User $body Updated user object (required)
*
* @return void * @return void
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
public function updateUser($username, $body) public function updateUser($username, $body)
{ {
list($response) = $this->updateUserWithHttpInfo ($username, $body); list($response) = $this->updateUserWithHttpInfo($username, $body);
return $response; return $response;
} }
/** /**
* updateUserWithHttpInfo * Operation updateUserWithHttpInfo
* *
* Updated user * Updated user
* *
* @param string $username name that need to be deleted (required) * @param string $username name that need to be deleted (required)
* @param \Swagger\Client\Model\User $body Updated user object (required) * @param \Swagger\Client\Model\User $body Updated user object (required)
*
* @return Array of null, HTTP status code, HTTP response headers (array of strings) * @return Array of null, HTTP status code, HTTP response headers (array of strings)
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
@ -707,7 +728,7 @@ class UserApi
if ($body === null) { if ($body === null) {
throw new \InvalidArgumentException('Missing the required parameter $body when calling updateUser'); throw new \InvalidArgumentException('Missing the required parameter $body when calling updateUser');
} }
// parse inputs // parse inputs
$resourcePath = "/user/{username}"; $resourcePath = "/user/{username}";
$httpBody = ''; $httpBody = '';
@ -719,7 +740,7 @@ class UserApi
$headerParams['Accept'] = $_header_accept; $headerParams['Accept'] = $_header_accept;
} }
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
// path params // path params
@ -739,7 +760,7 @@ class UserApi
if (isset($body)) { if (isset($body)) {
$_tempBody = $body; $_tempBody = $body;
} }
// for model (json/xml) // for model (json/xml)
if (isset($_tempBody)) { if (isset($_tempBody)) {
$httpBody = $_tempBody; // $_tempBody is the method argument, if present $httpBody = $_tempBody; // $_tempBody is the method argument, if present
@ -758,7 +779,7 @@ class UserApi
} catch (ApiException $e) { } catch (ApiException $e) {
switch ($e->getCode()) { switch ($e->getCode()) {
} }
throw $e; throw $e;
} }
} }

View File

@ -55,18 +55,21 @@ class ApiClient
/** /**
* Configuration * Configuration
*
* @var Configuration * @var Configuration
*/ */
protected $config; protected $config;
/** /**
* Object Serializer * Object Serializer
*
* @var ObjectSerializer * @var ObjectSerializer
*/ */
protected $serializer; protected $serializer;
/** /**
* Constructor of the class * Constructor of the class
*
* @param Configuration $config config for this ApiClient * @param Configuration $config config for this ApiClient
*/ */
public function __construct(\Swagger\Client\Configuration $config = null) public function __construct(\Swagger\Client\Configuration $config = null)
@ -81,6 +84,7 @@ class ApiClient
/** /**
* Get the config * Get the config
*
* @return Configuration * @return Configuration
*/ */
public function getConfig() public function getConfig()
@ -90,6 +94,7 @@ class ApiClient
/** /**
* Get the serializer * Get the serializer
*
* @return ObjectSerializer * @return ObjectSerializer
*/ */
public function getSerializer() public function getSerializer()
@ -99,7 +104,9 @@ class ApiClient
/** /**
* Get API key (with prefix if set) * Get API key (with prefix if set)
*
* @param string $apiKeyIdentifier name of apikey * @param string $apiKeyIdentifier name of apikey
*
* @return string API key with the prefix * @return string API key with the prefix
*/ */
public function getApiKeyWithPrefix($apiKeyIdentifier) public function getApiKeyWithPrefix($apiKeyIdentifier)
@ -122,12 +129,14 @@ class ApiClient
/** /**
* Make the HTTP call (Sync) * Make the HTTP call (Sync)
*
* @param string $resourcePath path to method endpoint * @param string $resourcePath path to method endpoint
* @param string $method method to call * @param string $method method to call
* @param array $queryParams parameters to be place in query URL * @param array $queryParams parameters to be place in query URL
* @param array $postData parameters to be placed in POST body * @param array $postData parameters to be placed in POST body
* @param array $headerParams parameters to be place in request header * @param array $headerParams parameters to be place in request header
* @param string $responseType expected response type of the endpoint * @param string $responseType expected response type of the endpoint
*
* @throws \Swagger\Client\ApiException on a non 2xx response * @throws \Swagger\Client\ApiException on a non 2xx response
* @return mixed * @return mixed
*/ */
@ -160,7 +169,7 @@ class ApiClient
if ($this->config->getCurlTimeout() != 0) { if ($this->config->getCurlTimeout() != 0) {
curl_setopt($curl, CURLOPT_TIMEOUT, $this->config->getCurlTimeout()); 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_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
@ -171,7 +180,7 @@ class ApiClient
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
} }
if (! empty($queryParams)) { if (!empty($queryParams)) {
$url = ($url . '?' . http_build_query($queryParams)); $url = ($url . '?' . http_build_query($queryParams));
} }
@ -216,7 +225,7 @@ class ApiClient
// Make the request // Make the request
$response = curl_exec($curl); $response = curl_exec($curl);
$http_header_size = curl_getinfo($curl, CURLINFO_HEADER_SIZE); $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); $http_body = substr($response, $http_header_size);
$response_info = curl_getinfo($curl); $response_info = curl_getinfo($curl);
@ -295,16 +304,16 @@ class ApiClient
* *
* @return string[] Array of HTTP response heaers * @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 // ref/credit: http://php.net/manual/en/function.http-parse-headers.php#112986
$headers = array(); $headers = array();
$key = ''; $key = '';
foreach(explode("\n", $raw_headers) as $h) foreach(explode("\n", $raw_headers) as $h)
{ {
$h = explode(':', $h, 2); $h = explode(':', $h, 2);
if (isset($h[1])) if (isset($h[1]))
{ {
if (!isset($headers[$h[0]])) if (!isset($headers[$h[0]]))
@ -317,18 +326,18 @@ class ApiClient
{ {
$headers[$h[0]] = array_merge(array($headers[$h[0]]), array(trim($h[1]))); $headers[$h[0]] = array_merge(array($headers[$h[0]]), array(trim($h[1])));
} }
$key = $h[0]; $key = $h[0];
} }
else else
{ {
if (substr($h[0], 0, 1) == "\t") if (substr($h[0], 0, 1) == "\t")
$headers[$key] .= "\r\n\t".trim($h[0]); $headers[$key] .= "\r\n\t".trim($h[0]);
elseif (!$key) elseif (!$key)
$headers[0] = trim($h[0]);trim($h[0]); $headers[0] = trim($h[0]);trim($h[0]);
} }
} }
return $headers; return $headers;
} }
} }

View File

@ -48,24 +48,28 @@ class ApiException extends Exception
/** /**
* The HTTP body of the server response either as Json or string. * The HTTP body of the server response either as Json or string.
*
* @var mixed * @var mixed
*/ */
protected $responseBody; protected $responseBody;
/** /**
* The HTTP header of the server response. * The HTTP header of the server response.
*
* @var string[] * @var string[]
*/ */
protected $responseHeaders; protected $responseHeaders;
/** /**
* The deserialized response object * The deserialized response object
*
* @var $responseObject; * @var $responseObject;
*/ */
protected $responseObject; protected $responseObject;
/** /**
* Constructor * Constructor
*
* @param string $message Error message * @param string $message Error message
* @param int $code HTTP status code * @param int $code HTTP status code
* @param string $responseHeaders HTTP response header * @param string $responseHeaders HTTP response header
@ -100,7 +104,9 @@ class ApiException extends Exception
/** /**
* Sets the deseralized response object (during deserialization) * Sets the deseralized response object (during deserialization)
*
* @param mixed $obj Deserialized response object * @param mixed $obj Deserialized response object
*
* @return void * @return void
*/ */
public function setResponseObject($obj) public function setResponseObject($obj)

View File

@ -110,7 +110,7 @@ class Configuration
* *
* @var string * @var string
*/ */
protected $userAgent = "Swagger-Codegen/1.0.0/php"; protected $userAgent = "Swagger-Codegen//php";
/** /**
* Debug switch (default set to false) * Debug switch (default set to false)
@ -517,7 +517,7 @@ class Configuration
$report .= " OS: ".php_uname()."\n"; $report .= " OS: ".php_uname()."\n";
$report .= " PHP Version: ".phpversion()."\n"; $report .= " PHP Version: ".phpversion()."\n";
$report .= " OpenAPI Spec Version: 1.0.0\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"; $report .= " Temp Folder Path: ".self::getDefaultConfiguration()->getTempFolderPath()."\n";
return $report; return $report;

View File

@ -125,7 +125,7 @@ class AnimalFarm implements ArrayAccess
* *
* @return array invalid properties with reasons * @return array invalid properties with reasons
*/ */
public function list_invalid_properties() public function listInvalidProperties()
{ {
$invalid_properties = array(); $invalid_properties = array();
return $invalid_properties; return $invalid_properties;

View File

@ -125,7 +125,7 @@ class EnumClass implements ArrayAccess
* *
* @return array invalid properties with reasons * @return array invalid properties with reasons
*/ */
public function list_invalid_properties() public function listInvalidProperties()
{ {
$invalid_properties = array(); $invalid_properties = array();
return $invalid_properties; return $invalid_properties;

View File

@ -110,6 +110,12 @@ class EnumTest implements ArrayAccess
return self::$getters; 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() public function getEnumStringAllowableValues()
{ {
return [ return [
self::ENUM_STRING_UPPER,
self::ENUM_STRING_LOWER,
]; ];
} }
@ -131,7 +138,8 @@ class EnumTest implements ArrayAccess
public function getEnumIntegerAllowableValues() public function getEnumIntegerAllowableValues()
{ {
return [ return [
self::ENUM_INTEGER_1,
self::ENUM_INTEGER_MINUS_1,
]; ];
} }
@ -142,7 +150,8 @@ class EnumTest implements ArrayAccess
public function getEnumNumberAllowableValues() public function getEnumNumberAllowableValues()
{ {
return [ 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 * @return array invalid properties with reasons
*/ */
public function list_invalid_properties() public function listInvalidProperties()
{ {
$invalid_properties = array(); $invalid_properties = array();
$allowed_values = array("UPPER", "lower"); $allowed_values = array("UPPER", "lower");

View File

@ -69,7 +69,7 @@ class FormatTest implements ArrayAccess
'binary' => 'string', 'binary' => 'string',
'date' => '\DateTime', 'date' => '\DateTime',
'date_time' => '\DateTime', 'date_time' => '\DateTime',
'uuid' => 'UUID', 'uuid' => 'string',
'password' => 'string' 'password' => 'string'
); );
@ -578,7 +578,7 @@ class FormatTest implements ArrayAccess
/** /**
* Gets uuid * Gets uuid
* @return UUID * @return string
*/ */
public function getUuid() public function getUuid()
{ {
@ -587,7 +587,7 @@ class FormatTest implements ArrayAccess
/** /**
* Sets uuid * Sets uuid
* @param UUID $uuid * @param string $uuid
* @return $this * @return $this
*/ */
public function setUuid($uuid) public function setUuid($uuid)

View File

@ -122,6 +122,9 @@ class Order implements ArrayAccess
return self::$getters; 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() public function getStatusAllowableValues()
{ {
return [ return [
self::STATUS_PLACED,
self::STATUS_APPROVED,
self::STATUS_DELIVERED,
]; ];
} }

View File

@ -122,6 +122,9 @@ class Pet implements ArrayAccess
return self::$getters; 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() public function getStatusAllowableValues()
{ {
return [ return [
self::STATUS_AVAILABLE,
self::STATUS_PENDING,
self::STATUS_SOLD,
]; ];
} }

View File

@ -1,6 +1,6 @@
<?php <?php
/** /**
* ObjectSerializer * ObjectSerializer
* *
* PHP version 5 * PHP version 5
* *
@ -37,7 +37,7 @@ namespace Swagger\Client;
* ObjectSerializer Class Doc Comment * ObjectSerializer Class Doc Comment
* *
* @category Class * @category Class
* @package Swagger\Client * @package Swagger\Client
* @author http://github.com/swagger-api/swagger-codegen * @author http://github.com/swagger-api/swagger-codegen
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
* @link https://github.com/swagger-api/swagger-codegen * @link https://github.com/swagger-api/swagger-codegen
@ -79,7 +79,7 @@ class ObjectSerializer
/** /**
* Sanitize filename by removing path. * Sanitize filename by removing path.
* e.g. ../../sun.gif becomes sun.gif * e.g. ../../sun.gif becomes sun.gif
* *
* @param string $filename filename to be sanitized * @param string $filename filename to be sanitized
* *
@ -268,9 +268,13 @@ class ObjectSerializer
} }
$deserialized = new \SplFileObject($filename, "w"); $deserialized = new \SplFileObject($filename, "w");
$byte_written = $deserialized->fwrite($data); $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());
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 { } else {
// If a discriminator is defined and points to a valid subclass, use it. // If a discriminator is defined and points to a valid subclass, use it.
if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) {
@ -282,11 +286,11 @@ class ObjectSerializer
$instance = new $class(); $instance = new $class();
foreach ($instance::swaggerTypes() as $property => $type) { foreach ($instance::swaggerTypes() as $property => $type) {
$propertySetter = $instance::setters()[$property]; $propertySetter = $instance::setters()[$property];
if (!isset($propertySetter) || !isset($data->{$instance::attributeMap()[$property]})) { if (!isset($propertySetter) || !isset($data->{$instance::attributeMap()[$property]})) {
continue; continue;
} }
$propertyValue = $data->{$instance::attributeMap()[$property]}; $propertyValue = $data->{$instance::attributeMap()[$property]};
if (isset($propertyValue)) { if (isset($propertyValue)) {
$instance->$propertySetter(self::deserialize($propertyValue, $type, null, $discriminator)); $instance->$propertySetter(self::deserialize($propertyValue, $type, null, $discriminator));