patchAppointmentsCreateException method
Future<RestApiResponse>
patchAppointmentsCreateException(
- String id,
- DateTime exceptionFrom,
- DateTime from,
- DateTime to, {
- String title = '',
- String place = '',
- String description = '',
- String owner = '',
- ISODuration remindBefore = const ISODuration(year: 0),
- DateTime? remindAt,
- bool wholeDay = false,
- bool group = false,
- List<
String> ? attendeesUserNames, - List<
String> ? attendeesAddresses, - List<
String> ? attendeesEmails, - String notificationComment = '',
- bool notifyAllAttendees = false,
- bool isSerial = false,
- bool public = false,
- bool extern = false,
- int? type,
- int? occupancy,
- String rrule = '',
This request allows to create Termin series exception
id OID or ~UUID of the Termin series appointment
exceptionFrom start date of the appointment
optional fields: new appointment data
Implementation
Future<RestApiResponse> patchAppointmentsCreateException(
String id,
DateTime exceptionFrom,
DateTime from,
DateTime to, {
String title = '',
String place = '',
String description = '',
String owner = '',
ISODuration remindBefore = const ISODuration(year: 0),
DateTime? remindAt,
bool wholeDay = false,
bool group = false,
List<String>? attendeesUserNames,
List<String>? attendeesAddresses,
List<String>? attendeesEmails,
String notificationComment = '',
bool notifyAllAttendees = false,
bool isSerial = false,
bool public = false,
bool extern = false,
int? type,
int? occupancy,
String rrule = '',
}) {
final Map<String, dynamic> exceptionBody = <String, dynamic>{
'from': from.toISOFormatString(),
'to': to.toISOFormatString(),
};
if (title.isNotEmpty) exceptionBody['title'] = title;
if (place.isNotEmpty) exceptionBody['place'] = place;
if (description.isNotEmpty) exceptionBody['description'] = description;
if (owner.isNotEmpty) exceptionBody['owner'] = owner;
if (remindBefore != const ISODuration(year: 0)) {
exceptionBody['remindBefore'] = remindBefore.toISOFormatString();
}
if (remindAt != null) {
exceptionBody['remindAt'] = remindAt.toISOFormatString();
}
if (wholeDay) exceptionBody['wholeDay'] = wholeDay;
if (group) {
// Bewusste Legacy-Parität: Das alte API schreibt hier wholeDay.
exceptionBody['group'] = wholeDay;
}
final Map<String, dynamic> attendees = _attendees(
attendeesUserNames,
attendeesAddresses,
attendeesEmails,
notificationComment,
notifyAllAttendees,
);
if (attendees.isNotEmpty) exceptionBody['attendees'] = attendees;
if (isSerial) exceptionBody['isSerial'] = isSerial;
exceptionBody['public'] = public;
exceptionBody['extern'] = extern;
if (type != null) exceptionBody['type'] = type;
if (occupancy != null) exceptionBody['occupancy'] = occupancy;
if (rrule.isNotEmpty) exceptionBody['rrule'] = rrule;
return _bodyRequest(
ApiHttpMethod.patch,
'/appointments/$id/createException',
'patchAppointmentsCreateException',
<String, dynamic>{
'exceptionFrom': exceptionFrom.toISOFormatString(),
'exceptionBody': exceptionBody,
},
);
}