fromCode static method
Returns the participation status based on the string code, and throws an exception if no match is found.
Implementation
static ParticipationStatus fromCode(String code) => switch (code) {
('accepted') => ParticipationStatus.accepted,
('declined') => ParticipationStatus.declined,
('tentative') => ParticipationStatus.tentative,
('needs-action') => ParticipationStatus.needsAction,
_ => throw Exception('Unknown ParticipationStatus code $code'),
};