Method CreateAsync
- Namespace
- MailFathom.Application.Calendar
- Assembly
- MailFathom.Application.dll
CreateAsync(string?, DateTimeOffset, DateTimeOffset?, bool, IReadOnlyCollection<int>, StoredEmailId?, CancellationToken)
Puts an event the person states on their own calendar.
public Task<CalendarEventWriteResult> CreateAsync(string? title, DateTimeOffset start, DateTimeOffset? end, bool isAllDay, IReadOnlyCollection<int> reminders, StoredEmailId? sourceMessage, CancellationToken cancellationToken)
Parameters
titlestringWhat the event is called, as supplied.
startDateTimeOffsetWhen it begins.
endDateTimeOffset?When it ends, or null to state no end.
isAllDayboolWhether the event is stated as a day rather than as a clock time.
remindersIReadOnlyCollection<int>The leads to announce it at, as stated in minutes before it, or empty to announce nothing.
sourceMessageStoredEmailId?The message it was created from, or null where none was open.
cancellationTokenCancellationTokenPropagates caller cancellation.
Returns
- Task<CalendarEventWriteResult>
The event as the calendar holds it, or why it was refused.
Remarks
What is written is asserted by construction, because a person typing into their own client is putting an event on their calendar. Nothing here creates a proposal: those are read out of mail, and an event created from an open thread cites the message while being every bit as much the person's own.
Exceptions
- PrincipalNotAuthorizedException
Thrown when the caller acts for no person, or its grant omits CalendarWrite.