patchAppointmentsUpdateAppointment method

Future<RestApiResponse> patchAppointmentsUpdateAppointment(
  1. String id,
  2. DateTime from,
  3. DateTime to, {
  4. String title = '',
  5. String place = '',
  6. String description = '',
  7. String owner = '',
  8. ISODuration? remindBefore,
  9. DateTime? remindAt,
  10. bool wholeDay = false,
  11. bool group = false,
  12. List<String>? attendeesUserNames,
  13. List<String>? attendeesAddresses,
  14. List<String>? attendeesEmails,
  15. String notificationComment = '',
  16. bool notifyAllAttendees = false,
  17. bool isSerial = false,
  18. bool public = false,
  19. bool extern = false,
  20. int? type,
  21. int? occupancy,
  22. 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,
  );
}