Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
DELETE | /resourcetypes/{Id}/removeresource | Remove resource(s) from resourcetype | Remove resource(s) from resourcetype for the currently logged in user, only administrators are allowed to remove resources to resourcetypes. |
---|
import 'package:servicestack/servicestack.dart';
class ResourceTypeResource 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;
/**
* The priority of the resource
*/
// @ApiMember(Description="The priority of the resource")
int? Priority;
/**
* 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;
ResourceTypeResource({this.Id,this.Name,this.Active,this.Description,this.Email,this.Phone,this.Color,this.ImageUrl,this.Priority,this.EmailNotification,this.SMSNotification,this.EmailReminder,this.SMSReminder});
ResourceTypeResource.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!);
Priority = json['Priority'];
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!),
'Priority': Priority,
'EmailNotification': EmailNotification,
'SMSNotification': SMSNotification,
'EmailReminder': EmailReminder,
'SMSReminder': SMSReminder
};
getTypeName() => "ResourceTypeResource";
TypeContext? context = _ctx;
}
class ResourceTypeQueryResponse implements IConvertible
{
/**
* The resourcetype id
*/
// @ApiMember(Description="The resourcetype id")
int? Id;
/**
* The resourcetype name
*/
// @ApiMember(Description="The resourcetype name")
String? Name;
/**
* The resourcetype description
*/
// @ApiMember(Description="The resourcetype description")
String? Description;
/**
* The resources in the resourcetype. Only shows active resources if not admin.
*/
// @ApiMember(Description="The resources in the resourcetype. Only shows active resources if not admin.")
List<ResourceTypeResource>? Resources;
/**
* If resourcetype is active or not
*/
// @ApiMember(Description="If resourcetype is active or not")
bool? Active;
/**
* Then date when the resource was created
*/
// @ApiMember(Description="Then date when the resource was created")
DateTime? Created;
/**
* Then date when the resource was updated
*/
// @ApiMember(Description="Then date when the resource was updated")
DateTime? Updated;
ResourceTypeQueryResponse({this.Id,this.Name,this.Description,this.Resources,this.Active,this.Created,this.Updated});
ResourceTypeQueryResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
Name = json['Name'];
Description = json['Description'];
Resources = JsonConverters.fromJson(json['Resources'],'List<ResourceTypeResource>',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,
'Name': Name,
'Description': Description,
'Resources': JsonConverters.toJson(Resources,'List<ResourceTypeResource>',context!),
'Active': Active,
'Created': JsonConverters.toJson(Created,'DateTime',context!),
'Updated': JsonConverters.toJson(Updated,'DateTime',context!)
};
getTypeName() => "ResourceTypeQueryResponse";
TypeContext? context = _ctx;
}
class RemoveResourceTypeResource implements IConvertible
{
/**
* The resource id
*/
// @ApiMember(Description="The resource id")
int? Id;
RemoveResourceTypeResource({this.Id});
RemoveResourceTypeResource.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
return this;
}
Map<String, dynamic> toJson() => {
'Id': Id
};
getTypeName() => "RemoveResourceTypeResource";
TypeContext? context = _ctx;
}
// @ValidateRequest(Validator="IsAuthenticated")
class RemoveResource implements ICompany, IConvertible
{
/**
* The company id, if empty will use the company id for the user you are logged in with.
*/
// @ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.")
String? CompanyId;
/**
* The ResourceType id
*/
// @ApiMember(Description="The ResourceType id", IsRequired=true, ParameterType="path")
int? Id;
/**
* The resources to be removed
*/
// @ApiMember(Description="The resources to be removed")
List<RemoveResourceTypeResource>? Resources;
RemoveResource({this.CompanyId,this.Id,this.Resources});
RemoveResource.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
CompanyId = json['CompanyId'];
Id = json['Id'];
Resources = JsonConverters.fromJson(json['Resources'],'List<RemoveResourceTypeResource>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'CompanyId': CompanyId,
'Id': Id,
'Resources': JsonConverters.toJson(Resources,'List<RemoveResourceTypeResource>',context!)
};
getTypeName() => "RemoveResource";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.bokamera.se', types: <String, TypeInfo> {
'ResourceTypeResource': TypeInfo(TypeOf.Class, create:() => ResourceTypeResource()),
'Uri': TypeInfo(TypeOf.Class, create:() => Uri()),
'ResourceTypeQueryResponse': TypeInfo(TypeOf.Class, create:() => ResourceTypeQueryResponse()),
'List<ResourceTypeResource>': TypeInfo(TypeOf.Class, create:() => <ResourceTypeResource>[]),
'RemoveResourceTypeResource': TypeInfo(TypeOf.Class, create:() => RemoveResourceTypeResource()),
'RemoveResource': TypeInfo(TypeOf.Class, create:() => RemoveResource()),
'List<RemoveResourceTypeResource>': TypeInfo(TypeOf.Class, create:() => <RemoveResourceTypeResource>[]),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
DELETE /resourcetypes/{Id}/removeresource HTTP/1.1 Host: api.bokamera.se Accept: text/jsv
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { Id: 0, Name: String, Description: String, Resources: [ { Id: 0, Name: String, Active: False, Description: String, Email: String, Phone: String, Color: String, Priority: 0, EmailNotification: False, SMSNotification: False, EmailReminder: False, SMSReminder: False } ], Active: False }