DELETE | /users | Deletes a user | Deletes the logged in user account. |
---|
import 'package:servicestack/servicestack.dart';
class UserProfileResponse implements IConvertible
{
String? Id;
String? Firstname;
String? Lastname;
String? Phone;
String? Email;
UserProfileResponse({this.Id,this.Firstname,this.Lastname,this.Phone,this.Email});
UserProfileResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
Firstname = json['Firstname'];
Lastname = json['Lastname'];
Phone = json['Phone'];
Email = json['Email'];
return this;
}
Map<String, dynamic> toJson() => {
'Id': Id,
'Firstname': Firstname,
'Lastname': Lastname,
'Phone': Phone,
'Email': Email
};
getTypeName() => "UserProfileResponse";
TypeContext? context = _ctx;
}
class AdminProfile implements IConvertible
{
String? CompanyId;
String? Id;
String? Firstname;
String? Lastname;
String? Email;
String? WorkerId;
String? Phone;
AdminProfile({this.CompanyId,this.Id,this.Firstname,this.Lastname,this.Email,this.WorkerId,this.Phone});
AdminProfile.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
CompanyId = json['CompanyId'];
Id = json['Id'];
Firstname = json['Firstname'];
Lastname = json['Lastname'];
Email = json['Email'];
WorkerId = json['WorkerId'];
Phone = json['Phone'];
return this;
}
Map<String, dynamic> toJson() => {
'CompanyId': CompanyId,
'Id': Id,
'Firstname': Firstname,
'Lastname': Lastname,
'Email': Email,
'WorkerId': WorkerId,
'Phone': Phone
};
getTypeName() => "AdminProfile";
TypeContext? context = _ctx;
}
class DeleteUserResponse implements IConvertible
{
dynamic? ResponseStatus;
/**
* The user id for your profile.
*/
// @ApiMember(Description="The user id for your profile.", IsRequired=true)
String? UserName;
UserProfileResponse? UserProfile;
AdminProfile? AdminProfile;
DeleteUserResponse({this.ResponseStatus,this.UserName,this.UserProfile,this.AdminProfile});
DeleteUserResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'dynamic',context!);
UserName = json['UserName'];
UserProfile = JsonConverters.fromJson(json['UserProfile'],'UserProfileResponse',context!);
AdminProfile = JsonConverters.fromJson(json['AdminProfile'],'AdminProfile',context!);
return this;
}
Map<String, dynamic> toJson() => {
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'dynamic',context!),
'UserName': UserName,
'UserProfile': JsonConverters.toJson(UserProfile,'UserProfileResponse',context!),
'AdminProfile': JsonConverters.toJson(AdminProfile,'AdminProfile',context!)
};
getTypeName() => "DeleteUserResponse";
TypeContext? context = _ctx;
}
enum KeyCloakRealm
{
BookMore,
BookMoreAdmin,
SuperAdmin,
}
// @ApiResponse(Description="Returned if there is a validation error on the input parameters", StatusCode=400)
// @ApiResponse(Description="Returned if the current user is not allowed to perform the action", StatusCode=401)
class DeleteUser implements IConvertible
{
/**
* The user name of your profile.
*/
// @ApiMember(Description="The user name of your profile.", IsRequired=true)
String? UserName;
/**
* The user realm for identity server. BookMore = 1, BookMoreAdmin = 2
*/
// @ApiMember(Description="The user realm for identity server. BookMore = 1, BookMoreAdmin = 2 ", IsRequired=true)
KeyCloakRealm? Realm;
/**
* If this equals true it will force delete all customer profiles on all company on there you have booked a time.
*/
// @ApiMember(Description="If this equals true it will force delete all customer profiles on all company on there you have booked a time.")
bool? DeleteCustomerProfiles;
/**
* If this equals true it will check the request token value and try to delete user, if it is false it will send a delete confirmation email.
*/
// @ApiMember(Description="If this equals true it will check the request token value and try to delete user, if it is false it will send a delete confirmation email.")
bool? ForceDelete;
/**
* The value is only checked when ForceDelete is set to true. Contains the token value what was sent to email.
*/
// @ApiMember(Description="The value is only checked when ForceDelete is set to true. Contains the token value what was sent to email.")
String? Token;
DeleteUser({this.UserName,this.Realm,this.DeleteCustomerProfiles,this.ForceDelete,this.Token});
DeleteUser.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
UserName = json['UserName'];
Realm = JsonConverters.fromJson(json['Realm'],'KeyCloakRealm',context!);
DeleteCustomerProfiles = json['DeleteCustomerProfiles'];
ForceDelete = json['ForceDelete'];
Token = json['Token'];
return this;
}
Map<String, dynamic> toJson() => {
'UserName': UserName,
'Realm': JsonConverters.toJson(Realm,'KeyCloakRealm',context!),
'DeleteCustomerProfiles': DeleteCustomerProfiles,
'ForceDelete': ForceDelete,
'Token': Token
};
getTypeName() => "DeleteUser";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.bokamera.se', types: <String, TypeInfo> {
'UserProfileResponse': TypeInfo(TypeOf.Class, create:() => UserProfileResponse()),
'AdminProfile': TypeInfo(TypeOf.Class, create:() => AdminProfile()),
'DeleteUserResponse': TypeInfo(TypeOf.Class, create:() => DeleteUserResponse()),
'KeyCloakRealm': TypeInfo(TypeOf.Enum, enumValues:KeyCloakRealm.values),
'DeleteUser': TypeInfo(TypeOf.Class, create:() => DeleteUser()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
DELETE /users HTTP/1.1 Host: api.bokamera.se Accept: application/json
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"ResponseStatus":{},"UserName":"String","UserProfile":{"Firstname":"String","Lastname":"String","Phone":"String","Email":"String"},"AdminProfile":{"Firstname":"String","Lastname":"String","Email":"String","WorkerId":"String","Phone":"String"}}