Requires the role: | superadmin |
DELETE | /superadmin/administrators/{Id} | Delete a administrator from your company | If you want to delete a administrator from your company. |
---|
import 'package:servicestack/servicestack.dart';
class CompanyUserResource implements IConvertible
{
/**
* The resource id
*/
// @ApiMember(Description="The resource id")
int? Id;
/**
* The resource name
*/
// @ApiMember(Description="The resource name")
String? Name;
/**
* The resource status
*/
// @ApiMember(Description="The resource status")
bool? Active;
/**
* The resource description
*/
// @ApiMember(Description="The resource description")
String? Description;
/**
* The resource email
*/
// @ApiMember(Description="The resource email")
String? Email;
/**
* The resource phone
*/
// @ApiMember(Description="The resource phone")
String? Phone;
/**
* The resource color
*/
// @ApiMember(Description="The resource color")
String? Color;
/**
* The resource image
*/
// @ApiMember(Description="The resource image")
Uri? ImageUrl;
/**
* If the resource want to receive email notifications
*/
// @ApiMember(Description="If the resource want to receive email notifications")
bool? EmailNotification;
/**
* If the resource want to receive sms notifications
*/
// @ApiMember(Description="If the resource want to receive sms notifications")
bool? SMSNotification;
/**
* If the resource want to receive email reminders
*/
// @ApiMember(Description="If the resource want to receive email reminders")
bool? EmailReminder;
/**
* If the resource want to receive sms reminders
*/
// @ApiMember(Description="If the resource want to receive sms reminders")
bool? SMSReminder;
CompanyUserResource({this.Id,this.Name,this.Active,this.Description,this.Email,this.Phone,this.Color,this.ImageUrl,this.EmailNotification,this.SMSNotification,this.EmailReminder,this.SMSReminder});
CompanyUserResource.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
Name = json['Name'];
Active = json['Active'];
Description = json['Description'];
Email = json['Email'];
Phone = json['Phone'];
Color = json['Color'];
ImageUrl = JsonConverters.fromJson(json['ImageUrl'],'Uri',context!);
EmailNotification = json['EmailNotification'];
SMSNotification = json['SMSNotification'];
EmailReminder = json['EmailReminder'];
SMSReminder = json['SMSReminder'];
return this;
}
Map<String, dynamic> toJson() => {
'Id': Id,
'Name': Name,
'Active': Active,
'Description': Description,
'Email': Email,
'Phone': Phone,
'Color': Color,
'ImageUrl': JsonConverters.toJson(ImageUrl,'Uri',context!),
'EmailNotification': EmailNotification,
'SMSNotification': SMSNotification,
'EmailReminder': EmailReminder,
'SMSReminder': SMSReminder
};
getTypeName() => "CompanyUserResource";
TypeContext? context = _ctx;
}
class CompanyUserRolesQueryResponse implements IConvertible
{
String? RoleId;
String? Name;
String? Description;
CompanyUserRolesQueryResponse({this.RoleId,this.Name,this.Description});
CompanyUserRolesQueryResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
RoleId = json['RoleId'];
Name = json['Name'];
Description = json['Description'];
return this;
}
Map<String, dynamic> toJson() => {
'RoleId': RoleId,
'Name': Name,
'Description': Description
};
getTypeName() => "CompanyUserRolesQueryResponse";
TypeContext? context = _ctx;
}
class CompanyUserQueryResponse implements IConvertible
{
String? Id;
String? CompanyId;
String? Firstname;
String? Lastname;
String? Email;
String? Phone;
String? WorkerId;
int? ResourceId;
/**
* The resource information connected to the administrator.
*/
// @ApiMember(Description="The resource information connected to the administrator.")
CompanyUserResource? Resource;
/**
* The roles that are connected to the administrator.
*/
// @ApiMember(Description="The roles that are connected to the administrator.")
List<CompanyUserRolesQueryResponse>? Roles;
bool? Active;
DateTime? Created;
DateTime? Updated;
CompanyUserQueryResponse({this.Id,this.CompanyId,this.Firstname,this.Lastname,this.Email,this.Phone,this.WorkerId,this.ResourceId,this.Resource,this.Roles,this.Active,this.Created,this.Updated});
CompanyUserQueryResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
CompanyId = json['CompanyId'];
Firstname = json['Firstname'];
Lastname = json['Lastname'];
Email = json['Email'];
Phone = json['Phone'];
WorkerId = json['WorkerId'];
ResourceId = json['ResourceId'];
Resource = JsonConverters.fromJson(json['Resource'],'CompanyUserResource',context!);
Roles = JsonConverters.fromJson(json['Roles'],'List<CompanyUserRolesQueryResponse>',context!);
Active = json['Active'];
Created = JsonConverters.fromJson(json['Created'],'DateTime',context!);
Updated = JsonConverters.fromJson(json['Updated'],'DateTime',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Id': Id,
'CompanyId': CompanyId,
'Firstname': Firstname,
'Lastname': Lastname,
'Email': Email,
'Phone': Phone,
'WorkerId': WorkerId,
'ResourceId': ResourceId,
'Resource': JsonConverters.toJson(Resource,'CompanyUserResource',context!),
'Roles': JsonConverters.toJson(Roles,'List<CompanyUserRolesQueryResponse>',context!),
'Active': Active,
'Created': JsonConverters.toJson(Created,'DateTime',context!),
'Updated': JsonConverters.toJson(Updated,'DateTime',context!)
};
getTypeName() => "CompanyUserQueryResponse";
TypeContext? context = _ctx;
}
// @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 SuperAdminDeleteCompanyUser implements ICompany, IConvertible
{
/**
* Enter the company and id for the application user, if blank company id and you are an admin, your company id will be used.
*/
// @ApiMember(Description="Enter the company and id for the application user, if blank company id and you are an admin, your company id will be used.", ParameterType="query")
String? CompanyId;
/**
* Enter the user id for the administrator.
*/
// @ApiMember(Description="Enter the user id for the administrator.", IsRequired=true, ParameterType="query")
String? Id;
SuperAdminDeleteCompanyUser({this.CompanyId,this.Id});
SuperAdminDeleteCompanyUser.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
CompanyId = json['CompanyId'];
Id = json['Id'];
return this;
}
Map<String, dynamic> toJson() => {
'CompanyId': CompanyId,
'Id': Id
};
getTypeName() => "SuperAdminDeleteCompanyUser";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.bokamera.se', types: <String, TypeInfo> {
'CompanyUserResource': TypeInfo(TypeOf.Class, create:() => CompanyUserResource()),
'Uri': TypeInfo(TypeOf.Class, create:() => Uri()),
'CompanyUserRolesQueryResponse': TypeInfo(TypeOf.Class, create:() => CompanyUserRolesQueryResponse()),
'CompanyUserQueryResponse': TypeInfo(TypeOf.Class, create:() => CompanyUserQueryResponse()),
'List<CompanyUserRolesQueryResponse>': TypeInfo(TypeOf.Class, create:() => <CompanyUserRolesQueryResponse>[]),
'SuperAdminDeleteCompanyUser': TypeInfo(TypeOf.Class, create:() => SuperAdminDeleteCompanyUser()),
});
Dart SuperAdminDeleteCompanyUser DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
DELETE /superadmin/administrators/{Id} HTTP/1.1 Host: api.bokamera.se Accept: text/csv
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"Firstname":"String","Lastname":"String","Email":"String","Phone":"String","WorkerId":"String","ResourceId":0,"Resource":{"Id":0,"Name":"String","Active":false,"Description":"String","Email":"String","Phone":"String","Color":"String","EmailNotification":false,"SMSNotification":false,"EmailReminder":false,"SMSReminder":false},"Roles":[{"Name":"String","Description":"String"}],"Active":false}