update php petstore sample

This commit is contained in:
wing328 2015-07-13 15:31:20 +08:00
parent f154e407d2
commit 879c1b921c
3 changed files with 58 additions and 69 deletions

View File

@ -96,15 +96,14 @@ class PetApi
*
* 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 (optional)
* @return void
* @throws \Swagger\Client\ApiException on non-2xx response
*/
public function updatePet($body)
public function updatePet($body=null)
{
// parse inputs
$resourcePath = "/pet";
$resourcePath = str_replace("{format}", "json", $resourcePath);
@ -161,15 +160,14 @@ class PetApi
*
* 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 (optional)
* @return void
* @throws \Swagger\Client\ApiException on non-2xx response
*/
public function addPet($body)
public function addPet($body=null)
{
// parse inputs
$resourcePath = "/pet";
$resourcePath = str_replace("{format}", "json", $resourcePath);
@ -226,15 +224,14 @@ class PetApi
*
* 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 (optional)
* @return \Swagger\Client\Model\Pet[]
* @throws \Swagger\Client\ApiException on non-2xx response
*/
public function findPetsByStatus($status)
public function findPetsByStatus($status=null)
{
// parse inputs
$resourcePath = "/pet/findByStatus";
$resourcePath = str_replace("{format}", "json", $resourcePath);
@ -300,15 +297,14 @@ class PetApi
*
* Finds Pets by tags
*
* @param string[] $tags Tags to filter by (required)
*
* @param string[] $tags Tags to filter by (optional)
* @return \Swagger\Client\Model\Pet[]
* @throws \Swagger\Client\ApiException on non-2xx response
*/
public function findPetsByTags($tags)
public function findPetsByTags($tags=null)
{
// parse inputs
$resourcePath = "/pet/findByTags";
$resourcePath = str_replace("{format}", "json", $resourcePath);
@ -375,17 +371,17 @@ class PetApi
* Find pet by ID
*
* @param int $pet_id ID of pet that needs to be fetched (required)
*
* @return \Swagger\Client\Model\Pet
* @throws \Swagger\Client\ApiException on non-2xx response
*/
public function getPetById($pet_id)
{
// verify the required parameter 'pet_id' is set
if ($pet_id === null) {
throw new \InvalidArgumentException('Missing the required parameter $pet_id when calling getPetById');
}
// parse inputs
$resourcePath = "/pet/{petId}";
$resourcePath = str_replace("{format}", "json", $resourcePath);
@ -463,19 +459,19 @@ class PetApi
* Updates a pet in the store with form data
*
* @param string $pet_id ID of pet that needs to be updated (required)
* @param string $name Updated name of the pet (required)
* @param string $status Updated status of the pet (required)
*
* @param string $name Updated name of the pet (optional)
* @param string $status Updated status of the pet (optional)
* @return void
* @throws \Swagger\Client\ApiException on non-2xx response
*/
public function updatePetWithForm($pet_id, $name, $status)
public function updatePetWithForm($pet_id, $name=null, $status=null)
{
// verify the required parameter 'pet_id' is set
if ($pet_id === null) {
throw new \InvalidArgumentException('Missing the required parameter $pet_id when calling updatePetWithForm');
}
// parse inputs
$resourcePath = "/pet/{petId}";
$resourcePath = str_replace("{format}", "json", $resourcePath);
@ -541,19 +537,19 @@ class PetApi
*
* Deletes a pet
*
* @param string $api_key (required)
* @param string $api_key (optional)
* @param int $pet_id Pet id to delete (required)
*
* @return void
* @throws \Swagger\Client\ApiException on non-2xx response
*/
public function deletePet($api_key, $pet_id)
public function deletePet($api_key=null, $pet_id)
{
// verify the required parameter 'pet_id' is set
if ($pet_id === null) {
throw new \InvalidArgumentException('Missing the required parameter $pet_id when calling deletePet');
}
// parse inputs
$resourcePath = "/pet/{petId}";
$resourcePath = str_replace("{format}", "json", $resourcePath);
@ -617,19 +613,19 @@ class PetApi
* uploads an image
*
* @param int $pet_id ID of pet to update (required)
* @param string $additional_metadata Additional data to pass to server (required)
* @param \SplFileObject $file file to upload (required)
*
* @param string $additional_metadata Additional data to pass to server (optional)
* @param \SplFileObject $file file to upload (optional)
* @return void
* @throws \Swagger\Client\ApiException on non-2xx response
*/
public function uploadFile($pet_id, $additional_metadata, $file)
public function uploadFile($pet_id, $additional_metadata=null, $file=null)
{
// verify the required parameter 'pet_id' is set
if ($pet_id === null) {
throw new \InvalidArgumentException('Missing the required parameter $pet_id when calling uploadFile');
}
// parse inputs
$resourcePath = "/pet/{petId}/uploadImage";
$resourcePath = str_replace("{format}", "json", $resourcePath);

View File

@ -96,14 +96,13 @@ class StoreApi
*
* Returns pet inventories by status
*
*
* @return map[string,int]
* @throws \Swagger\Client\ApiException on non-2xx response
*/
public function getInventory()
{
// parse inputs
$resourcePath = "/store/inventory";
$resourcePath = str_replace("{format}", "json", $resourcePath);
@ -170,15 +169,14 @@ class StoreApi
*
* 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 (optional)
* @return \Swagger\Client\Model\Order
* @throws \Swagger\Client\ApiException on non-2xx response
*/
public function placeOrder($body)
public function placeOrder($body=null)
{
// parse inputs
$resourcePath = "/store/order";
$resourcePath = str_replace("{format}", "json", $resourcePath);
@ -243,17 +241,17 @@ class StoreApi
* Find purchase order by ID
*
* @param string $order_id ID of pet that needs to be fetched (required)
*
* @return \Swagger\Client\Model\Order
* @throws \Swagger\Client\ApiException on non-2xx response
*/
public function getOrderById($order_id)
{
// verify the required parameter 'order_id' is set
if ($order_id === null) {
throw new \InvalidArgumentException('Missing the required parameter $order_id when calling getOrderById');
}
// parse inputs
$resourcePath = "/store/order/{orderId}";
$resourcePath = str_replace("{format}", "json", $resourcePath);
@ -321,17 +319,17 @@ class StoreApi
* Delete purchase order by ID
*
* @param string $order_id ID of the order that needs to be deleted (required)
*
* @return void
* @throws \Swagger\Client\ApiException on non-2xx response
*/
public function deleteOrder($order_id)
{
// verify the required parameter 'order_id' is set
if ($order_id === null) {
throw new \InvalidArgumentException('Missing the required parameter $order_id when calling deleteOrder');
}
// parse inputs
$resourcePath = "/store/order/{orderId}";
$resourcePath = str_replace("{format}", "json", $resourcePath);

View File

@ -96,15 +96,14 @@ class UserApi
*
* Create user
*
* @param \Swagger\Client\Model\User $body Created user object (required)
*
* @param \Swagger\Client\Model\User $body Created user object (optional)
* @return void
* @throws \Swagger\Client\ApiException on non-2xx response
*/
public function createUser($body)
public function createUser($body=null)
{
// parse inputs
$resourcePath = "/user";
$resourcePath = str_replace("{format}", "json", $resourcePath);
@ -158,15 +157,14 @@ class UserApi
*
* 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 (optional)
* @return void
* @throws \Swagger\Client\ApiException on non-2xx response
*/
public function createUsersWithArrayInput($body)
public function createUsersWithArrayInput($body=null)
{
// parse inputs
$resourcePath = "/user/createWithArray";
$resourcePath = str_replace("{format}", "json", $resourcePath);
@ -220,15 +218,14 @@ class UserApi
*
* 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 (optional)
* @return void
* @throws \Swagger\Client\ApiException on non-2xx response
*/
public function createUsersWithListInput($body)
public function createUsersWithListInput($body=null)
{
// parse inputs
$resourcePath = "/user/createWithList";
$resourcePath = str_replace("{format}", "json", $resourcePath);
@ -282,16 +279,15 @@ class UserApi
*
* Logs user into the system
*
* @param string $username The user name for login (required)
* @param string $password The password for login in clear text (required)
*
* @param string $username The user name for login (optional)
* @param string $password The password for login in clear text (optional)
* @return string
* @throws \Swagger\Client\ApiException on non-2xx response
*/
public function loginUser($username, $password)
public function loginUser($username=null, $password=null)
{
// parse inputs
$resourcePath = "/user/login";
$resourcePath = str_replace("{format}", "json", $resourcePath);
@ -357,14 +353,13 @@ class UserApi
*
* Logs out current logged in user session
*
*
* @return void
* @throws \Swagger\Client\ApiException on non-2xx response
*/
public function logoutUser()
{
// parse inputs
$resourcePath = "/user/logout";
$resourcePath = str_replace("{format}", "json", $resourcePath);
@ -415,17 +410,17 @@ class UserApi
* Get user by user name
*
* @param string $username The name that needs to be fetched. Use user1 for testing. (required)
*
* @return \Swagger\Client\Model\User
* @throws \Swagger\Client\ApiException on non-2xx response
*/
public function getUserByName($username)
{
// verify the required parameter 'username' is set
if ($username === null) {
throw new \InvalidArgumentException('Missing the required parameter $username when calling getUserByName');
}
// parse inputs
$resourcePath = "/user/{username}";
$resourcePath = str_replace("{format}", "json", $resourcePath);
@ -493,18 +488,18 @@ class UserApi
* Updated user
*
* @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 (optional)
* @return void
* @throws \Swagger\Client\ApiException on non-2xx response
*/
public function updateUser($username, $body)
public function updateUser($username, $body=null)
{
// verify the required parameter 'username' is set
if ($username === null) {
throw new \InvalidArgumentException('Missing the required parameter $username when calling updateUser');
}
// parse inputs
$resourcePath = "/user/{username}";
$resourcePath = str_replace("{format}", "json", $resourcePath);
@ -566,17 +561,17 @@ class UserApi
* Delete user
*
* @param string $username The name that needs to be deleted (required)
*
* @return void
* @throws \Swagger\Client\ApiException on non-2xx response
*/
public function deleteUser($username)
{
// verify the required parameter 'username' is set
if ($username === null) {
throw new \InvalidArgumentException('Missing the required parameter $username when calling deleteUser');
}
// parse inputs
$resourcePath = "/user/{username}";
$resourcePath = str_replace("{format}", "json", $resourcePath);