toJson method

Map<String, dynamic> toJson()

Converts this Calendar object to a JSON object.

Each parameter of Calendar corresponds to a key in the resulting JSON object. The 'allowedOnlineMeetingProviders' key maps to a list of strings. The 'owner' key maps to a JSON object obtained from the CalendarOwner object.

Implementation

Map<String, dynamic> toJson() {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = id;
  data['name'] = name;
  data['color'] = color;
  data['isDefaultCalendar'] = isDefaultCalendar;
  data['changeKey'] = changeKey;
  data['canShare'] = canShare;
  data['canViewPrivateItems'] = canViewPrivateItems;
  data['hexColor'] = hexColor;
  data['canEdit'] = canEdit;
  data['allowedOnlineMeetingProviders'] = allowedOnlineMeetingProviders;
  data['defaultOnlineMeetingProvider'] = defaultOnlineMeetingProvider;
  data['isTallyingResponses'] = isTallyingResponses;
  data['isRemovable'] = isRemovable;
  data['owner'] = owner.toJson();
  return data;
}