7.2 KiB
SwagUserApi
All URIs are relative to http://petstore.swagger.io/v2
Method | HTTP request | Description |
---|---|---|
createUser | POST /user | Create user |
createUsersWithArrayInput | POST /user/createWithArray | Creates list of users with given input array |
createUsersWithListInput | POST /user/createWithList | Creates list of users with given input array |
deleteUser | DELETE /user/{username} | Delete user |
getUserByName | GET /user/{username} | Get user by user name |
loginUser | GET /user/login | Logs user into the system |
logoutUser | GET /user/logout | Logs out current logged in user session |
updateUser | PUT /user/{username} | Updated user |
createUser
createUser(swagUser)
Create user
This can only be done by the logged in user.
Example
SwagUserApi api = new SwagUserApi();
Map<String, Object> params = new Map<String, Object>{
'swagUser' => SwagUser.getExample()
};
try {
// cross your fingers
api.createUser(params);
} catch (Swagger.ApiException e) {
// ...handle your exceptions
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
swagUser | SwagUser | Created user object |
Return type
null (empty response body)
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: Not defined
createUsersWithArrayInput
createUsersWithArrayInput(swagUser)
Creates list of users with given input array
Example
SwagUserApi api = new SwagUserApi();
Map<String, Object> params = new Map<String, Object>{
'swagUser' => new List<SwagUser>{SwagUser.getExample()}
};
try {
// cross your fingers
api.createUsersWithArrayInput(params);
} catch (Swagger.ApiException e) {
// ...handle your exceptions
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
swagUser | List<SwagUser> | List of user object |
Return type
null (empty response body)
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: Not defined
createUsersWithListInput
createUsersWithListInput(swagUser)
Creates list of users with given input array
Example
SwagUserApi api = new SwagUserApi();
Map<String, Object> params = new Map<String, Object>{
'swagUser' => new List<SwagUser>{SwagUser.getExample()}
};
try {
// cross your fingers
api.createUsersWithListInput(params);
} catch (Swagger.ApiException e) {
// ...handle your exceptions
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
swagUser | List<SwagUser> | List of user object |
Return type
null (empty response body)
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: Not defined
deleteUser
deleteUser(username)
Delete user
This can only be done by the logged in user.
Example
SwagUserApi api = new SwagUserApi();
Map<String, Object> params = new Map<String, Object>{
'username' => 'username_example'
};
try {
// cross your fingers
api.deleteUser(params);
} catch (Swagger.ApiException e) {
// ...handle your exceptions
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
username | String | The name that needs to be deleted |
Return type
null (empty response body)
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: Not defined
getUserByName
SwagUser getUserByName(username)
Get user by user name
Example
SwagUserApi api = new SwagUserApi();
Map<String, Object> params = new Map<String, Object>{
'username' => 'username_example'
};
try {
// cross your fingers
SwagUser result = api.getUserByName(params);
System.debug(result);
} catch (Swagger.ApiException e) {
// ...handle your exceptions
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
username | String | The name that needs to be fetched. Use user1 for testing. |
Return type
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: application/xml, application/json
loginUser
String loginUser(username, password)
Logs user into the system
Example
SwagUserApi api = new SwagUserApi();
Map<String, Object> params = new Map<String, Object>{
'username' => 'username_example',
'password' => 'password_example'
};
try {
// cross your fingers
String result = api.loginUser(params);
System.debug(result);
} catch (Swagger.ApiException e) {
// ...handle your exceptions
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
username | String | The user name for login | |
password | String | The password for login in clear text |
Return type
String
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: application/xml, application/json
logoutUser
logoutUser()
Logs out current logged in user session
Example
SwagUserApi api = new SwagUserApi();
try {
// cross your fingers
api.logoutUser();
} catch (Swagger.ApiException e) {
// ...handle your exceptions
}
Parameters
This endpoint does not need any parameter.
Return type
null (empty response body)
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: Not defined
updateUser
updateUser(username, swagUser)
Updated user
This can only be done by the logged in user.
Example
SwagUserApi api = new SwagUserApi();
Map<String, Object> params = new Map<String, Object>{
'username' => 'username_example',
'swagUser' => SwagUser.getExample()
};
try {
// cross your fingers
api.updateUser(params);
} catch (Swagger.ApiException e) {
// ...handle your exceptions
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
username | String | name that need to be deleted | |
swagUser | SwagUser | Updated user object |
Return type
null (empty response body)
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: Not defined