Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
DELETE | /timeexceptions/{Id} | Delete a given time exception that the user have access too |
---|
import 'package:servicestack/servicestack.dart';
class TimeExceptionReosurceDetails implements IConvertible
{
/**
* Ids of the resources that owns this exception
*/
// @ApiMember(Description="Ids of the resources that owns this exception")
int? Id;
/**
* Name of the resource
*/
// @ApiMember(Description="Name of the resource")
String? Name;
/**
* Description of the resource
*/
// @ApiMember(Description="Description of the resource")
String? Description;
/**
* Color of the resource
*/
// @ApiMember(Description="Color of the resource")
String? Color;
/**
* Image of the resource
*/
// @ApiMember(Description="Image of the resource")
Uri? ImageUrl;
ResponseStatus? ResponseStatus;
TimeExceptionReosurceDetails({this.Id,this.Name,this.Description,this.Color,this.ImageUrl,this.ResponseStatus});
TimeExceptionReosurceDetails.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
Name = json['Name'];
Description = json['Description'];
Color = json['Color'];
ImageUrl = JsonConverters.fromJson(json['ImageUrl'],'Uri',context!);
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Id': Id,
'Name': Name,
'Description': Description,
'Color': Color,
'ImageUrl': JsonConverters.toJson(ImageUrl,'Uri',context!),
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
};
getTypeName() => "TimeExceptionReosurceDetails";
TypeContext? context = _ctx;
}
class ExceptionCalendarExportStatus implements IConvertible
{
String? CalendarId;
int? ExceptionId;
bool? Synced;
ExceptionCalendarExportStatus({this.CalendarId,this.ExceptionId,this.Synced});
ExceptionCalendarExportStatus.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
CalendarId = json['CalendarId'];
ExceptionId = json['ExceptionId'];
Synced = json['Synced'];
return this;
}
Map<String, dynamic> toJson() => {
'CalendarId': CalendarId,
'ExceptionId': ExceptionId,
'Synced': Synced
};
getTypeName() => "ExceptionCalendarExportStatus";
TypeContext? context = _ctx;
}
class DayOfWeekDto implements IConvertible
{
int? DayOfWeekId;
int? DotNetDayOfWeekId;
String? DayOfWeek;
DayOfWeekDto({this.DayOfWeekId,this.DotNetDayOfWeekId,this.DayOfWeek});
DayOfWeekDto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
DayOfWeekId = json['DayOfWeekId'];
DotNetDayOfWeekId = json['DotNetDayOfWeekId'];
DayOfWeek = json['DayOfWeek'];
return this;
}
Map<String, dynamic> toJson() => {
'DayOfWeekId': DayOfWeekId,
'DotNetDayOfWeekId': DotNetDayOfWeekId,
'DayOfWeek': DayOfWeek
};
getTypeName() => "DayOfWeekDto";
TypeContext? context = _ctx;
}
class ResourceTimeExceptionQueryResponse implements IConvertible
{
/**
* Time exception id
*/
// @ApiMember(Description="Time exception id")
int? Id;
/**
* Time company id
*/
// @ApiMember(Description="Time company id")
String? CompanyId;
/**
* If it's locked for editing for the logged in administrator
*/
// @ApiMember(Description="If it's locked for editing for the logged in administrator")
bool? Locked;
/**
* Resources that owns this exception
*/
// @ApiMember(Description="Resources that owns this exception")
List<int>? ResourceIds;
/**
* Resources that owns this exception
*/
// @ApiMember(Description="Resources that owns this exception")
List<TimeExceptionReosurceDetails>? Resources;
/**
* Indicates wheter or not the time exception is recurring
*/
// @ApiMember(Description="Indicates wheter or not the time exception is recurring")
bool? IsRecurring;
/**
* Time exception starting timestamp
*/
// @ApiMember(Description="Time exception starting timestamp")
DateTime? From;
/**
* Time exception ending timestamp
*/
// @ApiMember(Description="Time exception ending timestamp")
DateTime? To;
/**
* If recurring then this value indicates the time of day when the time exception begins
*/
// @ApiMember(Description="If recurring then this value indicates the time of day when the time exception begins")
Duration? FromTime;
/**
* If recurring then this value indicates the time of day when the time exception ends
*/
// @ApiMember(Description="If recurring then this value indicates the time of day when the time exception ends")
Duration? ToTime;
/**
* The reason of the time exception, example: Vacation, doctors appointment, ...
*/
// @ApiMember(Description="The reason of the time exception, example: Vacation, doctors appointment, ...")
String? ReasonText;
/**
* The reason of the time exception that could be public to customers, example: Vacation, Closed, Sick leave, ...
*/
// @ApiMember(Description="The reason of the time exception that could be public to customers, example: Vacation, Closed, Sick leave, ...")
String? ReasonTextPublic;
/**
* What hexadecimal color code the exception should have in the scheduler
*/
// @ApiMember(Description="What hexadecimal color code the exception should have in the scheduler")
String? Color;
/**
* If the time exception should block the time in the scheduler so it's not avaialable to book
*/
// @ApiMember(Description="If the time exception should block the time in the scheduler so it's not avaialable to book")
bool? BlockTime;
/**
* If the ReasonText should only be visible to conncted resources. If false, all resources will be able to see it
*/
// @ApiMember(Description="If the ReasonText should only be visible to conncted resources. If false, all resources will be able to see it")
bool? Private;
/**
* The status for export to calendars like Gcal
*/
// @ApiMember(Description="The status for export to calendars like Gcal")
ExceptionCalendarExportStatus? CalendarExportStatus;
/**
* If recurring, an array indicating which days of the week the exception recures on where 1 = Monday .. 7 = Sunday. When recurring then the time portion of the Fields From and To indicates the time of day the recurrence occurs
*/
// @ApiMember(Description="If recurring, an array indicating which days of the week the exception recures on where 1 = Monday .. 7 = Sunday. When recurring then the time portion of the Fields From and To indicates the time of day the recurrence occurs")
List<DayOfWeekDto>? DaysOfWeek;
/**
* The datetime the exception was created
*/
// @ApiMember(Description="The datetime the exception was created")
DateTime? Created;
ResponseStatus? ResponseStatus;
ResourceTimeExceptionQueryResponse({this.Id,this.CompanyId,this.Locked,this.ResourceIds,this.Resources,this.IsRecurring,this.From,this.To,this.FromTime,this.ToTime,this.ReasonText,this.ReasonTextPublic,this.Color,this.BlockTime,this.Private,this.CalendarExportStatus,this.DaysOfWeek,this.Created,this.ResponseStatus});
ResourceTimeExceptionQueryResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
CompanyId = json['CompanyId'];
Locked = json['Locked'];
ResourceIds = JsonConverters.fromJson(json['ResourceIds'],'List<int>',context!);
Resources = JsonConverters.fromJson(json['Resources'],'List<TimeExceptionReosurceDetails>',context!);
IsRecurring = json['IsRecurring'];
From = JsonConverters.fromJson(json['From'],'DateTime',context!);
To = JsonConverters.fromJson(json['To'],'DateTime',context!);
FromTime = JsonConverters.fromJson(json['FromTime'],'Duration',context!);
ToTime = JsonConverters.fromJson(json['ToTime'],'Duration',context!);
ReasonText = json['ReasonText'];
ReasonTextPublic = json['ReasonTextPublic'];
Color = json['Color'];
BlockTime = json['BlockTime'];
Private = json['Private'];
CalendarExportStatus = JsonConverters.fromJson(json['CalendarExportStatus'],'ExceptionCalendarExportStatus',context!);
DaysOfWeek = JsonConverters.fromJson(json['DaysOfWeek'],'List<DayOfWeekDto>',context!);
Created = JsonConverters.fromJson(json['Created'],'DateTime',context!);
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Id': Id,
'CompanyId': CompanyId,
'Locked': Locked,
'ResourceIds': JsonConverters.toJson(ResourceIds,'List<int>',context!),
'Resources': JsonConverters.toJson(Resources,'List<TimeExceptionReosurceDetails>',context!),
'IsRecurring': IsRecurring,
'From': JsonConverters.toJson(From,'DateTime',context!),
'To': JsonConverters.toJson(To,'DateTime',context!),
'FromTime': JsonConverters.toJson(FromTime,'Duration',context!),
'ToTime': JsonConverters.toJson(ToTime,'Duration',context!),
'ReasonText': ReasonText,
'ReasonTextPublic': ReasonTextPublic,
'Color': Color,
'BlockTime': BlockTime,
'Private': Private,
'CalendarExportStatus': JsonConverters.toJson(CalendarExportStatus,'ExceptionCalendarExportStatus',context!),
'DaysOfWeek': JsonConverters.toJson(DaysOfWeek,'List<DayOfWeekDto>',context!),
'Created': JsonConverters.toJson(Created,'DateTime',context!),
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
};
getTypeName() => "ResourceTimeExceptionQueryResponse";
TypeContext? context = _ctx;
}
// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
// @ApiResponse(Description="You have too low privilegies to call this service", StatusCode=403)
// @ValidateRequest(Validator="IsAuthenticated")
class DeleteResourceTimeException 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;
/**
* Time exception id to be deleted
*/
// @ApiMember(Description="Time exception id to be deleted")
int? Id;
DeleteResourceTimeException({this.CompanyId,this.Id});
DeleteResourceTimeException.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() => "DeleteResourceTimeException";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.bokamera.se', types: <String, TypeInfo> {
'TimeExceptionReosurceDetails': TypeInfo(TypeOf.Class, create:() => TimeExceptionReosurceDetails()),
'Uri': TypeInfo(TypeOf.Class, create:() => Uri()),
'ExceptionCalendarExportStatus': TypeInfo(TypeOf.Class, create:() => ExceptionCalendarExportStatus()),
'DayOfWeekDto': TypeInfo(TypeOf.Class, create:() => DayOfWeekDto()),
'ResourceTimeExceptionQueryResponse': TypeInfo(TypeOf.Class, create:() => ResourceTimeExceptionQueryResponse()),
'List<TimeExceptionReosurceDetails>': TypeInfo(TypeOf.Class, create:() => <TimeExceptionReosurceDetails>[]),
'List<DayOfWeekDto>': TypeInfo(TypeOf.Class, create:() => <DayOfWeekDto>[]),
'DeleteResourceTimeException': TypeInfo(TypeOf.Class, create:() => DeleteResourceTimeException()),
});
Dart DeleteResourceTimeException 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 /timeexceptions/{Id} HTTP/1.1 Host: api.bokamera.se Accept: text/csv
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"Id":0,"Locked":false,"ResourceIds":[0],"Resources":[{"Id":0,"Name":"String","Description":"String","Color":"String","ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}],"IsRecurring":false,"FromTime":"00:00:00","ToTime":"00:00:00","ReasonText":"String","ReasonTextPublic":"String","Color":"String","BlockTime":false,"Private":false,"CalendarExportStatus":{"CalendarId":"String","ExceptionId":0,"Synced":false},"DaysOfWeek":[{"DayOfWeekId":0,"DotNetDayOfWeekId":0,"DayOfWeek":"String"}],"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}