add http info to php api methods

This commit is contained in:
wing328 2015-12-06 19:00:52 +08:00
parent 9367b7f6a6
commit bb341832a5
6 changed files with 416 additions and 75 deletions

View File

@ -231,7 +231,7 @@ class ApiClient
} else if ($response_info['http_code'] >= 200 && $response_info['http_code'] <= 299 ) { } else if ($response_info['http_code'] >= 200 && $response_info['http_code'] <= 299 ) {
// return raw body if response is a file // return raw body if response is a file
if ($responseType == '\SplFileObject') { if ($responseType == '\SplFileObject') {
return array($http_body, $http_header); return array($http_body, $response_info['http_code'], $http_header);
} }
$data = json_decode($http_body); $data = json_decode($http_body);
@ -249,7 +249,7 @@ class ApiClient
$response_info['http_code'], $http_header, $data $response_info['http_code'], $http_header, $data
); );
} }
return array($data, $http_header); return array($data, $response_info['http_code'], $http_header);
} }
/** /**

View File

@ -92,7 +92,7 @@ use \{{invokerPackage}}\ObjectSerializer;
{{#operation}} {{#operation}}
/** /**
* {{{nickname}}} * {{{operationId}}}
* *
* {{{summary}}} * {{{summary}}}
* *
@ -100,12 +100,28 @@ use \{{invokerPackage}}\ObjectSerializer;
{{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}
* @throws \{{invokerPackage}}\ApiException on non-2xx response * @throws \{{invokerPackage}}\ApiException on non-2xx response
*/ */
public function {{nickname}}({{#allParams}}${{paramName}}{{^required}}=null{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) public function {{operationId}} ({{#allParams}}${{paramName}}{{^required}}=null{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
{
list($response, $statusCode, $httpHeader) = $this->{{operationId}}WithHttpInfo ({{#allParams}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
return $response;
}
/**
* {{{operationId}}}
*
* {{{summary}}}
*
{{#allParams}} * @param {{dataType}} ${{paramName}} {{description}} {{#required}}(required){{/required}}{{^required}}(optional){{/required}}
{{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}
* @throws \{{invokerPackage}}\ApiException on non-2xx response
*/
public function {{operationId}}WithHttpInfo ({{#allParams}}${{paramName}}{{^required}}=null{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
{ {
{{#allParams}}{{#required}} {{#allParams}}{{#required}}
// verify the required parameter '{{paramName}}' is set // verify the required parameter '{{paramName}}' is set
if (${{paramName}} === null) { if (${{paramName}} === null) {
throw new \InvalidArgumentException('Missing the required parameter ${{paramName}} when calling {{nickname}}'); throw new \InvalidArgumentException('Missing the required parameter ${{paramName}} when calling {{operationId}}');
}{{/required}}{{/allParams}} }{{/required}}{{/allParams}}
// parse inputs // parse inputs
@ -182,17 +198,17 @@ use \{{invokerPackage}}\ObjectSerializer;
// make the API Call // make the API Call
try try
{ {
list($response, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
$resourcePath, $method, $resourcePath, $method,
$queryParams, $httpBody, $queryParams, $httpBody,
$headerParams{{#returnType}}, '{{returnType}}'{{/returnType}} $headerParams{{#returnType}}, '{{returnType}}'{{/returnType}}
); );
{{#returnType}} {{#returnType}}
if (!$response) { if (!$response) {
return null; return array(null, $statusCode, $httpHeader);
} }
return $this->apiClient->getSerializer()->deserialize($response, '{{returnType}}', $httpHeader); return array($this->apiClient->getSerializer()->deserialize($response, '{{returnType}}', $httpHeader));
{{/returnType}} {{/returnType}}
} catch (ApiException $e) { } catch (ApiException $e) {
switch ($e->getCode()) { {{#responses}}{{#dataType}} switch ($e->getCode()) { {{#responses}}{{#dataType}}
@ -205,7 +221,7 @@ use \{{invokerPackage}}\ObjectSerializer;
throw $e; throw $e;
} }
{{#returnType}} {{#returnType}}
return null; return array(null, $statusCode, $httpHeader);
{{/returnType}} {{/returnType}}
} }
{{/operation}} {{/operation}}

View File

@ -101,6 +101,22 @@ class PetApi
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
public function updatePet ($body=null) public function updatePet ($body=null)
{
list($response, $statusCode, $httpHeader) = $this->updatePetWithHttpInfo ($body);
return $response;
}
/**
* updatePet
*
* Update an existing pet
*
* @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 updatePetWithHttpInfo ($body=null)
{ {
@ -143,7 +159,7 @@ class PetApi
// make the API Call // make the API Call
try try
{ {
list($response, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
$resourcePath, $method, $resourcePath, $method,
$queryParams, $httpBody, $queryParams, $httpBody,
$headerParams $headerParams
@ -168,6 +184,22 @@ class PetApi
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
public function addPet ($body=null) public function addPet ($body=null)
{
list($response, $statusCode, $httpHeader) = $this->addPetWithHttpInfo ($body);
return $response;
}
/**
* addPet
*
* Add a new pet to the store
*
* @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 addPetWithHttpInfo ($body=null)
{ {
@ -210,7 +242,7 @@ class PetApi
// make the API Call // make the API Call
try try
{ {
list($response, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
$resourcePath, $method, $resourcePath, $method,
$queryParams, $httpBody, $queryParams, $httpBody,
$headerParams $headerParams
@ -235,6 +267,22 @@ class PetApi
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
public function findPetsByStatus ($status=null) public function findPetsByStatus ($status=null)
{
list($response, $statusCode, $httpHeader) = $this->findPetsByStatusWithHttpInfo ($status);
return $response;
}
/**
* findPetsByStatus
*
* Finds Pets by status
*
* @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 findPetsByStatusWithHttpInfo ($status=null)
{ {
@ -276,17 +324,17 @@ class PetApi
// make the API Call // make the API Call
try try
{ {
list($response, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
$resourcePath, $method, $resourcePath, $method,
$queryParams, $httpBody, $queryParams, $httpBody,
$headerParams, '\Swagger\Client\Model\Pet[]' $headerParams, '\Swagger\Client\Model\Pet[]'
); );
if (!$response) { if (!$response) {
return null; return array(null, $statusCode, $httpHeader);
} }
return $this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\Pet[]', $httpHeader); return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\Pet[]', $httpHeader));
} catch (ApiException $e) { } catch (ApiException $e) {
switch ($e->getCode()) { switch ($e->getCode()) {
@ -299,7 +347,7 @@ class PetApi
throw $e; throw $e;
} }
return null; return array(null, $statusCode, $httpHeader);
} }
@ -313,6 +361,22 @@ class PetApi
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
public function findPetsByTags ($tags=null) public function findPetsByTags ($tags=null)
{
list($response, $statusCode, $httpHeader) = $this->findPetsByTagsWithHttpInfo ($tags);
return $response;
}
/**
* findPetsByTags
*
* Finds Pets by tags
*
* @param string[] $tags Tags to filter by (optional)
* @return \Swagger\Client\Model\Pet[]
* @throws \Swagger\Client\ApiException on non-2xx response
*/
public function findPetsByTagsWithHttpInfo ($tags=null)
{ {
@ -354,17 +418,17 @@ class PetApi
// make the API Call // make the API Call
try try
{ {
list($response, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
$resourcePath, $method, $resourcePath, $method,
$queryParams, $httpBody, $queryParams, $httpBody,
$headerParams, '\Swagger\Client\Model\Pet[]' $headerParams, '\Swagger\Client\Model\Pet[]'
); );
if (!$response) { if (!$response) {
return null; return array(null, $statusCode, $httpHeader);
} }
return $this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\Pet[]', $httpHeader); return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\Pet[]', $httpHeader));
} catch (ApiException $e) { } catch (ApiException $e) {
switch ($e->getCode()) { switch ($e->getCode()) {
@ -377,7 +441,7 @@ class PetApi
throw $e; throw $e;
} }
return null; return array(null, $statusCode, $httpHeader);
} }
@ -391,6 +455,22 @@ class PetApi
* @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, $statusCode, $httpHeader) = $this->getPetByIdWithHttpInfo ($pet_id);
return $response;
}
/**
* getPetById
*
* 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 getPetByIdWithHttpInfo ($pet_id)
{ {
// verify the required parameter 'pet_id' is set // verify the required parameter 'pet_id' is set
@ -442,17 +522,17 @@ class PetApi
// make the API Call // make the API Call
try try
{ {
list($response, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
$resourcePath, $method, $resourcePath, $method,
$queryParams, $httpBody, $queryParams, $httpBody,
$headerParams, '\Swagger\Client\Model\Pet' $headerParams, '\Swagger\Client\Model\Pet'
); );
if (!$response) { if (!$response) {
return null; return array(null, $statusCode, $httpHeader);
} }
return $this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\Pet', $httpHeader); return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\Pet', $httpHeader));
} catch (ApiException $e) { } catch (ApiException $e) {
switch ($e->getCode()) { switch ($e->getCode()) {
@ -465,7 +545,7 @@ class PetApi
throw $e; throw $e;
} }
return null; return array(null, $statusCode, $httpHeader);
} }
@ -481,6 +561,24 @@ class PetApi
* @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, $statusCode, $httpHeader) = $this->updatePetWithFormWithHttpInfo ($pet_id, $name, $status);
return $response;
}
/**
* updatePetWithForm
*
* 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 (optional)
* @param string $status Updated status of the pet (optional)
* @return void
* @throws \Swagger\Client\ApiException on non-2xx response
*/
public function updatePetWithFormWithHttpInfo ($pet_id, $name=null, $status=null)
{ {
// verify the required parameter 'pet_id' is set // verify the required parameter 'pet_id' is set
@ -542,7 +640,7 @@ class PetApi
// make the API Call // make the API Call
try try
{ {
list($response, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
$resourcePath, $method, $resourcePath, $method,
$queryParams, $httpBody, $queryParams, $httpBody,
$headerParams $headerParams
@ -568,6 +666,23 @@ class PetApi
* @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, $statusCode, $httpHeader) = $this->deletePetWithHttpInfo ($pet_id, $api_key);
return $response;
}
/**
* deletePet
*
* Deletes a pet
*
* @param int $pet_id Pet id to delete (required)
* @param string $api_key (optional)
* @return void
* @throws \Swagger\Client\ApiException on non-2xx response
*/
public function deletePetWithHttpInfo ($pet_id, $api_key=null)
{ {
// verify the required parameter 'pet_id' is set // verify the required parameter 'pet_id' is set
@ -620,7 +735,7 @@ class PetApi
// make the API Call // make the API Call
try try
{ {
list($response, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
$resourcePath, $method, $resourcePath, $method,
$queryParams, $httpBody, $queryParams, $httpBody,
$headerParams $headerParams
@ -647,6 +762,24 @@ class PetApi
* @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, $statusCode, $httpHeader) = $this->uploadFileWithHttpInfo ($pet_id, $additional_metadata, $file);
return $response;
}
/**
* uploadFile
*
* uploads an image
*
* @param int $pet_id ID of pet to update (required)
* @param string $additional_metadata Additional data to pass to server (optional)
* @param \SplFileObject $file file to upload (optional)
* @return void
* @throws \Swagger\Client\ApiException on non-2xx response
*/
public function uploadFileWithHttpInfo ($pet_id, $additional_metadata=null, $file=null)
{ {
// verify the required parameter 'pet_id' is set // verify the required parameter 'pet_id' is set
@ -714,7 +847,7 @@ class PetApi
// make the API Call // make the API Call
try try
{ {
list($response, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
$resourcePath, $method, $resourcePath, $method,
$queryParams, $httpBody, $queryParams, $httpBody,
$headerParams $headerParams

View File

@ -100,6 +100,21 @@ class StoreApi
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
public function getInventory () public function getInventory ()
{
list($response, $statusCode, $httpHeader) = $this->getInventoryWithHttpInfo ();
return $response;
}
/**
* getInventory
*
* Returns pet inventories by status
*
* @return map[string,int]
* @throws \Swagger\Client\ApiException on non-2xx response
*/
public function getInventoryWithHttpInfo ()
{ {
@ -140,17 +155,17 @@ class StoreApi
// make the API Call // make the API Call
try try
{ {
list($response, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
$resourcePath, $method, $resourcePath, $method,
$queryParams, $httpBody, $queryParams, $httpBody,
$headerParams, 'map[string,int]' $headerParams, 'map[string,int]'
); );
if (!$response) { if (!$response) {
return null; return array(null, $statusCode, $httpHeader);
} }
return $this->apiClient->getSerializer()->deserialize($response, 'map[string,int]', $httpHeader); return array($this->apiClient->getSerializer()->deserialize($response, 'map[string,int]', $httpHeader));
} catch (ApiException $e) { } catch (ApiException $e) {
switch ($e->getCode()) { switch ($e->getCode()) {
@ -163,7 +178,7 @@ class StoreApi
throw $e; throw $e;
} }
return null; return array(null, $statusCode, $httpHeader);
} }
@ -177,6 +192,22 @@ class StoreApi
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
public function placeOrder ($body=null) public function placeOrder ($body=null)
{
list($response, $statusCode, $httpHeader) = $this->placeOrderWithHttpInfo ($body);
return $response;
}
/**
* placeOrder
*
* Place an order for a pet
*
* @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 placeOrderWithHttpInfo ($body=null)
{ {
@ -214,17 +245,17 @@ class StoreApi
// make the API Call // make the API Call
try try
{ {
list($response, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
$resourcePath, $method, $resourcePath, $method,
$queryParams, $httpBody, $queryParams, $httpBody,
$headerParams, '\Swagger\Client\Model\Order' $headerParams, '\Swagger\Client\Model\Order'
); );
if (!$response) { if (!$response) {
return null; return array(null, $statusCode, $httpHeader);
} }
return $this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\Order', $httpHeader); return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\Order', $httpHeader));
} catch (ApiException $e) { } catch (ApiException $e) {
switch ($e->getCode()) { switch ($e->getCode()) {
@ -237,7 +268,7 @@ class StoreApi
throw $e; throw $e;
} }
return null; return array(null, $statusCode, $httpHeader);
} }
@ -251,6 +282,22 @@ class StoreApi
* @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, $statusCode, $httpHeader) = $this->getOrderByIdWithHttpInfo ($order_id);
return $response;
}
/**
* getOrderById
*
* 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 getOrderByIdWithHttpInfo ($order_id)
{ {
// verify the required parameter 'order_id' is set // verify the required parameter 'order_id' is set
@ -295,17 +342,17 @@ class StoreApi
// make the API Call // make the API Call
try try
{ {
list($response, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
$resourcePath, $method, $resourcePath, $method,
$queryParams, $httpBody, $queryParams, $httpBody,
$headerParams, '\Swagger\Client\Model\Order' $headerParams, '\Swagger\Client\Model\Order'
); );
if (!$response) { if (!$response) {
return null; return array(null, $statusCode, $httpHeader);
} }
return $this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\Order', $httpHeader); return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\Order', $httpHeader));
} catch (ApiException $e) { } catch (ApiException $e) {
switch ($e->getCode()) { switch ($e->getCode()) {
@ -318,7 +365,7 @@ class StoreApi
throw $e; throw $e;
} }
return null; return array(null, $statusCode, $httpHeader);
} }
@ -332,6 +379,22 @@ class StoreApi
* @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, $statusCode, $httpHeader) = $this->deleteOrderWithHttpInfo ($order_id);
return $response;
}
/**
* deleteOrder
*
* Delete purchase order by ID
*
* @param string $order_id ID of the order that needs to be deleted (required)
* @return void
* @throws \Swagger\Client\ApiException on non-2xx response
*/
public function deleteOrderWithHttpInfo ($order_id)
{ {
// verify the required parameter 'order_id' is set // verify the required parameter 'order_id' is set
@ -376,7 +439,7 @@ class StoreApi
// make the API Call // make the API Call
try try
{ {
list($response, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
$resourcePath, $method, $resourcePath, $method,
$queryParams, $httpBody, $queryParams, $httpBody,
$headerParams $headerParams

View File

@ -101,6 +101,22 @@ class UserApi
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
public function createUser ($body=null) public function createUser ($body=null)
{
list($response, $statusCode, $httpHeader) = $this->createUserWithHttpInfo ($body);
return $response;
}
/**
* createUser
*
* Create user
*
* @param \Swagger\Client\Model\User $body Created user object (optional)
* @return void
* @throws \Swagger\Client\ApiException on non-2xx response
*/
public function createUserWithHttpInfo ($body=null)
{ {
@ -138,7 +154,7 @@ class UserApi
// make the API Call // make the API Call
try try
{ {
list($response, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
$resourcePath, $method, $resourcePath, $method,
$queryParams, $httpBody, $queryParams, $httpBody,
$headerParams $headerParams
@ -163,6 +179,22 @@ class UserApi
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
public function createUsersWithArrayInput ($body=null) public function createUsersWithArrayInput ($body=null)
{
list($response, $statusCode, $httpHeader) = $this->createUsersWithArrayInputWithHttpInfo ($body);
return $response;
}
/**
* createUsersWithArrayInput
*
* Creates list of users with given input array
*
* @param \Swagger\Client\Model\User[] $body List of user object (optional)
* @return void
* @throws \Swagger\Client\ApiException on non-2xx response
*/
public function createUsersWithArrayInputWithHttpInfo ($body=null)
{ {
@ -200,7 +232,7 @@ class UserApi
// make the API Call // make the API Call
try try
{ {
list($response, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
$resourcePath, $method, $resourcePath, $method,
$queryParams, $httpBody, $queryParams, $httpBody,
$headerParams $headerParams
@ -225,6 +257,22 @@ class UserApi
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
public function createUsersWithListInput ($body=null) public function createUsersWithListInput ($body=null)
{
list($response, $statusCode, $httpHeader) = $this->createUsersWithListInputWithHttpInfo ($body);
return $response;
}
/**
* createUsersWithListInput
*
* Creates list of users with given input array
*
* @param \Swagger\Client\Model\User[] $body List of user object (optional)
* @return void
* @throws \Swagger\Client\ApiException on non-2xx response
*/
public function createUsersWithListInputWithHttpInfo ($body=null)
{ {
@ -262,7 +310,7 @@ class UserApi
// make the API Call // make the API Call
try try
{ {
list($response, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
$resourcePath, $method, $resourcePath, $method,
$queryParams, $httpBody, $queryParams, $httpBody,
$headerParams $headerParams
@ -288,6 +336,23 @@ class UserApi
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
public function loginUser ($username=null, $password=null) public function loginUser ($username=null, $password=null)
{
list($response, $statusCode, $httpHeader) = $this->loginUserWithHttpInfo ($username, $password);
return $response;
}
/**
* loginUser
*
* Logs user into the system
*
* @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 loginUserWithHttpInfo ($username=null, $password=null)
{ {
@ -327,17 +392,17 @@ class UserApi
// make the API Call // make the API Call
try try
{ {
list($response, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
$resourcePath, $method, $resourcePath, $method,
$queryParams, $httpBody, $queryParams, $httpBody,
$headerParams, 'string' $headerParams, 'string'
); );
if (!$response) { if (!$response) {
return null; return array(null, $statusCode, $httpHeader);
} }
return $this->apiClient->getSerializer()->deserialize($response, 'string', $httpHeader); return array($this->apiClient->getSerializer()->deserialize($response, 'string', $httpHeader));
} catch (ApiException $e) { } catch (ApiException $e) {
switch ($e->getCode()) { switch ($e->getCode()) {
@ -350,7 +415,7 @@ class UserApi
throw $e; throw $e;
} }
return null; return array(null, $statusCode, $httpHeader);
} }
@ -363,6 +428,21 @@ class UserApi
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
public function logoutUser () public function logoutUser ()
{
list($response, $statusCode, $httpHeader) = $this->logoutUserWithHttpInfo ();
return $response;
}
/**
* logoutUser
*
* Logs out current logged in user session
*
* @return void
* @throws \Swagger\Client\ApiException on non-2xx response
*/
public function logoutUserWithHttpInfo ()
{ {
@ -396,7 +476,7 @@ class UserApi
// make the API Call // make the API Call
try try
{ {
list($response, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
$resourcePath, $method, $resourcePath, $method,
$queryParams, $httpBody, $queryParams, $httpBody,
$headerParams $headerParams
@ -421,6 +501,22 @@ class UserApi
* @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, $statusCode, $httpHeader) = $this->getUserByNameWithHttpInfo ($username);
return $response;
}
/**
* getUserByName
*
* Get user by user name
*
* @param string $username The name that needs to be fetched. Use user1 for testing. (required)
* @return \Swagger\Client\Model\User
* @throws \Swagger\Client\ApiException on non-2xx response
*/
public function getUserByNameWithHttpInfo ($username)
{ {
// verify the required parameter 'username' is set // verify the required parameter 'username' is set
@ -465,17 +561,17 @@ class UserApi
// make the API Call // make the API Call
try try
{ {
list($response, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
$resourcePath, $method, $resourcePath, $method,
$queryParams, $httpBody, $queryParams, $httpBody,
$headerParams, '\Swagger\Client\Model\User' $headerParams, '\Swagger\Client\Model\User'
); );
if (!$response) { if (!$response) {
return null; return array(null, $statusCode, $httpHeader);
} }
return $this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\User', $httpHeader); return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\User', $httpHeader));
} catch (ApiException $e) { } catch (ApiException $e) {
switch ($e->getCode()) { switch ($e->getCode()) {
@ -488,7 +584,7 @@ class UserApi
throw $e; throw $e;
} }
return null; return array(null, $statusCode, $httpHeader);
} }
@ -503,6 +599,23 @@ class UserApi
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
public function updateUser ($username, $body=null) public function updateUser ($username, $body=null)
{
list($response, $statusCode, $httpHeader) = $this->updateUserWithHttpInfo ($username, $body);
return $response;
}
/**
* updateUser
*
* Updated user
*
* @param string $username name that need to be deleted (required)
* @param \Swagger\Client\Model\User $body Updated user object (optional)
* @return void
* @throws \Swagger\Client\ApiException on non-2xx response
*/
public function updateUserWithHttpInfo ($username, $body=null)
{ {
// verify the required parameter 'username' is set // verify the required parameter 'username' is set
@ -551,7 +664,7 @@ class UserApi
// make the API Call // make the API Call
try try
{ {
list($response, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
$resourcePath, $method, $resourcePath, $method,
$queryParams, $httpBody, $queryParams, $httpBody,
$headerParams $headerParams
@ -576,6 +689,22 @@ class UserApi
* @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, $statusCode, $httpHeader) = $this->deleteUserWithHttpInfo ($username);
return $response;
}
/**
* deleteUser
*
* Delete user
*
* @param string $username The name that needs to be deleted (required)
* @return void
* @throws \Swagger\Client\ApiException on non-2xx response
*/
public function deleteUserWithHttpInfo ($username)
{ {
// verify the required parameter 'username' is set // verify the required parameter 'username' is set
@ -620,7 +749,7 @@ class UserApi
// make the API Call // make the API Call
try try
{ {
list($response, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
$resourcePath, $method, $resourcePath, $method,
$queryParams, $httpBody, $queryParams, $httpBody,
$headerParams $headerParams

View File

@ -231,7 +231,7 @@ class ApiClient
} else if ($response_info['http_code'] >= 200 && $response_info['http_code'] <= 299 ) { } else if ($response_info['http_code'] >= 200 && $response_info['http_code'] <= 299 ) {
// return raw body if response is a file // return raw body if response is a file
if ($responseType == '\SplFileObject') { if ($responseType == '\SplFileObject') {
return array($http_body, $http_header); return array($http_body, $response_info['http_code'], $http_header);
} }
$data = json_decode($http_body); $data = json_decode($http_body);
@ -249,7 +249,7 @@ class ApiClient
$response_info['http_code'], $http_header, $data $response_info['http_code'], $http_header, $data
); );
} }
return array($data, $http_header); return array($data, $response_info['http_code'], $http_header);
} }
/** /**