patchAppointmentsUpdateAppointment method
- String id,
- DateTime from,
- DateTime to, {
- String title = '',
- String place = '',
- String description = '',
- String owner = '',
- ISODuration? remindBefore,
- 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 edit an appointment
id OID or ~UUID of appointment
from New UTC start date and time of the appointment
to New UTC end date and time of the appointment
title New appointment title
place New appointment location
description New appointment description
owner User name of the appointment owner
remindBefore Relative reminder interval
remindAt Absolute reminder time
wholeDay Whether the appointment spans the whole day
attendeesUserNames DOCUframe user names to invite
attendeesAddresses Address OIDs to invite
attendeesEmails External email addresses to invite
notificationComment Comment included in attendee notifications
notifyAllAttendees Whether all attendees should be notified
isSerial Whether this is a serial appointment
public Whether the appointment is public
extern Whether the appointment is external
type Optional appointment type
occupancy Optional occupancy state
rrule Recurrence rule for serial appointments
Returns: RestApiResponse containing the updated appointment.
Implementation
Future<RestApiResponse> patchAppointmentsUpdateAppointment(
String id,
DateTime from,
DateTime to, {
String title = '',
String place = '',
String description = '',
String owner = '',
ISODuration? remindBefore,
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> body = <String, dynamic>{
'from': from.toISOFormatString(),
'to': to.toISOFormatString(),
'title': title,
'place': place,
'description': description,
'owner': owner,
};
if (remindBefore != null && remindBefore != const ISODuration(year: 0)) {
body['remindBefore'] = remindBefore.toISOFormatString();
}
if (remindAt != null) body['remindAt'] = remindAt.toISOFormatString();
body['wholeDay'] = wholeDay;
final Map<String, dynamic> attendees = _attendees(
attendeesUserNames,
attendeesAddresses,
attendeesEmails,
notificationComment,
notifyAllAttendees,
);
if (attendees.isNotEmpty) body['attendees'] = attendees;
body['isSerial'] = isSerial;
body['public'] = public;
body['extern'] = extern;
if (type != null) body['type'] = type;
if (occupancy != null) body['occupancy'] = occupancy;
if (rrule.isNotEmpty) body['rrule'] = rrule;
return _bodyRequest(
ApiHttpMethod.patch,
'/appointments/$id/updateAppointment',
'patchAppointmentsUpdateAppointment',
body,
);
}