Merge pull request #565 from wing328/php_doc

Update PHP documentation for method
This commit is contained in:
Tony Tam
2015-03-29 08:52:01 -07:00
4 changed files with 376 additions and 397 deletions

View File

@@ -22,26 +22,25 @@
{{#operations}}
class {{classname}} {
function __construct($apiClient) {
$this->apiClient = $apiClient;
}
function __construct($apiClient) {
$this->apiClient = $apiClient;
}
{{#operation}}
/**
* {{{nickname}}}
/**
* {{{nickname}}}
*
* {{{summary}}}
{{#allParams}}* {{paramName}}, {{dataType}}: {{description}} {{^optional}}(required){{/optional}}{{#optional}}(optional){{/optional}}
* {{/allParams}}
* @return {{{returnType}}}
*/
* {{{summary}}}
*
{{#allParams}} * @param {{dataType}} ${{paramName}} {{description}} {{^optional}}(required){{/optional}}{{#optional}}(optional){{/optional}}
{{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}
*/
public function {{nickname}}({{#allParams}}${{paramName}}{{#optional}}=null{{/optional}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) {
// parse inputs
$resourcePath = "{{path}}";
$resourcePath = str_replace("{format}", "json", $resourcePath);
$method = "{{httpMethod}}";
// parse inputs
$resourcePath = "{{path}}";
$resourcePath = str_replace("{format}", "json", $resourcePath);
$method = "{{httpMethod}}";
$queryParams = array();
$headerParams = array();
$formParams = array();
@@ -50,17 +49,17 @@ class {{classname}} {
{{#queryParams}}// query params
if(${{paramName}} !== null) {
$queryParams['{{baseName}}'] = $this->apiClient->toQueryValue(${{paramName}});
}{{/queryParams}}
$queryParams['{{baseName}}'] = $this->apiClient->toQueryValue(${{paramName}});
}{{/queryParams}}
{{#headerParams}}// header params
if(${{paramName}} !== null) {
$headerParams['{{baseName}}'] = $this->apiClient->toHeaderValue(${{paramName}});
}{{/headerParams}}
$headerParams['{{baseName}}'] = $this->apiClient->toHeaderValue(${{paramName}});
}{{/headerParams}}
{{#pathParams}}// path params
if(${{paramName}} !== null) {
$resourcePath = str_replace("{" . "{{baseName}}" . "}",
$this->apiClient->toPathValue(${{paramName}}), $resourcePath);
}{{/pathParams}}
$resourcePath = str_replace("{" . "{{baseName}}" . "}",
$this->apiClient->toPathValue(${{paramName}}), $resourcePath);
}{{/pathParams}}
{{#formParams}}// form params
if (${{paramName}} !== null) {
$formParams['{{baseName}}'] = {{#isFile}}'@' . {{/isFile}}$this->apiClient->toFormValue(${{paramName}});
@@ -78,10 +77,10 @@ class {{classname}} {
$body = http_build_query($body);
}
// make the API Call
$response = $this->apiClient->callAPI($resourcePath, $method,
$queryParams, $body,
$headerParams);
// make the API Call
$response = $this->apiClient->callAPI($resourcePath, $method,
$queryParams, $body,
$headerParams);
{{#returnType}}if(! $response) {
return null;

View File

@@ -21,26 +21,25 @@
*/
class PetApi {
function __construct($apiClient) {
$this->apiClient = $apiClient;
}
function __construct($apiClient) {
$this->apiClient = $apiClient;
}
/**
* updatePet
/**
* updatePet
*
* Update an existing pet
* body, Pet: Pet object that needs to be added to the store (required)
*
* @return
*/
* Update an existing pet
*
* @param Pet $body Pet object that needs to be added to the store (required)
* @return void
*/
public function updatePet($body) {
// parse inputs
$resourcePath = "/pet";
$resourcePath = str_replace("{format}", "json", $resourcePath);
$method = "PUT";
// parse inputs
$resourcePath = "/pet";
$resourcePath = str_replace("{format}", "json", $resourcePath);
$method = "PUT";
$queryParams = array();
$headerParams = array();
$formParams = array();
@@ -64,29 +63,28 @@ class PetApi {
$body = http_build_query($body);
}
// make the API Call
$response = $this->apiClient->callAPI($resourcePath, $method,
$queryParams, $body,
$headerParams);
// make the API Call
$response = $this->apiClient->callAPI($resourcePath, $method,
$queryParams, $body,
$headerParams);
}
/**
* addPet
/**
* addPet
*
* Add a new pet to the store
* body, Pet: Pet object that needs to be added to the store (required)
*
* @return
*/
* Add a new pet to the store
*
* @param Pet $body Pet object that needs to be added to the store (required)
* @return void
*/
public function addPet($body) {
// parse inputs
$resourcePath = "/pet";
$resourcePath = str_replace("{format}", "json", $resourcePath);
$method = "POST";
// parse inputs
$resourcePath = "/pet";
$resourcePath = str_replace("{format}", "json", $resourcePath);
$method = "POST";
$queryParams = array();
$headerParams = array();
$formParams = array();
@@ -110,29 +108,28 @@ class PetApi {
$body = http_build_query($body);
}
// make the API Call
$response = $this->apiClient->callAPI($resourcePath, $method,
$queryParams, $body,
$headerParams);
// make the API Call
$response = $this->apiClient->callAPI($resourcePath, $method,
$queryParams, $body,
$headerParams);
}
/**
* findPetsByStatus
/**
* findPetsByStatus
*
* Finds Pets by status
* status, array[string]: Status values that need to be considered for filter (required)
*
* @return array[Pet]
*/
* Finds Pets by status
*
* @param array[string] $status Status values that need to be considered for filter (required)
* @return array[Pet]
*/
public function findPetsByStatus($status) {
// parse inputs
$resourcePath = "/pet/findByStatus";
$resourcePath = str_replace("{format}", "json", $resourcePath);
$method = "GET";
// parse inputs
$resourcePath = "/pet/findByStatus";
$resourcePath = str_replace("{format}", "json", $resourcePath);
$method = "GET";
$queryParams = array();
$headerParams = array();
$formParams = array();
@@ -141,8 +138,8 @@ class PetApi {
// query params
if($status !== null) {
$queryParams['status'] = $this->apiClient->toQueryValue($status);
}
$queryParams['status'] = $this->apiClient->toQueryValue($status);
}
@@ -155,10 +152,10 @@ class PetApi {
$body = http_build_query($body);
}
// make the API Call
$response = $this->apiClient->callAPI($resourcePath, $method,
$queryParams, $body,
$headerParams);
// make the API Call
$response = $this->apiClient->callAPI($resourcePath, $method,
$queryParams, $body,
$headerParams);
if(! $response) {
return null;
@@ -169,21 +166,20 @@ class PetApi {
return $responseObject;
}
/**
* findPetsByTags
/**
* findPetsByTags
*
* Finds Pets by tags
* tags, array[string]: Tags to filter by (required)
*
* @return array[Pet]
*/
* Finds Pets by tags
*
* @param array[string] $tags Tags to filter by (required)
* @return array[Pet]
*/
public function findPetsByTags($tags) {
// parse inputs
$resourcePath = "/pet/findByTags";
$resourcePath = str_replace("{format}", "json", $resourcePath);
$method = "GET";
// parse inputs
$resourcePath = "/pet/findByTags";
$resourcePath = str_replace("{format}", "json", $resourcePath);
$method = "GET";
$queryParams = array();
$headerParams = array();
$formParams = array();
@@ -192,8 +188,8 @@ class PetApi {
// query params
if($tags !== null) {
$queryParams['tags'] = $this->apiClient->toQueryValue($tags);
}
$queryParams['tags'] = $this->apiClient->toQueryValue($tags);
}
@@ -206,10 +202,10 @@ class PetApi {
$body = http_build_query($body);
}
// make the API Call
$response = $this->apiClient->callAPI($resourcePath, $method,
$queryParams, $body,
$headerParams);
// make the API Call
$response = $this->apiClient->callAPI($resourcePath, $method,
$queryParams, $body,
$headerParams);
if(! $response) {
return null;
@@ -220,21 +216,20 @@ class PetApi {
return $responseObject;
}
/**
* getPetById
/**
* getPetById
*
* Find pet by ID
* pet_id, int: ID of pet that needs to be fetched (required)
*
* @return Pet
*/
* Find pet by ID
*
* @param int $pet_id ID of pet that needs to be fetched (required)
* @return Pet
*/
public function getPetById($pet_id) {
// parse inputs
$resourcePath = "/pet/{petId}";
$resourcePath = str_replace("{format}", "json", $resourcePath);
$method = "GET";
// parse inputs
$resourcePath = "/pet/{petId}";
$resourcePath = str_replace("{format}", "json", $resourcePath);
$method = "GET";
$queryParams = array();
$headerParams = array();
$formParams = array();
@@ -245,9 +240,9 @@ class PetApi {
// path params
if($pet_id !== null) {
$resourcePath = str_replace("{" . "petId" . "}",
$this->apiClient->toPathValue($pet_id), $resourcePath);
}
$resourcePath = str_replace("{" . "petId" . "}",
$this->apiClient->toPathValue($pet_id), $resourcePath);
}
@@ -258,10 +253,10 @@ class PetApi {
$body = http_build_query($body);
}
// make the API Call
$response = $this->apiClient->callAPI($resourcePath, $method,
$queryParams, $body,
$headerParams);
// make the API Call
$response = $this->apiClient->callAPI($resourcePath, $method,
$queryParams, $body,
$headerParams);
if(! $response) {
return null;
@@ -272,23 +267,22 @@ class PetApi {
return $responseObject;
}
/**
* updatePetWithForm
/**
* updatePetWithForm
*
* Updates a pet in the store with form data
* pet_id, string: ID of pet that needs to be updated (required)
* * name, string: Updated name of the pet (required)
* * status, string: Updated status of the pet (required)
*
* @return
*/
* 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)
* @return void
*/
public function updatePetWithForm($pet_id, $name, $status) {
// parse inputs
$resourcePath = "/pet/{petId}";
$resourcePath = str_replace("{format}", "json", $resourcePath);
$method = "POST";
// parse inputs
$resourcePath = "/pet/{petId}";
$resourcePath = str_replace("{format}", "json", $resourcePath);
$method = "POST";
$queryParams = array();
$headerParams = array();
$formParams = array();
@@ -299,9 +293,9 @@ class PetApi {
// path params
if($pet_id !== null) {
$resourcePath = str_replace("{" . "petId" . "}",
$this->apiClient->toPathValue($pet_id), $resourcePath);
}
$resourcePath = str_replace("{" . "petId" . "}",
$this->apiClient->toPathValue($pet_id), $resourcePath);
}
// form params
if ($name !== null) {
$formParams['name'] = $this->apiClient->toFormValue($name);
@@ -318,30 +312,29 @@ class PetApi {
$body = http_build_query($body);
}
// make the API Call
$response = $this->apiClient->callAPI($resourcePath, $method,
$queryParams, $body,
$headerParams);
// make the API Call
$response = $this->apiClient->callAPI($resourcePath, $method,
$queryParams, $body,
$headerParams);
}
/**
* deletePet
/**
* deletePet
*
* Deletes a pet
* api_key, string: (required)
* * pet_id, int: Pet id to delete (required)
*
* @return
*/
* Deletes a pet
*
* @param string $api_key (required)
* @param int $pet_id Pet id to delete (required)
* @return void
*/
public function deletePet($api_key, $pet_id) {
// parse inputs
$resourcePath = "/pet/{petId}";
$resourcePath = str_replace("{format}", "json", $resourcePath);
$method = "DELETE";
// parse inputs
$resourcePath = "/pet/{petId}";
$resourcePath = str_replace("{format}", "json", $resourcePath);
$method = "DELETE";
$queryParams = array();
$headerParams = array();
$formParams = array();
@@ -351,13 +344,13 @@ class PetApi {
// header params
if($api_key !== null) {
$headerParams['api_key'] = $this->apiClient->toHeaderValue($api_key);
}
$headerParams['api_key'] = $this->apiClient->toHeaderValue($api_key);
}
// path params
if($pet_id !== null) {
$resourcePath = str_replace("{" . "petId" . "}",
$this->apiClient->toPathValue($pet_id), $resourcePath);
}
$resourcePath = str_replace("{" . "petId" . "}",
$this->apiClient->toPathValue($pet_id), $resourcePath);
}
@@ -368,31 +361,30 @@ class PetApi {
$body = http_build_query($body);
}
// make the API Call
$response = $this->apiClient->callAPI($resourcePath, $method,
$queryParams, $body,
$headerParams);
// make the API Call
$response = $this->apiClient->callAPI($resourcePath, $method,
$queryParams, $body,
$headerParams);
}
/**
* uploadFile
/**
* uploadFile
*
* uploads an image
* pet_id, int: ID of pet to update (required)
* * additional_metadata, string: Additional data to pass to server (required)
* * file, file: file to upload (required)
*
* @return
*/
* 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 file $file file to upload (required)
* @return void
*/
public function uploadFile($pet_id, $additional_metadata, $file) {
// parse inputs
$resourcePath = "/pet/{petId}/uploadImage";
$resourcePath = str_replace("{format}", "json", $resourcePath);
$method = "POST";
// parse inputs
$resourcePath = "/pet/{petId}/uploadImage";
$resourcePath = str_replace("{format}", "json", $resourcePath);
$method = "POST";
$queryParams = array();
$headerParams = array();
$formParams = array();
@@ -403,9 +395,9 @@ class PetApi {
// path params
if($pet_id !== null) {
$resourcePath = str_replace("{" . "petId" . "}",
$this->apiClient->toPathValue($pet_id), $resourcePath);
}
$resourcePath = str_replace("{" . "petId" . "}",
$this->apiClient->toPathValue($pet_id), $resourcePath);
}
// form params
if ($additional_metadata !== null) {
$formParams['additionalMetadata'] = $this->apiClient->toFormValue($additional_metadata);
@@ -422,10 +414,10 @@ class PetApi {
$body = http_build_query($body);
}
// make the API Call
$response = $this->apiClient->callAPI($resourcePath, $method,
$queryParams, $body,
$headerParams);
// make the API Call
$response = $this->apiClient->callAPI($resourcePath, $method,
$queryParams, $body,
$headerParams);
}

View File

@@ -21,25 +21,24 @@
*/
class StoreApi {
function __construct($apiClient) {
$this->apiClient = $apiClient;
}
function __construct($apiClient) {
$this->apiClient = $apiClient;
}
/**
* getInventory
/**
* getInventory
*
* Returns pet inventories by status
* @return map[string,int]
*/
* Returns pet inventories by status
*
* @return map[string,int]
*/
public function getInventory() {
// parse inputs
$resourcePath = "/store/inventory";
$resourcePath = str_replace("{format}", "json", $resourcePath);
$method = "GET";
// parse inputs
$resourcePath = "/store/inventory";
$resourcePath = str_replace("{format}", "json", $resourcePath);
$method = "GET";
$queryParams = array();
$headerParams = array();
$formParams = array();
@@ -59,10 +58,10 @@ class StoreApi {
$body = http_build_query($body);
}
// make the API Call
$response = $this->apiClient->callAPI($resourcePath, $method,
$queryParams, $body,
$headerParams);
// make the API Call
$response = $this->apiClient->callAPI($resourcePath, $method,
$queryParams, $body,
$headerParams);
if(! $response) {
return null;
@@ -73,21 +72,20 @@ class StoreApi {
return $responseObject;
}
/**
* placeOrder
/**
* placeOrder
*
* Place an order for a pet
* body, Order: order placed for purchasing the pet (required)
*
* @return Order
*/
* Place an order for a pet
*
* @param Order $body order placed for purchasing the pet (required)
* @return Order
*/
public function placeOrder($body) {
// parse inputs
$resourcePath = "/store/order";
$resourcePath = str_replace("{format}", "json", $resourcePath);
$method = "POST";
// parse inputs
$resourcePath = "/store/order";
$resourcePath = str_replace("{format}", "json", $resourcePath);
$method = "POST";
$queryParams = array();
$headerParams = array();
$formParams = array();
@@ -111,10 +109,10 @@ class StoreApi {
$body = http_build_query($body);
}
// make the API Call
$response = $this->apiClient->callAPI($resourcePath, $method,
$queryParams, $body,
$headerParams);
// make the API Call
$response = $this->apiClient->callAPI($resourcePath, $method,
$queryParams, $body,
$headerParams);
if(! $response) {
return null;
@@ -125,21 +123,20 @@ class StoreApi {
return $responseObject;
}
/**
* getOrderById
/**
* getOrderById
*
* Find purchase order by ID
* order_id, string: ID of pet that needs to be fetched (required)
*
* @return Order
*/
* Find purchase order by ID
*
* @param string $order_id ID of pet that needs to be fetched (required)
* @return Order
*/
public function getOrderById($order_id) {
// parse inputs
$resourcePath = "/store/order/{orderId}";
$resourcePath = str_replace("{format}", "json", $resourcePath);
$method = "GET";
// parse inputs
$resourcePath = "/store/order/{orderId}";
$resourcePath = str_replace("{format}", "json", $resourcePath);
$method = "GET";
$queryParams = array();
$headerParams = array();
$formParams = array();
@@ -150,9 +147,9 @@ class StoreApi {
// path params
if($order_id !== null) {
$resourcePath = str_replace("{" . "orderId" . "}",
$this->apiClient->toPathValue($order_id), $resourcePath);
}
$resourcePath = str_replace("{" . "orderId" . "}",
$this->apiClient->toPathValue($order_id), $resourcePath);
}
@@ -163,10 +160,10 @@ class StoreApi {
$body = http_build_query($body);
}
// make the API Call
$response = $this->apiClient->callAPI($resourcePath, $method,
$queryParams, $body,
$headerParams);
// make the API Call
$response = $this->apiClient->callAPI($resourcePath, $method,
$queryParams, $body,
$headerParams);
if(! $response) {
return null;
@@ -177,21 +174,20 @@ class StoreApi {
return $responseObject;
}
/**
* deleteOrder
/**
* deleteOrder
*
* Delete purchase order by ID
* order_id, string: ID of the order that needs to be deleted (required)
*
* @return
*/
* Delete purchase order by ID
*
* @param string $order_id ID of the order that needs to be deleted (required)
* @return void
*/
public function deleteOrder($order_id) {
// parse inputs
$resourcePath = "/store/order/{orderId}";
$resourcePath = str_replace("{format}", "json", $resourcePath);
$method = "DELETE";
// parse inputs
$resourcePath = "/store/order/{orderId}";
$resourcePath = str_replace("{format}", "json", $resourcePath);
$method = "DELETE";
$queryParams = array();
$headerParams = array();
$formParams = array();
@@ -202,9 +198,9 @@ class StoreApi {
// path params
if($order_id !== null) {
$resourcePath = str_replace("{" . "orderId" . "}",
$this->apiClient->toPathValue($order_id), $resourcePath);
}
$resourcePath = str_replace("{" . "orderId" . "}",
$this->apiClient->toPathValue($order_id), $resourcePath);
}
@@ -215,10 +211,10 @@ class StoreApi {
$body = http_build_query($body);
}
// make the API Call
$response = $this->apiClient->callAPI($resourcePath, $method,
$queryParams, $body,
$headerParams);
// make the API Call
$response = $this->apiClient->callAPI($resourcePath, $method,
$queryParams, $body,
$headerParams);
}

View File

@@ -21,26 +21,25 @@
*/
class UserApi {
function __construct($apiClient) {
$this->apiClient = $apiClient;
}
function __construct($apiClient) {
$this->apiClient = $apiClient;
}
/**
* createUser
/**
* createUser
*
* Create user
* body, User: Created user object (required)
*
* @return
*/
* Create user
*
* @param User $body Created user object (required)
* @return void
*/
public function createUser($body) {
// parse inputs
$resourcePath = "/user";
$resourcePath = str_replace("{format}", "json", $resourcePath);
$method = "POST";
// parse inputs
$resourcePath = "/user";
$resourcePath = str_replace("{format}", "json", $resourcePath);
$method = "POST";
$queryParams = array();
$headerParams = array();
$formParams = array();
@@ -64,29 +63,28 @@ class UserApi {
$body = http_build_query($body);
}
// make the API Call
$response = $this->apiClient->callAPI($resourcePath, $method,
$queryParams, $body,
$headerParams);
// make the API Call
$response = $this->apiClient->callAPI($resourcePath, $method,
$queryParams, $body,
$headerParams);
}
/**
* createUsersWithArrayInput
/**
* createUsersWithArrayInput
*
* Creates list of users with given input array
* body, array[User]: List of user object (required)
*
* @return
*/
* Creates list of users with given input array
*
* @param array[User] $body List of user object (required)
* @return void
*/
public function createUsersWithArrayInput($body) {
// parse inputs
$resourcePath = "/user/createWithArray";
$resourcePath = str_replace("{format}", "json", $resourcePath);
$method = "POST";
// parse inputs
$resourcePath = "/user/createWithArray";
$resourcePath = str_replace("{format}", "json", $resourcePath);
$method = "POST";
$queryParams = array();
$headerParams = array();
$formParams = array();
@@ -110,29 +108,28 @@ class UserApi {
$body = http_build_query($body);
}
// make the API Call
$response = $this->apiClient->callAPI($resourcePath, $method,
$queryParams, $body,
$headerParams);
// make the API Call
$response = $this->apiClient->callAPI($resourcePath, $method,
$queryParams, $body,
$headerParams);
}
/**
* createUsersWithListInput
/**
* createUsersWithListInput
*
* Creates list of users with given input array
* body, array[User]: List of user object (required)
*
* @return
*/
* Creates list of users with given input array
*
* @param array[User] $body List of user object (required)
* @return void
*/
public function createUsersWithListInput($body) {
// parse inputs
$resourcePath = "/user/createWithList";
$resourcePath = str_replace("{format}", "json", $resourcePath);
$method = "POST";
// parse inputs
$resourcePath = "/user/createWithList";
$resourcePath = str_replace("{format}", "json", $resourcePath);
$method = "POST";
$queryParams = array();
$headerParams = array();
$formParams = array();
@@ -156,30 +153,29 @@ class UserApi {
$body = http_build_query($body);
}
// make the API Call
$response = $this->apiClient->callAPI($resourcePath, $method,
$queryParams, $body,
$headerParams);
// make the API Call
$response = $this->apiClient->callAPI($resourcePath, $method,
$queryParams, $body,
$headerParams);
}
/**
* loginUser
/**
* loginUser
*
* Logs user into the system
* username, string: The user name for login (required)
* * password, string: The password for login in clear text (required)
*
* @return string
*/
* Logs user into the system
*
* @param string $username The user name for login (required)
* @param string $password The password for login in clear text (required)
* @return string
*/
public function loginUser($username, $password) {
// parse inputs
$resourcePath = "/user/login";
$resourcePath = str_replace("{format}", "json", $resourcePath);
$method = "GET";
// parse inputs
$resourcePath = "/user/login";
$resourcePath = str_replace("{format}", "json", $resourcePath);
$method = "GET";
$queryParams = array();
$headerParams = array();
$formParams = array();
@@ -188,11 +184,11 @@ class UserApi {
// query params
if($username !== null) {
$queryParams['username'] = $this->apiClient->toQueryValue($username);
}// query params
$queryParams['username'] = $this->apiClient->toQueryValue($username);
}// query params
if($password !== null) {
$queryParams['password'] = $this->apiClient->toQueryValue($password);
}
$queryParams['password'] = $this->apiClient->toQueryValue($password);
}
@@ -205,10 +201,10 @@ class UserApi {
$body = http_build_query($body);
}
// make the API Call
$response = $this->apiClient->callAPI($resourcePath, $method,
$queryParams, $body,
$headerParams);
// make the API Call
$response = $this->apiClient->callAPI($resourcePath, $method,
$queryParams, $body,
$headerParams);
if(! $response) {
return null;
@@ -219,20 +215,19 @@ class UserApi {
return $responseObject;
}
/**
* logoutUser
/**
* logoutUser
*
* Logs out current logged in user session
* @return
*/
* Logs out current logged in user session
*
* @return void
*/
public function logoutUser() {
// parse inputs
$resourcePath = "/user/logout";
$resourcePath = str_replace("{format}", "json", $resourcePath);
$method = "GET";
// parse inputs
$resourcePath = "/user/logout";
$resourcePath = str_replace("{format}", "json", $resourcePath);
$method = "GET";
$queryParams = array();
$headerParams = array();
$formParams = array();
@@ -252,29 +247,28 @@ class UserApi {
$body = http_build_query($body);
}
// make the API Call
$response = $this->apiClient->callAPI($resourcePath, $method,
$queryParams, $body,
$headerParams);
// make the API Call
$response = $this->apiClient->callAPI($resourcePath, $method,
$queryParams, $body,
$headerParams);
}
/**
* getUserByName
/**
* getUserByName
*
* Get user by user name
* username, string: The name that needs to be fetched. Use user1 for testing. (required)
*
* @return User
*/
* Get user by user name
*
* @param string $username The name that needs to be fetched. Use user1 for testing. (required)
* @return User
*/
public function getUserByName($username) {
// parse inputs
$resourcePath = "/user/{username}";
$resourcePath = str_replace("{format}", "json", $resourcePath);
$method = "GET";
// parse inputs
$resourcePath = "/user/{username}";
$resourcePath = str_replace("{format}", "json", $resourcePath);
$method = "GET";
$queryParams = array();
$headerParams = array();
$formParams = array();
@@ -285,9 +279,9 @@ class UserApi {
// path params
if($username !== null) {
$resourcePath = str_replace("{" . "username" . "}",
$this->apiClient->toPathValue($username), $resourcePath);
}
$resourcePath = str_replace("{" . "username" . "}",
$this->apiClient->toPathValue($username), $resourcePath);
}
@@ -298,10 +292,10 @@ class UserApi {
$body = http_build_query($body);
}
// make the API Call
$response = $this->apiClient->callAPI($resourcePath, $method,
$queryParams, $body,
$headerParams);
// make the API Call
$response = $this->apiClient->callAPI($resourcePath, $method,
$queryParams, $body,
$headerParams);
if(! $response) {
return null;
@@ -312,22 +306,21 @@ class UserApi {
return $responseObject;
}
/**
* updateUser
/**
* updateUser
*
* Updated user
* username, string: name that need to be deleted (required)
* * body, User: Updated user object (required)
*
* @return
*/
* Updated user
*
* @param string $username name that need to be deleted (required)
* @param User $body Updated user object (required)
* @return void
*/
public function updateUser($username, $body) {
// parse inputs
$resourcePath = "/user/{username}";
$resourcePath = str_replace("{format}", "json", $resourcePath);
$method = "PUT";
// parse inputs
$resourcePath = "/user/{username}";
$resourcePath = str_replace("{format}", "json", $resourcePath);
$method = "PUT";
$queryParams = array();
$headerParams = array();
$formParams = array();
@@ -338,9 +331,9 @@ class UserApi {
// path params
if($username !== null) {
$resourcePath = str_replace("{" . "username" . "}",
$this->apiClient->toPathValue($username), $resourcePath);
}
$resourcePath = str_replace("{" . "username" . "}",
$this->apiClient->toPathValue($username), $resourcePath);
}
// body params
$body = null;
@@ -355,29 +348,28 @@ class UserApi {
$body = http_build_query($body);
}
// make the API Call
$response = $this->apiClient->callAPI($resourcePath, $method,
$queryParams, $body,
$headerParams);
// make the API Call
$response = $this->apiClient->callAPI($resourcePath, $method,
$queryParams, $body,
$headerParams);
}
/**
* deleteUser
/**
* deleteUser
*
* Delete user
* username, string: The name that needs to be deleted (required)
*
* @return
*/
* Delete user
*
* @param string $username The name that needs to be deleted (required)
* @return void
*/
public function deleteUser($username) {
// parse inputs
$resourcePath = "/user/{username}";
$resourcePath = str_replace("{format}", "json", $resourcePath);
$method = "DELETE";
// parse inputs
$resourcePath = "/user/{username}";
$resourcePath = str_replace("{format}", "json", $resourcePath);
$method = "DELETE";
$queryParams = array();
$headerParams = array();
$formParams = array();
@@ -388,9 +380,9 @@ class UserApi {
// path params
if($username !== null) {
$resourcePath = str_replace("{" . "username" . "}",
$this->apiClient->toPathValue($username), $resourcePath);
}
$resourcePath = str_replace("{" . "username" . "}",
$this->apiClient->toPathValue($username), $resourcePath);
}
@@ -401,10 +393,10 @@ class UserApi {
$body = http_build_query($body);
}
// make the API Call
$response = $this->apiClient->callAPI($resourcePath, $method,
$queryParams, $body,
$headerParams);
// make the API Call
$response = $this->apiClient->callAPI($resourcePath, $method,
$queryParams, $body,
$headerParams);
}