PageRenderTime 51ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/samples/client/petstore/php/SwaggerClient-php/docs/UserApi.md

https://gitlab.com/akkhil2012/swagger-codegen
Markdown | 374 lines | 245 code | 129 blank | 0 comment | 0 complexity | 0a416733ba76e1f4d44a79961ea2c0ab MD5 | raw file
  1. # Swagger\Client\UserApi
  2. All URIs are relative to *http://petstore.swagger.io/v2*
  3. Method | HTTP request | Description
  4. ------------- | ------------- | -------------
  5. [**createUser**](UserApi.md#createUser) | **POST** /user | Create user
  6. [**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array
  7. [**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array
  8. [**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user
  9. [**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name
  10. [**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system
  11. [**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session
  12. [**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user
  13. # **createUser**
  14. > createUser($body)
  15. Create user
  16. This can only be done by the logged in user.
  17. ### Example
  18. ```php
  19. <?php
  20. require_once(__DIR__ . '/vendor/autoload.php');
  21. $api_instance = new Swagger\Client\Api\UserApi();
  22. $body = new \Swagger\Client\Model\User(); // \Swagger\Client\Model\User | Created user object
  23. try {
  24. $api_instance->createUser($body);
  25. } catch (Exception $e) {
  26. echo 'Exception when calling UserApi->createUser: ', $e->getMessage(), "\n";
  27. }
  28. ?>
  29. ```
  30. ### Parameters
  31. Name | Type | Description | Notes
  32. ------------- | ------------- | ------------- | -------------
  33. **body** | [**\Swagger\Client\Model\User**](\Swagger\Client\Model\User.md)| Created user object | [optional]
  34. ### Return type
  35. void (empty response body)
  36. ### Authorization
  37. No authorization required
  38. ### HTTP reuqest headers
  39. - **Content-Type**: Not defined
  40. - **Accept**: application/json, application/xml
  41. [[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)
  42. # **createUsersWithArrayInput**
  43. > createUsersWithArrayInput($body)
  44. Creates list of users with given input array
  45. ### Example
  46. ```php
  47. <?php
  48. require_once(__DIR__ . '/vendor/autoload.php');
  49. $api_instance = new Swagger\Client\Api\UserApi();
  50. $body = array(new User()); // \Swagger\Client\Model\User[] | List of user object
  51. try {
  52. $api_instance->createUsersWithArrayInput($body);
  53. } catch (Exception $e) {
  54. echo 'Exception when calling UserApi->createUsersWithArrayInput: ', $e->getMessage(), "\n";
  55. }
  56. ?>
  57. ```
  58. ### Parameters
  59. Name | Type | Description | Notes
  60. ------------- | ------------- | ------------- | -------------
  61. **body** | [**\Swagger\Client\Model\User[]**](User.md)| List of user object | [optional]
  62. ### Return type
  63. void (empty response body)
  64. ### Authorization
  65. No authorization required
  66. ### HTTP reuqest headers
  67. - **Content-Type**: Not defined
  68. - **Accept**: application/json, application/xml
  69. [[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)
  70. # **createUsersWithListInput**
  71. > createUsersWithListInput($body)
  72. Creates list of users with given input array
  73. ### Example
  74. ```php
  75. <?php
  76. require_once(__DIR__ . '/vendor/autoload.php');
  77. $api_instance = new Swagger\Client\Api\UserApi();
  78. $body = array(new User()); // \Swagger\Client\Model\User[] | List of user object
  79. try {
  80. $api_instance->createUsersWithListInput($body);
  81. } catch (Exception $e) {
  82. echo 'Exception when calling UserApi->createUsersWithListInput: ', $e->getMessage(), "\n";
  83. }
  84. ?>
  85. ```
  86. ### Parameters
  87. Name | Type | Description | Notes
  88. ------------- | ------------- | ------------- | -------------
  89. **body** | [**\Swagger\Client\Model\User[]**](User.md)| List of user object | [optional]
  90. ### Return type
  91. void (empty response body)
  92. ### Authorization
  93. No authorization required
  94. ### HTTP reuqest headers
  95. - **Content-Type**: Not defined
  96. - **Accept**: application/json, application/xml
  97. [[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)
  98. # **deleteUser**
  99. > deleteUser($username)
  100. Delete user
  101. This can only be done by the logged in user.
  102. ### Example
  103. ```php
  104. <?php
  105. require_once(__DIR__ . '/vendor/autoload.php');
  106. // Configure HTTP basic authorization: test_http_basic
  107. Swagger\Client\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
  108. Swagger\Client\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');
  109. $api_instance = new Swagger\Client\Api\UserApi();
  110. $username = "username_example"; // string | The name that needs to be deleted
  111. try {
  112. $api_instance->deleteUser($username);
  113. } catch (Exception $e) {
  114. echo 'Exception when calling UserApi->deleteUser: ', $e->getMessage(), "\n";
  115. }
  116. ?>
  117. ```
  118. ### Parameters
  119. Name | Type | Description | Notes
  120. ------------- | ------------- | ------------- | -------------
  121. **username** | **string**| The name that needs to be deleted |
  122. ### Return type
  123. void (empty response body)
  124. ### Authorization
  125. [test_http_basic](../README.md#test_http_basic)
  126. ### HTTP reuqest headers
  127. - **Content-Type**: Not defined
  128. - **Accept**: application/json, application/xml
  129. [[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)
  130. # **getUserByName**
  131. > \Swagger\Client\Model\User getUserByName($username)
  132. Get user by user name
  133. ### Example
  134. ```php
  135. <?php
  136. require_once(__DIR__ . '/vendor/autoload.php');
  137. $api_instance = new Swagger\Client\Api\UserApi();
  138. $username = "username_example"; // string | The name that needs to be fetched. Use user1 for testing.
  139. try {
  140. $result = $api_instance->getUserByName($username);
  141. print_r($result);
  142. } catch (Exception $e) {
  143. echo 'Exception when calling UserApi->getUserByName: ', $e->getMessage(), "\n";
  144. }
  145. ?>
  146. ```
  147. ### Parameters
  148. Name | Type | Description | Notes
  149. ------------- | ------------- | ------------- | -------------
  150. **username** | **string**| The name that needs to be fetched. Use user1 for testing. |
  151. ### Return type
  152. [**\Swagger\Client\Model\User**](User.md)
  153. ### Authorization
  154. No authorization required
  155. ### HTTP reuqest headers
  156. - **Content-Type**: Not defined
  157. - **Accept**: application/json, application/xml
  158. [[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)
  159. # **loginUser**
  160. > string loginUser($username, $password)
  161. Logs user into the system
  162. ### Example
  163. ```php
  164. <?php
  165. require_once(__DIR__ . '/vendor/autoload.php');
  166. $api_instance = new Swagger\Client\Api\UserApi();
  167. $username = "username_example"; // string | The user name for login
  168. $password = "password_example"; // string | The password for login in clear text
  169. try {
  170. $result = $api_instance->loginUser($username, $password);
  171. print_r($result);
  172. } catch (Exception $e) {
  173. echo 'Exception when calling UserApi->loginUser: ', $e->getMessage(), "\n";
  174. }
  175. ?>
  176. ```
  177. ### Parameters
  178. Name | Type | Description | Notes
  179. ------------- | ------------- | ------------- | -------------
  180. **username** | **string**| The user name for login | [optional]
  181. **password** | **string**| The password for login in clear text | [optional]
  182. ### Return type
  183. **string**
  184. ### Authorization
  185. No authorization required
  186. ### HTTP reuqest headers
  187. - **Content-Type**: Not defined
  188. - **Accept**: application/json, application/xml
  189. [[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)
  190. # **logoutUser**
  191. > logoutUser()
  192. Logs out current logged in user session
  193. ### Example
  194. ```php
  195. <?php
  196. require_once(__DIR__ . '/vendor/autoload.php');
  197. $api_instance = new Swagger\Client\Api\UserApi();
  198. try {
  199. $api_instance->logoutUser();
  200. } catch (Exception $e) {
  201. echo 'Exception when calling UserApi->logoutUser: ', $e->getMessage(), "\n";
  202. }
  203. ?>
  204. ```
  205. ### Parameters
  206. This endpoint does not need any parameter.
  207. ### Return type
  208. void (empty response body)
  209. ### Authorization
  210. No authorization required
  211. ### HTTP reuqest headers
  212. - **Content-Type**: Not defined
  213. - **Accept**: application/json, application/xml
  214. [[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)
  215. # **updateUser**
  216. > updateUser($username, $body)
  217. Updated user
  218. This can only be done by the logged in user.
  219. ### Example
  220. ```php
  221. <?php
  222. require_once(__DIR__ . '/vendor/autoload.php');
  223. $api_instance = new Swagger\Client\Api\UserApi();
  224. $username = "username_example"; // string | name that need to be deleted
  225. $body = new \Swagger\Client\Model\User(); // \Swagger\Client\Model\User | Updated user object
  226. try {
  227. $api_instance->updateUser($username, $body);
  228. } catch (Exception $e) {
  229. echo 'Exception when calling UserApi->updateUser: ', $e->getMessage(), "\n";
  230. }
  231. ?>
  232. ```
  233. ### Parameters
  234. Name | Type | Description | Notes
  235. ------------- | ------------- | ------------- | -------------
  236. **username** | **string**| name that need to be deleted |
  237. **body** | [**\Swagger\Client\Model\User**](\Swagger\Client\Model\User.md)| Updated user object | [optional]
  238. ### Return type
  239. void (empty response body)
  240. ### Authorization
  241. No authorization required
  242. ### HTTP reuqest headers
  243. - **Content-Type**: Not defined
  244. - **Accept**: application/json, application/xml
  245. [[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)